[lld] r261747 - Mark R_AARCH64_PREL32 as relative.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 24 08:15:21 PST 2016
Author: rafael
Date: Wed Feb 24 10:15:13 2016
New Revision: 261747
URL: http://llvm.org/viewvc/llvm-project?rev=261747&view=rev
Log:
Mark R_AARCH64_PREL32 as relative.
Added:
lld/trunk/test/ELF/aarch64-relative.s
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=261747&r1=261746&r2=261747&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Wed Feb 24 10:15:13 2016
@@ -1209,7 +1209,9 @@ AArch64TargetInfo::AArch64TargetInfo() {
PltZeroSize = 32;
}
-bool AArch64TargetInfo::isRelRelative(uint32_t Type) const { return false; }
+bool AArch64TargetInfo::isRelRelative(uint32_t Type) const {
+ return Type == R_AARCH64_PREL32;
+}
bool AArch64TargetInfo::isTlsGlobalDynamicRel(unsigned Type) const {
return Type == R_AARCH64_TLSDESC_ADR_PAGE21 ||
Added: lld/trunk/test/ELF/aarch64-relative.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/aarch64-relative.s?rev=261747&view=auto
==============================================================================
--- lld/trunk/test/ELF/aarch64-relative.s (added)
+++ lld/trunk/test/ELF/aarch64-relative.s Wed Feb 24 10:15:13 2016
@@ -0,0 +1,11 @@
+// REQUIRES: aarch64
+// 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
+
+ .Lfoo:
+ .rodata
+ .long .Lfoo - .
+
+// CHECK: Relocations [
+// CHECK-NEXT: ]
More information about the llvm-commits
mailing list