[lld] r261765 - R_AARCH64_LDST8_ABS_LO12_NC is effectivelly relative.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 11:58:51 PST 2016


Author: rafael
Date: Wed Feb 24 13:58:50 2016
New Revision: 261765

URL: http://llvm.org/viewvc/llvm-project?rev=261765&view=rev
Log:
R_AARCH64_LDST8_ABS_LO12_NC is effectivelly relative.

It only sets the low bits and given the page alignment of PT_LOAD the
dynamic linker can only change the high ones.

Modified:
    lld/trunk/ELF/Target.cpp
    lld/trunk/test/ELF/aarch64-relative.s

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=261765&r1=261764&r2=261765&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Wed Feb 24 13:58:50 2016
@@ -1220,7 +1220,8 @@ AArch64TargetInfo::AArch64TargetInfo() {
 }
 
 bool AArch64TargetInfo::isRelRelative(uint32_t Type) const {
-  return Type == R_AARCH64_PREL32 || Type == R_AARCH64_ADR_PREL_PG_HI21;
+  return Type == R_AARCH64_PREL32 || Type == R_AARCH64_ADR_PREL_PG_HI21 ||
+         Type == R_AARCH64_LDST8_ABS_LO12_NC;
 }
 
 bool AArch64TargetInfo::isTlsGlobalDynamicRel(unsigned Type) const {

Modified: lld/trunk/test/ELF/aarch64-relative.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/aarch64-relative.s?rev=261765&r1=261764&r2=261765&view=diff
==============================================================================
--- lld/trunk/test/ELF/aarch64-relative.s (original)
+++ lld/trunk/test/ELF/aarch64-relative.s Wed Feb 24 13:58:50 2016
@@ -3,6 +3,7 @@
 // RUN: ld.lld %t.o -o %t.so -shared
 // RUN: llvm-readobj -r %t.so | FileCheck %s
         adrp    x8, .Lfoo
+        strb    w9, [x8, :lo12:.Lfoo]
 
         .data
         .Lfoo:




More information about the llvm-commits mailing list