elf32btsmip.xr 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /* Script for ld -r: link without relocation */
  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-tradbigmips", "elf32-tradbigmips",
  7. "elf32-tradlittlemips")
  8. OUTPUT_ARCH(mips)
  9. /* For some reason, the Solaris linker makes bad executables
  10. if gld -r is used and the intermediate file has sections starting
  11. at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
  12. bug. But for now assigning the zero vmas works. */
  13. SECTIONS
  14. {
  15. /* Read-only sections, merged into text segment: */
  16. .interp 0 : { *(.interp) }
  17. .MIPS.abiflags 0 : { *(.MIPS.abiflags) }
  18. .reginfo 0 : { *(.reginfo) }
  19. .note.gnu.build-id : { *(.note.gnu.build-id) }
  20. .dynamic 0 : { *(.dynamic) }
  21. .hash 0 : { *(.hash) }
  22. .gnu.hash 0 : { *(.gnu.hash) }
  23. .dynsym 0 : { *(.dynsym) }
  24. .dynstr 0 : { *(.dynstr) }
  25. .gnu.version 0 : { *(.gnu.version) }
  26. .gnu.version_d 0: { *(.gnu.version_d) }
  27. .gnu.version_r 0: { *(.gnu.version_r) }
  28. .rel.init 0 : { *(.rel.init) }
  29. .rela.init 0 : { *(.rela.init) }
  30. .rel.text 0 : { *(.rel.text) }
  31. .rela.text 0 : { *(.rela.text) }
  32. .rel.fini 0 : { *(.rel.fini) }
  33. .rela.fini 0 : { *(.rela.fini) }
  34. .rel.rodata 0 : { *(.rel.rodata) }
  35. .rela.rodata 0 : { *(.rela.rodata) }
  36. .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
  37. .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
  38. .rel.data 0 : { *(.rel.data) }
  39. .rela.data 0 : { *(.rela.data) }
  40. .rel.tdata 0 : { *(.rel.tdata) }
  41. .rela.tdata 0 : { *(.rela.tdata) }
  42. .rel.tbss 0 : { *(.rel.tbss) }
  43. .rela.tbss 0 : { *(.rela.tbss) }
  44. .rel.ctors 0 : { *(.rel.ctors) }
  45. .rela.ctors 0 : { *(.rela.ctors) }
  46. .rel.dtors 0 : { *(.rel.dtors) }
  47. .rela.dtors 0 : { *(.rela.dtors) }
  48. .rel.got 0 : { *(.rel.got) }
  49. .rela.got 0 : { *(.rela.got) }
  50. .rel.dyn 0 : { *(.rel.dyn) }
  51. .rel.sdata 0 : { *(.rel.sdata) }
  52. .rela.sdata 0 : { *(.rela.sdata) }
  53. .rel.sbss 0 : { *(.rel.sbss) }
  54. .rela.sbss 0 : { *(.rela.sbss) }
  55. .rel.sdata2 0 : { *(.rel.sdata2) }
  56. .rela.sdata2 0 : { *(.rela.sdata2) }
  57. .rel.sbss2 0 : { *(.rel.sbss2) }
  58. .rela.sbss2 0 : { *(.rela.sbss2) }
  59. .rel.bss 0 : { *(.rel.bss) }
  60. .rela.bss 0 : { *(.rela.bss) }
  61. .rel.iplt 0 :
  62. {
  63. *(.rel.iplt)
  64. }
  65. .rela.iplt 0 :
  66. {
  67. *(.rela.iplt)
  68. }
  69. .rel.plt 0 :
  70. {
  71. *(.rel.plt)
  72. }
  73. .rela.plt 0 :
  74. {
  75. *(.rela.plt)
  76. }
  77. .init 0 :
  78. {
  79. KEEP (*(SORT_NONE(.init)))
  80. }
  81. .text 0 :
  82. {
  83. *(.text .stub)
  84. /* .gnu.warning sections are handled specially by elf32.em. */
  85. *(.gnu.warning)
  86. }
  87. .fini 0 :
  88. {
  89. KEEP (*(SORT_NONE(.fini)))
  90. }
  91. .rodata 0 : { *(.rodata) }
  92. .rodata1 0 : { *(.rodata1) }
  93. .sdata2 0 :
  94. {
  95. *(.sdata2)
  96. }
  97. .sbss2 0 : { *(.sbss2) }
  98. .eh_frame_hdr : { *(.eh_frame_hdr) }
  99. .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  100. .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table
  101. .gcc_except_table.*) }
  102. /* These sections are generated by the Sun/Oracle C++ compiler. */
  103. .exception_ranges 0 : ONLY_IF_RO { *(.exception_ranges
  104. .exception_ranges*) }
  105. .plt 0 : { *(.plt) }
  106. .iplt 0 : { *(.iplt) }
  107. /* Adjust the address for the data segment. We want to adjust up to
  108. the same address within the page on the next page up. */
  109. /* Exception handling */
  110. .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  111. .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  112. .exception_ranges 0 : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
  113. /* Thread Local Storage sections */
  114. .tdata 0 : { *(.tdata) }
  115. .tbss 0 : { *(.tbss) }
  116. .preinit_array 0 :
  117. {
  118. KEEP (*(.preinit_array))
  119. }
  120. .jcr 0 : { KEEP (*(.jcr)) }
  121. .got.plt 0 : { *(.got.plt) }
  122. .data 0 :
  123. {
  124. *(.data)
  125. }
  126. .data1 0 : { *(.data1) }
  127. .got 0 : { *(.got) }
  128. /* We want the small data sections together, so single-instruction offsets
  129. can access them all, and initialized data all before uninitialized, so
  130. we can shorten the on-disk segment size. */
  131. .sdata 0 :
  132. {
  133. *(.sdata)
  134. }
  135. .lit8 0 : { *(.lit8) }
  136. .lit4 0 : { *(.lit4) }
  137. .sbss 0 :
  138. {
  139. *(.dynsbss)
  140. *(.sbss)
  141. *(.scommon)
  142. }
  143. .bss 0 :
  144. {
  145. *(.dynbss)
  146. *(.bss)
  147. *(COMMON)
  148. /* Align here to ensure that the .bss section occupies space up to
  149. _end. Align after .bss to ensure correct alignment even if the
  150. .bss section disappears because there are no input sections.
  151. FIXME: Why do we need it? When there is no .bss section, we don't
  152. pad the .data section. */
  153. }
  154. /* Stabs debugging sections. */
  155. .stab 0 : { *(.stab) }
  156. .stabstr 0 : { *(.stabstr) }
  157. .stab.excl 0 : { *(.stab.excl) }
  158. .stab.exclstr 0 : { *(.stab.exclstr) }
  159. .stab.index 0 : { *(.stab.index) }
  160. .stab.indexstr 0 : { *(.stab.indexstr) }
  161. .comment 0 : { *(.comment) }
  162. /* DWARF debug sections.
  163. Symbols in the DWARF debugging sections are relative to the beginning
  164. of the section so we begin them at 0. */
  165. /* DWARF 1 */
  166. .debug 0 : { *(.debug) }
  167. .line 0 : { *(.line) }
  168. /* GNU DWARF 1 extensions */
  169. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  170. .debug_sfnames 0 : { *(.debug_sfnames) }
  171. /* DWARF 1.1 and DWARF 2 */
  172. .debug_aranges 0 : { *(.debug_aranges) }
  173. .debug_pubnames 0 : { *(.debug_pubnames) }
  174. /* DWARF 2 */
  175. .debug_info 0 : { *(.debug_info) }
  176. .debug_abbrev 0 : { *(.debug_abbrev) }
  177. .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
  178. .debug_frame 0 : { *(.debug_frame) }
  179. .debug_str 0 : { *(.debug_str) }
  180. .debug_loc 0 : { *(.debug_loc) }
  181. .debug_macinfo 0 : { *(.debug_macinfo) }
  182. /* SGI/MIPS DWARF 2 extensions */
  183. .debug_weaknames 0 : { *(.debug_weaknames) }
  184. .debug_funcnames 0 : { *(.debug_funcnames) }
  185. .debug_typenames 0 : { *(.debug_typenames) }
  186. .debug_varnames 0 : { *(.debug_varnames) }
  187. /* DWARF 3 */
  188. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  189. .debug_ranges 0 : { *(.debug_ranges) }
  190. /* DWARF Extension. */
  191. .debug_macro 0 : { *(.debug_macro) }
  192. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  193. .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  194. .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  195. .mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) }
  196. .mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) }
  197. .mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) }
  198. .mdebug.abiO64 0 : { KEEP(*(.mdebug.abiO64)) }
  199. .mdebug.eabi32 0 : { KEEP(*(.mdebug.eabi32)) }
  200. .mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) }
  201. .gcc_compiled_long32 0 : { KEEP(*(.gcc_compiled_long32)) }
  202. .gcc_compiled_long64 0 : { KEEP(*(.gcc_compiled_long64)) }
  203. }