elf64lppc.xe 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. /* Script for -z separate-code */
  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. PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
  14. .interp : { *(.interp) }
  15. .note.gnu.build-id : { *(.note.gnu.build-id) }
  16. .hash : { *(.hash) }
  17. .gnu.hash : { *(.gnu.hash) }
  18. .dynsym : { *(.dynsym) }
  19. .dynstr : { *(.dynstr) }
  20. .gnu.version : { *(.gnu.version) }
  21. .gnu.version_d : { *(.gnu.version_d) }
  22. .gnu.version_r : { *(.gnu.version_r) }
  23. .rela.opd : { *(.rela.opd) }
  24. .rela.init : { *(.rela.init) }
  25. .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  26. .rela.fini : { *(.rela.fini) }
  27. .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  28. .rela.data.rel.ro : { *(.rela.data.rel.ro .rela.data.rel.ro.* .rela.gnu.linkonce.d.rel.ro.*) }
  29. .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
  30. .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
  31. .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
  32. .rela.ctors : { *(.rela.ctors) }
  33. .rela.dtors : { *(.rela.dtors) }
  34. .rela.got : { *(.rela.got) }
  35. .rela.toc : { *(.rela.toc) }
  36. .rela.toc1 : { *(.rela.toc1) }
  37. .rela.tocbss : { *(.rela.tocbss) }
  38. .rela.branch_lt : { *(.rela.branch_lt) }
  39. .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
  40. .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
  41. .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
  42. .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
  43. .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  44. .rela.iplt :
  45. {
  46. PROVIDE_HIDDEN (__rela_iplt_start = .);
  47. *(.rela.iplt)
  48. PROVIDE_HIDDEN (__rela_iplt_end = .);
  49. }
  50. .rela.plt :
  51. {
  52. *(.rela.plt)
  53. }
  54. . = ALIGN(CONSTANT (MAXPAGESIZE));
  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. . = ALIGN(CONSTANT (MAXPAGESIZE));
  79. /* Adjust the address for the rodata segment. We want to adjust up to
  80. the same address within the page on the next page up. */
  81. . = SEGMENT_START("rodata-segment", ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)));
  82. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  83. .rodata1 : { *(.rodata1) }
  84. .sdata2 :
  85. {
  86. *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
  87. }
  88. .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
  89. .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
  90. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  91. .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  92. .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) }
  93. /* These sections are generated by the Sun/Oracle C++ compiler. */
  94. .exception_ranges : ONLY_IF_RO { *(.exception_ranges*) }
  95. /* Adjust the address for the data segment. We want to adjust up to
  96. the same address within the page on the next page up. */
  97. . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  98. /* Exception handling */
  99. .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  100. .gnu_extab : ONLY_IF_RW { *(.gnu_extab) }
  101. .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  102. .exception_ranges : ONLY_IF_RW { *(.exception_ranges*) }
  103. /* Thread Local Storage sections */
  104. .tdata :
  105. {
  106. PROVIDE_HIDDEN (__tdata_start = .);
  107. *(.tdata .tdata.* .gnu.linkonce.td.*)
  108. }
  109. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  110. .preinit_array :
  111. {
  112. PROVIDE_HIDDEN (__preinit_array_start = .);
  113. KEEP (*(.preinit_array))
  114. PROVIDE_HIDDEN (__preinit_array_end = .);
  115. }
  116. .init_array :
  117. {
  118. PROVIDE_HIDDEN (__init_array_start = .);
  119. KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
  120. KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
  121. PROVIDE_HIDDEN (__init_array_end = .);
  122. }
  123. .fini_array :
  124. {
  125. PROVIDE_HIDDEN (__fini_array_start = .);
  126. KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
  127. KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
  128. PROVIDE_HIDDEN (__fini_array_end = .);
  129. }
  130. .ctors :
  131. {
  132. /* gcc uses crtbegin.o to find the start of
  133. the constructors, so we make sure it is
  134. first. Because this is a wildcard, it
  135. doesn't matter if the user does not
  136. actually link against crtbegin.o; the
  137. linker won't look for a file to match a
  138. wildcard. The wildcard also means that it
  139. doesn't matter which directory crtbegin.o
  140. is in. */
  141. KEEP (*crtbegin.o(.ctors))
  142. KEEP (*crtbegin?.o(.ctors))
  143. /* We don't want to include the .ctor section from
  144. the crtend.o file until after the sorted ctors.
  145. The .ctor section from the crtend file contains the
  146. end of ctors marker and it must be last */
  147. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  148. KEEP (*(SORT(.ctors.*)))
  149. KEEP (*(.ctors))
  150. }
  151. .dtors :
  152. {
  153. KEEP (*crtbegin.o(.dtors))
  154. KEEP (*crtbegin?.o(.dtors))
  155. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  156. KEEP (*(SORT(.dtors.*)))
  157. KEEP (*(.dtors))
  158. }
  159. .jcr : { KEEP (*(.jcr)) }
  160. .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  161. .dynamic : { *(.dynamic) }
  162. .opd : ALIGN(8) { KEEP (*(.opd)) }
  163. .toc1 : ALIGN(8) { *(.toc1) }
  164. .branch_lt : ALIGN(8) { *(.branch_lt) }
  165. .got : ALIGN(256) { *(.got .toc) }
  166. . = DATA_SEGMENT_RELRO_END (0, .);
  167. .toc : ALIGN(8) { *(.toc) }
  168. /* We want the small data sections together, so single-instruction offsets
  169. can access them all, and initialized data all before uninitialized, so
  170. we can shorten the on-disk segment size. */
  171. .sdata :
  172. {
  173. *(.sdata .sdata.* .gnu.linkonce.s.*)
  174. }
  175. .tocbss : ALIGN(8) { *(.tocbss)}
  176. .sbss :
  177. {
  178. *(.dynsbss)
  179. *(.sbss .sbss.* .gnu.linkonce.sb.*)
  180. *(.scommon)
  181. }
  182. .plt : { *(.plt) }
  183. .iplt : { *(.iplt) }
  184. .data :
  185. {
  186. *(.data .data.* .gnu.linkonce.d.*)
  187. SORT(CONSTRUCTORS)
  188. }
  189. .data1 : { *(.data1) }
  190. _edata = .; PROVIDE (edata = .);
  191. . = .;
  192. __bss_start = .;
  193. .bss :
  194. {
  195. *(.dynbss)
  196. *(.bss .bss.* .gnu.linkonce.b.*)
  197. *(COMMON)
  198. /* Align here to ensure that the .bss section occupies space up to
  199. _end. Align after .bss to ensure correct alignment even if the
  200. .bss section disappears because there are no input sections.
  201. FIXME: Why do we need it? When there is no .bss section, we do not
  202. pad the .data section. */
  203. . = ALIGN(. != 0 ? 64 / 8 : 1);
  204. }
  205. . = ALIGN(64 / 8);
  206. . = SEGMENT_START("ldata-segment", .);
  207. . = ALIGN(64 / 8);
  208. _end = .; PROVIDE (end = .);
  209. . = DATA_SEGMENT_END (.);
  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. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  251. /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
  252. }