[uClibc-cvs] CVS uClibc/utils

CVS User jocke jocke at codepoet.org
Wed Oct 6 07:34:20 UTC 2004


Update of /var/cvs/uClibc/utils
In directory nail:/tmp/cvs-serv15810/utils

Modified Files:
	ldd.c Makefile dl-cache.h ldconfig.c 
Log Message:
Puts common defines into dl-defs.h (in ldso/include) from dl-elf.h and
dl-cache.h and make use of it. Also disables the lib-path-redundancy check
for the case the cache is not used. Makes use of _PRELOAD_FILE_SUPPORT.
>From Peter Mazinger.


--- /var/cvs/uClibc/utils/ldd.c	2004/10/05 12:06:40	1.18
+++ /var/cvs/uClibc/utils/ldd.c	2004/10/06 07:34:17	1.19
@@ -45,7 +45,7 @@
 #else
 #include "elf.h"
 #endif
-#include "dl-cache.h"
+#include "dl-defs.h"
 
 #ifdef DMALLOC
 #include <dmalloc.h>
@@ -439,7 +439,7 @@
 	   This list must exactly match the list in uClibc/ldso/ldso/dl-elf.c */
 	path =	UCLIBC_RUNTIME_PREFIX "lib:"
 		UCLIBC_RUNTIME_PREFIX "usr/lib"
-#if !defined (__LDSO_CACHE_SUPPORT__)
+#ifndef __LDSO_CACHE_SUPPORT__
 		":" UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib"
 #endif
 		;
--- /var/cvs/uClibc/utils/Makefile	2004/10/05 12:06:40	1.15
+++ /var/cvs/uClibc/utils/Makefile	2004/10/06 07:34:17	1.16
@@ -55,7 +55,7 @@
 ldd:	ldd.c
 	$(CC) $(CFLAGS) $(XXFLAGS) -Wl,-s \
 		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
-		-DUCLIBC_LDSO=$(UCLIBC_LDSO) \
+		-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
 		$^ -o $@ $(LDADD_LIBFLOAT) -L../lib
 	$(STRIPTOOL) -x -R .note -R .comment $@
 
--- /var/cvs/uClibc/utils/dl-cache.h	2004/10/03 07:53:52	1.1
+++ /var/cvs/uClibc/utils/dl-cache.h	2004/10/06 07:34:17	1.2
@@ -1,34 +0,0 @@
-#define LDSO_BASE_PATH UCLIBC_RUNTIME_PREFIX "etc/" __LDSO_BASE_FILENAME__
-#define LDSO_CONF    LDSO_BASE_PATH ".conf"
-#define LDSO_CACHE   LDSO_BASE_PATH ".cache"
-#define LDSO_PRELOAD LDSO_BASE_PATH ".preload"
-
-#define LIB_ANY	     -1
-#define LIB_DLL       0
-#define LIB_ELF       1
-#define LIB_ELF64     0x80
-#define LIB_ELF_LIBC5 2
-#define LIB_ELF_LIBC6 3
-#define LIB_ELF_LIBC0 4
-
-/* Definitions and prototypes for cache stuff */
-#ifdef __LDSO_CACHE_SUPPORT__
-
-#define LDSO_CACHE_MAGIC "ld.so-"
-#define LDSO_CACHE_MAGIC_LEN (sizeof LDSO_CACHE_MAGIC -1)
-#define LDSO_CACHE_VER "1.7.0"
-#define LDSO_CACHE_VER_LEN (sizeof LDSO_CACHE_VER -1)
-
-typedef struct {
-	char magic   [LDSO_CACHE_MAGIC_LEN];
-	char version [LDSO_CACHE_VER_LEN];
-	int nlibs;
-} header_t;
-
-typedef struct {
-	int flags;
-	int sooffset;
-	int liboffset;
-} libentry_t;
-
-#endif
--- /var/cvs/uClibc/utils/ldconfig.c	2004/10/03 07:52:05	1.5
+++ /var/cvs/uClibc/utils/ldconfig.c	2004/10/06 07:34:17	1.6
@@ -876,7 +876,7 @@
 	{
 	    scan_dir(UCLIBC_RUNTIME_PREFIX "lib");
 	    scan_dir(UCLIBC_RUNTIME_PREFIX "usr/lib");
-#if !defined (__LDSO_CACHE_SUPPORT__)
+#ifndef __LDSO_CACHE_SUPPORT__
 	    scan_dir(UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib");
 #endif
 
@@ -884,21 +884,20 @@
 	    if ((extpath = get_extpath()))
 	    {
 		for (cp = strtok(extpath, DIR_SEP); cp; cp = strtok(NULL, DIR_SEP)) {
-			/* strip traling slashes */
+			/* we do the redundancy check only if cache usage is enabled */
+#ifdef __LDSO_CACHE_SUPPORT__
+			/* strip trailing slashes */
 			int len = strlen(cp);
 			if (len) 
 				while (cp[--len] == '/' && len)
 					cp[len] = 0;
-			if (strcmp(UCLIBC_RUNTIME_PREFIX "lib", cp) == 0
-			    || strcmp(UCLIBC_RUNTIME_PREFIX "usr/lib", cp) == 0
-#if !defined (__LDSO_CACHE_SUPPORT__)
-			    || strcmp(UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib", cp) == 0
-#endif
-			    ) {
+			if (strcmp(UCLIBC_RUNTIME_PREFIX "lib", cp) == 0 ||
+			    strcmp(UCLIBC_RUNTIME_PREFIX "usr/lib", cp) == 0) {
 				if (verbose >= 0)
-					warnx("Path `%s' given more than once\n", cp);
+					warnx("Remove `%s' from `%s'\n", cp, LDSO_CONF);
 				continue;
 			}
+#endif
 		    scan_dir(cp);
 		}
 		free(extpath);



More information about the uClibc-cvs mailing list