aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-01-27 15:01:08 -0500
committerMike Frysinger <vapier@gentoo.org>2017-03-03 11:03:21 -0700
commita6c35c40daf508b4f236b870c2b60bfa9b68de9e (patch)
tree894de9b99d48e6f3891a6d0bb525fc1334a946af
parentda0140fb5c8a9bccd0c66166c8e21cb3e37e2f1d (diff)
downloadgdb-a6c35c40daf508b4f236b870c2b60bfa9b68de9e.zip
gdb-a6c35c40daf508b4f236b870c2b60bfa9b68de9e.tar.gz
gdb-a6c35c40daf508b4f236b870c2b60bfa9b68de9e.tar.bz2
gold/ld: enable gnu hash by default
Glibc first added .gnu.hash support to glibc-2.5 (released 29 Sep 2006), and gold was first released after that. Let's default the gnu hash style to the new "gnu" rather than the classic sysv. gold/: 2012-02-03 Mike Frysinger <vapier@gentoo.org> * options.h (General_options): Change default to gnu for hash_style.
-rw-r--r--gold/options.h2
-rw-r--r--ld/emultempl/elf32.em13
-rw-r--r--ld/testsuite/lib/ld-lib.exp4
3 files changed, 16 insertions, 3 deletions
diff --git a/gold/options.h b/gold/options.h
index b7c725a..ef17566 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -921,7 +921,7 @@ class General_options
N_("Min fraction of empty buckets in dynamic hash"),
N_("FRACTION"));
- DEFINE_enum(hash_style, options::TWO_DASHES, '\0', "sysv",
+ DEFINE_enum(hash_style, options::TWO_DASHES, '\0', "gnu",
N_("Dynamic hash style"), N_("[sysv,gnu,both]"),
{"sysv", "gnu", "both"});
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 92b7e4a..ac2090a 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -100,6 +100,19 @@ static void
gld${EMULATION_NAME}_before_parse (void)
{
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
+EOF
+# Enable gnu hash by default for Linux (non-mips) targets.
+# This has been supported since glibc-2.5.
+case ${target} in
+ mips*) ;;
+ *-*-linux-* | *-*-gnu*)
+ fragment <<EOF
+ link_info.emit_hash = FALSE;
+ link_info.emit_gnu_hash = TRUE;
+EOF
+ ;;
+esac
+fragment <<EOF
input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 6c6a0b7..53ad4a1 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -147,7 +147,7 @@ proc default_ld_relocate { ld target objects } {
global HOSTING_EMU
remote_file host delete $target
- return [run_host_cmd_yesno "$ld" "$HOSTING_EMU -o $target -r $objects"]
+ return [run_host_cmd_yesno "$ld" "$HOSTING_EMU --hash-style=sysv -o $target -r $objects"]
}
# Check to see if ld is being invoked with a non-endian output format
@@ -228,7 +228,7 @@ proc default_ld_link { ld target objects } {
remote_file host delete $target
- return [run_host_cmd_yesno "$ld" "$HOSTING_EMU $flags -o $target $objs $libs"]
+ return [run_host_cmd_yesno "$ld" "$HOSTING_EMU --hash-style=sysv $flags -o $target $objs $libs"]
}
# Link a program using ld, without including any libraries.