[lld] r256563 - Reformat of conditions for calculating r_offset in RelocationSection<ELFT>::writeTo(). NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 29 08:17:32 PST 2015


Author: grimar
Date: Tue Dec 29 10:17:32 2015
New Revision: 256563

URL: http://llvm.org/viewvc/llvm-project?rev=256563&view=rev
Log:
Reformat of conditions for calculating r_offset in RelocationSection<ELFT>::writeTo(). NFC.

Modified:
    lld/trunk/ELF/OutputSections.cpp

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=256563&r1=256562&r2=256563&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Dec 29 10:17:32 2015
@@ -283,17 +283,15 @@ template <class ELFT> void RelocationSec
       Reloc = Target->getDynReloc(Type);
     P->setSymbolAndType(Sym, Reloc, Config->Mips64EL);
 
-    if (NeedsGot) {
-      if (LazyReloc)
-        P->r_offset = Out<ELFT>::GotPlt->getEntryAddr(*Body);
-      else
-        P->r_offset = Out<ELFT>::Got->getEntryAddr(*Body);
-    } else if (NeedsCopy) {
+    if (LazyReloc)
+      P->r_offset = Out<ELFT>::GotPlt->getEntryAddr(*Body);
+    else if (NeedsGot)
+      P->r_offset = Out<ELFT>::Got->getEntryAddr(*Body);
+    else if (NeedsCopy)
       P->r_offset = Out<ELFT>::Bss->getVA() +
                     dyn_cast<SharedSymbol<ELFT>>(Body)->OffsetInBSS;
-    } else {
+    else
       P->r_offset = C.getOffset(RI.r_offset) + C.OutSec->getVA();
-    }
 
     uintX_t OrigAddend = 0;
     if (IsRela && !NeedsGot)




More information about the llvm-commits mailing list