[llvm-commits] CVS: llvm/tools/lli/ExecutionEngine.cpp

Misha Brukman brukman at cs.uiuc.edu
Tue Jul 15 10:59:00 PDT 2003


Changes in directory llvm/tools/lli:

ExecutionEngine.cpp updated: 1.14 -> 1.15

---
Log message:

Clean up my last checkin: code is easier to read and explains the differences in
usage of the special file handle RTLD_SELF on Sparc/Solaris vs. 0 on Linux/x86.


---
Diffs of the changes:

Index: llvm/tools/lli/ExecutionEngine.cpp
diff -u llvm/tools/lli/ExecutionEngine.cpp:1.14 llvm/tools/lli/ExecutionEngine.cpp:1.15
--- llvm/tools/lli/ExecutionEngine.cpp:1.14	Tue Jul 15 10:55:32 2003
+++ llvm/tools/lli/ExecutionEngine.cpp	Tue Jul 15 10:58:26 2003
@@ -362,12 +362,13 @@
       // External variable reference, try to use dlsym to get a pointer to it in
       // the LLI image.
 #if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
-      if (void *SymAddr = dlsym(RTLD_SELF, I->getName().c_str()))
-        GlobalAddress[I] = SymAddr;
+      // RTLD_SELF is already defined and it's not zero
 #else
-      if (void *SymAddr = dlsym(0, I->getName().c_str()))
-        GlobalAddress[I] = SymAddr;      
+      // Linux/x86 wants to use a 0, other systems may differ
+#define RTLD_SELF 0
 #endif
+      if (void *SymAddr = dlsym(RTLD_SELF, I->getName().c_str()))
+        GlobalAddress[I] = SymAddr;
       else {
         std::cerr << "Could not resolve external global address: "
                   << I->getName() << "\n";





More information about the llvm-commits mailing list