[gold commit] PR 18288: Fix incorrect handling of STT_COMMON symbols in shared libraries

Cary Coutant ccoutant@gmail.com
Sun Jun 7 21:02:00 GMT 2015


The gABI allows STT_COMMON symbols to appear in executables and shared
objects, so that the dynamic loader can resolve commons across modules.
When reading a shared object, however, an STT_COMMON symbol should be
treated as a regular definition at link time.

In a relocatable object, the gABI requires that any STT_COMMON symbols
must also be defined in the special SHN_COMMON section (which we extend
to include target-specific small and large common sections). Thus,
there is no need for gold to treat STT_COMMON symbols as common unless
the st_shndx field is also set to a common section.

-cary


2015-06-07  Cary Coutant  <ccoutant@gmail.com>

gold/
        PR gold/18288
        * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
        callers. Don't use STT_COMMON to check for common symbols.
        (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
        symbol that's not in a common section.
        * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
        common symbols.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stt-common.patch
Type: application/octet-stream
Size: 4512 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150607/f72c060a/attachment.obj>


More information about the Binutils mailing list