OSDN Git Service

Mike Frysinger writes:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>
Tue, 10 Aug 2004 09:50:07 +0000 (09:50 -0000)
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>
Tue, 10 Aug 2004 09:50:07 +0000 (09:50 -0000)
i was sticking some libraries in non-standard (i.e. not-hardcoded) paths and
then updating ld.so.conf accordingly ... oddly though, i couldnt get binaries
that linked against those libraries to run ... `ldconfig -v` showed the
required libraries being detected/cached, so something seemed wrong ...

turns out the libraries were being tagged as LIB_ELF_LIBC0 in the cache and
the loader currently only accepts LIB_ELF_LIBC{5,6} ... since readsoname.c in
ldconfig defines needed_tab with the mapping 'libc.so.0' -> LIB_ELF_LIBC0 it
seems like the loader should accept this type too

find attached a small patch which adds LIB_ELF_LIBC0 along side
LIB_ELF_LIBC{5,6} as an accepted lib type in the loader when dealing with the
ld.so.cache file

ldso/ldso/dl-elf.c

index cf1dae3..25c8240 100644 (file)
@@ -329,6 +329,7 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
 #endif
                for (i = 0; i < header->nlibs; i++) {
                        if ((libent[i].flags == LIB_ELF ||
+                                               libent[i].flags == LIB_ELF_LIBC0 ||
                                                libent[i].flags == LIB_ELF_LIBC5) &&
                                        _dl_strcmp(libname, strs + libent[i].sooffset) == 0 &&
                                        (tpnt1 = _dl_load_elf_shared_library(secure,