diff options
-rw-r--r-- | gold/options.h | 2 | ||||
-rw-r--r-- | ld/emultempl/elf32.em | 13 | ||||
-rw-r--r-- | ld/testsuite/lib/ld-lib.exp | 4 |
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. |