summaryrefslogtreecommitdiffstats
path: root/lld/ELF/InputFiles.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-06-15 17:56:10 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-06-15 17:56:10 +0000
commitcc70da39ffec467a1fbc85070eec81ef68bdb303 (patch)
tree40d933f7944d0c9e9032a8b1cc43903c8169496e /lld/ELF/InputFiles.cpp
parent6100adfeb541b6bdb27cd0f6f58cbe70c754fc04 (diff)
downloadbcm5719-llvm-cc70da39ffec467a1fbc85070eec81ef68bdb303.tar.gz
bcm5719-llvm-cc70da39ffec467a1fbc85070eec81ef68bdb303.zip
Internalize symbols in comdats.
We were dropping the CanOmitFromDynSym bit when creating undefined symbols because of comdat. llvm-svn: 272812
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
-rw-r--r--lld/ELF/InputFiles.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index fc107ea73c7..df0c6855b3c 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -351,7 +351,8 @@ SymbolBody *elf::ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
switch (Sym->st_shndx) {
case SHN_UNDEF:
return elf::Symtab<ELFT>::X
- ->addUndefined(Name, Binding, Sym->st_other, Sym->getType(), this)
+ ->addUndefined(Name, Binding, Sym->st_other, Sym->getType(),
+ /*CanOmitFromDynSym*/ false, this)
->body();
case SHN_COMMON:
return elf::Symtab<ELFT>::X
@@ -368,7 +369,8 @@ SymbolBody *elf::ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
case STB_GNU_UNIQUE:
if (Sec == &InputSection<ELFT>::Discarded)
return elf::Symtab<ELFT>::X
- ->addUndefined(Name, Binding, Sym->st_other, Sym->getType(), this)
+ ->addUndefined(Name, Binding, Sym->st_other, Sym->getType(),
+ /*CanOmitFromDynSym*/ false, this)
->body();
return elf::Symtab<ELFT>::X->addRegular(Name, *Sym, Sec)->body();
}
@@ -589,12 +591,12 @@ Symbol *BitcodeFile::createSymbol(const DenseSet<const Comdat *> &KeptComdats,
if (const Comdat *C = GV->getComdat())
if (!KeptComdats.count(C))
return Symtab<ELFT>::X->addUndefined(NameRef, Binding, Visibility, Type,
- this);
+ CanOmitFromDynSym, this);
const Module &M = Obj.getModule();
if (Flags & BasicSymbolRef::SF_Undefined)
return Symtab<ELFT>::X->addUndefined(NameRef, Binding, Visibility, Type,
- this);
+ CanOmitFromDynSym, this);
if (Flags & BasicSymbolRef::SF_Common) {
// FIXME: Set SF_Common flag correctly for module asm symbols, and expose
// size and alignment.
OpenPOWER on IntegriCloud