elf32lppcsim.xdw 9.0 KB

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