elf64lppc.xdwe 9.4 KB

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