1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

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.

llvm-svn: 7177
This commit is contained in:
Misha Brukman 2003-07-15 15:58:26 +00:00
parent 6a087a3a2f
commit 45dc28808e

View File

@ -362,12 +362,13 @@ void ExecutionEngine::emitGlobals() {
// 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
// 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
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";