aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-07-03 17:40:14 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-07-03 17:40:14 +0000
commitd303a449f2c523cd0547374a3a124e8c68bc9930 (patch)
tree6e53aa735a3c31eaafa2f800729f9d2f85ca8f81 /ld/scripttempl
parent4258bf4db5e32b1cc99599668593f3605719480b (diff)
downloadgdb-d303a449f2c523cd0547374a3a124e8c68bc9930.zip
gdb-d303a449f2c523cd0547374a3a124e8c68bc9930.tar.gz
gdb-d303a449f2c523cd0547374a3a124e8c68bc9930.tar.bz2
2001-07-03 Jakub Jelinek <jakub@redhat.com>
* scripttempl/elf.sc (DYNAMIC_PAD): New variable. (DYNAMIC): Use it to reserve few dynamic entries for post-linking tools.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r--ld/scripttempl/elf.sc11
1 files changed, 10 insertions, 1 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 3c1bfb4..e32348c 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -32,6 +32,8 @@
# combination of .init sections.
# FINI_START, FINI_END - statements just before and just after
# combination of .fini sections.
+# DYNAMIC_PAD - script to insert pad at end of .dynamic section.
+# Setting this to " " will result in no .dynamic padding.
#
# When adding sections, do note that the names of some sections are used
# when specifying the start address of the next.
@@ -66,7 +68,14 @@ test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
test "$LD_FLAG" = "N" && DATA_ADDR=.
INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
-DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
+test -z "$DYNAMIC_PAD" && test -n "$RELOCATING" && DYNAMIC_PAD="
+ /* Leave some space in .dynamic section, so that
+ post-linking utilities can add new dynamic tags. */
+ FILL(0) . += 6 * ${ELFSIZE} / 4;"
+DYNAMIC=".dynamic ${RELOCATING-0} :
+ {
+ *(.dynamic) $DYNAMIC_PAD
+ }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) ${RELOCATING+*(.sbss2.*)} ${RELOCATING+*(.gnu.linkonce.sb2.*)} }"
SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) ${RELOCATING+*(.sdata2.*)} ${RELOCATING+*(.gnu.linkonce.s2.*)} }"