PR24786, wrong LMA if first section in overlay is empty
[external/binutils.git] / ld / scripttempl / armbpabi.sc
1 # This variant of elf.sc is used for ARM BPABI platforms, like Symbian
2 # OS, where a separate postlinker will operated on the generated
3 # executable or shared object.  See elf.sc for configuration variables
4 # that apply; only BPABI-specific variables will be noted here.
5 #
6 # Copyright (C) 2014-2019 Free Software Foundation, Inc.
7 #
8 # Copying and distribution of this file, with or without modification,
9 # are permitted in any medium without royalty provided the copyright
10 # notice and this notice are preserved.
11
12 test -z "$ENTRY" && ENTRY=_start
13 test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
14 test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
15 if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
16 test -z "${ELFSIZE}" && ELFSIZE=32
17 test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
18 test "$LD_FLAG" = "N" && DATA_ADDR=.
19 test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
20 test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
21 test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
22 DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
23 DATA_SEGMENT_RELRO_END=""
24 DATA_SEGMENT_RELRO_GOTPLT_END=""
25 DATA_SEGMENT_END=""
26 if test -n "${COMMONPAGESIZE}"; then
27   DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
28   DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
29   if test -n "${SEPARATE_GOTPLT}"; then
30     DATA_SEGMENT_RELRO_GOTPLT_END=". = DATA_SEGMENT_RELRO_END (. + ${SEPARATE_GOTPLT});"
31   else
32     DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (.);"
33   fi
34 fi
35 INTERP=".interp       0 : { *(.interp) }"
36 PLT=".plt          ${RELOCATING-0} : { *(.plt) }"
37 RODATA=".rodata       ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
38 DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro .data.rel.ro.*) }"
39 DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink)  *(.gnu.lto_*) }"
40 if test -z "${NO_SMALL_DATA}"; then
41   SBSS=".sbss         ${RELOCATING-0} :
42   {
43     ${RELOCATING+PROVIDE (__sbss_start = .);}
44     ${RELOCATING+PROVIDE (___sbss_start = .);}
45     ${RELOCATING+*(.dynsbss)}
46     *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
47     ${RELOCATING+*(.scommon)}
48     ${RELOCATING+PROVIDE (__sbss_end = .);}
49     ${RELOCATING+PROVIDE (___sbss_end = .);}
50   }"
51   SBSS2=".sbss2        ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
52   SDATA="/* We want the small data sections together, so single-instruction offsets
53      can access them all, and initialized data all before uninitialized, so
54      we can shorten the on-disk segment size.  */
55   .sdata        ${RELOCATING-0} :
56   {
57     ${RELOCATING+${SDATA_START_SYMBOLS}}
58     *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
59   }"
60   SDATA2=".sdata2       ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
61   REL_SDATA=".rel.sdata    ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
62   .rela.sdata   ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
63   REL_SBSS=".rel.sbss     ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
64   .rela.sbss    ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
65   REL_SDATA2=".rel.sdata2   ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
66   .rela.sdata2  ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
67   REL_SBSS2=".rel.sbss2    ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
68   .rela.sbss2   ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
69 else
70   NO_SMALL_DATA=" "
71 fi
72 test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
73 INIT_ARRAY=".init_array   ${RELOCATING-0} :
74   {
75     /* SymbianOS uses this symbol.  */
76     ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Base = .);}
77     ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_start = .);}}
78     KEEP (*(SORT(.init_array.*)))
79     KEEP (*(.init_array))
80     ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_end = .);}}
81     /* SymbianOS uses this symbol.  */
82     ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Limit = .);}
83   }"
84 FINI_ARRAY=".fini_array   ${RELOCATING-0} :
85   {
86     ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_start = .);}}
87     KEEP (*(SORT(.fini_array.*)))
88     KEEP (*(.fini_array))
89     ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_end = .);}}
90   }"
91 CTOR=".ctors        ${CONSTRUCTING-0} :
92   {
93     ${CONSTRUCTING+${CTOR_START}}
94     /* gcc uses crtbegin.o to find the start of
95        the constructors, so we make sure it is
96        first.  Because this is a wildcard, it
97        doesn't matter if the user does not
98        actually link against crtbegin.o; the
99        linker won't look for a file to match a
100        wildcard.  The wildcard also means that it
101        doesn't matter which directory crtbegin.o
102        is in.  */
103
104     KEEP (*crtbegin.o(.ctors))
105     KEEP (*crtbegin?.o(.ctors))
106
107     /* We don't want to include the .ctor section from
108        the crtend.o file until after the sorted ctors.
109        The .ctor section from the crtend file contains the
110        end of ctors marker and it must be last */
111
112     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
113     KEEP (*(SORT(.ctors.*)))
114     KEEP (*(.ctors))
115     ${CONSTRUCTING+${CTOR_END}}
116   }"
117 DTOR=".dtors        ${CONSTRUCTING-0} :
118   {
119     ${CONSTRUCTING+${DTOR_START}}
120     KEEP (*crtbegin.o(.dtors))
121     KEEP (*crtbegin?.o(.dtors))
122     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
123     KEEP (*(SORT(.dtors.*)))
124     KEEP (*(.dtors))
125     ${CONSTRUCTING+${DTOR_END}}
126   }"
127 STACK="  .stack        ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
128   {
129     ${RELOCATING+_stack = .;}
130     *(.stack)
131   }"
132
133 TEXT_START_ADDR="SEGMENT_START(\"text\", ${TEXT_START_ADDR})"
134 SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text\", ${SHLIB_TEXT_START_ADDR:-0})"
135 DATA_ADDR="SEGMENT_START(\"data\", ${DATA_ADDR-${DATA_SEGMENT_ALIGN}})"
136 SHLIB_DATA_ADDR="SEGMENT_START(\"data\", ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}})"
137
138 # If this is for an embedded system, don't add SIZEOF_HEADERS.
139 if [ -z "$EMBEDDED" ]; then
140    test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS"
141    SHLIB_BASE_ADDRESS="${SHLIB_TEXT_START_ADDR} + SIZEOF_HEADERS"
142 else
143    test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
144    SHLIB_BASE_ADDRESS="${SHLIB_TEXT_START_ADDR}"
145 fi
146
147 cat <<EOF
148 /* Copyright (C) 2014-2019 Free Software Foundation, Inc.
149
150    Copying and distribution of this script, with or without modification,
151    are permitted in any medium without royalty provided the copyright
152    notice and this notice are preserved.  */
153
154 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
155               "${LITTLE_OUTPUT_FORMAT}")
156 OUTPUT_ARCH(${OUTPUT_ARCH})
157 EOF
158
159 test -n "${RELOCATING}" && cat <<EOF
160 ENTRY(${ENTRY})
161
162 ${LIB_SEARCH_DIRS}
163 /* Do we need any of these for elf?
164    __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}}  */
165 ${EXECUTABLE_SYMBOLS}
166 ${INPUT_FILES}
167
168 /* ARM's proprietary toolchain generate these symbols to match the start
169    and end of particular sections of the image.  SymbianOS uses these
170    symbols.  We provide them for compatibility with ARM's toolchains.
171    These symbols should be bound locally; each shared object may define
172    its own version of these symbols.  */
173
174 VERSION
175 {
176   /* Give these a dummy version to work around linker lameness.
177      The name used shouldn't matter as these are all local symbols.  */
178   __GNU {
179     local:
180       Image\$\$ER_RO\$\$Base;
181       Image\$\$ER_RO\$\$Limit;
182       SHT\$\$INIT_ARRAY\$\$Base;
183       SHT\$\$INIT_ARRAY\$\$Limit;
184       .ARM.exidx\$\$Base;
185       .ARM.exidx\$\$Limit;
186   };
187 }
188
189 EOF
190
191 cat <<EOF
192 SECTIONS
193 {
194   /* Read-only sections, merged into text segment: */
195   ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR});}}}
196
197   ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+ . = ${TEXT_BASE_ADDRESS};}}}
198   ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_BASE_ADDRESS};}}
199   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_BASE_ADDRESS};}}
200
201   /* Define Image\$\$ER_RO\$\$Base.  */
202   ${RELOCATING+PROVIDE (Image\$\$ER_RO\$\$Base = .);}
203
204   ${INITIAL_READONLY_SECTIONS}
205
206 EOF
207 cat <<EOF
208   .init         ${RELOCATING-0} :
209   {
210     ${RELOCATING+${INIT_START}}
211     KEEP (*(SORT_NONE(.init)))
212     ${RELOCATING+${INIT_END}}
213   } =${NOP-0}
214   .text         ${RELOCATING-0} :
215   {
216     ${RELOCATING+${TEXT_START_SYMBOLS}}
217     *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
218     /* .gnu.warning sections are handled specially by elf32.em.  */
219     *(.gnu.warning)
220     ${RELOCATING+${OTHER_TEXT_SECTIONS}}
221   } =${NOP-0}
222   .fini         ${RELOCATING-0} :
223   {
224     ${RELOCATING+${FINI_START}}
225     KEEP (*(SORT_NONE(.fini)))
226     ${RELOCATING+${FINI_END}}
227   } =${NOP-0}
228   /* The SymbianOS kernel requires that the PLT go at the end of the
229      text section.  */
230   ${DATA_PLT-${BSS_PLT-${PLT}}}
231   ${RELOCATING+PROVIDE (__etext = .);}
232   ${RELOCATING+PROVIDE (_etext = .);}
233   ${RELOCATING+PROVIDE (etext = .);}
234
235   /* Define Image\$\$ER_RO\$\$Limit.  */
236   ${RELOCATING+PROVIDE (Image\$\$ER_RO\$\$Limit = .);}
237
238   ${WRITABLE_RODATA-${RODATA}}
239   .rodata1      ${RELOCATING-0} : { *(.rodata1) }
240   ${CREATE_SHLIB-${SDATA2}}
241   ${CREATE_SHLIB-${SBSS2}}
242
243   /* On SymbianOS, put  .init_array and friends in the read-only
244      segment; there is no runtime relocation applied to these
245      arrays.  */
246
247   .preinit_array   ${RELOCATING-0} :
248   {
249     ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_start = .);}}
250     KEEP (*(.preinit_array))
251     ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_end = .);}}
252   }
253   ${RELOCATING+${INIT_ARRAY}}
254   ${RELOCATING+${FINI_ARRAY}}
255
256   ${OTHER_READONLY_SECTIONS}
257   .eh_frame_hdr ${RELOCATING-0} : { *(.eh_frame_hdr) }
258   .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
259   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table${RELOCATING+ .gcc_except_table.*})) }
260
261   /* Adjust the address for the data segment.  We want to adjust up to
262      the same address within the page on the next page up.  */
263   ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR};}}}
264   ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR};}}
265   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR};}}
266
267   /* Exception handling  */
268   .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
269   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table${RELOCATING+ .gcc_except_table.*})) }
270
271   /* Thread Local Storage sections  */
272   .tdata        ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
273   .tbss         ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
274
275   ${RELOCATING+${CTOR}}
276   ${RELOCATING+${DTOR}}
277   .jcr          ${RELOCATING-0} : { KEEP (*(.jcr)) }
278
279   ${RELOCATING+${DATARELRO}}
280   ${OTHER_RELRO_SECTIONS}
281   ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
282
283   ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
284
285   .data         ${RELOCATING-0} :
286   {
287     ${RELOCATING+${DATA_START_SYMBOLS}}
288     *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
289     ${CONSTRUCTING+SORT(CONSTRUCTORS)}
290   }
291   .data1        ${RELOCATING-0} : { *(.data1) }
292   ${WRITABLE_RODATA+${RODATA}}
293   ${OTHER_READWRITE_SECTIONS}
294   ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
295   ${CREATE_SHLIB+${SDATA2}}
296   ${CREATE_SHLIB+${SBSS2}}
297   ${SDATA}
298   ${OTHER_SDATA_SECTIONS}
299   ${RELOCATING+_edata = .;}
300   ${RELOCATING+PROVIDE (edata = .);}
301   ${RELOCATING+. = DEFINED(__bss_segment_start) ? __bss_segment_start : .;}
302   ${RELOCATING+__bss_start = .;}
303   ${RELOCATING+${OTHER_BSS_SYMBOLS}}
304   ${SBSS}
305   ${BSS_PLT+${PLT}}
306   .bss          ${RELOCATING-0} :
307   {
308    ${RELOCATING+*(.dynbss)}
309    *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
310    ${RELOCATING+*(COMMON)
311    /* Align here to ensure that the .bss section occupies space up to
312       _end.  Align after .bss to ensure correct alignment even if the
313       .bss section disappears because there are no input sections.  */
314    . = ALIGN(${ALIGNMENT});}
315   }
316   ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
317   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
318   ${RELOCATING+${OTHER_END_SYMBOLS}}
319   ${RELOCATING+_end = .;}
320   ${RELOCATING+PROVIDE (end = .);}
321   ${RELOCATING+${DATA_SEGMENT_END}}
322   ${STACK_ADDR+${STACK}}
323
324   /* These sections are not mapped under the BPABI.  */
325   .dynamic      0 : { *(.dynamic) }
326   .hash         0 : { *(.hash) }
327   .dynsym       0 : { *(.dynsym) }
328   .dynstr       0 : { *(.dynstr) }
329   .gnu.version  0 : { *(.gnu.version) }
330   .gnu.version_d 0: { *(.gnu.version_d) }
331   .gnu.version_r 0: { *(.gnu.version_r) }
332   ${CREATE_SHLIB-${INTERP}}
333
334   /* Stabs debugging sections.  */
335   .stab          0 : { *(.stab) }
336   .stabstr       0 : { *(.stabstr) }
337   .stab.excl     0 : { *(.stab.excl) }
338   .stab.exclstr  0 : { *(.stab.exclstr) }
339   .stab.index    0 : { *(.stab.index) }
340   .stab.indexstr 0 : { *(.stab.indexstr) }
341
342   .comment       0 : { *(.comment) }
343 EOF
344
345 . $srcdir/scripttempl/DWARF.sc
346
347 cat <<EOF
348   ${OTHER_SECTIONS}
349   ${RELOCATING+${OTHER_SYMBOLS}}
350   ${RELOCATING+${DISCARDED}}
351 EOF
352
353 # These relocations sections are part of the read-only segment in SVR4
354 # executables, but are not mapped in BPABI executables.
355 if [ "x$COMBRELOC" = x ]; then
356   COMBRELOCCAT=cat
357 else
358   COMBRELOCCAT="cat > $COMBRELOC"
359 fi
360 eval $COMBRELOCCAT <<EOF
361   .rel.init     0 : { *(.rel.init) }
362   .rela.init    0 : { *(.rela.init) }
363   .rel.text     0 : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
364   .rela.text    0 : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
365   .rel.fini     0 : { *(.rel.fini) }
366   .rela.fini    0 : { *(.rela.fini) }
367   .rel.rodata   0 : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
368   .rela.rodata  0 : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
369   ${OTHER_READONLY_RELOC_SECTIONS}
370   .rel.data.rel.ro 0 : { *(.rel.data.rel.ro${RELOCATING+ .rel.data.rel.ro.*}) }
371   .rela.data.rel.ro 0 : { *(.rela.data.rel.ro${RELOCATING+ .rela.data.rel.ro.*}) }
372   .rel.data     0 : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
373   .rela.data    0 : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
374   .rel.tdata    0 : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
375   .rela.tdata   0 : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
376   .rel.tbss     0 : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
377   .rela.tbss    0 : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
378   .rel.ctors    0 : { *(.rel.ctors) }
379   .rela.ctors   0 : { *(.rela.ctors) }
380   .rel.dtors    0 : { *(.rel.dtors) }
381   .rela.dtors   0 : { *(.rela.dtors) }
382   ${REL_SDATA}
383   ${REL_SBSS}
384   ${REL_SDATA2}
385   ${REL_SBSS2}
386   .rel.bss      0 : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
387   .rela.bss     0 : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
388   .rel.init_array  0 : { *(.rel.init_array) }
389   .rela.init_array 0 : { *(.rela.init_array) }
390   .rel.fini_array  0 : { *(.rel.fini_array) }
391   .rela.fini_array 0 : { *(.rela.fini_array) }
392 EOF
393 if [ -n "$COMBRELOC" ]; then
394 cat <<EOF
395   .rel.dyn      0 :
396     {
397 EOF
398 sed -e '/^[      ]*[{}][         ]*$/d;/:[       ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/      \1/' $COMBRELOC
399 cat <<EOF
400     }
401   .rela.dyn     0 :
402     {
403 EOF
404 sed -e '/^[      ]*[{}][         ]*$/d;/:[       ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/      \1/' $COMBRELOC
405 cat <<EOF
406     }
407 EOF
408 fi
409 cat <<EOF
410   .rel.plt      0 : { *(.rel.plt) }
411   .rela.plt     0 : { *(.rela.plt) }
412   ${OTHER_PLT_RELOC_SECTIONS}
413   .rel.other    0 : { *(.rel.*) }
414   .rela.other   0 : { *(.rela.*) }
415   .reli.other   0 : { *(.reli.*) }
416 }
417 EOF