rm48x50.ld 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * linker script for RM48x50 with GNU ld
  3. * Grissiom 2013-10-20
  4. */
  5. /* Program Entry, set to mark it as "used" and avoid gc */
  6. MEMORY
  7. {
  8. CODE (rx) : ORIGIN = 0x00000000, LENGTH = 3M
  9. DATA (rw) : ORIGIN = 0x08000000, LENGTH = 256k
  10. }
  11. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  12. OUTPUT_ARCH(arm)
  13. ENTRY(system_vectors)
  14. SECTIONS
  15. {
  16. .text :
  17. {
  18. __text_start = .;
  19. *(.vectors)
  20. *(.text)
  21. *(.text.*)
  22. __rodata_start = .;
  23. *(.rodata)
  24. *(.rodata.*)
  25. __rodata_end = .;
  26. *(.glue_7)
  27. *(.glue_7t)
  28. *(.vfp11_veneer)
  29. *(.v4_bx)
  30. *(.gnu.linkonce.t*)
  31. /* section information for finsh shell */
  32. . = ALIGN(4);
  33. __fsymtab_start = .;
  34. KEEP(*(FSymTab))
  35. __fsymtab_end = .;
  36. . = ALIGN(4);
  37. __vsymtab_start = .;
  38. KEEP(*(VSymTab))
  39. __vsymtab_end = .;
  40. . = ALIGN(4);
  41. /* section information for modules */
  42. . = ALIGN(4);
  43. __rtmsymtab_start = .;
  44. KEEP(*(RTMSymTab))
  45. __rtmsymtab_end = .;
  46. /* section information for initialization */
  47. . = ALIGN(4);
  48. __rt_init_start = .;
  49. KEEP(*(SORT(.rti_fn*)))
  50. __rt_init_end = .;
  51. __text_end = .;
  52. } > CODE = 0
  53. . = ALIGN(4);
  54. .ctors :
  55. {
  56. PROVIDE(__ctors_start__ = .);
  57. /* new GCC version uses .init_array */
  58. KEEP(*(SORT(.init_array.*)))
  59. KEEP(*(.init_array))
  60. PROVIDE(__ctors_end__ = .);
  61. } > CODE
  62. .dtors :
  63. {
  64. PROVIDE(__dtors_start__ = .);
  65. KEEP(*(SORT(.dtors.*)))
  66. KEEP(*(.dtors))
  67. PROVIDE(__dtors_end__ = .);
  68. /* This is used by the startup in order to initialize the .data secion */
  69. _sidata = .;
  70. } > CODE
  71. /* .ARM.exidx is sorted, so has to go in its own output section. */
  72. __exidx_start = .;
  73. .ARM.exidx :
  74. {
  75. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  76. /* This is used by the startup in order to initialize the .data secion */
  77. _sidata = .;
  78. } > CODE
  79. __exidx_end = .;
  80. /* .data section which is used for initialized data */
  81. .data : AT (_sidata)
  82. {
  83. . = ALIGN(4);
  84. /* This is used by the startup in order to initialize the .data secion */
  85. _sdata = . ;
  86. *(.data)
  87. *(.data.*)
  88. *(.gnu.linkonce.d*)
  89. . = ALIGN(4);
  90. /* This is used by the startup in order to initialize the .data secion */
  91. _edata = . ;
  92. } >DATA
  93. __data_end = .;
  94. __noinit_start = .;
  95. .noinit :
  96. {
  97. . = ALIGN(4);
  98. *(.bss.noinit)
  99. } > DATA
  100. __noinit_stop = .;
  101. __bss_start = .;
  102. .bss :
  103. {
  104. . = ALIGN(4);
  105. /* This is used by the startup in order to initialize the .bss secion */
  106. _sbss = .;
  107. *(.bss)
  108. *(.bss.*)
  109. *(COMMON)
  110. . = ALIGN(4);
  111. /* This is used by the startup in order to initialize the .bss secion */
  112. _ebss = . ;
  113. } > DATA
  114. __bss_end = .;
  115. /* Stabs debugging sections.
  116. .stab 0 : { *(.stab) }
  117. .stabstr 0 : { *(.stabstr) }
  118. .stab.excl 0 : { *(.stab.excl) }
  119. .stab.exclstr 0 : { *(.stab.exclstr) }
  120. .stab.index 0 : { *(.stab.index) }
  121. .stab.indexstr 0 : { *(.stab.indexstr) }
  122. .comment 0 : { *(.comment) }
  123. */
  124. _end = .;
  125. }