[PATCH] D55599: [LLD][ELF][AArch64] Fix ADRP relocations to undefined weak reference.
Peter Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 13 03:16:22 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL349024: [ELF][AArch64] Fix adrp to undefined weak reference. (authored by psmith, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D55599?vs=177845&id=178029#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55599/new/
https://reviews.llvm.org/D55599
Files:
lld/trunk/ELF/InputSection.cpp
lld/trunk/test/ELF/aarch64-undefined-weak.s
Index: lld/trunk/ELF/InputSection.cpp
===================================================================
--- lld/trunk/ELF/InputSection.cpp
+++ lld/trunk/ELF/InputSection.cpp
@@ -671,11 +671,11 @@
return In.MipsGot->getVA() + In.MipsGot->getTlsIndexOffset(File) -
In.MipsGot->getGp(File);
case R_AARCH64_PAGE_PC: {
- uint64_t Val = Sym.isUndefWeak() ? A : Sym.getVA(A);
+ uint64_t Val = Sym.isUndefWeak() ? P + A : Sym.getVA(A);
return getAArch64Page(Val) - getAArch64Page(P);
}
case R_AARCH64_PLT_PAGE_PC: {
- uint64_t Val = Sym.isUndefWeak() ? A : Sym.getPltVA() + A;
+ uint64_t Val = Sym.isUndefWeak() ? P + A : Sym.getPltVA() + A;
return getAArch64Page(Val) - getAArch64Page(P);
}
case R_RISCV_PC_INDIRECT: {
Index: lld/trunk/test/ELF/aarch64-undefined-weak.s
===================================================================
--- lld/trunk/test/ELF/aarch64-undefined-weak.s
+++ lld/trunk/test/ELF/aarch64-undefined-weak.s
@@ -40,7 +40,7 @@
// CHECK-NEXT: 210008: {{.*}} b.eq #4
// CHECK-NEXT: 21000c: {{.*}} cbz x1, #4
// CHECK-NEXT: 210010: {{.*}} adr x0, #0
-// CHECK-NEXT: 210014: {{.*}} adrp x0, #-2162688
+// CHECK-NEXT: 210014: {{.*}} adrp x0, #0
// CHECK: 210018: {{.*}} .word 0x00000000
// CHECK-NEXT: 21001c: {{.*}} .word 0x00000000
// CHECK-NEXT: 210020: {{.*}} .word 0x00000000
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55599.178029.patch
Type: text/x-patch
Size: 1408 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181213/0452248f/attachment.bin>
More information about the llvm-commits
mailing list