diff options
36 files changed, 500 insertions, 530 deletions
@@ -1,3 +1,98 @@ +1998-09-14 11:26 Ulrich Drepper <drepper@cygnus.com> + + * wcsmbs/wcsmbs-tst1.c: Include stdlib.h. + +1998-09-14 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> + + * libc-work/nis/nss_nisplus/nisplus-service.c + (_nss_nisplus_parse_servent): Convert port in network byte order. + +1998-09-14 07:53 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu> + + * stdlib/stdlib.h: Add a switch, __need_malloc_and_calloc, + to provide only malloc and calloc. + * include/stdlib.h: Support the above. + * string/bits/string2.h: Use __need_malloc_and_calloc when + including stdlib.h. + (__string2_1bptr_p): Avoid -Wbad-function-cast warnings. + + * iconvdata/iso-2022-jp.c: Include <stdlib.h>. + * iconvdata/iso646.c: Include <stdlib.h>. + +1998-09-14 07:51 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu> + + * sunrpc/rpc_cout.c: Add braces around ambiguous else. + * sysdeps/libm-ieee754/w_pow.c: Likewise. + * sysdeps/libm-ieee754/w_powf.c: Likewise. + * sysdeps/libm-ieee754/w_powl.c: Likewise. + +1998-09-14 07:57 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu> + + * stdio-common/stdio_lim.h.in: New file. All parameters + are adjustable at build time. + * Rules: Add a rule to build bits/stdio_lim.h from + stdio-common/stdio_lim.h.in. (It has to be in Rules so that + all subdirectories know how to make the file. It can't be + in Makerules because then it gets built at top level and the + dependencies are wrong.) + + * stdio-common/Makefile (distribute): Add stdio_lim.h.in. + * sysdeps/unix/sysv/linux/Makefile: Delete rules to make + stdio_lim.h. + * sysdeps/unix/sysv/linux/stdio_lim.h.in: Removed. + * sysdeps/unix/sysv/linux/Dist: Take out stdio_lim.h.in. + * sysdeps/posix/Makefile: Removed. + * sysdeps/posix/mk-stdiolim.c: Removed. + * sysdeps/generic/bits/stdio_lim.h: Removed. + +1998-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * argp/argp-help.c: Fixup indentation. + * nss/nss_files/files-alias.c: Quiet -Wparentheses warning. + * resolv/nss_dns/dns-network.c: Likewise. + * resolv/res_send.c: Likewise. + * rt/aio_cancel.c: Likewise. + * rt/aio_misc.c: Likewise. + +1998-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * Makefile (install-symbolic-link): Remove the link list file at last. + * Makerules (install-clean-symbolic-link-list): Removed. + +1998-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * timezone/tst-timezone.c: Print time in UTC to get consistent + output. + +1998-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * elf/rtld.c (_dl_rpath): Removed. + * elf/dl-support.c (_dl_path): Removed. + * elf/Makefile ($(objpfx)ld.so): Don't pass -rpath. + (CFLAGS-dl-support.c): Removed. + + * elf/dl-load.c (env_path_list): Renamed from fake_path_list. All + uses changed. + (_dl_init_paths): Always set env_path_list from LD_LIBRARY_PATH, + instead of appending it to the main map's rpath info. + (_dl_map_object): Consistently use LD_LIBRARY_PATH after all + DT_RPATHs. This makes it effective again. + (decompose_rpath): Remove second parameter, callers changed. + (fillin_rpath): Allocate enough space in curwd. + (expand_dynamic_string_token): Cope with get_origin returning -1. + +1998-09-14 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> + + * libc-work/nis/nss_compat/compat-pwd.c: Add support for + passwd.adjunct. + + * nis/nss_nis/nis-pwd.c (_nss_nis_getpwent_r): Correct test for + invalid password. + +1998-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> + + * locale/programs/locale.c: Update dates. + 1998-09-13 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/generic/bits/types.h: Include <features.h>. Make sure @@ -101,6 +101,7 @@ install: install-symbolic-link .PHONY: install-symbolic-link install-symbolic-link: subdir_install $(symbolic-link-prog) $(symbolic-link-list) + rm -f $(symbolic-link-list) install: -test ! -x $(common-objpfx)elf/ldconfig || \ @@ -651,14 +651,8 @@ endif ifeq (no,$(cross-compiling)) ifeq (yes,$(build-shared)) -# We need to clean the symbolic link list first. symbolic-link-prog := $(common-objpfx)elf/sln symbolic-link-list := $(common-objpfx)elf/symlink.list -install: install-clean-symbolic-link-list -.PHONY: install-clean-symbolic-link-list -install-clean-symbolic-link-list: - rm -f $(symbolic-link-list) - define make-shlib-link echo $(<F) $@ >> $(symbolic-link-list) endef @@ -200,3 +200,47 @@ $(common-objpfx)dummy$o: $(common-objpfx)dummy.c $(before-compile); endef object-suffixes-left := $(object-suffixes) include $(o-iterator) + +# There's no good place to put this - here will do. +# The dependencies are wrong if it's run from the top level. +ifeq ($(filter %posix, $(sysdirs)),) +L_tmpnam = 1 +TMP_MAX = 0 +L_ctermid = 1 +L_cuserid = 1 +else +L_tmpnam = 19 +TMP_MAX = 238328 +L_ctermid = 9 +L_cuserid = 9 +endif + +$(common-objpfx)bits/stdio_%.h $(common-objpfx)bits/stdio_%.d: \ + $(..)stdio-common/stdio_%.h.in + $(make-target-directory) + echo '#include "$(..)posix/bits/posix1_lim.h"' | \ + SUNPRO_DEPENDENCIES='$(@:.h=.d)T MARKER' \ + $(CC) $(+includes) -E -dM -xc - -o $(@:.d=.h)T + sed -e 's!MARKER!$(@:.h=.d) $(@:.d=.h)!' \ + -e 's!$(common-objpfx)!$$(common-objpfx)!g' \ + $(@:.h=.d)T > $(@:.h=.d)t && \ + mv -f $(@:.h=.d)t $(@:.h=.d) + fopen_max=`sed -n 's/^#define OPEN_MAX //p' $(@:.d=.h)T`; \ + filename_max=`sed -n 's/^#define PATH_MAX //p' $(@:.d=.h)T`; \ + fopen_max=$${fopen_max:-16}; \ + filename_max=$${filename_max:-1024}; \ + sed -e "s/@FOPEN_MAX@/$$fopen_max/" \ + -e "s/@FILENAME_MAX@/$$filename_max/" \ + -e "s/@L_tmpnam@/$(L_tmpnam)/" \ + -e "s/@TMP_MAX@/$(TMP_MAX)/" \ + -e "s/@L_ctermid@/$(L_ctermid)/" \ + -e "s/@L_cuserid@/$(L_cuserid)/" \ + $< > $(@:.d=.h).new && \ + mv -f $(@:.d=.h).new $(@:.d=.h); \ +# Remove these last so that they can be examined if something went wrong. + rm -f $(@:.d=.h)T $(@:.h=.d)T +# Get dependencies. +ifndef no_deps +-include $(common-objpfx)bits/stdio_lim.d +endif +common-generated += bits/stdio_lim.h bits/stdio_lim.d diff --git a/argp/argp-help.c b/argp/argp-help.c index 9a1c05387f..a3a1a12ef9 100644 --- a/argp/argp-help.c +++ b/argp/argp-help.c @@ -833,11 +833,12 @@ hol_append (struct hol *hol, struct hol *more) __mempcpy (short_options, hol->short_options, hol_so_len); - /* Fix up the short options pointers from HOL. */ + /* Fix up the short options pointers from HOL. */ for (e = entries, left = hol->num_entries; left > 0; e++, left--) e->short_options += (short_options - hol->short_options); - /* Now add the short options from MORE, fixing up its entries too. */ + /* Now add the short options from MORE, fixing up its entries + too. */ so = short_options + hol_so_len; more_so = more->short_options; for (left = more->num_entries; left > 0; e++, left--) @@ -872,7 +873,7 @@ hol_append (struct hol *hol, struct hol *more) hol->num_entries = num_entries; hol->short_options = short_options; } - } + } hol_free (more); } diff --git a/elf/Makefile b/elf/Makefile index 7f2201dc0a..ddd9d222fb 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -116,13 +116,9 @@ endif $(objpfx)ld.so: $(objpfx)librtld.os $(addprefix $(objpfx),$(rtld-ldscript)) \ $(ld-map) - $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \ - -Wl,-rpath=$(default-rpath) $(LDFLAGS-rtld) \ - $(filter-out $(rtld-ldscript) $(map-file),$^) \ - $(load-map-file) -Wl,-soname=$(rtld-installed-name) - -# The dl code in the static libc needs a default library path. -CFLAGS-dl-support.c = -D'DEFAULT_RPATH="$(default-rpath)"' + $(LINK.o) -nostdlib -nostartfiles -shared -o $@ $(LDFLAGS-rtld) \ + $(filter-out $(rtld-ldscript) $(map-file),$^) \ + $(load-map-file) -Wl,-soname=$(rtld-installed-name) # interp.c exists just to get this string into the libraries. CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' diff --git a/elf/dl-load.c b/elf/dl-load.c index b93258e9eb..cb0a4ff753 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -99,9 +99,8 @@ size_t _dl_pagesize; extern const char *_dl_platform; extern size_t _dl_platformlen; -/* This is a fake list to store the RPATH information for static - binaries. */ -static struct r_search_path_elem **fake_path_list; +/* This is the decomposed LD_LIBRARY_PATH search path. */ +static struct r_search_path_elem **env_path_list; /* List of the hardware capabilities we might end up using. */ static const struct r_strlenpair *capstr; @@ -175,7 +174,8 @@ expand_dynamic_string_token (struct link_map *l, const char *s) { assert (l->l_name[0] == '\0'); l->l_origin = get_origin (); - origin_len = l->l_origin ? strlen (l->l_origin) : 0; + origin_len = (l->l_origin && l->l_origin != (char *) -1 + ? strlen (l->l_origin) : 0); } else origin_len = l->l_origin == (char *) -1 ? 0 : strlen (l->l_origin); @@ -293,8 +293,8 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, interpreted as `use the current directory'. */ if (len == 0) { - static char curwd[2]; - cp = strcpy (curwd, "."); + static char curwd[] = "./"; + cp = curwd; } /* Remove trailing slashes (except for "/"). */ @@ -388,7 +388,7 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, static struct r_search_path_elem ** internal_function -decompose_rpath (const char *rpath, size_t additional_room, struct link_map *l) +decompose_rpath (const char *rpath, struct link_map *l) { /* Make a copy we can work with. */ const char *where = l->l_name; @@ -410,7 +410,7 @@ decompose_rpath (const char *rpath, size_t additional_room, struct link_map *l) /* This object is on the list of objects for which the RPATH must not be used. */ result = (struct r_search_path_elem **) - malloc ((additional_room + 1) * sizeof (*result)); + malloc (sizeof (*result)); if (result == NULL) _dl_signal_error (ENOMEM, NULL, "cannot create cache for search path"); @@ -433,10 +433,9 @@ decompose_rpath (const char *rpath, size_t additional_room, struct link_map *l) if (*cp == ':') ++nelems; - /* Allocate room for the result. NELEMS + 1 + ADDITIONAL_ROOM is an upper - limit for the number of necessary entries. */ - result = (struct r_search_path_elem **) malloc ((nelems + 1 - + additional_room + 1) + /* Allocate room for the result. NELEMS + 1 is an upper limit for the + number of necessary entries. */ + result = (struct r_search_path_elem **) malloc ((nelems + 1 + 1) * sizeof (*result)); if (result == NULL) _dl_signal_error (ENOMEM, NULL, "cannot create cache for search path"); @@ -458,32 +457,9 @@ _dl_init_paths (const char *llp) struct r_search_path_elem *pelem, **aelem; size_t round_size; -#ifdef PIC - /* We have in `search_path' the information about the RPATH of the - dynamic loader. Now fill in the information about the applications - RPATH and the directories addressed by the LD_LIBRARY_PATH environment - variable. */ + /* Fill in the information about the application's RPATH and the + directories addressed by the LD_LIBRARY_PATH environment variable. */ struct link_map *l; -#endif - - /* Number of elements in the library path. */ - size_t nllp; - - /* First determine how many elements the LD_LIBRARY_PATH contents has. */ - if (llp != NULL && *llp != '\0') - { - /* Simply count the number of colons. */ - const char *cp = llp; - nllp = 1; - while (*cp) - { - if (*cp == ':' || *cp == ';') - ++nllp; - ++cp; - } - } - else - nllp = 0; /* Get the capabilities. */ capstr = _dl_important_hwcaps (_dl_platform, _dl_platformlen, @@ -533,81 +509,44 @@ _dl_init_paths (const char *llp) l = _dl_loaded; if (l != NULL) { - /* We should never get here when initializing in a static application. - If this is a dynamically linked application _dl_loaded always - points to the main map which is not dlopen()ed. */ assert (l->l_type != lt_loaded); if (l->l_info[DT_RPATH]) - { - /* Allocate room for the search path and fill in information - from RPATH. */ - l->l_rpath_dirs = - decompose_rpath ((const char *) - (l->l_addr + l->l_info[DT_STRTAB]->d_un.d_ptr - + l->l_info[DT_RPATH]->d_un.d_val), - nllp, l); - } + /* Allocate room for the search path and fill in information + from RPATH. */ + l->l_rpath_dirs = + decompose_rpath ((const char *) + (l->l_addr + l->l_info[DT_STRTAB]->d_un.d_ptr + + l->l_info[DT_RPATH]->d_un.d_val), l); else - { - /* If we have no LD_LIBRARY_PATH and no RPATH we must tell - this somehow to prevent we look this up again and again. */ - if (nllp == 0) - l->l_rpath_dirs = (struct r_search_path_elem **) -1l; - else - { - l->l_rpath_dirs = (struct r_search_path_elem **) - malloc ((nllp + 1) * sizeof (*l->l_rpath_dirs)); - if (l->l_rpath_dirs == NULL) - _dl_signal_error (ENOMEM, NULL, - "cannot create cache for search path"); - l->l_rpath_dirs[0] = NULL; - } - } - - /* We don't need to search the list of fake entries which is searched - when no dynamic objects were loaded at this time. */ - fake_path_list = NULL; - - if (nllp > 0) - { - char *copy = local_strdup (llp); - - /* Decompose the LD_LIBRARY_PATH and fill in the result. - First search for the next place to enter elements. */ - struct r_search_path_elem **result = l->l_rpath_dirs; - while (*result != NULL) - ++result; - - /* We need to take care that the LD_LIBRARY_PATH environment - variable can contain a semicolon. */ - (void) fillin_rpath (copy, result, ":;", - __libc_enable_secure ? system_dirs : NULL, - "LD_LIBRARY_PATH", NULL); - } + l->l_rpath_dirs = NULL; } - else #endif /* PIC */ + + if (llp != NULL && *llp != '\0') { - /* This is a statically linked program but we still have to take - care for the LD_LIBRARY_PATH environment variable. We use a fake - link_map entry. This will only contain the l_rpath_dirs - information. */ + size_t nllp; + const char *cp = llp; - if (nllp == 0) - fake_path_list = NULL; - else + /* Decompose the LD_LIBRARY_PATH contents. First determine how many + elements it has. */ + nllp = 1; + while (*cp) { - fake_path_list = (struct r_search_path_elem **) - malloc ((nllp + 1) * sizeof (struct r_search_path_elem *)); - if (fake_path_list == NULL) - _dl_signal_error (ENOMEM, NULL, - "cannot create cache for search path"); - - (void) fillin_rpath (local_strdup (llp), fake_path_list, ":;", - __libc_enable_secure ? system_dirs |
