armelf.xbn 9.6 KB

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