[uClibc-cvs] svn commit: trunk/uClibc: extra/Configs ldso/include ldso/ldso

vapier at uclibc.org vapier at uclibc.org
Thu Jul 7 04:46:30 UTC 2005


Author: vapier
Date: 2005-07-06 22:46:29 -0600 (Wed, 06 Jul 2005)
New Revision: 10734

Log:
make RUNPATH/RPATH support configurable

Modified:
   trunk/uClibc/extra/Configs/Config.in
   trunk/uClibc/ldso/include/dl-elf.h
   trunk/uClibc/ldso/ldso/dl-elf.c


Changeset:
Modified: trunk/uClibc/extra/Configs/Config.in
===================================================================
--- trunk/uClibc/extra/Configs/Config.in	2005-07-07 00:14:11 UTC (rev 10733)
+++ trunk/uClibc/extra/Configs/Config.in	2005-07-07 04:46:29 UTC (rev 10734)
@@ -264,6 +264,19 @@
 	  WARNING: Changing the default prefix could cause problems with
 	           binutils' ld !
 
+config LDSO_RUNPATH
+	bool "Enable ELF RUNPATH tag support"
+	depends on BUILD_UCLIBC_LDSO
+	default y
+	help
+	  ELF's may have dynamic RPATH/RUNPATH tags.  These tags list paths 
+	  which extend the library search paths.  They are really only useful 
+	  if a package installs libraries in non standard locations and 
+	  ld.so.conf support is disabled.
+
+	  Usage of RUNPATH tags is not too common, so disabling this feature 
+	  should be safe for most people.
+
 config DL_FINI_CRT_COMPAT
 	bool "uClibc 0.9.27 compatibility"
 	default n

Modified: trunk/uClibc/ldso/include/dl-elf.h
===================================================================
--- trunk/uClibc/ldso/include/dl-elf.h	2005-07-07 00:14:11 UTC (rev 10733)
+++ trunk/uClibc/ldso/include/dl-elf.h	2005-07-07 04:46:29 UTC (rev 10734)
@@ -106,10 +106,12 @@
 				dynamic_info[DT_BIND_NOW] = 1;
 			if (dpnt->d_tag == DT_TEXTREL)
 				dynamic_info[DT_TEXTREL] = 1;
+#ifdef __LDSO_RUNPATH__
 			if (dpnt->d_tag == DT_RUNPATH)
 				dynamic_info[DT_RPATH] = 0;
 			if (dpnt->d_tag == DT_RPATH && dynamic_info[DT_RUNPATH])
 				dynamic_info[DT_RPATH] = 0;
+#endif
 		} else if (dpnt->d_tag < DT_LOPROC) {
 			if (dpnt->d_tag == DT_RELOCCOUNT)
 				dynamic_info[DT_RELCONT_IDX] = dpnt->d_un.d_val;

Modified: trunk/uClibc/ldso/ldso/dl-elf.c
===================================================================
--- trunk/uClibc/ldso/ldso/dl-elf.c	2005-07-07 00:14:11 UTC (rev 10733)
+++ trunk/uClibc/ldso/ldso/dl-elf.c	2005-07-07 04:46:29 UTC (rev 10734)
@@ -255,7 +255,7 @@
 struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
 	struct elf_resolve *tpnt, char *full_libname, int __attribute__((unused)) trace_loaded_objects)
 {
-	char *pnt, *pnt1;
+	char *pnt;
 	struct elf_resolve *tpnt1;
 	char *libname;
 
@@ -269,9 +269,9 @@
 
 	/* Skip over any initial initial './' and '/' stuff to
 	 * get the short form libname with no path garbage */
-	pnt1 = _dl_strrchr(libname, '/');
-	if (pnt1) {
-		libname = pnt1 + 1;
+	pnt = _dl_strrchr(libname, '/');
+	if (pnt) {
+		libname = pnt + 1;
 	}
 
 	/* Critical step!  Weed out duplicates early to avoid
@@ -300,6 +300,7 @@
 	 * The ABI specifies that RPATH is searched before LD_LIBRARY_PATH or
 	 * the default path of /usr/lib.  Check in rpath directories.
 	 */
+#ifdef __LDSO_RUNPATH__
 	pnt = (tpnt ? (char *) tpnt->dynamic_info[DT_RPATH] : NULL);
 	if (pnt) {
 		pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
@@ -307,6 +308,7 @@
 		if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt)) != NULL)
 			return tpnt1;
 	}
+#endif
 
 	/* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */
 	if (_dl_library_path) {
@@ -316,9 +318,11 @@
 			return tpnt1;
 		}
 	}
+
 	/*
 	 * The ABI specifies that RUNPATH is searched after LD_LIBRARY_PATH.
 	 */
+#ifdef __LDSO_RUNPATH__
 	pnt = (tpnt ? (char *)tpnt->dynamic_info[DT_RUNPATH] : NULL);
 	if (pnt) {
 		pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
@@ -326,6 +330,7 @@
 		if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt)) != NULL)
 			return tpnt1;
 	}
+#endif
 
 	/*
 	 * Where should the cache be searched?  There is no such concept in the




More information about the uClibc-cvs mailing list