1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/ExecutionEngine/RuntimeDyld
Keno Fischer 40027f8eda [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
2015-04-15 23:49:29 +00:00
..
Targets [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through 2015-03-30 03:37:06 +00:00
CMakeLists.txt Fix the autoconf build 2015-03-07 21:47:46 +00:00
LLVMBuild.txt Fix build following r211956 2014-06-28 06:31:47 +00:00
Makefile
RTDyldMemoryManager.cpp [ExecutionEngine] Fix dependence issue by moving RTDyldMemoryManager into 2015-02-15 23:22:43 +00:00
RuntimeDyld.cpp [RuntimeDyldELF] Improve GOT support 2015-04-14 02:10:35 +00:00
RuntimeDyldChecker.cpp [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through 2015-03-30 03:37:06 +00:00
RuntimeDyldCheckerImpl.h [RuntimeDyldELF] Improve GOT support 2015-04-14 02:10:35 +00:00
RuntimeDyldCOFF.cpp [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through 2015-03-30 03:37:06 +00:00
RuntimeDyldCOFF.h [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through 2015-03-30 03:37:06 +00:00
RuntimeDyldELF.cpp [RuntimeDyldELF] Fold Placeholder into Addend 2015-04-15 23:49:29 +00:00
RuntimeDyldELF.h [RuntimeDyldELF] Fold Placeholder into Addend 2015-04-15 23:49:29 +00:00
RuntimeDyldImpl.h [RuntimeDyld] Make SectionEntry's Name field a std::string. 2015-04-14 17:13:10 +00:00
RuntimeDyldMachO.cpp [RuntimeDyld] Add casts to make delta computation 64-bit. 2015-04-15 04:46:01 +00:00
RuntimeDyldMachO.h [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through 2015-03-30 03:37:06 +00:00