summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
diff options
context:
space:
mode:
authorKeno Fischer <kfischer@college.harvard.edu>2015-04-15 23:49:29 +0000
committerKeno Fischer <kfischer@college.harvard.edu>2015-04-15 23:49:29 +0000
commitae9bac3366ca37a0a21e0a49151be4281199c6ff (patch)
tree8c6908c3d1350d9bb8cef57863a631888b58dca3 /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
parent1d1a8e00b894e8592945a657626677da13658308 (diff)
downloadbcm5719-llvm-ae9bac3366ca37a0a21e0a49151be4281199c6ff.tar.gz
bcm5719-llvm-ae9bac3366ca37a0a21e0a49151be4281199c6ff.zip
[RuntimeDyldELF] Fold Placeholder into Addend
Summary: This allows us to get rid of the original unrelocated object file after we're done processing relocations (but before applying them). MachO and COFF already do not require this (currently we have temporary hacks to prevent ownership from being released, but those are brittle and should be removed soon). The placeholder mechanism allowed the relocation resolver to look at original object file to obtain more information that are required to apply the relocations. This is usually necessary in two cases: - For relocations targetting sub-word memory locations, there may be pieces of the instruction at the target address which we should not override. - Some relocations on some platforms allow an extra addend to be encoded in their immediate fields. The problem is that in the second case the information cannot be recovered after the relocations have been applied once because they will have been overridden. In the first case we also need to be careful to not use any bits that aren't fixed and may have been overriden by applying a first relocation. In the past both have been fixed by just looking at original object file. This patch attempts to recover the information from the first by looking at the relocated object file, while the extra addend in the second case is read upon relocation processing and addend to the regular addend. I have tested this on X86. Other platforms represent my best understanding of how those relocations should work, but I may have missed something because I do not have access to those platforms. We will keep the ugly workarounds in place for a couple of days, so this commit can be reverted if it breaks the bots. Reviewers: petarj, t.p.northover, lhames Reviewed By: lhames Subscribers: aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D9028 llvm-svn: 235060
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
index 590d26a3fb8..9a4a8630e4c 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
@@ -99,6 +99,13 @@ class RuntimeDyldELF : public RuntimeDyldImpl {
uint64_t SymbolOffset,
unsigned Type);
+ // Compute the address in memory where we can find the placeholder
+ void *computePlaceholderAddress(unsigned SectionID, uint64_t Offset) const;
+
+ // Split out common case for createing the RelocationEntry for when the relocation requires
+ // no particular advanced processing.
+ void processSimpleRelocation(unsigned SectionID, uint64_t Offset, unsigned RelType, RelocationValueRef Value);
+
// The tentative ID for the GOT section
unsigned GOTSectionID;
OpenPOWER on IntegriCloud