summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2022-01-15 23:19:42 +0100
committerAndreas K. Hüttel <dilfridge@gentoo.org>2022-01-15 23:26:47 +0100
commit09d59da43630e66d4f7ae7145e121d06c81a2fdc (patch)
treed38afa2403f2c8feae725a979615de30ab76d4a9 /9999/0004-Gentoo-Pass-hash-style-sysv-to-ld-in-the-testsuite.patch
parentAllow for empty patchsets (diff)
downloadbinutils-patches-09d59da43630e66d4f7ae7145e121d06c81a2fdc.tar.gz
binutils-patches-09d59da43630e66d4f7ae7145e121d06c81a2fdc.tar.bz2
binutils-patches-09d59da43630e66d4f7ae7145e121d06c81a2fdc.zip
Update patches for binutils 2.38
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Diffstat (limited to '9999/0004-Gentoo-Pass-hash-style-sysv-to-ld-in-the-testsuite.patch')
-rw-r--r--9999/0004-Gentoo-Pass-hash-style-sysv-to-ld-in-the-testsuite.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/9999/0004-Gentoo-Pass-hash-style-sysv-to-ld-in-the-testsuite.patch b/9999/0004-Gentoo-Pass-hash-style-sysv-to-ld-in-the-testsuite.patch
new file mode 100644
index 0000000..2ac5053
--- /dev/null
+++ b/9999/0004-Gentoo-Pass-hash-style-sysv-to-ld-in-the-testsuite.patch
@@ -0,0 +1,61 @@
+From 6e5bb8fa8e5f409e12098a922de72f6bdcc99603 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
+Date: Tue, 20 Jul 2021 21:15:24 +0200
+Subject: [PATCH 4/6] Gentoo: Pass --hash-style=sysv to ld in the testsuite
+
+---
+ binutils/testsuite/lib/binutils-common.exp | 2 +-
+ 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 93603b0be68..83ae1307f2a 100644
+--- a/binutils/testsuite/lib/binutils-common.exp
++++ b/binutils/testsuite/lib/binutils-common.exp
+@@ -1303,7 +1303,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 5c7771f7221..ff9ee6a425c 100644
+--- a/ld/testsuite/lib/ld-lib.exp
++++ b/ld/testsuite/lib/ld-lib.exp
+@@ -171,7 +171,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
+@@ -202,8 +202,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
+--
+2.34.1
+