forked from OSchip/llvm-project
Pass Binding instead of IsWeak to addBitcode.
We were computing the binding on both the caller and callee. llvm-svn: 280156
This commit is contained in:
parent
991b12bf09
commit
cceb92a075
|
@ -635,8 +635,7 @@ Symbol *BitcodeFile::createSymbol(const DenseSet<const Comdat *> &KeptComdats,
|
|||
StringRef NameRef = Saver.save(StringRef(Name));
|
||||
|
||||
uint32_t Flags = Sym.getFlags();
|
||||
bool IsWeak = Flags & BasicSymbolRef::SF_Weak;
|
||||
uint32_t Binding = IsWeak ? STB_WEAK : STB_GLOBAL;
|
||||
uint32_t Binding = (Flags & BasicSymbolRef::SF_Weak) ? STB_WEAK : STB_GLOBAL;
|
||||
|
||||
uint8_t Type = STT_NOTYPE;
|
||||
bool CanOmitFromDynSym = false;
|
||||
|
@ -681,7 +680,7 @@ Symbol *BitcodeFile::createSymbol(const DenseSet<const Comdat *> &KeptComdats,
|
|||
Binding, Visibility, STT_OBJECT,
|
||||
HasUnnamedAddr, this);
|
||||
}
|
||||
return Symtab<ELFT>::X->addBitcode(NameRef, IsWeak, Visibility, Type,
|
||||
return Symtab<ELFT>::X->addBitcode(NameRef, Binding, Visibility, Type,
|
||||
CanOmitFromDynSym, HasUnnamedAddr, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -460,7 +460,7 @@ void SymbolTable<ELFT>::addShared(SharedFile<ELFT> *F, StringRef Name,
|
|||
}
|
||||
|
||||
template <class ELFT>
|
||||
Symbol *SymbolTable<ELFT>::addBitcode(StringRef Name, bool IsWeak,
|
||||
Symbol *SymbolTable<ELFT>::addBitcode(StringRef Name, uint8_t Binding,
|
||||
uint8_t StOther, uint8_t Type,
|
||||
bool CanOmitFromDynSym,
|
||||
bool HasUnnamedAddr, BitcodeFile *F) {
|
||||
|
@ -469,8 +469,7 @@ Symbol *SymbolTable<ELFT>::addBitcode(StringRef Name, bool IsWeak,
|
|||
std::tie(S, WasInserted) =
|
||||
insert(Name, Type, StOther & 3, CanOmitFromDynSym, HasUnnamedAddr,
|
||||
/*IsUsedInRegularObj*/ false, F);
|
||||
int Cmp = compareDefinedNonCommon<ELFT>(S, WasInserted,
|
||||
IsWeak ? STB_WEAK : STB_GLOBAL);
|
||||
int Cmp = compareDefinedNonCommon<ELFT>(S, WasInserted, Binding);
|
||||
if (Cmp > 0)
|
||||
replaceBody<DefinedBitcode>(S, Name, StOther, Type, F);
|
||||
else if (Cmp == 0)
|
||||
|
|
|
@ -72,8 +72,8 @@ public:
|
|||
|
||||
void addLazyArchive(ArchiveFile *F, const llvm::object::Archive::Symbol S);
|
||||
void addLazyObject(StringRef Name, LazyObjectFile &Obj);
|
||||
Symbol *addBitcode(StringRef Name, bool IsWeak, uint8_t StOther, uint8_t Type,
|
||||
bool CanOmitFromDynSym, bool HasUnnamedAddr,
|
||||
Symbol *addBitcode(StringRef Name, uint8_t Binding, uint8_t StOther,
|
||||
uint8_t Type, bool CanOmitFromDynSym, bool HasUnnamedAddr,
|
||||
BitcodeFile *File);
|
||||
|
||||
Symbol *addCommon(StringRef N, uint64_t Size, uint64_t Alignment,
|
||||
|
|
Loading…
Reference in New Issue