aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-11-27 19:06:07 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-11-27 19:06:07 +0000
commit484593416ab47f073bb191ee0d92458898aab311 (patch)
treebbe618f1796f60561a6bb8568f3c3e15ac34ed95 /ld
parent163c1c309ebe75cf22b70610a5dc1f067fa9ee04 (diff)
downloadgdb-484593416ab47f073bb191ee0d92458898aab311.zip
gdb-484593416ab47f073bb191ee0d92458898aab311.tar.gz
gdb-484593416ab47f073bb191ee0d92458898aab311.tar.bz2
2001-11-27 H.J. Lu <hjl@gnu.org>
* emulparams/elf_i386.sh (NO_SMALL_DATA): Set to yes. * emulparams/elf_i386_be.sh (NO_SMALL_DATA): Likewise. * emulparams/elf_i386_chaos.sh (NO_SMALL_DATA): Likewise. * emulparams/elf_i386_ldso.sh (NO_SMALL_DATA): Likewise. * emulparams/elf_x86_64.sh (NO_SMALL_DATA): Likewise. * emulparams/m68kelf.sh (NO_SMALL_DATA): Likewise. * emulparams/elf32_sparc.sh (NO_SMALL_DATA): Likewise. * emulparams/elf64_sparc.sh (NO_SMALL_DATA): Likewise. * scripttempl/elf.sc (SBSS): New. Define if ${NO_SMALL_DATA} is not empty. (SDATA): Likewise. (REL_SDATA): Likewise. (REL_SBSS): Likewise. (REL_SDATA2): Likewise. (REL_SBSS2): Likewise. (SBSS2): Define if ${NO_SMALL_DATA} is not empty. (SDATA2): Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog21
-rw-r--r--ld/emulparams/elf32_sparc.sh1
-rw-r--r--ld/emulparams/elf64_sparc.sh1
-rw-r--r--ld/emulparams/elf_i386.sh1
-rw-r--r--ld/emulparams/elf_i386_be.sh1
-rw-r--r--ld/emulparams/elf_i386_chaos.sh1
-rw-r--r--ld/emulparams/elf_i386_ldso.sh1
-rw-r--r--ld/emulparams/elf_x86_64.sh1
-rw-r--r--ld/emulparams/m68kelf.sh1
-rw-r--r--ld/scripttempl/elf.sc66
10 files changed, 67 insertions, 28 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index a2414bb..a07f056 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,24 @@
+2001-11-27 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/elf_i386.sh (NO_SMALL_DATA): Set to yes.
+ * emulparams/elf_i386_be.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/elf_i386_chaos.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/elf_i386_ldso.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/elf_x86_64.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/m68kelf.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/elf32_sparc.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/elf64_sparc.sh (NO_SMALL_DATA): Likewise.
+
+ * scripttempl/elf.sc (SBSS): New. Define if ${NO_SMALL_DATA}
+ is not empty.
+ (SDATA): Likewise.
+ (REL_SDATA): Likewise.
+ (REL_SBSS): Likewise.
+ (REL_SDATA2): Likewise.
+ (REL_SBSS2): Likewise.
+ (SBSS2): Define if ${NO_SMALL_DATA} is not empty.
+ (SDATA2): Likewise.
+
2001-11-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* scripttempl/elfm68hc11.sc (CTOR, DTOR): Put constructor and
diff --git a/ld/emulparams/elf32_sparc.sh b/ld/emulparams/elf32_sparc.sh
index 74e2326..d8b81e7 100644
--- a/ld/emulparams/elf32_sparc.sh
+++ b/ld/emulparams/elf32_sparc.sh
@@ -9,3 +9,4 @@ MACHINE=
TEMPLATE_NAME=elf32
DATA_PLT=
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/ld/emulparams/elf64_sparc.sh b/ld/emulparams/elf64_sparc.sh
index b0a58ea..dae3f21 100644
--- a/ld/emulparams/elf64_sparc.sh
+++ b/ld/emulparams/elf64_sparc.sh
@@ -8,6 +8,7 @@ MACHINE=
DATA_PLT=
GENERATE_SHLIB_SCRIPT=yes
NOP=0x01000000
+NO_SMALL_DATA=yes
case "$target" in
sparc*-solaris*)
diff --git a/ld/emulparams/elf_i386.sh b/ld/emulparams/elf_i386.sh
index 6928f64..53dd54b 100644
--- a/ld/emulparams/elf_i386.sh
+++ b/ld/emulparams/elf_i386.sh
@@ -8,3 +8,4 @@ MACHINE=
NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/ld/emulparams/elf_i386_be.sh b/ld/emulparams/elf_i386_be.sh
index 4405d21..2c681b7 100644
--- a/ld/emulparams/elf_i386_be.sh
+++ b/ld/emulparams/elf_i386_be.sh
@@ -9,3 +9,4 @@ MACHINE=
NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/ld/emulparams/elf_i386_chaos.sh b/ld/emulparams/elf_i386_chaos.sh
index 6afe3c8..f7ad3cf 100644
--- a/ld/emulparams/elf_i386_chaos.sh
+++ b/ld/emulparams/elf_i386_chaos.sh
@@ -8,3 +8,4 @@ MACHINE=
NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/ld/emulparams/elf_i386_ldso.sh b/ld/emulparams/elf_i386_ldso.sh
index 4bb2123..a477a69 100644
--- a/ld/emulparams/elf_i386_ldso.sh
+++ b/ld/emulparams/elf_i386_ldso.sh
@@ -9,3 +9,4 @@ NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
ELF_INTERPRETER_NAME=\"/usr/lib/ld.so.1\"
+NO_SMALL_DATA=yes
diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh
index c6586c3..27931c7 100644
--- a/ld/emulparams/elf_x86_64.sh
+++ b/ld/emulparams/elf_x86_64.sh
@@ -9,3 +9,4 @@ MACHINE=
NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/ld/emulparams/m68kelf.sh b/ld/emulparams/m68kelf.sh
index 508d58d..b784a3c 100644
--- a/ld/emulparams/m68kelf.sh
+++ b/ld/emulparams/m68kelf.sh
@@ -9,3 +9,4 @@ NOP=0x4e754e75
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=m68kelf
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 0f3db03..bba7074 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -1,6 +1,8 @@
#
# Unusual variables checked by this code:
# NOP - four byte opcode for no-op (defaults to 0)
+# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
+# empty.
# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
# INITIAL_READONLY_SECTIONS - at start of text segment
# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
@@ -72,8 +74,36 @@ INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
-SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
-SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
+if test -z "${NO_SMALL_DATA}"; then
+ SBSS=".sbss ${RELOCATING-0} :
+ {
+ ${RELOCATING+PROVIDE (__sbss_start = .);}
+ ${RELOCATING+PROVIDE (___sbss_start = .);}
+ *(.dynsbss)
+ *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
+ *(.scommon)
+ ${RELOCATING+PROVIDE (__sbss_end = .);}
+ ${RELOCATING+PROVIDE (___sbss_end = .);}
+ }"
+ SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
+ SDATA="/* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata ${RELOCATING-0} :
+ {
+ ${RELOCATING+${SDATA_START_SYMBOLS}}
+ *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
+ }"
+ SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
+ REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
+ .rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
+ REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
+ .rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
+ REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
+ .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
+ REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
+ .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
+fi
CTOR=".ctors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+${CTOR_START}}
@@ -177,14 +207,10 @@ eval $COMBRELOCCAT <<EOF
.rel.got ${RELOCATING-0} : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) }
${OTHER_GOT_RELOC_SECTIONS}
- .rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
- .rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }
- .rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
- .rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }
- .rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
- .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }
- .rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
- .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }
+ ${REL_SDATA}
+ ${REL_SBSS}
+ ${REL_SDATA2}
+ ${REL_SBSS2}
.rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
EOF
@@ -266,29 +292,13 @@ cat <<EOF
${OTHER_GOT_SECTIONS}
${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}}
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
- .sdata ${RELOCATING-0} :
- {
- ${RELOCATING+${SDATA_START_SYMBOLS}}
- *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
- }
+ ${SDATA}
${OTHER_SDATA_SECTIONS}
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
- .sbss ${RELOCATING-0} :
- {
- ${RELOCATING+PROVIDE (__sbss_start = .);}
- ${RELOCATING+PROVIDE (___sbss_start = .);}
- *(.dynsbss)
- *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
- *(.scommon)
- ${RELOCATING+PROVIDE (__sbss_end = .);}
- ${RELOCATING+PROVIDE (___sbss_end = .);}
- }
+ ${SBSS}
${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} :
{