[llvm] r182098 - r182085 introduced a change that triggered an assertion on ARM. This is an immediate fix

David Tweed david.tweed at arm.com
Fri May 17 07:32:00 PDT 2013


Author: davidtweed
Date: Fri May 17 09:31:59 2013
New Revision: 182098

URL: http://llvm.org/viewvc/llvm-project?rev=182098&view=rev
Log:
r182085 introduced a change that triggered an assertion on ARM. This is an immediate fix
which doesn't resolve the deeper problem.

Modified:
    llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp

Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=182098&r1=182097&r2=182098&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Fri May 17 09:31:59 2013
@@ -277,6 +277,7 @@ void RuntimeDyldELF::resolveX86Relocatio
   }
 }
 
+// FIXME: PR16013: this routine needs modification to handle repeated relocations.
 void RuntimeDyldELF::resolveAArch64Relocation(const SectionEntry &Section,
                                               uint64_t Offset,
                                               uint64_t Value,
@@ -356,6 +357,7 @@ void RuntimeDyldELF::resolveAArch64Reloc
   }
 }
 
+// FIXME: PR16013: this routine needs modification to handle repeated relocations.
 void RuntimeDyldELF::resolveARMRelocation(const SectionEntry &Section,
                                           uint64_t Offset,
                                           uint32_t Value,
@@ -391,8 +393,8 @@ void RuntimeDyldELF::resolveARMRelocatio
     // We are not expecting any other addend in the relocation address.
     // Using 0x000F0FFF because MOVW has its 16 bit immediate split into 2
     // non-contiguous fields.
-    assert((*TargetPtr & 0x000F0FFF) == 0);
     Value = Value & 0xFFFF;
+    *TargetPtr &= ~0x000F0FFF; // Not really right; see FIXME at top.
     *TargetPtr |= Value & 0xFFF;
     *TargetPtr |= ((Value >> 12) & 0xF) << 16;
     break;
@@ -402,8 +404,8 @@ void RuntimeDyldELF::resolveARMRelocatio
   case ELF::R_ARM_MOVT_ABS :
     // We are not expecting any other addend in the relocation address.
     // Use 0x000F0FFF for the same reason as R_ARM_MOVW_ABS_NC.
-    assert((*TargetPtr & 0x000F0FFF) == 0);
     Value = (Value >> 16) & 0xFFFF;
+    *TargetPtr &= ~0x000F0FFF; // Not really right; see FIXME at top.
     *TargetPtr |= Value & 0xFFF;
     *TargetPtr |= ((Value >> 12) & 0xF) << 16;
     break;





More information about the llvm-commits mailing list