[lld] r289733 - Rename InputSection.cpp:getSymVA to getRelocTargetVA.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 14:45:52 PST 2016


Author: silvas
Date: Wed Dec 14 16:45:52 2016
New Revision: 289733

URL: http://llvm.org/viewvc/llvm-project?rev=289733&view=rev
Log:
Rename InputSection.cpp:getSymVA to getRelocTargetVA.

This name was really confusing because there is also another static
helper Symbols.cpp:getSymVA which has the same name.

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=289733&r1=289732&r2=289733&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Wed Dec 14 16:45:52 2016
@@ -337,9 +337,9 @@ static uint64_t getAArch64UndefinedRelat
 }
 
 template <class ELFT>
-static typename ELFT::uint getSymVA(uint32_t Type, typename ELFT::uint A,
-                                    typename ELFT::uint P,
-                                    const SymbolBody &Body, RelExpr Expr) {
+static typename ELFT::uint
+getRelocTargetVA(uint32_t Type, typename ELFT::uint A, typename ELFT::uint P,
+                 const SymbolBody &Body, RelExpr Expr) {
   switch (Expr) {
   case R_HINT:
   case R_TLSDESC_CALL:
@@ -507,7 +507,7 @@ void InputSection<ELFT>::relocateNonAllo
     uint64_t SymVA = 0;
     if (!Sym.isTls() || Out<ELFT>::TlsPhdr)
       SymVA = SignExtend64<sizeof(uintX_t) * 8>(
-          getSymVA<ELFT>(Type, Addend, AddrLoc, Sym, R_ABS));
+          getRelocTargetVA<ELFT>(Type, Addend, AddrLoc, Sym, R_ABS));
     Target->relocateOne(BufLoc, Type, SymVA);
   }
 }
@@ -535,29 +535,29 @@ void InputSectionBase<ELFT>::relocate(ui
 
     uintX_t AddrLoc = OutSec->Addr + Offset;
     RelExpr Expr = Rel.Expr;
-    uint64_t SymVA =
-        SignExtend64<Bits>(getSymVA<ELFT>(Type, A, AddrLoc, *Rel.Sym, Expr));
+    uint64_t TargetVA = SignExtend64<Bits>(
+        getRelocTargetVA<ELFT>(Type, A, AddrLoc, *Rel.Sym, Expr));
 
     switch (Expr) {
     case R_RELAX_GOT_PC:
     case R_RELAX_GOT_PC_NOPIC:
-      Target->relaxGot(BufLoc, SymVA);
+      Target->relaxGot(BufLoc, TargetVA);
       break;
     case R_RELAX_TLS_IE_TO_LE:
-      Target->relaxTlsIeToLe(BufLoc, Type, SymVA);
+      Target->relaxTlsIeToLe(BufLoc, Type, TargetVA);
       break;
     case R_RELAX_TLS_LD_TO_LE:
-      Target->relaxTlsLdToLe(BufLoc, Type, SymVA);
+      Target->relaxTlsLdToLe(BufLoc, Type, TargetVA);
       break;
     case R_RELAX_TLS_GD_TO_LE:
     case R_RELAX_TLS_GD_TO_LE_NEG:
-      Target->relaxTlsGdToLe(BufLoc, Type, SymVA);
+      Target->relaxTlsGdToLe(BufLoc, Type, TargetVA);
       break;
     case R_RELAX_TLS_GD_TO_IE:
     case R_RELAX_TLS_GD_TO_IE_ABS:
     case R_RELAX_TLS_GD_TO_IE_PAGE_PC:
     case R_RELAX_TLS_GD_TO_IE_END:
-      Target->relaxTlsGdToIe(BufLoc, Type, SymVA);
+      Target->relaxTlsGdToIe(BufLoc, Type, TargetVA);
       break;
     case R_PPC_PLT_OPD:
       // Patch a nop (0x60000000) to a ld.
@@ -565,7 +565,7 @@ void InputSectionBase<ELFT>::relocate(ui
         write32be(BufLoc + 4, 0xe8410028); // ld %r2, 40(%r1)
     // fallthrough
     default:
-      Target->relocateOne(BufLoc, Type, SymVA);
+      Target->relocateOne(BufLoc, Type, TargetVA);
       break;
     }
   }




More information about the llvm-commits mailing list