History log of /external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
799184d8eb140d02385501223cea0a087148b67b 21-Mar-2012 Danil Malyshev <dmalyshev@accesssoftek.com> Re-factored RuntimeDyld.
Added ExecutionEngine/MCJIT tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
b4746203986e943f3dc0af789c5dc8b34cc85db5 21-Mar-2012 Danil Malyshev <dmalyshev@accesssoftek.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
fdebc38523b397743973ff6a2d2e93b112dd96e5 17-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unreachable code. (replace with llvm_unreachable to help GCC where necessary)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
61425c0a7f4e3608a85f7bbf254cd052a15b7446 16-Jan-2012 Jim Grosbach <grosbach@apple.com> MCJIT support for non-function sections.

Move to a by-section allocation and relocation scheme. This allows
better support for sections which do not contain externally visible
symbols.

Flesh out the relocation address vs. local storage address separation a
bit more as well. Remote process JITs use this to tell the relocation
resolution code where the code will live when it executes.

The startFunctionBody/endFunctionBody interfaces to the JIT and the
memory manager are deprecated. They'll stick around for as long as the
old JIT does, but the MCJIT doesn't use them anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
2bd335470f8939782f3df7f6180282d3825d4f09 10-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unnecessary default cases in switches that cover all enum values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
4f9f41f2f9772ecd6a57800fcc8de8ec2734f33c 13-Apr-2011 Jim Grosbach <grosbach@apple.com> Load multiple object files and link them via RuntimeDyld in llvm-rtdyld.

Relocations between the object modules are properly resolved, as in the
following trivial example:

$ cat t.c
int foo();
int main() {
return foo();
}
$ cat foo.c
int foo() {
return 65;
}
$ clang -c t.c -fno-asynchronous-unwind-tables
$ clang -c foo.c -fno-asynchronous-unwind-tables
$ llvm-rtdyld t.o foo.o ; echo $?
loaded '_main' at: 0x10015c000
65



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
6b32e7e213ca14d5d898c84053d6f38a4c360763 13-Apr-2011 Jim Grosbach <grosbach@apple.com> Allow user-specified program entry point for llvm-rtdyld.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
f8c1c8465ff097ad5b87331b6d9a2576167f1402 12-Apr-2011 Jim Grosbach <grosbach@apple.com> MCJIT lazy relocation resolution and symbol address re-assignment.

Add handling for tracking the relocations on symbols and resolving them.
Keep track of the relocations even after they are resolved so that if
the RuntimeDyld client moves the object, it can update the address and any
relocations to that object will be updated.

For our trival object file load/run test harness (llvm-rtdyld), this enables
relocations between functions located in the same object module. It should
be trivially extendable to load multiple objects with mutual references.

As a simple example, the following now works (running on x86_64 Darwin 10.6):


$ cat t.c
int bar() {
return 65;
}

int main() {
return bar();
}
$ clang t.c -fno-asynchronous-unwind-tables -o t.o -c
$ otool -vt t.o
t.o:
(__TEXT,__text) section
_bar:
0000000000000000 pushq %rbp
0000000000000001 movq %rsp,%rbp
0000000000000004 movl $0x00000041,%eax
0000000000000009 popq %rbp
000000000000000a ret
000000000000000b nopl 0x00(%rax,%rax)
_main:
0000000000000010 pushq %rbp
0000000000000011 movq %rsp,%rbp
0000000000000014 subq $0x10,%rsp
0000000000000018 movl $0x00000000,0xfc(%rbp)
000000000000001f callq 0x00000024
0000000000000024 addq $0x10,%rsp
0000000000000028 popq %rbp
0000000000000029 ret
$ llvm-rtdyld t.o -debug-only=dyld ; echo $?
Function sym: '_bar' @ 0
Function sym: '_main' @ 16
Extracting function: _bar from [0, 15]
allocated to 0x100153000
Extracting function: _main from [16, 41]
allocated to 0x100154000
Relocation at '_main' + 16 from '_bar(Word1: 0x2d000000)
Resolving relocation at '_main' + 16 (0x100154010) from '_bar (0x100153000)(pcrel, type: 2, Size: 4).
loaded '_main' at: 0x100154000
65
$




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
7cbf92d1d9945c35d1021458280bb7984f796a01 12-Apr-2011 Jim Grosbach <grosbach@apple.com> Tidy up a bit now that we're using the MemoryManager interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
b027105fa50c864d44873dc78daafb3db3ec9c14 08-Apr-2011 Jim Grosbach <grosbach@apple.com> Refactor MCJIT 32-bit section loading.

Teach 32-bit section loading to use the Memory Manager interface, just like
the 64-bit loading does. Tidy up a few other things here and there.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
c41ab789a052d7a8a4eacecfa1edd4af0d933990 06-Apr-2011 Jim Grosbach <grosbach@apple.com> RuntimeDyld should use the memory manager API.

Start teaching the runtime Dyld interface to use the memory manager API
for allocating space. Rather than mapping directly into the MachO object,
we extract the payload for each object and copy it into a dedicated buffer
allocated via the memory manager. For now, just do Segment64, so this works
on x86_64, but not yet on ARM.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
fcbe5b71936b820647dffff0e4f9c60ece3988a5 05-Apr-2011 Jim Grosbach <grosbach@apple.com> Layer the memory manager between the JIT and the runtime Dyld.

The JITMemory manager references LLVM IR constructs directly, while the
runtime Dyld works at a lower level and can handle objects which may not
originate from LLVM IR. Introduce a new layer for the memory manager to
handle the interface between them. For the MCJIT, this layer will be almost
entirely simply a call-through w/ translation between the IR objects and
symbol names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
5acfa9f0fd641906e520a6caaf644d03def27ae0 29-Mar-2011 Jim Grosbach <grosbach@apple.com> Instantiate a JITMemoryManager for MCJIT Dyld

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
b3eecaf19e81f0cccffdeff940afbfd1a3754af2 22-Mar-2011 Jim Grosbach <grosbach@apple.com> Propogate the error message, not just the error state.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
6e56331ed99e5b96de940dfdc53e438eef521a2e 21-Mar-2011 Jim Grosbach <grosbach@apple.com> Library-ize the dyld components of llvm-rtdyld.

Move the dynamic linking functionality of the llvm-rtdyld program into an
ExecutionEngine support library. Update llvm-rtdyld to just load an object
file into memory, use the library to process it, then run the _main()
function, if one is found.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
35fdeb7b373e416ff00c54abef12e786963af725 18-Mar-2011 Jim Grosbach <grosbach@apple.com> Add llvm-rtdyld support for loading 32-bit code.

Factor out the 64-bit specific bits into a helper function and add an
equivalent that loads the 32-bit sections. This allows using llvm-rtdyld on ARM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
82c25b4964f91760fb4731cdef114b2ba2a950cc 18-Mar-2011 Jim Grosbach <grosbach@apple.com> Naming conventional tidy up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
1cb19a4470533be84eb61e8f5fc40aa9d45f86f9 18-Mar-2011 Jim Grosbach <grosbach@apple.com> MachO file loader and execution utility.

Add a bone-simple utility to load a MachO object into memory, look for
a function (main) in it, and run that function directly. This will be used
as a test and development platform for MC-JIT work regarding symbol resolution,
dynamic lookup, etc..

Code by Daniel Dunbar.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp