llvm-project/llvm/lib/ExecutionEngine
Lang Hames 3b514554a2 [RuntimeDyld] Fix '_' stripping in RTDyldMemoryManager::getSymbolAddressInProcess.
The RTDyldMemoryManager::getSymbolAddressInProcess method accepts a
linker-mangled symbol name, but it calls through to dlsym to do the lookup (via
DynamicLibrary::SearchForAddressOfSymbol), and dlsym expects an unmangled
symbol name.

Historically we've attempted to "demangle" by removing leading '_'s on all
platforms, and fallen back to an extra search if that failed. That's broken, as
it can cause symbols to resolve incorrectly on platforms that don't do mangling
if you query '_foo' and the process also happens to contain a 'foo'.

Fix this by demangling conditionally based on the host platform. That's safe
here because this function is specifically for symbols in the host process, so
the usual cross-process JIT looking concerns don't apply.

M    unittests/ExecutionEngine/ExecutionEngineTest.cpp
M    lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp

llvm-svn: 262657
2016-03-03 21:23:15 +00:00
..
IntelJITEvents Refactor duplicated code for linking with pthread. 2016-03-01 15:54:40 +00:00
Interpreter Remove autoconf support 2016-01-26 21:29:08 +00:00
MCJIT Remove autoconf support 2016-01-26 21:29:08 +00:00
OProfileJIT Remove autoconf support 2016-01-26 21:29:08 +00:00
Orc [Orc] Add stack-realignment code to the i386 resolver function. 2016-02-21 22:50:26 +00:00
RuntimeDyld [RuntimeDyld] Fix '_' stripping in RTDyldMemoryManager::getSymbolAddressInProcess. 2016-03-03 21:23:15 +00:00
CMakeLists.txt modules: Add explicit dependency on intrinsics_gen 2015-06-16 00:44:12 +00:00
ExecutionEngine.cpp GlobalValue: use getValueType() instead of getType()->getPointerElementType(). 2016-01-16 20:30:46 +00:00
ExecutionEngineBindings.cpp Support: Fix incremental build when re-configuring targets 2016-02-13 22:58:43 +00:00
GDBRegistrationListener.cpp Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
LLVMBuild.txt add missing dependency for ExecutionEngine lib 2015-06-01 21:56:56 +00:00
SectionMemoryManager.cpp [SectionMemoryManager] Don't just drop the RO free list 2016-01-10 18:17:12 +00:00
TargetSelect.cpp Readdress r236990, use of static members on a non-static variable. 2015-05-11 22:20:48 +00:00