summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ExecutionEngine] Fix dependence issue by moving RTDyldMemoryManager intoLang Hames2015-02-151-294/+0
| | | | | | | | RuntimeDyld. This should fix http://llvm.org/PR22593. llvm-svn: 229343
* RTDyldMemoryManager.cpp: Make the reference to __morestack weak.Peter Collingbourne2014-12-301-2/+4
| | | | | | | This fixes the DSO build for now. Eventually we should develop some other mechanism to make this work correctly with DSOs. llvm-svn: 225014
* The __morestack function is only available on i386 and x86_64 architectures.Peter Collingbourne2014-12-301-1/+4
| | | | llvm-svn: 224994
* Make the __morestack function available to the JIT memory manager under Linux.Peter Collingbourne2014-12-301-0/+7
| | | | | | | | | This function's implementation lives in libgcc, a static library, so we need to expose it explicitly, like the other such functions. Differential Revision: http://reviews.llvm.org/D6788 llvm-svn: 224993
* [MCJIT] Turn the getSymbolAddress free function created in r218626 into a staticLang Hames2014-10-011-1/+2
| | | | | | | | | | | member of RTDyldMemoryManager (and rename to getSymbolAddressInProcess). The functionality this provides is very specific to RTDyldMemoryManager, so it makes sense to keep it in that class to avoid accidental re-use. No functional change. llvm-svn: 218741
* Unit test r218187, changing RTDyldMemoryManager::getSymbolAddress's behavior ↵David Blaikie2014-09-291-1/+1
| | | | | | | | | | | favor mangled lookup over unmangled lookup. The contract of this function seems problematic (fallback in either direction seems like it could produce bugs in one client or another), but here's some tests for its current behavior, at least. See the commit/review thread of r218187 for more discussion. llvm-svn: 218626
* Remove redundant if test.Lang Hames2014-09-211-4/+1
| | | | llvm-svn: 218220
* RTDyldMemoryManager::getSymbolAddress(): Make sure to return 0 if symbol ↵NAKAMURA Takumi2014-09-201-0/+2
| | | | | | name is not met. [-Wreturn-type] llvm-svn: 218195
* [MCJIT] Make RTDyldMemoryManager::getSymbolAddress's behaviour more consistent.Lang Hames2014-09-201-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch modifies RTDyldMemoryManager::getSymbolAddress(Name)'s behavior to make it consistent with how clients are using it: Name should be mangled, and getSymbolAddress should demangle it on the caller's behalf before looking the name up in the process. This patch also fixes the one client (MCJIT::getPointerToFunction) that had been passing unmangled names (by having it pass mangled names instead). Background: RTDyldMemoryManager::getSymbolAddress(Name) has always used a re-try mechanism when looking up symbol names in the current process. Prior to this patch getSymbolAddress first tried to look up 'Name' exactly as the user passed it in and then, if that failed, tried to demangle 'Name' and re-try the look up. The implication of this behavior is that getSymbolAddress expected to be called with unmangled names, and that handling mangled names was a fallback for convenience. This is inconsistent with how clients (particularly the RuntimeDyldImpl subclasses, but also MCJIT) usually use this API. Most clients pass in mangled names, and succeed only because of the fallback case. For clients passing in mangled names, getSymbolAddress's old behavior was actually dangerous, as it could cause unmangled names in the process to shadow mangled names being looked up. For example, consider: foo.c: int _x = 7; int x() { return _x; } foo.o: 000000000000000c D __x 0000000000000000 T _x If foo.c becomes part of the process (E.g. via dlopen("libfoo.dylib")) it will add symbols 'x' (the function) and '_x' (the variable) to the process. However jit clients looking for the function 'x' will be using the mangled function name '_x' (note how function 'x' appears in foo.o). When getSymbolAddress goes looking for '_x' it will find the variable instead, and return its address and in place of the function, leading to JIT'd code calling the variable and crashing (if we're lucky). By requiring that getSymbolAddress be called with mangled names, and demangling only when we're about to do a lookup in the process, the new behavior implemented in this patch should eliminate any chance of names being shadowed during lookup. There's no good way to test this at the moment: This issue only arrises when looking up process symbols (not JIT'd symbols). Any test case would have to generate a platform-appropriate dylib to pass to llvm-rtdyld, and I'm not aware of any in-tree tool for doing this in a portable way. llvm-svn: 218187
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+0
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* There are no __register_frame and __deregister_frame functions Yaron Keren2013-12-171-1/+1
| | | | | | | | | | when using structured exception handling (SEH) on Windows 64. http://llvm-reviews.chandlerc.com/D2378 Patch by Jonathan Liu! llvm-svn: 197483
* Resolve JIT runtime linking problems on Android.Andrew Kaylor2013-11-151-2/+83
| | | | | | Patch by James Lyon! llvm-svn: 194832
* The FIXME was indeed fixed in the linker, comment removed.Yaron Keren2013-10-251-4/+0
| | | | llvm-svn: 193402
* Really fix build warning/error that I think r192756 was trying to fix.Craig Topper2013-10-161-4/+4
| | | | llvm-svn: 192773
* Fixing build warning/errorAndrew Kaylor2013-10-161-2/+3
| | | | llvm-svn: 192756
* Adding support for deregistering EH frames with MCJIT.Andrew Kaylor2013-10-161-6/+77
| | | | | | Patch by Yaron Keren llvm-svn: 192753
* Adding multiple object support to MCJIT EH frame handlingAndrew Kaylor2013-10-111-3/+8
| | | | llvm-svn: 192504
* Adding multiple module support for MCJIT.Andrew Kaylor2013-10-011-15/+25
| | | | | | | | Tests to follow. PIC with small code model and EH frame handling will not work with multiple modules. There are also some rough edges to be smoothed out for remote target support. llvm-svn: 191722
* Fix the build issue under ia64. Close bug #5715Sylvestre Ledru2013-08-271-1/+1
| | | | | | Thanks to Luca Falavigna for the help and most of the patch. llvm-svn: 189324
* Preserve const correctness.Benjamin Kramer2013-06-041-3/+3
| | | | | | GCC complains about casting away const. llvm-svn: 183216
* Add missing header for atexit.Michael J. Spencer2013-05-241-0/+2
| | | | llvm-svn: 182672
* Put RTDyldMemoryManager into its own file, and make it linked into Filip Pizlo2013-05-211-0/+116
| | | | | | | | | | | | | | | | | | libExecutionEngine. Move method implementations that aren't specific to allocation out of SectionMemoryManager and into RTDyldMemoryManager. This is in preparation for exposing RTDyldMemoryManager through the C API. This is a fixed version of r182407 and r182411. That first revision broke builds because I forgot to move the conditional includes of various POSIX headers from SectionMemoryManager into RTDyldMemoryManager. Those includes are necessary because of how getPointerToNamedFunction works around the glibc libc_nonshared.a thing. The latter revision still broke things because I forgot to include llvm/Config/config.h. llvm-svn: 182418
* Roll out r182411 and 182412 because it's still broken.Filip Pizlo2013-05-211-115/+0
| | | | llvm-svn: 182415
* Fix busted comment. This conditional include block used to be in ↵Filip Pizlo2013-05-211-1/+1
| | | | | | SectionMemoryManager, but is now in RTDyldMemoryManager. llvm-svn: 182412
* Put RTDyldMemoryManager into its own file, and make it linked into Filip Pizlo2013-05-211-0/+115
| | | | | | | | | | | | | | | | libExecutionEngine. Move method implementations that aren't specific to allocation out of SectionMemoryManager and into RTDyldMemoryManager. This is in preparation for exposing RTDyldMemoryManager through the C API. This is a fixed version of r182407. That revision broke builds because I forgot to move the conditional includes of various POSIX headers from SectionMemoryManager into RTDyldMemoryManager. Those includes are necessary because of how getPointerToNamedFunction works around the glibc libc_nonshared.a thing. llvm-svn: 182411
* Roll out r182407 and r182408 because they broke builds.Filip Pizlo2013-05-211-105/+0
| | | | llvm-svn: 182409
* Put RTDyldMemoryManager into its own file, and make it linked into Filip Pizlo2013-05-211-0/+105
libExecutionEngine. Move method implementations that aren't specific to allocation out of SectionMemoryManager and into RTDyldMemoryManager. This is in preparation for exposing RTDyldMemoryManager through the C API. llvm-svn: 182407
OpenPOWER on IntegriCloud