[ELF][MIPS] Use TargetInfo::needsGot call to check necessity of GOT for local symbols. NFC.
llvm-svn: 263388
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index beaad67..c7d5efa 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -339,7 +339,7 @@
// MIPS has a special rule to create GOTs for local symbols.
if (Config->EMachine == EM_MIPS && !Preemptible &&
- (Type == R_MIPS_GOT16 || Type == R_MIPS_CALL16)) {
+ Target->needsGot(Type, Body)) {
// FIXME (simon): Do not add so many redundant entries.
Out<ELFT>::Got->addMipsLocalEntry();
continue;