elf64lppc.x 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. /* Default linker script, for normal executables */
  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("elf64-powerpcle", "elf64-powerpcle",
  7. "elf64-powerpcle")
  8. OUTPUT_ARCH(powerpc:common64)
  9. ENTRY(_start)
  10. SEARCH_DIR("=/usr/local/lib/powerpc-linux-gnu"); SEARCH_DIR("=/lib/powerpc-linux-gnu"); SEARCH_DIR("=/usr/lib/powerpc-linux-gnu"); SEARCH_DIR("=/usr/local/lib64le"); SEARCH_DIR("=/lib64le"); SEARCH_DIR("=/usr/lib64le"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SEARCH_DIR("=/usr/powerpc64le-linux-gnu/lib64le"); SEARCH_DIR("=/usr/powerpc64le-linux-gnu/lib");
  11. SECTIONS
  12. {
  13. /* Read-only sections, merged into text segment: */
  14. PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
  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. .rela.opd : { *(.rela.opd) }
  25. .rela.init : { *(.rela.init) }
  26. .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  27. .rela.fini : { *(.rela.fini) }
  28. .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  29. .rela.data.rel.ro : { *(.rela.data.rel.ro .rela.data.rel.ro.* .rela.gnu.linkonce.d.rel.ro.*) }
  30. .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
  31. .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
  32. .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
  33. .rela.ctors : { *(.rela.ctors) }
  34. .rela.dtors : { *(.rela.dtors) }
  35. .rela.got : { *(.rela.got) }
  36. .rela.toc : { *(.rela.toc) }
  37. .rela.toc1 : { *(.rela.toc1) }
  38. .rela.tocbss : { *(.rela.tocbss) }
  39. .rela.branch_lt : { *(.rela.branch_lt) }
  40. .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
  41. .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
  42. .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
  43. .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
  44. .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  45. .rela.iplt :
  46. {
  47. PROVIDE_HIDDEN (__rela_iplt_start = .);
  48. *(.rela.iplt)
  49. PROVIDE_HIDDEN (__rela_iplt_end = .);
  50. }
  51. .rela.plt :
  52. {
  53. *(.rela.plt)
  54. }
  55. .init :
  56. {
  57. KEEP (*(SORT_NONE(.init)))
  58. }
  59. .text :
  60. {
  61. *(.text.unlikely .text.*_unlikely .text.unlikely.*)
  62. *(.text.exit .text.exit.*)
  63. *(.text.startup .text.startup.*)
  64. *(.text.hot .text.hot.*)
  65. *(SORT(.text.sorted.*))
  66. *(.text .stub .text.* .gnu.linkonce.t.*)
  67. /* .gnu.warning sections are handled specially by elf.em. */
  68. *(.gnu.warning)
  69. *(.sfpr .glink)
  70. }
  71. .fini :
  72. {
  73. KEEP (*(SORT_NONE(.fini)))
  74. }
  75. PROVIDE (__etext = .);
  76. PROVIDE (_etext = .);
  77. PROVIDE (etext = .);
  78. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  79. .rodata1 : { *(.rodata1) }
  80. .sdata2 :
  81. {
  82. *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
  83. }
  84. .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
  85. .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
  86. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  87. .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  88. .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) }
  89. /* These sections are generated by the Sun/Oracle C++ compiler. */
  90. .exception_ranges : ONLY_IF_RO { *(.exception_ranges*) }
  91. /* Adjust the address for the data segment. We want to adjust up to
  92. the same address within the page on the next page up. */
  93. . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  94. /* Exception handling */
  95. .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  96. .gnu_extab : ONLY_IF_RW { *(.gnu_extab) }
  97. .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  98. .exception_ranges : ONLY_IF_RW { *(.exception_ranges*) }
  99. /* Thread Local Storage sections */
  100. .tdata :
  101. {
  102. PROVIDE_HIDDEN (__tdata_start = .);
  103. *(.tdata .tdata.* .gnu.linkonce.td.*)
  104. }
  105. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  106. .preinit_array :
  107. {
  108. PROVIDE_HIDDEN (__preinit_array_start = .);
  109. KEEP (*(.preinit_array))
  110. PROVIDE_HIDDEN (__preinit_array_end = .);
  111. }
  112. .init_array :
  113. {
  114. PROVIDE_HIDDEN (__init_array_start = .);
  115. KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
  116. KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
  117. PROVIDE_HIDDEN (__init_array_end = .);
  118. }
  119. .fini_array :
  120. {
  121. PROVIDE_HIDDEN (__fini_array_start = .);
  122. KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
  123. KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
  124. PROVIDE_HIDDEN (__fini_array_end = .);
  125. }
  126. .ctors :
  127. {
  128. /* gcc uses crtbegin.o to find the start of
  129. the constructors, so we make sure it is
  130. first. Because this is a wildcard, it
  131. doesn't matter if the user does not
  132. actually link against crtbegin.o; the
  133. linker won't look for a file to match a
  134. wildcard. The wildcard also means that it
  135. doesn't matter which directory crtbegin.o
  136. is in. */
  137. KEEP (*crtbegin.o(.ctors))
  138. KEEP (*crtbegin?.o(.ctors))
  139. /* We don't want to include the .ctor section from
  140. the crtend.o file until after the sorted ctors.
  141. The .ctor section from the crtend file contains the
  142. end of ctors marker and it must be last */
  143. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  144. KEEP (*(SORT(.ctors.*)))
  145. KEEP (*(.ctors))
  146. }
  147. .dtors :
  148. {
  149. KEEP (*crtbegin.o(.dtors))
  150. KEEP (*crtbegin?.o(.dtors))
  151. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  152. KEEP (*(SORT(.dtors.*)))
  153. KEEP (*(.dtors))
  154. }
  155. .jcr : { KEEP (*(.jcr)) }
  156. .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  157. .dynamic : { *(.dynamic) }
  158. .opd : ALIGN(8) { KEEP (*(.opd)) }
  159. .toc1 : ALIGN(8) { *(.toc1) }
  160. .branch_lt : ALIGN(8) { *(.branch_lt) }
  161. .got : ALIGN(256) { *(.got .toc) }
  162. . = DATA_SEGMENT_RELRO_END (0, .);
  163. .toc : ALIGN(8) { *(.toc) }
  164. /* We want the small data sections together, so single-instruction offsets
  165. can access them all, and initialized data all before uninitialized, so
  166. we can shorten the on-disk segment size. */
  167. .sdata :
  168. {
  169. *(.sdata .sdata.* .gnu.linkonce.s.*)
  170. }
  171. .tocbss : ALIGN(8) { *(.tocbss)}
  172. .sbss :
  173. {
  174. *(.dynsbss)
  175. *(.sbss .sbss.* .gnu.linkonce.sb.*)
  176. *(.scommon)
  177. }
  178. .plt : { *(.plt) }
  179. .iplt : { *(.iplt) }
  180. .data :
  181. {
  182. *(.data .data.* .gnu.linkonce.d.*)
  183. SORT(CONSTRUCTORS)
  184. }
  185. .data1 : { *(.data1) }
  186. _edata = .; PROVIDE (edata = .);
  187. . = .;
  188. __bss_start = .;
  189. .bss :
  190. {
  191. *(.dynbss)
  192. *(.bss .bss.* .gnu.linkonce.b.*)
  193. *(COMMON)
  194. /* Align here to ensure that the .bss section occupies space up to
  195. _end. Align after .bss to ensure correct alignment even if the
  196. .bss section disappears because there are no input sections.
  197. FIXME: Why do we need it? When there is no .bss section, we do not
  198. pad the .data section. */
  199. . = ALIGN(. != 0 ? 64 / 8 : 1);
  200. }
  201. . = ALIGN(64 / 8);
  202. . = SEGMENT_START("ldata-segment", .);
  203. . = ALIGN(64 / 8);
  204. _end = .; PROVIDE (end = .);
  205. . = DATA_SEGMENT_END (.);
  206. /* Stabs debugging sections. */
  207. .stab 0 : { *(.stab) }
  208. .stabstr 0 : { *(.stabstr) }
  209. .stab.excl 0 : { *(.stab.excl) }
  210. .stab.exclstr 0 : { *(.stab.exclstr) }
  211. .stab.index 0 : { *(.stab.index) }
  212. .stab.indexstr 0 : { *(.stab.indexstr) }
  213. .comment 0 : { *(.comment) }
  214. .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
  215. /* DWARF debug sections.
  216. Symbols in the DWARF debugging sections are relative to the beginning
  217. of the section so we begin them at 0. */
  218. /* DWARF 1 */
  219. .debug 0 : { *(.debug) }
  220. .line 0 : { *(.line) }
  221. /* GNU DWARF 1 extensions */
  222. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  223. .debug_sfnames 0 : { *(.debug_sfnames) }
  224. /* DWARF 1.1 and DWARF 2 */
  225. .debug_aranges 0 : { *(.debug_aranges) }
  226. .debug_pubnames 0 : { *(.debug_pubnames) }
  227. /* DWARF 2 */
  228. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  229. .debug_abbrev 0 : { *(.debug_abbrev) }
  230. .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
  231. .debug_frame 0 : { *(.debug_frame) }
  232. .debug_str 0 : { *(.debug_str) }
  233. .debug_loc 0 : { *(.debug_loc) }
  234. .debug_macinfo 0 : { *(.debug_macinfo) }
  235. /* SGI/MIPS DWARF 2 extensions */
  236. .debug_weaknames 0 : { *(.debug_weaknames) }
  237. .debug_funcnames 0 : { *(.debug_funcnames) }
  238. .debug_typenames 0 : { *(.debug_typenames) }
  239. .debug_varnames 0 : { *(.debug_varnames) }
  240. /* DWARF 3 */
  241. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  242. .debug_ranges 0 : { *(.debug_ranges) }
  243. /* DWARF Extension. */
  244. .debug_macro 0 : { *(.debug_macro) }
  245. .debug_addr 0 : { *(.debug_addr) }
  246. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  247. /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
  248. }