[lld] r288669 - ELF/AArch64: Simplify R_AARCH64_ADD_ABS_LO12_NC relocation

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


Author: azanella
Date: Mon Dec  5 08:15:03 2016
New Revision: 288669

URL: http://llvm.org/viewvc/llvm-project?rev=288669&view=rev
Log:
ELF/AArch64: Simplify R_AARCH64_ADD_ABS_LO12_NC relocation

This patch uses the updateAArch64Add on relocation apply and remove
the comment.

Modified:
    lld/trunk/ELF/Target.cpp

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=288669&r1=288668&r2=288669&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Mon Dec  5 08:15:03 2016
@@ -1349,11 +1349,7 @@ void AArch64TargetInfo::relocateOne(uint
     write64le(Loc, Val);
     break;
   case R_AARCH64_ADD_ABS_LO12_NC:
-    // This relocation stores 12 bits and there's no instruction
-    // to do it. Instead, we do a 32 bits store of the value
-    // of r_addend bitwise-or'ed Loc. This assumes that the addend
-    // bits in Loc are zero.
-    or32le(Loc, (Val & 0xFFF) << 10);
+    updateAArch64Add(Loc, Val);
     break;
   case R_AARCH64_ADR_GOT_PAGE:
   case R_AARCH64_ADR_PREL_PG_HI21:




More information about the llvm-commits mailing list