mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-26 09:18:56 +00:00
On Sparc/Solaris, the special handle RTLD_SELF is used as a handle referring to
the program's executing image, not 0 as it is on Linux/x86 and possibly other systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7176 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -361,8 +361,13 @@ void ExecutionEngine::emitGlobals() {
|
|||||||
} else {
|
} else {
|
||||||
// External variable reference, try to use dlsym to get a pointer to it in
|
// External variable reference, try to use dlsym to get a pointer to it in
|
||||||
// the LLI image.
|
// the LLI image.
|
||||||
|
#if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
|
||||||
|
if (void *SymAddr = dlsym(RTLD_SELF, I->getName().c_str()))
|
||||||
|
GlobalAddress[I] = SymAddr;
|
||||||
|
#else
|
||||||
if (void *SymAddr = dlsym(0, I->getName().c_str()))
|
if (void *SymAddr = dlsym(0, I->getName().c_str()))
|
||||||
GlobalAddress[I] = SymAddr;
|
GlobalAddress[I] = SymAddr;
|
||||||
|
#endif
|
||||||
else {
|
else {
|
||||||
std::cerr << "Could not resolve external global address: "
|
std::cerr << "Could not resolve external global address: "
|
||||||
<< I->getName() << "\n";
|
<< I->getName() << "\n";
|
||||||
|
Reference in New Issue
Block a user