aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-object.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-09-02 12:58:42 +0000
committerUlrich Drepper <drepper@redhat.com>1998-09-02 12:58:42 +0000
commit143e2b96c94c3fd5a2c618db0bad094ce659e743 (patch)
treeeea1289a952261584269f3ffeadf4137a1924706 /elf/dl-object.c
parent4ce636da6cf71061410da841e12b27b5f551e879 (diff)
downloadglibc-143e2b96c94c3fd5a2c618db0bad094ce659e743.zip
glibc-143e2b96c94c3fd5a2c618db0bad094ce659e743.tar.gz
glibc-143e2b96c94c3fd5a2c618db0bad094ce659e743.tar.bz2
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.
Diffstat (limited to 'elf/dl-object.c')
-rw-r--r--elf/dl-object.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/elf/dl-object.c b/elf/dl-object.c
index 97edd81..db6e81c 100644
--- a/elf/dl-object.c
+++ b/elf/dl-object.c
@@ -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;
}