[ELF][MIPS] Use TargetInfo::needsGot call to check necessity of GOT for local symbols...
authorSimon Atanasyan <simon@atanasyan.com>
Sun, 13 Mar 2016 20:13:24 +0000 (20:13 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Sun, 13 Mar 2016 20:13:24 +0000 (20:13 +0000)
llvm-svn: 263388

lld/ELF/Writer.cpp

index beaad67..c7d5efa 100644 (file)
@@ -339,7 +339,7 @@ void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C,
 
     // 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;