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

Misha Brukman brukman at cs.uiuc.edu
Tue Jun 3 20:58:01 PDT 2003


Changes in directory llvm/tools/lli/JIT:

Intercept.cpp updated: 1.3 -> 1.4

---
Log message:

Sparc's dlsym() requires the special operand RTLD_SELF to find a symbol in the
currently-running process.


---
Diffs of the changes:

Index: llvm/tools/lli/JIT/Intercept.cpp
diff -u llvm/tools/lli/JIT/Intercept.cpp:1.3 llvm/tools/lli/JIT/Intercept.cpp:1.4
--- llvm/tools/lli/JIT/Intercept.cpp:1.3	Wed May 14 08:53:40 2003
+++ llvm/tools/lli/JIT/Intercept.cpp	Tue Jun  3 20:57:22 2003
@@ -54,7 +54,11 @@
   if (Name == "atexit") return (void*)&jit_atexit;
 
   // If it's an external function, look it up in the process image...
+#if defined(i386) || defined(__i386__) || defined(__x86__)
   void *Ptr = dlsym(0, Name.c_str());
+#elif defined(sparc) || defined(__sparc__) || defined(__sparcv9)
+  void *Ptr = dlsym(RTLD_SELF, Name.c_str());
+#endif
   if (Ptr == 0) {
     std::cerr << "WARNING: Cannot resolve fn '" << Name
 	      << "' using a dummy noop function instead!\n";





More information about the llvm-commits mailing list