llvm-6502/lib
Keno Fischer 277d81e680 Reapply [RuntimeDyldELF] Fold Placeholder into Addend
This reapplies r235060 and 235070, which were reverted because of test failures
in LLDB. The failure was caused because at  moment RuntimeDyld is processing
relocations for all sections, irrespective of whether we actually load them
into memory or not, but RuntimeDyld was not actually remembering where in memory
the unrelocated section is. This commit includes a fix for that issue by
remembering that pointer, though the longer term fix should be to stop processing
unneeded sections.

Original 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.

Differential Revision: http://reviews.llvm.org/D9028

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236341 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-01 20:21:45 +00:00
..
Analysis Fix -Wpessimizing-move warnings by removing std::move calls. 2015-04-30 23:07:00 +00:00
AsmParser [opaque pointer type] Pass GlobalAlias the actual pointer type rather than decomposing it into pointee type + address space 2015-04-29 21:22:39 +00:00
Bitcode Don't overflow GCTable 2015-04-30 04:09:41 +00:00
CodeGen Revert "[WinEH] Add an EH registration and state insertion pass for 32-bit x86" 2015-05-01 20:14:04 +00:00
DebugInfo Add missing library dependency in libPDB. 2015-04-27 21:23:12 +00:00
ExecutionEngine Reapply [RuntimeDyldELF] Fold Placeholder into Addend 2015-05-01 20:21:45 +00:00
Fuzzer
IR [opaque pointer type] Store the value type of an alloca 2015-04-29 23:00:35 +00:00
IRReader
LineEditor
Linker [opaque pointer type] Pass GlobalAlias the actual pointer type rather than decomposing it into pointee type + address space 2015-04-29 21:22:39 +00:00
LTO LTO: Add API to choose whether to embed uselists 2015-04-27 23:38:54 +00:00
MC Remove unnecessary break. 2015-04-30 22:41:12 +00:00
Object
Option
Passes
ProfileData
Support YAML: Fix the output of sequences that contain flow sequences. 2015-05-01 18:34:25 +00:00
TableGen [TableGen] Cleanup formatting by moving operators from beginning of line to end of previous line. NFC 2015-04-30 05:54:22 +00:00
Target Revert "[WinEH] Add an EH registration and state insertion pass for 32-bit x86" 2015-05-01 20:14:04 +00:00
Transforms InstrProf: Instrumenter support for setting profile output from command line 2015-04-30 23:49:23 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile