crti.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (C) 2016 Andes Technology, Inc.
  3. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  4. */
  5. .pic
  6. #APP
  7. .section .init
  8. .align 2
  9. .globl _init
  10. .type _init, @function
  11. _init:
  12. .LFB28:
  13. ! Generate instructions for ABI: 1
  14. ! pretend args size: 0, auto vars size: 0, pushed regs size: 12, outgoing args size: 24
  15. ! Generate instructions for ABI: 2
  16. ! pretend args size: 0, auto vars size: 0, pushed regs size: 12, outgoing args size: 0
  17. ! frame pointer: $fp, needed: yes
  18. ! $fp $gp $lp
  19. ! prologue
  20. .off_16bit
  21. smw.adm $sp,[$sp],$sp,#0x8
  22. smw.adm $sp,[$sp],$sp,#0x6
  23. .restore_16bit
  24. #ifdef __NDS32_N1213_43U1H__
  25. sethi $gp, hi20(_GLOBAL_OFFSET_TABLE_+8)
  26. ori $gp, $gp, lo12(_GLOBAL_OFFSET_TABLE_+12)
  27. #else
  28. sethi $gp, hi20(_GLOBAL_OFFSET_TABLE_-8)
  29. ori $gp, $gp, lo12(_GLOBAL_OFFSET_TABLE_-4)
  30. mfusr $ta, $pc
  31. #endif
  32. add $gp, $ta, $gp
  33. #if defined(NDS32_ABI_2) || defined(NDS32_ABI_2FP)
  34. addi $sp, $sp, -4
  35. addi $fp, $sp, 8
  36. #else
  37. addi $sp, $sp, -28
  38. addi $fp, $sp, 32
  39. #endif
  40. ! end of prologue
  41. #APP
  42. .align 2
  43. .section .fini
  44. .align 2
  45. .globl _fini
  46. .type _fini, @function
  47. _fini:
  48. .LFB29:
  49. ! Generate instructions for ABI: 1
  50. ! pretend args size: 0, auto vars size: 0, pushed regs size: 12, outgoing args size: 24
  51. ! Generate instructions for ABI: 2
  52. ! pretend args size: 0, auto vars size: 0, pushed regs size: 12, outgoing args size: 0
  53. ! frame pointer: $fp, needed: yes
  54. ! $fp $gp $lp
  55. ! prologue
  56. .off_16bit
  57. smw.adm $sp,[$sp],$sp,#0x8
  58. smw.adm $sp,[$sp],$sp,#0x6
  59. .restore_16bit
  60. #ifdef __NDS32_N1213_43U1H__
  61. sethi $gp, hi20(_GLOBAL_OFFSET_TABLE_+8)
  62. ori $gp, $gp, lo12(_GLOBAL_OFFSET_TABLE_+12)
  63. #else
  64. sethi $gp, hi20(_GLOBAL_OFFSET_TABLE_-8)
  65. ori $gp, $gp, lo12(_GLOBAL_OFFSET_TABLE_-4)
  66. mfusr $ta, $pc
  67. #endif
  68. add $gp, $ta, $gp
  69. #if defined(NDS32_ABI_2) || defined(NDS32_ABI_2FP)
  70. addi $sp, $sp, -4
  71. addi $fp, $sp, 8
  72. #else
  73. addi $sp, $sp, -28
  74. addi $fp, $sp, 32
  75. #endif
  76. ! end of prologue
  77. #APP
  78. .align 2
  79. .ident "GCC: (GNU) 3.4.4"