You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

268 line
10KB

  1. /* Script for -z separate-code */
  2. /* Copyright (C) 2014-2020 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("=/tmp/jenkins-GCC-10-pipeline-48_20201124_1606180639/install-native/arm-none-eabi/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
  11. SECTIONS
  12. {
  13. PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x8000)); . = SEGMENT_START("text-segment", 0x8000);
  14. .interp : { *(.interp) }
  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. PROVIDE_HIDDEN (__rel_iplt_start = .);
  50. *(.rel.iplt)
  51. PROVIDE_HIDDEN (__rel_iplt_end = .);
  52. }
  53. .rela.iplt :
  54. {
  55. PROVIDE_HIDDEN (__rela_iplt_start = .);
  56. *(.rela.iplt)
  57. PROVIDE_HIDDEN (__rela_iplt_end = .);
  58. }
  59. .rel.plt :
  60. {
  61. *(.rel.plt)
  62. }
  63. .rela.plt :
  64. {
  65. *(.rela.plt)
  66. }
  67. . = ALIGN(CONSTANT (MAXPAGESIZE));
  68. .init :
  69. {
  70. KEEP (*(SORT_NONE(.init)))
  71. }
  72. .plt : { *(.plt) }
  73. .iplt : { *(.iplt) }
  74. .text :
  75. {
  76. *(.text.unlikely .text.*_unlikely .text.unlikely.*)
  77. *(.text.exit .text.exit.*)
  78. *(.text.startup .text.startup.*)
  79. *(.text.hot .text.hot.*)
  80. *(SORT(.text.sorted.*))
  81. *(.text .stub .text.* .gnu.linkonce.t.*)
  82. /* .gnu.warning sections are handled specially by elf.em. */
  83. *(.gnu.warning)
  84. *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
  85. }
  86. .fini :
  87. {
  88. KEEP (*(SORT_NONE(.fini)))
  89. }
  90. PROVIDE (__etext = .);
  91. PROVIDE (_etext = .);
  92. PROVIDE (etext = .);
  93. . = ALIGN(CONSTANT (MAXPAGESIZE));
  94. /* Adjust the address for the rodata segment. We want to adjust up to
  95. the same address within the page on the next page up. */
  96. . = SEGMENT_START("rodata-segment", ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)));
  97. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  98. .rodata1 : { *(.rodata1) }
  99. .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
  100. .ARM.exidx :
  101. {
  102. PROVIDE_HIDDEN (__exidx_start = .);
  103. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  104. PROVIDE_HIDDEN (__exidx_end = .);
  105. }
  106. .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
  107. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  108. .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  109. .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) }
  110. /* These sections are generated by the Sun/Oracle C++ compiler. */
  111. .exception_ranges : ONLY_IF_RO { *(.exception_ranges*) }
  112. /* Adjust the address for the data segment. We want to adjust up to
  113. the same address within the page on the next page up. */
  114. . = ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1));
  115. /* Exception handling */
  116. .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  117. .gnu_extab : ONLY_IF_RW { *(.gnu_extab) }
  118. .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  119. .exception_ranges : ONLY_IF_RW { *(.exception_ranges*) }
  120. /* Thread Local Storage sections */
  121. .tdata :
  122. {
  123. PROVIDE_HIDDEN (__tdata_start = .);
  124. *(.tdata .tdata.* .gnu.linkonce.td.*)
  125. }
  126. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  127. .preinit_array :
  128. {
  129. PROVIDE_HIDDEN (__preinit_array_start = .);
  130. KEEP (*(.preinit_array))
  131. PROVIDE_HIDDEN (__preinit_array_end = .);
  132. }
  133. .init_array :
  134. {
  135. PROVIDE_HIDDEN (__init_array_start = .);
  136. KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
  137. KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
  138. PROVIDE_HIDDEN (__init_array_end = .);
  139. }
  140. .fini_array :
  141. {
  142. PROVIDE_HIDDEN (__fini_array_start = .);
  143. KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
  144. KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
  145. PROVIDE_HIDDEN (__fini_array_end = .);
  146. }
  147. .ctors :
  148. {
  149. /* gcc uses crtbegin.o to find the start of
  150. the constructors, so we make sure it is
  151. first. Because this is a wildcard, it
  152. doesn't matter if the user does not
  153. actually link against crtbegin.o; the
  154. linker won't look for a file to match a
  155. wildcard. The wildcard also means that it
  156. doesn't matter which directory crtbegin.o
  157. is in. */
  158. KEEP (*crtbegin.o(.ctors))
  159. KEEP (*crtbegin?.o(.ctors))
  160. /* We don't want to include the .ctor section from
  161. the crtend.o file until after the sorted ctors.
  162. The .ctor section from the crtend file contains the
  163. end of ctors marker and it must be last */
  164. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  165. KEEP (*(SORT(.ctors.*)))
  166. KEEP (*(.ctors))
  167. }
  168. .dtors :
  169. {
  170. KEEP (*crtbegin.o(.dtors))
  171. KEEP (*crtbegin?.o(.dtors))
  172. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  173. KEEP (*(SORT(.dtors.*)))
  174. KEEP (*(.dtors))
  175. }
  176. .jcr : { KEEP (*(.jcr)) }
  177. .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  178. .dynamic : { *(.dynamic) }
  179. .got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
  180. .data :
  181. {
  182. __data_start = .;
  183. *(.data .data.* .gnu.linkonce.d.*)
  184. SORT(CONSTRUCTORS)
  185. }
  186. .data1 : { *(.data1) }
  187. _edata = .; PROVIDE (edata = .);
  188. . = .;
  189. __bss_start = .;
  190. __bss_start__ = .;
  191. .bss :
  192. {
  193. *(.dynbss)
  194. *(.bss .bss.* .gnu.linkonce.b.*)
  195. *(COMMON)
  196. /* Align here to ensure that the .bss section occupies space up to
  197. _end. Align after .bss to ensure correct alignment even if the
  198. .bss section disappears because there are no input sections.
  199. FIXME: Why do we need it? When there is no .bss section, we do not
  200. pad the .data section. */
  201. . = ALIGN(. != 0 ? 32 / 8 : 1);
  202. }
  203. _bss_end__ = .; __bss_end__ = .;
  204. . = ALIGN(32 / 8);
  205. . = SEGMENT_START("ldata-segment", .);
  206. . = ALIGN(32 / 8);
  207. __end__ = .;
  208. _end = .; PROVIDE (end = .);
  209. .stack 0x80000 :
  210. {
  211. _stack = .;
  212. *(.stack)
  213. }
  214. /* Stabs debugging sections. */
  215. .stab 0 : { *(.stab) }
  216. .stabstr 0 : { *(.stabstr) }
  217. .stab.excl 0 : { *(.stab.excl) }
  218. .stab.exclstr 0 : { *(.stab.exclstr) }
  219. .stab.index 0 : { *(.stab.index) }
  220. .stab.indexstr 0 : { *(.stab.indexstr) }
  221. .comment 0 : { *(.comment) }
  222. .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
  223. /* DWARF debug sections.
  224. Symbols in the DWARF debugging sections are relative to the beginning
  225. of the section so we begin them at 0. */
  226. /* DWARF 1 */
  227. .debug 0 : { *(.debug) }
  228. .line 0 : { *(.line) }
  229. /* GNU DWARF 1 extensions */
  230. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  231. .debug_sfnames 0 : { *(.debug_sfnames) }
  232. /* DWARF 1.1 and DWARF 2 */
  233. .debug_aranges 0 : { *(.debug_aranges) }
  234. .debug_pubnames 0 : { *(.debug_pubnames) }
  235. /* DWARF 2 */
  236. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  237. .debug_abbrev 0 : { *(.debug_abbrev) }
  238. .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
  239. .debug_frame 0 : { *(.debug_frame) }
  240. .debug_str 0 : { *(.debug_str) }
  241. .debug_loc 0 : { *(.debug_loc) }
  242. .debug_macinfo 0 : { *(.debug_macinfo) }
  243. /* SGI/MIPS DWARF 2 extensions */
  244. .debug_weaknames 0 : { *(.debug_weaknames) }
  245. .debug_funcnames 0 : { *(.debug_funcnames) }
  246. .debug_typenames 0 : { *(.debug_typenames) }
  247. .debug_varnames 0 : { *(.debug_varnames) }
  248. /* DWARF 3 */
  249. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  250. .debug_ranges 0 : { *(.debug_ranges) }
  251. /* DWARF Extension. */
  252. .debug_macro 0 : { *(.debug_macro) }
  253. .debug_addr 0 : { *(.debug_addr) }
  254. .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }
  255. .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
  256. /* This section contains data that is not initialised during load
  257. *or* application reset. */
  258. .noinit (NOLOAD) :
  259. {
  260. . = ALIGN(2);
  261. PROVIDE (__noinit_start = .);
  262. *(.noinit)
  263. . = ALIGN(2);
  264. PROVIDE (__noinit_end = .);
  265. }
  266. /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
  267. }