llvm/test/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
..
MCJIT Respect Addend when processing MCJIT relocations to local/global symbols. 2013-04-05 13:29:04 +00:00
2002-12-16-ArgTest.ll Corrections for XFAIL armv5 tests 2013-02-28 10:05:10 +00:00
2003-01-04-ArgumentBug.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
2003-01-04-LoopTest.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
2003-01-04-PhiTest.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2003-01-09-SARTest.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2003-01-10-FUCOM.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2003-01-15-AlignmentTest.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2003-05-06-LivenessClobber.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
2003-05-07-ArgumentTest.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
2003-05-11-PHIRegAllocBug.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2003-06-04-bzip2-bug.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2003-06-05-PHIBug.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2003-08-15-AllocaAssertion.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2003-08-21-EnvironmentTest.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
2003-08-23-RegisterAllocatePhysReg.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2005-12-02-TailCallBug.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
2007-12-10-APIntLoadStore.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2008-06-05-APInt-OverAShr.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
2010-01-15-UndefValue.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
fpbitcast.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
hello2.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
hello.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
lit.local.cfg Disable Execution Engine tests not supported by Hexagon. 2013-03-25 20:02:14 +00:00
simplesttest.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
simpletest.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
stubs.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
test-arith.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
test-branch.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
test-call-no-external-funcs.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
test-call.ll Corrections for XFAIL armv5 tests 2013-02-28 10:05:10 +00:00
test-cast.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
test-common-symbols.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
test-constantexpr.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
test-fp-no-external-funcs.ll Corrections for XFAIL armv5 tests 2013-02-28 10:05:10 +00:00
test-fp.ll Corrections for XFAIL armv5 tests 2013-02-28 10:05:10 +00:00
test-global-init-nonzero.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
test-global.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
test-interp-vec-loadstore.ll Add support for vector data types in the LLVM interpreter. 2013-04-01 15:53:30 +00:00
test-loadstore.ll This patch improves the MCJIT runtime dynamic loader by adding new handling 2012-04-12 20:13:57 +00:00
test-local.ll Additional ExecutionEngine tests, as part of bringing up the MCJIT on ELF 2012-01-17 09:14:54 +00:00
test-logical.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
test-loop.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
test-phi.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
test-ret.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
test-return.ll Remove "XFAIL: arm" from test/ExecutionEngine/test-return.ll 2012-01-17 18:21:05 +00:00
test-setcond-fp.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
test-setcond-int.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
test-shift.ll Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00