Sparc's dlsym() requires the special operand RTLD_SELF to find a symbol in the

currently-running process.

llvm-svn: 6592
This commit is contained in:
Misha Brukman 2003-06-04 01:57:22 +00:00
parent 46666cfcdd
commit 905496e94f
1 changed files with 4 additions and 0 deletions

View File

@ -54,7 +54,11 @@ void *VM::getPointerToNamedFunction(const std::string &Name) {
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";