diff options
-rw-r--r-- | lld/ELF/Target.cpp | 2 | ||||
-rw-r--r-- | lld/test/ELF/aarch64-relative.s | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 5f343598dbd..3822eaa7c08 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -1220,7 +1220,7 @@ AArch64TargetInfo::AArch64TargetInfo() { } bool AArch64TargetInfo::isRelRelative(uint32_t Type) const { - return Type == R_AARCH64_PREL32; + return Type == R_AARCH64_PREL32 || Type == R_AARCH64_ADR_PREL_PG_HI21; } bool AArch64TargetInfo::isTlsGlobalDynamicRel(unsigned Type) const { diff --git a/lld/test/ELF/aarch64-relative.s b/lld/test/ELF/aarch64-relative.s index 9ffd6a8704a..43b6c4afbd3 100644 --- a/lld/test/ELF/aarch64-relative.s +++ b/lld/test/ELF/aarch64-relative.s @@ -2,8 +2,11 @@ // RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %s -o %t.o // RUN: ld.lld %t.o -o %t.so -shared // RUN: llvm-readobj -r %t.so | FileCheck %s + adrp x8, .Lfoo + .data .Lfoo: + .rodata .long .Lfoo - . |