This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gold commit] PR 16979: Don't let default version in a shared object override prior unversioned definition in another shared object


In PR 16979, a reference to malloc is being resolved to an unversioned
reference in libmalloc.so. When linked with --as-needed, however, the
dynamic table does not list libmalloc.so as a DT_NEEDED library.

If we have a reference to an unversioned symbol in a shared object,
and we later see a versioned definition in another shared object, we
were overriding the first definition with the second in the process of
defining the default version. As a result, we no longer think that the
first shared object was actually needed to resolve any symbols, and we
don't list it as a DT_NEEDED library.

This patch fixes the problem by treating the two definitions as separate
symbols, so the second definition does not override the first.

-cary


2016-03-30  Cary Coutant  <ccoutant@gmail.com>

gold/
        PR gold/16979
        * symtab.cc (Symbol_table::define_default_version): Check for case
        where symbols are both in different shared objects.

Attachment: pr16979.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]