llvm-6502/lib/ExecutionEngine
Ulrich Weigand 03f018a713 Respect Addend when processing MCJIT relocations to local/global symbols.
When the RuntimeDyldELF::processRelocationRef routine finds the target
symbol of a relocation in the local or global symbol table, it performs
a section-relative relocation:

    Value.SectionID = lsi->second.first;
    Value.Addend = lsi->second.second;

At this point, however, any Addend that might have been specified in
the original relocation record is lost.  This is somewhat difficult to
trigger for relocations within the code section since they usually
do not contain non-zero Addends (when built with the default JIT code
model, in any case).  However, the problem can be reliably triggered
by a relocation within the data section caused by code like:

 int test[2] = { -1, 0 };
 int *p = &test[1];

The initializer of "p" will need a relocation to "test + 4".  On
platforms using RelA relocations this means an Addend of 4 is required.
Current code ignores this addend when processing the relocation,
resulting in incorrect execution.

Fixed by taking the Addend into account when processing relocations
to symbols found in the local or global symbol table.

Tested on x86_64-linux and powerpc64-linux.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178869 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05 13:29:04 +00:00
..
IntelJITEvents Formatting correction 2013-01-29 00:50:18 +00:00
Interpreter Add support for vector data types in the LLVM interpreter. 2013-04-01 15:53:30 +00:00
JIT Make APFloat constructor require explicit semantics. 2013-01-22 09:46:31 +00:00
MCJIT Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
OProfileJIT [patch] bug 15055 Add Unistd.h to OProfileWrapper.cpp 2013-02-07 20:43:33 +00:00
RuntimeDyld Respect Addend when processing MCJIT relocations to local/global symbols. 2013-04-05 13:29:04 +00:00
CMakeLists.txt Add profiling support for Intel Parallel Amplifier XE (VTune) for JITted code in LLVM. 2012-03-13 08:33:15 +00:00
EventListenerCommon.h Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
ExecutionEngine.cpp Add support for vector data types in the LLVM interpreter. 2013-04-01 15:53:30 +00:00
ExecutionEngineBindings.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
LLVMBuild.txt Add profiling support for Intel Parallel Amplifier XE (VTune) for JITted code in LLVM. 2012-03-13 08:33:15 +00:00
Makefile Add profiling support for Intel Parallel Amplifier XE (VTune) for JITted code in LLVM. 2012-03-13 08:33:15 +00:00
TargetSelect.cpp Introduce llvm::sys::getProcessTriple() function. 2013-01-16 17:27:22 +00:00