We were computing the binding on both the caller and callee.
llvm-svn: 280156
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;
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);
}
}
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) {
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)
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,