Fix problem causing duplicated linker-generated symbols with versions.
authorCary Coutant <ccoutant@gmail.com>
Sat, 14 Jul 2018 19:29:03 +0000 (12:29 -0700)
committerCary Coutant <ccoutant@gmail.com>
Sat, 14 Jul 2018 19:29:50 +0000 (12:29 -0700)
commit1b115e8e0e051d65d0747f0a8a84eb6453866729
tree9bd3161afbedbe8da6620bc2b823ea83679ee46a
parent6cb624f8a02a844885025dd6d756f9dd1d380023
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.
gold/ChangeLog
gold/symtab.cc
gold/testsuite/Makefile.am
gold/testsuite/Makefile.in
gold/testsuite/ver_test_pr23409.sh [new file with mode: 0755]
gold/testsuite/ver_test_pr23409_1.script [new file with mode: 0644]
gold/testsuite/ver_test_pr23409_2.script [new file with mode: 0644]