mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
* 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.
This commit is contained in:
15
ChangeLog
15
ChangeLog
@ -1,5 +1,20 @@
|
|||||||
Sat May 4 05:44:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
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
|
* hurd/hurd-raise.c (_hurd_raise_signal): Pass sigcode in msg_sig_post
|
||||||
rpc.
|
rpc.
|
||||||
|
|
||||||
|
13
elf/Makefile
13
elf/Makefile
@ -39,7 +39,7 @@ include ../Makeconfig
|
|||||||
|
|
||||||
ifeq (yes,$(build-shared))
|
ifeq (yes,$(build-shared))
|
||||||
extra-objs = $(rtld-routines:=.so) soinit.so sofini.so
|
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-others = $(slibdir)/$(rtld-installed-name)
|
||||||
install-bin = ldd
|
install-bin = ldd
|
||||||
|
|
||||||
@ -52,14 +52,19 @@ endif
|
|||||||
include ../Rules
|
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.
|
# Link together the dynamic linker into a single relocatable object.
|
||||||
# We use this to produce both the ABI-compliant and Linux-compatible
|
# We use this to produce both the ABI-compliant and Linux-compatible
|
||||||
# dynamic linker shared objects below.
|
# 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,\
|
$(patsubst %,$(common-objpfx)lib%_pic.a,\
|
||||||
elf c $(LDLIBS-c.so:-l%=%))
|
elf c $(LDLIBS-c.so:-l%=%))
|
||||||
$(LINK.o) -nostdlib -nostartfiles -r -o $@ \
|
$(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)'
|
||||||
'-Wl,-(' $^ -lgcc '-Wl,-)'
|
|
||||||
|
|
||||||
$(objpfx)ld.so: $(objpfx)librtld.so
|
$(objpfx)ld.so: $(objpfx)librtld.so
|
||||||
$(rtld-link) -Wl,-soname=$(rtld-installed-name)
|
$(rtld-link) -Wl,-soname=$(rtld-installed-name)
|
||||||
|
7
locale/C_name.c
Normal file
7
locale/C_name.c
Normal file
@ -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";
|
@ -30,7 +30,7 @@ distribute = localeinfo.h categories.def \
|
|||||||
locales.h locfile.h stringtrans.h
|
locales.h locfile.h stringtrans.h
|
||||||
routines = setlocale findlocale loadlocale localeconv nl_langinfo
|
routines = setlocale findlocale loadlocale localeconv nl_langinfo
|
||||||
categories = ctype messages monetary numeric time collate
|
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
|
others = localedef locale
|
||||||
install-bin = localedef locale
|
install-bin = localedef locale
|
||||||
extra-objs = $(localedef-modules:=.o) $(locale-modules:=.o) \
|
extra-objs = $(localedef-modules:=.o) $(locale-modules:=.o) \
|
||||||
|
@ -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.
|
/* Name of current locale for each individual category.
|
||||||
Each is malloc'd unless it is nl_C_name. */
|
Each is malloc'd unless it is nl_C_name. */
|
||||||
static const char *_nl_current_names[] =
|
static const char *_nl_current_names[] =
|
||||||
@ -261,7 +258,7 @@ setlocale (int category, const char *locale)
|
|||||||
if (__argz_append (&locale_path, &locale_path_len,
|
if (__argz_append (&locale_path, &locale_path_len,
|
||||||
LOCALE_PATH, sizeof (LOCALE_PATH)) != 0)
|
LOCALE_PATH, sizeof (LOCALE_PATH)) != 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (category == LC_ALL)
|
if (category == LC_ALL)
|
||||||
{
|
{
|
||||||
/* The user wants to set all categories. The desired locales
|
/* 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. */
|
/* Set all name pointers to the argument name. */
|
||||||
for (category = 0; category < LC_ALL; ++category)
|
for (category = 0; category < LC_ALL; ++category)
|
||||||
newnames[category] = (char *) locale;
|
newnames[category] = (char *) locale;
|
||||||
|
|
||||||
if (strchr (locale, ';') != NULL)
|
if (strchr (locale, ';') != NULL)
|
||||||
{
|
{
|
||||||
/* This is a composite name. Make a copy and split it up. */
|
/* 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;
|
int save_errno;
|
||||||
abort_composite:
|
abort_composite:
|
||||||
save_errno = errno;
|
save_errno = errno;
|
||||||
|
|
||||||
while (++category < LC_ALL)
|
while (++category < LC_ALL)
|
||||||
if (_nl_current[category] != NULL)
|
if (_nl_current[category] != NULL)
|
||||||
_nl_free_locale (newdata[category]);
|
_nl_free_locale (newdata[category]);
|
||||||
|
@ -33,6 +33,7 @@ Cambridge, MA 02139, USA. */
|
|||||||
#include <hurd/auth.h>
|
#include <hurd/auth.h>
|
||||||
#include <hurd/term.h>
|
#include <hurd/term.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "dl-machine.h"
|
#include "dl-machine.h"
|
||||||
|
|
||||||
@ -139,7 +140,9 @@ unfmh(); /* XXX */
|
|||||||
if (! memobjname)
|
if (! memobjname)
|
||||||
_dl_sysdep_fatal ("Bogus library spec: ", p, "\n", NULL);
|
_dl_sysdep_fatal ("Bogus library spec: ", p, "\n", NULL);
|
||||||
*memobjname++ = '\0';
|
*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
|
/* Add a user reference on the memory object port, so we will
|
||||||
still have one after _dl_map_object_from_fd calls our
|
still have one after _dl_map_object_from_fd calls our
|
||||||
@ -307,7 +310,6 @@ open (const char *file_name, int mode, ...)
|
|||||||
if (! err)
|
if (! err)
|
||||||
err = __auth_user_authenticate
|
err = __auth_user_authenticate
|
||||||
(_dl_hurd_data->portarray[INIT_PORT_AUTH],
|
(_dl_hurd_data->portarray[INIT_PORT_AUTH],
|
||||||
fileport,
|
|
||||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||||
&newpt);
|
&newpt);
|
||||||
__mach_port_destroy (__mach_task_self (), ref);
|
__mach_port_destroy (__mach_task_self (), ref);
|
||||||
@ -361,17 +363,19 @@ open (const char *file_name, int mode, ...)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
if (retryname[1] == 'd' && retryname[2] == '/')
|
if (retryname[1] == 'd' && retryname[2] == '/' &&
|
||||||
|
isdigit (retryname[3]))
|
||||||
{
|
{
|
||||||
int fd;
|
/* We can't use strtol for the decoding here
|
||||||
char *end;
|
because it brings in hairy locale bloat. */
|
||||||
err = 0;
|
char *p;
|
||||||
fd = (int) strtol (retryname, &end, 10);
|
int fd = 0;
|
||||||
if (end == NULL || err || /* Malformed number. */
|
for (p = &retryname[3]; isdigit (*p); ++p)
|
||||||
/* Check for excess text after the number. A slash
|
fd = (fd * 10) + (*p - '0');
|
||||||
is valid; it ends the component. Anything else
|
/* Check for excess text after the number. A slash is
|
||||||
does not name a numeric file descriptor. */
|
valid; it ends the component. Anything else does not
|
||||||
(*end != '/' && *end != '\0'))
|
name a numeric file descriptor. */
|
||||||
|
if (*p != '/' && *p != '\0')
|
||||||
return __hurd_fail (ENOENT);
|
return __hurd_fail (ENOENT);
|
||||||
if (fd < 0 || fd >= _dl_hurd_data->dtablesize ||
|
if (fd < 0 || fd >= _dl_hurd_data->dtablesize ||
|
||||||
_dl_hurd_data->dtable[fd] == MACH_PORT_NULL)
|
_dl_hurd_data->dtable[fd] == MACH_PORT_NULL)
|
||||||
@ -380,7 +384,7 @@ open (const char *file_name, int mode, ...)
|
|||||||
of ENOENT. */
|
of ENOENT. */
|
||||||
return __hurd_fail (EBADF);
|
return __hurd_fail (EBADF);
|
||||||
fileport = _dl_hurd_data->dtable[fd];
|
fileport = _dl_hurd_data->dtable[fd];
|
||||||
if (*end == '\0')
|
if (*p == '\0')
|
||||||
{
|
{
|
||||||
/* This descriptor is the file port we want. */
|
/* This descriptor is the file port we want. */
|
||||||
dealloc_dir = 0;
|
dealloc_dir = 0;
|
||||||
@ -391,7 +395,7 @@ open (const char *file_name, int mode, ...)
|
|||||||
/* Do a normal retry on the remaining components. */
|
/* Do a normal retry on the remaining components. */
|
||||||
startdir = fileport;
|
startdir = fileport;
|
||||||
dealloc_dir = 1;
|
dealloc_dir = 1;
|
||||||
file_name = end + 1; /* Skip the slash. */
|
file_name = p + 1; /* Skip the slash. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -448,7 +452,6 @@ open (const char *file_name, int mode, ...)
|
|||||||
if (! err)
|
if (! err)
|
||||||
err = __auth_user_authenticate
|
err = __auth_user_authenticate
|
||||||
(_dl_hurd_data->portarray[INIT_PORT_AUTH],
|
(_dl_hurd_data->portarray[INIT_PORT_AUTH],
|
||||||
unauth,
|
|
||||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||||
result);
|
result);
|
||||||
__mach_port_deallocate (__mach_task_self (),
|
__mach_port_deallocate (__mach_task_self (),
|
||||||
|
Reference in New Issue
Block a user