mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
AArch64/ARM64: produce correct relocation for conditional branches.
llvm-svn: 206391
This commit is contained in:
parent
af1975547a
commit
3eb27f781b
@ -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