R_AARCH64_LDST8_ABS_LO12_NC is effectivelly relative.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 24 Feb 2016 19:58:50 +0000 (19:58 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 24 Feb 2016 19:58:50 +0000 (19:58 +0000)
It only sets the low bits and given the page alignment of PT_LOAD the
dynamic linker can only change the high ones.

llvm-svn: 261765

lld/ELF/Target.cpp
lld/test/ELF/aarch64-relative.s

index 3822eaa..d24bba2 100644 (file)
@@ -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 {
index 43b6c4a..e6a60cc 100644 (file)
@@ -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: