elf32ltsmip.xbn 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. /* Script for -N: mix text and data on same page; don't align data */
  2. /* Copyright (C) 2014 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-tradlittlemips", "elf32-tradbigmips",
  7. "elf32-tradlittlemips")
  8. OUTPUT_ARCH(mips)
  9. ENTRY(__start)
  10. SEARCH_DIR("=/srv/openwrt/ar71xx/build/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/mips-openwrt-linux-musl/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. PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
  15. .interp : { *(.interp) }
  16. .MIPS.abiflags : { *(.MIPS.abiflags) }
  17. .reginfo : { *(.reginfo) }
  18. .note.gnu.build-id : { *(.note.gnu.build-id) }
  19. .dynamic : { *(.dynamic) }
  20. .hash : { *(.hash) }
  21. .gnu.hash : { *(.gnu.hash) }
  22. .dynsym : { *(.dynsym) }
  23. .dynstr : { *(.dynstr) }
  24. .gnu.version : { *(.gnu.version) }
  25. .gnu.version_d : { *(.gnu.version_d) }
  26. .gnu.version_r : { *(.gnu.version_r) }
  27. .rel.init : { *(.rel.init) }
  28. .rela.init : { *(.rela.init) }
  29. .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
  30. .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  31. .rel.fini : { *(.rel.fini) }
  32. .rela.fini : { *(.rela.fini) }
  33. .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
  34. .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  35. .rel.data.rel.ro : { *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*) }
  36. .rela.data.rel.ro : { *(.rela.data.rel.ro .rela.data.rel.ro.* .rela.gnu.linkonce.d.rel.ro.*) }
  37. .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
  38. .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
  39. .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
  40. .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
  41. .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
  42. .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
  43. .rel.ctors : { *(.rel.ctors) }
  44. .rela.ctors : { *(.rela.ctors) }
  45. .rel.dtors : { *(.rel.dtors) }
  46. .rela.dtors : { *(.rela.dtors) }
  47. .rel.got : { *(.rel.got) }
  48. .rela.got : { *(.rela.got) }
  49. .rel.dyn : { *(.rel.dyn) }
  50. .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
  51. .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
  52. .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
  53. .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
  54. .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
  55. .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
  56. .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
  57. .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
  58. .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
  59. .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  60. .rel.iplt :
  61. {
  62. PROVIDE_HIDDEN (__rel_iplt_start = .);
  63. *(.rel.iplt)
  64. PROVIDE_HIDDEN (__rel_iplt_end = .);
  65. }
  66. .rela.iplt :
  67. {
  68. PROVIDE_HIDDEN (__rela_iplt_start = .);
  69. *(.rela.iplt)
  70. PROVIDE_HIDDEN (__rela_iplt_end = .);
  71. }
  72. .rel.plt :
  73. {
  74. *(.rel.plt)
  75. }
  76. .rela.plt :
  77. {
  78. *(.rela.plt)
  79. }
  80. .init :
  81. {
  82. KEEP (*(SORT_NONE(.init)))
  83. }
  84. .text :
  85. {
  86. _ftext = . ;
  87. *(.text.unlikely .text.*_unlikely .text.unlikely.*)
  88. *(.text.exit .text.exit.*)
  89. *(.text.startup .text.startup.*)
  90. *(.text.hot .text.hot.*)
  91. *(.text .stub .text.* .gnu.linkonce.t.*)
  92. /* .gnu.warning sections are handled specially by elf32.em. */
  93. *(.gnu.warning)
  94. *(.mips16.fn.*) *(.mips16.call.*)
  95. }
  96. .fini :
  97. {
  98. KEEP (*(SORT_NONE(.fini)))
  99. }
  100. PROVIDE (__etext = .);
  101. PROVIDE (_etext = .);
  102. PROVIDE (etext = .);
  103. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  104. .rodata1 : { *(.rodata1) }
  105. .sdata2 :
  106. {
  107. *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
  108. }
  109. .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
  110. .eh_frame_hdr : { *(.eh_frame_hdr) }
  111. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  112. .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
  113. .gcc_except_table.*) }
  114. /* These sections are generated by the Sun/Oracle C++ compiler. */
  115. .exception_ranges : ONLY_IF_RO { *(.exception_ranges
  116. .exception_ranges*) }
  117. .plt : { *(.plt) }
  118. .iplt : { *(.iplt) }
  119. /* Adjust the address for the data segment. We want to adjust up to
  120. the same address within the page on the next page up. */
  121. . = .;
  122. /* Exception handling */
  123. .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  124. .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  125. .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
  126. /* Thread Local Storage sections */
  127. .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  128. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  129. .preinit_array :
  130. {
  131. PROVIDE_HIDDEN (__preinit_array_start = .);
  132. KEEP (*(.preinit_array))
  133. PROVIDE_HIDDEN (__preinit_array_end = .);
  134. }
  135. .init_array :
  136. {
  137. PROVIDE_HIDDEN (__init_array_start = .);
  138. KEEP (*(SORT(.init_array.*)))
  139. KEEP (*(.init_array ))
  140. PROVIDE_HIDDEN (__init_array_end = .);
  141. }
  142. .fini_array :
  143. {
  144. PROVIDE_HIDDEN (__fini_array_start = .);
  145. KEEP (*(SORT(.fini_array.*)))
  146. KEEP (*(.fini_array ))
  147. PROVIDE_HIDDEN (__fini_array_end = .);
  148. }
  149. .ctors :
  150. {
  151. /* gcc uses crtbegin.o to find the start of
  152. the constructors, so we make sure it is
  153. first. Because this is a wildcard, it
  154. doesn't matter if the user does not
  155. actually link against crtbegin.o; the
  156. linker won't look for a file to match a
  157. wildcard. The wildcard also means that it
  158. doesn't matter which directory crtbegin.o
  159. is in. */
  160. KEEP (*crtbegin.o(.ctors))
  161. KEEP (*crtbegin?.o(.ctors))
  162. /* We don't want to include the .ctor section from
  163. the crtend.o file until after the sorted ctors.
  164. The .ctor section from the crtend file contains the
  165. end of ctors marker and it must be last */
  166. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  167. KEEP (*(SORT(.ctors.*)))
  168. KEEP (*(.ctors))
  169. }
  170. .dtors :
  171. {
  172. KEEP (*crtbegin.o(.dtors))
  173. KEEP (*crtbegin?.o(.dtors))
  174. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  175. KEEP (*(SORT(.dtors.*)))
  176. KEEP (*(.dtors))
  177. }
  178. .jcr : { KEEP (*(.jcr)) }
  179. .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  180. .got.plt : { *(.got.plt) }
  181. .data :
  182. {
  183. _fdata = . ;
  184. *(.data .data.* .gnu.linkonce.d.*)
  185. SORT(CONSTRUCTORS)
  186. }
  187. .data1 : { *(.data1) }
  188. . = .;
  189. . = .;
  190. HIDDEN (_gp = ALIGN (16) + 0x7ff0);
  191. .got : { *(.got) }
  192. /* We want the small data sections together, so single-instruction offsets
  193. can access them all, and initialized data all before uninitialized, so
  194. we can shorten the on-disk segment size. */
  195. .sdata :
  196. {
  197. *(.sdata .sdata.* .gnu.linkonce.s.*)
  198. }
  199. .lit8 : { *(.lit8) }
  200. .lit4 : { *(.lit4) }
  201. _edata = .; PROVIDE (edata = .);
  202. . = .;
  203. __bss_start = .;
  204. _fbss = .;
  205. .sbss :
  206. {
  207. *(.dynsbss)
  208. *(.sbss .sbss.* .gnu.linkonce.sb.*)
  209. *(.scommon)
  210. }
  211. .bss :
  212. {
  213. *(.dynbss)
  214. *(.bss .bss.* .gnu.linkonce.b.*)
  215. *(COMMON)
  216. /* Align here to ensure that the .bss section occupies space up to
  217. _end. Align after .bss to ensure correct alignment even if the
  218. .bss section disappears because there are no input sections.
  219. FIXME: Why do we need it? When there is no .bss section, we don't
  220. pad the .data section. */
  221. . = ALIGN(. != 0 ? 32 / 8 : 1);
  222. }
  223. . = ALIGN(32 / 8);
  224. . = SEGMENT_START("ldata-segment", .);
  225. . = ALIGN(32 / 8);
  226. _end = .; PROVIDE (end = .);
  227. /* Stabs debugging sections. */
  228. .stab 0 : { *(.stab) }
  229. .stabstr 0 : { *(.stabstr) }
  230. .stab.excl 0 : { *(.stab.excl) }
  231. .stab.exclstr 0 : { *(.stab.exclstr) }
  232. .stab.index 0 : { *(.stab.index) }
  233. .stab.indexstr 0 : { *(.stab.indexstr) }
  234. .comment 0 : { *(.comment) }
  235. /* DWARF debug sections.
  236. Symbols in the DWARF debugging sections are relative to the beginning
  237. of the section so we begin them at 0. */
  238. /* DWARF 1 */
  239. .debug 0 : { *(.debug) }
  240. .line 0 : { *(.line) }
  241. /* GNU DWARF 1 extensions */
  242. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  243. .debug_sfnames 0 : { *(.debug_sfnames) }
  244. /* DWARF 1.1 and DWARF 2 */
  245. .debug_aranges 0 : { *(.debug_aranges) }
  246. .debug_pubnames 0 : { *(.debug_pubnames) }
  247. /* DWARF 2 */
  248. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  249. .debug_abbrev 0 : { *(.debug_abbrev) }
  250. .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
  251. .debug_frame 0 : { *(.debug_frame) }
  252. .debug_str 0 : { *(.debug_str) }
  253. .debug_loc 0 : { *(.debug_loc) }
  254. .debug_macinfo 0 : { *(.debug_macinfo) }
  255. /* SGI/MIPS DWARF 2 extensions */
  256. .debug_weaknames 0 : { *(.debug_weaknames) }
  257. .debug_funcnames 0 : { *(.debug_funcnames) }
  258. .debug_typenames 0 : { *(.debug_typenames) }
  259. .debug_varnames 0 : { *(.debug_varnames) }
  260. /* DWARF 3 */
  261. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  262. .debug_ranges 0 : { *(.debug_ranges) }
  263. /* DWARF Extension. */
  264. .debug_macro 0 : { *(.debug_macro) }
  265. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  266. .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  267. .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  268. .mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) }
  269. .mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) }
  270. .mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) }
  271. .mdebug.abiO64 0 : { KEEP(*(.mdebug.abiO64)) }
  272. .mdebug.eabi32 0 : { KEEP(*(.mdebug.eabi32)) }
  273. .mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) }
  274. .gcc_compiled_long32 0 : { KEEP(*(.gcc_compiled_long32)) }
  275. .gcc_compiled_long64 0 : { KEEP(*(.gcc_compiled_long64)) }
  276. /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
  277. }