aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heider2010-09-06 22:17:46 +0000
committerAndre Heider2010-09-06 22:17:46 +0000
commit83a931dac03c6390482d21306850a02499915741 (patch)
tree19b7fa5472837920cd3930cccb3df3c79ba5869f
parentd3ea6265bac8c0bf4947e6bc6f7bf248799cc966 (diff)
downloadscummvm-rg350-83a931dac03c6390482d21306850a02499915741.tar.gz
scummvm-rg350-83a931dac03c6390482d21306850a02499915741.tar.bz2
scummvm-rg350-83a931dac03c6390482d21306850a02499915741.zip
PLUGINS: Only resolve __dso_handle if loading was successful.
svn-id: r52612
-rw-r--r--backends/plugins/elf/elf-provider.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/backends/plugins/elf/elf-provider.cpp b/backends/plugins/elf/elf-provider.cpp
index f3f6bace07..ddffde3e38 100644
--- a/backends/plugins/elf/elf-provider.cpp
+++ b/backends/plugins/elf/elf-provider.cpp
@@ -113,11 +113,13 @@ bool ELFPlugin::loadPlugin() {
bool ret = DynamicPlugin::loadPlugin();
#ifdef ELF_LOADER_CXA_ATEXIT
- // FIXME HACK: Reverse HACK of findSymbol() :P
- VoidFunc tmp;
- tmp = findSymbol("__dso_handle");
- memcpy(&_dso_handle, &tmp, sizeof(VoidFunc));
- debug(2, "elfloader: __dso_handle is %p", _dso_handle);
+ if (ret) {
+ // FIXME HACK: Reverse HACK of findSymbol() :P
+ VoidFunc tmp;
+ tmp = findSymbol("__dso_handle");
+ memcpy(&_dso_handle, &tmp, sizeof(VoidFunc));
+ debug(2, "elfloader: __dso_handle is %p", _dso_handle);
+ }
#endif
_dlHandle->discard_symtab();