[lld] r288668 - ELF/AArch64: consolidate getAArch64Page implementation

Adhemerval Zanella via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 06:14:26 PST 2016


Author: azanella
Date: Mon Dec  5 08:14:26 2016
New Revision: 288668

URL: http://llvm.org/viewvc/llvm-project?rev=288668&view=rev
Log:
ELF/AArch64: consolidate getAArch64Page implementation

This patch avoid getAArch64Page code duplication by removing the
implementation at InputSection.

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

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=288668&r1=288667&r2=288668&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Mon Dec  5 08:14:26 2016
@@ -303,13 +303,6 @@ void InputSection<ELFT>::copyRelocations
   }
 }
 
-// Page(Expr) is the page address of the expression Expr, defined
-// as (Expr & ~0xFFF). (This applies even if the machine page size
-// supported by the platform has a different value.)
-static uint64_t getAArch64Page(uint64_t Expr) {
-  return Expr & (~static_cast<uint64_t>(0xFFF));
-}
-
 static uint32_t getARMUndefinedRelativeWeakVA(uint32_t Type, uint32_t A,
                                               uint32_t P) {
   switch (Type) {

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=288668&r1=288667&r2=288668&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Mon Dec  5 08:14:26 2016
@@ -1274,7 +1274,10 @@ void AArch64TargetInfo::writeGotPlt(uint
   write64le(Buf, In<ELF64LE>::Plt->getVA());
 }
 
-static uint64_t getAArch64Page(uint64_t Expr) {
+// Page(Expr) is the page address of the expression Expr, defined
+// as (Expr & ~0xFFF). (This applies even if the machine page size
+// supported by the platform has a different value.)
+uint64_t getAArch64Page(uint64_t Expr) {
   return Expr & (~static_cast<uint64_t>(0xFFF));
 }
 

Modified: lld/trunk/ELF/Target.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.h?rev=288668&r1=288667&r2=288668&view=diff
==============================================================================
--- lld/trunk/ELF/Target.h (original)
+++ lld/trunk/ELF/Target.h Mon Dec  5 08:14:26 2016
@@ -105,6 +105,7 @@ public:
 
 std::string toString(uint32_t RelType);
 uint64_t getPPC64TocBase();
+uint64_t getAArch64Page(uint64_t Expr);
 
 extern TargetInfo *Target;
 TargetInfo *createTarget();




More information about the llvm-commits mailing list