Skip to content

Commit

Permalink
ARM: add support for R_ARM_ABS8 relocations
Browse files Browse the repository at this point in the history
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
  • Loading branch information
compnerd committed Jan 9, 2015
1 parent c41acff commit ea4fe48
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
10 changes: 10 additions & 0 deletions test/MC/ARM/reloc-abs8.s
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ea4fe48

Please sign in to comment.