1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00
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:
Ulrich Drepper
1998-09-02 12:58:42 +00:00
parent 4ce636da6c
commit 143e2b96c9
7 changed files with 53 additions and 23 deletions

View File

@ -37,13 +37,15 @@ get_origin (void)
result = (char *) malloc (last_slash - linkval + 1);
if (result == NULL)
result = (char *) -1;
else if (last_slash == linkval)
memcpy (result, "/", 2);
else
*((char *) __mempcpy (result, linkval, last_slash - linkval)) = '\0';
}
else
{
result = (char *) -1;
/* We use te environment variable LD_ORIGIN_PATH. If it is set make
/* We use the environment variable LD_ORIGIN_PATH. If it is set make
a copy and strip out trailing slashes. */
if (_dl_origin_path != NULL)
{
@ -54,7 +56,7 @@ get_origin (void)
else
{
char *cp = __mempcpy (result, _dl_origin_path, len);
while (cp > result && cp[-1] == '/')
while (cp > result + 1 && cp[-1] == '/')
--cp;
*cp = '\0';
}