daily update
[deliverable/binutils-gdb.git] / ld / scripttempl / elf.sc
CommitLineData
252b5132
RH
1#
2# Unusual variables checked by this code:
563e308f 3# NOP - four byte opcode for no-op (defaults to 0)
48459341
L
4# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
5# empty.
951e9133
L
6# SMALL_DATA_CTOR - .ctors contains small data.
7# SMALL_DATA_DTOR - .dtors contains small data.
252b5132
RH
8# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
9# INITIAL_READONLY_SECTIONS - at start of text segment
10# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
11# (e.g., .PARISC.milli)
12# OTHER_TEXT_SECTIONS - these get put in .text when relocating
13# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
14# (e.g., .PARISC.global)
8c37241b
JJ
15# OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
16# (e.g. PPC32 .fixup, .got[12])
904ecb2d 17# OTHER_BSS_SECTIONS - other than .bss .sbss ...
252b5132
RH
18# OTHER_SECTIONS - at the end
19# EXECUTABLE_SYMBOLS - symbols that must be defined for an
20# executable (e.g., _DYNAMIC_LINK)
ba916c8a
MM
21# TEXT_START_ADDR - the first byte of the text segment, after any
22# headers.
23# TEXT_BASE_ADDRESS - the first byte of the text segment.
252b5132
RH
24# TEXT_START_SYMBOLS - symbols that appear at the start of the
25# .text section.
26# DATA_START_SYMBOLS - symbols that appear at the start of the
27# .data section.
28# OTHER_GOT_SYMBOLS - symbols defined just before .got.
5253f23b
AM
29# OTHER_GOT_SECTIONS - sections just after .got.
30# OTHER_SDATA_SECTIONS - sections just after .sdata.
252b5132
RH
31# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
32# .bss section besides __bss_start.
33# DATA_PLT - .plt should be in data segment, not text segment.
b71a5181 34# PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement.
6c86c541 35# BSS_PLT - .plt should be in bss segment
252b5132
RH
36# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
37# EMBEDDED - whether this is for an embedded system.
38# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
39# start address of shared library.
40# INPUT_FILES - INPUT command of files to always include
a8e53fb0 41# WRITABLE_RODATA - if set, the .rodata section should be writable
904ecb2d
JL
42# INIT_START, INIT_END - statements just before and just after
43# combination of .init sections.
44# FINI_START, FINI_END - statements just before and just after
45# combination of .fini sections.
465bc359
AM
46# STACK_ADDR - start of a .stack section.
47# OTHER_END_SYMBOLS - symbols to place right at the end of the script.
8c37241b
JJ
48# SEPARATE_GOTPLT - if set, .got.plt should be separate output section,
49# so that .got can be in the RELRO area. It should be set to
50# the number of bytes in the beginning of .got.plt which can be
51# in the RELRO area as well.
252b5132
RH
52#
53# When adding sections, do note that the names of some sections are used
54# when specifying the start address of the next.
55#
56
d73e9da0
AS
57# Many sections come in three flavours. There is the 'real' section,
58# like ".data". Then there are the per-procedure or per-variable
59# sections, generated by -ffunction-sections and -fdata-sections in GCC,
60# and useful for --gc-sections, which for a variable "foo" might be
61# ".data.foo". Then there are the linkonce sections, for which the linker
62# eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
63# The exact correspondences are:
64#
65# Section Linkonce section
66# .text .gnu.linkonce.t.foo
67# .rodata .gnu.linkonce.r.foo
68# .data .gnu.linkonce.d.foo
69# .bss .gnu.linkonce.b.foo
70# .sdata .gnu.linkonce.s.foo
71# .sbss .gnu.linkonce.sb.foo
72# .sdata2 .gnu.linkonce.s2.foo
73# .sbss2 .gnu.linkonce.sb2.foo
465bc359 74# .debug_info .gnu.linkonce.wi.foo
13ae64f3
JJ
75# .tdata .gnu.linkonce.td.foo
76# .tbss .gnu.linkonce.tb.foo
d73e9da0
AS
77#
78# Each of these can also have corresponding .rel.* and .rela.* sections.
9ac4db9c 79
252b5132
RH
80test -z "$ENTRY" && ENTRY=_start
81test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
82test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
83if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
84test -z "${ELFSIZE}" && ELFSIZE=32
85test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
86test "$LD_FLAG" = "N" && DATA_ADDR=.
9203ba99
JJ
87test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
88test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
8c37241b 89test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
1ddd7b13 90DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
8c37241b
JJ
91DATA_SEGMENT_RELRO_END=""
92DATA_SEGMENT_RELRO_GOTPLT_END=""
2d13d8c5
JJ
93DATA_SEGMENT_END=""
94if test -n "${COMMONPAGESIZE}"; then
1ddd7b13 95 DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
2d13d8c5 96 DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
8c37241b 97 if test -n "${SEPARATE_GOTPLT}"; then
a4f5ad88 98 DATA_SEGMENT_RELRO_GOTPLT_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT}, .);"
8c37241b 99 else
a4f5ad88 100 DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (0, .);"
8c37241b 101 fi
2d20f7bf 102fi
465bc359
AM
103INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
104PLT=".plt ${RELOCATING-0} : { *(.plt) }"
8c37241b
JJ
105if test -z "$GOT"; then
106 if test -z "$SEPARATE_GOTPLT"; then
107 GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
108 else
109 GOT=".got ${RELOCATING-0} : { *(.got) }"
a4f5ad88
JJ
110 GOTPLT="${RELOCATING+${DATA_SEGMENT_RELRO_GOTPLT_END}}
111 .got.plt ${RELOCATING-0} : { *(.got.plt) }"
8c37241b
JJ
112 fi
113fi
465bc359
AM
114DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
115RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
8c37241b 116DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }"
9ee5e499 117STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
48459341
L
118if test -z "${NO_SMALL_DATA}"; then
119 SBSS=".sbss ${RELOCATING-0} :
120 {
121 ${RELOCATING+PROVIDE (__sbss_start = .);}
122 ${RELOCATING+PROVIDE (___sbss_start = .);}
123 *(.dynsbss)
124 *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
125 *(.scommon)
126 ${RELOCATING+PROVIDE (__sbss_end = .);}
127 ${RELOCATING+PROVIDE (___sbss_end = .);}
128 }"
129 SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
130 SDATA="/* We want the small data sections together, so single-instruction offsets
131 can access them all, and initialized data all before uninitialized, so
132 we can shorten the on-disk segment size. */
133 .sdata ${RELOCATING-0} :
134 {
135 ${RELOCATING+${SDATA_START_SYMBOLS}}
136 *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
137 }"
138 SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
139 REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
140 .rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
141 REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
142 .rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
143 REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
144 .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
145 REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
146 .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
8c37241b
JJ
147else
148 NO_SMALL_DATA=" "
48459341 149fi
8c37241b 150test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
465bc359 151CTOR=".ctors ${CONSTRUCTING-0} :
252b5132
RH
152 {
153 ${CONSTRUCTING+${CTOR_START}}
154 /* gcc uses crtbegin.o to find the start of
155 the constructors, so we make sure it is
156 first. Because this is a wildcard, it
157 doesn't matter if the user does not
158 actually link against crtbegin.o; the
159 linker won't look for a file to match a
160 wildcard. The wildcard also means that it
161 doesn't matter which directory crtbegin.o
162 is in. */
163
877d60f7 164 KEEP (*crtbegin*.o(.ctors))
252b5132
RH
165
166 /* We don't want to include the .ctor section from
167 from the crtend.o file until after the sorted ctors.
168 The .ctor section from the crtend file contains the
169 end of ctors marker and it must be last */
170
877d60f7 171 KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
252b5132
RH
172 KEEP (*(SORT(.ctors.*)))
173 KEEP (*(.ctors))
174 ${CONSTRUCTING+${CTOR_END}}
175 }"
465bc359 176DTOR=".dtors ${CONSTRUCTING-0} :
252b5132
RH
177 {
178 ${CONSTRUCTING+${DTOR_START}}
877d60f7
AM
179 KEEP (*crtbegin*.o(.dtors))
180 KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
252b5132
RH
181 KEEP (*(SORT(.dtors.*)))
182 KEEP (*(.dtors))
183 ${CONSTRUCTING+${DTOR_END}}
184 }"
465bc359
AM
185STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
186 {
187 ${RELOCATING+_stack = .;}
188 *(.stack)
189 }"
252b5132
RH
190
191# if this is for an embedded system, don't add SIZEOF_HEADERS.
192if [ -z "$EMBEDDED" ]; then
193 test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS"
194else
195 test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
196fi
197
198cat <<EOF
199OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
200 "${LITTLE_OUTPUT_FORMAT}")
201OUTPUT_ARCH(${OUTPUT_ARCH})
202ENTRY(${ENTRY})
203
204${RELOCATING+${LIB_SEARCH_DIRS}}
205${RELOCATING+/* Do we need any of these for elf?
206 __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
207${RELOCATING+${EXECUTABLE_SYMBOLS}}
208${RELOCATING+${INPUT_FILES}}
209${RELOCATING- /* For some reason, the Solaris linker makes bad executables
210 if gld -r is used and the intermediate file has sections starting
211 at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
212 bug. But for now assigning the zero vmas works. */}
213
214SECTIONS
215{
216 /* Read-only sections, merged into text segment: */
c6d3b05f 217 ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
252b5132 218 ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
36af4a4e 219 ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
252b5132
RH
220 ${CREATE_SHLIB-${INTERP}}
221 ${INITIAL_READONLY_SECTIONS}
222 ${TEXT_DYNAMIC+${DYNAMIC}}
465bc359
AM
223 .hash ${RELOCATING-0} : { *(.hash) }
224 .dynsym ${RELOCATING-0} : { *(.dynsym) }
225 .dynstr ${RELOCATING-0} : { *(.dynstr) }
226 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
227 .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
228 .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
9e4141bc 229
db6751f2
JJ
230EOF
231if [ "x$COMBRELOC" = x ]; then
232 COMBRELOCCAT=cat
233else
234 COMBRELOCCAT="cat > $COMBRELOC"
235fi
236eval $COMBRELOCCAT <<EOF
465bc359
AM
237 .rel.init ${RELOCATING-0} : { *(.rel.init) }
238 .rela.init ${RELOCATING-0} : { *(.rela.init) }
239 .rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
240 .rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
241 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
242 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
243 .rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
244 .rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
9e4141bc 245 ${OTHER_READONLY_RELOC_SECTIONS}
8c37241b
JJ
246 .rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) }
247 .rela.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) }
465bc359
AM
248 .rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
249 .rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
13ae64f3
JJ
250 .rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
251 .rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
252 .rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
253 .rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
465bc359
AM
254 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
255 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
256 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
257 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
258 .rel.got ${RELOCATING-0} : { *(.rel.got) }
259 .rela.got ${RELOCATING-0} : { *(.rela.got) }
9e4141bc 260 ${OTHER_GOT_RELOC_SECTIONS}
48459341
L
261 ${REL_SDATA}
262 ${REL_SBSS}
263 ${REL_SDATA2}
264 ${REL_SBSS2}
465bc359
AM
265 .rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
266 .rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
db6751f2
JJ
267EOF
268if [ -n "$COMBRELOC" ]; then
269cat <<EOF
465bc359 270 .rel.dyn ${RELOCATING-0} :
db6751f2
JJ
271 {
272EOF
273sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC
274cat <<EOF
275 }
465bc359 276 .rela.dyn ${RELOCATING-0} :
db6751f2
JJ
277 {
278EOF
279sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC
280cat <<EOF
281 }
282EOF
283fi
284cat <<EOF
465bc359
AM
285 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
286 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
9e673ad1 287 ${OTHER_PLT_RELOC_SECTIONS}
9e4141bc 288
465bc359 289 .init ${RELOCATING-0} :
4ab10e93 290 {
53db15ed 291 ${RELOCATING+${INIT_START}}
4ab10e93 292 KEEP (*(.init))
53db15ed 293 ${RELOCATING+${INIT_END}}
4ab10e93
GK
294 } =${NOP-0}
295
6c86c541 296 ${DATA_PLT-${BSS_PLT-${PLT}}}
465bc359 297 .text ${RELOCATING-0} :
252b5132
RH
298 {
299 ${RELOCATING+${TEXT_START_SYMBOLS}}
465bc359 300 *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
a85bf78e 301 KEEP (*(.text.*personality*))
252b5132
RH
302 /* .gnu.warning sections are handled specially by elf32.em. */
303 *(.gnu.warning)
252b5132
RH
304 ${RELOCATING+${OTHER_TEXT_SECTIONS}}
305 } =${NOP-0}
465bc359 306 .fini ${RELOCATING-0} :
904ecb2d 307 {
53db15ed 308 ${RELOCATING+${FINI_START}}
904ecb2d 309 KEEP (*(.fini))
53db15ed 310 ${RELOCATING+${FINI_END}}
904ecb2d 311 } =${NOP-0}
6c86c541
GK
312 ${RELOCATING+PROVIDE (__etext = .);}
313 ${RELOCATING+PROVIDE (_etext = .);}
314 ${RELOCATING+PROVIDE (etext = .);}
a8e53fb0 315 ${WRITABLE_RODATA-${RODATA}}
465bc359 316 .rodata1 ${RELOCATING-0} : { *(.rodata1) }
6c86c541
GK
317 ${CREATE_SHLIB-${SDATA2}}
318 ${CREATE_SHLIB-${SBSS2}}
465bc359 319 ${OTHER_READONLY_SECTIONS}
65765700 320 .eh_frame_hdr : { *(.eh_frame_hdr) }
0841712e 321 .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
dfff4fbe 322 .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
252b5132
RH
323
324 /* Adjust the address for the data segment. We want to adjust up to
325 the same address within the page on the next page up. */
9203ba99 326 ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
2d20f7bf 327 ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
9203ba99 328 ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
252b5132 329
8c37241b 330 /* Exception handling */
0841712e 331 .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
dfff4fbe 332 .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
8c37241b
JJ
333
334 /* Thread Local Storage sections */
335 .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
336 .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
337
b5090659
L
338 /* Ensure the __preinit_array_start label is properly aligned. We
339 could instead move the label definition inside the section, but
340 the linker would then create the section even if it turns out to
341 be empty, which isn't pretty. */
342 ${RELOCATING+. = ALIGN(${ALIGNMENT});}
343 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
7b89fa29 344 .preinit_array ${RELOCATING-0} : { KEEP (*(.preinit_array)) }
b5090659
L
345 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
346
347 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .);}}
7b89fa29 348 .init_array ${RELOCATING-0} : { KEEP (*(.init_array)) }
b5090659
L
349 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
350
351 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
7b89fa29 352 .fini_array ${RELOCATING-0} : { KEEP (*(.fini_array)) }
b5090659
L
353 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
354
951e9133
L
355 ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
356 ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
8c37241b
JJ
357 .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
358
359 ${RELOCATING+${DATARELRO}}
360 ${OTHER_RELRO_SECTIONS}
361 ${TEXT_DYNAMIC-${DYNAMIC}}
362 ${NO_SMALL_DATA+${RELRO_NOW+${GOT}}}
363 ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
364 ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT+${GOTPLT}}}}
365 ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
366 ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
367
b71a5181 368 ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
8c37241b 369
465bc359 370 .data ${RELOCATING-0} :
252b5132
RH
371 {
372 ${RELOCATING+${DATA_START_SYMBOLS}}
465bc359 373 *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
a85bf78e 374 KEEP (*(.gnu.linkonce.d.*personality*))
252b5132
RH
375 ${CONSTRUCTING+SORT(CONSTRUCTORS)}
376 }
465bc359 377 .data1 ${RELOCATING-0} : { *(.data1) }
a8e53fb0 378 ${WRITABLE_RODATA+${RODATA}}
465bc359 379 ${OTHER_READWRITE_SECTIONS}
951e9133
L
380 ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
381 ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
b71a5181 382 ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
252b5132 383 ${RELOCATING+${OTHER_GOT_SYMBOLS}}
8c37241b 384 ${NO_SMALL_DATA-${GOT}}
465bc359 385 ${OTHER_GOT_SECTIONS}
6c86c541
GK
386 ${CREATE_SHLIB+${SDATA2}}
387 ${CREATE_SHLIB+${SBSS2}}
48459341 388 ${SDATA}
465bc359 389 ${OTHER_SDATA_SECTIONS}
9e4141bc 390 ${RELOCATING+_edata = .;}
252b5132
RH
391 ${RELOCATING+PROVIDE (edata = .);}
392 ${RELOCATING+__bss_start = .;}
393 ${RELOCATING+${OTHER_BSS_SYMBOLS}}
48459341 394 ${SBSS}
6c86c541 395 ${BSS_PLT+${PLT}}
465bc359 396 .bss ${RELOCATING-0} :
252b5132
RH
397 {
398 *(.dynbss)
465bc359 399 *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
252b5132
RH
400 *(COMMON)
401 /* Align here to ensure that the .bss section occupies space up to
402 _end. Align after .bss to ensure correct alignment even if the
403 .bss section disappears because there are no input sections. */
404 ${RELOCATING+. = ALIGN(${ALIGNMENT});}
405 }
465bc359 406 ${OTHER_BSS_SECTIONS}
252b5132 407 ${RELOCATING+. = ALIGN(${ALIGNMENT});}
9e4141bc 408 ${RELOCATING+_end = .;}
252b5132
RH
409 ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
410 ${RELOCATING+PROVIDE (end = .);}
2d13d8c5 411 ${RELOCATING+${DATA_SEGMENT_END}}
252b5132
RH
412
413 /* Stabs debugging sections. */
465bc359
AM
414 .stab 0 : { *(.stab) }
415 .stabstr 0 : { *(.stabstr) }
416 .stab.excl 0 : { *(.stab.excl) }
417 .stab.exclstr 0 : { *(.stab.exclstr) }
418 .stab.index 0 : { *(.stab.index) }
252b5132
RH
419 .stab.indexstr 0 : { *(.stab.indexstr) }
420
465bc359 421 .comment 0 : { *(.comment) }
252b5132
RH
422
423 /* DWARF debug sections.
424 Symbols in the DWARF debugging sections are relative to the beginning
425 of the section so we begin them at 0. */
426
427 /* DWARF 1 */
428 .debug 0 : { *(.debug) }
429 .line 0 : { *(.line) }
430
431 /* GNU DWARF 1 extensions */
432 .debug_srcinfo 0 : { *(.debug_srcinfo) }
433 .debug_sfnames 0 : { *(.debug_sfnames) }
434
435 /* DWARF 1.1 and DWARF 2 */
436 .debug_aranges 0 : { *(.debug_aranges) }
437 .debug_pubnames 0 : { *(.debug_pubnames) }
438
439 /* DWARF 2 */
465bc359 440 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
252b5132
RH
441 .debug_abbrev 0 : { *(.debug_abbrev) }
442 .debug_line 0 : { *(.debug_line) }
443 .debug_frame 0 : { *(.debug_frame) }
444 .debug_str 0 : { *(.debug_str) }
445 .debug_loc 0 : { *(.debug_loc) }
446 .debug_macinfo 0 : { *(.debug_macinfo) }
447
448 /* SGI/MIPS DWARF 2 extensions */
449 .debug_weaknames 0 : { *(.debug_weaknames) }
450 .debug_funcnames 0 : { *(.debug_funcnames) }
451 .debug_typenames 0 : { *(.debug_typenames) }
452 .debug_varnames 0 : { *(.debug_varnames) }
453
465bc359 454 ${STACK_ADDR+${STACK}}
252b5132 455 ${OTHER_SECTIONS}
465bc359 456 ${RELOCATING+${OTHER_END_SYMBOLS}}
9ee5e499 457 ${RELOCATING+${STACKNOTE}}
252b5132
RH
458}
459EOF
This page took 0.256045 seconds and 4 git commands to generate.