This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Fix strong_ref_weak_def.sh and dyn_weak_ref.sh when configured with --enabled-default-hash-style=gnu.
- From: Romain Geissler <romain dot geissler at gmail dot com>
- To: binutils at sourceware dot org
- Cc: Romain Geissler <romain dot geissler at gmail dot com>
- Date: Mon, 25 Sep 2017 16:00:52 +0000
- Subject: [PATCH] Fix strong_ref_weak_def.sh and dyn_weak_ref.sh when configured with --enabled-default-hash-style=gnu.
- Authentication-results: sourceware.org; auth=none
Hi,
GOLD has the two tests strong_ref_weak_def.sh and dyn_weak_ref.sh failing when
configured with the non standard default hash style "gnu". The reason is, the symbol
looked by these tests are listed only in the regular hash table, not the GNU one.
The attached patch fixes this. Tested on x86_64.
Cheers,
Romain
2017-09-25 Romain Geissler <romain.geissler@gmail.com>
* testsuite/Makefile.am (strong_ref_weak_def.sh, dyn_weak_ref.sh):
Link with --hash-stye=sysv.
* testsuite/Makefile.in: Regenerate.
---
gold/testsuite/Makefile.am | 8 ++++----
gold/testsuite/Makefile.in | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index cae47f1e09..0f21109ad2 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -2793,12 +2793,12 @@ MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \
strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
$(COMPILE) -o $@ -c -fPIC $<
strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
- gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o
+ gcctestdir/ld --hash-style=sysv -shared -o $@ strong_ref_weak_def_2.o
strong_ref_weak_def_1.o: strong_ref_weak_def_1.c
$(COMPILE) -o $@ -c -fPIC $<
strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \
gcctestdir/ld
- gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \
+ gcctestdir/ld --hash-style=sysv -shared -o $@ strong_ref_weak_def_1.o \
strong_ref_weak_def_2.so
strong_ref_weak_def.stdout: strong_ref_weak_def_1.so
$(TEST_READELF) -sWD $< > $@
@@ -2812,13 +2812,13 @@ MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \
dyn_weak_ref_2.o: dyn_weak_ref_2.c
$(COMPILE) -o $@ -c -fPIC $<
dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld
- gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o
+ gcctestdir/ld --hash-style=sysv -shared -o $@ dyn_weak_ref_2.o
dyn_weak_ref_1.o: dyn_weak_ref_1.c
$(COMPILE) -o $@ -c -fPIC $<
# We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o
# so that the weak ref there goes to gold's symbol table first.
dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld
- gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
+ gcctestdir/ld --hash-style=sysv -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
dyn_weak_ref.stdout: dyn_weak_ref_1.so
$(TEST_READELF) -sWD $< > $@
diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in
index 0169fce141..08c086e09a 100644
--- a/gold/testsuite/Makefile.in
+++ b/gold/testsuite/Makefile.in
@@ -7192,25 +7192,25 @@ uninstall-am:
@GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -o $@ -c -fPIC $<
@GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld --hash-style=sysv -shared -o $@ strong_ref_weak_def_2.o
@GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_1.o: strong_ref_weak_def_1.c
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -o $@ -c -fPIC $<
@GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld --hash-style=sysv -shared -o $@ strong_ref_weak_def_1.o \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ strong_ref_weak_def_2.so
@GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def.stdout: strong_ref_weak_def_1.so
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -sWD $< > $@
@GCC_TRUE@@NATIVE_LINKER_TRUE@dyn_weak_ref_2.o: dyn_weak_ref_2.c
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -o $@ -c -fPIC $<
@GCC_TRUE@@NATIVE_LINKER_TRUE@dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld --hash-style=sysv -shared -o $@ dyn_weak_ref_2.o
@GCC_TRUE@@NATIVE_LINKER_TRUE@dyn_weak_ref_1.o: dyn_weak_ref_1.c
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -o $@ -c -fPIC $<
# We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o
# so that the weak ref there goes to gold's symbol table first.
@GCC_TRUE@@NATIVE_LINKER_TRUE@dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld --hash-style=sysv -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
@GCC_TRUE@@NATIVE_LINKER_TRUE@dyn_weak_ref.stdout: dyn_weak_ref_1.so
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -sWD $< > $@
@GCC_TRUE@@NATIVE_LINKER_TRUE@start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
--
2.11.0