diff --git a/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp b/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp index 45e02338e8d..0489caa69a3 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp @@ -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"); diff --git a/test/MC/ARM/reloc-abs8.s b/test/MC/ARM/reloc-abs8.s new file mode 100644 index 00000000000..716f0ff21df --- /dev/null +++ b/test/MC/ARM/reloc-abs8.s @@ -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