diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | elf/Makefile | 13 | ||||
-rw-r--r-- | locale/C_name.c | 7 | ||||
-rw-r--r-- | locale/Makefile | 2 | ||||
-rw-r--r-- | locale/setlocale.c | 9 | ||||
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 33 |
6 files changed, 53 insertions, 26 deletions
@@ -1,5 +1,20 @@ Sat May 4 05:44:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + * locale/setlocale.c (_nl_C_name): Variable removed. + * locale/C_name.c: New file. + (_nl_C_name): Put it here instead. + * locale/Makefile (aux): Add C_name. + + * sysdeps/mach/hurd/dl-sysdep.c (open): Don't pass io port in + auth_user_authenticate rpc. + (open): Avoid using strtol in digit conversion for "fd/N" magic. + (_dl_sysdep_start): Likewise for memobj name in magic switches. + + * elf/Makefile (reloc-link): New variable. + (dl-allobjs.so): New target, link together $(rtld-routines). + (librtld.so): Depend on that instead of the rtld components. + (generated): Add dl-allobjs.so. + * hurd/hurd-raise.c (_hurd_raise_signal): Pass sigcode in msg_sig_post rpc. diff --git a/elf/Makefile b/elf/Makefile index dfb307b..c973a0f 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -39,7 +39,7 @@ include ../Makeconfig ifeq (yes,$(build-shared)) extra-objs = $(rtld-routines:=.so) soinit.so sofini.so -generated = librtld.so +generated = librtld.so dl-allobjs.so install-others = $(slibdir)/$(rtld-installed-name) install-bin = ldd @@ -52,14 +52,19 @@ endif include ../Rules +# Command to link into a larger single relocatable object. +reloc-link = $(LINK.o) -nostdlib -nostartfiles -r -o $@ + +$(objpfx)dl-allobjs.so: $(rtld-routines:%=$(objpfx)%.so) + $(reloc-link) $^ + # Link together the dynamic linker into a single relocatable object. # We use this to produce both the ABI-compliant and Linux-compatible # dynamic linker shared objects below. -$(objpfx)librtld.so: $(rtld-routines:%=$(objpfx)%.so) \ +$(objpfx)librtld.so: $(objpfx)dl-allobjs.so \ $(patsubst %,$(common-objpfx)lib%_pic.a,\ elf c $(LDLIBS-c.so:-l%=%)) - $(LINK.o) -nostdlib -nostartfiles -r -o $@ \ - '-Wl,-(' $^ -lgcc '-Wl,-)' + $(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)' $(objpfx)ld.so: $(objpfx)librtld.so $(rtld-link) -Wl,-soname=$(rtld-installed-name) diff --git a/locale/C_name.c b/locale/C_name.c new file mode 100644 index 0000000..5e7cb85 --- /dev/null +++ b/locale/C_name.c @@ -0,0 +1,7 @@ +/* Define a constant for the name of the standard C locale, so the string + constant is not repeated in dozens of object files. */ + +#include "localeinfo.h" + +/* Name of our standard locale. */ +const char _nl_C_name[] = "C"; diff --git a/locale/Makefile b/locale/Makefile index 6b208b7..d7941d6 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -30,7 +30,7 @@ distribute = localeinfo.h categories.def \ locales.h locfile.h stringtrans.h routines = setlocale findlocale loadlocale localeconv nl_langinfo categories = ctype messages monetary numeric time collate -aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc +aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name others = localedef locale install-bin = localedef locale extra-objs = $(localedef-modules:=.o) $(locale-modules:=.o) \ diff --git a/locale/setlocale.c b/locale/setlocale.c index c0d6fcd..6eb6d98 100644 --- a/locale/setlocale.c +++ b/locale/setlocale.c @@ -102,9 +102,6 @@ void (*const _nl_category_postload[]) (void) = }; -/* Name of our standard locale. */ -const char _nl_C_name[] = "C"; - /* Name of current locale for each individual category. Each is malloc'd unless it is nl_C_name. */ static const char *_nl_current_names[] = @@ -261,7 +258,7 @@ setlocale (int category, const char *locale) if (__argz_append (&locale_path, &locale_path_len, LOCALE_PATH, sizeof (LOCALE_PATH)) != 0) return NULL; - + if (category == LC_ALL) { /* The user wants to set all categories. The desired locales @@ -274,7 +271,7 @@ setlocale (int category, const char *locale) /* Set all name pointers to the argument name. */ for (category = 0; category < LC_ALL; ++category) newnames[category] = (char *) locale; - + if (strchr (locale, ';') != NULL) { /* This is a composite name. Make a copy and split it up. */ @@ -329,7 +326,7 @@ setlocale (int category, const char *locale) int save_errno; abort_composite: save_errno = errno; - + while (++category < LC_ALL) if (_nl_current[category] != NULL) _nl_free_locale (newdata[category]); diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 21f94f8..c580bb3 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -33,6 +33,7 @@ Cambridge, MA 02139, USA. */ #include <hurd/auth.h> #include <hurd/term.h> #include <stdarg.h> +#include <ctype.h> #include "dl-machine.h" @@ -139,7 +140,9 @@ unfmh(); /* XXX */ if (! memobjname) _dl_sysdep_fatal ("Bogus library spec: ", p, "\n", NULL); *memobjname++ = '\0'; - memobj = (mach_port_t) atoi (memobjname); + memobj = 0; + while (*memobjname != '\0') + memobj = (memobj * 10) + (*memobjname++ - '0'); /* Add a user reference on the memory object port, so we will still have one after _dl_map_object_from_fd calls our @@ -307,7 +310,6 @@ open (const char *file_name, int mode, ...) if (! err) err = __auth_user_authenticate (_dl_hurd_data->portarray[INIT_PORT_AUTH], - fileport, ref, MACH_MSG_TYPE_MAKE_SEND, &newpt); __mach_port_destroy (__mach_task_self (), ref); @@ -361,17 +363,19 @@ open (const char *file_name, int mode, ...) break; case 'f': - if (retryname[1] == 'd' && retryname[2] == '/') + if (retryname[1] == 'd' && retryname[2] == '/' && + isdigit (retryname[3])) { - int fd; - char *end; - err = 0; - fd = (int) strtol (retryname, &end, 10); - if (end == NULL || err || /* Malformed number. */ - /* Check for excess text after the number. A slash - is valid; it ends the component. Anything else - does not name a numeric file descriptor. */ - (*end != '/' && *end != '\0')) + /* We can't use strtol for the decoding here + because it brings in hairy locale bloat. */ + char *p; + int fd = 0; + for (p = &retryname[3]; isdigit (*p); ++p) + fd = (fd * 10) + (*p - '0'); + /* Check for excess text after the number. A slash is + valid; it ends the component. Anything else does not + name a numeric file descriptor. */ + if (*p != '/' && *p != '\0') return __hurd_fail (ENOENT); if (fd < 0 || fd >= _dl_hurd_data->dtablesize || _dl_hurd_data->dtable[fd] == MACH_PORT_NULL) @@ -380,7 +384,7 @@ open (const char *file_name, int mode, ...) of ENOENT. */ return __hurd_fail (EBADF); fileport = _dl_hurd_data->dtable[fd]; - if (*end == '\0') + if (*p == '\0') { /* This descriptor is the file port we want. */ dealloc_dir = 0; @@ -391,7 +395,7 @@ open (const char *file_name, int mode, ...) /* Do a normal retry on the remaining components. */ startdir = fileport; dealloc_dir = 1; - file_name = end + 1; /* Skip the slash. */ + file_name = p + 1; /* Skip the slash. */ break; } } @@ -448,7 +452,6 @@ open (const char *file_name, int mode, ...) if (! err) err = __auth_user_authenticate (_dl_hurd_data->portarray[INIT_PORT_AUTH], - unauth, ref, MACH_MSG_TYPE_MAKE_SEND, result); __mach_port_deallocate (__mach_task_self (), |