forked from OSchip/llvm-project
parent
455210e18f
commit
d4fbe4fe82
|
|
@ -358,9 +358,8 @@ static int compareDefined(Symbol *S, bool WasInserted, uint8_t Binding,
|
||||||
// We have a new non-common defined symbol with the specified binding. Return 1
|
// We have a new non-common defined symbol with the specified binding. Return 1
|
||||||
// if the new symbol should win, -1 if the new symbol should lose, or 0 if there
|
// if the new symbol should win, -1 if the new symbol should lose, or 0 if there
|
||||||
// is a conflict. If the new symbol wins, also update the binding.
|
// is a conflict. If the new symbol wins, also update the binding.
|
||||||
template <typename ELFT>
|
|
||||||
static int compareDefinedNonCommon(Symbol *S, bool WasInserted, uint8_t Binding,
|
static int compareDefinedNonCommon(Symbol *S, bool WasInserted, uint8_t Binding,
|
||||||
bool IsAbsolute, typename ELFT::uint Value,
|
bool IsAbsolute, uint64_t Value,
|
||||||
StringRef Name) {
|
StringRef Name) {
|
||||||
if (int Cmp = compareDefined(S, WasInserted, Binding, Name)) {
|
if (int Cmp = compareDefined(S, WasInserted, Binding, Name)) {
|
||||||
if (Cmp > 0)
|
if (Cmp > 0)
|
||||||
|
|
@ -466,8 +465,8 @@ Symbol *SymbolTable<ELFT>::addRegular(StringRef Name, uint8_t StOther,
|
||||||
bool WasInserted;
|
bool WasInserted;
|
||||||
std::tie(S, WasInserted) = insert(Name, Type, getVisibility(StOther),
|
std::tie(S, WasInserted) = insert(Name, Type, getVisibility(StOther),
|
||||||
/*CanOmitFromDynSym*/ false, File);
|
/*CanOmitFromDynSym*/ false, File);
|
||||||
int Cmp = compareDefinedNonCommon<ELFT>(S, WasInserted, Binding,
|
int Cmp = compareDefinedNonCommon(S, WasInserted, Binding, Section == nullptr,
|
||||||
Section == nullptr, Value, Name);
|
Value, Name);
|
||||||
if (Cmp > 0)
|
if (Cmp > 0)
|
||||||
replaceBody<DefinedRegular>(S, Name, /*IsLocal=*/false, StOther, Type,
|
replaceBody<DefinedRegular>(S, Name, /*IsLocal=*/false, StOther, Type,
|
||||||
Value, Size, Section, File);
|
Value, Size, Section, File);
|
||||||
|
|
@ -512,8 +511,8 @@ Symbol *SymbolTable<ELFT>::addBitcode(StringRef Name, uint8_t Binding,
|
||||||
bool WasInserted;
|
bool WasInserted;
|
||||||
std::tie(S, WasInserted) =
|
std::tie(S, WasInserted) =
|
||||||
insert(Name, Type, getVisibility(StOther), CanOmitFromDynSym, F);
|
insert(Name, Type, getVisibility(StOther), CanOmitFromDynSym, F);
|
||||||
int Cmp = compareDefinedNonCommon<ELFT>(S, WasInserted, Binding,
|
int Cmp = compareDefinedNonCommon(S, WasInserted, Binding,
|
||||||
/*IsAbs*/ false, /*Value*/ 0, Name);
|
/*IsAbs*/ false, /*Value*/ 0, Name);
|
||||||
if (Cmp > 0)
|
if (Cmp > 0)
|
||||||
replaceBody<DefinedRegular>(S, Name, /*IsLocal=*/false, StOther, Type, 0, 0,
|
replaceBody<DefinedRegular>(S, Name, /*IsLocal=*/false, StOther, Type, 0, 0,
|
||||||
nullptr, F);
|
nullptr, F);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue