GNU Binutils with patches for OS216
修訂 | a6c35c40daf508b4f236b870c2b60bfa9b68de9e (tree) |
---|---|
時間 | 2017-03-04 03:03:21 |
作者 | Mike Frysinger <vapier@gent...> |
Commiter | Mike Frysinger |
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.
@@ -921,7 +921,7 @@ class General_options | ||
921 | 921 | N_("Min fraction of empty buckets in dynamic hash"), |
922 | 922 | N_("FRACTION")); |
923 | 923 | |
924 | - DEFINE_enum(hash_style, options::TWO_DASHES, '\0', "sysv", | |
924 | + DEFINE_enum(hash_style, options::TWO_DASHES, '\0', "gnu", | |
925 | 925 | N_("Dynamic hash style"), N_("[sysv,gnu,both]"), |
926 | 926 | {"sysv", "gnu", "both"}); |
927 | 927 |
@@ -100,6 +100,19 @@ static void | ||
100 | 100 | gld${EMULATION_NAME}_before_parse (void) |
101 | 101 | { |
102 | 102 | 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 | |
103 | 116 | input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; |
104 | 117 | config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; |
105 | 118 | config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; |
@@ -147,7 +147,7 @@ proc default_ld_relocate { ld target objects } { | ||
147 | 147 | global HOSTING_EMU |
148 | 148 | |
149 | 149 | 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"] | |
151 | 151 | } |
152 | 152 | |
153 | 153 | # 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 } { | ||
228 | 228 | |
229 | 229 | remote_file host delete $target |
230 | 230 | |
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"] | |
232 | 232 | } |
233 | 233 | |
234 | 234 | # Link a program using ld, without including any libraries. |