diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-04-03 22:25:08 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-04-03 22:25:08 +0000 |
commit | 839be78401e0e0b31bfec02a7cc6a9ec2f03ebd1 (patch) | |
tree | b23a7274776909a365f1aeed5f075ad2bb6a25b4 | |
parent | f9b798baee95f36e33075eb79f27d93ecc04ebf0 (diff) | |
download | glibc-839be78401e0e0b31bfec02a7cc6a9ec2f03ebd1.tar.gz glibc-839be78401e0e0b31bfec02a7cc6a9ec2f03ebd1.tar.xz glibc-839be78401e0e0b31bfec02a7cc6a9ec2f03ebd1.zip |
Update.
* elf/dl-load.c (_dl_dst_substitute): Pretty print comment. (add_name_to_object): Add cast in malloc call. (fillin_rpath): Optimize loop to initialize ->status a bit.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | elf/dl-load.c | 16 |
2 files changed, 11 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog index 7b0cff44f1..b84df57865 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2000-04-03 Ulrich Drepper <drepper@redhat.com> + * elf/dl-load.c (_dl_dst_substitute): Pretty print comment. + (add_name_to_object): Add cast in malloc call. + (fillin_rpath): Optimize loop to initialize ->status a bit. + * sysdeps/i386/dl-machine.h: Undo last change. * sysdeps/mach/hurd/i386/dl-machine.h (RTLD_START_SPECIAL_INIT): Restore %edx register after call here. diff --git a/elf/dl-load.c b/elf/dl-load.c index d337182aa7..0291bf2a74 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -203,8 +203,8 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result, const char *repl; size_t len; - /* Note that it is no bug that the strings in the first two `strncmp' - calls are longer than the sequence which is actually tested. */ + /* Note that it is no bug that the strings in the first two `strncmp' + calls are longer than the sequence which is actually tested. */ if ((((strncmp (&name[1], "ORIGIN}", 6) == 0 && (len = 7) != 0) || (strncmp (&name[1], "PLATFORM}", 8) == 0 && (len = 9) != 0)) && (name[len] == '\0' || name[len] == '/' @@ -311,7 +311,7 @@ add_name_to_object (struct link_map *l, const char *name) return; name_len = strlen (name) + 1; - newname = malloc (sizeof *newname + name_len); + newname = (struct libname_list *) malloc (sizeof *newname + name_len); if (newname == NULL) { /* No more memory. */ @@ -407,6 +407,7 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, else { size_t cnt; + enum r_dir_status init_val; /* It's a new directory. Create an entry and add it. */ dirp = (struct r_search_path_elem *) @@ -424,12 +425,9 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, /* We have to make sure all the relative directories are never ignored. The current directory might change and all our saved information would be void. */ - if (cp[0] != '/') - for (cnt = 0; cnt < ncapstr; ++cnt) - dirp->status[cnt] = existing; - else - for (cnt = 0; cnt < ncapstr; ++cnt) - dirp->status[cnt] = unknown; + init_val = cp[0] != '/' ? existing : unknown; + for (cnt = 0; cnt < ncapstr; ++cnt) + dirp->status[cnt] = init_val; dirp->what = what; dirp->where = where; |