elf_x86_64.xr 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* Script for -r */
  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-x86-64", "elf64-x86-64",
  7. "elf64-x86-64")
  8. OUTPUT_ARCH(i386:x86-64)
  9. /* For some reason, the Solaris linker makes bad executables
  10. if gld -r is used and the intermediate file has sections starting
  11. at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
  12. bug. But for now assigning the zero vmas works. */
  13. SECTIONS
  14. {
  15. .interp 0 : { *(.interp) }
  16. .note.gnu.build-id 0: { *(.note.gnu.build-id) }
  17. .hash 0 : { *(.hash) }
  18. .gnu.hash 0 : { *(.gnu.hash) }
  19. .dynsym 0 : { *(.dynsym) }
  20. .dynstr 0 : { *(.dynstr) }
  21. .gnu.version 0 : { *(.gnu.version) }
  22. .gnu.version_d 0: { *(.gnu.version_d) }
  23. .gnu.version_r 0: { *(.gnu.version_r) }
  24. .rela.init 0 : { *(.rela.init) }
  25. .rela.text 0 : { *(.rela.text) }
  26. .rela.fini 0 : { *(.rela.fini) }
  27. .rela.rodata 0 : { *(.rela.rodata) }
  28. .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
  29. .rela.data 0 : { *(.rela.data) }
  30. .rela.tdata 0 : { *(.rela.tdata) }
  31. .rela.tbss 0 : { *(.rela.tbss) }
  32. .rela.ctors 0 : { *(.rela.ctors) }
  33. .rela.dtors 0 : { *(.rela.dtors) }
  34. .rela.got 0 : { *(.rela.got) }
  35. .rela.bss 0 : { *(.rela.bss) }
  36. .rela.ldata 0 : { *(.rela.ldata) }
  37. .rela.lbss 0 : { *(.rela.lbss) }
  38. .rela.lrodata 0 : { *(.rela.lrodata) }
  39. .rela.ifunc 0 : { *(.rela.ifunc) }
  40. .rela.plt 0 :
  41. {
  42. *(.rela.plt)
  43. }
  44. .init 0 :
  45. {
  46. KEEP (*(SORT_NONE(.init)))
  47. }
  48. .plt 0 : { *(.plt) }
  49. .plt.got 0 : { *(.plt.got) }
  50. .plt.sec 0 : { *(.plt.sec) }
  51. .text 0 :
  52. {
  53. *(.text .stub)
  54. /* .gnu.warning sections are handled specially by elf.em. */
  55. *(.gnu.warning)
  56. }
  57. .fini 0 :
  58. {
  59. KEEP (*(SORT_NONE(.fini)))
  60. }
  61. .rodata 0 : { *(.rodata) }
  62. .rodata1 0 : { *(.rodata1) }
  63. .eh_frame_hdr 0 : { *(.eh_frame_hdr) }
  64. .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  65. .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table) }
  66. .gnu_extab 0 : ONLY_IF_RO { *(.gnu_extab*) }
  67. /* These sections are generated by the Sun/Oracle C++ compiler. */
  68. .exception_ranges 0 : ONLY_IF_RO { *(.exception_ranges) }
  69. /* Exception handling */
  70. .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  71. .gnu_extab 0 : ONLY_IF_RW { *(.gnu_extab) }
  72. .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table) }
  73. .exception_ranges 0 : ONLY_IF_RW { *(.exception_ranges) }
  74. /* Thread Local Storage sections */
  75. .tdata 0 :
  76. {
  77. *(.tdata)
  78. }
  79. .tbss 0 : { *(.tbss) }
  80. .jcr 0 : { KEEP (*(.jcr)) }
  81. .dynamic 0 : { *(.dynamic) }
  82. .got 0 : { *(.got) }
  83. .got.plt 0 : { *(.got.plt) }
  84. .data 0 :
  85. {
  86. *(.data)
  87. }
  88. .data1 0 : { *(.data1) }
  89. .bss 0 :
  90. {
  91. *(.bss)
  92. }
  93. .lbss 0 :
  94. {
  95. *(.lbss)
  96. }
  97. .lrodata 0 :
  98. {
  99. *(.lrodata)
  100. }
  101. .ldata 0 :
  102. {
  103. *(.ldata)
  104. }
  105. /* Stabs debugging sections. */
  106. .stab 0 : { *(.stab) }
  107. .stabstr 0 : { *(.stabstr) }
  108. .stab.excl 0 : { *(.stab.excl) }
  109. .stab.exclstr 0 : { *(.stab.exclstr) }
  110. .stab.index 0 : { *(.stab.index) }
  111. .stab.indexstr 0 : { *(.stab.indexstr) }
  112. .comment 0 : { *(.comment) }
  113. .gnu.build.attributes : { *(.gnu.build.attributes) }
  114. /* DWARF debug sections.
  115. Symbols in the DWARF debugging sections are relative to the beginning
  116. of the section so we begin them at 0. */
  117. /* DWARF 1 */
  118. .debug 0 : { *(.debug) }
  119. .line 0 : { *(.line) }
  120. /* GNU DWARF 1 extensions */
  121. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  122. .debug_sfnames 0 : { *(.debug_sfnames) }
  123. /* DWARF 1.1 and DWARF 2 */
  124. .debug_aranges 0 : { *(.debug_aranges) }
  125. .debug_pubnames 0 : { *(.debug_pubnames) }
  126. /* DWARF 2 */
  127. .debug_info 0 : { *(.debug_info) }
  128. .debug_abbrev 0 : { *(.debug_abbrev) }
  129. .debug_line 0 : { *(.debug_line) }
  130. .debug_frame 0 : { *(.debug_frame) }
  131. .debug_str 0 : { *(.debug_str) }
  132. .debug_loc 0 : { *(.debug_loc) }
  133. .debug_macinfo 0 : { *(.debug_macinfo) }
  134. /* SGI/MIPS DWARF 2 extensions */
  135. .debug_weaknames 0 : { *(.debug_weaknames) }
  136. .debug_funcnames 0 : { *(.debug_funcnames) }
  137. .debug_typenames 0 : { *(.debug_typenames) }
  138. .debug_varnames 0 : { *(.debug_varnames) }
  139. /* DWARF 3 */
  140. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  141. .debug_ranges 0 : { *(.debug_ranges) }
  142. /* DWARF Extension. */
  143. .debug_macro 0 : { *(.debug_macro) }
  144. .debug_addr 0 : { *(.debug_addr) }
  145. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  146. }