diff options
author | Lang Hames <lhames@gmail.com> | 2013-08-09 00:57:01 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2013-08-09 00:57:01 +0000 |
commit | 623f2025a7a32de68a5ab402aa2b50ca3e3a6958 (patch) | |
tree | bf132ebc3600b1c8ec424db1718650f57692a72e | |
parent | 128ce319ec47c46dc7da16aa3a75185899878745 (diff) | |
download | external_llvm-623f2025a7a32de68a5ab402aa2b50ca3e3a6958.zip external_llvm-623f2025a7a32de68a5ab402aa2b50ca3e3a6958.tar.gz external_llvm-623f2025a7a32de68a5ab402aa2b50ca3e3a6958.tar.bz2 |
Optimistically ignore scattered relocations in MachO in RuntimeDyld. This
un-breaks simple use cases while I work on more general support.
<rdar://problem/14487667>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188044 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp | 10 | ||||
-rw-r--r-- | test/ExecutionEngine/RuntimeDyld/Inputs/arm_secdiff_reloc.o | bin | 0 -> 616 bytes | |||
-rw-r--r-- | test/ExecutionEngine/RuntimeDyld/arm_secdiff_reloc.test | 1 | ||||
-rw-r--r-- | test/ExecutionEngine/RuntimeDyld/lit.local.cfg | 1 |
4 files changed, 12 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp index 0384b32..5d5ff3a 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp @@ -287,6 +287,16 @@ void RuntimeDyldMachO::processRelocationRef(unsigned SectionID, 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]; diff --git a/test/ExecutionEngine/RuntimeDyld/Inputs/arm_secdiff_reloc.o b/test/ExecutionEngine/RuntimeDyld/Inputs/arm_secdiff_reloc.o Binary files differnew file mode 100644 index 0000000..5392266 --- /dev/null +++ b/test/ExecutionEngine/RuntimeDyld/Inputs/arm_secdiff_reloc.o diff --git a/test/ExecutionEngine/RuntimeDyld/arm_secdiff_reloc.test b/test/ExecutionEngine/RuntimeDyld/arm_secdiff_reloc.test new file mode 100644 index 0000000..92e4dd7 --- /dev/null +++ b/test/ExecutionEngine/RuntimeDyld/arm_secdiff_reloc.test @@ -0,0 +1 @@ +RUN: llvm-rtdyld -printline %p/Inputs/arm_secdiff_reloc.o diff --git a/test/ExecutionEngine/RuntimeDyld/lit.local.cfg b/test/ExecutionEngine/RuntimeDyld/lit.local.cfg new file mode 100644 index 0000000..df9b335 --- /dev/null +++ b/test/ExecutionEngine/RuntimeDyld/lit.local.cfg @@ -0,0 +1 @@ +config.suffixes = ['.test'] |