summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
Diffstat (limited to 'ldso')
-rw-r--r--ldso/Rules.mak1
-rw-r--r--ldso/config.h10
-rw-r--r--ldso/ldso/dl-elf.c42
-rw-r--r--ldso/ldso/readelflib1.c42
-rw-r--r--ldso/util/ldconfig.c5
5 files changed, 51 insertions, 49 deletions
diff --git a/ldso/Rules.mak b/ldso/Rules.mak
index b853c1426..c0bd561bb 100644
--- a/ldso/Rules.mak
+++ b/ldso/Rules.mak
@@ -10,5 +10,4 @@ CFLAGS += -DVERSION=\"$(LDSO_VERSION)\"
CC = $(TOPDIR)extra/gcc-uClibc/$(NATIVE_ARCH)-uclibc-gcc
ifeq ($(DEVEL),true)
CFLAGS += -DUCLIBC_INSTALL_DIR=\"$(INSTALL_DIR)\"
- CFLAGS += -DUCLIBC_DEVEL
endif
diff --git a/ldso/config.h b/ldso/config.h
index 1d1429dc1..26171138d 100644
--- a/ldso/config.h
+++ b/ldso/config.h
@@ -4,18 +4,12 @@
# define LDSO_CACHE "../util/ld.so.cache"
# define LDSO_PRELOAD "../util/ld.so.preload"
# define LDDSTUB "../util/lddstub"
-#elif UCLIBC_DEVEL
+#else
# define LDSO_IMAGE UCLIBC_INSTALL_DIR"/lib/ld.so"
# define LDSO_CONF UCLIBC_INSTALL_DIR"/etc/ld.so.conf"
# define LDSO_CACHE UCLIBC_INSTALL_DIR"/etc/ld.so.cache"
# define LDSO_PRELOAD UCLIBC_INSTALL_DIR"/etc/ld.so.preload"
-# define LDDSTUB UCLIBC_INSTALL_DIR"/lib/lddstub"
-#else
-# define LDSO_IMAGE "/lib/ld.so"
-# define LDSO_CONF "/etc/ld.so.conf"
-# define LDSO_CACHE "/etc/ld.so.cache"
-# define LDSO_PRELOAD "/etc/ld.so.preload"
-# define LDDSTUB "/usr/lib/lddstub"
+# define LDDSTUB UCLIBC_INSTALL_DIR"/usr/lib/lddstub"
#endif
#define LDD_ARGV0 "__LDD_ARGV0"
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 4689e51f2..78ba9d0d2 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -227,7 +227,7 @@ struct elf_resolve *_dl_load_shared_library(int secure,
/*
* Where should the cache be searched? There is no such concept in the
* ABI, so we have some flexibility here. For now, search it before
- * the default path of /usr/lib.
+ * the hard coded paths that follow (i.e before /lib and /usr/lib).
*/
#ifdef USE_CACHE
if (_dl_cache_addr != NULL && _dl_cache_addr != (caddr_t) - 1) {
@@ -247,51 +247,57 @@ struct elf_resolve *_dl_load_shared_library(int secure,
}
#endif
-
-#ifdef UCLIBC_DEVEL
-
- /* Check in /usr/<arch>-linux-uclibc/lib */
- pnt1 = UCLIBC_INSTALL_DIR "/lib";
+ /* Check in <install-dir>/usr/lib */
+ pnt1 = UCLIBC_INSTALL_DIR "/usr/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
+ return tpnt1;
-#else /* UCLIBC_DEVEL */
+ /* Check in <install-dir>/lib */
+ pnt1 = UCLIBC_INSTALL_DIR "/lib/";
+ pnt = mylibname;
+ while (*pnt1)
+ *pnt++ = *pnt1++;
+ pnt1 = libname;
+ while (*pnt1)
+ *pnt++ = *pnt1++;
+ *pnt++ = 0;
+ tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
+ if (tpnt1)
+ return tpnt1;
/* Check in /usr/lib */
pnt1 = "/usr/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
+ return tpnt1;
/* Check in /lib */
- /* try "/lib/". */
pnt1 = "/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
-#endif /* UCLIBC_DEVEL */
+ return tpnt1;
goof:
/* Well, we shot our wad on that one. All we can do now is punt */
diff --git a/ldso/ldso/readelflib1.c b/ldso/ldso/readelflib1.c
index 4689e51f2..78ba9d0d2 100644
--- a/ldso/ldso/readelflib1.c
+++ b/ldso/ldso/readelflib1.c
@@ -227,7 +227,7 @@ struct elf_resolve *_dl_load_shared_library(int secure,
/*
* Where should the cache be searched? There is no such concept in the
* ABI, so we have some flexibility here. For now, search it before
- * the default path of /usr/lib.
+ * the hard coded paths that follow (i.e before /lib and /usr/lib).
*/
#ifdef USE_CACHE
if (_dl_cache_addr != NULL && _dl_cache_addr != (caddr_t) - 1) {
@@ -247,51 +247,57 @@ struct elf_resolve *_dl_load_shared_library(int secure,
}
#endif
-
-#ifdef UCLIBC_DEVEL
-
- /* Check in /usr/<arch>-linux-uclibc/lib */
- pnt1 = UCLIBC_INSTALL_DIR "/lib";
+ /* Check in <install-dir>/usr/lib */
+ pnt1 = UCLIBC_INSTALL_DIR "/usr/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
+ return tpnt1;
-#else /* UCLIBC_DEVEL */
+ /* Check in <install-dir>/lib */
+ pnt1 = UCLIBC_INSTALL_DIR "/lib/";
+ pnt = mylibname;
+ while (*pnt1)
+ *pnt++ = *pnt1++;
+ pnt1 = libname;
+ while (*pnt1)
+ *pnt++ = *pnt1++;
+ *pnt++ = 0;
+ tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
+ if (tpnt1)
+ return tpnt1;
/* Check in /usr/lib */
pnt1 = "/usr/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
+ return tpnt1;
/* Check in /lib */
- /* try "/lib/". */
pnt1 = "/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
-#endif /* UCLIBC_DEVEL */
+ return tpnt1;
goof:
/* Well, we shot our wad on that one. All we can do now is punt */
diff --git a/ldso/util/ldconfig.c b/ldso/util/ldconfig.c
index b7f976890..5c041f8b8 100644
--- a/ldso/util/ldconfig.c
+++ b/ldso/util/ldconfig.c
@@ -684,13 +684,10 @@ int main(int argc, char **argv)
free(extpath);
}
-#ifdef UCLIBC_DEVEL
+ scan_dir(UCLIBC_INSTALL_DIR"/usr/lib");
scan_dir(UCLIBC_INSTALL_DIR"/lib");
-#else
- /* everybody needs these, don't they? */
scan_dir("/usr/lib");
scan_dir("/lib");
-#endif
}
if (!nocache)