[llvm-commits] CVS: llvm/tools/lli/ExecutionEngine.cpp
Misha Brukman
brukman at cs.uiuc.edu
Fri Jul 18 13:34:01 PDT 2003
Changes in directory llvm/tools/lli:
ExecutionEngine.cpp updated: 1.15 -> 1.16
---
Log message:
Cleaned up the code which chooses the appropriate value for the file descriptor
to pass to dlsym() -- Linux/x86 wants 0 while Sparc/Solaris wants RTLD_SELF,
which is not zero. Thanks to Chris for the suggestion.
---
Diffs of the changes:
Index: llvm/tools/lli/ExecutionEngine.cpp
diff -u llvm/tools/lli/ExecutionEngine.cpp:1.15 llvm/tools/lli/ExecutionEngine.cpp:1.16
--- llvm/tools/lli/ExecutionEngine.cpp:1.15 Tue Jul 15 10:58:26 2003
+++ llvm/tools/lli/ExecutionEngine.cpp Fri Jul 18 13:33:38 2003
@@ -359,14 +359,13 @@
DEBUG(std::cerr << "Global '" << I->getName() << "' -> "
<< (void*)GlobalAddress[I] << "\n");
} else {
- // External variable reference, try to use dlsym to get a pointer to it in
- // the LLI image.
-#if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
- // RTLD_SELF is already defined and it's not zero
-#else
+ // On Sparc, RTLD_SELF is already defined and it's not zero
// Linux/x86 wants to use a 0, other systems may differ
+#ifndef RTLD_SELF
#define RTLD_SELF 0
#endif
+ // External variable reference, try to use dlsym to get a pointer to it in
+ // the LLI image.
if (void *SymAddr = dlsym(RTLD_SELF, I->getName().c_str()))
GlobalAddress[I] = SymAddr;
else {
More information about the llvm-commits
mailing list