aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-version.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-version.c')
-rw-r--r--elf/dl-version.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/elf/dl-version.c b/elf/dl-version.c
index 8966d61..2fbf494 100644
--- a/elf/dl-version.c
+++ b/elf/dl-version.c
@@ -1,5 +1,5 @@
/* Handle symbol and library versioning.
- Copyright (C) 1997-2024 Free Software Foundation, Inc.
+ Copyright (C) 1997-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -357,6 +357,13 @@ _dl_check_map_versions (struct link_map *map, int verbose, int trace_mode)
ent = (ElfW(Verdef) *) ((char *) ent + ent->vd_next);
}
}
+
+ /* The empty string has ELF hash zero. This avoids a NULL check
+ before the version string comparison in check_match in
+ dl-lookup.c. */
+ for (unsigned int i = 0; i < map->l_nversions; ++i)
+ if (map->l_versions[i].name == NULL)
+ map->l_versions[i].name = "";
}
/* When there is a DT_VERNEED entry with libc.so on DT_NEEDED, issue