elf_k1om.xswe 8.3 KB

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