summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-10-15 08:55:22 +0000
committerEric Andersen <andersen@codepoet.org>2003-10-15 08:55:22 +0000
commit5f7b130ef0be7111b91d91e9a77a6226b048489b (patch)
tree17ccde9a4faf9b7e09a4c6c0c29eeb42f3e87312 /ldso
parent94b92c2fab333403aa43fd55ec858fdbf666f8c3 (diff)
Doh! I was returning with an incorrect pointer type when dlopening
already loaded libs, which unsurprisingly would cause dlsym() to not work at all... -Erik
Diffstat (limited to 'ldso')
-rw-r--r--ldso/libdl/dlib.c14
-rw-r--r--ldso/libdl/libdl.c14
2 files changed, 14 insertions, 14 deletions
diff --git a/ldso/libdl/dlib.c b/ldso/libdl/dlib.c
index c54104ffe..ebd7b85b8 100644
--- a/ldso/libdl/dlib.c
+++ b/ldso/libdl/dlib.c
@@ -186,13 +186,6 @@ void *_dlopen(const char *libname, int flag)
_dl_unmap_cache();
return NULL;
}
- if (tpnt->init_flag & INIT_FUNCS_CALLED) {
-
- /* If the init and fini stuff has already been run, that means
- * someone called dlopen on a library we already have opened, so
- * we don't need to fix thing up any further... */
- return tpnt;
- }
dyn_chain = (struct dyn_elf *) malloc(sizeof(struct dyn_elf));
_dl_memset(dyn_chain, 0, sizeof(struct dyn_elf));
@@ -204,6 +197,13 @@ void *_dlopen(const char *libname, int flag)
dyn_chain->next_handle = _dl_handles;
_dl_handles = rpnt = dyn_chain;
+ if (tpnt->init_flag & INIT_FUNCS_CALLED) {
+ /* If the init and fini stuff has already been run, that means
+ * the dlopen'd library has already been loaded, and nothing
+ * further needs to be done. */
+ return (void *) dyn_chain;
+ }
+
#ifdef __SUPPORT_LD_DEBUG__
if(_dl_debug)
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index c54104ffe..ebd7b85b8 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -186,13 +186,6 @@ void *_dlopen(const char *libname, int flag)
_dl_unmap_cache();
return NULL;
}
- if (tpnt->init_flag & INIT_FUNCS_CALLED) {
-
- /* If the init and fini stuff has already been run, that means
- * someone called dlopen on a library we already have opened, so
- * we don't need to fix thing up any further... */
- return tpnt;
- }
dyn_chain = (struct dyn_elf *) malloc(sizeof(struct dyn_elf));
_dl_memset(dyn_chain, 0, sizeof(struct dyn_elf));
@@ -204,6 +197,13 @@ void *_dlopen(const char *libname, int flag)
dyn_chain->next_handle = _dl_handles;
_dl_handles = rpnt = dyn_chain;
+ if (tpnt->init_flag & INIT_FUNCS_CALLED) {
+ /* If the init and fini stuff has already been run, that means
+ * the dlopen'd library has already been loaded, and nothing
+ * further needs to be done. */
+ return (void *) dyn_chain;
+ }
+
#ifdef __SUPPORT_LD_DEBUG__
if(_dl_debug)