Fix the implementation of R_386_GOTPC and R_386_GOTOFF.
They were both pointing to the start of the got, not the end.
Fixes pr28924.
llvm-svn: 280310
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 9a29483..d10b594 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -574,7 +574,8 @@
// 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 || Expr == R_PPC_TOC)
+ if (Expr == R_GOTONLY_PC || Expr == R_GOTONLY_PC_FROM_END ||
+ Expr == R_GOTREL || Expr == R_GOTREL_FROM_END || Expr == R_PPC_TOC)
Out<ELFT>::Got->HasGotOffRel = true;
uintX_t Addend = computeAddend(File, Buf, E, RI, Expr, Body);