[lld] r263236 - [ELF][MIPS] Update comment about creation local GOT entries for non-local symbols. NFC.

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 05:57:53 PST 2016


Author: atanasyan
Date: Fri Mar 11 07:57:53 2016
New Revision: 263236

URL: http://llvm.org/viewvc/llvm-project?rev=263236&view=rev
Log:
[ELF][MIPS] Update comment about creation local GOT entries for non-local symbols. NFC.

Modified:
    lld/trunk/ELF/InputSection.cpp

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=263236&r1=263235&r2=263236&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Fri Mar 11 07:57:53 2016
@@ -249,9 +249,11 @@ void InputSectionBase<ELFT>::relocate(ui
             AHL += SignExtend64<16>(read32<E>(LowLoc));
           SymVA = Out<ELFT>::Got->getMipsLocalPageAddr(SymVA + AHL);
         } else {
-          // Under some conditions relocations against non-local symbols require
-          // entries in the local part of MIPS GOT. In that case we need an
-          // entryinitialized by full address of the symbol.
+          // For non-local symbols GOT entries should contain their full
+          // addresses. But if such symbol cannot be preempted, we do not
+          // have to put them into the "global" part of GOT and use dynamic
+          // linker to determine their actual addresses. That is why we
+          // create GOT entries for them in the "local" part of GOT.
           SymVA = Out<ELFT>::Got->getMipsLocalFullAddr(Body) + A;
         }
       } else {




More information about the llvm-commits mailing list