mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-23 12:40:17 +00:00
AArch64/ARM64: produce correct relocation for conditional branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206391 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ced4836f4d
commit
9a8aff0062
@ -83,7 +83,11 @@ unsigned ARM64ELFObjectWriter::GetRelocType(const MCValue &Target,
|
||||
case ARM64::fixup_arm64_pcrel_call26:
|
||||
return ELF::R_AARCH64_CALL26;
|
||||
case ARM64::fixup_arm64_pcrel_imm19:
|
||||
return ELF::R_AARCH64_TLSIE_LD_GOTTPREL_PREL19;
|
||||
// A bit of an oddity here: shared by both "ldr x0, :gottprel:var" and
|
||||
// "b.eq var".
|
||||
if (SymLoc == ARM64MCExpr::VK_GOTTPREL)
|
||||
return ELF::R_AARCH64_TLSIE_LD_GOTTPREL_PREL19;
|
||||
return ELF::R_AARCH64_CONDBR19;
|
||||
default:
|
||||
llvm_unreachable("Unsupported pc-relative fixup kind");
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// RUN: llvm-mc -triple=aarch64-none-linux-gnu -filetype=obj %s -o - | \
|
||||
// RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj %s -o - | \
|
||||
// RUN: llvm-readobj -r | FileCheck -check-prefix=OBJ %s
|
||||
|
||||
b.eq somewhere
|
||||
|
Loading…
Reference in New Issue
Block a user