diff options
Diffstat (limited to 'elf')
-rw-r--r-- | elf/dl-load.c | 11 | ||||
-rw-r--r-- | elf/dl-object.c | 8 |
2 files changed, 7 insertions, 12 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c index 94531b271f..8a8936f7bd 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -163,7 +163,7 @@ static const size_t system_dirs_len[] = /* Local version of `strdup' function. */ -static inline char * +static char * local_strdup (const char *s) { size_t len = strlen (s) + 1; @@ -1470,15 +1470,6 @@ cannot enable executable stack as shared object requires"); { /* Create an appropriate searchlist. It contains only this map. This is the definition of DT_SYMBOLIC in SysVr4. */ - l->l_symbolic_searchlist.r_list = - (struct link_map **) malloc (sizeof (struct link_map *)); - - if (l->l_symbolic_searchlist.r_list == NULL) - { - errstring = N_("cannot create searchlist"); - goto call_lose_errno; - } - l->l_symbolic_searchlist.r_list[0] = l; l->l_symbolic_searchlist.r_nlist = 1; diff --git a/elf/dl-object.c b/elf/dl-object.c index 0e45aea39b..7780de6304 100644 --- a/elf/dl-object.c +++ b/elf/dl-object.c @@ -50,13 +50,17 @@ _dl_new_object (char *realname, const char *libname, int type, #endif new = (struct link_map *) calloc (sizeof (*new) + audit_space + + sizeof (struct r_scope_elem) + sizeof (*newname) + libname_len, 1); if (new == NULL) return NULL; new->l_real = new; - new->l_libname = newname = (struct libname_list *) ((char *) (new + 1) - + audit_space); + new->l_symbolic_searchlist.r_list = (struct link_map **) ((char *) (new + 1) + + audit_space); + + new->l_libname = newname + = (struct libname_list *) (new->l_symbolic_searchlist.r_list + 1); newname->name = (char *) memcpy (newname + 1, libname, libname_len); /* newname->next = NULL; We use calloc therefore not necessary. */ newname->dont_free = 1; |