[llvm] r188044 - Optimistically ignore scattered relocations in MachO in RuntimeDyld. This
Lang Hames
lhames at gmail.com
Thu Aug 8 17:57:01 PDT 2013
Author: lhames
Date: Thu Aug 8 19:57:01 2013
New Revision: 188044
URL: http://llvm.org/viewvc/llvm-project?rev=188044&view=rev
Log:
Optimistically ignore scattered relocations in MachO in RuntimeDyld. This
un-breaks simple use cases while I work on more general support.
<rdar://problem/14487667>
Added:
llvm/trunk/test/ExecutionEngine/RuntimeDyld/
llvm/trunk/test/ExecutionEngine/RuntimeDyld/Inputs/
llvm/trunk/test/ExecutionEngine/RuntimeDyld/Inputs/arm_secdiff_reloc.o (with props)
llvm/trunk/test/ExecutionEngine/RuntimeDyld/arm_secdiff_reloc.test
llvm/trunk/test/ExecutionEngine/RuntimeDyld/lit.local.cfg
Modified:
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp?rev=188044&r1=188043&r2=188044&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp Thu Aug 8 19:57:01 2013
@@ -287,6 +287,16 @@ void RuntimeDyldMachO::processRelocation
macho::RelocationEntry RE = MachO->getRelocation(RelI.getRawDataRefImpl());
uint32_t RelType = MachO->getAnyRelocationType(RE);
+
+ // FIXME: Properly handle scattered relocations.
+ // For now, optimistically skip these: they can often be ignored, as
+ // the static linker will already have applied the relocation, and it
+ // only needs to be reapplied if symbols move relative to one another.
+ // Note: This will fail horribly where the relocations *do* need to be
+ // applied, but that was already the case.
+ if (MachO->isRelocationScattered(RE))
+ return;
+
RelocationValueRef Value;
SectionEntry &Section = Sections[SectionID];
Added: llvm/trunk/test/ExecutionEngine/RuntimeDyld/Inputs/arm_secdiff_reloc.o
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/Inputs/arm_secdiff_reloc.o?rev=188044&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/ExecutionEngine/RuntimeDyld/Inputs/arm_secdiff_reloc.o
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: llvm/trunk/test/ExecutionEngine/RuntimeDyld/arm_secdiff_reloc.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/arm_secdiff_reloc.test?rev=188044&view=auto
==============================================================================
--- llvm/trunk/test/ExecutionEngine/RuntimeDyld/arm_secdiff_reloc.test (added)
+++ llvm/trunk/test/ExecutionEngine/RuntimeDyld/arm_secdiff_reloc.test Thu Aug 8 19:57:01 2013
@@ -0,0 +1 @@
+RUN: llvm-rtdyld -printline %p/Inputs/arm_secdiff_reloc.o
Added: llvm/trunk/test/ExecutionEngine/RuntimeDyld/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/lit.local.cfg?rev=188044&view=auto
==============================================================================
--- llvm/trunk/test/ExecutionEngine/RuntimeDyld/lit.local.cfg (added)
+++ llvm/trunk/test/ExecutionEngine/RuntimeDyld/lit.local.cfg Thu Aug 8 19:57:01 2013
@@ -0,0 +1 @@
+config.suffixes = ['.test']
More information about the llvm-commits
mailing list