armelf.xs 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /* Script for ld --shared: link shared library */
  2. /* Copyright (C) 2014-2019 Free Software Foundation, Inc.
  3. Copying and distribution of this script, with or without modification,
  4. are permitted in any medium without royalty provided the copyright
  5. notice and this notice are preserved. */
  6. OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
  7. "elf32-littlearm")
  8. OUTPUT_ARCH(arm)
  9. ENTRY(_start)
  10. SEARCH_DIR("=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/install-native/arm-none-eabi/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
  11. SECTIONS
  12. {
  13. /* Read-only sections, merged into text segment: */
  14. . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
  15. .note.gnu.build-id : { *(.note.gnu.build-id) }
  16. .hash : { *(.hash) }
  17. .gnu.hash : { *(.gnu.hash) }
  18. .dynsym : { *(.dynsym) }
  19. .dynstr : { *(.dynstr) }
  20. .gnu.version : { *(.gnu.version) }
  21. .gnu.version_d : { *(.gnu.version_d) }
  22. .gnu.version_r : { *(.gnu.version_r) }
  23. .rel.init : { *(.rel.init) }
  24. .rela.init : { *(.rela.init) }
  25. .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
  26. .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  27. .rel.fini : { *(.rel.fini) }
  28. .rela.fini : { *(.rela.fini) }
  29. .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
  30. .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  31. .rel.data.rel.ro : { *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*) }
  32. .rela.data.rel.ro : { *(.rela.data.rel.ro .rela.data.rel.ro.* .rela.gnu.linkonce.d.rel.ro.*) }
  33. .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
  34. .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
  35. .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
  36. .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
  37. .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
  38. .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
  39. .rel.ctors : { *(.rel.ctors) }
  40. .rela.ctors : { *(.rela.ctors) }
  41. .rel.dtors : { *(.rel.dtors) }
  42. .rela.dtors : { *(.rela.dtors) }
  43. .rel.got : { *(.rel.got) }
  44. .rela.got : { *(.rela.got) }
  45. .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
  46. .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  47. .rel.iplt :
  48. {
  49. *(.rel.iplt)
  50. }
  51. .rela.iplt :
  52. {
  53. *(.rela.iplt)
  54. }
  55. .rel.plt :
  56. {
  57. *(.rel.plt)
  58. }
  59. .rela.plt :
  60. {
  61. *(.rela.plt)
  62. }
  63. .init :
  64. {
  65. KEEP (*(SORT_NONE(.init)))
  66. }
  67. .plt : { *(.plt) }
  68. .iplt : { *(.iplt) }
  69. .text :
  70. {
  71. *(.text.unlikely .text.*_unlikely .text.unlikely.*)
  72. *(.text.exit .text.exit.*)
  73. *(.text.startup .text.startup.*)
  74. *(.text.hot .text.hot.*)
  75. *(.text .stub .text.* .gnu.linkonce.t.*)
  76. /* .gnu.warning sections are handled specially by elf32.em. */
  77. *(.gnu.warning)
  78. *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
  79. }
  80. .fini :
  81. {
  82. KEEP (*(SORT_NONE(.fini)))
  83. }
  84. PROVIDE (__etext = .);
  85. PROVIDE (_etext = .);
  86. PROVIDE (etext = .);
  87. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  88. .rodata1 : { *(.rodata1) }
  89. .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
  90. PROVIDE_HIDDEN (__exidx_start = .);
  91. .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
  92. PROVIDE_HIDDEN (__exidx_end = .);
  93. .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
  94. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  95. .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  96. .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) }
  97. /* These sections are generated by the Sun/Oracle C++ compiler. */
  98. .exception_ranges : ONLY_IF_RO { *(.exception_ranges*) }
  99. /* Adjust the address for the data segment. We want to adjust up to
  100. the same address within the page on the next page up. */
  101. . = ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1));
  102. /* Exception handling */
  103. .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  104. .gnu_extab : ONLY_IF_RW { *(.gnu_extab) }
  105. .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  106. .exception_ranges : ONLY_IF_RW { *(.exception_ranges*) }
  107. /* Thread Local Storage sections */
  108. .tdata :
  109. {
  110. *(.tdata .tdata.* .gnu.linkonce.td.*)
  111. }
  112. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  113. .preinit_array :
  114. {
  115. KEEP (*(.preinit_array))
  116. }
  117. .init_array :
  118. {
  119. KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
  120. KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
  121. }
  122. .fini_array :
  123. {
  124. KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
  125. KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
  126. }
  127. .ctors :
  128. {
  129. /* gcc uses crtbegin.o to find the start of
  130. the constructors, so we make sure it is
  131. first. Because this is a wildcard, it
  132. doesn't matter if the user does not
  133. actually link against crtbegin.o; the
  134. linker won't look for a file to match a
  135. wildcard. The wildcard also means that it
  136. doesn't matter which directory crtbegin.o
  137. is in. */
  138. KEEP (*crtbegin.o(.ctors))
  139. KEEP (*crtbegin?.o(.ctors))
  140. /* We don't want to include the .ctor section from
  141. the crtend.o file until after the sorted ctors.
  142. The .ctor section from the crtend file contains the
  143. end of ctors marker and it must be last */
  144. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  145. KEEP (*(SORT(.ctors.*)))
  146. KEEP (*(.ctors))
  147. }
  148. .dtors :
  149. {
  150. KEEP (*crtbegin.o(.dtors))
  151. KEEP (*crtbegin?.o(.dtors))
  152. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  153. KEEP (*(SORT(.dtors.*)))
  154. KEEP (*(.dtors))
  155. }
  156. .jcr : { KEEP (*(.jcr)) }
  157. .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  158. .dynamic : { *(.dynamic) }
  159. .got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
  160. .data :
  161. {
  162. PROVIDE (__data_start = .);
  163. *(.data .data.* .gnu.linkonce.d.*)
  164. SORT(CONSTRUCTORS)
  165. }
  166. .data1 : { *(.data1) }
  167. PROVIDE (_edata = .); PROVIDE (edata = .);
  168. . = .;
  169. PROVIDE (__bss_start = .);
  170. PROVIDE (__bss_start__ = .);
  171. .bss :
  172. {
  173. *(.dynbss)
  174. *(.bss .bss.* .gnu.linkonce.b.*)
  175. *(COMMON)
  176. /* Align here to ensure that the .bss section occupies space up to
  177. _end. Align after .bss to ensure correct alignment even if the
  178. .bss section disappears because there are no input sections.
  179. FIXME: Why do we need it? When there is no .bss section, we do not
  180. pad the .data section. */
  181. . = ALIGN(. != 0 ? 32 / 8 : 1);
  182. }
  183. PROVIDE (_bss_end__ = .); PROVIDE (__bss_end__ = .);
  184. . = ALIGN(32 / 8);
  185. . = SEGMENT_START("ldata-segment", .);
  186. . = ALIGN(32 / 8);
  187. PROVIDE (__end__ = .);
  188. PROVIDE (_end = .); PROVIDE (end = .);
  189. .stack 0x80000 :
  190. {
  191. _stack = .;
  192. *(.stack)
  193. }
  194. /* Stabs debugging sections. */
  195. .stab 0 : { *(.stab) }
  196. .stabstr 0 : { *(.stabstr) }
  197. .stab.excl 0 : { *(.stab.excl) }
  198. .stab.exclstr 0 : { *(.stab.exclstr) }
  199. .stab.index 0 : { *(.stab.index) }
  200. .stab.indexstr 0 : { *(.stab.indexstr) }
  201. .comment 0 : { *(.comment) }
  202. .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
  203. /* DWARF debug sections.
  204. Symbols in the DWARF debugging sections are relative to the beginning
  205. of the section so we begin them at 0. */
  206. /* DWARF 1 */
  207. .debug 0 : { *(.debug) }
  208. .line 0 : { *(.line) }
  209. /* GNU DWARF 1 extensions */
  210. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  211. .debug_sfnames 0 : { *(.debug_sfnames) }
  212. /* DWARF 1.1 and DWARF 2 */
  213. .debug_aranges 0 : { *(.debug_aranges) }
  214. .debug_pubnames 0 : { *(.debug_pubnames) }
  215. /* DWARF 2 */
  216. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  217. .debug_abbrev 0 : { *(.debug_abbrev) }
  218. .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
  219. .debug_frame 0 : { *(.debug_frame) }
  220. .debug_str 0 : { *(.debug_str) }
  221. .debug_loc 0 : { *(.debug_loc) }
  222. .debug_macinfo 0 : { *(.debug_macinfo) }
  223. /* SGI/MIPS DWARF 2 extensions */
  224. .debug_weaknames 0 : { *(.debug_weaknames) }
  225. .debug_funcnames 0 : { *(.debug_funcnames) }
  226. .debug_typenames 0 : { *(.debug_typenames) }
  227. .debug_varnames 0 : { *(.debug_varnames) }
  228. /* DWARF 3 */
  229. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  230. .debug_ranges 0 : { *(.debug_ranges) }
  231. /* DWARF Extension. */
  232. .debug_macro 0 : { *(.debug_macro) }
  233. .debug_addr 0 : { *(.debug_addr) }
  234. .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }
  235. .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
  236. /* This section contains data that is not initialised during load
  237. *or* application reset. */
  238. .noinit (NOLOAD) :
  239. {
  240. . = ALIGN(2);
  241. PROVIDE (__noinit_start = .);
  242. *(.noinit)
  243. . = ALIGN(2);
  244. PROVIDE (__noinit_end = .);
  245. }
  246. /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
  247. }