aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@gmail.com>2015-06-07 14:03:09 -0700
committerCary Coutant <ccoutant@gmail.com>2015-06-07 14:03:52 -0700
commitb8cf50755b573140aae71f7247b604373fcdfbeb (patch)
tree9703225459949bc9fde830bbf7bba2cca5dcd38d /gold/symtab.h
parent66f38e2951a1f7110ca3f1adf362322ec4208428 (diff)
downloadgdb-b8cf50755b573140aae71f7247b604373fcdfbeb.zip
gdb-b8cf50755b573140aae71f7247b604373fcdfbeb.tar.gz
gdb-b8cf50755b573140aae71f7247b604373fcdfbeb.tar.bz2
Fix incorrect handling of STT_COMMON symbols in shared libraries.
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. 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.
Diffstat (limited to 'gold/symtab.h')
-rw-r--r--gold/symtab.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/gold/symtab.h b/gold/symtab.h
index f6c0ac6..2c9aa32 100644
--- a/gold/symtab.h
+++ b/gold/symtab.h
@@ -557,8 +557,6 @@ class Symbol
{
if (this->source_ != FROM_OBJECT)
return false;
- if (this->type_ == elfcpp::STT_COMMON)
- return true;
bool is_ordinary;
unsigned int shndx = this->shndx(&is_ordinary);
return !is_ordinary && Symbol::is_common_shndx(shndx);