[llvm] r205502 - Add support for the R_ARM_ABS32 relocation.

Rafael Espindola rafael.espindola at gmail.com
Wed Apr 2 19:27:00 PDT 2014


Author: rafael
Date: Wed Apr  2 21:27:00 2014
New Revision: 205502

URL: http://llvm.org/viewvc/llvm-project?rev=205502&view=rev
Log:
Add support for the R_ARM_ABS32 relocation.

This should bring the arm buildbots back.

Added:
    llvm/trunk/test/DebugInfo/Inputs/arm-relocs.elf-arm
    llvm/trunk/test/DebugInfo/arm-relocs.test
Modified:
    llvm/trunk/include/llvm/Object/RelocVisitor.h

Modified: llvm/trunk/include/llvm/Object/RelocVisitor.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/RelocVisitor.h?rev=205502&r1=205501&r2=205502&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/RelocVisitor.h (original)
+++ llvm/trunk/include/llvm/Object/RelocVisitor.h Wed Apr  2 21:27:00 2014
@@ -153,6 +153,14 @@ public:
         HasError = true;
         return RelocToApply();
       }
+    } else if (FileFormat == "ELF32-arm") {
+      switch (RelocType) {
+      default:
+        HasError = true;
+        return RelocToApply();
+      case llvm::ELF::R_ARM_ABS32:
+        return visitELF_ARM_ABS32(R, Value);
+      }
     }
     HasError = true;
     return RelocToApply();
@@ -325,6 +333,11 @@ private:
     return RelocToApply(Value + Addend, 8);
   }
 
+  RelocToApply visitELF_ARM_ABS32(RelocationRef R, uint64_t Value) {
+    int64_t Addend = getAddend32LE(R);
+    return RelocToApply(Value + Addend, 4);
+  }
+
 };
 
 }

Added: llvm/trunk/test/DebugInfo/Inputs/arm-relocs.elf-arm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/arm-relocs.elf-arm?rev=205502&view=auto
==============================================================================
Binary files llvm/trunk/test/DebugInfo/Inputs/arm-relocs.elf-arm (added) and llvm/trunk/test/DebugInfo/Inputs/arm-relocs.elf-arm Wed Apr  2 21:27:00 2014 differ

Added: llvm/trunk/test/DebugInfo/arm-relocs.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/arm-relocs.test?rev=205502&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/arm-relocs.test (added)
+++ llvm/trunk/test/DebugInfo/arm-relocs.test Wed Apr  2 21:27:00 2014
@@ -0,0 +1,5 @@
+RUN: llvm-dwarfdump %p/Inputs/arm-relocs.elf-arm | FileCheck %s
+
+; CHECK: debug_info contents
+; CHECK: DW_TAG_enumeration_type
+; CHECK-NEXT: DW_AT_name{{.*}} = "e1"





More information about the llvm-commits mailing list