[llvm-commits] CVS: llvm/tools/lli/ExecutionEngine.cpp
Misha Brukman
brukman at cs.uiuc.edu
Tue Jul 15 10:56:02 PDT 2003
Changes in directory llvm/tools/lli:
ExecutionEngine.cpp updated: 1.13 -> 1.14
---
Log message:
On Sparc/Solaris, the special handle RTLD_SELF is used as a handle referring to
the program's executing image, not 0 as it is on Linux/x86 and possibly other
systems.
---
Diffs of the changes:
Index: llvm/tools/lli/ExecutionEngine.cpp
diff -u llvm/tools/lli/ExecutionEngine.cpp:1.13 llvm/tools/lli/ExecutionEngine.cpp:1.14
--- llvm/tools/lli/ExecutionEngine.cpp:1.13 Mon Jun 30 16:59:00 2003
+++ llvm/tools/lli/ExecutionEngine.cpp Tue Jul 15 10:55:32 2003
@@ -361,8 +361,13 @@
} else {
// External variable reference, try to use dlsym to get a pointer to it in
// the LLI image.
- if (void *SymAddr = dlsym(0, I->getName().c_str()))
+#if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
+ if (void *SymAddr = dlsym(RTLD_SELF, I->getName().c_str()))
GlobalAddress[I] = SymAddr;
+#else
+ if (void *SymAddr = dlsym(0, I->getName().c_str()))
+ GlobalAddress[I] = SymAddr;
+#endif
else {
std::cerr << "Could not resolve external global address: "
<< I->getName() << "\n";
More information about the llvm-commits
mailing list