Remove isGotRelative.
It is now redundant with the expression. While at it, handle both "X -
Got" and "Got - PC".
llvm-svn: 266607
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index c799d54..3421eb3 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -467,8 +467,6 @@
if (Offset == (uintX_t)-1)
continue;
- if (Target->isGotRelative(Type))
- HasGotOffRel = true;
// Set "used" bit for --as-needed.
if (OrigBody.isUndefined() && !OrigBody.isWeak())
@@ -476,6 +474,12 @@
S->File->IsUsed = true;
RelExpr Expr = Target->getRelExpr(Type, Body);
+
+ // This relocation does not require got entry, but it is relative to got and
+ // needs it to be created. Here we request for that.
+ if (Expr == R_GOTONLY_PC || Expr == R_GOTREL)
+ HasGotOffRel = true;
+
uintX_t Addend = getAddend<ELFT>(RI);
const uint8_t *BufLoc = Buf + RI.r_offset;
if (!RelTy::IsRela)