AArch64/ARM64: support relocated ADR instruction

llvm-svn: 207109
This commit is contained in:
Tim Northover 2014-04-24 12:56:30 +00:00
parent 58031e937f
commit e881c63815
2 changed files with 5 additions and 1 deletions

View File

@ -67,7 +67,8 @@ unsigned ARM64ELFObjectWriter::GetRelocType(const MCValue &Target,
case FK_Data_8:
return ELF::R_AARCH64_PREL64;
case ARM64::fixup_arm64_pcrel_adr_imm21:
llvm_unreachable("No ELF relocations supported for ADR at the moment");
assert(SymLoc == ARM64MCExpr::VK_NONE && "unexpected ADR relocation");
return ELF::R_AARCH64_ADR_PREL_LO21;
case ARM64::fixup_arm64_pcrel_adrp_imm21:
if (SymLoc == ARM64MCExpr::VK_ABS && !IsNC)
return ELF::R_AARCH64_ADR_PREL_PG_HI21;

View File

@ -1,6 +1,9 @@
// RUN: llvm-mc -triple=aarch64-none-linux-gnu -filetype=obj %s -o - | \
// RUN: llvm-readobj -r | FileCheck -check-prefix=OBJ %s
// RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj %s -o - | \
// RUN: llvm-readobj -r | FileCheck -check-prefix=OBJ %s
adr x2, some_label
adrp x5, some_label