[lld] r250563 - [ELF2] Remove unneeded new Type parameter

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 15:37:33 PDT 2015


Author: hfinkel
Date: Fri Oct 16 17:37:32 2015
New Revision: 250563

URL: http://llvm.org/viewvc/llvm-project?rev=250563&view=rev
Log:
[ELF2] Remove unneeded new Type parameter

As pointed out by Rafael (with a further suggestion by Rui), the new Type
parameter I added in r250555 is not needed. Remove it.

Modified:
    lld/trunk/ELF/InputSection.cpp
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/ELF/OutputSections.h

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=250563&r1=250562&r2=250563&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Fri Oct 16 17:37:32 2015
@@ -57,7 +57,7 @@ void InputSection<ELFT>::relocate(
     // resolved so we don't allocate a SymbolBody.
     const Elf_Shdr *SymTab = File.getSymbolTable();
     if (SymIndex < SymTab->sh_info) {
-      uintX_t SymVA = getLocalRelTarget(File, RI, Type);
+      uintX_t SymVA = getLocalRelTarget(File, RI);
       relocateOne(Buf, BufEnd, RI, Type, BaseAddr, SymVA);
       continue;
     }

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=250563&r1=250562&r2=250563&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Fri Oct 16 17:37:32 2015
@@ -126,7 +126,7 @@ template <class ELFT> void RelocationSec
         if (Body)
           Addend += getSymVA<ELFT>(cast<ELFSymbolBody<ELFT>>(*Body));
         else
-          Addend += getLocalRelTarget(File, RI, Type);
+          Addend += getLocalRelTarget(File, RI);
       }
       P->setSymbolAndType(0, Target->getRelativeReloc(), IsMips64EL);
     }
@@ -424,11 +424,10 @@ typename ELFFile<ELFT>::uintX_t lld::elf
 template <class ELFT>
 typename ELFFile<ELFT>::uintX_t
 lld::elf2::getLocalRelTarget(const ObjectFile<ELFT> &File,
-                             const typename ELFFile<ELFT>::Elf_Rel &RI,
-                             uint32_t Type) {
+                             const typename ELFFile<ELFT>::Elf_Rel &RI) {
   // PPC64 has a special relocation representing the TOC base pointer
   // that does not have a corresponding symbol.
-  if (Config->EMachine == EM_PPC64 && Type == R_PPC64_TOC)
+  if (Config->EMachine == EM_PPC64 && RI.getType(false) == R_PPC64_TOC)
     return getPPC64TocBase();
 
   typedef typename ELFFile<ELFT>::Elf_Sym Elf_Sym;
@@ -750,19 +749,19 @@ template ELFFile<ELF64BE>::uintX_t getSy
 
 template ELFFile<ELF32LE>::uintX_t
 getLocalRelTarget(const ObjectFile<ELF32LE> &,
-                  const ELFFile<ELF32LE>::Elf_Rel &, uint32_t);
+                  const ELFFile<ELF32LE>::Elf_Rel &);
 
 template ELFFile<ELF32BE>::uintX_t
 getLocalRelTarget(const ObjectFile<ELF32BE> &,
-                  const ELFFile<ELF32BE>::Elf_Rel &, uint32_t);
+                  const ELFFile<ELF32BE>::Elf_Rel &);
 
 template ELFFile<ELF64LE>::uintX_t
 getLocalRelTarget(const ObjectFile<ELF64LE> &,
-                  const ELFFile<ELF64LE>::Elf_Rel &, uint32_t);
+                  const ELFFile<ELF64LE>::Elf_Rel &);
 
 template ELFFile<ELF64BE>::uintX_t
 getLocalRelTarget(const ObjectFile<ELF64BE> &,
-                  const ELFFile<ELF64BE>::Elf_Rel &, uint32_t);
+                  const ELFFile<ELF64BE>::Elf_Rel &);
 
 template bool includeInSymtab<ELF32LE>(const SymbolBody &);
 template bool includeInSymtab<ELF32BE>(const SymbolBody &);

Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=250563&r1=250562&r2=250563&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Fri Oct 16 17:37:32 2015
@@ -38,8 +38,7 @@ typename llvm::object::ELFFile<ELFT>::ui
 template <class ELFT>
 typename llvm::object::ELFFile<ELFT>::uintX_t
 getLocalRelTarget(const ObjectFile<ELFT> &File,
-                  const typename llvm::object::ELFFile<ELFT>::Elf_Rel &Sym,
-                  uint32_t Type);
+                  const typename llvm::object::ELFFile<ELFT>::Elf_Rel &Sym);
 bool canBePreempted(const SymbolBody *Body, bool NeedsGot);
 template <class ELFT> bool includeInSymtab(const SymbolBody &B);
 




More information about the llvm-commits mailing list