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:
Tim Northover 2014-04-16 15:27:52 +00:00
parent ced4836f4d
commit 9a8aff0062
2 changed files with 6 additions and 2 deletions

View File

@ -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:
// 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");
}

View File

@ -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