[llvm] r225510 - ARM: add support for R_ARM_ABS16

Saleem Abdulrasool compnerd at compnerd.org
Thu Jan 8 22:57:25 PST 2015


Author: compnerd
Date: Fri Jan  9 00:57:24 2015
New Revision: 225510

URL: http://llvm.org/viewvc/llvm-project?rev=225510&view=rev
Log:
ARM: add support for R_ARM_ABS16

Add support for R_ARM_ABS16 relocation mapping.  Addresses PR22156.

Added:
    llvm/trunk/test/MC/ARM/reloc-abs16.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=225510&r1=225509&r2=225510&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp Fri Jan  9 00:57:24 2015
@@ -156,6 +156,14 @@ unsigned ARMELFObjectWriter::GetRelocTyp
         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");

Added: llvm/trunk/test/MC/ARM/reloc-abs16.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/reloc-abs16.s?rev=225510&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/reloc-abs16.s (added)
+++ llvm/trunk/test/MC/ARM/reloc-abs16.s Fri Jan  9 00:57:24 2015
@@ -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
+





More information about the llvm-commits mailing list