crt_arch.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifdef __SH_FDPIC__
  2. __asm__(
  3. ".text \n"
  4. ".global " START " \n"
  5. START ": \n"
  6. " tst r8, r8 \n"
  7. " bf 1f \n"
  8. " mov #68, r3 \n"
  9. " add r3, r3 \n"
  10. " mov #8, r4 \n"
  11. " swap.w r4, r4 \n"
  12. " trapa #31 \n"
  13. " nop \n"
  14. " nop \n"
  15. " nop \n"
  16. " nop \n"
  17. "1: nop \n"
  18. #ifndef SHARED
  19. " mov r8, r4 \n"
  20. " mova 1f, r0 \n"
  21. " mov.l 1f, r5 \n"
  22. " mov.l 1f+4, r6 \n"
  23. " add r0, r5 \n"
  24. " mov.l 4f, r1 \n"
  25. "5: bsrf r1 \n"
  26. " add r0, r6 \n"
  27. " mov r0, r12 \n"
  28. #endif
  29. " mov r10, r5 \n"
  30. " mov r15, r4 \n"
  31. " mov.l r9, @-r15 \n"
  32. " mov.l r8, @-r15 \n"
  33. " mov #-16, r0 \n"
  34. " mov.l 2f, r1 \n"
  35. "3: bsrf r1 \n"
  36. " and r0, r15 \n"
  37. ".align 2 \n"
  38. "1: .long __ROFIXUP_LIST__@PCREL \n"
  39. " .long __ROFIXUP_END__@PCREL + 4 \n"
  40. "2: .long " START "_c@PCREL - (3b+4-.) \n"
  41. #ifndef SHARED
  42. "4: .long __fdpic_fixup@PCREL - (5b+4-.) \n"
  43. #endif
  44. );
  45. #ifndef SHARED
  46. #include "fdpic_crt.h"
  47. #endif
  48. #else
  49. __asm__(
  50. ".text \n"
  51. ".global " START " \n"
  52. START ": \n"
  53. " mova 1f, r0 \n"
  54. " mov.l 1f, r5 \n"
  55. " add r0, r5 \n"
  56. " mov r15, r4 \n"
  57. " mov #-16, r0 \n"
  58. " mov.l 2f, r1 \n"
  59. "3: bsrf r1 \n"
  60. " and r0, r15 \n"
  61. ".align 2 \n"
  62. ".weak _DYNAMIC \n"
  63. ".hidden _DYNAMIC \n"
  64. "1: .long _DYNAMIC-. \n"
  65. "2: .long " START "_c@PCREL - (3b+4-.) \n"
  66. );
  67. #endif
  68. /* used by gcc for switching the FPU between single and double precision */
  69. #ifdef SHARED
  70. __attribute__((__visibility__("hidden")))
  71. #endif
  72. const unsigned long __fpscr_values[2] = { 0, 0x80000 };