summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-12-30 18:06:52 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-12-30 18:06:52 +0000
commit06e8543cd0e0c2b3477ee522a49c20e021b38088 (patch)
tree2736b14dc45748b8517187ec3b10cca757e52470 /llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
parent82fb8cba16bac814a44af97b6a3836e5ca7ab9f8 (diff)
downloadbcm5719-llvm-06e8543cd0e0c2b3477ee522a49c20e021b38088.tar.gz
bcm5719-llvm-06e8543cd0e0c2b3477ee522a49c20e021b38088.zip
Make the __morestack function available to the JIT memory manager under Linux.
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
Diffstat (limited to 'llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp b/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
index 51b2d0faab8..4c2f7977b76 100644
--- a/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
+++ b/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
@@ -210,6 +210,10 @@ ARM_MATH_IMPORTS(ARM_MATH_DECL)
#undef ARM_MATH_DECL
#endif
+#if defined(__linux__) && defined(__GLIBC__)
+extern "C" void __morestack();
+#endif
+
uint64_t
RTDyldMemoryManager::getSymbolAddressInProcess(const std::string &Name) {
// This implementation assumes that the host program is the target.
@@ -233,6 +237,9 @@ RTDyldMemoryManager::getSymbolAddressInProcess(const std::string &Name) {
if (Name == "lstat64") return (uint64_t)&lstat64;
if (Name == "atexit") return (uint64_t)&atexit;
if (Name == "mknod") return (uint64_t)&mknod;
+
+ // __morestack lives in libgcc, a static library.
+ if (Name == "__morestack") return (uint64_t)&__morestack;
#endif // __linux__ && __GLIBC__
// See ARM_MATH_IMPORTS definition for explanation
OpenPOWER on IntegriCloud