diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-10-25 01:59:59 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-10-25 01:59:59 +0000 |
commit | 158944e642bf92f783f0fe84df0d86466959ac6e (patch) | |
tree | 6a864d65036fdbe12322441eeae62ce6c49ca4a8 /sysdeps/generic | |
parent | 3efbc515400fafada196b6b171776057f1121a18 (diff) |
(_dl_load_cache_lookup): Favour exact matching of version function
if both the general (1) and glibc-specific (3) entry are present.
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/dl-cache.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sysdeps/generic/dl-cache.c b/sysdeps/generic/dl-cache.c index b3c46ff6b2..53980a7a5e 100644 --- a/sysdeps/generic/dl-cache.c +++ b/sysdeps/generic/dl-cache.c @@ -53,10 +53,7 @@ _dl_load_cache_lookup (const char *name) static struct cache_file *cache; static size_t cachesize; unsigned int i; - - if (cache == (void *) -1) - /* Previously looked for the cache file and didn't find it. */ - return NULL; + const char *best; if (cache == NULL) { @@ -76,6 +73,11 @@ _dl_load_cache_lookup (const char *name) } } + if (cache == (void *) -1) + /* Previously looked for the cache file and didn't find it. */ + return NULL; + + best = NULL; for (i = 0; i < cache->nlibs; ++i) if ((cache->libs[i].flags == 1 || cache->libs[i].flags == 3) && /* ELF library entry. */ @@ -85,7 +87,14 @@ _dl_load_cache_lookup (const char *name) /* Does the name match? */ ! strcmp (name, ((const char *) &cache->libs[cache->nlibs] + cache->libs[i].key))) - return (const char *) &cache->libs[cache->nlibs] + cache->libs[i].value; + { + best = ((const char *) &cache->libs[cache->nlibs] + + cache->libs[i].value); - return NULL; + if (cache->libs[i].flags == 3) + /* We've found an exact match for the shared object and no + general `ELF' release. Stop searching. */ + break; + } + return best; } |