std::pair<Symbol *, bool>
SymbolTable<ELFT>::insert(StringRef &Name, uint8_t Type, uint8_t Visibility,
bool CanOmitFromDynSym, bool HasUnnamedAddr,
- bool IsUsedInRegularObj, InputFile *File) {
+ InputFile *File) {
+ bool IsUsedInRegularObj = !File || File->kind() == InputFile::ObjectKind;
Symbol *S;
bool WasInserted;
std::tie(S, WasInserted) = insert(Name);
Symbol *S;
bool WasInserted;
std::tie(S, WasInserted) =
- insert(Name, Type, StOther & 3, CanOmitFromDynSym, HasUnnamedAddr,
- /*IsUsedInRegularObj*/ !File || !isa<BitcodeFile>(File), File);
+ insert(Name, Type, StOther & 3, CanOmitFromDynSym, HasUnnamedAddr, File);
if (WasInserted) {
S->Binding = Binding;
replaceBody<Undefined>(S, Name, StOther, Type, File);
bool HasUnnamedAddr, InputFile *File) {
Symbol *S;
bool WasInserted;
- std::tie(S, WasInserted) =
- insert(N, Type, StOther & 3, /*CanOmitFromDynSym*/ false, HasUnnamedAddr,
- !isa<BitcodeFile>(File), File);
+ std::tie(S, WasInserted) = insert(
+ N, Type, StOther & 3, /*CanOmitFromDynSym*/ false, HasUnnamedAddr, File);
int Cmp = compareDefined(S, WasInserted, Binding);
if (Cmp > 0) {
S->Binding = Binding;
InputSectionBase<ELFT> *Section) {
Symbol *S;
bool WasInserted;
- std::tie(S, WasInserted) = insert(
- Name, Sym.getType(), Sym.getVisibility(),
- /*CanOmitFromDynSym*/ false, /*HasUnnamedAddr*/ false,
- /*IsUsedInRegularObj*/ true, Section ? Section->getFile() : nullptr);
+ std::tie(S, WasInserted) =
+ insert(Name, Sym.getType(), Sym.getVisibility(),
+ /*CanOmitFromDynSym*/ false, /*HasUnnamedAddr*/ false,
+ Section ? Section->getFile() : nullptr);
int Cmp = compareDefinedNonCommon(S, WasInserted, Sym.getBinding());
if (Cmp > 0)
replaceBody<DefinedRegular<ELFT>>(S, Name, Sym, Section);
bool WasInserted;
std::tie(S, WasInserted) =
insert(Name, STT_NOTYPE, StOther & 3, /*CanOmitFromDynSym*/ false,
- /*HasUnnamedAddr*/ false, /*IsUsedInRegularObj*/ true, nullptr);
+ /*HasUnnamedAddr*/ false, nullptr);
int Cmp = compareDefinedNonCommon(S, WasInserted, Binding);
if (Cmp > 0)
replaceBody<DefinedRegular<ELFT>>(S, Name, StOther);
bool WasInserted;
std::tie(S, WasInserted) = insert(N, STT_NOTYPE, /*Visibility*/ StOther & 0x3,
/*CanOmitFromDynSym*/ false,
- /*HasUnnamedAddr*/ false,
- /*IsUsedInRegularObj*/ true, nullptr);
+ /*HasUnnamedAddr*/ false, nullptr);
int Cmp = compareDefinedNonCommon(S, WasInserted, STB_GLOBAL);
if (Cmp > 0)
replaceBody<DefinedSynthetic<ELFT>>(S, N, Value, Section);
bool WasInserted;
std::tie(S, WasInserted) =
insert(Name, Sym.getType(), STV_DEFAULT, /*CanOmitFromDynSym*/ true,
- /*HasUnnamedAddr*/ false, /*IsUsedInRegularObj*/ false, F);
+ /*HasUnnamedAddr*/ false, F);
// Make sure we preempt DSO symbols with default visibility.
if (Sym.getVisibility() == STV_DEFAULT)
S->ExportDynamic = true;
Symbol *S;
bool WasInserted;
std::tie(S, WasInserted) =
- insert(Name, Type, StOther & 3, CanOmitFromDynSym, HasUnnamedAddr,
- /*IsUsedInRegularObj*/ false, F);
+ insert(Name, Type, StOther & 3, CanOmitFromDynSym, HasUnnamedAddr, F);
int Cmp = compareDefinedNonCommon(S, WasInserted, Binding);
if (Cmp > 0)
replaceBody<DefinedRegular<ELFT>>(S, Name, StOther, Type, F);