elf64ltsmip.xu 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. /* Script for ld -Ur: link w/out relocation, do create constructors */
  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("elf64-tradlittlemips", "elf64-tradbigmips",
  7. "elf64-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. .MIPS.abiflags 0 : { *(.MIPS.abiflags) }
  17. .MIPS.options : { *(.MIPS.options) }
  18. .note.gnu.build-id : { *(.note.gnu.build-id) }
  19. .dynamic 0 : { *(.dynamic) }
  20. .hash 0 : { *(.hash) }
  21. .gnu.hash 0 : { *(.gnu.hash) }
  22. .dynsym 0 : { *(.dynsym) }
  23. .dynstr 0 : { *(.dynstr) }
  24. .gnu.version 0 : { *(.gnu.version) }
  25. .gnu.version_d 0: { *(.gnu.version_d) }
  26. .gnu.version_r 0: { *(.gnu.version_r) }
  27. .rel.init 0 : { *(.rel.init) }
  28. .rela.init 0 : { *(.rela.init) }
  29. .rel.text 0 : { *(.rel.text) }
  30. .rela.text 0 : { *(.rela.text) }
  31. .rel.fini 0 : { *(.rel.fini) }
  32. .rela.fini 0 : { *(.rela.fini) }
  33. .rel.rodata 0 : { *(.rel.rodata) }
  34. .rela.rodata 0 : { *(.rela.rodata) }
  35. .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
  36. .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
  37. .rel.data 0 : { *(.rel.data) }
  38. .rela.data 0 : { *(.rela.data) }
  39. .rel.tdata 0 : { *(.rel.tdata) }
  40. .rela.tdata 0 : { *(.rela.tdata) }
  41. .rel.tbss 0 : { *(.rel.tbss) }
  42. .rela.tbss 0 : { *(.rela.tbss) }
  43. .rel.ctors 0 : { *(.rel.ctors) }
  44. .rela.ctors 0 : { *(.rela.ctors) }
  45. .rel.dtors 0 : { *(.rel.dtors) }
  46. .rela.dtors 0 : { *(.rela.dtors) }
  47. .rel.got 0 : { *(.rel.got) }
  48. .rela.got 0 : { *(.rela.got) }
  49. .rel.dyn 0 : { *(.rel.dyn) }
  50. .rel.sdata 0 : { *(.rel.sdata) }
  51. .rela.sdata 0 : { *(.rela.sdata) }
  52. .rel.sbss 0 : { *(.rel.sbss) }
  53. .rela.sbss 0 : { *(.rela.sbss) }
  54. .rel.sdata2 0 : { *(.rel.sdata2) }
  55. .rela.sdata2 0 : { *(.rela.sdata2) }
  56. .rel.sbss2 0 : { *(.rel.sbss2) }
  57. .rela.sbss2 0 : { *(.rela.sbss2) }
  58. .rel.bss 0 : { *(.rel.bss) }
  59. .rela.bss 0 : { *(.rela.bss) }
  60. .rel.iplt 0 :
  61. {
  62. *(.rel.iplt)
  63. }
  64. .rela.iplt 0 :
  65. {
  66. *(.rela.iplt)
  67. }
  68. .rel.plt 0 :
  69. {
  70. *(.rel.plt)
  71. }
  72. .rela.plt 0 :
  73. {
  74. *(.rela.plt)
  75. }
  76. .init 0 :
  77. {
  78. KEEP (*(SORT_NONE(.init)))
  79. }
  80. .plt 0 : { *(.plt) }
  81. .iplt 0 : { *(.iplt) }
  82. .text 0 :
  83. {
  84. *(.text .stub)
  85. /* .gnu.warning sections are handled specially by elf32.em. */
  86. *(.gnu.warning)
  87. }
  88. .fini 0 :
  89. {
  90. KEEP (*(SORT_NONE(.fini)))
  91. }
  92. .rodata 0 : { *(.rodata) }
  93. .rodata1 0 : { *(.rodata1) }
  94. .sdata2 0 :
  95. {
  96. *(.sdata2)
  97. }
  98. .sbss2 0 : { *(.sbss2) }
  99. .eh_frame_hdr : { *(.eh_frame_hdr) }
  100. .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  101. .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table
  102. .gcc_except_table.*) }
  103. /* These sections are generated by the Sun/Oracle C++ compiler. */
  104. .exception_ranges 0 : ONLY_IF_RO { *(.exception_ranges
  105. .exception_ranges*) }
  106. /* Adjust the address for the data segment. We want to adjust up to
  107. the same address within the page on the next page up. */
  108. /* Exception handling */
  109. .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  110. .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  111. .exception_ranges 0 : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
  112. /* Thread Local Storage sections */
  113. .tdata 0 : { *(.tdata) }
  114. .tbss 0 : { *(.tbss) }
  115. .preinit_array 0 :
  116. {
  117. KEEP (*(.preinit_array))
  118. }
  119. .jcr 0 : { KEEP (*(.jcr)) }
  120. .data 0 :
  121. {
  122. *(.data)
  123. SORT(CONSTRUCTORS)
  124. }
  125. .data1 0 : { *(.data1) }
  126. .got.plt 0 : { *(.got.plt) }
  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. .srdata 0 : { *(.srdata) }
  138. .sbss 0 :
  139. {
  140. *(.dynsbss)
  141. *(.sbss)
  142. *(.scommon)
  143. }
  144. .bss 0 :
  145. {
  146. *(.dynbss)
  147. *(.bss)
  148. *(COMMON)
  149. /* Align here to ensure that the .bss section occupies space up to
  150. _end. Align after .bss to ensure correct alignment even if the
  151. .bss section disappears because there are no input sections.
  152. FIXME: Why do we need it? When there is no .bss section, we don't
  153. pad the .data section. */
  154. }
  155. /* Stabs debugging sections. */
  156. .stab 0 : { *(.stab) }
  157. .stabstr 0 : { *(.stabstr) }
  158. .stab.excl 0 : { *(.stab.excl) }
  159. .stab.exclstr 0 : { *(.stab.exclstr) }
  160. .stab.index 0 : { *(.stab.index) }
  161. .stab.indexstr 0 : { *(.stab.indexstr) }
  162. .comment 0 : { *(.comment) }
  163. /* DWARF debug sections.
  164. Symbols in the DWARF debugging sections are relative to the beginning
  165. of the section so we begin them at 0. */
  166. /* DWARF 1 */
  167. .debug 0 : { *(.debug) }
  168. .line 0 : { *(.line) }
  169. /* GNU DWARF 1 extensions */
  170. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  171. .debug_sfnames 0 : { *(.debug_sfnames) }
  172. /* DWARF 1.1 and DWARF 2 */
  173. .debug_aranges 0 : { *(.debug_aranges) }
  174. .debug_pubnames 0 : { *(.debug_pubnames) }
  175. /* DWARF 2 */
  176. .debug_info 0 : { *(.debug_info) }
  177. .debug_abbrev 0 : { *(.debug_abbrev) }
  178. .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
  179. .debug_frame 0 : { *(.debug_frame) }
  180. .debug_str 0 : { *(.debug_str) }
  181. .debug_loc 0 : { *(.debug_loc) }
  182. .debug_macinfo 0 : { *(.debug_macinfo) }
  183. /* SGI/MIPS DWARF 2 extensions */
  184. .debug_weaknames 0 : { *(.debug_weaknames) }
  185. .debug_funcnames 0 : { *(.debug_funcnames) }
  186. .debug_typenames 0 : { *(.debug_typenames) }
  187. .debug_varnames 0 : { *(.debug_varnames) }
  188. /* DWARF 3 */
  189. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  190. .debug_ranges 0 : { *(.debug_ranges) }
  191. /* DWARF Extension. */
  192. .debug_macro 0 : { *(.debug_macro) }
  193. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  194. .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  195. .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  196. }