Don't treat as separate symbols if unversioned symbol is undefined.
authorCary Coutant <ccoutant@gmail.com>
Tue, 27 Sep 2016 19:08:19 +0000 (12:08 -0700)
committerCary Coutant <ccoutant@gmail.com>
Tue, 27 Sep 2016 19:08:28 +0000 (12:08 -0700)
When we see an unversioned symbol reference in a shared library, followed
by a default definition of the symbol in another shared library, we were
treating them as separate symbols. That should only happen when both are
definitions.

gold/
PR gold/20238
* symtab.cc (Symbol_table::define_default_version): Check that
unversioned symbol is defined.

gold/ChangeLog
gold/symtab.cc

index d791d2940f2f5be98fc3a1182faff7f9f52fde6d..1e01a4a247bb1fc1a168fdb24bf4dc099d68dfd0 100644 (file)
@@ -1,3 +1,9 @@
+2016-09-26  Cary Coutant  <ccoutant@gmail.com>
+
+       PR gold/20238
+       * symtab.cc (Symbol_table::define_default_version): Check that
+       unversioned symbol is defined.
+
 2016-09-26  Vlad Zakharov  <vzakhar@synopsys.com>
 
        * Makefile.in: Regenerate.
index b31794a5a8cd49f7737473015a933418effe1600..c872f47d38638540278e1dcc05caee1195d88f5d 100644 (file)
@@ -882,6 +882,7 @@ Symbol_table::define_default_version(Sized_symbol<size>* sym,
        ;
       else if (pdef->second->is_from_dynobj()
               && sym->is_from_dynobj()
+              && pdef->second->is_defined()
               && pdef->second->object() != sym->object())
         ;
       else