[uClibc-cvs] uClibc/ldso/libdl libdl.c,1.38,1.39

Erik Andersen andersen at uclibc.org
Sat Feb 14 11:30:42 UTC 2004


Update of /var/cvs/uClibc/ldso/libdl
In directory nail:/tmp/cvs-serv9702/libdl

Modified Files:
	libdl.c 
Log Message:
Joakim Tjernlund writes:

Hi it is me again.

This is the latest ldso patch. the NEW weak symbol handling works now
with a little special handling in _dl_find_hash(). You get to chose
if you want the new or old handling :)

There was 2 missing _dl_check_if_named_library_is_loaded() calls in _dlopen().

I then disabled the _dl_check_if_named_library_is_loaded() in dl-elf.c since
it is rendundant.

Question, why does some _dl_linux_resolver(), like i386, have 2 calls
to _dl_find_hash()? I think that is wrong, isn't it?

I really hope you can check this out soon ...



Index: libdl.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/libdl/libdl.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- libdl.c	12 Feb 2004 08:51:21 -0000	1.38
+++ libdl.c	14 Feb 2004 11:30:39 -0000	1.39
@@ -30,7 +30,7 @@
 
 static int __attribute__ ((unused)) foobar1 = (int) foobar;	/* Use as pointer */
 extern void _dl_dprintf(int, const char *, ...) __attribute__ ((__weak__, __alias__ ("foobar")));
-extern char *_dl_find_hash(const char *, struct dyn_elf *, struct elf_resolve *, enum caller_type)
+extern char *_dl_find_hash(const char *, struct dyn_elf *, int)
 	__attribute__ ((__weak__, __alias__ ("foobar")));
 extern struct elf_resolve * _dl_load_shared_library(int, struct dyn_elf **, struct elf_resolve *, char *, int)
 	__attribute__ ((__weak__, __alias__ ("foobar")));
@@ -179,6 +179,7 @@
 	if(_dl_debug) 
 	_dl_dprintf(_dl_debug_file, "Trying to dlopen '%s'\n", (char*)libname);
 #endif
+	if (!(tpnt = _dl_check_if_named_library_is_loaded((char *)libname, 0)))
 	tpnt = _dl_load_shared_library(0, &rpnt, tfrom, (char*)libname, 0);
 	if (tpnt == NULL) {
 		_dl_unmap_cache();
@@ -220,6 +221,9 @@
 					dpnt->d_un.d_val);
 				name = _dl_get_last_path_component(lpntstr);
 
+				if ((tpnt1 = _dl_check_if_named_library_is_loaded(name, 0)))
+					continue;
+
 #ifdef __SUPPORT_LD_DEBUG__
 				if(_dl_debug) 
 				_dl_dprintf(_dl_debug_file, "Trying to load '%s', needed by '%s'\n", 
@@ -381,7 +385,7 @@
 		}
 	}
 
-	ret = _dl_find_hash((char*)name, handle, NULL, copyrel);
+	ret = _dl_find_hash((char*)name, handle, 0);
 
 	/*
 	 * Nothing found.




More information about the uClibc-cvs mailing list