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