mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Update.
1998-09-02 Ulrich Drepper <drepper@cygnus.com> * elf/dl-load.c (fillin_rpath): Handle "/" as RPATH correctly. (_dl_map_object_from_fd): Make NAME argument const. Remove last parameter in _dl_new_object call. (print_search_path): Correct construction of composed path name. (_dl_map_object): Prevent looking at RPATH of the main map twice. Remove last parameter in _dl_new_object call. * elf/dl-object.c: Remove last parameter. Determine whether create origin entry based on empty realname. Handle file in root directory correctly. * elf/ldsodefs.h: Adjust prototype for _dl_new_object. * elf/rtld.c (dl_main): Add comment describing reason for memory leak. Remove last parameter in _dl_new_object call. * sysdeps/generic/dl-origin.h: Handle file in root directory correctly. * sysdeps/unix/sysv/linux/dl-origin.h: Likewise.
This commit is contained in:
@ -33,7 +33,7 @@ struct link_map *_dl_default_scope[5];
|
||||
|
||||
struct link_map *
|
||||
internal_function
|
||||
_dl_new_object (char *realname, const char *libname, int type, int find_origin)
|
||||
_dl_new_object (char *realname, const char *libname, int type)
|
||||
{
|
||||
size_t libname_len = strlen (libname) + 1;
|
||||
struct link_map *new = calloc (sizeof *new, 1);
|
||||
@ -63,7 +63,7 @@ _dl_new_object (char *realname, const char *libname, int type, int find_origin)
|
||||
}
|
||||
|
||||
/* Don't try to find the origin for the main map. */
|
||||
if (! find_origin)
|
||||
if (realname[0] == '\0')
|
||||
new->l_origin = NULL;
|
||||
else
|
||||
{
|
||||
@ -117,9 +117,16 @@ _dl_new_object (char *realname, const char *libname, int type, int find_origin)
|
||||
}
|
||||
|
||||
if (origin != (char *) -1)
|
||||
/* Now remove the filename and the slash. Do this even if the
|
||||
string is something like "/foo" which leaves an empty string. */
|
||||
*strrchr (origin, '/') = '\0';
|
||||
{
|
||||
/* Now remove the filename and the slash. Do this even if the
|
||||
string is something like "/foo" which leaves an empty string. */
|
||||
char *last = strrchr (origin, '/');
|
||||
|
||||
if (last == origin)
|
||||
origin[1] = '\0';
|
||||
else
|
||||
*last = '\0';
|
||||
}
|
||||
|
||||
new->l_origin = origin;
|
||||
}
|
||||
|
Reference in New Issue
Block a user