diff options
author | Cary Coutant <ccoutant@gmail.com> | 2018-07-14 12:29:03 -0700 |
---|---|---|
committer | Cary Coutant <ccoutant@gmail.com> | 2018-07-14 12:29:50 -0700 |
commit | 1b115e8e0e051d65d0747f0a8a84eb6453866729 (patch) | |
tree | 9bd3161afbedbe8da6620bc2b823ea83679ee46a /gold/testsuite/Makefile.am | |
parent | 6cb624f8a02a844885025dd6d756f9dd1d380023 (diff) | |
download | gdb-1b115e8e0e051d65d0747f0a8a84eb6453866729.zip gdb-1b115e8e0e051d65d0747f0a8a84eb6453866729.tar.gz gdb-1b115e8e0e051d65d0747f0a8a84eb6453866729.tar.bz2 |
Fix problem causing duplicated linker-generated symbols with versions.
When generating _end, _edata, etc. symbols, and a version script provides
a version name, and we are linking against another shared library that
provides those symbols with a different version, gold ends up trying to
resolve the other shared library's symbols to the new definitions, resulting
in two copies of each symbol, one as default, and one as non-default.
This patch tests for that condition, and ignores the symbols provided
by the other shared library.
gold/
PR gold/23409
* symtab.cc (Symbol_table::define_special_symbol): Add check for
version name on existing symbol.
* testsuite/Makefile.am (ver_test_pr23409): New test case.
* testsuite/Makefile.in: Regenerate.
* testsuite/ver_test_pr23409.sh: New test script.
* testsuite/ver_test_pr23409_1.script: New version script.
* testsuite/ver_test_pr23409_2.script: New version script.
Diffstat (limited to 'gold/testsuite/Makefile.am')
-rw-r--r-- | gold/testsuite/Makefile.am | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index 5f7d981..e15788e 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -1880,6 +1880,15 @@ ver_test_14.syms: ver_test_14 ver_test_14: gcctestdir/ld ver_test_main.o ver_test_1.so ver_test_2.so ver_test_4.so ver_test_14.script $(CXXLINK) -Bgcctestdir/ -Wl,--version-script,$(srcdir)/ver_test_14.script -Wl,-E -Wl,-R,. ver_test_main.o ver_test_1.so ver_test_2.so ver_test_4.so +check_SCRIPTS += ver_test_pr23409.sh +check_DATA += ver_test_pr23409.syms +ver_test_pr23409.syms: ver_test_pr23409_1.so + $(TEST_READELF) --dyn-syms -W $< >$@ +ver_test_pr23409_1.so: gcctestdir/ld ver_test_1.o $(srcdir)/ver_test_pr23409_1.script ver_test_pr23409_2.so + gcctestdir/ld -shared -o $@ ver_test_1.o ver_test_pr23409_2.so --version-script $(srcdir)/ver_test_pr23409_1.script +ver_test_pr23409_2.so: gcctestdir/ld ver_test_1.o $(srcdir)/ver_test_pr23409_2.script + gcctestdir/ld -shared -o $@ ver_test_1.o --version-script $(srcdir)/ver_test_pr23409_2.script + check_SCRIPTS += weak_as_needed.sh check_DATA += weak_as_needed.stdout weak_as_needed.stdout: weak_as_needed_a.so |