diff options
author | 2017-10-18 00:44:49 +0200 | |
---|---|---|
committer | 2020-07-25 20:24:46 +0300 | |
commit | 22d38c93ac4ba495388162e0de95553c346e9d3b (patch) | |
tree | e3d1ecd339c912c9c59ce8fb7bea30f16e58c8f0 | |
parent | Gentoo: ld: enable new dtags by default for linux/gnu targets (diff) | |
download | binutils-gdb-gentoo/binutils-2.35.tar.gz binutils-gdb-gentoo/binutils-2.35.tar.bz2 binutils-gdb-gentoo/binutils-2.35.zip |
Gentoo: Pass --hash-style=sysv to ld in the testsuitegentoo/binutils-2.35-1gentoo/binutils-2.35
-rw-r--r-- | binutils/testsuite/lib/binutils-common.exp | 2 | ||||
-rw-r--r-- | ld/testsuite/lib/ld-lib.exp | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp index 491cd8db09e..4dac456f2e3 100644 --- a/binutils/testsuite/lib/binutils-common.exp +++ b/binutils/testsuite/lib/binutils-common.exp @@ -1144,7 +1144,7 @@ proc run_dump_test { name {extra_options {}} } { # Add -L$srcdir/$subdir so that the linker command can use # linker scripts in the source directory. - set cmd "$LD $ld_extra_opt $LDFLAGS -L$srcdir/$subdir \ + set cmd "$LD --hash-style=sysv $ld_extra_opt $LDFLAGS -L$srcdir/$subdir \ $opts(ld) -o $objfile $objfiles $opts(ld_after_inputfiles)" # If needed then check for, or add a -Map option. diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 8d851a94b71..25a3c9158fe 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -165,7 +165,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 @@ -196,8 +196,20 @@ proc default_ld_link { ld target objects } { set flags [big_or_little_endian] } + # Hilariously, this procedure is called sometimes with $CC and sometimes + # with $ld as parameter. If we want to change the default behaviour, we + # need to take the different option formats into account. + # We check the $ld parameter for + # - ld-new -> we're working with the new linker + # - otherwise -> we're likely working with the system compiler + if {[regexp {ld-new$} $ld]} { + set gentoosysv "--hash-style=sysv" + } else { + set gentoosysv "-Wl,--hash-style=sysv" + } + remote_file host delete $target - set exec_output [run_host_cmd "$ld" "$flags -o $target $objects"] + set exec_output [run_host_cmd "$ld" "$gentoosysv $flags -o $target $objects"] set exec_output [prune_warnings $exec_output] # We don't care if we get a warning about a non-existent start |