llvm-6502/lib/ExecutionEngine/RuntimeDyld
Lang Hames daf061cf05 [MCJIT] Refactor and add stub inspection to the RuntimeDyldChecker framework.
This patch introduces a 'stub_addr' builtin that can be used to find the address
of the stub for a given (<file>, <section>, <symbol>) tuple. This address can be
used both to verify the contents of stubs (by loading from the returned address)
and to verify references to stubs (by comparing against the returned address).

Example (1) - Verifying stub contents:

Load 8 bytes (assuming a 64-bit target) from the stub for 'x' in the __text
section of f.o, and compare that value against the addres of 'x'.

# rtdyld-check: *{8}(stub_addr(f.o, __text, x) = x

Example (2) - Verifying references to stubs:

Decode the immediate of the instruction at label 'l', and verify that it's
equal to the offset from the next instruction's PC to the stub for 'y' in the
__text section of f.o (i.e. it's the correct PC-rel difference).

# rtdyld-check: decode_operand(l, 4) = stub_addr(f.o, __text, y) - next_pc(l)
l:
        movq    y@GOTPCREL(%rip), %rax

Since stub inspection requires cooperation with RuntimeDyldImpl this patch
pimpl-ifies RuntimeDyldChecker. Its implementation is moved in to a new class,
RuntimeDyldCheckerImpl, that has access to the definition of RuntimeDyldImpl.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213698 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-22 22:47:39 +00:00
..
Targets Appease the buildbots. 2014-07-22 22:02:19 +00:00
CMakeLists.txt [RuntimeDyld] Add a framework for testing relocation logic in RuntimeDyld. 2014-06-27 20:20:57 +00:00
GDBRegistrar.cpp [C++] Use 'nullptr'. 2014-04-24 06:44:33 +00:00
JITRegistrar.h [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
LLVMBuild.txt Fix build following r211956 2014-06-28 06:31:47 +00:00
Makefile
ObjectImageCommon.h Pass a std::unique_ptr& to the create??? methods is lib/Object. 2014-06-23 22:00:37 +00:00
RuntimeDyld.cpp [MCJIT] Refactor and add stub inspection to the RuntimeDyldChecker framework. 2014-07-22 22:47:39 +00:00
RuntimeDyldChecker.cpp [MCJIT] Refactor and add stub inspection to the RuntimeDyldChecker framework. 2014-07-22 22:47:39 +00:00
RuntimeDyldCheckerImpl.h [MCJIT] Refactor and add stub inspection to the RuntimeDyldChecker framework. 2014-07-22 22:47:39 +00:00
RuntimeDyldELF.cpp [PowerPC] ELFv2 dynamic loader support 2014-07-20 23:53:14 +00:00
RuntimeDyldELF.h [RuntimeDyld, PowerPC] Fix/improve handling of TOC relocations 2014-06-27 10:32:14 +00:00
RuntimeDyldImpl.h [MCJIT] Refactor and add stub inspection to the RuntimeDyldChecker framework. 2014-07-22 22:47:39 +00:00
RuntimeDyldMachO.cpp [RuntimeDyld] Change the return type of decodeAddend to match the storage type. 2014-07-22 21:42:46 +00:00
RuntimeDyldMachO.h [MCJIT] Refactor and add stub inspection to the RuntimeDyldChecker framework. 2014-07-22 22:47:39 +00:00