ARM: add support for R_ARM_ABS16

Add support for R_ARM_ABS16 relocation mapping.  Addresses PR22156.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225510 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool 2015-01-09 06:57:24 +00:00
parent 466a7dea9b
commit c2a1df7125
2 changed files with 21 additions and 0 deletions

View File

@ -156,6 +156,14 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
break;
}
break;
case FK_Data_2:
switch (Modifier) {
default: llvm_unreachable("unsupported modifier");
case MCSymbolRefExpr::VK_None:
Type = ELF::R_ARM_ABS16;
break;
}
break;
case FK_Data_4:
switch (Modifier) {
default: llvm_unreachable("Unsupported Modifier");

13
test/MC/ARM/reloc-abs16.s Normal file
View File

@ -0,0 +1,13 @@
@ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s | llvm-objdump -r - \
@ RUN: | FileCheck %s
@ RUN: llvm-mc -triple thumbv7-eabi -filetype obj -o - %s | llvm-objdump -r - \
@ RUN: | FileCheck %s
.syntax unified
.short abs16_0 -32768
.short abs16_1 +65535
@ CHECK: 0 R_ARM_ABS16 abs16_0
@ CHECK: 2 R_ARM_ABS16 abs16_1