[llvm] r225507 - ARM: add support for R_ARM_ABS8 relocations
Saleem Abdulrasool
compnerd at compnerd.org
Thu Jan 8 21:59:12 PST 2015
Author: compnerd
Date: Thu Jan 8 23:59:12 2015
New Revision: 225507
URL: http://llvm.org/viewvc/llvm-project?rev=225507&view=rev
Log:
ARM: add support for R_ARM_ABS8 relocations
Add support for R_ARM_ABS8 relocation. Addresses PR22126.
Added:
llvm/trunk/test/MC/ARM/reloc-abs8.s
Modified:
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp?rev=225507&r1=225506&r2=225507&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp Thu Jan 8 23:59:12 2015
@@ -148,6 +148,14 @@ unsigned ARMELFObjectWriter::GetRelocTyp
} 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");
Added: llvm/trunk/test/MC/ARM/reloc-abs8.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/reloc-abs8.s?rev=225507&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/reloc-abs8.s (added)
+++ llvm/trunk/test/MC/ARM/reloc-abs8.s Thu Jan 8 23:59:12 2015
@@ -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
More information about the llvm-commits
mailing list