Do not overload a one-bit variable, NeedsCopyOrPltAddr.
This patch removes NeedsCopyOrPltAddr and instead add two variables,
NeedsCopy and NeedsPltAddr. This uses one more bit in Symbol class,
but the actual size doesn't increase because we had unused bits.
This should improve code readability.
llvm-svn: 295287
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 4bdcfb8..000d0fa 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -458,7 +458,7 @@
// interpose any aliases.
for (SharedSymbol<ELFT> *Alias : getAliases(SS)) {
Alias->CopySection = ISec;
- Alias->NeedsCopyOrPltAddr = true;
+ Alias->NeedsCopy = true;
Alias->symbol()->IsUsedInRegularObj = true;
}
@@ -502,7 +502,7 @@
if (Body.isObject()) {
// Produce a copy relocation.
auto *B = cast<SharedSymbol<ELFT>>(&Body);
- if (!B->needsCopy())
+ if (!B->NeedsCopy)
addCopyRelSymbol(B);
return Expr;
}
@@ -527,7 +527,7 @@
// that points to the real function is a dedicated got entry used by the
// plt. That is identified by special relocation types (R_X86_64_JUMP_SLOT,
// R_386_JMP_SLOT, etc).
- Body.NeedsCopyOrPltAddr = true;
+ Body.NeedsPltAddr = true;
return toPlt(Expr);
}
error("symbol '" + toString(Body) + "' defined in " + toString(Body.File) +