• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂a6c35c40daf508b4f236b870c2b60bfa9b68de9e (tree)
時間2017-03-04 03:03:21
作者Mike Frysinger <vapier@gent...>
CommiterMike Frysinger

Log Message

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.

Change Summary

差異

--- a/gold/options.h
+++ b/gold/options.h
@@ -921,7 +921,7 @@ class General_options
921921 N_("Min fraction of empty buckets in dynamic hash"),
922922 N_("FRACTION"));
923923
924- DEFINE_enum(hash_style, options::TWO_DASHES, '\0', "sysv",
924+ DEFINE_enum(hash_style, options::TWO_DASHES, '\0', "gnu",
925925 N_("Dynamic hash style"), N_("[sysv,gnu,both]"),
926926 {"sysv", "gnu", "both"});
927927
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -100,6 +100,19 @@ static void
100100 gld${EMULATION_NAME}_before_parse (void)
101101 {
102102 ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
103+EOF
104+# Enable gnu hash by default for Linux (non-mips) targets.
105+# This has been supported since glibc-2.5.
106+case ${target} in
107+ mips*) ;;
108+ *-*-linux-* | *-*-gnu*)
109+ fragment <<EOF
110+ link_info.emit_hash = FALSE;
111+ link_info.emit_gnu_hash = TRUE;
112+EOF
113+ ;;
114+esac
115+fragment <<EOF
103116 input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
104117 config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
105118 config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
--- 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 } {
147147 global HOSTING_EMU
148148
149149 remote_file host delete $target
150- return [run_host_cmd_yesno "$ld" "$HOSTING_EMU -o $target -r $objects"]
150+ return [run_host_cmd_yesno "$ld" "$HOSTING_EMU --hash-style=sysv -o $target -r $objects"]
151151 }
152152
153153 # 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 } {
228228
229229 remote_file host delete $target
230230
231- return [run_host_cmd_yesno "$ld" "$HOSTING_EMU $flags -o $target $objs $libs"]
231+ return [run_host_cmd_yesno "$ld" "$HOSTING_EMU --hash-style=sysv $flags -o $target $objs $libs"]
232232 }
233233
234234 # Link a program using ld, without including any libraries.