Fix assigning to _gp in linker scripts.
The previous logic was to try to detect if a linker script defined _gp
by checking !ElfSym::MipsGp->Value. That doesn't work in all cases as
the assigned value can be 0.
We now just always defined it Writer.cpp and always overwrite it
afterwards if needed.
llvm-svn: 313788
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index af83982..3ed6ad0 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -148,6 +148,7 @@
ExprValue V = Cmd->Expression();
if (V.isAbsolute()) {
Sym->Value = V.getValue();
+ Sym->Section = nullptr;
} else {
Sym->Section = V.Sec;
Sym->Value = V.getSectionOffset();