elf64lppc.xde 9.8 KB

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