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.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/elf/dl-version.c b/elf/dl-version.c
index 0675b1c..b5515c8 100644
--- a/elf/dl-version.c
+++ b/elf/dl-version.c
@@ -155,16 +155,23 @@ int
_dl_check_map_versions (struct link_map *map, int verbose)
{
int result = 0;
- const char *strtab = (const char *) (map->l_addr
- + map->l_info[DT_STRTAB]->d_un.d_ptr);
+ const char *strtab;
/* Pointer to section with needed versions. */
- ElfW(Dyn) *dyn = map->l_info[VERSTAG (DT_VERNEED)];
+ ElfW(Dyn) *dyn;
/* Pointer to dynamic section with definitions. */
- ElfW(Dyn) *def = map->l_info[VERSTAG (DT_VERDEF)];
+ ElfW(Dyn) *def;
/* We need to find out which is the highest version index used
in a dependecy. */
unsigned int ndx_high = 0;
+ /* If we don't have a string table, we must be ok. */
+ if (map->l_info[DT_STRTAB] == NULL)
+ return 0;
+ strtab = (const char *) (map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
+
+ dyn = map->l_info[VERSTAG (DT_VERNEED)];
+ def = map->l_info[VERSTAG (DT_VERDEF)];
+
if (dyn != NULL)
{
/* This file requires special versions from its dependencies. */