ARM: add support for R_ARM_ABS8 relocations

Add support for R_ARM_ABS8 relocation.  Addresses PR22126.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225507 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool 2015-01-09 05:59:12 +00:00
parent c41acffe22
commit ea4fe48b22
2 changed files with 18 additions and 0 deletions

View File

@ -148,6 +148,14 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
} else {
switch ((unsigned)Fixup.getKind()) {
default: llvm_unreachable("invalid fixup kind!");
case FK_Data_1:
switch (Modifier) {
default: llvm_unreachable("unsupported Modifier");
case MCSymbolRefExpr::VK_None:
Type = ELF::R_ARM_ABS8;
break;
}
break;
case FK_Data_4:
switch (Modifier) {
default: llvm_unreachable("Unsupported Modifier");

10
test/MC/ARM/reloc-abs8.s Normal file
View File

@ -0,0 +1,10 @@
@ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s | llvm-objdump -r - \
@ RUN: | FileCheck %s
.syntax unified
.byte abs8_0 -128
.byte abs8_1 +255
@ CHECK: 0 R_ARM_ABS8 abs8_0
@ CHECK: 1 R_ARM_ABS8 abs8_1