| 1 |
/* Linker script for normal executables with text, data and BSS in hugepages */ |
| 2 |
OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc", |
| 3 |
"elf64-powerpc") |
| 4 |
OUTPUT_ARCH(powerpc:common64) |
| 5 |
ENTRY(_start) |
| 6 |
SEARCH_DIR("/usr/powerpc64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/powerpc64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); |
| 7 |
INPUT( -lhugetlbfs ); |
| 8 |
PHDRS |
| 9 |
{ |
| 10 |
headers PT_PHDR PHDRS ; |
| 11 |
interp PT_INTERP ; |
| 12 |
htext PT_LOAD FILEHDR PHDRS FLAGS (0x00100005); |
| 13 |
hdata PT_LOAD FLAGS (0x00100007); |
| 14 |
dynamic PT_DYNAMIC ; |
| 15 |
note PT_NOTE ; |
| 16 |
/* this is the value of PT_GNU_EH_FRAME as defined in |
| 17 |
usr/include/elf.h but binutils does not recognize that identifier |
| 18 |
as it does other PT_ constants. */ |
| 19 |
eh_frame_hdr 1685382480 FLAGS (0x00000004); |
| 20 |
} |
| 21 |
SECTIONS |
| 22 |
{ |
| 23 |
/* Read-only sections, merged into text segment: */ |
| 24 |
__executable_start = 0x10000000; . = 0x10000000 + SIZEOF_HEADERS; |
| 25 |
.interp : { *(.interp) } :interp :htext |
| 26 |
.note.SuSE : { *(.note.SuSE) } :htext :note |
| 27 |
.note.ABI-tag : { *(.note.ABI-tag) } :htext :note |
| 28 |
.note.gnu.build-id : { *(.note.gnu.build-id) } :htext :note |
| 29 |
.hash : { *(.hash) } :htext |
| 30 |
.dynsym : { *(.dynsym) } :htext |
| 31 |
.dynstr : { *(.dynstr) } :htext |
| 32 |
.gnu.version : { *(.gnu.version) } :htext |
| 33 |
.gnu.version_d : { *(.gnu.version_d) } :htext |
| 34 |
.gnu.version_r : { *(.gnu.version_r) } :htext |
| 35 |
.rel.init : { *(.rel.init) } :htext |
| 36 |
.rela.init : { *(.rela.init) } :htext |
| 37 |
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } :htext |
| 38 |
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } :htext |
| 39 |
.rel.fini : { *(.rel.fini) } :htext |
| 40 |
.rela.fini : { *(.rela.fini) } :htext |
| 41 |
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } :htext |
| 42 |
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } :htext |
| 43 |
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } :htext |
| 44 |
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } :htext |
| 45 |
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } :htext |
| 46 |
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } :htext |
| 47 |
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } :htext |
| 48 |
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } :htext |
| 49 |
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } :htext |
| 50 |
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } :htext |
| 51 |
.rel.ctors : { *(.rel.ctors) } :htext |
| 52 |
.rela.ctors : { *(.rela.ctors) } :htext |
| 53 |
.rel.dtors : { *(.rel.dtors) } :htext |
| 54 |
.rela.dtors : { *(.rela.dtors) } :htext |
| 55 |
.rel.got : { *(.rel.got) } :htext |
| 56 |
.rela.got : { *(.rela.got) } :htext |
| 57 |
.rela.toc : { *(.rela.toc) } :htext |
| 58 |
.rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } :htext |
| 59 |
.rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) } :htext |
| 60 |
.rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } :htext |
| 61 |
.rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) } :htext |
| 62 |
.rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) } :htext |
| 63 |
.rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) } :htext |
| 64 |
.rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) } :htext |
| 65 |
.rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) } :htext |
| 66 |
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } :htext |
| 67 |
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } :htext |
| 68 |
.rel.plt : { *(.rel.plt) } :htext |
| 69 |
.rela.plt : { *(.rela.plt) } :htext |
| 70 |
.rela.tocbss : { *(.rela.tocbss) } :htext |
| 71 |
.init : |
| 72 |
{ |
| 73 |
KEEP (*(.init)) |
| 74 |
} :htext =0x60000000 |
| 75 |
.text : |
| 76 |
{ |
| 77 |
*(.text .stub .text.* .gnu.linkonce.t.*) |
| 78 |
KEEP (*(.text.*personality*)) |
| 79 |
/* .gnu.warning sections are handled specially by elf32.em. */ |
| 80 |
*(.gnu.warning) |
| 81 |
*(.sfpr .glink) |
| 82 |
} :htext =0x60000000 |
| 83 |
.fini : |
| 84 |
{ |
| 85 |
KEEP (*(.fini)) |
| 86 |
} :htext =0x60000000 |
| 87 |
PROVIDE (__etext = .); |
| 88 |
PROVIDE (_etext = .); |
| 89 |
PROVIDE (etext = .); |
| 90 |
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } :htext |
| 91 |
.rodata1 : { *(.rodata1) } :htext |
| 92 |
.sdata2 : |
| 93 |
{ |
| 94 |
*(.sdata2 .sdata2.* .gnu.linkonce.s2.*) |
| 95 |
} :htext |
| 96 |
.sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } :htext |
| 97 |
.eh_frame_hdr : { *(.eh_frame_hdr) } :htext :eh_frame_hdr |
| 98 |
/* .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } :htext */ |
| 99 |
/* .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } :htext */ |
| 100 |
|
| 101 |
/* We don't maintain address congruence here, because saving |
| 102 |
* hugepages is more important than saving executable size. */ |
| 103 |
. = ALIGN (. + 0x1000000, 0x1000000); /* Align to next 16MB hugepage */ |
| 104 |
/* Exception handling */ |
| 105 |
.eh_frame : /*ONLY_IF_RW*/ { KEEP (*(.eh_frame)) } :hdata |
| 106 |
.gcc_except_table : /*ONLY_IF_RW*/ { *(.gcc_except_table .gcc_except_table.*) } :hdata |
| 107 |
/* Thread Local Storage sections */ |
| 108 |
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } :hdata |
| 109 |
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } :hdata |
| 110 |
.preinit_array : |
| 111 |
{ |
| 112 |
PROVIDE /*_HIDDEN*/ (__preinit_array_start = .); |
| 113 |
KEEP (*(.preinit_array)) |
| 114 |
PROVIDE /*_HIDDEN*/ (__preinit_array_end = .); |
| 115 |
} :hdata |
| 116 |
.init_array : |
| 117 |
{ |
| 118 |
PROVIDE /*_HIDDEN*/ (__init_array_start = .); |
| 119 |
KEEP (*(SORT(.init_array.*))) |
| 120 |
KEEP (*(.init_array)) |
| 121 |
PROVIDE /*_HIDDEN*/ (__init_array_end = .); |
| 122 |
} :hdata |
| 123 |
.fini_array : |
| 124 |
{ |
| 125 |
PROVIDE /*_HIDDEN*/ (__fini_array_start = .); |
| 126 |
KEEP (*(.fini_array)) |
| 127 |
KEEP (*(SORT(.fini_array.*))) |
| 128 |
PROVIDE /*_HIDDEN*/ (__fini_array_end = .); |
| 129 |
} :hdata |
| 130 |
.ctors : |
| 131 |
{ |
| 132 |
/* gcc uses crtbegin.o to find the start of |
| 133 |
the constructors, so we make sure it is |
| 134 |
first. Because this is a wildcard, it |
| 135 |
doesn't matter if the user does not |
| 136 |
actually link against crtbegin.o; the |
| 137 |
linker won't look for a file to match a |
| 138 |
wildcard. The wildcard also means that it |
| 139 |
doesn't matter which directory crtbegin.o |
| 140 |
is in. */ |
| 141 |
KEEP (*crtbegin*.o(.ctors)) |
| 142 |
/* We don't want to include the .ctor section from |
| 143 |
from the crtend.o file until after the sorted ctors. |
| 144 |
The .ctor section from the crtend file contains the |
| 145 |
end of ctors marker and it must be last */ |
| 146 |
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) |
| 147 |
KEEP (*(SORT(.ctors.*))) |
| 148 |
KEEP (*(.ctors)) |
| 149 |
} :hdata |
| 150 |
.dtors : |
| 151 |
{ |
| 152 |
KEEP (*crtbegin*.o(.dtors)) |
| 153 |
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) |
| 154 |
KEEP (*(SORT(.dtors.*))) |
| 155 |
KEEP (*(.dtors)) |
| 156 |
} :hdata |
| 157 |
.jcr : { KEEP (*(.jcr)) } :hdata |
| 158 |
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } :hdata |
| 159 |
.dynamic : { *(.dynamic) } :dynamic :hdata |
| 160 |
/* . = DATA_SEGMENT_RELRO_END (0, .);*/ |
| 161 |
.data : |
| 162 |
{ |
| 163 |
*(.data .data.* .gnu.linkonce.d.*) |
| 164 |
KEEP (*(.gnu.linkonce.d.*personality*)) |
| 165 |
SORT(CONSTRUCTORS) |
| 166 |
} :hdata |
| 167 |
.data1 : { *(.data1)} :hdata |
| 168 |
.toc1 ALIGN(8) : { *(.toc1) } :hdata |
| 169 |
.opd ALIGN(8) : { KEEP (*(.opd)) } :hdata |
| 170 |
.got ALIGN(8) : { *(.got .toc) } :hdata |
| 171 |
/* We want the small data sections together, so single-instruction offsets |
| 172 |
can access them all, and initialized data all before uninitialized, so |
| 173 |
we can shorten the on-disk segment size. */ |
| 174 |
.sdata : |
| 175 |
{ |
| 176 |
*(.sdata .sdata.* .gnu.linkonce.s.*) |
| 177 |
} :hdata |
| 178 |
_edata = .; PROVIDE (edata = .); |
| 179 |
__bss_start = .; |
| 180 |
.tocbss ALIGN(8) : { *(.tocbss)} :hdata |
| 181 |
.sbss : |
| 182 |
{ |
| 183 |
*(.dynsbss) |
| 184 |
*(.sbss .sbss.* .gnu.linkonce.sb.*) |
| 185 |
*(.scommon) |
| 186 |
} :hdata |
| 187 |
.plt : { *(.plt) } :hdata |
| 188 |
.bss : |
| 189 |
{ |
| 190 |
*(.dynbss) |
| 191 |
*(.bss .bss.* .gnu.linkonce.b.*) |
| 192 |
*(COMMON) |
| 193 |
/* |
| 194 |
* Align here to ensure that the .bss section occupies space up to |
| 195 |
* _end. Additionally (for huge pages) align to a segment boundary. |
| 196 |
* This ensures that no normal page mappings will be created in this |
| 197 |
* segment (after the bss) which could interfere with remapping. |
| 198 |
* |
| 199 |
* XXX: This ALIGN will need to be extended to handle the case where |
| 200 |
* ends above 1T -- in which case the alignment should be 1T. |
| 201 |
*/ |
| 202 |
. = ALIGN(256*1024*1024); |
| 203 |
} :hdata |
| 204 |
_end = .; |
| 205 |
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 |
/* DWARF debug sections. |
| 216 |
Symbols in the DWARF debugging sections are relative to the beginning |
| 217 |
of the section so we begin them at 0. */ |
| 218 |
/* DWARF 1 */ |
| 219 |
.debug 0 : { *(.debug) } |
| 220 |
.line 0 : { *(.line) } |
| 221 |
/* GNU DWARF 1 extensions */ |
| 222 |
.debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 223 |
.debug_sfnames 0 : { *(.debug_sfnames) } |
| 224 |
/* DWARF 1.1 and DWARF 2 */ |
| 225 |
.debug_aranges 0 : { *(.debug_aranges) } |
| 226 |
.debug_pubnames 0 : { *(.debug_pubnames) } |
| 227 |
/* DWARF 2 */ |
| 228 |
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
| 229 |
.debug_abbrev 0 : { *(.debug_abbrev) } |
| 230 |
.debug_line 0 : { *(.debug_line) } |
| 231 |
.debug_frame 0 : { *(.debug_frame) } |
| 232 |
.debug_str 0 : { *(.debug_str) } |
| 233 |
.debug_loc 0 : { *(.debug_loc) } |
| 234 |
.debug_macinfo 0 : { *(.debug_macinfo) } |
| 235 |
/* SGI/MIPS DWARF 2 extensions */ |
| 236 |
.debug_weaknames 0 : { *(.debug_weaknames) } |
| 237 |
.debug_funcnames 0 : { *(.debug_funcnames) } |
| 238 |
.debug_typenames 0 : { *(.debug_typenames) } |
| 239 |
.debug_varnames 0 : { *(.debug_varnames) } |
| 240 |
/DISCARD/ : { *(.note.GNU-stack) } |
| 241 |
} |