summaryrefslogtreecommitdiff
path: root/elf/dl-version.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-04-15 22:26:34 +0000
committerUlrich Drepper <drepper@redhat.com>2000-04-15 22:26:34 +0000
commit145b84138f8b1fca851196451ab0f21a054ae754 (patch)
tree0e7f1c478ba1aa27bd7acd4fbbf7b99471e5c14a /elf/dl-version.c
parent29094e48802f69927d59b5edf5afc90ec222c8b9 (diff)
downloadglibc-145b84138f8b1fca851196451ab0f21a054ae754.tar.gz
Update.
* elf/dl-version.c (_dl_check_map_versions): New argument trace_mode. Before testing versions check that we actually loaded the object and whether we are in trace mode. If not loaded during tracing don't test versions in this object. (_dl_check_all_versions): Take new parameter and pass to _dl_check_map_versions. * sysdeps/generic/ldsodefs.h: Update prototypes for _dl_check_all_versions and _dl_check_map_versions. * elf/rtld.c (struct version_check_args): Add dotrace. (version_check_doit): Pass args->dotrace to _dl_check_all_versions. (dl_main): Pass info about trace mode to version_check_doit. * elf/dl-open.c (dl_open_worker): Pass zero as new argument to _dl_check_all_versions. * manual/users.texi (XPG Functions): Document utmpxname, getutmp, and getutmpx. Patch by Bryan Henderson <bryanh@giraffe-data.com>.
Diffstat (limited to 'elf/dl-version.c')
-rw-r--r--elf/dl-version.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/elf/dl-version.c b/elf/dl-version.c
index 59e8dd33c8..94eaed88b2 100644
--- a/elf/dl-version.c
+++ b/elf/dl-version.c
@@ -160,7 +160,7 @@ no version information available (required by ",
int
internal_function
-_dl_check_map_versions (struct link_map *map, int verbose)
+_dl_check_map_versions (struct link_map *map, int verbose, int trace_mode)
{
int result = 0;
const char *strtab;
@@ -209,29 +209,34 @@ _dl_check_map_versions (struct link_map *map, int verbose)
and no stub entry was created. This should never happen. */
assert (needed != NULL);
- /* NEEDED is the map for the file we need. Now look for the
- dependency symbols. */
- aux = (ElfW(Vernaux) *) ((char *) ent + ent->vn_aux);
- while (1)
+ /* Make sure this is no stub we created because of a missing
+ dependency. */
+ if (! trace_mode || needed->l_opencount != 0)
{
- /* Match the symbol. */
- result |= match_symbol ((*map->l_name
- ? map->l_name : _dl_argv[0]),
- aux->vna_hash,
- strtab + aux->vna_name,
- needed, verbose,
- aux->vna_flags & VER_FLG_WEAK);
-
- /* Compare the version index. */
- if ((unsigned int) (aux->vna_other & 0x7fff) > ndx_high)
- ndx_high = aux->vna_other & 0x7fff;
-
- if (aux->vna_next == 0)
- /* No more symbols. */
- break;
-
- /* Next symbol. */
- aux = (ElfW(Vernaux) *) ((char *) aux + aux->vna_next);
+ /* NEEDED is the map for the file we need. Now look for the
+ dependency symbols. */
+ aux = (ElfW(Vernaux) *) ((char *) ent + ent->vn_aux);
+ while (1)
+ {
+ /* Match the symbol. */
+ result |= match_symbol ((*map->l_name
+ ? map->l_name : _dl_argv[0]),
+ aux->vna_hash,
+ strtab + aux->vna_name,
+ needed, verbose,
+ aux->vna_flags & VER_FLG_WEAK);
+
+ /* Compare the version index. */
+ if ((unsigned int) (aux->vna_other & 0x7fff) > ndx_high)
+ ndx_high = aux->vna_other & 0x7fff;
+
+ if (aux->vna_next == 0)
+ /* No more symbols. */
+ break;
+
+ /* Next symbol. */
+ aux = (ElfW(Vernaux) *) ((char *) aux + aux->vna_next);
+ }
}
if (ent->vn_next == 0)
@@ -356,13 +361,14 @@ _dl_check_map_versions (struct link_map *map, int verbose)
int
internal_function
-_dl_check_all_versions (struct link_map *map, int verbose)
+_dl_check_all_versions (struct link_map *map, int verbose, int trace_mode)
{
struct link_map *l;
int result = 0;
for (l = map; l != NULL; l = l->l_next)
- result |= l->l_opencount != 0 && _dl_check_map_versions (l, verbose);
+ result |= (l->l_opencount != 0
+ && _dl_check_map_versions (l, verbose, trace_mode));
return result;
}