diff -durpN glibc-2.2.5/abi-tags glibc-2.3/abi-tags --- glibc-2.2.5/abi-tags 1998-09-21 07:31:06.000000000 -0700 +++ glibc-2.3/abi-tags 2002-09-20 17:28:19.000000000 -0700 @@ -22,5 +22,7 @@ .*-sun-solaris2.* 2 2.0.0 # just an arbitrary value +.*-.*-freebsd.*-gnu.* 3 4.0.0 # earliest compatible kernel version + # There is no catch-all default here because every supported OS that uses # ELF must have its own unique ABI tag. diff -durpN glibc-2.2.5/aclocal.m4 glibc-2.3/aclocal.m4 --- glibc-2.2.5/aclocal.m4 2001-06-11 05:32:44.000000000 -0700 +++ glibc-2.3/aclocal.m4 2002-09-29 10:45:42.000000000 -0700 @@ -121,11 +121,13 @@ AR=`$CC -print-prog-name=ar` AC_SUBST(AR) # ranlib has to be treated a bit differently since it might not exist at all. -RANLIB=`$CC -print-prog-name=ranlib` -if test $RANLIB = ranlib; then +ac_ranlib=`$CC -print-prog-name=ranlib` +if test "x$ac_ranlib" = xranlib; then # This extra check has to happen since gcc simply echos the parameter in # case it cannot find the value in its own directories. AC_CHECK_TOOL(RANLIB, ranlib, :) +else + RANLIB=$ac_ranlib fi AC_SUBST(RANLIB) diff -durpN glibc-2.2.5/argp/argp-fmtstream.c glibc-2.3/argp/argp-fmtstream.c --- glibc-2.2.5/argp/argp-fmtstream.c 2001-08-16 23:41:52.000000000 -0700 +++ glibc-2.3/argp/argp-fmtstream.c 2002-09-23 22:11:41.000000000 -0700 @@ -1,5 +1,5 @@ /* Word-wrapping and line-truncating streams - Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . @@ -267,9 +267,10 @@ __argp_fmtstream_update (argp_fmtstream_ at the end of the buffer, and NEXTLINE is in fact empty (and so we need not be careful to maintain its contents). */ - if (nextline == buf + len + 1 - ? fs->end - nl < fs->wmargin + 1 - : nextline - (nl + 1) < fs->wmargin) + if ((nextline == buf + len + 1 + ? fs->end - nl < fs->wmargin + 1 + : nextline - (nl + 1) < fs->wmargin) + && fs->p > nextline) { /* The margin needs more blanks than we removed. */ if (fs->end - fs->p > fs->wmargin + 1) @@ -414,10 +415,10 @@ __argp_fmtstream_printf (struct argp_fmt avail = fs->end - fs->p; out = __vsnprintf (fs->p, avail, fmt, args); va_end (args); - if (out >= avail) + if ((size_t) out >= avail) size_guess = out + 1; } - while (out >= avail); + while ((size_t) out >= avail); fs->p += out; diff -durpN glibc-2.2.5/argp/argp-help.c glibc-2.3/argp/argp-help.c --- glibc-2.2.5/argp/argp-help.c 2001-08-20 12:55:03.000000000 -0700 +++ glibc-2.3/argp/argp-help.c 2002-04-08 01:19:17.000000000 -0700 @@ -1,5 +1,5 @@ /* Hierarchial argument parsing help output - Copyright (C) 1995-2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . @@ -62,7 +62,8 @@ char *alloca (); # include # ifdef _LIBC # undef dgettext -# define dgettext(domain, msgid) __dcgettext (domain, msgid, LC_MESSAGES) +# define dgettext(domain, msgid) \ + INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES) # endif # else # define dgettext(domain, msgid) (msgid) diff -durpN glibc-2.2.5/argp/argp-parse.c glibc-2.3/argp/argp-parse.c --- glibc-2.2.5/argp/argp-parse.c 2001-07-05 21:54:44.000000000 -0700 +++ glibc-2.3/argp/argp-parse.c 2002-04-08 01:19:12.000000000 -0700 @@ -1,5 +1,5 @@ /* Hierarchial argument parsing, layered over getopt - Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. + Copyright (C) 1995-2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . @@ -35,7 +35,8 @@ # include # ifdef _LIBC # undef dgettext -# define dgettext(domain, msgid) __dcgettext (domain, msgid, LC_MESSAGES) +# define dgettext(domain, msgid) \ + INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES) # endif # else # define dgettext(domain, msgid) (msgid) @@ -81,7 +82,13 @@ /* When argp is given the --HANG switch, _ARGP_HANG is set and argp will sleep for one second intervals, decrementing _ARGP_HANG until it's zero. Thus you can force the program to continue by attaching a debugger and setting - it to 0 yourself. */ + it to 0 yourself. + + XXX This variable used to be exported. But there seems to be no + need, at least not inside libc. */ +#ifdef _LIBC +static +#endif volatile int _argp_hang; #define OPT_PROGNAME -2 diff -durpN glibc-2.2.5/assert/__assert.c glibc-2.3/assert/__assert.c --- glibc-2.2.5/assert/__assert.c 2001-07-05 21:54:44.000000000 -0700 +++ glibc-2.3/assert/__assert.c 2002-08-02 14:46:57.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff -durpN glibc-2.2.5/assert/assert.c glibc-2.3/assert/assert.c --- glibc-2.2.5/assert/assert.c 2001-08-16 21:47:59.000000000 -0700 +++ glibc-2.3/assert/assert.c 2002-08-03 11:38:00.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,1994,1995,1996,1998,2001 Free Software Foundation, Inc. +/* Copyright (C) 1991,1994-1996,1998,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +21,7 @@ #include #include #include +#include extern const char *__progname; @@ -28,7 +29,7 @@ extern const char *__progname; #ifdef USE_IN_LIBIO # include # include -# define fflush(s) _IO_fflush (s) +# define fflush(s) INTUSE(_IO_fflush) (s) #endif /* This function, when passed a string containing an asserted @@ -41,6 +42,7 @@ extern const char *__progname; # include FATAL_PREPARE_INCLUDE #endif +#undef __assert_fail void __assert_fail (const char *assertion, const char *file, unsigned int line, const char *function) @@ -51,25 +53,33 @@ __assert_fail (const char *assertion, co FATAL_PREPARE; #endif - (void) __asprintf (&buf, _("%s%s%s:%u: %s%sAssertion `%s' failed.\n"), - __progname, __progname[0] ? ": " : "", - file, line, - function ? function : "", function ? ": " : "", - assertion); - - /* Print the message. */ + if (__asprintf (&buf, _("%s%s%s:%u: %s%sAssertion `%s' failed.\n"), + __progname, __progname[0] ? ": " : "", + file, line, + function ? function : "", function ? ": " : "", + assertion) >= 0) + { + /* Print the message. */ #ifdef USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - (void) __fwprintf (stderr, L"%s", buf); - else + if (_IO_fwide (stderr, 0) > 0) + (void) __fwprintf (stderr, L"%s", buf); + else #endif - (void) fputs (buf, stderr); + (void) fputs (buf, stderr); - (void) fflush (stderr); + (void) fflush (stderr); - /* We have to free the buffer since the appplication might catch the - SIGABRT. */ - free (buf); + /* We have to free the buffer since the application might catch the + SIGABRT. */ + free (buf); + } + else + { + /* At least print a minimal message. */ + static const char errstr[] = "Unexpected error.\n"; + __libc_write (STDERR_FILENO, errstr, sizeof (errstr) - 1); + } abort (); } +hidden_def(__assert_fail) diff -durpN glibc-2.2.5/assert/assert-perr.c glibc-2.3/assert/assert-perr.c --- glibc-2.2.5/assert/assert-perr.c 2001-08-16 21:47:59.000000000 -0700 +++ glibc-2.3/assert/assert-perr.c 2002-08-29 22:20:35.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1994,1995,1996,1997,1998,2001 Free Software Foundation, Inc. +/* Copyright (C) 1994-1998,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,7 @@ #include #include #include +#include extern const char *__progname; @@ -29,7 +30,7 @@ extern const char *__progname; #ifdef USE_IN_LIBIO # include # include -# define fflush(s) _IO_fflush (s) +# define fflush(s) INTUSE(_IO_fflush) (s) #endif /* This function, when passed an error number, a filename, and a line @@ -53,25 +54,33 @@ __assert_perror_fail (int errnum, FATAL_PREPARE; #endif - (void) __asprintf (&buf, _("%s%s%s:%u: %s%sUnexpected error: %s.\n"), - __progname, __progname[0] ? ": " : "", - file, line, - function ? function : "", function ? ": " : "", - __strerror_r (errnum, errbuf, sizeof errbuf)); - - /* Print the message. */ + if (__asprintf (&buf, _("%s%s%s:%u: %s%sUnexpected error: %s.\n"), + __progname, __progname[0] ? ": " : "", + file, line, + function ? function : "", function ? ": " : "", + __strerror_r (errnum, errbuf, sizeof errbuf)) >= 0) + { + /* Print the message. */ #ifdef USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - (void) __fwprintf (stderr, L"%s", buf); - else + if (_IO_fwide (stderr, 0) > 0) + (void) __fwprintf (stderr, L"%s", buf); + else #endif - (void) fputs (buf, stderr); + (void) fputs (buf, stderr); - (void) fflush (stderr); + (void) fflush (stderr); - /* We have to free the buffer since the appplication might catch the - SIGABRT. */ - free (buf); + /* We have to free the buffer since the appplication might catch the + SIGABRT. */ + free (buf); + } + else + { + /* At least print a minimal message. */ + static const char errstr[] = "Unexpected error.\n"; + __libc_write (STDERR_FILENO, errstr, sizeof (errstr) - 1); + } abort (); } +libc_hidden_def (__assert_perror_fail) diff -durpN glibc-2.2.5/BUGS glibc-2.3/BUGS --- glibc-2.2.5/BUGS 2001-06-15 21:22:02.000000000 -0700 +++ glibc-2.3/BUGS 2002-09-30 13:49:48.000000000 -0700 @@ -1,7 +1,7 @@ List of known bugs (certainly very incomplete) ---------------------------------------------- -Time-stamp: <2001-06-15T21:21:36 drepper> +Time-stamp: <02/09/30 13:49:48 drepper> This following list contains those bugs which I'm aware of. Please make sure that bugs you report are not listed here. If you can fix one @@ -55,21 +55,6 @@ Severity: [ *] to [***] [ *] The libm-ieee `scalb' function gives wrong results for non-integral second parameters. -[ *] Collation symbol and equivalence class handling in regex are not - yet 100% correct. - - [. .] at end of a range does not work - - [. .] and [= =] do not handle collating symbols (where a symbol - stands for multiple character) and multibyte character in - general not correctly. - - This is *extremely* hard to fix since regex has to be rewritten - completely. - -[ *] The regex implementation has various other problems, like limitations - of the expression size etc. [PR libc/1570, PR libc/1777] - - None of these can be fixed without a rewrite. - [ *] Several (most?) collation specifications are broken. The code which is currently there is in most cases inherited from the originial author (in case there is a LC_COLLATE specification in the locale @@ -86,10 +71,11 @@ Severity: [ *] to [***] of the whole LC_COLLATE description. [ *] Some of the functions which also handled IPv6 are currently broken. - This includes getaddrinfo() and getnameinfo(). IPv4 handling of + IPv6 and IPv4 lookups occasionally happen when not needed. This + happens in getaddrinfo() and getnameinfo(). IPv4 handling of these functions is OK though and there are patches available to fix the IPv6 code as well. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ulrich Drepper -drepper@cygnus.com +drepper@redhat.com diff -durpN glibc-2.2.5/catgets/catgets.c glibc-2.3/catgets/catgets.c --- glibc-2.2.5/catgets/catgets.c 2001-08-09 15:36:30.000000000 -0700 +++ glibc-2.3/catgets/catgets.c 2002-05-14 20:45:07.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1996-2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper, . @@ -70,8 +70,11 @@ catopen (const char *cat_name, int flag) return (nl_catd) -1; if (__open_catalog (cat_name, nlspath, env_var, result) != 0) - /* Couldn't open the file. */ - return (nl_catd) -1; + { + /* Couldn't open the file. */ + free ((void *) result); + return (nl_catd) -1; + } return (nl_catd) result; } diff -durpN glibc-2.2.5/catgets/catgetsinfo.h glibc-2.3/catgets/catgetsinfo.h --- glibc-2.2.5/catgets/catgetsinfo.h 2001-08-08 14:23:20.000000000 -0700 +++ glibc-2.3/catgets/catgetsinfo.h 2002-09-23 22:11:41.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper, . @@ -48,9 +48,10 @@ typedef struct catalog_info /* The magic number to signal we really have a catalog file. */ -#define CATGETS_MAGIC 0x960408de +#define CATGETS_MAGIC 0x960408deU /* Prototypes for helper functions. */ extern int __open_catalog (const char *cat_name, const char *nlspath, const char *env_var, __nl_catd __catalog); +libc_hidden_proto (__open_catalog) diff -durpN glibc-2.2.5/catgets/gencat.c glibc-2.3/catgets/gencat.c --- glibc-2.2.5/catgets/gencat.c 2002-01-20 19:20:30.000000000 -0800 +++ glibc-2.3/catgets/gencat.c 2002-06-29 13:52:35.000000000 -0700 @@ -325,15 +325,29 @@ read_input_file (struct catalog *current ++line_number; /* It the line continued? */ + continued = 0; if (buf[act_len - 1] == '\n') { --act_len; - continued = buf[act_len - 1] == '\\'; + + /* There might be more than one backslash at the end of + the line. Only if there is an odd number of them is + the line continued. */ + if (buf[act_len - 1] == '\\') + { + int temp_act_len = act_len; + + do + { + --temp_act_len; + continued = !continued; + } + while (temp_act_len > 0 && buf[temp_act_len - 1] == '\\'); + } + if (continued) --act_len; } - else - continued = 0; /* Append to currently selected line. */ obstack_grow (¤t->mem_pool, buf, act_len); diff -durpN glibc-2.2.5/catgets/Makefile glibc-2.3/catgets/Makefile --- glibc-2.2.5/catgets/Makefile 2001-07-05 21:54:44.000000000 -0700 +++ glibc-2.3/catgets/Makefile 2002-07-25 00:23:17.000000000 -0700 @@ -1,4 +1,4 @@ -# Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +# Copyright (C) 1996,1997,1998,1999,2000,2002 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -45,6 +45,8 @@ $(objpfx)gencat: $(gencat-modules:%=$(ob catgets-CPPFLAGS := -DNLSPATH='"$(msgcatdir)/%L/%N:$(msgcatdir)/%L/LC_MESSAGES/%N:$(msgcatdir)/%l/%N:$(msgcatdir)/%l/LC_MESSAGES/%N:"' \ -DHAVE_CONFIG_H +CPPFLAGS-gencat = -DNOT_IN_libc + generated = de.msg test1.cat test1.h sample.SJIS.cat test-gencat.h generated-dirs = de diff -durpN glibc-2.2.5/catgets/open_catalog.c glibc-2.3/catgets/open_catalog.c --- glibc-2.2.5/catgets/open_catalog.c 2001-08-08 14:20:39.000000000 -0700 +++ glibc-2.3/catgets/open_catalog.c 2002-09-23 22:11:41.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1996-2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper, . @@ -194,7 +194,7 @@ __open_catalog (const char *cat_name, co goto close_unlock_return; if (__builtin_expect (!S_ISREG (st.st_mode), 0) - || st.st_size < sizeof (struct catalog_obj)) + || (size_t) st.st_size < sizeof (struct catalog_obj)) { /* `errno' is not set correctly but the file is not usable. Use an reasonable error value. */ @@ -212,13 +212,9 @@ __open_catalog (const char *cat_name, co /* Some systems do not have this flag; it is superfluous. */ # define MAP_FILE 0 # endif -# ifndef MAP_INHERIT - /* Some systems might lack this; they lose. */ -# define MAP_INHERIT 0 -# endif catalog->file_ptr = (struct catalog_obj *) __mmap (NULL, st.st_size, PROT_READ, - MAP_FILE|MAP_COPY|MAP_INHERIT, fd, 0); + MAP_FILE|MAP_COPY, fd, 0); if (__builtin_expect (catalog->file_ptr != (struct catalog_obj *) MAP_FAILED, 1)) /* Tell the world we managed to mmap the file. */ @@ -237,7 +233,7 @@ __open_catalog (const char *cat_name, co /* Save read, handle partial reads. */ do { - size_t now = __read (fd, (((char *) &catalog->file_ptr) + size_t now = __read (fd, (((char *) catalog->file_ptr) + (st.st_size - todo)), todo); if (now == 0 || now == (size_t) -1) { @@ -257,8 +253,7 @@ __open_catalog (const char *cat_name, co /* Determine whether the file is a catalog file and if yes whether it is written using the correct byte order. Else we have to swap the values. */ - if (__builtin_expect (catalog->file_ptr->magic, CATGETS_MAGIC) - == CATGETS_MAGIC) + if (__builtin_expect (catalog->file_ptr->magic == CATGETS_MAGIC, 1)) swapping = 0; else if (catalog->file_ptr->magic == SWAPU32 (CATGETS_MAGIC)) swapping = 1; @@ -309,7 +304,8 @@ __open_catalog (const char *cat_name, co /* Now we can check whether the file is large enough to contain the tables it says it contains. */ - if (st.st_size <= (sizeof (struct catalog_obj) + 2 * tab_size + max_offset)) + if ((size_t) st.st_size + <= (sizeof (struct catalog_obj) + 2 * tab_size + max_offset)) /* The last string is not contained in the file. */ goto invalid_file; @@ -332,3 +328,4 @@ __open_catalog (const char *cat_name, co return result; } +libc_hidden_def (__open_catalog) diff -durpN glibc-2.2.5/catgets/sample.SJIS glibc-2.3/catgets/sample.SJIS --- glibc-2.2.5/catgets/sample.SJIS 2001-03-09 23:14:12.000000000 -0800 +++ glibc-2.3/catgets/sample.SJIS 2002-06-29 13:56:59.000000000 -0700 @@ -8,5 +8,7 @@ $set 1 3 sample3:予定表: 4 sample4:TEST\tTAB: 5 sample5:機能\t十種類: +6 double slash\\ +7 "another line" $set Another FOO "message foo" diff -durpN glibc-2.2.5/catgets/test-gencat.c glibc-2.3/catgets/test-gencat.c --- glibc-2.2.5/catgets/test-gencat.c 2001-08-08 14:24:20.000000000 -0700 +++ glibc-2.3/catgets/test-gencat.c 2002-06-29 13:58:05.000000000 -0700 @@ -23,6 +23,8 @@ main (void) printf ("%s\n", catgets(catalog, 1, 3, "sample 3")); printf ("%s\n", catgets(catalog, 1, 4, "sample 4")); printf ("%s\n", catgets(catalog, 1, 5, "sample 5")); + printf ("%s\n", catgets(catalog, 1, 6, "sample 6")); + printf ("%s\n", catgets(catalog, 1, 7, "sample 7")); catclose (catalog); return 0; diff -durpN glibc-2.2.5/catgets/test-gencat.sh glibc-2.3/catgets/test-gencat.sh --- glibc-2.2.5/catgets/test-gencat.sh 2001-07-16 15:17:22.000000000 -0700 +++ glibc-2.3/catgets/test-gencat.sh 2002-06-29 14:01:26.000000000 -0700 @@ -1,6 +1,6 @@ #! /bin/sh # Test escape character handling in gencat. -# Copyright (C) 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. # This file is part of the GNU C Library. # @@ -36,12 +36,14 @@ sample2:日本語: sample3:予定表: sample4:TEST TAB: sample5:機能 十種類: +double slash\ +another line EOF res=$? cat < + + * sysdeps/alpha/stxncpy.S: Don't access memory beyond the source + buffer. + * sysdeps/alpha/alphaev6/stxncpy.S: Likewise. + +2002-10-02 Andreas Jaeger + Guido Guenther + + * sysdeps/mips/fpu/fraiseexcpt.c: Add internal definition. + * sysdeps/mips/fpu/fesetenv.c: Likewise. + +2002-10-03 Jakub Jelinek + + * sysdeps/unix/sysv/linux/net/route.h: Include bits/wordsize.h. + (struct rtentry): Make rt_pad4 6 bytes long if __WORDSIZE == 64. + * sysdeps/unix/sysv/linux/alpha/Dist: Remove net/route.h. + * sysdeps/unix/sysv/linux/alpha/net/route.h: Remove. + * sysdeps/unix/sysv/linux/ia64/Dist: Remove net/route.h. + * sysdeps/unix/sysv/linux/ia64/net/route.h: Remove. + * sysdeps/unix/sysv/linux/s390/Dist: Remove net/route.h. + * sysdeps/unix/sysv/linux/s390/net/route.h: Remove. + +2002-10-03 Ulrich Drepper + + * libio/freopen.c: Don't re-set _wide_data element if the stream + is of old style which didn't have the element. + * libio/freopen64.c: Likewise. + +2002-10-02 Ulrich Drepper + + * sysdeps/unix/sysv/linux/x86_64/Dist: Add bits/utmpx.h. + * sysdeps/unix/sysv/linux/sparc/Dist: Likewise. + * sysdeps/unix/sysv/linux/powerpc/Dist: Likewise. + + * sysdeps/s390/s390-32/initfini.c: Avoid unterminated string literals. + * sysdeps/sh/elf/initfini.c: Likewise. + * sysdeps/mach/hurd/mips/init-first.c: Likewise. + * sysdeps/hppa/elf/initfini.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/sfp-machine.h: Likewise. + +2002-10-02 Steven Munroe + Jakub Jelinek + + * login/programs/utmpdump.c (print_entry): Copy up->ut_tv fields + to struct timeval temp_tv before printing to be 32-/64-bit agnostic. + * sysdeps/powerpc/bits/wordsize.h: Move to... + * sysdeps/powerpc/powerpc32/bits/wordsize.h: ...here. + (__WORDSIZE_COMPAT32): Define. + * sysdeps/powerpc/powerpc64/bits/wordsize.h: Likewise. + * sysdeps/sparc/sparc32/bits/wordsize.h (__WORDSIZE_COMPAT32): + Define. + * sysdeps/sparc/sparc64/bits/wordsize.h (__WORDSIZE_COMPAT32): + Define. + * sysdeps/s390/bits/wordsize.h: Move to... + * sysdeps/s390/s390-32/bits/wordsize.h: ...here. + * sysdeps/s390/s390-64/bits/wordsize.h: Likewise. + * sysdeps/x86_64/bits/wordsize.h (__WORDSIZE_COMPAT32): Define. + * sysdeps/unix/sysv/linux/powerpc/bits/utmp.h: New file. + * sysdeps/unix/sysv/linux/powerpc/bits/utmpx.h: New file. + * sysdeps/unix/sysv/linux/sparc/bits/utmp.h: New file. + * sysdeps/unix/sysv/linux/sparc/bits/utmpx.h: New file. + * sysdeps/unix/sysv/linux/x86_64/bits/utmp.h: New file. + * sysdeps/unix/sysv/linux/x86_64/bits/utmpx.h: New file. + +2002-10-02 Jakub Jelinek + + * sysdeps/alpha/dl-machine.h (elf_machine_rela): Fix comment typo. + Temporarily enable R_ALPHA_NONE relocs in ld.so. + * sysdeps/ia64/dl-machine.h (elf_machine_rela): Temporarily enable + R_IA64_NONE relocs in ld.so. + +2002-09-27 Steven Munroe + + * README.template: Minimum Linux kernel for powerpc64 is 2.4.19. + + * sysdeps/unix/sysv/linux/powerpc/bits/ipc.h (struct ipc_perm): + Use __uint32_t and __uint64_t for __seq, __pad1, __unused[12] fields + so they are consistent between PPC32 and PPC64. + + * sysdeps/unix/sysv/linux/powerpc/bits/stat.h [__WORDSIZE != 32]: + (_STAT_VER): Define to _STAT_VER_KERNEL. + (stru stat, struct stat64): Define to match the PPC64 kernel. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions + (libc: GLIBC_2.2): Remove __xstat64, __fxstat64, and __lxstat64. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat64.c: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat64.c: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat64.c: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/Dist: Add kernel_stat.h. + +2002-10-02 Roland McGrath + + * sysdeps/unix/sysv/linux/xstatconv.c [STAT_IS_KERNEL_STAT]: + Conditionalize the function definitions on this. + * sysdeps/unix/sysv/linux/xstat.c (__xstat) [STAT_IS_KERNEL_STAT]: + Don't use xstat_conv, just fail if VERS != _STAT_VER_KERNEL. + * sysdeps/unix/sysv/linux/fxstat.c (__fxstat) [STAT_IS_KERNEL_STAT]: + Likewise. + * sysdeps/unix/sysv/linux/lxstat.c (__lxstat) [STAT_IS_KERNEL_STAT]: + Likewise. + +2002-10-02 Ulrich Drepper + + * version.h (VERSION): Bump to 2.3. + + * elf/Makefile (distribute): Add tst-tlsmod1.c, tst-tlsmod2.c, + tst-tlsmod3.c, tst-tlsmod4.c, circlemod1.c, circlemod1a.c, + circlemod2.c, circlemod2a.c, circlemod3.c, circlemod3a.c, + and nodlopenmod2.c. + + * login/Makefile (distribute): Add utmp-equal.h. + + * iconvdata/Makefile (distribute): Add TSCII.precomposed and + TSCII.irreversible. + + * Make-dist (dist): Create .bz2 file. Add rule to create .bz2 files. + Also distribute xtests sources. + +2002-10-02 Kaz Kojima + + * elf/elf.h: Change TLS ELF relocation numbers. + * elf/tls-macros.h: Fix code sequences for SH TLS_LD and TLS_GD + macros. + * sysdeps/sh/dl-machine.h (dl_machine_rela) [case R_SH_TLS_TPOFF32]: + Use addend. + * sysdeps/sh/elf/initfini.c: Move __fpscr_values to... + * sysdeps/sh/elf/start.S: ...here. + +2002-10-01 Jakub Jelinek + + * sysdeps/unix/sysv/linux/ia64/bits/sigstack.h (MINSIGSTKSZ, + SIGSTKSZ): Changed to match kernel. + * sysdeps/unix/sysv/linux/sparc/bits/sigstack.h: New file. + +2002-10-01 Carlos O'Donell + + * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h + [__USE_GNU] (F_SETLEASE, F_GETLEASE, F_NOTIFY): New macros. + [__USE_GNU] (DN_ACCESS, DN_MODIFY, DN_CREATE, DN_DELETE, DN_RENAME, + DN_ATTRIB, DN_MULTISHOT): New macros. + +2002-02-08 Randolph Chung + + * sysdeps/hppa/elf/start.S: Define __data_start. + +2002-10-01 Isamu Hasegawa + + * posix/regex_internal.c (re_string_reconstruct): Reset the member + LEN and STOP. + * posix/regexec.c (re_search_stub): Remove incorrect condition of + "range < 0". + Round RANGE in case that it is too small. + +2002-10-01 Roland McGrath + + * config.h.in (NO_HIDDEN): New #undef. + * include/libc-symbols.h [! NO_HIDDEN]: Add this condition to + nonempty definitions of hidden_proto et al. + * configure.in: Grok --disable-hidden-plt to define NO_HIDDEN. + * configure: Regenerated. + * sysdeps/mach/hurd/configure.in: Always define NO_HIDDEN. + * sysdeps/mach/hurd/configure: Regenerated. + +2002-09-19 David Mosberger + + * sysdeps/ia64/dl-fptr.c (make_fdesc): Load address of "local" via + a 64-bit gp-relative address to enable binaries with large data + sections. + +2002-09-30 Ulrich Drepper + + * stdlib/cxa_finalize.c (__cxa_finalize): Call UNREGISTER_ATFORK + if it is defined. + * posix/Makefile (distribute): Add fork.h. + * sysdeps/generic/fork.h: New file. + +2002-09-29 Bruno Haible + + * sysdeps/generic/utmp_file.c (LOCKING_FAILED): New macro. + (UNLOCK_FILE): Add a label. + (getutent_r_file, internal_getut_r, getutline_r_file, pututline_file, + updwtmp_file): Shut off the alarm clock when locking failed. + +2002-09-30 Isamu Hasegawa + + * posix/regex_internal.h (re_match_context_t): Add a new member. + (re_fail_stack_ent_t): New structure. + (re_fail_stack_t): Likewise. + * posix/regexec.c (re_search_internal): Use the new member of + re_match_context_t. + Use fail stack only if it has back references and there are plural + matching candidates. + (proceed_next_node): Use fail stack if it is indicated. + (set_regs): Likewise. + (push_fail_stack): New function. + (pop_fail_stack): New function. + (check_dst_limits): Likewise. + (check_dst_limits_calc_pos): Likewise. + (search_subexp): Check the limitations on the top of subexpressions. + (sift_states_bkref): Check the limitations of the destination node. + Reuse the array sctx->sifted_states. + +2002-09-30 Ulrich Drepper + + * stdio-common/printf_fp.c: Shuffle a few lines around to help the + compiler optimizing. No semantical changes intended. + +2002-09-30 Jakub Jelinek + + * sysdeps/ia64/strncpy.S: Only segfault in .recovery2 if some bits + from the next quad are needed. + +2002-09-30 Roland McGrath + + * elf/tls-macros.h (TLS_LD, TLS_GD): Use call insn, not callq. + + * sysdeps/unix/x86_64/sysdep.S [USE_TLS && HAVE___THREAD] [! PIC]: + Use direct-%fs form of TLS access for errno. + + * sysdeps/unix/sysv/linux/i386/i686/sysdep.h: File removed, since + the i386 version has all the same asm now. + + * sysdeps/i386/elf/configure.in: Add @GOTNTPOFF and @NTPOFF uses to + the TLS support check. + * sysdeps/i386/elf/configure: Regenerated. + + * sysdeps/unix/sysv/linux/i386/sysdep.h [USE_TLS && HAVE___THREAD] + (SYSCALL_ERROR_HANDLER): Use direct-%gs form of TLS access for errno. + + * sysdeps/unix/i386/sysdep.S (syscall_error) + [USE_TLS && HAVE___THREAD]: Use TLS access for errno. + + * sysdeps/unix/sysv/linux/x86_64/sysdep.h + [USE_TLS && HAVE___THREAD] (SYSCALL_ERROR_HANDLER): Use TLS access. + + * rt/tst-aio7.c (do_test): Don't read from stdin, which could be the + terminal when the test is running in a background job. Instead, make + a pipe and read from its read half while never writing anything to it. + +2002-09-30 Andreas Jaeger + + * stdlib/tst-bsearch.c (main): Fix format strings. + * stdio-common/tst-rndseek.c (do_test): Likewise. + * libio/tst_swprintf.c (main): Likewise. + * catgets/tst-catgets.c (main): Likewise. + * libio/tst-fgetws.c (main): Likewise. + * posix/tst-mmap.c (main): Likewise. + * posix/bug-regex12.c (main): Likewise. + * posix/bug-regex11.c (main): Likewise. + * io/tst-getcwd.c (do_test): Likewise. + + * iconvdata/tst-e2big.c (test): Use %td in printf for ptrdiff_t. + + * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER): + Store 4 bytes into errno, not 8 bytes. + +2002-09-29 Ulrich Drepper + + * posix/regexec.c (sift_states_bkref): Remove ret variable. Use + err instead. + +2002-09-29 Roland McGrath + + * test-skeleton.c (timeout_handler): Use WUNTRACED flag in waitpid. + Examine the child's status and print something different if it wasn't + just killed by our SIGKILL. + (main): In the child process call setpgid to put it in its own pgrp. + +2002-09-29 Ulrich Drepper + + * sysdeps/unix/sysv/linux/sigwait.c (__sigwait): The return value + semantics for sigtimedwait is different. Rework the return value + handling and don't pass in a siginfo variable. + +2002-09-29 Roland McGrath + + * malloc/malloc.c [! MALLOC_DEBUG] (assert): #undef before defining. + + * sysdeps/mach/hurd/Versions (ld: GLIBC_2.2.6): Add __errno_location. + + * sysdeps/unix/sysv/linux/x86_64/sysdep.S [USE_TLS && HAVE___THREAD]: + Define errno in .tbss. + * sysdeps/unix/x86_64/sysdep.S [USE_TLS && HAVE___THREAD]: Use TLS + access for setting errno. + + * sysdeps/unix/x86_64/sysdep.S: Store 32 bits at errno, not 64 bits. + AFAICT, it was just blind luck that the word following errno in .bss + was just alignment padding and not some other variable to be clobbered. + +2002-09-29 Jakub Jelinek + + * sysdeps/unix/sysv/linux/kernel-features.h + (__ASSUME_SETRESUID_SYSCALL): On the sparc, define to 1, not empty. + +2002-09-29 Jakub Jelinek + + * nss/bug-erange.c (main): Don't fail if /etc/resolv.conf doesn't + exist. + +2002-09-29 Ulrich Drepper + + * nss/Makefile: Move bug-erange from tests to xtests. + +2002-09-29 Jakub Jelinek + + * stdlib/longlong.h (__udiv_qrnnd): Remove PARAMS from prototype. + +2002-09-29 Jakub Jelinek + + * sysdeps/unix/sysv/linux/sparc/sysdep.h (inline_syscall0): Make asm + volatile. + (inline_syscall1, inline_syscall2, inline_syscall3, inline_syscall4, + inline_syscall5, inline_syscall6): Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (INLINE_SYSCALL): + Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h (INLINE_SYSCALL): + Likewise. + +2002-09-29 Roland McGrath + + * configure.in (libc_cv_ranlib_necessary check): Put the .o file in + the archive, not the .c file. + * configure: Regenerated. + +2002-09-29 Roland McGrath + + * configure: Regenerated after aclocal.m4 change. + + * sysdeps/x86_64/sysdep.h [HAVE_ELF] (L): Define with .L##name form. + * sysdeps/unix/sysv/linux/x86_64/sysdep.h (L): Don't define it here. + + * sysdeps/generic/dl-lookupcfg.h [USE_TLS] (DL_LOOKUP_RETURNS_MAP): + Define it, because _dl_sym presumes it (for any platform). + + * sysdeps/x86_64/dl-tls.h: New file. + + * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Add a cast. + + * sysdeps/x86_64/elf/configure.in: New file. + * sysdeps/x86_64/elf/configure: New generated file. + +2002-09-28 Roland McGrath + + * elf/rtld.c (_dl_start): Fix conditional for declaring CNT. + + * aclocal.m4 (LIBC_PROG_BINUTILS): Don't clobber $RANLIB with ranlib + before we check it. + +2002-09-28 Ulrich Drepper + + * sysdeps/unix/sysv/linux/ia64/syscalls.list: Add __syscall_exit + entry point. + +2002-09-28 Jakub Jelinek + + * posix/bug-regex11.c (tests): Add flags field. + (main): Avoid warnings. Use test[i].flags. Return nonzero + if any of the tests failed. + * posix/bug-regex12.c: New file. + * posix/Makefile (tests): Add bug-regex12. + +2002-03-02 Thorsten Kukuk + + * sysdeps/unix/nice.c (nice): Use getpriority() for the return value. + +2002-09-28 Jeff Bailey + + * sysdeps/unix/sysv/sysv4/solaris2/configure.in: Delete. + * sysdeps/unix/sysv/aix/configure.in: Update comment and remove + stdio=libio setting. + +2002-09-28 Roland McGrath + + * sysdeps/mach/hurd/dl-sysdep.c (_dl_important_hwcaps): Use INTUSE for + _dl_signal_error. + * sysdeps/mips/dl-machine.h (elf_machine_runtime_link_map): Likewise. + * sysdeps/powerpc/powerpc64/dl-machine.c + (_dl_reloc_overflow): Likewise. + * sysdeps/arm/dl-machine.h (elf_machine_rel): Likewise. + (elf_machine_rela): Likewise. + +2002-09-27 Steven Munroe + + * include/libc-symbols.h (__hidden_dot_weak1): Fix typo. Replace + ASM_GLOBAL_DIRECTIVE with .weak. + +2002-09-28 Andreas Jaeger + + * sysdeps/unix/sysv/linux/mips/truncate64.c (truncate64): Fix + number of args to syscall. + * sysdeps/unix/sysv/linux/mips/ftruncate64.c (__ftruncate64): Likewise. + Patch by Guido Guenther . + +2002-09-27 Roland McGrath + + * sysdeps/unix/sysv/linux/x86_64/sysdep.h (__NR_pread, __NR_pwrite): + Define these to __NR_pread64, __NR_pwrite64 if not defined. + + * sysdeps/unix/sysv/linux/powerpc/lchown.S + [SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)]: Use this condition + on chown compatibility symbol; use compat_symbol, not symbol_version. + +2002-09-27 Isamu Hasegawa + + * posix/regcomp.c (reg_free): Free the debug area. + (re_compile_internal): Allocate debug area for the input string. + (create_initial_state): Check the back references in initial states + if they are really match null string in the initial state. + (parse_reg_exp): Mark the dfa that the dfa can have plural matchings. + (parse_expression): Likewise. + (parse_bracket_exp): Likewise. + * posix/regex_internal.c (re_node_set_intersect): Remove unused + function. + (re_node_set_contains): Change to return the index of node. + * posix/regex_internal.h (re_backref_cache_entry): Change the members. + (re_match_context_t): Likewise. + (struct re_dfa_t): Likewise. + (re_sift_context_t): New structure. + * posix/regexec.c (match_ctx_clear_flag): New function. + (sift_ctx_init): Likewise. + (update_cur_sifted_state): Likewise. + (add_epsilon_src_nodes): Likewise. + (sub_epsilon_src_nodes): Likewise. + (check_subexp_limits): Likewise. + (search_subexp): Likewise. + (sift_states_bkref): Likewise. + (merge_state_array): Likewise. + (sift_states_iter_bkref): Remove unused function. + (add_epsilon_backreference): Remove unused function. + (re_search_internal): Adapt new members and interfaces. + (check_matching): Check the back references in initial states + if they are really match null string in the initial state. + (proceed_next_node): Change the evaluation of back references, + since we have real registers here. + (set_regs): Adapt new interface of proceed_next_node. + (sift_states_backward): Add invocation of update_cur_sifted_state + instead of add_epsilon_backreference. + Add a sentinel to the outermost while loop. + Move the handling of back references to sift_states_bkref function, + since we can't handle some back references (e.g. a back reference + which match NULL string) here. + (transit_state_mb): Handle the new member max_mb_elem_len. + (transit_state_bkref_loop): Move the evaluation of back references to + search_subexp function, since we can't evaluate some back references + (e.g. a back reference which can have plural matchings) here. + (match_ctx_init): Adapt the new member. + (match_ctx_add_entry): Adapt the new members. + +2002-09-25 Alan Modra + + * elf/do-rel.h: Define macro DO_ELF_MACHINE_REL_RELATIVE for + 'elf_machine_rel_relative' + (elf_dynamic_do_rel): Call DO_ELF_MACHINE_REL_RELATIVE macro + instead of 'elf_machine_rel_relative'. + * sysdeps/hppa/dl-machine.h: + Define macro DO_ELF_MACHINE_REL_RELATIVE for + 'elf_machine_rel_relative' with extra map parameter + required by HPPA. + (elf_machine_rela_relative): Add plt relocation changes. + +2001-11-14 Matthew Wilcox + + * sysdeps/unix/sysv/linux/hppa/bits/ipc.h: New file. + * sysdeps/unix/sysv/linux/hppa/bits/msq.h: New file. + * sysdeps/unix/sysv/linux/hppa/bits/sem.h: New file. + * sysdeps/unix/sysv/linux/hppa/bits/shm.h: New file. + +2002-09-27 Steven Munroe + + * sysdeps/powerpc/powerpc32/Makefile: Fix typo in comment. + + * sysdeps/powerpc/powerpc64/Makefile + [$(build-shared) = yes] (pic-ccflag): Define it. + [$(subdir) = csu] (CFLAGS-initfini.s): Add -fpic here too. + +2002-09-27 Roland McGrath + + * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Remove + unneeded TLS cases. + +2002-09-27 Jakub Jelinek + + * elf/dl-addr.c (_dl_addr): Set dli_fbase to l_map_start + unconditionally. Set dli_fname to _dl_argv[0] only for main program. + +2002-09-27 Roland McGrath + + * elf/dl-addr.c (_dl_addr): Add a cast. + + * sysdeps/x86_64/dl-machine.h (elf_machine_rela) [USE_TLS]: Handle new + TLS relocs R_X86_64_DTPMOD64, R_X86_64_DTPOFF64, and R_X86_64_TPOFF64. + + * elf/elf.h (R_X86_64_DTPMOD64, R_X86_64_DTPOFF64, R_X86_64_TPOFF64, + R_X86_64_TLSGD, R_X86_64_TLSLD, R_X86_64_DTPOFF32, + R_x86_64_GOTTPOFF, R_X86_64_TPOFF32): New macros. + (R_X86_64_NUM): Update the value. + +2002-09-24 Jakub Jelinek + + * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_load_address): Don't + rely on *r_offset of R_SPARC_RELATIVE reloc in .got to contain the + addend. + * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_load_address): Use + the same l_addr computation. + * sysdeps/sparc/sparc64/configure.in: Removed. + * sysdeps/sparc/sparc64/configure: Removed. + * config.h.in (SPARC64_DYNAMIC_BEFORE_GOT): Remove. + +2002-09-26 Ulrich Drepper + + * elf/dynamic-link.h (elf_get_dynamic_info): Relocate DT_HASH entry + if necessary. + * elf/dl-lookup.c (_dl_setup_hash): DT_HASH entry is already relocated. + * elf/dl-addr.c (_dl_addr): Use .hash[1] entry to determine end of the + symbol table if necessary. + +2002-09-26 Roland McGrath + + * stdlib/longlong.h: Replaced with current version from GCC mainline, + last modified 2002-09-22 Kazu Hirata . + +2002-09-25 Andreas Jaeger + + * sysdeps/unix/sysv/linux/mips/syscalls.list: Add syscall_exit. + Patch by Guido Guenther . + +2002-09-25 Roland McGrath + + * Makeconfig (%.v.i pattern rule): Use $(CPPFLAGS). + +2002-09-24 Ulrich Drepper + + * sysdeps/unix/sysv/linux/configure.in: Recognize nptl add-on name. + +2002-09-24 Roland McGrath + + * sysdeps/mach/hurd/Versions (ld: GLIBC_2.0): Move __libc_read, + __libc_write, __libc_lseek64, to ... + (ld: GLIBC_PRIVATE): ... here. + + * csu/Versions: Use %include to get USE_TLS defined. + (libc: GLIBC_2.0) [USE_TLS && HAVE___THREAD]: Remove _errno, errno. + (libc: GLIBC_2.3) [USE_TLS && HAVE___THREAD]: Put errno here instead. + * resolv/Versions: Use %include to get USE_TLS defined. + (libc: GLIBC_2.0) [USE_TLS && HAVE___THREAD]: Remove _h_errno, h_errno, + and _res. + (libc: GLIBC_2.3) [USE_TLS && HAVE___THREAD]: Put h_errno, _res here. + + * elf/tls-macros.h [__x86_64__] (TLS_LE, TLS_IE, TLS_LD, TLS_GD): + New macros for x86-64. + + * sysdeps/unix/sysv/linux/alpha/bits/time.h: File removed. + It was indentical to the linux/bits/time.h file. + + * nscd/nscd_gethst_r.c (nscd_gethst_r): Add a cast to silence warning. + + * resolv/gethnamaddr.c (gethostbyaddr): Use socklen_t for SIZE. + +2002-09-23 Ulrich Drepper + + * po/zh_CN.po: New file. + +2002-09-23 Roland McGrath + + * posix/unistd.h: Test [__USE_UNIX98] instead of [__USE_OPEN2K] + for gethostname declaration. + + * catgets/open_catalog.c (__open_catalog): Don't use a value type + as the __builtin_expect expression, just the Boolean value. + + * sysdeps/generic/wordexp.c (parse_glob): int -> size_t for counter. + * sysdeps/unix/sysv/linux/opensock.c (__opensock): Likewise. + * resolv/res_hconf.c (arg_service_list, parse_line): Likewise. + * iconvdata/tst-loading.c (main): Likewise. + * catgets/tst-catgets.c (main): Likewise. + * stdlib/tst-xpg-basename.c (main): Likewise. + * stdlib/tst-bsearch.c (main): Likewise. + * stdio-common/test-vfprintf.c (main): Likewise. + * stdio-common/tst-rndseek.c (do_test): Likewise. + * libio/tst_swprintf.c (main): Likewise. + * libio/tst-fgetws.c (main): Likewise. + * wcsmbs/tst-mbrtowc.c (check_ascii): Likewise. + * time/tst-posixtz.c (main): Likewise. + * time/tst-strptime.c (test_tm): Likewise. + * time/tst-strptime.c (main): Likewise. + * time/tst-getdate.c (main): Likewise. + * posix/tst-mmap.c (main): Likewise. + * posix/tst-getaddrinfo.c (do_test): Likewise. + * io/tst-getcwd.c (do_test): Likewise. + * resolv/tst-aton.c (main): Likewise. + * inet/tst-network.c (main): Likewise. + * libio/tst-fgetws.c (main): Likewise. + * sysdeps/posix/sprofil.c (add_region): int -> unsigned int for I. + * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): int -> unsigned int + for PTYNO. + + * stdlib/msort.c (qsort): Add a cast to silence warning. + * stdio-common/vfprintf.c (process_string_arg): Likewise. + * libio/oldfileops.c (_IO_old_do_write): Likewise. + * sysdeps/unix/sysv/linux/getcwd.c (__getcwd): Likewise. + * sysdeps/unix/sysv/linux/ttyname.c (ttyname): Likewise. + * sysdeps/unix/sysv/linux/gethostid.c (gethostid): Likewise. + * argp/argp-fmtstream.c (__argp_fmtstream_printf): Likewise. + * nscd/nscd_getgr_r.c (nscd_getgr_r): Likewise. + * sysdeps/unix/grantpt.c (grantpt): Likewise. + * libio/tst-widetext.c (main): Likewise. + * libio/tst-mmap2-eofsync.c (do_test): Likewise. + * rt/tst-aio.c (test_file): Likewise. + * rt/tst-aio64.c (test_file): Likewise. + * resolv/tst-aton.c (main): Likewise. + + * catgets/catgetsinfo.h (CATGETS_MAGIC): Use U suffix on the constant. + + * ctype/ctype.c (__ctype_tolower, __ctype_toupper): Cast to int32_t + instead of uint32_t in these macros. + +2002-09-22 Bruno Haible + + * iconv/iconv_prog.c (main): Provide an error message that identifies + the wrong encoding. + + * iconvdata/tscii.c: New file. + * iconvdata/testdata/TSCII: New file. + * iconvdata/testdata/TSCII..UTF8: New file. + * iconvdata/TSCII.precomposed: New file. + * iconvdata/TSCII.irreversible: New file. + * iconvdata/gconv-modules (TSCII): New module. + * iconvdata/Makefile (modules): Add TSCII. + (distribute): Add tscii.c. + * iconvdata/tst-table-from.c (try, utf8_decode, main): Double output + buffer size. + * iconvdata/tst-tables.sh: Add TSCII. + * iconvdata/TESTS: Add TSCII. + + Revert 2002-04-18 patch. + * iconvdata/euc-jisx0213.c (EMIT_SHIFT_TO_INIT, BODY for + FROM_DIRECTION): Make the FROM direction stateful again. + * iconvdata/shift_jisx0213.c (EMIT_SHIFT_TO_INIT, BODY for + FROM_DIRECTION): Likewise. + + * iconvdata/tst-e2big.c: New file. + * iconvdata/Makefile (tests): Add tst-e2big. + +2002-09-23 Roland McGrath + + * elf/Makefile (test-extras): Define this instead of test-srcs. + * Makerules (all-nonlib): Include $(test-extras) too. + +2002-09-21 Carlos O'Donell + + * sysdeps/hppa/abort-instr.h: New file. + +2002-09-22 Roland McGrath + + * sysdeps/mach/hurd/Versions (ld: GLIBC_2.0): Remove duplicate entry. + + * sysdeps/mach/hurd/dl-sysdep.c (_exit): Add alias __GI__exit. + +2002-09-22 Andreas Schwab + + * cppflags-iterator.mk (CPPFLAGS-$(cpp-src)): Append, not overwrite. + + * sysdeps/m68k/fpu/bits/mathinline.h (isgreater, isgreaterequal) + (isless, islessequal, islessgreater, isunordered) [GCC >= 3.1]: + Use GCC builtins. + +2002-09-21 Roland McGrath + + * sysdeps/unix/sysv/linux/i386/dl-procinfo.h (_DL_HWCAP_PLATFORM): + Correct the value so it covers all platforms, and is computed + from _DL_PLATFORMS_COUNT rather than hard-wired. + From Andrew Suffield . + +2002-09-20 Ulrich Drepper + + * sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path): Avoid + locking when using mount tab file. + * sysdeps/unix/sysv/linux/internal_statvfs.c: Likewise. + * sysdeps/unix/sysv/linux/statvfs.c: Include . + * sysdeps/unix/sysv/linux/fstatvfs.c: Likewise. + + * elf/dl-init.c (_dl_init): Fix test of the size of the + preinit_array section. + (call_init): Optimize access to DT_INIT_ARRAY entry a bit. + Reported by Brian Cabral . + +2002-09-20 Steven Munroe + + * sysdeps/powerpc/sysdep.h: Remove powerpc32 specific macros. + * sysdeps/powerpc/powerpc32/sysdep.h: New file. Define powerpc32 + specific macros copied from sysdeps/powerpc/sysdep.h. + * sysdeps/powerpc/powerpc64/sysdep.h: New file. Define powerpc64 + specific macros. + * sysdeps/unix/powerpc/sysdep.h: Include . + [__WORDSIZE==64]: Include sysdeps/powerpc/powerpc64/sysdep.h. + [!__WORDSIZE==64]: Include sysdeps/powerpc/powerpc32/sysdep.h. + +2002-09-19 Bruno Haible + + * intl/dcigettext.c (DCIGETTEXT): Restore errno only right before + returning. + +2002-09-17 Bruno Haible + + * sysdeps/generic/utmp-equal.h: New file, extracted from utmp_file.c. + * sysdeps/generic/utmp_file.c (setutent_file): Invalidate last_entry + also on platforms with !HAVE_UT_TYPE. + (proc_utmp_eq): Remove function. + (internal_getut_r, pututline_file): Call __utmp_equal instead. + +2002-09-20 Bruno Haible + + * abi-tags: Add support for FreeBSD with ABI OS value 3. + * elf/cache.c (print_entry): Support the GNU/FreeBSD ABI tag. + +2002-09-20 Roland McGrath + + * sysdeps/generic/gmp-mparam.h: Include . + (BITS_PER_MP_LIMB, BYTES_PER_MP_LIMB, BITS_PER_LONGINT): Define in + terms of __WORDSIZE. + * sysdeps/x86_64/gmp-mparam.h: File removed. + * sysdeps/sparc/gmp-mparam.h: File removed. + * sysdeps/mips/mips64/gmp-mparam.h: File removed. + * sysdeps/ia64/gmp-mparam.h: File removed. + * sysdeps/alpha/gmp-mparam.h: File removed. + +2002-09-20 Steven Munroe + + * sysdeps/powerpc/elf/libc-start.c: Use long in place of int for argc + load, so as to work on both 32-bit and 64-bit. Remove unnecessary + casts. Align __libc_stack_end to 8 bytes. + +2002-09-20 Roland McGrath + + * sysdeps/powerpc/fpu/s_lrint.c: Use strong_alias/weak_alias macros + instead of asm for lrintf, __lrintf aliases. + + * sysdeps/powerpc/fpu/s_lrint.c (__lrint): Change union long array to + int array for 32-/64-bit compatibility. + From Steven Munroe . + +2002-09-17 Bruno Haible + + * sysdeps/generic/ifreq.h (__if_nextreq): New function. + * sysdeps/unix/sysv/linux/ifreq.h (__if_nextreq): New function. + * sysdeps/mach/hurd/ifreq.h (__if_nextreq): New function. + * sysdeps/gnu/ifaddrs.c (getifaddrs): Use __if_nextreq + for iterating through the list of interfaces. + * resolv/res_hconf.c (_res_hconf_reorder_addrs): Likewise. + +2002-09-20 Roland McGrath + + * sysdeps/unix/grantpt.c (pts_name): Set errno when __ptsname_r fails. + Reported by Bruno Haible . + + * sysdeps/unix/bsd/bsd4.4/isatty.c: New file. + + * sysdeps/unix/bsd/isatty.c (__isatty): Don't save and restore errno. + * sysdeps/unix/bsd/ptsname.c (__ptsname_r): Return errno value from + isatty unmodified. Reported by Bruno Haible . + +2002-09-20 Steven Munroe + + * sysdeps/powerpc/bits/setjmp.h [__WORDSIZE]: Add 64-bit jmpbuf. + * sysdeps/powerpc/bits/wordsize.h: New file. + * sysdeps/powerpc/fpu/bits/mathinline.h (lrint, lrintf): Change long + array to int array for 32-/64-bit compatibility. + +2002-09-20 Roland McGrath + + * login/programs/utmpdump.c: Don't include , . + + * sysdeps/generic/utimes.c (__utimes): Don't check TVP for null. + Reported by Bruno Haible . + + * sysdeps/generic/ifreq.h (__ifreq): Compute termination condition + before doubling RQ_LEN. + * sysdeps/unix/sysv/linux/ifreq.h (__ifreq): Likewise. + Reported by Bruno Haible . + +2002-09-18 Bruno Haible + + * login/logout.c (logout): Don't assume ut_time has the same size as + a time_t. + * login/logwtmp.c (logwtmp): Likewise. + + * sysdeps/pthread/configure: New file, moved here from + linuxthreads/sysdeps/unix/sysv/linux/configure. + +2002-09-19 Ulrich Drepper + + * sysdeps/unix/sysv/linux/_exit.c: Include . + (_exit): Don't use ABORT_INSTRUCTION if it is not defined. + Reported by Glen Nakamura . + +2002-09-19 Neal H. Walfield + + * sysdeps/mach/hurd/fork.c (__fork): Do not free the signal + thread's sigstate data structure if it has been allocated. + +2002-09-19 Roland McGrath + + * include/libc-symbols.h [HAVE_ASM_SET_DIRECTIVE] + [! HAVE_ASM_GLOBAL_DOT_NAME] (__hidden_dot_def1): Fix typo'd name. + +2002-09-18 Ulrich Drepper + + * version.h (VERSION): Bump to 2.2.94. + + * sysdeps/powerpc/fpu/Dist: Move fprrest.S and fprsave.S to... + * sysdeps/powerpc/powerpc32/fpu/Dist: ...here. New file. + * sysdeps/unix/sysv/linux/powerpc/Dist: Move kernel_stat.h to... + * sysdeps/unix/sysv/linux/powerpc/powerpc32/Dist: ...here. + + * sysdeps/i386/Makefile: Remove obsolete db2 rules. + + * sysdeps/unix/sysv/linux/Makefile: Add exit-thread.S. + + * sysdeps/unix/sysv/linux/powerpc/Dist: Add ldd-rewrite.sh. + + * sysdeps/unix/sysv/linux/powerpc/powerpc64/Dist: New file. + +2002-09-19 Jakub Jelinek + + * sysdeps/wordsize-32/Makefile: New file. + * sysdeps/arm/Makefile: Removed. + * sysdeps/i386/Makefile (sysdep_routines, shared-only-routines): + Don't add divdi3 here. + * sysdeps/m68k/Makefile: Likewise. + * sysdeps/powerpc/powerpc32/Makefile: Likewise. + * sysdeps/sh/Makefile: Likewise. + * sysdeps/s390/s390-32/Makefile: Likewise. + +2002-09-18 Roland McGrath + + * locale/lc-ctype.c (_nl_postload_ctype): Add compat_symbol decls for + the __ctype_* compat symbols, so the relocs generated bind to the + right versioned global symbol in the shared object. + + * elf/do-rel.h (elf_dynamic_do_rel): Mask off 0x8000 bit (hidden flag) + from the value taken from the DT_VERSYM table. + * elf/dl-runtime.c (fixup, profile_fixup): Likewise. + * sysdeps/mips/dl-machine.h (__dl_runtime_resolve): Likewise. + (RESOLVE_GOTSYM): Likewise. + + * sysdeps/unix/sysv/linux/sigaction.c (__libc_sigaction): + Add libc_hidden_def. + * sysdeps/unix/sysv/linux/arm/sigaction.c: Likewise. + * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. + * sysdeps/unix/sysv/linux/ia64/sigaction.c: Likewise. + * sysdeps/unix/sysv/linux/mips/sigaction.c: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise. + +2002-09-18 Ulrich Drepper + + * include/signal.h: Add libc_hidden_proto for __libc_sigaction. + + * sysdeps/unix/sysv/linux/sigaction.c: If SIGCANCEL is defined + define sigaction and __sigaction as wrappers around + __libc_sigaction which rejects changing SIGCANCEL. + * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. + + * sysdeps/unix/sysv/linux/i386/clone.S: Add support for SETTLS and + SETTID/CLEARTID. + + * signal/allocrtsig.c: Move to... + * sysdeps/generic/allocrtsig.c: ...here. New file. + +2002-09-17 Jakub Jelinek + + * elf/dl-lookup.c (_dl_debug_bindings): Print TLS lookups always. + + * elf/elf.h (R_386_TLS_TPOFF, R_386_TLS_IE, R_386_TLS_GOTIE, + R_386_TLS_LE): Define. + (R_386_TLS_IE_32, R_386_TLS_LE_32, R_386_TLS_TPOFF32): Update + comments. + * sysdeps/i386/dl-machine.h (elf_machine_type_class): Return + ELF_RTYPE_CLASS_PLT for R_386_TLS_TPOFF. + (elf_machine_rel): Handle R_386_TLS_TPOFF. + (elf_machine_rela): Likewise. + Remove unnecessary RTLD_BOOTSTRAP #ifdefs. + +2002-09-17 Roland McGrath + + * malloc/Makefile ($(objpfx)memusagestat.o: sysincludes): Define + file-specific variable override so it compiles properly when using + --with-headers. + +2002-09-17 Steven Munroe + + Ported to PowerPC64 running Linux. + * sysdeps/powerpc/powerpc64/Dist: New file. + * sysdeps/powerpc/powerpc64/Implies: New file. + * sysdeps/powerpc/powerpc64/Makefile: New file. + * sysdeps/powerpc/powerpc64/__longjmp.S: New file. + * sysdeps/powerpc/powerpc64/atomicity.h: New file. + * sysdeps/powerpc/powerpc64/backtrace.c: New file. + * sysdeps/powerpc/powerpc64/bp-asm.h: New file. + * sysdeps/powerpc/powerpc64/bsd-_setjmp.S: New file. + * sysdeps/powerpc/powerpc64/bsd-setjmp.S: New file. + * sysdeps/powerpc/powerpc64/dl-dtprocnum.h: New file. + * sysdeps/powerpc/powerpc64/dl-lookupcfg.h: New file. + * sysdeps/powerpc/powerpc64/dl-machine.c: New file. + * sysdeps/powerpc/powerpc64/dl-machine.h: New file. + * sysdeps/powerpc/powerpc64/memset.S: New file. + * sysdeps/powerpc/powerpc64/ppc-mcount.S: New file. + * sysdeps/powerpc/powerpc64/register-dump.h: New file. + * sysdeps/powerpc/powerpc64/setjmp.S: New file. + * sysdeps/powerpc/powerpc64/stpcpy.S: New file. + * sysdeps/powerpc/powerpc64/strchr.S: New file. + * sysdeps/powerpc/powerpc64/strcmp.S: New file. + * sysdeps/powerpc/powerpc64/strcpy.S: New file. + * sysdeps/powerpc/powerpc64/strlen.S: New file. + * sysdeps/powerpc/powerpc64/elf/bzero.S: New file. + * sysdeps/powerpc/powerpc64/elf/start.S: New file. + * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: New file. + * sysdeps/powerpc/powerpc64/fpu/s_copysignf.S: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New File. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/glob64.c: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: New file. + + * include/libc-symbols.h [HAVE_ASM_GLOBAL_DOT_NAME] + (C_SYMBOL_DOT_NAME): Insure that C_SYMBOL_DOT_NAME works for + various gcc versions. Dot names required for powerpc64. + [HAVE_ASM_GLOBAL_DOT_NAME] (_weak_extern): Add .weakext '.'ed symbol. + [HAVE_ASM_GLOBAL_DOT_NAME] (strong_alias): Add .global + C_SYMBOL_DOT_NAME(alias). + [HAVE_ASM_GLOBAL_DOT_NAME] (strong_data_alias): New macro. Same as + original strong_alias macro. + [HAVE_ASM_GLOBAL_DOT_NAME] (weak_alias): Add .weakext/.weak + C_SYMBOL_DOT_NAME(alias). + [HAVE_ASM_GLOBAL_DOT_NAME] (_symbol_version): Add .symver '.'ed name. + [HAVE_ASM_GLOBAL_DOT_NAME] (_default_symbol_version): Add .symver + '.'ed name. + Add comments on libc_hidden_data_def and libc_hidden_data_weak usage. + [HAVE_ASM_GLOBAL_DOT_NAME] (hidden_dot_def1): New macro. Generate + .global C_SYMBOL_DOT_NAME(alias). Otherwise an empty macro. + (hidden_def): Append hidden_dot_def1 macro to definition. + (hidden_ver): Append hidden_dot_def1 macro to definition. + (hidden_data_def): New macro. Same as original hidden_def macro. + (hidden_data_ver): New macro. Same as original hidden_ver macro. + [HAVE_ASM_GLOBAL_DOT_NAME] (hidden_dot_weak1): New macro. Generate + .weakext C_SYMBOL_DOT_NAME(alias). Otherwise an empty macro. + (hidden_weak): Append hidden_dot_weak1 macro to definition. + (hidden_data_weak): New macro. Same as original hidden_weak macro. + [HAVE_ASM_GLOBAL_DOT_NAME] (HIDDEN_JUMPTARGET): Define as .__GI_name. + Otherwise defined as __GI_name. + (libc_hidden_data_def): New macro. Use hidden_data_def. + (libc_hidden_data_weak): New macro. Use hidden_data_weak. + (libc_hidden_data_ver): New macro. Use hidden_data_ver. + (rtld_hidden_data_def): New macro. Use hidden_data_def. + (rtld_hidden_data_weak): New macro. Use hidden_data_weak. + (rtld_hidden_data_ver): New macro. Use hidden_data_ver. + (libm_hidden_data_def): New macro. Use hidden_data_def. + (libm_hidden_data_weak): New macro. Use hidden_data_weak. + (libm_hidden_data_ver): New macro. Use hidden_data_ver. + * inet/in6_addr.c: Replace libc_hidden_def with libc_hidden_data_def. + +2002-09-17 Ulrich Drepper + + * include/libc-symbols.h: Change *hidden_proto macros to accept + option parameters and pass those to the attribute definition. + * include/unistd.h (_exit): Add __noreturn__ to libc_hidden_proto call. + + * include/unistd.h: Declare __libc_pause. + + * include/sys/socket.h: Declare __libc_send, __libc_recv, + __libc_sendto, __libc_sendmsg, __libc_recvmsg, and __libc_accept. + + * include/unistd.h: Declare __libc_fork. + +2002-09-17 Roland McGrath + + * sunrpc/xcrypt.c (passwd2des_internal): Renamed fom passwd2des. + (passwd2des): Define it as an alias. + (xencrypt, xdecrypt): Call passwd2des_internal instead of passwd2des. + +2002-09-12 Bruno Haible + + * include/sys/sysctl.h (__sysctl): Add libc_hidden_proto. + * sysdeps/unix/sysv/linux/sysctl.c (__sysctl): Add libc_hidden_def. + + * include/rpc/xdr.h (xdrstdio_create): Add libc_hidden_proto. + * sunrpc/xdr_stdio.c (xdrstdio_create): Add libc_hidden_def. + +2002-09-05 Steven Munroe + + * sysdeps/unix/sysv/linux/kernel-features.h [__powerpc64__] + (__ASSUME_TRUNCATE64_SYSCALL, __ASSUME_STAT64_SYSCALL, __ASSUME_IPC64, + __ASSUME_FCNTL64, __ASSUME_MMAP2_SYSCALL): Don't define these. + PowerPC64 does not have separate 64-bit syscalls. + +2002-09-16 Roland McGrath + + * sysdeps/unix/sysv/linux/powerpc/mmap64.c (__mmap64): Add a cast. + + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (INLINE_SYSCALL): + New macro. + + * elf/rtld.c [HP_TIMING_NONAVAIL]: Fix last change for this case. + + * include/unistd.h: Uncomment libc_hidden_proto for _exit. + * sysdeps/mach/hurd/_exit.c: Add libc_hidden_def. + * sysdeps/generic/_exit.c: Likewise. + +2002-09-12 Jakub Jelinek + + * sysdeps/sparc/sparc32/fpu/libm-test-ulps: Regenerate. + + * elf/rtld.c (struct dl_start_final_info): New. + (_dl_start_final): Change second argument to struct + dl_start_final_info *. Set start_time from info. + (_dl_start): Remove bootstrap_map variable, add info. + Define bootstrap_map as macro. If not DONT_USE_BOOTSTRAP_MAP, + store HP_TIMING_NOW result into info.start_time. + +2002-09-16 Andreas Jaeger + + * sysdeps/unix/sysv/linux/_exit.c: Add libc_hidden_def and weak_alias + to _Exit. + * sysdeps/unix/sysv/linux/i386/_exit.S: Likewise. + +2002-09-15 Franz Sirl + + * sysdeps/powerpc/abort-instr.h: New file. + +2002-09-14 Ulrich Drepper + + * sysdeps/generic/libc-start.c (__libc_start_main): Remove bogus + comment. + + * test-skeleton.c (main): Provide more information in case waitpid + fails. + + * include/unistd.h: Declare __exit_thread. + * sysdeps/generic/libc-start.c (__libc_start_main): Remove dummy_addr. + Wrap call to main in setjmp if HAVE_CANCELBUF is defined. + * sysdeps/unix/sysv/linux/exit-thread.S: New file. + * sysdeps/unix/sysv/linux/_exit.c: New file. + * sysdeps/unix/sysv/linux/i386/_exit.S: New file. + * sysdeps/unix/sysv/linux/Makefile [subdir==posix] (sysdep_routines): + Add exit-thread. + + * configure.in: Add dl_iterate_phdr to test using -nostdlib. + +2002-09-12 Jakub Jelinek + + * sysdeps/i386/dl-machine.h (elf_machine_rel) + (case R_386_TLS_DTPMOD32): Don't use addend. + [case R_386_TLS_TPOFF32]: Remove redundant SYM_MAP != NULL check. + (elf_machine_rela): Add support for TLS relocs. + +2002-09-14 Roland McGrath + + * Makefile (manual/%): Add this pattern target to the iconvdata/% rule. + +2002-07-29 Steven Munroe + + * stdlib/longlong.h [_ARCH_PPC && W_TYPE_SIZE!=32]: Add powerpc64 + specific asm macros for multiple percision integer math. + +2002-06-04 Steven Munroe + + * sysdeps/generic/ldconfig.h (FLAG_POWERPC_LIB64) New macro. + * elf/cache.c (print_entry): Add case for FLAG_POWERPC_LIB64. + Remove per-machine conditionals for FLAG_* cases. + * sysdeps/unix/sysv/linux/powerpc/ldconfig.h: New file. + * sysdeps/unix/sysv/linux/powerpc/readelflib.c: New file. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/dl-cache.h: New file. + +2002-09-10 Alan Modra + + * csu/gmon-start.c [!TEXT_START]: Define TEXT_START if not already + defined in entry.h. + (__gmon_start__) [!ENTRY_POINT_DECL]: Use TEXT_START macro to obtain + lowest address for profiling in __monstartup call. + * sysdeps/powerpc/powerpc64/elf/entry.h: New file. + +2002-09-14 Roland McGrath + + * sysdeps/unix/sysv/linux/pread.c: __NR_pread64 may be defined + instead of __NR_pread. + * sysdeps/unix/sysv/linux/pread64.c: Likewise. + * sysdeps/unix/sysv/linux/pwrite.c: __NR_pwrite64 may be defined + instead of __NR_pwrite. + * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. + +2002-09-13 Roland McGrath + + * manual/libc.texinfo: @ifinfo -> @ifnottex around copyright notice. + +2002-09-13 Andreas Jaeger + + * sysdeps/unix/sysv/linux/mips/syscalls.list: Add readahead + syscall. Patch by Guido Guenther . + +2002-09-12 Ulrich Drepper + + * elf/elf.h: Correct DT_LOOS and DT_HIOS values. + +2002-09-10 Ulrich Drepper + + * sysdeps/powerpc/fpu/s_isnan.c: #undef __isnanf and isnanf after + reading the headers. + +2002-09-12 Roland McGrath + + * elf/rtld.c (_dl_start_final): Move _begin, _end decls outside the fn. + (_dl_start) [DONT_USE_BOOTSTRAP_MAP]: Use &_begin instead of l_addr to + find the ELF header. + + * elf/rtld.c (dl_main) [USE_TLS]: Adjust l_tls_initimage of main + executable if needed, in case it's actually a shared object. + +2002-09-11 Roland McGrath + + * elf/dl-load.c (_dl_map_object_from_fd): Use l_addr instead of + l_map_start to adjust l_tls_initimage. + + * nss/getnssent_r.c (__nss_getent_r): Use EAGAIN instead of errno + when using h_errno and it's not set to NETDB_INTERNAL. + * nss/getXXbyYY_r.c [NEED_H_ERRNO]: Likewise. + + * Makefile ($(common-objpfx)testrun.sh): New target. + (others): Depend on it. + (postclean-generated): Append it. + + * nss/bug-erange.c: New file. + * nss/Makefile (tests): Add it. + + * nss/getXXbyYY_r.c (INTERNAL (REENTRANT_NAME)): Return errno + instead of always EAGAIN when status is NSS_STATUS_TRYAGAIN. + + * sysdeps/generic/dl-environ.c (unsetenv): Redo last fix without + strncmp, keeps the code smaller for a non-performance-critical case. + + * sysdeps/generic/dl-environ.c (unsetenv): Rewritten using strncmp, + no longer wrongly matches arbitrary prefixes of NAME. + Reported by Jakub Jelinek . + +2002-09-11 Jakub Jelinek + + * posix/bug-regex11.c (tests): New array. + (main): Rewritten to run more different tests. + +2002-09-10 Roland McGrath + + * nscd/Makefile (CPPFLAGS-nscd, CPPFLAGS-nscd_conf, CPPFLAGS-dbg_log) + (CPPFLAGS-connections, CPPFLAGS-hstcache): Variables removed. + Instead, catch all of $(nscd-modules) via cppflags-iterator.mk. + + * sysdeps/powerpc/fpu/s_isnan.c: Do macro hackery on __GI___isnanf as + well so we don't get it declared by include/math.h's hidden_proto. + Then do hidden_proto for __isnanf locally so hidden_def works right. + + * posix/bug-regex5.c (main): Use `union locale_data_value' rather than + a cast to turn nl_langinfo return value into an integer. + +2002-09-10 Isamu Hasegawa + + * posix/regexec.c (build_trtable): Fix the destination of + newline to prevent wrong states from overwriting. + Append break statements to optimization. + +2002-09-10 Isamu Hasegawa + + * posix/regcomp.c: Wrap #include wchar.h and wctype.h in #if. + (build_range_exp): Add castings to strlen invocations. + (build_collating_symbol): Restore the type of characters from "char" + to "unsigned char", and supplement castings. + (build_collating_symbol): Likewise. + (build_equiv_class): Likewise. + (build_charclass): Likewise. + (seek_collating_symbol_entry): Likewise. + (parse_bracket_exp): Likewise. + (build_word_op): Supplement a casting. + * posix/regex_internal.c: Wrap #include wchar.h and wctype.h in #if. + (re_string_allocate): Fix castings. + (re_string_construct): Likewise. + (re_string_construct_common): Likewise. + (re_string_realloc_buffers): Likewise. + (build_wcs_buffer): Likewise. + (build_wcs_upper_buffer): Likewise. + (re_string_skip_chars): Likewise. + (re_string_reconstruct): Likewise. + * posix/regex_internal.h: Restore the type of characters in + re_string_t and bracket_elem_t from "char" to "unsigned char". + (re_string_elem_size_at): Fix castings. + * posix/regexec.c: Wrap #include wchar.h and wctype.h in #if. + (transit_state_bkref_loop): Restore the type of characters from + "char" to "unsigned char", and append a cast to "char*" pointer in + array subscript. + (check_node_accept_bytes): Likewise. + (find_collation_sequence_value): Likewise. + +2002-09-10 Hartvig Ekner + + * sysdeps/mips/memcpy.S: New file. + * sysdeps/mips/memset.S: New file. + * sysdeps/mips/fpu/e_sqrt.c: New file. + * sysdeps/mips/fpu/e_sqrtf.c: New file. + + * fpu/fclrexcpt.c: Cleaned up the FPU exception stuff - was not + functional before. Also removed all SHLIB_COMPAT stuff. + * fpu/fegetenv.c: Likewise. + * fpu/fesetenv.c:: Likewise. + * fpu/feupdateenv.c: Likewise. + * fpu/fgetexcptflg.c: Likewise. + * fpu/fraiseexcpt.c: Likewise. + + * sysdeps/mips/fpu/fsetexcptflg.c: New file. + +2002-09-09 Jakub Jelinek + + * include/math.h (__finite_internal, __finitef_internal, + __finitel_internal, __isinf_internal, __isnan_internal): Remove. + (isfinite): Remove. + (__finite, __isinf, __isnan, __finitef, __isinff, __isnanf, __finitel, + __isinfl, __isnanl): Add hidden_proto. + (__fpclassify, __fpclassifyf, __fpclassifyl, __expm1l): Add + libm_hidden_proto. + * math/Makefile (libm-calls): Add s_isinf and s_isnan. + * stdio-common/printf_fp.c (__printf_fp): Remove INTUSE from + __is{inf,nan} calls. + * stdio-common/printf_size.c (printf_size): Likewise. + * sysdeps/generic/printf_fphex.c (__printf_fphex): Likewise. + * sysdeps/generic/s_ldexp.c (__ldexp): Likewise. + * sysdeps/generic/s_ldexpf.c (__ldexpf): Likewise. + * sysdeps/generic/s_ldexpl.c (__ldexpl): Likewise. + * sysdeps/generic/s_expm1l.c (__expm1l): Add libm_hidden_def. + * sysdeps/i386/fpu/s_finite.S (__finite_internal): Remove alias. + (__finite): Add hidden_def. + * sysdeps/i386/fpu/s_finitef.S (__finitef_internal): Remove alias. + (__finitef): Add hidden_def. + * sysdeps/i386/fpu/s_finitel.S (__finitel_internal): Remove alias. + (__finitel): Add hidden_def. + * sysdeps/i386/fpu/s_isinfl.c (__isinfl): Remove INTDEF. Add + hidden_def. + * sysdeps/i386/fpu/s_isnanl.c (__isnanl): Likewise. + * sysdeps/i386/fpu/s_fpclassifyl.c (__fpclassifyl): Add + libm_hidden_def. + * sysdeps/i386/fpu/s_expm1l.S (__expm1l): Likewise. + * sysdeps/ieee754/dbl-64/s_finite.c (__finite): Remove INTDEF. Add + hidden_def. + * sysdeps/ieee754/dbl-64/s_isinf.c (__isinf): Likewise. + (__isinfl): Remove INTDEF. + * sysdeps/ieee754/dbl-64/s_isnan.c (__isnan): Remove INTDEF. Add + hidden_def. + (__isnanl): Remove INTDEF. + * sysdeps/ieee754/dbl-64/s_fpclassify.c (__fpclassify): Add + libm_hidden_def. + * sysdeps/ieee754/dbl-64/e_lgamma_r.c (sin_pi): Use __sin and __cos + instead of sin and cos. + * sysdeps/ieee754/flt-32/s_finitef.c (__finitef): Remove INTDEF. + Add hidden_def. + * sysdeps/ieee754/flt-32/s_isinff.c (__isinff): Likewise. + * sysdeps/ieee754/flt-32/s_isnanf.c (__isnanf): Likewise. + * sysdeps/ieee754/flt-32/s_fpclassifyf.c (__fpclassifyf): Add + libm_hidden_def. + * sysdeps/ieee754/ldbl-128/s_finitel.c (__finitel): Remove INTDEF. + Add hidden_def. + * sysdeps/ieee754/ldbl-128/s_isinfl.c (__isinfl): Likewise. + * sysdeps/ieee754/ldbl-128/s_isnanl.c (__isnanl): Likewise. + * sysdeps/ieee754/ldbl-128/s_fpclassifyl.c (__fpclassifyl): Add + libm_hidden_def. + * sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Add + libm_hidden_def. + * sysdeps/ieee754/ldbl-96/s_finitel.c (__finitel): Remove INTDEF. + Add hidden_def. + * sysdeps/ieee754/ldbl-96/s_isinfl.c (__isinfl): Likewise. + * sysdeps/ieee754/ldbl-96/s_isnanl.c (__isnanl): Likewise. + * sysdeps/ieee754/ldbl-96/s_fpclassifyl.c (__fpclassifyl): Add + libm_hidden_def. + * sysdeps/ia64/fpu/s_finite.S (__finite_internal, __finitef_internal, + __finitel_internal): Remove aliases. + (__finite, __finitef, __finitel): Add hidden_def. + * sysdeps/ia64/fpu/s_isnan.S (__isnan_internal, __isnanf_internal, + __isnanl_internal): Remove aliases. + (__isnan, __isnanf, __isnanl): Add hidden_def. + * sysdeps/ia64/fpu/s_isinf.S (__isinf_internal, __isinff_internal, + __isinfl_internal): Remove aliases. + (__isinf, __isinff, __isinfl): Add hidden_def. + * sysdeps/ia64/fpu/s_fpclassify.S (__fpclassify, __fpclassifyf, + __fpclassifyl): Add libm_hidden_def. + * sysdeps/ia64/fpu/s_expm1l.S (__expm1l): Likewise. + * sysdeps/m68k/s_isinfl.c (__isinfl): Remove INTDEF. Add hidden_def. + * sysdeps/m68k/fpu/s_isinf.c (INTDEFX): Remove. + (hidden_defx): Define and use. + * sysdeps/m68k/fpu/s_fpclassifyl.c (__fpclassifyl): Add + libm_hidden_def. + * sysdeps/m68k/fpu/s_expm1l.c (__expm1l): Likewise. + * sysdeps/m68k/s_isnanl.c (__isnanl): Add hidden_def. + * sysdeps/powerpc/fpu/s_isnan.c (__isnan, __isnanf, __isnanl): + Remove INTDEF. + (__isnan, __isnanf): Add hidden_def. + * sysdeps/x86_64/fpu/s_finitel.S (__finitel_internal): Remove alias. + (__finitel): Add libm_hidden_def. + * sysdeps/x86_64/fpu/s_expm1l.S (__expm1l): Likewise. + + * include/fenv.h (feraiseexcept, fesetenv): Add libm_hidden_proto. + * sysdeps/alpha/fpu/fesetenv.c (fesetenv): Add libm_hidden_ver. + * sysdeps/alpha/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/arm/fpu/fesetenv.c (fesetenv): Likewise. + * sysdeps/arm/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/generic/fesetenv.c (fesetenv): Likewise. + * sysdeps/generic/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/i386/fpu/fesetenv.c (fesetenv): Likewise. + * sysdeps/i386/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/m68k/fpu/fesetenv.c (fesetenv): Likewise. + * sysdeps/m68k/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/mips/fpu/fesetenv.c (fesetenv): Likewise. + * sysdeps/mips/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/powerpc/fpu/fesetenv.c (fesetenv): Likewise. + * sysdeps/powerpc/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/sparc/fpu/fesetenv.c (fesetenv): Likewise. + * sysdeps/sparc/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/hppa/fpu/fesetenv.c (fesetenv): Add libm_hidden_def. + * sysdeps/hppa/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/ia64/fpu/fesetenv.c (fesetenv): Likewise. + * sysdeps/ia64/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/sh/sh4/fpu/fesetenv.c (fesetenv): Likewise. + * sysdeps/sh/sh4/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/s390/fpu/fesetenv.c (fesetenv): Likewise. + * sysdeps/s390/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + * sysdeps/x86_64/fpu/fesetenv.c (fesetenv): Likewise. + * sysdeps/x86_64/fpu/fraiseexcpt.c (feraiseexcept): Likewise. + +2002-09-09 Steven Munroe + + * elf/elf.h: Add powerpc64 specific elf relocation and dynamic types. + +2002-09-09 Jakub Jelinek + + * elf/dl-error.c (_dl_signal_cerror): Don't print anything if only + LD_DEBUG=statistics or LD_TRACE_PRELINKING. + +2002-09-09 Ulrich Drepper + + * string/stratcliff.c: Some more strncpy tests. + Patch by Daniel Jacobowitz . + +2002-09-08 Roland McGrath + + * resolv/resolv.h: Include for u_long even in + the [__need_res_state] case. + Reported by Bruno Haible . + +2002-09-04 Bruno Haible + + * sysdeps/generic/bits/ustat.h: Comment fix. + * io/sys/sendfile.h: Comment fix. + * sysdeps/posix/pread.c: Comment fix. + * sysdeps/posix/pread64.c: Comment fix. + * sysdeps/posix/pwrite.c: Comment fix. + * sysdeps/posix/pwrite64.c: Comment fix. + +2002-09-06 Roland McGrath + + * posix/sys/utsname.h (_UTSNAME_SYSNAME_LENGTH): New macro, defined + to _UTSNAME_LENGTH if not already defined by . + (_UTSNAME_RELEASE_LENGTH, _UTSNAME_VERSION_LENGTH): Likewise. + (_UTSNAME_MACHINE_LENGTH): Likewise. + (struct utsname): Use new macros instead of _UTSNAME_LENGTH. + +2002-09-06 Ulrich Drepper + + * sysdeps/unix/sysv/linux/shm_open.c (where_is_shmfs): Correct + test for filesystem type name of mount points. + + * include/errno.h: Use errno definition with __thread for now only + in libc and ld.so. + + * test-skeleton.c (main): Improve error message for unexpected + signal case. + +2002-09-05 Roland McGrath + + * ctype/ctype-info.c: Renamed __ctype_old_* symbols to __ctype_*. + * locale/lc-ctype.c (_nl_postload_ctype): Likewise. + +2002-09-05 Jakub Jelinek + + * wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Unlock and return in + case of failure. + +2002-09-04 Bruno Haible + + * sysdeps/unix/sysv/linux/sigset-cvt-mask.h (sigset_set_old_mask, + sigset_get_old_mask): Turn into inline functions. + * sysdeps/unix/sysv/aix/sigset-cvt-mask.h (sigset_set_old_mask, + sigset_get_old_mask): Likewise. + * sysdeps/unix/sysv/sysv4/sigset-cvt-mask.h (sigset_set_old_mask, + sigset_get_old_mask): Likewise. + * sysdeps/generic/sigset-cvt-mask.h (sigset_set_old_mask): Declutter + syntax. + + * elf/readlib.c (process_file): Conditionalize check for QMAGIC. + + * sysdeps/generic/_strerror.c (_sys_errlist, _sys_nerr): Remove + default definitions. + (__strerror_r): Use _sys_errlist_internal instead of _sys_errlist, + _sys_nerr_internal instead of _sys_nerr. + + * nscd/connections.c (handle_request): Declare CALLER inside #if. + +2002-07-29 Steven Munroe + + * sysdeps/powerpc/__longjmp.S: Moved to... + * sysdeps/powerpc/powerpc32/__longjmp.S: ...here. + * sysdeps/powerpc/add_n.S: Moved to... + * sysdeps/powerpc/powerpc32/add_n.S: ...here. + * sysdeps/powerpc/addmul_1.S: Moved to... + * sysdeps/powerpc/powerpc32/addmul_1.S: ...here. + * sysdeps/powerpc/atomicity.h: Moved to... + * sysdeps/powerpc/powerpc32/atomicity.h: ...here. + * sysdeps/powerpc/backtrace.c: Moved to... + * sysdeps/powerpc/powerpc32/backtrace.c: ...here. + * sysdeps/powerpc/bp-asm.h: Moved to... + * sysdeps/powerpc/powerpc32/bp-asm.h: ...here. + * sysdeps/powerpc/bsd-_setjmp.S: Moved to... + * sysdeps/powerpc/powerpc32/bsd-_setjmp.S: ...here. + * sysdeps/powerpc/bsd-setjmp.S: Moved to... + * sysdeps/powerpc/powerpc32/bsd-setjmp.S: ...here. + * sysdeps/powerpc/dl-machine.c: Moved to... + * sysdeps/powerpc/powerpc32/dl-machine.c: ...here. + * sysdeps/powerpc/dl-machine.h: Moved to... + * sysdeps/powerpc/powerpc32/dl-machine.h: ...here. + * sysdeps/powerpc/dl-start.S: Moved to... + * sysdeps/powerpc/powerpc32/dl-start.S: ...here. + * sysdeps/powerpc/gprrest0.S: Moved to... + * sysdeps/powerpc/powerpc32/gprrest0.S: ...here. + * sysdeps/powerpc/gprrest1.S: Moved to... + * sysdeps/powerpc/powerpc32/gprrest1.S: ...here. + * sysdeps/powerpc/gprsave0.S: Moved to... + * sysdeps/powerpc/powerpc32/gprsave0.S: ...here. + * sysdeps/powerpc/gprsave1.S: Moved to... + * sysdeps/powerpc/powerpc32/gprsave1.S: ...here. + * sysdeps/powerpc/lshift.S: Moved to... + * sysdeps/powerpc/powerpc32/lshift.S: ...here. + * sysdeps/powerpc/memset.S: Moved to... + * sysdeps/powerpc/powerpc32/memset.S: ...here. + * sysdeps/powerpc/mul_1.S: Moved to... + * sysdeps/powerpc/powerpc32/mul_1.S: ...here. + * sysdeps/powerpc/ppc-mcount.S: Moved to... + * sysdeps/powerpc/powerpc32/ppc-mcount.S: ...here. + * sysdeps/powerpc/register-dump.h: Moved to... + * sysdeps/powerpc/powerpc32/register-dump.h: ...here. + * sysdeps/powerpc/rshift.S: Moved to... + * sysdeps/powerpc/powerpc32/rshift.S: ...here. + * sysdeps/powerpc/setjmp.S: Moved to... + * sysdeps/powerpc/powerpc32/setjmp.S: ...here. + * sysdeps/powerpc/stpcpy.S: Moved to... + * sysdeps/powerpc/powerpc32/stpcpy.S: ...here. + * sysdeps/powerpc/strchr.S: Moved to... + * sysdeps/powerpc/powerpc32/strchr.S: ...here. + * sysdeps/powerpc/strcmp.S: Moved to... + * sysdeps/powerpc/powerpc32/strcmp.S: ...here. + * sysdeps/powerpc/strcpy.S: Moved to... + * sysdeps/powerpc/powerpc32/strcpy.S: ...here. + * sysdeps/powerpc/strlen.S: Moved to... + * sysdeps/powerpc/powerpc32/strlen.S: ...here. + * sysdeps/powerpc/sub_n.S: Moved to... + * sysdeps/powerpc/powerpc32/sub_n.S: ...here. + * sysdeps/powerpc/submul_1.S: Moved to... + * sysdeps/powerpc/powerpc32/submul_1.S: ...here. + * sysdeps/powerpc/elf/bzero.S: Moved to... + * sysdeps/powerpc/powerpc32/elf/bzero.S: ...here. + * sysdeps/powerpc/elf/start.S: Moved to... + * sysdeps/powerpc/powerpc32/elf/start.S: ...here. + * sysdeps/powerpc/fpu/__longjmp.S: Moved to... + * sysdeps/powerpc/powerpc32/fpu/__longjmp.S: ...here. + * sysdeps/powerpc/fpu/fprrest.S: Moved to... + * sysdeps/powerpc/powerpc32/fpu/fprrest.S: ...here. + * sysdeps/powerpc/fpu/fprsave.S: Moved to... + * sysdeps/powerpc/powerpc32/fpu/fprsave.S: ...here. + * sysdeps/powerpc/fpu/setjmp.S: Moved to... + * sysdeps/powerpc/powerpc32/fpu/setjmp.S: ...here. + * sysdeps/powerpc/fpu/s_copysign.S: Moved to... + * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: ...here. + * sysdeps/powerpc/fpu/s_copysignf.S: Moved to... + * sysdeps/powerpc/powerpc32/fpu/s_copysignf.S: ...here. + * sysdeps/unix/sysv/linux/powerpc/brk.S: Moved to... + * sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S: ...here. + * sysdeps/unix/sysv/linux/powerpc/clone.S: Moved to... + * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: ...here. + * sysdeps/unix/sysv/linux/powerpc/glob64.c: Moved to... + * sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c: ...here. + * sysdeps/unix/sysv/linux/powerpc/kernel_stat.h: Moved to... + * sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h: ...here. + * sysdeps/unix/sysv/linux/powerpc/socket.S: Moved to... + * sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S: ...here. + * sysdeps/unix/sysv/linux/powerpc/sysdep.h: Moved to... + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: ...here. + * sysdeps/unix/sysv/linux/powerpc/syscalls.list: Moved to... + * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: ...here. + Support PowerPC64. Separate powerpc into powerpc/powerpc32 and + powerpc/powerpc64. + +2002-07-29 Steven Munroe + + * FAQ.in: Add powerpc64 to supported targets list. Also state the + minimum gcc version is 3.2 + * README: Add powerpc64 to supported targets list. + * configure.in: Change machine=powerpc to machine=powerpc/powerpc32. + Add powerpc64 and machine=powerpc/powerpc64. + (HAVE_ASM_GLOBAL_DOT_NAME): Define if linux*powerpc/powerpc64*. + * shlib-versions: Set DEFAULT version to 2.2.5 for powerpc64. + * sysdeps/powerpc/Dist: Remove dl-machine.c, dl-start.S, ppc-mcount.S, + gprsave1.S, gprsave0.S, gprrest1.S, and gprrest0.S. + * sysdeps/powerpc/powerpc32/Dist: New file. + * sysdeps/powerpc/Implies: Remove wordsize-32 and powerpc/soft-fp. + * sysdeps/powerpc/powerpc32/Implies: New file. + * sysdeps/powerpc/Makefile(cflags): Remove powerpc32 specific cflags. + ($(with-fp) = no): Move test to powerpc32/Makefile. + ($(subdir) = misc): Move to powerpc32/Makefile. + ($(build-shared) = yes): Move to powerpc32/Makefile. + ($(subdir) = csu): Move to powerpc32/Makefile. + (sysdep-rtld-routines): Remove dl-start. Moved these bits to ... + * sysdeps/powerpc/powerpc32/Makefile: New file. + * sysdeps/powerpc/Versions: Remove libgcc functions. + * sysdeps/powerpc/powerpc32/Versions: New file. + * sysdeps/powerpc/fpu/Makefile: Remove fprsave and fprrest. + * sysdeps/powerpc/powerpc32/fpu/Makefile: New file. + * sysdeps/unix/sysv/linux/configure.in (powerpc*): + Set arch_minimum_kernel=2.4.19 for powerpc/powerpc64. Also set + libc_cv_gcc_unwind_find_fde=yes only if !powerpc/powerpc64. + ($machine): Add powerpc/powerpc64 to if ... | for + libc_cv_slibdir=/libc64. + (powerpc*): Set ldd_rewrite_script. + * sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed: New file. + * sysdeps/unix/sysv/linux/powerpc/Dist: Remove clone.S. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/Dist: New file. + Add clone.S. + * sysdeps/unix/sysv/linux/powerpc/Makefile: Remove oldgetrlimit64. + * sysdeps/unix/sysv/linux/powerpc/Versions: Remove GLIBC_2.0 + functions. Remove GLIBC_2.2 functions except getrlimit and + setrlimit. Moved them to ... + * sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions: New file. + +2002-09-04 Ulrich Drepper + + * libio/tst-atime.c: Include . + (do_test): Only perform fstatvfs check if ST_NOATIME is defined. + +2002-09-03 Isamu Hasegawa + + * posix/regcomp.c (regcomp): Append "__restrict" modifier to avoid + warnings of some compilers. + (build_collating_symbol): Change the type of characters from + "unsigned char" to "char", and append a cast to "char*" pointer in + array subscript. + (build_collating_symbol): Likewise. + (build_equiv_class): Likewise. + (build_charclass): Likewise. + (re_compile_pattern): Remove incorrect cast. + (re_compile_fastmap_iter): Change the type of characters from + "unsigned char" to "char", and append a cast to "char*" pointer + in array subscript. + (parse_bracket_exp): Likewise. + * posix/regex_internal.c (re_string_construct_common): Likewise. + (re_string_allocate): Likewise. + (re_string_construct): Likewise. + (re_string_realloc_buffers): Likewise. + (build_wcs_buffer): Likewise. + (re_string_reconstruct): Likewise. + * posix/regex_internal.h: Change the type of characters in + re_string_t and bracket_elem_t from "unsigned char" to "char". + * posix/regexec.c (regexec): Append "__restrict" modifier to avoid + warnings of some compilers. + (transit_state_bkref_loop): Change the type of characters from + "unsigned char" to "char", and append a cast to "char*" pointer in + array subscript. + (check_node_accept_bytes): Likewise. + (find_collation_sequence_value): Likewise. + +2002-09-04 Roland McGrath + + * resolv/nss_dns/dns-network.c (MAXPACKET): Increase minimum value + from 1024 to 65536, to avoid buffer overrun. + +2002-09-03 Gerhard Tonn + + * sysdeps/s390/s390/fpu/libm-test-ulps: Regenerate. + +2002-09-04 Ulrich Drepper + + * libio/tst-atime.c (do_test): Make sure noatime flag isn't set + for filesystem. + +2002-09-04 Jakub Jelinek + + * posix/bug-regex11.c: New test. + * posix/Makefile (tests): Add bug-regex11. + +2002-09-03 Jakub Jelinek + + * locale/tst-C_locale.c (run_test): Pass LC_ALL_MASK not LC_ALL to + newlocale. + +2002-09-02 Roland McGrath + + * sysdeps/powerpc/elf/libc-start.c [! SHARED]: Call + __pthread_initialize_minimal and __libc_check_standard_fds to + match the generic version. + + * sysdeps/unix/sysv/linux/shmat.c (shmat): Add a cast to avoid a + warning when INLINE_SYSCALL macro uses the __syscall_ipc function. + + * locale/localeconv.c (__localeconv): Cast -1 to char to avoid + warnings on platorms where char is unsigned. + +2002-09-02 Ulrich Drepper + + * version.h (VERSION): Bump to 2.2.93. + + * sysdeps/unix/sysv/linux/x86_64/Dist: Add __start_context.S. + +2002-09-02 Jakub Jelinek + + * elf/rtld.c (dl_main): If prelinking succeeded, mark all objects + as relocated. + +2002-09-02 Jack Howarth + + * sysdeps/powerpc/fpu/libm-test-ulps: Regenerated. + +2002-09-02 Jakub Jelinek + + * locale/localeinfo.h (struct locale_data): Add private.ctype. + * wcsmbs/wcsmbsload.h (__wcsmbs_gconv_fcts, __wcsmbs_last_locale, + __wcsmbs_to_wc, update_conversion_ptrs): Removed. + (__wcsmbs_gconv_fcts_c, _nl_C_LC_CTYPE): New externs. + (__wcsmbs_load_conv): Remove const from argument. + (_nl_cleanup_ctype): New proto. + (get_gconv_fcts): New function. + * wcsmbs/wcsmbsload.c (__wcsmbs_last_locale): Removed. + (__wcsmbs_to_wc): Rename back to... + (to_wc): ... this. + (__wcsmbs_gconv_fcts): Rename to... + (__wcsmbs_gconv_fcts_c): ... this. Make const. Use to_wc. + (lock): Removed. + (__libc_setlocale_lock): New extern. + (__wcsmbs_load_conv): Remove const from argument. + Initialize new_category->private.ctype instead of a global + variable. + (__wcsmbs_clone_conv): Use get_gconv_fcts instead of + update_function_ptrs. No locking is necessary. + (_nl_cleanup_ctype): New function. + * wcsmbs/btowc.c (__btowc): Use get_gconv_fcts instead of + update_function_ptrs and a global __wcsmbs_gconv_fcts variable. + * wcsmbs/mbrtowc.c (__mbrtowc): Likewise. + * wcsmbs/mbsnrtowcs.c (__mbsnrtowcs): Likewise. + * wcsmbs/wcrtomb.c (__wcrtomb): Likewise. + * wcsmbs/wcsnrtombs.c (__wcsnrtombs): Likewise. + * wcsmbs/wcsrtombs.c (__wcsrtombs): Likewise. + * wcsmbs/wctob.c (wctob): Likewise. + * stdlib/mblen.c (mblen): Likewise. + * stdlib/mbtowc.c (mbtowc): Likewise. + * stdlib/wctomb.c (wctomb): Likewise. + * wcsmbs/mbsrtowcs.c (__mbsrtowcs): Likewise. + Remove calls to wcsmbs_get_towc_func and wcsmbs_free_funcs. + * wcsmbs/mbsrtowcs_l.c (wcsmbs_get_towc_func, wcsmbs_free_funcs): + Removed. + +2002-09-02 Roland McGrath + + * sysdeps/mach/hurd/Versions (ld: GLIBC_2.0): Add __fxstat64. + +2002-09-01 Roland McGrath + + * ctype/ctype.h (__ctype_b, __ctype_toupper, __ctype_tolower): + Variable declarations removed. + (__ctype_b_loc, __ctype_toupper_loc, __ctype_tolower_loc): Declare + these functions to replace them. + (__isctype, tolower, toupper, _tolower, _toupper): Use those accessor + functions plus an indirection rather than the old global variables. + * include/ctype.h (__isctype, tolower, _tolower, toupper, _toupper): + Macros removed. + (__ctype_b_loc, __ctype_toupper_loc, __ctype_tolower_loc): New extern + inline functions. + * ctype/ctype-info.c: Revert last reversion back the other way. + Define tsd vars CTYPE_B, CTYPE_TOLOWER, CTYPE_TOUPPER. + Define real function versions of include/ctype.h inlines here. + * ctype/Versions (libc: GLIBC_2.3): Add __ctype_b_loc, + __ctype_tolower_loc, __ctype_toupper_loc. + * locale/lc-ctype.c: Revert last reversion back the other way. + (_nl_postload_ctype): If current thread uses the global locale, + update its tsd vars. + * locale/uselocale.c (__uselocale): Update tsd vars from new locale. + * hurd/hurd/threadvar.h (enum __hurd_threadvar_index): Add CTYPE_B, + CTYPE_TOLOWER, CTYPE_TOUPPER. + + * sysdeps/generic/bits/libc-tsd.h (__libc_tsd_address): New macro. + * sysdeps/mach/hurd/bits/libc-tsd.h (__libc_tsd_address): Renamed + from __libc_tsd_threadvar_location. + (__libc_tsd_set, __libc_tsd_get): Update uses. + +2002-09-01 Ulrich Drepper + + * ctype/ctype.h: Undo the patch before the last one. Put back the + macro definitions for the standard functions to access the + classification and mapping arrays. + * include/ctype.h: Partly revert last patch. Move the macro + definitions for the exported functions back to the public header. + #undef all the macros defined here before redefining. + * ctype/ctype-info.c: Revert last patch. + * locale/lc-ctype.c: Revert last patch. + + * ctype/Makefile (routines): Add isctype. + * ctype/Versions (libc): Export isctype and __isctype for GLIBC_2.3. + * ctype/ctype.h: Add declaration of isctype. + * include/ctype.h: Declare __isctype. + * ctype/isctype.c: New file. + +2002-09-01 Roland McGrath + + * sysdeps/generic/libc-tls.c (__pthread_initialize_minimal): Pass + TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN instead of 0, 1. + + * include/getopt.h: Include before . + + * locale/findlocale.c (_nl_remove_locale): Don't search in + _nl_locale_file_list if DATA->alloc is ld_archive. + Use _nl_unload_locale to do the rest of the work. + + * locale/loadarchive.c (_nl_load_locale_from_archive): Set usage_count + of new structure to UNDELETABLE. + + * wctype/wctype.h (iswalnum, iswalpha, iswcntrl, iswdigit, iswlower, + iswgraph, iswprint, iswpunct, iswspace, iswupper, iswxdigit, iswblank, + towlower, towupper): Macros removed. + * ctype/ctype.h (__tobody): Put parens around macro argument. + (__isctype): Macro removed. + (__ctype_b, __ctype_tolower, __ctype_toupper): Decls removed. + (isalnum, isalpha, iscntrl, isdigit, islower, isgraph, isprint, + ispunct, isspace, isupper, isxdigit, isblank, _tolower, _toupper, + tolower, toupper): Macros and inlines removed. + * include/ctype.h [! NOT_IN_libc] + (isalnum, isalpha, iscntrl, isdigit, islower, isgraph, isprint, + ispunct, isspace, isupper, isxdigit, isblank, _tolower, _toupper, + tolower, toupper): Define here instead, using _NL_CURRENT. + * ctype/ctype.c (__ctype_tolower, __ctype_toupper): Define as macros + using _NL_CURRENT. + * ctype/ctype-extn.c (__ctype_tolower, __ctype_toupper): Likewise. + * ctype/ctype-info.c (__ctype_b, __ctype_tolower, __ctype_toupper): + Renamed these to __ctype_old_*. Define old names only for SHLIB_COMPAT. + (__ctype32_b, __ctype32_tolower, __ctype32_toupper): Likewise. + (__ctype32_wctrans, __ctype32_wctrans, __ctype32_width): Removed. + * locale/lc-ctype.c (_nl_postload_ctype): Use renamed variables, + conditional on SHLIB_COMPAT. Don't set removed variables at all. + * wctype/wcfuncs.c: Use _NL_CURRENT instead of those globals. + * wcsmbs/wcwidth.h (internal_wcwidth): Likewise. + * resolv/res_init.c [RESOLVSORT] (sort_mask): Renamed sort_mask_chars. + (ISSORTMASK): Update use. + * intl/localealias.c [__GNUC__]: #undef alloca before #define. + * nss/nss_files/files-XXX.c (last_use): Rename `none' to `nouse'. + (_nss_files_getENTNAME_r): Likewise. + * nss/nss_files/files-alias.c (last_use, _nss_files_getaliasent_r): + Likewise. + + * Makerules (all-nonlib): Renamed from all-tests. + Include $(others) here too. + * locale/Makefile (CPPFLAGS-locale, CPPFLAGS-localedef, + CPPFLAGS-ld-ctype, CPPFLAGS-ld-time, CPPFLAGS-ld-numeric, + CPPFLAGS-ld-monetary, CPPFLAGS-ld-collate, CPPFLAGS-ld-identification, + CPPFLAGS-charmap, CPPFLAGS-locarchive, CPPFLAGS-linereader, + CPPFLAGS-charmap-dir): Variables removed. Instead, catch all + the program modules via cppflags-iterator.mk. + * sunrpc/Makefile (CPPFLAGS-rpc_main): Variable removed. + Instead, catch all rpcgen-objs via cppflags-iterator.mk. + +2002-08-31 Roland McGrath + + * posix/tst-getconf.sh: If no third arg, work with static linking. + + * locale/categories.def (LC_TIME): No more _nl_postload_time. + + * locale/setlocale.c (_nl_category_postload): Use weak refs only under + [_NL_CURRENT_INDIRECT]. + +2002-08-31 Ulrich Drepper + + * time/tst-ftime_l.c (main): Also test strftime with uselocale. + +2002-08-31 Roland McGrath + + * locale/newlocale.c (__newlocale): Don't use strdup for names. + Instead, make the single allocation of the structure larger to hold + the name strings. + * locale/duplocale.c (__duplocale): Don't strdup names individually. + Instead, calculate size for a single allocation and copy into it. + * locale/freelocale.c (__freelocale): Don't free names individually. + + * locale/newlocale.c (__newlocale): Don't leak old data or names. + + * locale/xlocale.h (__locale_struct): Move __names member last, + for binary compatibility. + + * locale/duplocale.c (__duplocale): Free names from the right array. + + * locale/uselocale.c (__uselocale): Return previous locale when + setting a new one. + + * locale/newlocale.c: Commit changes from 2002-08-30 + batch where I failed to commit this file: + (__newlocale): Fill in __names array. + +2002-08-31 Ulrich Drepper + + * sysdeps/gnu/Makefile: Only depend on Versions.v.i for + errlist-compat.c if versioning==yes. + +2002-08-31 Andreas Jaeger + + * sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup): Declare + external functions with hidden attribute. + (elf_machine_rela): Optimize. + + * sysdeps/x86_64/memset.S: New file. + * sysdeps/x86_64/bzero.S: New file. + * sysdeps/x86_64/stpcpy.S: New file. + * sysdeps/x86_64/strcat.S: New file. + * sysdeps/x86_64/strchr.S: New file. + * sysdeps/x86_64/strcpy.S: New file. + * sysdeps/x86_64/strcspn.S: New file. + * sysdeps/x86_64/strlen.S: New file. + * sysdeps/x86_64/strpbrk.S: New file. + * sysdeps/x86_64/strspn.S: New file. + * sysdeps/x86_64/strcmp.S: New file. + * sysdeps/x86_64/strtok_r.S: New file. + * sysdeps/x86_64/strtok.S: New file. + * sysdeps/x86_64/memcpy.S: New file. + * sysdeps/x86_64/mempcpy.S: New file. + + * sysdeps/x86_64/fpu/s_copysign.S: Fix algorithm. + + * sysdeps/x86_64/fpu/libm-test-ulps: Add ulps for double tests. + +2002-08-31 Ulrich Drepper + + * stdio-common/Makefile (generated): Add errlist-compat.c. + + * locale/Makefile (extra-objs): Add $(localedef-aux:=.o). + + * locale/localeinfo.h: Pretty printing. + + * stdio-common/vfprintf.c (vfprintf): Remove duplicate ifs in + form_number handling. + +2002-08-31 Andreas Jaeger + + * sysdeps/x86_64/fpu/libm-test-ulps: Add ulps for float and long + double tests. + + * sysdeps/unix/sysv/linux/x86_64/Makefile (sysdep_routines): Add + __start_context. + + * sysdeps/unix/sysv/linux/x86_64/__start_context.S: New file. + + * sysdeps/unix/sysv/linux/x86_64/makecontext.c: New file. + + * sysdeps/unix/sysv/linux/x86_64/ucontext_i.h: Add defines for + registers used for passing args. + + * sysdeps/unix/sysv/linux/x86_64/swapcontext.S: Save and restore + all needed registers. + + * sysdeps/unix/sysv/linux/x86_64/setcontext.S: Restore all + registers. + + * sysdeps/unix/sysv/linux/x86_64/getcontext.S: Save all needed + registers. + +2002-08-30 Ulrich Drepper + + * elf/dynamic-link.h (elf_get_dynamic_info): Mark with + always_inline attribute. + +2002-08-30 Roland McGrath + + * stdlib/tst-setcontext.c (main): If makecontext does nothing, + presume it's the stub and bail without error. + + * nss/getnssent_r.c (__nss_getent_r): Return ENOENT if status is + neither SUCCESS nor TRYAGAIN (see 2002-08-25 change [PR libc/4259]). + + * nss/getnssent_r.c (__nss_getent_r): Set *H_ERRNOP, not global one. + + * sysdeps/x86_64/hp-timing.h (HP_TIMING_NOW, HP_TIMING_ACCUM): New + macros replace the i686 versions for 64-bit mode. + + * locale/duplocale.c: Include . + + * intl/dcigettext.c (DCIGETTEXT) [_LIBC]: Check for bogus CATEGORY. + [_LIBC] (category_to_name): Don't define the function. Instead + define a macro using _nl_category_names. + + * locale/xlocale.h (struct __locale_struct): New member `__names'. + * locale/xlocale.c (_nl_C_locobj): Update initializer. + * locale/global-locale.c (_nl_global_locale): Likewise. + * locale/duplocale.c (__duplocale): strdup __names elements. + * locale/freelocale.c (__freelocale): Free __names elements. + * locale/localename.c (_nl_current_names): Variable removed. + (__current_locale_name): Use _NL_CURRENT_LOCALE->__names instead. + * locale/localeinfo.h (_nl_current_names): Removed decl. + * locale/setlocale.c: Use _nl_global_locale->__names in place of + _nl_current_names throughout. + + * locale/setlocale.c (setlocale): strdup -> __strdup (not ISO C). + + * sysdeps/gnu/errlist-compat.awk: Emit link_warnings for sys_errlist + and sys_nerr in the output file. + + * sunrpc/Makefile (rpcgen-cmd): Pass CPP in rpcgen's environment. + * scripts/cpp: Just use the environment variable. + + * libio/tst-mmap-setvbuf.c (main): Use 'm' fopen flag. + * libio/tst-mmap-offend.c (do_test): Likewise. + * libio/tst-mmap-fflushsync.c (do_test): Likewise. + * libio/tst-mmap-eofsync.c (do_test): Likewise. + * libio/tst-mmap2-eofsync.c (do_test): Likewise. + + * locale/localename.c: If the current locale is the global locale, use + _nl_current_names; otherwise use the locale object. + +2002-08-29 Ulrich Drepper + + * libio/fileops.c (_IO_new_file_fopen): Recognize new mode specifier + 'm' to enable mmap I/O. + * libio/libio.h (_IO_FILE): Rename _blksize field to _flags2. The + former wasn't used (anymore?). + (_IO_FLAGS2_MMAP): New define. + * libio/genops.c (_IO_no_init): Initialize _flags2 field. + * libio/iofopen.c (__fopen_maybe_mmap): Use mmap callbacks only if + _IO_FLAGS2_MMAP bit is set. + * libio/iofdopen.c (_IO_new_fdopen): Recognize 'm' mode specifier. + Enable mmap-using mode only if 'm' was set. + +2002-08-29 Roland McGrath + + * sysdeps/mach/hurd/bits/local_lim.h (NAME_MAX): New macro. + + * sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup: doinit): + Change argument type from int to intptr_t. + + * locale/global-locale.c (__libc_tsd_LOCALE_data): Conditionalize the + initializer on [! _HURD_THREADVAR_H] (bad kludge). + * sysdeps/mach/hurd/i386/init-first.c (init): Initialize + _HURD_THREADVAR_LOCALE slot to &_nl_global_locale. + * hurd/hurdsig.c (_hurdsig_init): Likewise. Zero other slots. + + * sysdeps/mach/_strerror.c (__strerror_r): Add libc_hidden_def. + + * sysdeps/mach/hurd/pwrite64.c: No libc_hidden_def (__libc_pwrite64). + + * sysdeps/mach/hurd/dl-sysdep.c (__GI_abort): Define alias for abort. + + * include/assert.h (__assert_perror_fail): Declare it, do hidden_proto. + * assert/assert-perr.c: Add libc_hidden_def. + * elf/dl-minimal.c [! NDEBUG] (__assert_perror_fail): New function. + + * sysdeps/gnu/errlist-compat.awk: Don't fail if there are no versions + found at all. + * sysdeps/gnu/Versions: File removed. Moved all #errlist-compat + sys_errlist stuff to ... + * sysdeps/unix/sysv/linux/Versions: ... here. + + * mach/mach.h: Include . + +2002-08-29 Roland McGrath + + * elf/dl-runtime.c (IN_DL_RUNTIME): Define this macro first thing. + * sysdeps/i386/dl-machine.h: Only declare fixup, profile_fixup and + define ELF_MACHINE_RUNTIME_TRAMPOLINE under #ifdef IN_DL_RUNTIME. + + * sysdeps/generic/readelflib.c (process_elf_file): Fix typo. + + * iconv/gconv_int.h: Include for alloca decl. + (norm_add_slashes): alloca -> __alloca + +2002-08-29 Jakub Jelinek + + * stdio-common/vfprintf.c (vfprintf): Add builtin_expect for + string_malloced, it is unlikely to be set. + Only call free with non-NULL workspace. + * sysdeps/sparc/sparc32/sparcv9/Makefile (sysdep-CFLAGS): Use + -mcpu=ultrasparc, not only tune for it. + (ASFLAGS*): Set unconditionally. + + * sysdeps/generic/readelflib.c (process_elf_file): Make LOADADDR + ElfW(Addr). Don't mask upper 32-bits and lower 12 bits off from + p_vaddr/p_offset when computing LOADADDR. + +2002-08-29 Ulrich Drepper + + * version.h (VERSION): Bump to 2.2.92. + + * time/Makefile (tst-ftime_l-ENV): New variable. + + * iconvdata/ibm870.c: All bytes are now used, no holes anymore. + + * localedata/charmaps/IBM870: Add correct mapping for , + , and . Add missing mappings. + Patch by Antonin Kopecky . + + * gmon/sys/gmon.h (ARCDENSITY): Bump to 3. + Define ARCINDEX. Bump MAXARCS to 1 << 20. + (struct tostruct): Use ACRINDEX as type for link field. + (statuc gmonparam): Likewise for froms. + * gmon/gmon.c (__monstartup): Use currect cast for assignments to + kcount and froms. + (write_call_graph): Use correct type for from_index and to_index. + * gmon/mcount.c: Use correct types for frompcindex and toindex + variables. + Patches by Dan Kegel . + + * sysdeps/posix/getaddrinfo.c (gaih_inet): Fix code to determine + canonical name. + + * time/strptime.c (ISSPACE): New #define. Use isspace or + __isspace_l. Replace calls to isspace. + (match_string): Define variant for USE_IN_EXTENDED_LOCALE_MODEL. + +2002-08-29 Roland McGrath + + * string/tst-strxfrm.c: Remove __ from function names. + +2002-08-28 Ulrich Drepper + + * include/wchar.h: Declare __mbsrtowcs_l. + * wcsmbs/Makefile (routines): Add mbsrtowcs_l. + * wcsmbs/mbsrtowcs.c: Add support for compilation with + USE_IN_EXTENDED_LOCALE_MODEL. + * wcsmbs/mbsrtowcs_l: New file. + * wcsmbs/wcsmbsload.c (__wcsmbs_to_wc): Renamed from to_wc. Don't + define as static. Change all uses. + (__wcsmbs_getfct): Renamed from getfct. Don't define as static. + Change all callers. + * wcsmbs/wcsmbsload.h: Declare __wcsmbs_to_wc and __wcsmbs_getfct. + * time/strftime.c: When translating for the extended locale model + use the _l functions. + * time/Makefile (tests): Add tst-ftime_l. + * time/tst-ftime_l.c: New file. + +2002-08-28 Roland McGrath + + * locale/findlocale.c [NL_CURRENT_INDIRECT] (_nl_C): New variable. + * locale/setlocale.c (setlocale) [NL_CURRENT_INDIRECT]: Null return + from _nl_find_locale ok if for _nl_C_name. + + * locale/nl_langinfo.c [NL_CURRENT_INDIRECT]: Use a categories.def + iterator to refer to each category's _nl_current_LC_FOO symbol, so + we know they are all linked in. + + * NEWS: Added 2.2.6 text from 2.2 branch version. + + * time/strptime.c (strptime_internal): Remove spurious const. + + * locale/lc-time.c (_nl_init_era_entries, _nl_get_era_entry, + _nl_select_era_entry): Moved to ... + * time/era.c: ... here, new file. + (_nl_init_era_entries, _nl_get_era_entry, _nl_select_era_entry): + Add internal_function to definitions. Take an additional argument + giving the `struct locale_data *' to use. + * locale/lc-time.c (_get_alt_digit, _nl_get_walt_digit, + _nl_parse_alt_digit): Moved to ... + * time/alt_digit.c: ... here, new file. + * time/lc-time-cleanup.c: New file. + * locale/lc-time.c (_nl_postload_time, free_mem): Functions removed. + * locale/localeinfo.h (_nl_postload_time): Remove decl. + (_nl_cleanup_time): Declare it. + (_nl_get_era_entry, _nl_select_era_entry): Update decls. + (_get_alt_digit, _nl_get_walt_digit, _nl_parse_alt_digit): Likewise. + * time/Makefile (aux): New variable: era, alt_digit, lc-time-cleanup. + * time/strftime.c: Pass locale data to helper functions. + * time/strptime.c: Likewise. + + * locale/localeinfo.h (struct locale_data): New member `private' + * locale/loadlocale.c (_nl_intern_locale_data): Initialize it. + (_nl_unload_locale): Call LOCALE->private.cleanup if it is set. + * locale/C-collate.c: Update initializer. + * locale/C-identification.c: Likewise. + * locale/C-measurement.c: Likewise. + * locale/C-telephone.c: Likewise. + * locale/C-address.c: Likewise. + * locale/C-name.c: Likewise. + * locale/C-paper.c: Likewise. + * locale/C-time.c: Likewise. + * locale/C-numeric.c: Likewise. + * locale/C-monetary.c: Likewise. + * locale/C-messages.c : Likewise. + * locale/C-ctype.c: Likewise. + + * time/strptime.c [USE_IN_EXTENDED_LOCALE_MODEL] (_NL_CURRENT_WORD): + Redefine this too. + +2002-08-28 Jakub Jelinek + + * sysdeps/generic/ldsodefs.h (__rtld_global_attribute__): Define. + (_rtld_global): Use it. + + * sysdeps/gnu/Dist: Remove errlist-compat.c. + * sysdeps/gnu/Makefile (errlist-compat.c): Build this file in the + object directory. Pass all Versions files to the awk script. + * sysdeps/gnu/errlist-compat.c: Removed. + * sysdeps/gnu/errlist.awk: Use #errlist-compat comments from the + first Versions file in the search path which has them. + Allow multiple errlist symbol versions to have the same count of + errors. + * sysdeps/gnu/errlist-compat.awk: Include instead + of "errlist-compat.c". + * sysdeps/gnu/errlist.c: Regenerated. + * sysdeps/unix/sysv/linux/mips/Versions (libc): Add #errlist-compat + comments at GLIBC_2.0, GLIBC_2.1 and GLIBC_2.3. + * sysdeps/unix/sysv/linux/alpha/Versions: Likewise. + (librt): Add aio_cancel and aio_cancel64 as GLIBC_2.3. + * sysdeps/unix/sysv/linux/hppa/Versions: Likewise. + * sysdeps/unix/sysv/linux/sparc/Versions: New file. + * sysdeps/unix/sysv/linux/alpha/bits/errno.h: New file. + * sysdeps/unix/sysv/linux/hppa/bits/errno.h (ECANCELED): Define to + ECANCELLED if not defined by kernel headers. + * sysdeps/unix/sysv/linux/bits/errno.h: Don't redefine ECANCELED if + already defined by kernel headers. + * sysdeps/unix/sysv/linux/sparc/bits/errno.h: New file. + * sysdeps/pthread/aio_cancel.c: Don't include aio.h and its + aio_cancel64 renaming hack nor provide weak_alias if aio_cancel + is a macro. + * Versions.def (GLIBC_2.3) [librt]: Add. + + * sysdeps/unix/sysv/linux/alpha/pipe.S: New file. + +2002-08-28 Ulrich Drepper + + * include/libc-symbols.h [!__ASSEMBLER__] (declare_symbol_1): Add + missing comma to .type directive. + +2002-08-28 Jakub Jelinek + + * sysdeps/ia64/elf/configure.in (PI_STATIC_AND_HIDDEN): Define + unconditionally. + * sysdeps/alpha/elf/configure.in (libc_cv_alpha_hidden_gprel): New + check. + (PI_STATIC_AND_HIDDEN): Define if check succeeded. + +2002-08-28 Jakub Jelinek + + * locale/loadarchive.c (_nl_load_locale_from_archive): Add fd >= 0 + check to close_and_out close. Replace return NULL statements where + fd might be >= 0 with goto close_and_out. Close the file descriptor + when it is no longer needed. + +2002-08-28 Ulrich Drepper + + * sysdeps/s390/s390-64/dl-machine.h: Avoid unescaped newlines in + string constants. + * sysdeps/sparc/sparc32/dl-machine.h: Likewise. + * sysdeps/arm/dl-machine.h: Likewise. + * sysdeps/cris/dl-machine.h: Likewise. + * sysdeps/unix/sysv/linux/m68k/register-dump.h: Likewise. + * sysdeps/unix/sysv/aix/gettimeofday.c: Likewise. + +2002-08-28 Roland McGrath + + * Makeconfig (default_cflags): Revert unintended change. + +2002-08-28 Ulrich Drepper + + * version.h (VERSION): Bump to 2.2.91. + + * configure.in: Disable TLS support by default for now. + + * sysdeps/i386/fpu/libm-test-ulps: Adjust ulp for yn for float. + + * sysdeps/generic/strtol.c (strtol): Add some more casts to avoid + warnings. + + * stdlib/strtod.c (STRTOF): Correct type in cast of last patch. + + * stdlib/fmtmsg.c (fmtmsg): Use correct test for failure of + fprintf/fwprintf calls. + +2002-08-28 Roland McGrath + + * Makeconfig (run-program-prefix): Fix bogus use of $(findstring ...) + to use $(filter ...) instead. Same bug fixed in aix conditionals. + + * locale/setlocale.c: Declare postload functions weak. + + * elf/tst-tls1-static.c: New file. + * elf/tst-tls2-static.c: New file. + * elf/Makefile ($(tests-static):%=$(objfpx)%.o): Remove rule. + + Make uselocale support static linking. + * locale/xlocale.c: Revert changes putting _nl_global_locale here. + This file again just defines _nl_C_locobj. + (_nl_C_locobj): Use a categories.def iterator in the initializer. + * locale/global-locale.c: New file. Define _nl_global_locale here, + using all weak references in the initializer. + * locale/Makefile (aux): Add global-locale. + * locale/localeinfo.h (_nl_global_locale, _NL_CURRENT_LOCALE): Make + these unconditional, along with the tsd decl. + [!SHARED && HAVE___THREAD && HAVE_WEAK_SYMBOLS] (NL_CURRENT_INDIRECT): + Define it under these conditions. + [NL_CURRENT_INDIRECT]: Test this instead of [! SHARED]. + Don't declare _nl_current. Declare _nl_current_LC_FOO as + `extern __thread struct locale_data *const *'. + [NL_CURRENT_INDIRECT] + (_NL_CURRENT_DATA, _NL_CURRENT, _NL_CURRENT_WSTR): Add indirection. + [NL_CURRENT_INDIRECT] (_NL_CURRENT_DEFINE): Rewritten. Define + the thread variable _nl_current_LC_FOO and also a special absolute + symbol _nl_current_LC_FOO_used. + * locale/uselocale.c (__uselocale) [NL_CURRENT_INDIRECT]: + Set each _nl_current_LC_FOO symbol to point into the new locale, + using weak references to test if _nl_current_LC_FOO_used was linked in. + * locale/setlocale.c [! SHARED]: Replace this conditional ... + [NL_CURRENT_INDIRECT]: ... with this one. + (_nl_current, _nl_C): Variables removed. + [NL_CURRENT_INDIRECT] (_nl_current_used): New variable, table of + weak references to _nl_current_LC_FOO_used. + [NL_CURRENT_INDIRECT] (CATEGORY_USED): Define using that table. + (free_category): New function, broken out of ... + (free_mem): ... here. Call that. + (free_mem) [NL_CURRENT_INDIRECT]: Use a categories.def iterator + instead of a loop. + + * sysdeps/generic/libc-tls.c (__libc_setup_tls): Don't check for + PT_LOAD program headers and don't try to relocate PT_TLS's p_vaddr; + it is already absolute. + + * elf/Makefile (tests): List tst-tls1 and tst-tls2 unconditionally. + [$(build-static) = yes] (tests): Add tst-tls1-static, tst-tls2-static. + [$(build-static) = yes] (tests-static): New variable. + ($(tests-static):%=$(objfpx)%.o)): New static pattern rule. + +2002-08-26 Christoph Hellwig + + * sysdeps/unix/sysv/linux/sys/personality.h: Remark origin, fix + formating braindamage, add missing PER_HPUX and PER_OSF1 values. + +2002-08-28 Ulrich Drepper + + * sysdeps/x86_64/Dist: Add _mcount.S and bits/link.h. + + * sysdeps/s390/Dist: Add bits/link.h. + + * sysdeps/sh/Dist: New file. + + * sysdeps/ia64/Dist: Add ia64libgcc.S. + + * sysdeps/wordsize-32/Dist: New file. + + * sysdeps/unix/sysv/linux/alpha/Dist: Add dl-brk.S. + * sysdeps/unix/sysv/linux/powerpc/Dist: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/Dist: Likewise. + + * sysdeps/unix/sysv/linux/Dist: Add dl-brk.c, dl-sbrk.c, and + sys/personality.h. + + * sysdeps/unix/Dist: Add i386/dl-brk.S, mips/dl-brk.S, and + sparc/dl-brk.S. + + * sysdeps/unix/bsd/Dist: Add vax/dl-brk.S. + + * sysdeps/unix/bsd/sun/Dist: New file. + + * sysdeps/unix/bsd/osf/Dist: New file. + + * sysdeps/unix/bsd/hp/Dist: New file. + + * sysdeps/unix/arm/Dist: New file. + + * sysdeps/powerpc/Dist: Add divdi3.c and libgcc-compat.S. + + * sysdeps/mach/hurd/Dist: Add set-init.c. + + * sysdeps/i386/Dist: Add bits/link.h. + + * sysdeps/gnu/Dist: Add errlist-compat.c errlist-compat.awk. + + * sysdeps/generic/Dist: Add dl-brk.c and dl-sbrk.c. + + * locale/Makefile (distribute): Add hashval.h. + + * iconvdata/Makefile (distribute): Add tcvn5712-1.c and armscii-8.c. + + * sysdeps/unix/sysv/linux/Dist: Remove errlist.h. + + * misc/sys/cdefs.h: Define __BEGIN_NAMESPACE_STD, __END_NAMESPACE_STD, + __USING_NAMESPACE_STD, __BEGIN_NAMESPACE_C99, __END_NAMESPACE_C99, and + __USING_NAMESPACE_C99 depending on _GLIBCPP_USE_NAMESPACES. + * ctype/ctype.h: Prepare headers for use in ISO C++ compliant + implementations. + * libio/stdio.h: Likewise. + * locale/locale.h: Likewise. + * math/math.h: Likewise. + * math/bits/mathcalls.h: Likewise. + * setjmp/setjmp.h: Likewise. + * signal/signal.h: Likewise. + * stdlib/stdlib.h: Likewise. + * string/string.h: Likewise. + * time/time.h: Likewise. + * wcsmbs/wchar.h: Likewise. + * wctype/wctype.h: Likewise. + +2002-08-28 Roland McGrath + + * locale/tst-C-locale.c (run_test): Remove __ from function names. + +2002-08-28 Jakub Jelinek + Roland McGrath + + * locale/hashval.h (compute_hashval): Use prototype defn. + (hashval_t): New macro, defined to unsigned long int + if not already defined. + (compute_hashval): Return hashval_t instead of unsigned long int. + * locale/loadarchive.c (hashval_t): New macro. + * locale/programs/locarchive.c: Include hashval.h directly instead + of simple-hash.h. + (compute_hashval, hashval_t): Define these macros first. + (insert_name): Use archive_hashval instead of compute_hashval. + (add_locale, delete_locales_from_archive): Likewise. + +2002-08-28 Jakub Jelinek + + * locale/programs/locarchive.c (insert_name): Suppress warnings about + hash collisions if be_quiet. + +2002-08-27 Roland McGrath + + * locale/locale.h (__newlocale, __duplocale, __freelocale, + __uselocale): Don't declare these any more. + * include/locale.h (__uselocale): Declare here instead, using __typeof. + + * sysdeps/unix/readdir.c: If getdents fails with ENOENT, restore errno + and treat it as an EOF return. + * sysdeps/unix/readdir_r.c: Likewise. + + * sysdeps/gnu/errlist-compat.awk: Include in output. + From Alexandre Oliva . + * sysdeps/gnu/errlist-compat.c: Regenerated. + +2002-08-27 Brian Youmans <3diff@gnu.org> + + * sysdeps/ieee754/flt-32/e_asinf.c: Modified copying permission + wording at request of copyright holder Stephen Moshier. + * sysdeps/ieee754/ldbl-128/e_acosl.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_asinl.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_coshl.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_powl.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_sinhl.c: Likewise. + * sysdeps/ieee754/ldbl-128/k_tanl.c: Likewise. + * sysdeps/ieee754/ldbl-128/s_erfl.c: Likewise. + * sysdeps/ieee754/ldbl-96/e_asinl.c: Likewise. + * sysdeps/ieee754/ldbl-96/e_j0l.c: Likewise. + * sysdeps/ieee754/ldbl-96/e_j1l.c: Likewise. + * sysdeps/ieee754/ldbl-96/e_jnl.c: Likewise. + * sysdeps/ieee754/ldbl-96/e_lgammal_r.c: Likewise. + * sysdeps/ieee754/ldbl-96/s_erfl.c: Likewise. + +2002-08-28 Jakub Jelinek + + * ctype/ctype.h (isascii_l, toascii_l): Define to __*_l counterparts. + * ctype/ctype-extn.c (isblank_l): Add weak alias. + * sysdeps/generic/strtol_l.c (strtol_l): Likewise. + * sysdeps/generic/strtoll_l.c (strtoll_l): Likewise. + * sysdeps/generic/strtoul_l.c (strtoul_l): Likewise. + * sysdeps/generic/strtoull_l.c (strtoull_l): Likewise. + * wctype/iswctype_l.c (iswctype_l): Likewise. + +2002-08-27 Roland McGrath + + * time/strftime.c [USE_IN_EXTENDED_LOCALE_MODEL]: No libc_hidden_def. + + * ctype/ctype.h (__exctype_l): Don't declare __ name. + * stdlib/stdlib.h: Don't declare __*_l names. + * include/stdlib.h: Declare them here instead. + * include/string.h: Don't declare __*_l names. + * string/string.h: Declare them here instead. + * time/time.h: Don't declare __*_l names. + * include/time.h: Declare them here instead. + * wcsmbs/wchar.h: Don't declare __*_l names. + * include/wchar.h: Declare them here instead. + * wctype/wctype.h: Declare iswalnum_l, not __iswalnum_l. + Don't declare __*_l names. + * include/wctype.h: Declare them here instead. + * stdlib/monetary.h: Declare strfmon_l, not __strfmon_l. + * stdlib/strfmon_l.c (strfmon_l): Define as weak alias. + * locale/langinfo.h: Don't declare __nl_langinfo_l. + * include/langinfo.h: Declare it here with __typeof. + + * time/strptime.c [USE_IN_EXTENDED_LOCALE_MODEL]: Define __strptime_l + instead, taking an extra __locale_t argument. + * time/Makefile (routines): Add strptime_l. + * time/time.h (__strptime_l, strptime_l): Declare them. + * time/strptime_l.c: New file. + + * time/time.h (__strftime_l, strftime_l): Declare them. + * wcsmbs/wchar.h (__wcsftime_l, wcsftime_l): Declare them. + * time/strftime_l.c: New file. + * time/wcsftime_l.c: New file. + * time/Makefile (routines): Add strftime_l, wcsftime_l. + * time/Versions (libc: GLIBC_2.3): Add __strftime_l, __wcsftime_l, + strftime_l, wcsftime_l. + * time/strftime.c [USE_IN_EXTENDED_LOCALE_MODEL]: Define __strftime_l + or __wcsftime_l instead, taking an extra __locale_t argument. + + * locale/Versions (libc: GLIBC_PRIVATE): Move __uselocale to ... + (libc: GLIBC_2.3): ... here. + +2002-08-27 Ulrich Drepper + + * stdio-common/Makefile: Fix typo in stdio_lim.h installation rule. + + * Makefile (distribute): Add LICENSES. + + * sysdeps/unix/sysv/linux/x86_64/Dist: Add ucontext_i.h and + sys/debugreg.h. + + * sysdeps/unix/sysv/linux/s390/Dist: Add new/route.h. + + * sysdeps/unix/sysv/linux/ia64/Dist: Add dl-brk.S and sys/user.h. + + * sysdeps/unix/sysv/linux/mips/Dist: Add sys/user.h. + + * sysdeps/unix/sysv/linux/Dist: Add readahead.c. + + * sysdeps/mach/hurd/alpha/Dist: New file. + + * sysdeps/arm/Dist: Add bits/link.h. + + * sunrpc/Makefile: Distribute thrsvc. + + * stdio-common/Makefile: Remove more left-overs from old stdio. + + * include/linewrap.h: Removed. + + * libio/bug-mmap-fflush.c: Rewrite to not touch source directory. + + * intl/Makefile (distribute): Add plural-eval.c. + +2002-08-27 Roland McGrath + + * manual/sysinfo.texi (Mount Information): Correct file name to macro + assocations for _PATH_MNTTAB, MNTTAB, _PATH_MOUNTED, MOUNTED. + Say mtab is in either /var/run or /etc. + +2002-08-26 Roland McGrath + + * manual/errno.texi (Error Codes): Added ECANCELED (118 for Hurd). + * sysdeps/mach/hurd/bits/errno.h: Regenerated. + + * sysdeps/gnu/Versions: New file. + * sysdeps/unix/sysv/linux/Versions (libc: GLIBC_2.1): Remove + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; from here. + * sysdeps/gnu/Makefile ($(..)sysdeps/gnu/errlist-compat.c): New target. + ($(objpfx)errlist.d): Depend on $(..)sysdeps/gnu/errlist-compat.c. + * sysdeps/gnu/errlist.awk: Make output define _sys_errlist_internal + and _sys_nerr_internal instead of anything else. Make it include + "errlist-compat.c" if [!NOT_IN_libc && !ERRLIST_NO_COMPAT]. + Make it emit some asm magic if [EMIT_ERR_MAX]. + * sysdeps/gnu/errlist.c: Regenerated. + * sysdeps/gnu/errlist-compat.awk: New file. + * sysdeps/gnu/errlist-compat.c: New file (generated). + * sysdeps/mach/hurd/errlist.c (ERRLIST_NO_COMPAT): New macro. + (_sys_errlist_internal): Define this as a macro for _hurd_errlist. + (_sys_nerr_internal): Define this is a macro for _hurd_nerr. + (SYS_ERRLIST, SYS_NERR): Macros removed. + (sys_nerr, _sys_nerr): Remove these weak aliases. + * sysdeps/unix/sysv/linux/errlist.c: File removed. + * sysdeps/unix/sysv/linux/errlist.h: File removed. + * sysdeps/unix/sysv/linux/arm/errlist.c: File removed. + + * include/libc-symbols.h (declare_symbol): New macro. + * config.h.in (ASM_TYPE_DIRECTIVE_PREFIX): New #undef. + * configure.in: New check to define it. + * configure: Regenerated. + +2002-08-27 Ulrich Drepper + + * stdio-common/Makefile (headers): Remove bits/stdio_lim.h. This + file isn't distributed. Add special rules to install bits/stdio_lim.h. + + * Make-dist: Remove traces of old stdio. + * Makeconfig: Likewise. + + * locale/Makefile (localedef-aux): New variable. Only md5 + assigned to it. These files are not ddistributed in this directory. + + * sysdeps/unix/sysv/linux/s390/Dist: Add sys/procfs.h. + * sysdeps/unix/sysv/linux/s390/s390-64/Dist: Remove sys/procfs.h. + * sysdeps/unix/sysv/linux/s390/s390-32/Dist: Likewise. + + * sysdeps/unix/sysv/linux/Dist: Remove sys/sendfile.h. + + * nss/getXXbyYY_r.c (REENTRANT_NAME): If no service is available + set h_errno to NO_RECOVERY [PR libc/4360]. + +2002-08-26 Ulrich Drepper + + * libio/Makefile (tests): Add bug-fopena+. + * libio/bug-fopena+.c: New file. + * libio/fileops.c (_IO_file_open): Only set file pointer to end of the + file for _IO_IS_APPENDING if file isn't opened for reading, too. + + * stdio-common/tst-swprintf.c (main): Add casts to avoid warnings. + + * locale/xlocale.c: Fix the last change. The variable still has + to end in _data. + * sysdeps/generic/bits/libc-tsd.h [!(USE_TLS && HAVE___THREAD)] + (__libc_tsd_set): Add _data prefix to variable name. + +2002-08-26 Roland McGrath + + * sysdeps/generic/sigset-cvt-mask.h (sigset_set_old_mask): Replace + macro with inline function. + (sigset_get_old_mask): Likewise. + * sysdeps/posix/sigblock.c (__sigblock): Update callers. + * sysdeps/posix/sigsetmask.c (__sigsetmask): Likewise. + * sysdeps/posix/sigpause.c (__sigpause): Likewise. + * sysdeps/posix/sigvec.c (__sigvec, sigvec_wrapper_handler): Likewise. + * sysdeps/unix/sysv/aix/sigset-cvt-mask.h + (sigset_set_old_mask, sigset_get_old_mask): Make these macros return + values. + * sysdeps/unix/sysv/linux/sigset-cvt-mask.h: Likewise. + * sysdeps/unix/sysv/sysv4/sigset-cvt-mask.h: Likewise. + +2002-07-06 Bruno Haible + + * sysdeps/generic/sigset-cvt-mask.h (sigset_set_old_mask, + sigset_get_old_mask): Make it work with larger sigset_t. + * sysdeps/posix/sigblock.c (__sigblock): Use those macros. + * sysdeps/posix/sigsetmask.c (__sigsetmask): Likewise. + * sysdeps/posix/sigpause.c (__sigpause): Likewise. + +2002-08-26 Roland McGrath + + * time/sys/time.h [__USE_BSD] (lutimes, futimes): Declare them. + * manual/filesys.texi (File Times): Document lutimes and futimes. + * misc/Makefile (routines): Add them. + * misc/Versions (libc: GLIBC_2.3): Likewise. + * sysdeps/generic/lutimes.c: New file. + * sysdeps/generic/futimes.c: New file. + * sysdeps/mach/hurd/lutimes.c: New file. + * sysdeps/mach/hurd/futimes.c: New file. + + * manual/filesys.texi (File Times): Add explicit note about null + pointer argument to utimes. + +2002-08-26 Roland McGrath + + * sysdeps/mach/hurd/ifreq.h (__if_freereq): Add missing semicolon. + (__ifreq): Add a cast. Remove an unused variable. + + * hurd/hurd/threadvar.h (enum __hurd_threadvar_index): Add + _HURD_THREADVAR_LOCALE. + +2002-08-26 Jakub Jelinek + + * posix/regexec.c (re_search_stub): Return correct match length + if start != 0. + * posix/bug-regex10.c: New test. + * posix/Makefile (tests): Add bug-regex10. + +2002-08-26 Brian Youmans <3diff@gnu.org> + + * COPYING.LIB: Replaced with fresh copy from + ftp://ftp.gnu.org/gnu/Licenses/COPYING.LIB-2.1; + suggested copying permission notice now says version 2.1 instead + of version 2. + + * crypt/crypt.c: Changed copying permission notice to Lesser GPL + from Library GPL. + * crypt/crypt_util.c: Likewise. + * crypt/ufc.c: Likewise. + * elf/dl-conflict.c: Likewise. + * elf/dl-iteratephdr.c: Likewise. + * iconv/iconvconfig.h: Likewise. + * malloc/arena.c: Likewise. + * malloc/hooks.c: Likewise. + * malloc/malloc.c: Likewise. + * posix/glob/Makefile.ami: Likewise. + * posix/glob/Makefile.in: Likewise. + * stdlib/gmp-impl.h: Likewise. + * stdlib/gmp.h: Likewise. + * sysdeps/generic/dl-iteratephdr-static.c: Likewise. + * sysdeps/generic/strnlen.c: Likewise. + * sysdeps/mach/hurd/powerpc/bits/sigcontext.h: Likewise. + * sysdeps/mach/hurd/recvmsg.c: Likewise. + * sysdeps/mach/hurd/sendmsg.c: Likewise. + * sysdeps/mach/hurd/spawni.c: Likewise. + * sysdeps/mach/powerpc/machine-sp.h: Likewise. + * sysdeps/mach/powerpc/sysdep.h: Likewise. + * sysdeps/mach/powerpc/thread_state.h: Likewise. + * sysdeps/unix/bsd/bsd4.4/bits/socket.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/dl-iteratephdr-static.c: Likewise. + * sysdeps/x86_64/gmp-mparam.h: Likewise. + + * sysdeps/ieee754/dbl-64/MathLib.h: Corrected version number in + Lesser GPL copying permission notice from 2 to 2.1. + * sysdeps/ieee754/dbl-64/asincos.tbl: Likewise. + * sysdeps/ieee754/dbl-64/atnat.h: Likewise. + * sysdeps/ieee754/dbl-64/atnat2.h: Likewise. + * sysdeps/ieee754/dbl-64/branred.c: Likewise. + * sysdeps/ieee754/dbl-64/branred.h: Likewise. + * sysdeps/ieee754/dbl-64/dla.h: Likewise. + * sysdeps/ieee754/dbl-64/doasin.c: Likewise. + * sysdeps/ieee754/dbl-64/doasin.h: Likewise. + * sysdeps/ieee754/dbl-64/dosincos.c: Likewise. + * sysdeps/ieee754/dbl-64/dosincos.h: Likewise. + * sysdeps/ieee754/dbl-64/e_asin.c: Likewise. + * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise. + * sysdeps/ieee754/dbl-64/e_exp.c: Likewise. + * sysdeps/ieee754/dbl-64/e_log.c: Likewise. + * sysdeps/ieee754/dbl-64/e_pow.c: Likewise. + * sysdeps/ieee754/dbl-64/e_remainder.c: Likewise. + * sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise. + * sysdeps/ieee754/dbl-64/halfulp.c: Likewise. + * sysdeps/ieee754/dbl-64/mpa.c: Likewise. + * sysdeps/ieee754/dbl-64/mpa.h: Likewise. + * sysdeps/ieee754/dbl-64/mpa2.h: Likewise. + * sysdeps/ieee754/dbl-64/mpatan.c: Likewise. + * sysdeps/ieee754/dbl-64/mpatan.h: Likewise. + * sysdeps/ieee754/dbl-64/mpatan2.c: Likewise. + * sysdeps/ieee754/dbl-64/mpexp.c: Likewise. + * sysdeps/ieee754/dbl-64/mpexp.h: Likewise. + * sysdeps/ieee754/dbl-64/mplog.c: Likewise. + * sysdeps/ieee754/dbl-64/mplog.h: Likewise. + * sysdeps/ieee754/dbl-64/mpsqrt.c: Likewise. + * sysdeps/ieee754/dbl-64/mpsqrt.h: Likewise. + * sysdeps/ieee754/dbl-64/mptan.c: Likewise. + * sysdeps/ieee754/dbl-64/mydefs.h: Likewise. + * sysdeps/ieee754/dbl-64/powtwo.tbl: Likewise. + * sysdeps/ieee754/dbl-64/root.tbl: Likewise. + * sysdeps/ieee754/dbl-64/s_atan.c: Likewise. + * sysdeps/ieee754/dbl-64/s_sin.c: Likewise. + * sysdeps/ieee754/dbl-64/s_tan.c: Likewise. + * sysdeps/ieee754/dbl-64/sincos.tbl: Likewise. + * sysdeps/ieee754/dbl-64/sincos32.c: Likewise. + * sysdeps/ieee754/dbl-64/sincos32.h: Likewise. + * sysdeps/ieee754/dbl-64/slowexp.c: Likewise. + * sysdeps/ieee754/dbl-64/slowpow.c: Likewise. + * sysdeps/ieee754/dbl-64/uasncs.h: Likewise. + * sysdeps/ieee754/dbl-64/uatan.tbl: Likewise. + * sysdeps/ieee754/dbl-64/uexp.h: Likewise. + * sysdeps/ieee754/dbl-64/uexp.tbl: Likewise. + * sysdeps/ieee754/dbl-64/ulog.h: Likewise. + * sysdeps/ieee754/dbl-64/ulog.tbl: Likewise. + * sysdeps/ieee754/dbl-64/upow.h: Likewise. + * sysdeps/ieee754/dbl-64/upow.tbl: Likewise. + * sysdeps/ieee754/dbl-64/urem.h: Likewise. + * sysdeps/ieee754/dbl-64/uroot.h: Likewise. + * sysdeps/ieee754/dbl-64/usncs.h: Likewise. + * sysdeps/ieee754/dbl-64/utan.h: Likewise. + * sysdeps/ieee754/dbl-64/utan.tbl: Likewise. + + * sysdeps/ieee754/flt-32/e_asinf.c: Added copyright notice for Stephen + Moshier and Lesser GPL copying permission notice, per license from + Moshier. + * sysdeps/ieee754/ldbl-128/e_acosl.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_asinl.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_coshl.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_powl.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_sinhl.c: Likewise. + * sysdeps/ieee754/ldbl-128/k_tanl.c: Likewise. + * sysdeps/ieee754/ldbl-128/s_erfl.c: Likewise. + * sysdeps/ieee754/ldbl-96/e_asinl.c: Likewise. + * sysdeps/ieee754/ldbl-96/e_j0l.c: Likewise. + * sysdeps/ieee754/ldbl-96/e_j1l.c: Likewise. + * sysdeps/ieee754/ldbl-96/e_jnl.c: Likewise. + * sysdeps/ieee754/ldbl-96/e_lgammal_r.c: Likewise. + * sysdeps/ieee754/ldbl-96/s_erfl.c: Likewise. + + * sysdeps/ieee754/ldbl-128/e_j0l.c: Added Lesser GPL copying permission + notice, per license from copyright holder Stephen Moshier. + * sysdeps/ieee754/ldbl-128/e_j1l.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_lgammal_r.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_log10l.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_log2l.c: Likewise. + * sysdeps/ieee754/ldbl-128/e_logl.c: Likewise. + * sysdeps/ieee754/ldbl-128/s_atanl.c: Likewise. + * sysdeps/ieee754/ldbl-128/s_cbrtl.c: Likewise. + * sysdeps/ieee754/ldbl-128/s_expm1l.c: Likewise. + * sysdeps/ieee754/ldbl-128/s_log1pl.c: Likewise. + +2002-08-26 Kaz Kojima + + * sysdeps/sh/Makefile (sysdeps_routines): Add divdi3 in csu dir. + (shared-only-routines): Likewise. + +2002-08-26 Roland McGrath + + * locale/programs/ld-ctype.c (ctype_read): When given a repertoire + name of "", store a null pointer instead. + + * configure.in (elf): Set to yes for freebsd*, netbsd*. + * configure: Regenerated. + + * locale/xlocale.c [! (USE_TLS && HAVE___THREAD)] (__libc_tsd_LOCALE): + Initialize this instead of __libc_tsd_LOCALE_data. + + * sysdeps/unix/grantpt.c (pts_name): Convert ENOTTY return from + ptsname_r to EINVAL. + + * sysdeps/generic/ptsname.c (__ptsname_r): Return ENOSYS instead of 0. + + * rt/Makefile: Revert last change, it was inappropriate to presume aio + implementations depend on pthreads. + * rt/tst-aio.c (do_test): Exit happy if first failure is ENOSYS. + * rt/tst-aio64.c (do_test): Likewise. + * rt/tst-aio2.c (do_test): Likewise. + * rt/tst-aio3.c (do_test): Likewise. + * rt/tst-aio4.c (do_test): Likewise. + * rt/tst-aio5.c (do_test): Likewise. + * rt/tst-aio6.c (do_test): Likewise. + * rt/tst-aio7.c (do_test): Likewise. + + * sysdeps/generic/bits/libc-lock.h (__libc_setspecific): Use a cast to + void so as to avoid compiler warnings. + + * libio/oldstdfiles.c [! _IO_MTSAFE_IO] (DEF_STDFILE): Don't define + _IO_wide_data_FD, which is never used here. + + * libio/iofread.c + [! _IO_MTSAFE_IO] (fread_unlocked): Add libc_hidden_ver defn. + * libio/iofputs.c [! _IO_MTSAFE_IO] (fputs_unlocked): Likewise. + * libio/iofgets.c [! _IO_MTSAFE_IO] (fgets_unlocked): Likewise. + + * include/resolv.h [! _LIBC_REENTRANT] (_res): #undef it before decl. + * include/netdb.h [! _LIBC_REENTRANT] (h_errno): Declare normal extern. + + * misc/syslog.c (openlog): Conditionalize locking on [_LIBC_REENTRANT]. + (closelog): Likewise. + +2002-07-06 Bruno Haible + + * sysdeps/alpha/fpu/fpu_control.h: Comment fix. + + * sysdeps/unix/sysv/linux/alpha/pipe.S: Moved to ... + * sysdeps/unix/alpha/pipe.S: ... here. + * sysdeps/unix/bsd/osf/alpha/pipe.S: File removed. + + * sysdeps/unix/i386/brk.S: Rename local label to '.Lhere' in ELF. + + * sysdeps/unix/i386/brk.S: Add PSEUDO_END invocation. + * sysdeps/unix/i386/fork.S: Likewise. + * sysdeps/unix/i386/pipe.S: Likewise. + * sysdeps/unix/i386/wait.S: Likewise. + + * sysdeps/unix/fork.S: Fix PSEUDO_END argument. + * sysdeps/unix/arm/fork.S: Likewise. + + * sysdeps/unix/sysv/linux/arm/sysdep.h (PSEUDO): Swap DO_CALL + arguments. + (DO_CALL): Swap argument order. + * sysdeps/unix/sysv/linux/hppa/sysdep.h (PSEUDO): Swap DO_CALL + arguments. + (DO_CALL): Swap argument order. + * sysdeps/unix/sysv/linux/i386/sysdep.h (PSEUDO): Swap DO_CALL + arguments. + (DO_CALL): Swap argument order. + * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (PSEUDO): Swap DO_CALL + arguments. + (DO_CALL): Swap argument order. + * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (PSEUDO): Swap DO_CALL + arguments. + (DO_CALL): Swap argument order. + * sysdeps/unix/sysv/linux/sh/sysdep.h (PSEUDO): Swap DO_CALL + arguments. + (DO_CALL): Swap argument order. + * sysdeps/unix/sysv/linux/x86_64/sysdep.h (PSEUDO): Swap DO_CALL + arguments. + (DO_CALL): Swap argument order. + + * sysdeps/i386/sysdep.h (PSEUDO): Fix syntax error. + (L): Define right for ELF. + * sysdeps/unix/sysv/linux/i386/sysdep.h (L): Remove definition. + Now defined in sysdeps/i386/sysdep.h. + + * sysdeps/posix/readv.c: Ansify function definition. + * sysdeps/posix/writev.c: Likewise. + + * stdio-common/tst-fseek.c (main): Don't assume that off_t and size_t + have the same size. Avoid direct cast from size_t to off_t. + + * login/tst-utmp.c (simulate_login): Don't leave garbage after the + nul byte in entry[n].ut_user. + (simulate_logout): Likewise. + + * login/programs/utmpdump.c (print_entry): Test _HAVE_UT_TYPE, + _HAVE_UT_PID, _HAVE_UT_ID, _HAVE_UT_HOST, instead of assuming the + existence of corresponding members of 'struct utmp'. + * login/tst-utmp.c: Trivialize the test if testing 'struct utmp' and + !_HAVE_UT_TYPE. + + * sysdeps/unix/opendir.c (__opendir): If st_blksize is 0 or too small, + allocate a buffer of at least BUFSIZ bytes, not just of + sizeof (struct dirent). + + * sysdeps/generic/glob.c: Include . + (NAME_MAX): Define a fallback. + (glob_in_dir): Allocate enough room for a 'struct dirent64' on the + stack. + * posix/tst-dir.c: Include , for offsetof. + (main): Allocate enough room for a 'struct dirent64' on the stack. + * posix/tst-gnuglob.c (my_DIR): Allocate enough room for a + 'struct dirent'. + + * sysdeps/unix/sysv/linux/init-first.c: Don't include + kernel-features.h. + + * inet/htontest.c: Include . + + * sysdeps/generic/sys/sysinfo.h: Surround with __{BEGIN,END}_DECLS. + + * include/sys/sysctl.h: Comment fix. + + * elf/rtld.c (_rtld_global) [! _LIBC_REENTRANT]: Don't initialize + _dl_load_lock. + * libio/fileno.c (fileno_unlocked): Define regardless of _IO_MTSAFE_IO. + + * sysdeps/unix/bsd/bsd4.4/syscalls.list (__sigaltstack): New alias. + + * sysdeps/unix/inet/syscalls.list (__connect_internal): New alias. + (__getpeername): New alias. + (__getsockname): New alias. + (__socket): New alias. + + * sysdeps/unix/common/syscalls.list (getpgid): Remove. + + * sysdeps/unix/syscalls.list (__chown_internal): New alias. + (__fcntl_internal): New alias. + (__profil): New alias. + +2002-08-26 Ulrich Drepper + + * nscd/hstcache.c (cache_addhst): Add new parameter saying whether + entry was for getaddr* lookup or not. Add only matching cache + entry. Change all callers [PR libc/4317]. + + * libio/wfileops.c (_IO_wfile_seekoff): Set fp->_offset after + finding the read position [PR libc/4265]. + * libio/Makefile (tests): Add bug-rewind2. + * libio/bug-rewind2.c: New file. + + * libio/bug-rewind.c: Fix creation of temp file. + +2002-08-25 Ulrich Drepper + + * nss/getXXbyYY_r.c (REENTRANT_NAME): Return ENOENT if status is + neither SUCCESS nor TRYAGAIN [PR libc/4259]. + * nss/nss_files/files-XXX.c (internal_getent): Don't set *errnop + to ENOENT if no entry is found. + * nis/nss_compat/compat-grp.c: Don't set errno in case of lookup + failure. + * nis/nss_compat/compat-initgroups.c: Likewise. + * nis/nss_compat/compat-pwd.c: Likewise. + * nis/nss_compat/compat-spwd.c: Likewise. + * nis/nss_nis/nis-alias.c: Likewise. + * nis/nss_nis/nis-ethers.c: Likewise. + * nis/nss_nis/nis-grp.c: Likewise. + * nis/nss_nis/nis-hosts.c: Likewise. + * nis/nss_nis/nis-initgroups.c: Likewise. + * nis/nss_nis/nis-netgrp.c: Likewise. + * nis/nss_nis/nis-network.c: Likewise. + * nis/nss_nis/nis-proto.c: Likewise. + * nis/nss_nis/nis-publickey.c: Likewise. + * nis/nss_nis/nis-pwd.c: Likewise. + * nis/nss_nis/nis-rpc.c: Likewise. + * nis/nss_nis/nis-service.c: Likewise. + * nis/nss_nis/nis-spwd.c: Likewise. + * resolv/nss_dns/dns-host.c: Likewise. + * resolv/nss_dns/dns-network.c: Likewise. + * nis/nss_nisplus/nisplus-alias.c: Save errno around NIS calls. + * nis/nss_nisplus/nisplus-ethers.c: Likewise. + * nis/nss_nisplus/nisplus-grp.c: Likewise. + * nis/nss_nisplus/nisplus-hosts.c: Likewise. + * nis/nss_nisplus/nisplus-network.c: Likewise. + * nis/nss_nisplus/nisplus-proto.c: Likewise. + * nis/nss_nisplus/nisplus-pwd.c: Likewise. + * nis/nss_nisplus/nisplus-rpc.c: Likewise. + * nis/nss_nisplus/nisplus-service.c: Likewise. + * nis/nss_nisplus/nisplus-spwd.c: Likewise. + * hesiod/nss_hesiod/hesiod-pwd.c (lookup): Preserve errno value. + * hesiod/nss_hesiod/hesiod-proto.c (lookup): Likewise. + * hesiod/nss_hesiod/hesiod-grp.c (lookup): Likewise. + * hesiod/nss_hesiod/hesiod-service.c (lookup): Likewise. + + * sysdeps/unix/sysv/linux/i386/sigaction.c: Avoid warnings by + declaring __restore and __restore_rt as hidden (if possible). + +2002-08-25 Roland McGrath + + * manual/llio.texi (Access Modes): Fix typos in O_READ/O_WRITE defns. + + * sysdeps/generic/utmp_file.c (LOCK_FILE): Check for error from fcntl. + (getutent_r_file, internal_getut_r): Updated all callers. + (getutline_r_file, pututline_file, updwtmp_file): Likewise. + +2002-08-25 Ulrich Drepper + + * locale/programs/locale.c: Don't print aliases for non-existing + locales for 'locale -a'. + Patch by Noah Levitt [PR libc/4166]. + +2002-07-19 H.J. Lu + + * sysdeps/unix/sysv/linux/mips/bits/msq.h: New file. + +2002-07-16 H.J. Lu + + * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add + sys/personality.h. + * sysdeps/unix/sysv/linux/sys/personality.h: New file. + +2002-08-25 Ulrich Drepper + + * elf/tst-tlsmod1.c (in_dso): Make sure the TLS variable access is + not moved ahead of the fputs call. + * elf/tst-tlsmod2.c (in_dso): Likewise. + * elf/tst-tlsmod3.c (in_dso2): Likewise. + * elf/tst-tlsmod4.c (in_dso): Likewise. + +2002-08-25 Andreas Schwab + + * elf/dl-reloc.c (_dl_reloc_bad_type): Nul-terminate message. + +2002-08-25 Roland McGrath + + * sysdeps/generic/utmp_file.c (UNLOCK_FILE): Clear alarm before + resetting handler, to avoid the possibility of a spurious SIGALRM + delivered to the user's handler. + Reported by Amit D. Chaudhary , + + * misc/Makefile (CFLAGS-init-misc.c): Variable removed. It served to + set -fkeep-inline-functions, which is not needed for the current file. + + * sysdeps/generic/ldsodefs.h: Add attribute_hidden to *_internal decls. + (_dl_setup_hash): Add attribute_hidden. + (_dl_sysdep_start, _dl_sysdep_start_cleanup): Likewise. + (_dl_sysdep_read_whole_file, _dl_dprintf): Likewise. + (_dl_new_object, _dl_map_object_deps): Likewise. + (_dl_map_object_deps_internal): Remove decl. + * elf/rtld.c (__mempcpy, _exit): Redeclare locally as hidden. + + * sysdeps/i386/dl-machine.h [PI_STATIC_AND_HIDDEN + && HAVE_VISIBILITY_ATTRIBUTE && HAVE_HIDDEN + && !HAVE_BROKEN_VISIBILITY_ATTRIBUTE] + (elf_machine_dynamic, elf_machine_load_address): Rewritten without asm, + instead relying on the compiler to produce only GOTOFF variable refs. + +2002-08-25 Ulrich Drepper + + * elf/dl-load.c: Fix typo in comment. Add a few more __builtin_expect. + + * sysdeps/generic/dl-cache.h (_dl_cache_libcmp): Define as static + inline to avoid defining it in every file which includes this header. + + * elf/rtld.c: Also test for HAVE_VISIBILITY_ATTRIBUTE before + defining DONT_USE_BOOTSTRAP_MAP. + + * libio/tst-freopen.c (main): Use correct formats for __LINE__. + * libio/tst-mmap-setvbuf.c (main): Likewise. + * libio/tst-widetext.c (main): Likewise. + + * libio/tst-mmap-eofsync.c (do_test): Use correct format in error + message. + * libio/tst-mmap-fflushsync.c (do_test): Likewise. + * libio/tst-mmap2-eofsync.c (do_test): Likewise. + + * sysdeps/i386/elf/configure.in: Unconditionally define + PI_STATIC_AND_HIDDEN. + * elf/rtld.c (DONT_USE_BOOTSTRAP_MAP): Define only if + PI_STATIC_AND_HIDDEN is defined as well. + * config.h.in: Add PI_STATIC_AND_HIDDEN entry. + +2002-08-24 Ulrich Drepper + + * sysdeps/ia64/bzero.S: Define __bzero as well. + + * locale/programs/charmap.c (charmap_new_char): Don't use + ULONG_MAX as maximum UCS4 value. + + * sysdeps/unix/sysv/linux/ia64/sys/user.h: New file. + + * sysdeps/generic/strtol.c: We don't need the isascii test in glibc. + + * malloc/hooks.c (public_sET_STATe): use size_t as type for i. + * malloc/malloc.c (mALLINFo): Likewise. + + * libio/wstrops.c (_IO_wstr_pbackfail): Use WEOF in comparison. + + * libio/wfileops.c (_IO_wfile_overflow): Use EOF not WEOF when + examining result of _IO_do_flush call. + + * stdio-common/vfprintf.c (vfprintf): Use correct type in va_arg. + Use prec not spec when sizing buffers. + + * catgets/open_catalog.c (__open_catalog): Add casts to avoid warnings. + * locale/loadarchive.c (_nl_load_locale_from_archive): Likewise. + * locale/loadlocale.c (_nl_intern_locale_data): Likewise. + * stdio-common/vfscanf.c (inchar): Likewise. + * misc/efgcvt_r.c (fcvt_r): Likewise. + * elf/dl-misc.c (_dl_debug_vdprintf): Likewise. + * elf/readlib.c (process_file): Likewise. + * elf/sprof.c (load_profdata): Likewise. + * sysdeps/ia64/hp-timing.h (HP_TIMING_PRINT): Likewise. + * locale/programs/linereader.c (get_toplvl_escape): Likewise. + * locale/programs/charmap.c (charmap_read): Likewise. + * libio/fileops.c: Likewise. + * libio/fmemopen.c: Likewise. + * stdlib/strtod.c: Likewise. + * elf/dl-load.c: Likewise. + * iconv/iconvconfig.c: Likewise. + * iconv/iconv_prog.c (process_block): Likewise. + * elf/rtld.c (dl_main): Likewise. + + * sysdeps/unix/sysv/linux/ia64/Makefile: Define _ASM_IA64_CURRENT_H + macro to calm down the compiler. + + * iconv/gconv_cache.c (__gconv_load_cache): Add cast to avoid warning. + + * sysdeps/ia64/elf/initfini.c: Don't use newlines embedded in string. + + * sysdeps/unix/sysv/linux/i386/sysdep.S: Update comment regarding + placement of errno definition. + * sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/mips/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise. + + * resolv/nss_dns/dns-host.c (MAXPACKET): Increase minimum value + from 1024 to 65536, to avoid buffer overrun. + +2002-08-16 Paul Eggert + + * resolv/gethnamaddr.c (MAXPACKET): Increase minimum value + from 1024 to 65536, to avoid buffer overrun. + * resolv/res_query.c (MAXPACKET): Likewise. + +2002-08-24 Andreas Jaeger + + * sysdeps/unix/sysv/linux/i386/Versions: Remove *xattr syscalls. + +2002-08-23 Ulrich Drepper + + * sysdeps/ieee754/dbl-64/e_pow.c (log1): Define and initialize + two52 locally. + (log2): Likewise. + * sysdeps/ieee754/dbl-64/upow.h: Remove definition of two52. + Patch by Simon Gee . + + * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs_conf): + Prefer reading /proc/stat since it is more uniform across + architectures. + + * manual/texinfo.tex: Update to latest official version. + + * sysvipc/sys/shm.h: Remove SHMLBA definition. + * sysdeps/generic/bits/shm.h: Define SHMLBA here. + * sysdeps/gnu/bits/shm.h: Likewise. + * sysdeps/unix/sysv/linux/alpha/bits/shm.h: Likewise. + * sysdeps/unix/sysv/linux/bits/shm.h: Likewise. + * sysdeps/unix/sysv/linux/mips/bits/shm.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/bits/shm.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/bits/shm.h: Likewise. + * sysdeps/unix/sysv/linux/s390/bits/shm.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/bits/shm.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/bits/shm.h: Define SHMLBA to 2^20 + since this is what the kernel says. + + * misc/sys/xattr.h: Include instead of + since ssize_t is needed as well. Replace const with __const. + +2002-08-23 Roland McGrath + + * malloc/hooks.c (__malloc_initialize_hook, __free_hook, + __malloc_hook, __realloc_hook, __memalign_hook, + __after_morecore_hook): Variable definitions moved to ... + * malloc/malloc.c: ... here, so as to be before all references. + + * sysdeps/i386/dl-machine.h (elf_machine_load_address): Add a dummy + global variable reference in an unused asm parameter, to ensure the + compiler has set up the GOT register before we use it. + + * malloc/hooks.c: Move variable definitions ahead of uses. + * libio/fileops.c: Move versioned_symbol defns ahead of _IO_jump_t + initializers that make reference to variables they define. + +2002-08-23 Andreas Jaeger + + * locale/loadarchive.c: Include for prototypes of + alloca, free, qsort. + + * dlfcn/bug-dlsym1-lib1.c (foo): Add prototype to avoid warning. + + * sysdeps/ieee754/flt-32/e_jnf.c: Remove unused variable. + * sysdeps/ieee754/ldbl-96/e_j0l.c: Likewise. + + * misc/sys/xattr.h: New file, contributed by Christoph Hellwig + . + * sysdeps/generic/fgetxattr.c: New file. + * sysdeps/generic/flistxattr.c: New file. + * sysdeps/generic/fremovexattr.c: New file. + * sysdeps/generic/fsetxattr.c: New file. + * sysdeps/generic/getxattr.c: New file. + * sysdeps/generic/listxattr.c: New file. + * sysdeps/generic/lgetxattr.c: New file. + * sysdeps/generic/llistxattr.c: New file. + * sysdeps/generic/lremovexattr.c: New file. + * sysdeps/generic/lsetxattr.c: New file. + * sysdeps/generic/removexattr.c: New file. + * sysdeps/generic/setxattr.c: New file. + * misc/Makefile (headers): Add sys/xattr.h. + (routines): Add *xattr calls. + * misc/Versions: Add *xattr calls with version 2.3. + * sysdeps/unix/sysv/linux/m68k/Versions: Remove *xattr syscalls. + * sysdeps/unix/sysv/linux/s390/s390-32/Versions: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/Versions: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: Likewise. + * sysdeps/unix/sysv/linux/x86_64/Versions: Likewise. + * sysdeps/unix/sysv/linux/ia64/Versions: Likewise. + * sysdeps/unix/sysv/linux/alpha/Versions: Likewise. + * sysdeps/unix/sysv/linux/arm/Versions: Likewise. + +2002-08-22 Steven Munroe + + * sysdeps/powerpc/elf/libc-start.c + (__cache_line_size): Declare. + (__aux_init_cache): New function. + (__libc_start_main): Change type of `auxvec' parameter to + `ElfW(auxv_t) *'. Correct walking of aux vector. Call + __aux_init_cache. + * sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c + (__cache_line_size): Declare. + (__aux_init_cache): New function. + (DL_PLATFORM_INIT): Define. + * sysdeps/powerpc/memset.S: Define __cache_line_size and use its + value to select the correct stride for dcbz. + +2002-08-22 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Fix arguments of + shmat. + +2002-08-22 Roland McGrath + + * locale/loadarchive.c (_nl_load_locale_from_archive): Check max file + position indicated by locrectab against file bounds before rounding to + page size. In mapping loop, always set TO before breaking out of + contiguous range coalescing loop. + + * locale/loadarchive.c (_nl_load_locale_from_archive): Use MAP_PRIVATE + (or MAP_COPY if available) instead of MAP_SHARED. + + * scripts/firstversions.awk: When encountering a version newer than + the specified earliest version, be sure to emit the specified earliest + version first if any renaming of an older version to that has been. + +2002-08-21 Roland McGrath + + * configure.in: Make GCC version check require 3.[2-9]* and no others. + * manual/install.texi (Tools for Compilation): Say 3.2 is required. + (Configuring and compiling): Don't mention older GCC versions any more. + * INSTALL: Regenerated. + + * manual/install.texi (Configuring and compiling, Installation, + Running make install, Linux): Linux -> GNU/Linux where appropriate. + + * elf/rtld.c (_dl_start_final): Move defn before _dl_start so it can + be inlined. Declare it with always_inline if [DONT_USE_BOOTSTRAP_MAP] + and with noinline otherwise. Remove hack alloca use to prevent + inlining, we can ask for it explicitly nowadays. + + * dlfcn/bug-dlsym1.c: New file. + * dlfcn/bug-dlsym1-lib1.c, dlfcn/bug-dlsym1-lib2.c: New files. + * dlfcn/Makefile (distribute): Add them. + (tests): Add bug-dlsym1 here. + (modules-names): Add bug-dlsym1-lib1 and bug-dlsym1-lib2 here. + ($(objpfx)bug-dlsym1, $(objpfx)bug-dlsym1.out): New targets. + ($(objpfx)bug-dlsym1-lib1.so, $(objpfx)bug-dlsym1-lib2.so): Likewise. + +2002-08-21 Ulrich Drepper + + * elf/rtld.c (start_time): New global variable. Moved from _dl_start. + (DONT_USE_BOOTSTRAP_MAP): Define if we can use non-exported symbols + before relocation. + (_dl_start): Don't use local bootstrap_map variable if + DONT_USE_BOOTSTRAP_MAP is defined. Use GL(dl_rtld_map). Don't + pass bootstrap_map to _dl_start_final in this case either. Don't + pass start_time to _dl_start_final ever. + (_dl_start_final): Don't copy bootstrap_map if DONT_USE_BOOTSTRAP_MAP. + + * elf/dl-deps.c (_dl_map_object_deps): Revert patch from 2002-05-28. + This cripples the scope lists necessary to search for symbols in + dependencies which are not in the global scope. + + * include/setjmp.h (__libc_longjmp): Add declaration. + +2002-08-21 Andreas Jaeger + + * sysdeps/x86_64/_mcount.S: Fix assembler. + + * sysdeps/unix/sysv/linux/x86_64/Makefile: Generate bits/syscall.h + with biarch support. + +2002-08-21 Andreas Jaeger + + * sysdeps/x86_64/sysdep.h (CALL_MCOUNT): Fix it. + + * sysdeps/x86_64/Makefile (sysdep_routines): Add _mcount. + + * sysdeps/x86_64/machine-gmon.h: New file. + * sysdeps/x86_64/_mcount.S: New file. + +2002-08-20 Ulrich Drepper + + * elf/rtld.c (_dl_start): Pass zero to TLS_INIT_TP. Set + bootstrap_map.l_tls_tp_initialized to 1 if TLS_INIT_TP was called. + (_dl_start_final): Copy l_tls_tp_initialized to GL(dl_rtld_map). + (dl_main): If HAVE___THREAD is not defined pass l_tls_tp_initialized + to TL_INIT_TP. Otherwise pass 1. + * include/link.h (struct link_map): Add l_tls_tp_initialized. + * sysdeps/generic/libc-tls.c (__libc_setup_tls): Pass 0 to TL_INIT_TP. + +2002-08-15 Jakub Jelinek + + * locale/programs/localedef.c (add_to_readlist): Error about + circular dependencies only if the locale in question hasn't + been finished. + * locale/programs/linereader.c (get_string): Pass LC_CTYPE not + CTYPE_LOCALE to load_locale. + * locale/programs/locfile.c (locfile_read): Don't include + unneeded but available locales in locale_mask. + + * locale/programs/locarchive.c (enlarge_archive): If quiet, don't + print any messages about enlarging archive. + +2002-08-20 Brian Youmans <3diff@gnu.org> + + * manual/contrib.texi: Removed licenses, added acknowledgements + for contributions by Intel, IBM, Craig Metz. + * LICENSES: New file, contains the text of all non-FSF licenses in the + distribution that require putting the notice in the accompanying + documentation. + * README.template, README: Mention LICENSES. + + * sysdeps/mach/hurd/net/if_ppp.h: Replaced CMU license with a + new one modelled on the modern BSD license, per recent letter + of permission from CMU. + * sysdeps/unix/sysv/linux/net/if_ppp.h: Likewise. + + * sysdeps/ieee754/dbl-64/MathLib.h: Changed the copyright holder + from IBM to FSF, per the recent Software Letter. Changed the + distribution terms from GPL to LGPL. + + * sysdeps/ieee754/dbl-64/asincos.tbl: Added FSF copyright and + copying permission notice (Lesser GPL), per recent IBM Software Letter. + * sysdeps/ieee754/dbl-64/powtwo.tbl: Likewise. + * sysdeps/ieee754/dbl-64/root.tbl: Likewise. + * sysdeps/ieee754/dbl-64/sincos.tbl: Likewise. + * sysdeps/ieee754/dbl-64/uatan.tbl: Likewise. + * sysdeps/ieee754/dbl-64/uexp.tbl: Likewise. + * sysdeps/ieee754/dbl-64/ulog.tbl: Likewise. + * sysdeps/ieee754/dbl-64/upow.tbl: Likewise. + * sysdeps/ieee754/dbl-64/utan.tbl: Likewise. + + * sysdeps/ieee754/dbl-64/atnat.h: Changed the copyright holder + from IBM to FSF, per the recent Software Letter. Corrected the + text of the copying permission notice to say Lesser GPL instead + of GPL in warranty disclaimer paragraph. + * sysdeps/ieee754/dbl-64/atnat2.h: Likewise. + * sysdeps/ieee754/dbl-64/branred.h: Likewise. + * sysdeps/ieee754/dbl-64/dla.h: Likewise. + * sysdeps/ieee754/dbl-64/doasin.h: Likewise. + * sysdeps/ieee754/dbl-64/dosincos.h: Likewise. + * sysdeps/ieee754/dbl-64/mpa.h: Likewise. + * sysdeps/ieee754/dbl-64/mpa2.h: Likewise. + * sysdeps/ieee754/dbl-64/mpatan.h: Likewise. + * sysdeps/ieee754/dbl-64/mpexp.h: Likewise. + * sysdeps/ieee754/dbl-64/mplog.h: Likewise. + * sysdeps/ieee754/dbl-64/mpsqrt.h: Likewise. + * sysdeps/ieee754/dbl-64/mydefs.h: Likewise. + * sysdeps/ieee754/dbl-64/sincos32.h: Likewise. + * sysdeps/ieee754/dbl-64/uasncs.h: Likewise. + * sysdeps/ieee754/dbl-64/uexp.h: Likewise. + * sysdeps/ieee754/dbl-64/ulog.h: Likewise. + * sysdeps/ieee754/dbl-64/upow.h: Likewise. + * sysdeps/ieee754/dbl-64/urem.h: Likewise. + * sysdeps/ieee754/dbl-64/uroot.h: Likewise. + * sysdeps/ieee754/dbl-64/usncs.h: Likewise. + * sysdeps/ieee754/dbl-64/utan.h: Likewise. + + * sysdeps/ieee754/dbl-64/branred.c: Corrected the text of the copying + permission notice to say Lesser GPL instead of GPL in warranty + disclaimer paragraph. + * sysdeps/ieee754/dbl-64/doasin.c: Likewise. + * sysdeps/ieee754/dbl-64/dosincos.c: Likewise. + * sysdeps/ieee754/dbl-64/e_asin.c: Likewise. + * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise. + * sysdeps/ieee754/dbl-64/e_exp.c: Likewise. + * sysdeps/ieee754/dbl-64/e_log.c: Likewise. + * sysdeps/ieee754/dbl-64/e_pow.c: Likewise. + * sysdeps/ieee754/dbl-64/e_remainder.c: Likewise. + * sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise. + * sysdeps/ieee754/dbl-64/halfulp.c: Likewise. + * sysdeps/ieee754/dbl-64/mpa.c: Likewise. + * sysdeps/ieee754/dbl-64/mpatan.c: Likewise. + * sysdeps/ieee754/dbl-64/mpatan2.c: Likewise. + * sysdeps/ieee754/dbl-64/mpexp.c: Likewise. + * sysdeps/ieee754/dbl-64/mplog.c: Likewise. + * sysdeps/ieee754/dbl-64/mpsqrt.c: Likewise. + * sysdeps/ieee754/dbl-64/mptan.c: Likewise. + * sysdeps/ieee754/dbl-64/s_atan.c: Likewise. + * sysdeps/ieee754/dbl-64/s_sin.c: Likewise. + * sysdeps/ieee754/dbl-64/s_tan.c: Likewise. + * sysdeps/ieee754/dbl-64/sincos32.c: Likewise. + * sysdeps/ieee754/dbl-64/slowexp.c: Likewise. + * sysdeps/ieee754/dbl-64/slowpow.c: Likewise. + +2002-08-20 Roland McGrath + + Fix ABI compatibility with libc compiled with old tools on powerpc. + Changes contributed by Franz Sirl + and Jack Howarth . + * sysdeps/powerpc/Makefile [$(have-protected) = yes] + (CPPFLAGS-divdi3.c, CPPFLAGS-libgcc-compat.S): New variables, + pass -DHAVE_DOT_HIDDEN for these files. + * sysdeps/powerpc/Versions (libc: GLIBC_2.0): Added __floatdidf, + __floatdisf. + * sysdeps/powerpc/divdi3.c: New file. + * sysdeps/powerpc/libgcc-compat.S: New file, replacement for ... + * sysdeps/powerpc/libgcc-compat.c: ... this, file removed. + +2002-08-20 Jakub Jelinek + + * locale/loadarchive.c (_nl_load_locale_from_archive): Handle + partially overlapping mappings. Remove unneeded (char *) casts. + Never allow duplication of ranges in mapped areas. + +2002-08-20 Roland McGrath + + * elf/Makefile ($(objpfx)ld.so): Separate commands in rule so errors + can be detected by make. Reported by H.J. Lu . + +2002-08-20 Ulrich Drepper + + * include/unistd.h: Don't hide _exit. + + * elf/rtld.c (_dl_start): Pass extra argument 1 to TLS_INIT_TP. + (dl_main): Pass extra argument 0 to TLS_INIT_TP. + * sysdeps/generic/libc-tls.c (__libc_setup_tls): Pass extra + argument 1 to TLS_INIT_TP. + * sysdeps/generic/tls.h (TLS_INIT_TP): Describe new parameter. + + * sysdeps/generic/dl-tls.c (allocate_dtv): Optimize a bit. + + * elf/Versions [ld] (GLIBC_PRIVATE): Add _dl_get_tls_static_info. + * sysdeps/generic/dl-tls.c (_dl_allocate_tls_storage): Move dtv + memory allocation to... + (allocate_dtv): ...here. New function. + (_dl_allocate_tls): Change to take parameter. If parameter is non-NULL + call allocate_dtv instead of _dl_allocate_tls_storage. + (_dl_deallocate_tls): New parameter. Deallocate TCB only if true. + (_dl_get_tls_static_info): New function. + * sysdeps/generic/ldsodefs.h: Adjust prototypes of _dl_allocate_tls + and _dl_deallocate_tls. Add prototype for _dl_get_tls_static_info. + +2002-08-19 Ulrich Drepper + + * sysdeps/generic/dl-tls.c (_dl_allocate_tls_init): Return + immediately if result == NULL. + +2002-08-16 Jakub Jelinek + + * sysdeps/alpha/fpu/libm-test-ulps: Regenerate. + +2002-08-18 Roland McGrath + + * sysdeps/mach/hurd/mkdir.c (__mkdir): Use __directory_name_split + instead of __file_name_split. + * sysdeps/mach/hurd/unlink.c (__unlink): Likewise. + + * sysdeps/mach/hurd/dl-sysdep.c + [HP_TIMING_AVAIL] (_dl_cpuclock_offset): New variable. + [HP_TIMING_AVAIL] (_dl_sysdep_start): Set it with HP_TIMING_NOW. + +2002-08-16 Jakub Jelinek + + * locale/loadarchive.c (_nl_load_locale_from_archive): Braino fix + in change before last: MAX -> MIN. + +2002-08-15 Roland McGrath + + * libio/fileops.c (_IO_file_seekoff_mmap): Leave read pointers at EOF + if seek would go past it. + (mmap_remap_check): If file position is at or past EOF after check, + leave read pointers at EOF and don't seek. + + * libio/tst-mmap-offend.c: New file. + * libio/Makefile (tests): Add it. + + * locale/loadarchive.c (_nl_load_locale_from_archive): Store strdup of + the name as passed, rather than the name in the archive dictionary. + +2002-08-15 Ulrich Drepper + + * csu/Makefile: Define elide-routines.os not static-only-routines. + + * include/sched.h (__clone): Add varargs at the end. + + * elf/rtld.c (_dl_start): Allow TLS_INIT_TP to fail, and stop in that + case. + (TLS_INIT_HELPER): If defined, use it. + * sysdeps/generic/libc-tls.c (TLS_INIT_HELPER): Likewise. + +2002-08-15 Roland McGrath + + * elf/dl-load.c (lose): Remove [!SHARED] conditional from null check + on L->l_prev; it can happen under rtld --verify too. + + * locale/loadarchive.c (_nl_load_locale_from_archive): Don't read the + header separately, just map an initial window of 2MB from the file + and remap if that is not large enough to cover the whole header. + +2002-08-15 Andreas Jaeger + + * sysdeps/unix/sysv/linux/m68k/Versions: Add *xattr syscalls with + version 2.3. + * sysdeps/unix/sysv/linux/arm/Versions: Likewise. + * sysdeps/unix/sysv/linux/alpha/Versions: Likewise. + * sysdeps/unix/sysv/linux/ia64/Versions: Likewise. + * sysdeps/unix/sysv/linux/x86_64/Versions: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/Versions: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/Versions: Likewise. + * sysdeps/unix/sysv/linux/powerpc/Versions: Likewise. + * sysdeps/unix/sysv/linux/mips/Versions: Likewise. + Patch by Andreas Gruenbacher . + + * sysdeps/unix/sysv/linux/syscalls.list: Add *xattr syscalls. + +2002-08-14 Roland McGrath + + * locale/locarchive.h (struct locale_category_data): Give this name to + the type of locale_data_t's elements. + * locale/programs/locarchive.c (cmpcategorysize): New static function. + (add_locale): Use that to sort the categories by size and put all + those that fit into two pages into the LC_ALL block, instead of + hard-coding it to do everything but LC_CTYPE and LC_COLLATE. + (show_archive_content): Detect categories inside LC_ALL block + directly, instead of hard-coding. + (oldlocrecentcmp): Compare just on file locations used. + +2002-08-14 Jakub Jelinek + + * locale/programs/locarchive.c (struct oldlocrecent): New type. + (oldlocrecentcmp): New function. + (enlarge_archive): Re-add locales in the order they were added + to the archive. + (add_locale): Put all the small locale files together, if the small + locale file block would occupy less pages if page size aligned, align + it. + (show_archive_content): Adjust for locale archives optimized for speed. + +2002-08-14 Roland McGrath + + * configure.in: Use "MISSING" as not-found value for MIG. + * sysdeps/mach/configure.in: Fatal if mig not found. + * configure, sysdeps/mach/configure: Regenerated. + +2002-08-13 Jakub Jelinek + + * locale/loadarchive.c (archfname): Add missing slash. + + * sysdeps/generic/strtold.c (__strtold_internal): Add libc_hidden_def. + * wcsmbs/wcstold.c (__wcstold_internal): Add libc_hidden_def. + +2002-08-12 Roland McGrath + + * include/sys/wait.h (__waitpid): Add libc_hidden_proto. + * sysdeps/unix/sysv/sco3.2.4/waitpid.S: Add libc_hidden_def. + * sysdeps/unix/sysv/sysv4/waitpid.c: Add libc_hidden_weak. + * sysdeps/unix/sysv/linux/waitpid.c: Likewise. + * sysdeps/unix/sysv/aix/waitpid.c: Likewise. + * sysdeps/unix/bsd/bsd4.4/waitpid.c: Likewise. + * sysdeps/generic/waitpid.c: Likewise. + + * include/net/if.h: New file. Use libc_hidden_proto + for if_nametoindex and if_indextoname. + * sysdeps/generic/if_index.c: Add libc_hidden_def. + * sysdeps/mach/hurd/if_index.c: Likewise. + * sysdeps/unix/sysv/linux/if_index.c: Likewise. + + * include/grp.h (setgroups): Add libc_hidden_proto. + * sysdeps/generic/setgroups.c: Add libc_hidden_def. + * sysdeps/mach/hurd/setgroups.c: Likewise. + * sysdeps/unix/sysv/irix4/setgroups.c: Likewise. + * sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise. + +2002-08-13 Jakub Jelinek + + * include/unistd.h (seteuid, setegid): Add libc_hidden_proto. + * sysdeps/generic/seteuid.c (seteuid): Add libc_hidden_def. + * sysdeps/generic/setegid.c (setegid): Likewise. + * sysdeps/mach/hurd/seteuid.c (seteuid): Likewise. + * sysdeps/mach/hurd/setegid.c (setegid): Likewise. + * sysdeps/unix/bsd/seteuid.c (seteuid): Likewise. + * sysdeps/unix/bsd/setegid.c (setegid): Likewise. + * sysdeps/unix/sysv/aix/seteuid.c (seteuid): Likewise. + * sysdeps/unix/sysv/aix/setegid.c (setegid): Likewise. + * sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c (seteuid): Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c (setegid): Likewise. + * sysdeps/unix/sysv/linux/seteuid.c (seteuid): Likewise. + * sysdeps/unix/sysv/linux/setegid.c (setegid): Likewise. + * sysdeps/unix/sysv/linux/i386/seteuid.c (seteuid): Likewise. + Remove fallback if __ASSUME_SETRESUID_SYSCALL. + + * include/sys/stat.h (__fxstat_internal, __fxstat64_internal, + __lxstat_internal, __lxstat64_internal): Remove. + (__fxstat, __fxstat64, __lxstat, __lxstat64, __xstat, __xstat64): + Add hidden_proto. + * sysdeps/generic/fxstat.c (__fxstat): Add hidden_def. + Remove INTDEF where present, remove #undef at the beginning. + * sysdeps/generic/fxstat64.c (__fxstat64): Likewise. + * sysdeps/generic/lxstat.c (__lxstat): Likewise. + * sysdeps/generic/lxstat64.c (__lxstat64): Likewise. + * sysdeps/generic/xstat.c (__xstat): Likewise. + * sysdeps/generic/xstat64.c (__xstat64): Likewise. + * sysdeps/mach/hurd/dl-sysdep.c (__xstat64, __fxstat64): Likewise. + * sysdeps/mach/hurd/fxstat.c (__fxstat): Likewise. + * sysdeps/mach/hurd/fxstat64.c (__fxstat64): Likewise. + * sysdeps/mach/hurd/lxstat.c (__lxstat): Likewise. + * sysdeps/mach/hurd/lxstat64.c (__lxstat64): Likewise. + * sysdeps/mach/hurd/xstat.c (__xstat): Likewise. + * sysdeps/mach/hurd/xstat64.c (__xstat64): Likewise. + * sysdeps/unix/fxstat.c (__fxstat): Likewise. + * sysdeps/unix/common/lxstat.c (__lxstat): Likewise. + * sysdeps/unix/sysv/aix/fxstat.c (__fxstat): Likewise. + * sysdeps/unix/sysv/aix/fxstat64.c (__fxstat64): Likewise. + * sysdeps/unix/sysv/aix/lxstat.c (__lxstat): Likewise. + * sysdeps/unix/sysv/aix/lxstat64.c (__lxstat64): Likewise. + * sysdeps/unix/sysv/aix/xstat.c (__xstat): Likewise. + * sysdeps/unix/sysv/aix/xstat64.c (__xstat64): Likewise. + * sysdeps/unix/sysv/linux/ia64/fxstat.c (__fxstat): Likewise. + * sysdeps/unix/sysv/linux/ia64/lxstat.c (__lxstat): Likewise. + * sysdeps/unix/sysv/linux/ia64/xstat.c (__xstat): Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/fxstat.c (__fxstat): Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/lxstat.c (__lxstat): Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/xstat.c (__xstat): Likewise. + * sysdeps/unix/sysv/linux/i386/fxstat.c (__fxstat): Likewise. + * sysdeps/unix/sysv/linux/i386/lxstat.c (__lxstat): Likewise. + * sysdeps/unix/sysv/linux/i386/xstat.c (__xstat): Likewise. + * sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise. + * sysdeps/unix/sysv/linux/xstat64.c (__xstat64): Likewise. + * sysdeps/unix/sysv/linux/fxstat.c (__fxstat): Likewise. + * sysdeps/unix/sysv/linux/fxstat64.c (__fxstat64): Likewise. + * sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise. + * sysdeps/unix/sysv/linux/lxstat64.c (__lxstat64): Likewise. + * sysdeps/unix/xstat.c (__xstat): Likewise. + + * include/sys/statvfs.h (statvfs, fstatvfs): Add libc_hidden_proto. + * sysdeps/generic/statvfs.c (statvfs): Add libc_hidden_def. + * sysdeps/generic/fstatvfs.c (fstatvfs): Likewise. + * sysdeps/mach/hurd/statvfs.c (statvfs): Likewise. + * sysdeps/mach/hurd/fstatvfs.c (fstatvfs): Likewise. + * sysdeps/unix/sysv/linux/statvfs.c (statvfs): Likewise. + * sysdeps/unix/sysv/linux/fstatvfs.c (fstatvfs): Likewise. + + * include/unistd.h (tcgetpgrp): Add libc_hidden_proto. + * include/termios.h (tcsetattr, cfsetispeed, cfsetospeed): Likewise. + * sysdeps/generic/tcgetpgrp.c (tcgetpgrp): Add libc_hidden_def. + * sysdeps/generic/tcsetattr.c (tcsetattr): Likewise. + * sysdeps/generic/speed.c (cfsetispeed, cfsetospeed): Likewise. + * sysdeps/unix/bsd/bsd4.4/tcsetattr.c (tcgetpgrp): Likewise. + * sysdeps/unix/bsd/sun/sunos4/tcsetattr.c (tcsetattr): Likewise. + * sysdeps/unix/bsd/sun/sunos4/speed.c (cfsetispeed, cfsetospeed): + Likewise. + * sysdeps/unix/bsd/tcgetpgrp.c (tcgetpgrp): Likewise. + * sysdeps/unix/bsd/tcsetattr.c (tcsetattr): Likewise. + * sysdeps/unix/sysv/aix/tcsetattr.c (tcsetattr): Likewise. + * sysdeps/unix/sysv/aix/speed.c (cfsetispeed, cfsetospeed): Likewise. + * sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise. + * sysdeps/unix/sysv/linux/speed.c (cfsetispeed, cfsetospeed): Likewise. + * sysdeps/unix/sysv/tcgetpgrp.c (tcgetpgrp): Likewise. + * sysdeps/unix/sysv/tcsetattr.c (tcsetattr): Likewise. + + * include/string.h (strcoll): Add libc_hidden_proto. + * string/strcoll.c (strcoll): Add libc_hidden_def. + + * misc/err.c (vwarn): Fix pasto in libc_hidden_def. + +2002-08-11 Philip Blundell + + * sysdeps/arm/Makefile: New file. + +2002-08-08 Jakub Jelinek + + * posix/regcomp.c (parse_reg_exp): If '|' is immediately followed + by another '|', end of regex or enclosing ')', clear branch. + * posix/bug-regex9.c: New test. + * posix/Makefile (tests): Add bug-regex9. + +2002-08-12 Roland McGrath + + * sysdeps/generic/dl-tls.c (_dl_allocate_tls_init): Fix inner loop + start count condition, use TOTAL instead of variable that was never + set. Fix outer loop termination condition to TOTAL >= after update. + + * sysdeps/generic/libc-tls.c (__libc_setup_tls): Initialize + dl_tls_static_align and dl_tls_static_nelem. + +2002-08-11 Roland McGrath + + * elf/tst-tlsmod4.c (in_dso): Insert a random library call before use + of the TLS macros, otherwise the compiler might not have initialized + the PIC register yet when we use the PLT via asm. + * elf/tst-tlsmod3.c (in_dso2): Likewise. + * elf/tst-tlsmod2.c (in_dso): Likewise. + + * sunrpc/svc_authux.c (_svcauth_unix): Remove spurious printf (ugh!). + + * sysdeps/i386/bits/byteswap.h (__bswap_16, __bswap_32, __bswap_64): + Evaluate argument exactly once. Remove __volatile__ from asm's. + + * include/unistd.h: Use libc_hidden_proto for getdomainname + and getlogin_r. + * sysdeps/generic/getdomain.c: Add libc_hidden_def. + * sysdeps/mach/hurd/getdomain.c: Likewise. + * sysdeps/unix/getlogin_r.c: Likewise. + * sysdeps/mach/hurd/getlogin_r.c: Likewise. + * sysdeps/generic/getlogin_r.c: Likewise. + + * include/rpc/auth_des.h: Use libc_hidden_proto for rtime. + * sunrpc/rtime.c: Add libc_hidden_def. + + * include/string.h: Use libc_hidden_proto for basename. + * string/basename.c [_LIBC]: Add libc_hidden_def. + + * sysdeps/unix/sysv/linux/opensock.c (__opensock): socket -> __socket. + + * locale/loadarchive.c: munmap -> __munmap throughout. + + * include/netdb.h: Use libc_hidden_proto for gai_strerror. + * sysdeps/posix/gai_strerror.c: Add libc_hidden_def. + * sysdeps/generic/gai_strerror.c: Likewise. + + * include/sys/errno.h: New file. + + * include/signal.h: No libc_hidden_proto for raise, + __libc_current_sigrtmin, __libc_current_sigrtmax. + These need to be overridden by linuxthreads. + * sysdeps/posix/raise.c: Reverted. + * sysdeps/generic/raise.c: Reverted. + * signal/allocrtsig.c: Reverted. + + * locale/loadarchive.c (LOCALEDIR): Remove debugging defn. Oops. + +2002-08-10 Roland McGrath + + * locale/loadarchive.c (_nl_archive_subfreeres): New function. + * locale/localeinfo.h: Declare it. + * locale/setlocale.c (free_mem): Don't call _nl_unload_locale on the + current locale if it's not in the file list. + Call _nl_archive_subfreeres. + +2002-08-10 Andreas Jaeger + + * sysdeps/i386/strchr.S: Add comment. + +2002-08-10 Roland McGrath + + * include/wchar.h (putwc): Use libc_hidden_proto. + * include/stdio.h (dprintf, fprintf, vfprintf, sprintf, + sscanf, fwrite, perror, remove, rewind, open_memstream): Likewise. + * stdio-common/dprintf.c: Add libc_hidden_def. + * stdio-common/fprintf.c: Likewise. + * stdio-common/sprintf.c: Likewise. + * stdio-common/sscanf.c: Likewise. + * libio/iofwrite.c: Likewise. + * libio/memstream.c: Likewise. + * libio/putwc.c: Likewise. + * stdio-common/perror.c: Likewise. + * sysdeps/posix/remove.c: Likewise. + * sysdeps/generic/remove.c: Likewise. + * libio/rewind.c: Likewise. Use instead of "stdio.h". + * stdio-common/vfprintf.c: Add libc_hidden_def. Include . + +2002-08-09 Jakub Jelinek + + * include/wctype.h (iswalpha, iswdigit, iswlower, iswspace, iswxdigit, + towlower, towupper): Add prototypes here too. Add libc_hidden_proto. + * wctype/wcfuncs.c (iswalpha, iswdigit, iswlower, iswspace, iswxdigit, + towlower, towupper): Add libc_hidden_weak. + + * include/bits/dlfcn.h: New file. + * elf/dl-profstub.c (_dl_mcount_wrapper_check): Add libc_hidden_def. + + * include/grp.h (_nss_files_parse_grent): Add libc_hidden_proto. + * include/netinet/ether.h (_nss_files_parse_etherent): Likewise. + * include/rpc/netdb.h (_nss_files_parse_rpcent): Likewise. + * include/pwd.h (_nss_files_parse_pwent): Likewise. + * include/shadow.h (_nss_files_parse_spent): Likewise. + * include/netdb.h (_nss_files_parse_protoent, + _nss_files_parse_servent, _nss_files_parse_netent): Likewise. + * nss/nss_files/files-parse.c (nss_files_parse_hidden_def): Define. + (LINE_PARSER): Use it. + * nss/nsswitch.h (__nss_hostname_digits_dots): Add libc_hidden_proto. + * nss/digits_dots.c (__nss_hostname_digits_dots): Add libc_hidden_def. + + * libio/oldiopopen.c: Move #if SHLIB_COMPAT after _IO_HAVE_SYS_WAIT + #endif. + + * manual/debug.texi (%MENU%): Remove trailing dot. + Reported by . + + * sysdeps/unix/sysv/linux/ia64/syscalls.list (llseek): Add lseek + aliases. + (lseek): Dummy. + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (llseek, lseek): + Likewise. + +2002-08-09 Roland McGrath + + * locale/loadarchive.c (_nl_load_locale_from_archive): Parse locale + name to find codeset name (if any) and normalize it. If the + normalized name differs, look up only that in the archive. + * locale/programs/locarchive.c (add_locale_to_archive): If the name + contains a codeset, normalize the codeset store only the normalized + name in the archive. If not, add an alias containing the locale's + normalized codeset name. Apply codeset name normalization when + matching entries in the alias file. + + * locale/programs/locarchive.c (delete_locales_from_archive): Don't + decrement HEAD->namehash_used here. + (add_locale): Only need to insert name string when name_offset != 0. + + * locale/programs/localedef.c (options): Add -A/--alias-file. + (alias_file): New variable. + (parse_opt): Grok -A, set that. + * locale/programs/localedef.h: Declare it. + + * locale/locarchive.h (struct locrecent): Add `refs' member. + * locale/programs/locarchive.c (insert_name): New function, broken out + of ... + (add_locale_to_archive): ... here. Call that. + (add_alias): New function. + (add_locale): New static function, add_locale_to_archive renamed. + (add_locale_to_archive): Call that and use add_alias to add an alias + for the name with codeset if the given name lacks it. + (enlarge_archive): Call add_locale instead of add_locale_to_archive. + + * locale/Makefile (routines): Add loadarchive. + * locale/loadarchive.c: New file, started from code by Ulrich Drepper. + (_nl_load_locale_from_archive): New function. + * locale/localeinfo.h: Declare it. + * locale/findlocale.c (_nl_find_locale): If using default locale path, + try _nl_load_locale_from_archive first. + + * locale/loadlocale.c (_nl_intern_locale_data): New function, + broken out of _nl_load_locale. + (_nl_load_locale): Call that. + * locale/localeinfo.h: Declare it. + (struct locale_data): Replace member `mmaped' with `alloc', an enum. + (struct locale_data): Remove unused member `options'. + * locale/findlocale.c (_nl_remove_locale): Update uses. + * locale/loadlocale.c (_nl_load_locale, _nl_unload_locale): Likewise. + * locale/C-collate.c: Update initializer. + * locale/C-identification.c: Likewise. + * locale/C-measurement.c: Likewise. + * locale/C-telephone.c: Likewise. + * locale/C-address.c: Likewise. + * locale/C-name.c: Likewise. + * locale/C-paper.c: Likewise. + * locale/C-time.c: Likewise. + * locale/C-numeric.c: Likewise. + * locale/C-monetary.c: Likewise. + * locale/C-messages.c : Likewise. + * locale/C-ctype.c: Likewise. + + * locale/hashval.h [! LONGBITS]: Include here and + use CHAR_BIT instead of BITSPERBYTE. + + * locale/localeinfo.h (_nl_find_locale, _nl_load_locale, + _nl_unload_locale): Add `internal_function attribute_hidden' to decls. + * locale/findlocale.c (_nl_find_locale): Add internal_function to defn. + (_nl_remove_locale): Likewise. + * locale/loadlocale.c (_nl_load_locale, _nl_unload_locale): Likewise. + + * locale/findlocale.c (_nl_default_locale_path): New variable. + (_nl_find_locale): If LOCALE_PATH is null, default to that. + * locale/localeinfo.h: Declare it. + * locale/setlocale.c (setlocale): Use _nl_default_locale_path + in place of LOCALEDIR. If no LOCPATH, pass null to _nl_find_locale. + * locale/newlocale.c (__newlocale): Likewise. + + * misc/err.c (vwarnx, vwarn): Fix typos in libc_hidden_def uses. + * inet/rexec.c (rexec_af): Add libc_hidden_def. + * sysdeps/generic/morecore.c: Likewise. + * signal/allocrtsig.c (__libc_current_sigrtmin): Likewise. + (__libc_current_sigrtmax): Likewise. + +2002-08-08 Roland McGrath + + * locale/loadlocale.c (_nl_load_locale): Don't use MAP_INHERIT. + * catgets/open_catalog.c (__open_catalog): Likewise. + + * locale/programs/locarchive.c (INITIAL_NUM_NAMES): Renamed + from typo INITIAL_NUM_NANES. + (create_archive): Update use. + +2002-08-08 Ulrich Drepper + + * sysdeps/unix/sysv/linux/sigwait.c: New file. + +2002-08-08 Roland McGrath + + * resolv/netdb.h: Don't declare h_errno as a plain global any more. + +2002-08-08 Jakub Jelinek + + * sysdeps/wordsize-64/wcstol_l.c (wcstoll_l): Define to something + else and undefine after including wcstol_l.c. + * sysdeps/wordsize-64/wcstoul_l.c (wcstoull_l): Similarly. + +2002-08-08 Ulrich Drepper + + * gmon/gmon.c (write_gmon): Use O_NOFOLLOW in open calls if available. + +2002-08-08 Alexandre Oliva + + * configure.in: Make the test for broken_alias_attribute stricter. + +2002-05-24 Robert Love + + * posix/Makefile (routines): Add sched_getaffinity and + sched_setaffinity. + * posix/sched.h: Add declarations for sched_getaffinity and + sched_setaffinity. + * sysdeps/generic/sched_getaffinity.c: New file. + * sysdeps/generic/sched_setaffinity.c: New file. + * sysdeps/unix/sysv/linux/syscalls.list: Add sched_getaffinity and + sched_setaffinity. + +2002-08-06 Andreas Schwab + + * sysdeps/unix/utime.c: If TIMES is NULL pass it through to utimes. + +2002-08-07 Ulrich Drepper + + * elf/dl-load.c (_dl_map_object_from_fd): Add missing \n in error + message. + + * stdlib/isomac.c (get_null_defines): Treat NOT_IN_libc special. + It is known to be defined. + + * include/string.h: Define index and rindex only if _ISOMAC is not + defined. + + * elf/rtld.c: Include . + * sysdeps/generic/libc-tls.c: Likewise. + +2002-08-07 Roland McGrath + + * resolv/res_debug.c (latlon2ul): Add const to argument type, and use + it internally. + (precsize_aton): Likewise. + + * inet/getnetgrent_r.c (endnetgrent, __getnetgrent_r): Actually call + the static symbols added in the last change (doofus is me). + + * locale/newlocale.c (__newlocale): Use a bit mask instead of a second + loop to notice missing categories in a composite name. + + * locale/locale.h (LC_CTYPE_MASK, LC_NUMERIC_MASK, LC_TIME_MASK, + LC_COLLATE_MASK, LC_MONETARY_MASK, LC_MESSAGES_MASK, LC_ALL_MASK, + LC_PAPER_MASK, LC_NAME_MASK, LC_ADDRESS_MASK, LC_TELEPHONE_MASK, + LC_MEASUREMENT_MASK, LC_IDENTIFICATION_MASK, LC_ALL_MASK): New macros. + +2002-08-07 Ulrich Drepper + + * malloc/tst-calloc.c: Add tests for one or both parameters being zero. + +2002-08-07 Roland McGrath + + * sysdeps/i386/dl-machine.h (elf_machine_rel): Add to, don't clobber, + unrelocated initial value for DTPOFF32 and TPOFF32 relocs. + Reported by Jakub Jelinek . + +2002-08-07 Jakub Jelinek + + * malloc/malloc.c (public_cALLOc): Check ELEM_SIZE != 0 before + division. + +2002-08-06 Roland McGrath + + * include/getopt.h: Put private decls inside [_GETOPT_H]. + Use libc_hidden_proto for getopt_long, getopt_long_only. + * posix/getopt1.c [_LIBC]: Include instead of "getopt.h". + Add libc_hidden_def. + + * sysdeps/generic/unwind-dw2-fde-glibc.c [_LIBC] (dl_iterate_phdr): + Define as a macro for __dl_iterate_phdr. + + * inet/getnetgrent_r.c (internal_setnetgrent): Renamed from __ name, + made static. Add __ name as a strong alias. + (internal_endnetgrent): Likewise. + (internal_getnetgrent_r): Likewise. + + * locale/Versions (libc: GLIBC_2.3): Add all the *_l functions + with no __ prefix. + * locale/langinfo.h [__USE_GNU]: Declare nl_langinfo_l. + * ctype/ctype.h [__USE_GNU]: Add declarations and macros for + all *_l functions with no __ prefix. + * wctype/wcfuncs_l.c: Define weak aliases without __ for all fns. + * ctype/ctype_l.c: Likewise. + * locale/nl_langinfo.c: Likewise. + * string/string.h [__USE_GNU]: Add decls for all *_l fns with no __. + * stdlib/stdlib.h [__USE_GNU]: Likewise. + * wcsmbs/wchar.h [__USE_GNU]: Likewise. + * wctype/wctype.h [__USE_GNU]: Likewise. + * string/strcoll_l.c (strcoll_l): Define as weak alias. + * string/strxfrm_l.c (strxfrm_l): Define as weak alias. + * sysdeps/generic/strcasecmp_l.c (strcasecmp_l): Define as weak alias. + * sysdeps/generic/strncase_l.c (strncasecmp_l): Define as weak alias. + * stdlib/strtod_l.c (strtod_l): Define as weak alias. + * stdlib/strtof_l.c (strtof_l): Define as weak alias. + * stdlib/strtold_l.c (strtold_l): Define as weak alias. + * wcsmbs/wcscasecmp_l.c (wcscasecmp_l): Define as weak alias. + (__wcscasecmp_l): Add libc_hidden_def. + * wcsmbs/wcsncase_l.c (wcsncasecmp_l): Define as weak alias. + (__wcsncasecmp_l): Add libc_hidden_def. + * wcsmbs/wcstof_l.c (wcstof_l): Define as weak alias. + * wcsmbs/wcstod_l.c (wcstod_l): Define as weak alias. + * wcsmbs/wcstold_l.c (wcstold_l): Define as weak alias. + * wcsmbs/wcscoll_l.c (wcscoll_l): Define as weak alias. + * wcsmbs/wcsxfrm_l.c (wcsxfrm_l): Define as weak alias. + * sysdeps/generic/wcstol_l.c (wcstol_l): Define as weak alias. + * sysdeps/generic/wcstoll_l.c (wcstoll_l): Define as weak alias. + * sysdeps/generic/wcstoul_l.c (wcstoul_l): Define as weak alias. + * sysdeps/generic/wcstoull_l.c (wcstoull_l): Define as weak alias. + * sysdeps/wordsize-64/wcstol_l.c (wcstoll_l): Define as weak alias. + * sysdeps/wordsize-64/wcstoul_l.c (wcstoull_l): Define as weak alias. + * wctype/wctrans_l.c (wctrans_l) Define as weak alias. + * wctype/towctrans_l.c (towctrans_l) Define as weak alias. + * wctype/wctype_l.c (wctype_l) Define as weak alias. + +2002-08-05 Roland McGrath + + * include/rpc/auth.h: Use libc_hidden_proto for getnetname, + netname2user, host2netname, user2netname, key_gendes. + * sunrpc/netname.c: Add libc_hidden_def. + * sunrpc/key_call.c: Likewise. + + * include/netdb.h: Use libc_hidden_proto for getaddrinfo, getnameinfo, + freeaddrinfo. + * inet/getnameinfo.c: Add libc_hidden_def. + * sysdeps/generic/getaddrinfo.c: Likewise. + * sysdeps/posix/getaddrinfo.c: Likewise. + + * include/wchar.h: Use libc_hidden_proto for wmemchr, wmemset. + * wcsmbs/wmemchr.c: Add libc_hidden_def. + * wcsmbs/wmemset.c: Add libc_hidden_def. + + * include/string.h: Move libc_hidden_proto's inside #ifndef _STRING_H. + (index, rindex): Define as macros for strchr, strrchr. + + * string/envz.c (envz_strip): index -> strchr + + * include/rpc/rpc_msg.h: Use libc_hidden_proto for _seterr_reply. + * sunrpc/rpc_prot.c: Add libc_hidden_def. + + * include/wchar.h: Use libc_hidden_proto for mbrtowc. + * wcsmbs/mbrtowc.c: Add libc_hidden_weak. + + * include/stdlib.h: Use libc_hidden_proto for wctomb. + * stdlib/wctomb.c: Add libc_hidden_def. + + * include/netdb.h: Use libc_hidden_proto for innetgr, rcmd_af, + rexec_af, rresvport_af, ruserok_af, iruserok_af, ruserpass, hstrerror. + * resolv/herror.c: Likewise. + * inet/rcmd.c: Add libc_hidden_def. + * inet/ruserpass.c: Likewise. + * inet/getnetgrent_r.c: Likewise. + + * include/rpc/svc.h: Use libc_hidden_proto for svc_register, + svc_unregister, remove *_internal decls. Use libc_hidden_proto + for svcerr_auth, svcerr_noprog, svcerr_progvers. + * sunrpc/svc.c (svc_register, svc_unregister): Change INTDEF to + libc_hidden_def. + (svcerr_auth, svcerr_noprog, svcerr_progvers): Add libc_hidden_def. + * sunrpc/svc_simple.c (registerrpc): Nix INTUSE for svc_register. + + * sysdeps/posix/system.c (do_system): New function, guts broken out of + __libc_system. + (__libc_system): Call it, putting just the line == NULL test here. + + * include/libc-symbols.h (__hidden_proto): Add extern keywords so + variables work right. + + * elf/dl-open.c (dl_open_worker): Use _ macro instead of gettext. + * elf/dl-close.c (_dl_close): Likewise. + + * include/netinet/in.h: Use libc_hidden_proto for bindresvport, + in6addr_any, in6addr_loopback. Remove decls for + bindresvport_internal, in6addr_any_internal, in6addr_loopback_internal. + * sunrpc/svc_udp.c (svcudp_bufcreate): Nix INTUSE for bindresvport. + * sunrpc/svc_tcp.c (svctcp_create): Likewise. + * sunrpc/clnt_udp.c (clntudp_bufcreate): Likewise. + * sunrpc/bindrsvprt.c: Change INTDEF to libc_hidden_def. + * inet/in6_addr.c: Change INTVARDEF to libc_hidden_def. + * sysdeps/posix/getaddrinfo.c (gaih_inet): Nix INTUSE for + in6addr_loopback. + * inet/gethstbyad_r.c (PREPROCESS): Nix INTUSE for in6addr_any. + + * include/netinet/ether.h: Use libc_hidden_proto for ether_ntoa_r, + ether_aton_r. + * inet/ether_aton_r.c: Add libc_hidden_def. + * inet/ether_ntoa_r.c: Likewise. + + * include/rpc/svc.h: Use libc_hidden_proto for xprt_register, + xprt_unregister. + * sunrpc/svc.c: Add libc_hidden_def. + * include/rpc/pmap_clnt.h: Use libc_hidden_proto for pmap_getport, + pmap_set, pmap_unset. + * sunrpc/pmap_clnt.c: Add libc_hidden_def. + * sunrpc/pm_getport.c: Likewise. + * include/rpc/auth_des.h: Use libc_hidden_proto for getpublickey. + * sunrpc/publickey.c: Add libc_hidden_def. + +2002-08-05 Ulrich Drepper + + * elf/rtld.c (_dl_start): Don't use memset. Use same tricks as for + the other memset call in this function. + + * sysdeps/generic/dl-tls.c (_dl_allocate_tls_init): Store dtv pointer + at correct index. Clear BSS region now that memalign is used. + +2002-08-05 Roland McGrath + + * include/sys/utsname.h: Use libc_hidden_proto for uname, __uname. + * sysdeps/generic/uname.c: Add libc_hidden_def. + * sysdeps/mach/hurd/uname.c: Likewise. + +2002-08-05 Jakub Jelinek + + * include/wchar.h (wcrtomb, wcscmp, wcsftime, wcsspn, wcschr, wcscoll, + wcspbrk): Add libc_hidden_proto. + * time/strftime.c (my_strftime): Add libc_hidden_def. + (strftime): Remove libc_hidden_def. + * wcsmbs/wcschr.c (wcschr): Add libc_hidden_def. + * wcsmbs/wcspbrk.c (wcspbrk): Likewise. + * wcsmbs/wcsspn.c (wcsspn): Likewise. + * wcsmbs/wcscmp.c (wcscmp): Likewise. + * wcsmbs/wcrtomb.c (wcrtomb): Add libc_hidden_weak. + * wcsmbs/wcscoll.c (wcscoll): Likewise. + + * include/rpc/rpc.h (__rpc_thread_svc_max_pollfd, + __rpc_thread_svc_pollfd, __rpc_thread_svc_fdset, + __rpc_thread_createerr): Add libc_hidden_proto. + * sunrpc/rpc_thread.c (__rpc_thread_svc_max_pollfd, + __rpc_thread_svc_pollfd, __rpc_thread_svc_fdset, + __rpc_thread_createerr): Add libc_hidden_def. + + * include/rpc/clnt.h (clnt_sperrno, clnt_spcreateerror, + clnt_perror, clnt_sperror, _rpc_dtablesize): Add libc_hidden_proto. + * sunrpc/clnt_perr.c (clnt_sperrno, clnt_spcreateerror, + clnt_perror, clnt_sperror): Add libc_hidden_def. + * sunrpc/rpc_dtable.c (_rpc_dtablesize): Likewise. + + * include/rpc/des_crypt.h (des_setparity, ecb_crypt, cbc_crypt): Add + libc_hidden_proto. + * sunrpc/des_crypt.c (ecb_crypt, cbc_crypt): Add libc_hidden_proto. + * sunrpc/des_soft.c (des_setparity): Likewise. + + * include/rpc/auth.h (key_encryptsession_pk, key_decryptsession_pk): + Add libc_hidden_proto. + * sunrpc/key_call.c (key_encryptsession_pk, key_decryptsession_pk): + Add libc_hidden_def. + +2002-08-05 Roland McGrath + + * sysdeps/generic/ldsodefs.h (struct rtld_global): Replace member + `bool _dl_initial_dtv_malloced' with `void *_dl_initial_dtv'. + * elf/rtld.c (dl_main): Set it to the new dtv for the main thread. + * sysdeps/generic/dl-tls.c (__tls_get_addr): When reallocating the + dtv, check if it matches _dl_initial_dtv; if so, malloc and copy the + old data, abandoning the original memory allocated by rtld at startup, + instead of calling realloc normally. + +2002-08-05 Ulrich Drepper + + * po/fr.po: Update from translation team. + +2002-08-04 Roland McGrath + + * sysdeps/unix/make-syscalls.sh: If the syscall name field is - + then generate a dummy module under the given name, obeying the + normal rules for the "caller" field. + + * sysdeps/generic/libc-tls.c (__libc_setup_tls): Make the phdr loop + actually iterate over the elements. Fix typo p_type -> p_vaddr. + + * include/pthread.h: Don't declare __pthread_initialize_minimal as + weak here; we declare it weak or strong in the one place we use it. + * sysdeps/generic/libc-start.c: ... which is here. + Don't make the decl weak if [USE_TLS], since static programs need TLS + setup even when single-threaded. + + * stdlib/isomac.c (fmt): Add -DNOT_IN_libc to the compiler command. + + * elf/Makefile (test-srcs): Add $(modules-names) to it. + (CFLAGS-vismod2.c, CFLAGS-failobj.c, CFLAGS-constload2.c, + CFLAGS-reldepmod3.c, CFLAGS-reldepmod4.c, CFLAGS-ltglobmod2.c): Remove + all these variables. + +2002-08-04 Ulrich Drepper + + * include/stdio.h: Don't define macro magic to redirect function + calls if _ISOMAC is defined. + + * sysdeps/i386/fpu/libm-test-ulps: Add epsilons for inlined + ldouble asin tests. + +2002-08-04 Roland McGrath + + * stdlib/lrand48_r.c: Add libc_hidden_def. + + * sysdeps/generic/dl-tls.c (_dl_allocate_tls_storage): Allocate the + TCB with __libc_memalign instead of mmap. + (_dl_deallocate_tls): Free it with free instead of munmap. + + * Makerules (cpp-srcs-left): When setting this to run + cppflags-iterator.mk, must append .c to $(tests) and $(xtests) + words. Combine the two loops into one on the concatenated list, + including those as well as $(test-srcs). + + * elf/dl-minimal.c (__libc_memalign): Guts of malloc moved here, + since we align here with optimally minimal waste anyway. + (malloc): Just call that. + + * sysdeps/generic/libc-tls.c (__libc_setup_tls): Set l_tls_offset to + the right variable. + + * elf/dl-load.c (_dl_map_object_from_fd): Use p_vaddr, not p_offset, + to compute memory location for l_tls_initimage. + * elf/rtld.c (_dl_start): Likewise. + * sysdeps/generic/libc-tls.c (__libc_setup_tls): Likewise. + + * libio/oldiopopen.c: Move #include's before #if SHLIB_COMPAT, + because the .d file is generated in the non-shared case and + so fails to catch them otherwise. + + * sysdeps/generic/dl-tls.c (_dl_allocate_tls_storage): New function, + split out of _dl_allocate_tls. + (_dl_allocate_tls_init): Likewise. + (_dl_allocate_tls): Call those. + * sysdeps/generic/ldsodefs.h: Declare them with attribute_hidden. + * elf/rtld.c (dl_main): Call them separately instead of calling + _dl_allocate_tls. Delay _dl_allocate_tls_init until after relocation + is finished, so that the initializer data has been relocated before we + copy it into the main thread's TLS block. + + * sysdeps/generic/dl-tls.c (_dl_allocate_tls): Fix off-by-one error in + loop conditions, prevented the last used module from being initialized. + +2002-08-04 Jakub Jelinek + + * sysdeps/generic/glob.c (glob, globfree): Only use libc_hidden_def + if glob resp. globfree are not macros. + * sysdeps/gnu/glob64.c (globfree64): Add libc_hidden_def. + * sysdeps/unix/sysv/linux/alpha/glob.c (glob, globfree, globfree64): + Add libc_hidden_ver. + * sysdeps/unix/sysv/linux/i386/glob64.c (globfree64): Add + libc_hidden_def. + * sysdeps/wordsize-64/glob.c (globfree64): Use libc_hidden_ver + instead of libc_hidden_weak. + * sysdeps/wordsize-64/strtol.c (__strtoll_internal): Use + libc_hidden_ver instead of libc_hidden_def. + * sysdeps/wordsize-64/wcstol.c (__wcstoll_internal): Use + libc_hidden_ver instead of libc_hidden_def. + (wcstoll, wcstoq): Remove libc_hidden_weak. + * sysdeps/wordsize-64/strtol_l.c (____strtoll_l_internal): Add + libc_hidden_ver. + * sysdeps/wordsize-64/strtoul.c (__strtoull_internal): Add + libc_hidden_ver. + * sysdeps/wordsize-64/strtoul_l.c (____strtoull_l_internal): Add + libc_hidden_ver. + * sysdeps/wordsize-64/wcstoul.c (__wcstoull_internal): Add + libc_hidden_ver. + +2002-08-04 Ulrich Drepper + + * stdio-common/psignal.c: Declare _sys_siglist_internal. Use USEINT + to access _sys_siglist. + * string/strsignal.c: Likewise. + * sysdeps/generic/siglist.c: Add _sys_siglist_internal alias. + * sysdeps/gnu/siglist.c: Likewise. + * sysdeps/unix/siglist.c: Likewise. + * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise. + + * libio/fileops.c: Add missing INTUSEs for _IO_file_jumps. + + * libio/wfileops.c: Add missing INTUSE for _IO_file_close. + + * intl/dcigettext.c: Define _nl_default_dirname_internal as hidden + alias and use it. + * intl/bindtextdom.c: Use _nl_default_dirname_internal. + + * include/netinet/in.h: Add declaration of in6addr_loopback_internal. + * inet/in6_addr.c: Add INTVARDEF for in6addr_loopback. + * sysdeps/posix/getaddrinfo.c: Use INTUSE for in6addr_loopback access. + + * include/time.h: Add libc_hidden_proto for __gmtime_r. + * time/gmtime.c (__gmtime_r): Add libc_hidden_def. + + * iconv/Versions: Replace __gconv_alias_db, __gconv_modules_db, + and __gconv_cache with __gconv_get_alias_db, __gconv_get_modules_db, + and __gconv_get_cache respectively. + * iconv/gconv_cache.c (gconv_cache): Renamed for __gconv_cache and + defined static. Change all users. + (__gconv_get_cache): New function. + * iconv/gconv_db.c (__gconv_get_modules_db): New function. + (__gconv_get_alias_db): New function. + * iconv/gconv_int.h (__gconv_alias_db): Declare as hidden. + (__conv_modules_db): Likewise. + Add prototypes for __gconv_get_cache, __gconv_get_modules_db, + and __gconv_get_alias_db. + * iconv/iconv_prog.c: Use the new functions instead of accessing the + variables. + + * include/stdlib.h: Add prototype and libc_hidden_proto for + __default_morecore. + * sysdeps/generic/morecore.c: Include . + + * malloc/obstack.c: Remove fputs macro. + + * malloc/mtrace.c: Remove fopen macro. + +2002-08-04 Jakub Jelinek + + * manual/debug.texi: Fix spelling to programmatically. + Reported by . + +2002-08-04 Ulrich Drepper + + * include/libio.h: Add libc_hidden_proto for __uflow. + * include/stdio.h: Map fopen, fdopen, fclose, fputs, fsetpos, and + fgetpos to _IO_* names. + Add libc_hidden_proto for fileno, fwrite, fseek, fflush_unlocked, + fread_unlocked, fwrite_unlocked, fgets_unlocked, fputs_unlocked. + * include/wchar.h: Add libc_hidden_proto for fputws_unlocked, + putwc_unlocked, vswscanf. + * libio/iolibio.h: Add libc_hidden_proto for _IO_fputs. + * libio/fileno.c: Use and libc_hidden_def. + * libio/fseek.c: Likewise. + * libio/fmemopen.c: Include "libioP.h". Call _IO_fopencookie and + not fopencookie. + * libio/genops.c (__uflow): Add libc_hidden_def. + * libio/iofflush_u.c (fflush_unlocked): Likewise. + * libio/iofgets_u.c (fgets_unlocked): Likewise. + * libio/iofputs_u.c (fputs_unlocked): Likewise. + * libio/iofputws_u.c (fputws_unlocked): Likewise. + * libio/iofread_u.c (fread_unlocked): Likewise. + * libio/iofwrite_u.c (fwrite_unlocked): Likewise. + * libio/iovswscanf.c (vswscanf): Likewise. + * libio/putwc_u.c (putwc_unlocked): Likewise. + * libio/iofputs.c: Use libc_hidden_def instead of INTDEF. + * malloc/malloc.c: Redirect fwrite calls to _IO_fwrite. + * malloc/mtrace.c: Likewise. + + * sunrpc/clnt_perr.c: Remove fputs macro. + * sunrpc/svc_simple.c: Likewise. + * sunrpc/svc_tcp.c: Likewise. + * sunrpc/svc_udp.c: Likewise. + * sunrpc/xdr_rec.c: Likewise. + * sunrpc/xdr_ref.c: Likewise. + + * iconv/Makefile: Add CPPFLAGS definitions with -DNOT_in_libc for + iconv_prog, linereader, and charmap-dir. + * locale/Makefile: Likewise for locale and charmap-dir. + * malloc/Makefile: Likewise for memusagestat. + * nscd/Makefile: Likewise for nscd, nscd_conf, and dbg_log. + * sunrpc/Makefile: Likewise for rpc_main. + * sysdeps/unix/sysv/linux/Makefile: Likewise for lddlibc4. + * timezone/Makefile: Likewise for zic. + + * stdio-common/perror.c: Avoid multiple calls to fileno_unlocked. + + * elf/dl-addr.c (_dl_addr): Add libc_hidden_def. + * elf/dl-close.c (_dl_close): Add libc_hidden_def. + * elf/dl-open.c (_dl_open): Add libc_hidden_def. + * include/dlfcn.h: Add libc_hidden_proto for _dl_addr, _dl_open, + _dl_close. + + * include/libio.h: Add libc_hidden_proto for __underflow, __wuflow, + __wunderflow. + * libio/genops.c (__underflow): Add libc_hidden_def. + * libio/wgenops.c (__wuflow): Likewise. + (__wunderflow): Likewise. + + * include/obstack.h: Add libc_hidden_proto for _obstack_newchunk. + * malloc/obstack.c (_obstack_newchunk): Add libc_hidden_def. + + * include/stdio.h: Add libc_hidden_proto for __vfscanf. + * stdio-common/vfscanf.c (__vfscanf): Add libc_hidden_def. + + * include/string.h: Add libc_hidden_proto for __strverscmp. + * string/strverscmp.c (__strverscmp): Add libc_hidden_def. + + * include/unistd.h: Add libc_hidden_proto for __sysconf. + * sysdeps/generic/sysconf.c (__sysconf): Add libc_hidden_def. + * sysdeps/posix/sysconf.c: Likewise. + * sysdeps/unix/sysv/irix4/sysconf.c: Likewise. + * sysdeps/unix/sysv/sysv4/sysconf.c: Likewise. + + * include/wctype.h: Use libc_hidden_proto for __iswctype, __iswalnum_l, + __iswalpha_l, __iswblank_l, __iswcntrl_l, __iswdigit_l, __iswlower_l, + __iswgraph_l, __iswprint_l, __iswpunct_l, __iswspace_l, __iswupper_l, + __iswxdigit_l, __towlower_l, __towupper_l. + * wcsmbs/wcstype.c (__iswctype): Use libc_hidden_def. + * wcsmbs/wcfuncs_l.c: Use libc_hidden_def for all functions. + + * include/sys/wait.h: Add libc_hidden_proto for __xmknod. + * sysdeps/generic/xmknod.c (__xmknod): Add libc_hidden_def. + * sysdeps/mach/hurd/xmknod.c: Likewise. + * sysdeps/unix/xmknod.c: Likewise. + * sysdeps/unix/sysv/linux/xmknod.c: Likewise. + * sysdeps/unix/sysv/linux/alpha/xmknod.c: Likewise. + * sysdeps/unix/sysv/linux/mips/xmknod.c: Likewise. + + * sunrpc/svc.c: Add missing INTUSE for _authenticate. + +2002-08-03 Roland McGrath + + * include/sys/resource.h: Use libc_hidden_proto for getpriority, + setpriority. + * sysdeps/unix/sysv/linux/getpriority.c: Add libc_hidden_def. + * sysdeps/unix/sysv/irix4/getpriority.c: Likewise. + * sysdeps/unix/sysv/irix4/setpriority.c: Likewise. + * sysdeps/mach/hurd/setpriority.c: Likewise. + * sysdeps/mach/hurd/getpriority.c: Likewise. + * sysdeps/generic/setpriority.c: Likewise. + * sysdeps/generic/getpriority.c: Likewise. + + * include/mcheck.h: Use libc_hidden_proto for mcheck_check_all. + * malloc/mcheck.c: Add libc_hidden_def. + + * include/search.h: Use libc_hidden_proto for hcreate_r, hdestroy_r. + * misc/hsearch_r.c: Add libc_hidden_def. + + * include/fnmatch.h: Use libc_hidden_proto for fnmatch. + * posix/fnmatch.c: Add libc_hidden_weak. + + * include/unistd.h: Use libc_hidden_proto for _exit, alarm, confstr, + execl, execle, execlp, execvp, getpid, getsid. + * sysdeps/generic/alarm.c: Add libc_hidden_def. + * sysdeps/unix/alarm.c: Likewise. + * posix/confstr.c: Likewise. + * posix/execvp.c: Likewise. + * posix/execlp.c: Likewise. + * posix/execle.c: Likewise. + * posix/execl.c: Likewise. + * sysdeps/generic/getsid.c: Likewise. + * sysdeps/mach/hurd/getsid.c: Likewise. + * sysdeps/generic/getpid.c: Add libc_hidden_weak. + * sysdeps/mach/hurd/getpid.c: Likewise. + + * include/stdlib.h: Use libc_hidden_proto for ecvt_r, fcvt_r, + qecvt_r, qfcvt_r, lrand48_r. + * misc/efgcvt_r.c: Add libc_hidden_def. + + * include/wordexp.h: Use libc_hidden_proto for wordfree. + * sysdeps/generic/wordexp.c: Add libc_hidden_def. + + * include/langinfo.h: Use libc_hidden_proto for nl_langinfo. + * locale/nl_langinfo.c: Add libc_hidden_def. + + * include/glob.h: Use libc_hidden_proto for glob, globfree, globfree64. + * sysdeps/generic/glob.c: Add libc_hidden_def. + * sysdeps/generic/glob64.c: Likewise. + * sysdeps/wordsize-64/glob.c (globfree64): Add libc_hidden_weak. + + * locale/nl_langinfo.c: Use _NL_CURRENT_DATA. + + * elf/Makefile (CFLAGS-vismod2.c): New variable. + + * locale/setlocale.c (_nl_current_names): Variable moved ... + * locale/localename.c (_nl_current_names): ... here, new file. + Make it global, with attribute_hidden. + * locale/localeinfo.h: Declare it. + * locale/Makefile (aux): Add localename. + * locale/localename.c (__current_locale_name): New function. + * include/locale.h (__current_locale_name): Declare it. + * intl/dcigettext.c (guess_category_value): Use that instead of + calling setlocale. + + * locale/locale.h [__USE_GNU] (locale_t): New type alias of __locale_t. + [__USE_GNU] (newlocale, duplocale, freelocale, uselocale): New decls. + [__USE_GNU] (LC_GLOBAL_LOCALE): New macro. + * locale/newlocale.c: Add alias to __ name. + * locale/duplocale.c: Likewise. + * locale/freelocale.c: Likewise. + * locale/uselocale.c: New file. + * locale/Makefile (routines): Add it. + * locale/Versions (libc: GLIBC_2.3): New set. + Add newlocale, duplocale, freelocale, uselocale. + (libc: GLIBC_PRIVATE): Add __uselocale. + + * locale/localeinfo.h [SHARED] + (_NL_CURRENT_LOCALE): New macro, defined to fetch a tsd value. + (_NL_CURRENT_DATA): Define using that. + (_NL_CURRENT, _NL_CURRENT_WSTR, _NL_CURRENT_WORD): Define using that. + (_NL_CURRENT_DEFINE): Define to empty. + [! SHARED]: Decls of _nl_current_CATEGORY and _nl_current + conditionalized on this. + * locale/xlocale.c (NL_C_INTIIALIZER): New macro, + taking initializer of _nl_C_locobj. + [SHARED] (_nl_global_locale): New variable, using that initializer. + (_nl_C_locobj): Use new macro for initialzier. + * locale/setlocale.c [! SHARED] (_nl_current): Conditionalize on this. + [! SHARED] (CATEGORY_USED): New macro. + [SHARED] (CATEGORY_USED, _nl_C): New macros. + (setdata, setlocale): Use that macro instead of examining _nl_current. + (setdata): Set the slot in _nl_global_locale. + Conditionalize setting of _nl_current on [! SHARED]. + * locale/findlocale.c [SHARED] (_nl_C): Define as a macro instead of + declaration as an extern. + * locale/newlocale.c (__newlocale): Use _nl_C_locobj instead of _nl_C. + + * include/locale.h: Use libc_hidden_proto for setlocale. + * locale/setlocale.c: Add libc_hidden_def. + + * locale/setlocale.c (free_mem): Use _NL_CURRENT_DATA. + + * include/search.h: Use libc_hidden_proto for hsearch_r, lfind. + * misc/hsearch_r.c: Add libc_hidden_def. + * misc/lsearch.c: Likewise. + + * include/ttyent.h: Use libc_hidden_proto for getttyent, setttyent, + endttyent. + * misc/getttyent.c: Add libc_hidden_def. + + * include/mcheck.h: Use libc_hidden_proto for mcheck. + * malloc/mcheck.c: Add libc_hidden_def. + + * include/envz.h: Use libc_hidden_proto for envz_entry, enz_remove. + * include/argz.h: Use libc_hidden_proto for argz_delete. + * string/argz-delete.c: Add libc_hidden_def. + * string/envz.c: Likewise. Use , not "envz.h". + + * sysdeps/unix/sysv/linux/x86_64/clone.S (thread_start): Use + HIDDEN_JUMPTARGET for _exit. + * sysdeps/unix/sysv/linux/m68k/clone.S (thread_start): Likewise. + * sysdeps/unix/sysv/linux/i386/clone.S (thread_start): Likewise. + * sysdeps/unix/sysv/linux/powerpc/clone.S: Likewise. + * sysdeps/unix/_exit.S (_exit): Add libc_hidden_def. + + * include/libc-symbols.h: Fix [__ASSEMBLY__] -> [__ASSEMBLER__]. + [__ASSEMBLER__] (hidden_weak): Define using hidden_def, or to empty. + [__ASSEMBLER__] (HIDDEN_JUMPTARGET): New macro. + * sysdeps/unix/sysv/linux/i386/makecontext.S: Use it for exit. + + * include/stdlib.h: Use libc_hidden_proto for abort, + __strtof_internal, __strtod_internal, __strtold_internal, + __strtol_internal, __strtoll_internal, __strtoul_internal, + __strtoull_internal. __strtof_l_internal, __strtod_l_internal, + __strtold_l_internal, __strtol_l_internal, __strtoll_l_internal, + __strtoul_l_internal, __strtoull_l_internal. + * include/wchar.h: Use libc_hidden_proto for __wcstof_internal, + __wcstod_internal, __wcstold_internal, __wcstol_internal, + __wcstoll_internal, __wcstoul_internal, ____wcstof_l_internal, + ____wcstod_l_internal, ____wcstold_l_internal, ____wcstol_l_internal, + ____wcstoll_l_internal, ____wcstoul_l_internal, __wcscasecmp_l, + __wcsncasecmp_l. + * sysdeps/generic/abort.c: Add libc_hidden_def. + * stdlib/strtod.c: Likewise. + * sysdeps/generic/strtol.c: Likewise. + * sysdeps/wordsize-64/strtol.c: Likewise. + * sysdeps/wordsize-64/wcstol.c: Likewise. + * sysdeps/wordsize-64/wcstol_l.c: Likewise. + + * include/stdlib.h: Use libc_hidden_proto for qsort. + * stdlib/msort.c: Add libc_hidden_def. + + * include/utime.h: Use libc_hidden_proto for utime. + * sysdeps/generic/utime.c: Add libc_hidden_def. + * sysdeps/unix/utime.c: Likewise. + + * sysdeps/generic/utmp_file.c (LOCK_FILE): sigemptyset -> __sigemptyset + * sysdeps/posix/profil.c (__profil): sigfillset -> __sigfillset + * sysdeps/posix/sprofil.c (__sprofil): Likewise. + * shadow/lckpwdf.c (__lckpwdf): Likewise (both). + * sysdeps/posix/spawni.c (__spawni): sigismember -> __sigismember + + * include/signal.h: Use libc_hidden_proto for raise, sigemptyset, + sigfillset, sigismember, __sigpause, __libc_current_sigrtmin, + and __libc_current_sigrtmax. + * signal/sigismem.c: Add libc_hidden_def. + * signal/sigfillset.c: Likewise. + * signal/sigempty.c: Likewise. + * sysdeps/generic/sigpause.c (__sigpause): Likewise. + * sysdeps/posix/sigpause.c (__sigpause): Likewise. + * sysdeps/unix/bsd/osf/alpha/sigpause.S: Likewise. + * sysdeps/posix/raise.c: Likewise. + * sysdeps/generic/raise.c: Likewise. + +2002-08-03 Ulrich Drepper + + * include/string.h: Use libc_hidden_proto for __stpcpy. + * sysdeps/alpha/stpcpy.S (__stpcpy): Add libc_hidden_def. + * sysdeps/alpha/alphaev67/stpcpy.S: Likewise. + * sysdeps/generic/stpcpy.c: Likewise. + * sysdeps/i386/stpcpy.S: Likewise. + * sysdeps/i386/i586/stpcpy.S: Likewise. + * sysdeps/powerpc/stpcpy.S: Likewise. + * sysdeps/sparc/sparc32/stpcpy.S: Likewise. + * sysdeps/sparc/sparc64/stpcpy.S: Likewise. + + * include/string.h: Use libc_hidden_proto for __strcasecmp_l, + __strncasecmp_l, __strdup, __strndup, __strerror_r. + * sysdeps/generic/strcasecmp_l.c (__strcasecmp_l): Add + libc_hidden_def. + * string/strdup.c (__strdup): Likewise. + * string/strndup.c (__strndup): Likewise. + * sysdeps/generic/_strerror.c (__strerror_r): Likewise. + * sysdeps/generic/strncase_l.c (__strncasecmp_l): Likewise. + +2002-08-03 Jakub Jelinek + + * include/libio.h: New file. + * libio/libioP.h (__overflow, __woverflow): Remove libc_hidden_proto. + * libio/iolibio.h: #include , not "libio.h". + * sysdeps/generic/morecore.c (__sbrk): Add libc_hidden_proto. + * sysdeps/unix/bsd/syscalls.list: Remove all __GI_* aliases. + * sysdeps/unix/common/syscalls.list: Likewise. + * sysdeps/unix/inet/syscalls.list: Likewise. + * sysdeps/unix/sysv/irix4/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/alpha/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/syscalls.list: Likewise. + * sysdeps/unix/sysv/sysv4/solaris2/syscalls.list: Likewise. + * sysdeps/unix/syscalls.list: Likewise. + +2002-08-03 Jakub Jelinek + Ulrich Drepper + + * malloc/malloc.c (public_cALLOc): Only divide if at least one of + the arguments is big enough to cause an overflow. + +2002-08-03 Ulrich Drepper + + * assert/assert.c: Use hidden_def not INTDEF. + +2002-08-03 Jakub Jelinek + + * include/libc-symbols.h: Optimize if HAVE_BROKEN_ALIAS_ATTRIBUTE is + not defined. + +2002-08-03 Roland McGrath + + * include/sys/syslog.h: Use libc_hidden_proto for syslog, vsyslog. + * include/err.h: Use libc_hidden_proto for warn, warnx, vwarn, vwarn, + verr, verrx. + * include/stdlib.h: Use libc_hidden_proto for exit, getenv, bsearch. + * misc/syslog.c: Add libc_hidden_def. + * misc/err.c: Likewise. + * stdlib/exit.c: Likewise. + * stdlib/bsearch.c: Likewise. + * sysdeps/generic/getenv.c: Likewise. + + * include/libc-symbols.h (hidden_weak): Define it for [__ASSEMBLER__]. + + * sysdeps/unix/make-syscalls.sh: Generate libc_hidden_def or + libc_hidden_weak for every system call symbol defined. + + * include/time.h: Use libc_hidden_proto for time, asctime, mktime, + timelocal, localtime, strftime. + * time/asctime.c: Add libc_hidden_def. + * time/mktime.c: Likewise. + * time/localtime.c: Likewise. + * time/strftime.c: Likewise. + * time/strptime.c: Likewise. + * sysdeps/generic/time.c: Likewise. + * sysdeps/unix/time.c: Likewise. + * sysdeps/unix/sysv/i386/time.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/time.S: Likewise. + + * include/arpa/inet.h: Use libc_hidden_proto for inet_ntop, inet_pton. + inet_makeaddr, inet_netof, inet_addr, __inet_addr. + * resolv/inet_ntop.c: Likewise. + * resolv/inet_pton.c: Likewise. + * inet/inet_mkadr.c: Add libc_hidden_def. + * inet/inet_netof.c: Likewise. + * resolv/inet_addr.c: Likewise. + + * include/libc-symbols.h: Remove `defined HAVE_BROKEN_ALIAS_ATTRIBUTE' + clauses from conditionals for now. Will have to be fixed later + for older compilers. + + * sysdeps/generic/mempcpy.c (__mempcpy): #undef it before defn. + +2002-08-02 Ulrich Drepper + + * configure.in (HAVE_BROKEN_ALIAS_ATTRIBUTE): Add check for + broken alias attribute handling. + * config.h.in (HAVE_BROKEN_ALIAS_ATTRIBUTE): Add. + +2002-08-02 Roland McGrath + + * elf/Makefile ($(objpfx)interp.os): Depend on config.make, + since it sets the variables we use in a -D switch. + +2002-08-02 Roland McGrath + + * posix/bits/posix1_lim.h (SSIZE_MAX): Define to LONG_MAX, not INT_MAX. + On 32-bit platforms they are the same; on 64-bit platforms ssize_t + matches long int, not int. + + * locale/localeinfo.h (_NL_CURRENT_DATA): New macro. + * wcsmbs/wcsmbsload.h (update_conversion_ptrs): Use it. + * locale/lc-ctype.c (_nl_postload_ctype): Likewise. + * wctype/wctrans.c (wctrans): Likewise. + * wctype/wctype.c (__wctype): Likewise. + * intl/loadmsgcat.c (_nl_init_domain_conv): Use _NL_CURRENT. + +2002-08-02 Ulrich Drepper + + * assert/assert.c (__assert_fail): Fix typo in comment. + + * include/rpc/rpc.h: Declare RPC_VARS tsd as extern. + * sunrpc/rpc_thread.c: Define it without static. + * sunrpc/Versions [libc] (GLIBC_PRIVATE): Export __libc_tsd_RPC_VARS. + +2002-08-02 Jakub Jelinek + + * assert/assert.c (__assert_fail): Remove undef. + Replace INTDEF with libc_hidden_def. + * assert/__assert.c (__assert): Remove INTUSE. + * elf/dl-minimal.c (__assert_fail): Replace INTDEF with + libc_hidden_weak. + * include/libc-symbols.h (hidden_proto, hidden_def, hidden_weak, + hidden_ver, libc_hidden_proto, libc_hidden_def, libc_hidden_weak, + libc_hidden_ver, rtld_hidden_proto, rtld_hidden_def, rtld_hidden_weak, + rltd_hidden_ver, libm_hidden_proto, libm_hidden_def, libm_hidden_weak, + libm_hiden_ver): Define. + * include/assert.h (__assert_fail_internal): Remove. + (__assert_fail): Add prototype. Add hidden_proto. + * include/libc-internal.h (__libc_freeres, __profile_frequency): Add + libc_hidden_proto. + * include/wchar.h (__mbrtowc_internal, __mbrlen_internal): Remove. + (__mbrtowc, __mbrlen): Use libc_hidden_proto. Remove macros. + * include/string.h (__mempcpy, __stpncpy, __rawmemchr, __strcasecmp): + Add libc_hidden_proto. + * include/fcntl.h (__open64, __libc_open, __libc_fcntl, __open, + __fcntl): Add libc_hidden_proto. Remove macros. + (__open_internal, __fcntl_internal): Remove. + * libio/iofdopen.c (_IO_fcntl): Remove INTUSE from __fcntl. + * malloc/set-freeres.c (__libc_freeres): Add libc_hidden_def. + * nss/nsswitch.h (__nss_database_lookup, __nss_next): Add + libc_hiden_proto. + * nss/nsswitch.c (__nss_database_lookup, __nss_next): Add + libc_hidden_def. + * sysdeps/generic/mempcpy.c (__mempcpy): Remove undef. + Add libc_hidden_def. + * sysdeps/generic/open64.c (__open64): Add libc_hidden_def. + * sysdeps/generic/open.c (__open): Remove undef. + Add libc_hidden_def. Remove INTDEF. + * sysdeps/generic/fcntl.c (__fcntl): Remove undef. + Add libc_hidden_def. + * sysdeps/mach/hurd/fcntl.c (__fcntl): Likewise. + * sysdeps/i386/i586/mempcpy.S (__mempcpy): Add libc_hidden_def. + * sysdeps/i386/i686/mempcpy.S (__mempcpy): Likewise. + * sysdeps/mach/hurd/fcntl.c (__libc_fcntl, __fcntl): Remove undef. + (__fcntl): Remove INTDEF2. Add libc_hidden_weak. + (__libc_fcntl): Add libc_hidden_def. + * sysdeps/mach/hurd/open.c (__libc_open, __open): Remove undef. + (__open): Remove INTDEF2. Add libc_hidden_weak. + (__libc_open): Add libc_hidden_def. + * sysdeps/posix/open64.c (__open64): Add libc_hidden_weak. + * sysdeps/standalone/open.c (__open): Add libc_hidden_def. + * sysdeps/unix/sysv/aix/fcntl.c (__libc_fcntl, __fcntl): Remove undef. + Add libc_hidden_def. + * sysdeps/unix/sysv/aix/open.c (__libc_open, __open): Remove undef. + Add libc_hidden_def. + * sysdeps/unix/sysv/linux/i386/fcntl.c (__libc_fcntl, __fcntl): Remove + undef. + (__fcntl): Remove INTDEF2. Add libc_hidden_weak. + (__libc_fcntl): Add libc_hidden_def. + * sysdeps/unix/sysv/linux/syscalls.list (__fcntl_internal, + __getpgid_internal, __chown_internal): Remove. + (__GI___fcntl, __GI___libc_fcntl, __GI___getpgid, __GI___pipe, + __GI___sched_setscheduler, __GI___select, __GI___setpgid, + __GI___chown): Add. + * sysdeps/unix/syscalls.list (__close_internal, __dup2_internal, + __getpid_internal, __open_internal, __write_internal): Remove. + (__GI___fcntl, __GI___libc_fcntl, __GI___open, __GI___libc_open, + __GI___chown, __GI___close, __GI___dup2, __GI___getpid, + __GI___libc_open, __GI___open, __GI___read, __GI___libc_read, + __GI___select, __GI___statfs, __GI___write, __GI___libc_write): Add. + * wcsmbs/mbrlen.c (__mbrlen): Remove undef. + Replace INTDEF with libc_hidden_def. + * wcsmbs/mbrtowc.c (__mbrtowc): Likewise. + * catgets/catgetsinfo.h (__open_catalog): Add libc_hidden_proto. + * catgets/open_catalog.c (__open_catalog): Add libc_hidden_def. + * elf/dl-profile.c (__profile_frequency): Add libc_hidden_proto. + * include/rpc/rpc.h (__rpc_thread_svc_fdset, __rpc_thread_createerr): + Add libc_hidden_proto. + * include/sys/poll.h (__poll): Add libc_hidden_proto. + * include/sys/select.h (__select): Likewise. + * include/sys/socket.h (__send): Likewise. + * include/sys/statfs.h (__statfs): Likewise. + * include/unistd.h (__pwrite64, __libc_read, __pipe, __chown, __dup2, + __getpid, __getpgid, __setpgid, __close, __read, __write, + __getpagesize, __sbrk): Likewise. + (__chown_internal, __dup2_internal, __getpid_internal, + __getpgid_internal, __close_internal, __write_internal, + __getpagesize_internal): Remove. + (__close, __dup2, __getpagesize, __getpgid, __getpid, __libc_write): + Remove macros. + * include/printf.h (__printf_fp): Add libc_hidden_proto. + * include/sched.h (__sched_setscheduler): Likewise. + * include/resolv.h (__res_ninit, __res_randomid): Likewise. + * include/stdlib.h (__secure_getenv): Likewise. + * include/signal.h (__sigaction, __sigsuspend): Likewise. + * inet/getaliasent_r.c (NSS_attribute_hidden): Remove. + * inet/getaliasname_r.c (NSS_attribute_hidden): Remove. + * inet/getnetbyad_r.c (NSS_attribute_hidden): Remove. + * inet/getnetbynm_r.c (NSS_attribute_hidden): Remove. + * inet/getnetent_r.c (NSS_attribute_hidden): Remove. + * inet/getproto_r.c (NSS_attribute_hidden): Remove. + * inet/getprtent_r.c (NSS_attribute_hidden): Remove. + * inet/getprtname_r.c (NSS_attribute_hidden): Remove. + * inet/getrpcbyname_r.c (NSS_attribute_hidden): Remove. + * inet/getrpcbynumber_r.c (NSS_attribute_hidden): Remove. + * inet/getrpcent_r.c (NSS_attribute_hidden): Remove. + * inet/getservent_r.c (NSS_attribute_hidden): Remove. + * inet/getsrvbynm_r.c (NSS_attribute_hidden): Remove. + * inet/getsrvbypt_r.c (NSS_attribute_hidden): Remove. + * inet/gethstbyad_r.c (DB_LOOKUP_FCT): Remove INTUSE. + * inet/gethstbynm2_r.c (DB_LOOKUP_FCT): Likewise. + * inet/gethstbynm_r.c (DB_LOOKUP_FCT): Likewise. + * inet/gethstent_r.c (DB_LOOKUP_FCT): Likewise. + * libio/genops.c (__overflow): Add libc_hidden_def. + * libio/iovdprintf.c: Remove libio.h include. + * libio/libioP.h (libc_hidden_proto, libc_hidden_def, + libc_hidden_weak): Define to nothing if not defined. + (__overflow, __woverflow): Add libc_hidden_proto. + * libio/wgenops.c (__woverflow): Add libc_hidden_def. + * nss/getXXent_r.c (NSS_attribute_hidden): Remove. + (DB_LOOKUP_FCT): Add libc_hidden_proto. + * nss/getXXbyYY_r.c (NSS_attribute_hidden): Remove. + (DB_LOOKUP_FCT): Add libc_hidden_proto. + * nss/XXX-lookup.c (DB_LOOKUP_FCT): Add libc_hidden_proto + and libc_hidden_def. + * nss/hosts-lookup.c (__nss_hosts_lookup): Remove INTDEF. + * posix/bsd-getpgrp.c (__getpgid_internal): Remove. + (__getpgid): Add libc_hidden_proto. + (__bsd_getpgrp): Remove INTUSE. + * resolv/res_init.c (__res_ninit, __res_randomid): Add + libc_hidden_def. + * shadow/getspent_r.c (NSS_attribute_hidden): Remove. + * shadow/getspnam_r.c (NSS_attribute_hidden): Remove. + * stdio-common/printf_fp.c (__printf_fp): Add libc_hidden_def. + * stdlib/strfmon.c (__printf_fp): Add libc_hidden_proto. + * stdlib/secure-getenv.c (__secure_getenv): Add libc_hidden_def. + * sunrpc/rpc_thread.c (__rpc_thread_svc_fdset, + __rpc_thread_createerr): Add libc_hidden_def. + * sysdeps/alpha/alphaev67/rawmemchr.S (__rawmemchr): Add + libc_hidden_def. + * sysdeps/alpha/alphaev67/stpncpy.S (__stpncpy): Likewise. + * sysdeps/alpha/rawmemchr.S (__rawmemchr): Likewise. + * sysdeps/alpha/stpncpy.S (__stpncpy): Likewise. + * sysdeps/generic/chown.c (__chown): Likewise. + * sysdeps/generic/close.c (__close): Likewise. + * sysdeps/generic/dup2.c (__dup2): Likewise. + * sysdeps/generic/pipe.c (__pipe): Likewise. + * sysdeps/generic/prof-freq.c (__profile_frequency): Likewise. + * sysdeps/generic/pwrite64.c (__pwrite64): Likewise. + * sysdeps/generic/rawmemchr.c (__rawmemchr): Likewise. + * sysdeps/generic/read.c (__libc_read): Likewise. + (__read): Add libc_hidden_weak. + * sysdeps/generic/sbrk.c (__sbrk): Add libc_hidden_def. + * sysdeps/generic/sched_sets.c (__sched_setscheduler): Likewise. + * sysdeps/generic/select.c (__select): Likewise. + * sysdeps/generic/send.c (__send): Likewise. + * sysdeps/generic/setpgid.c (__setpgid): Likewise. + * sysdeps/generic/sigaction.c (__sigaction): Likewise. + * sysdeps/generic/sigsuspend.c (__sigsuspend): Likewise. + * sysdeps/generic/statfs.c (__statfs): Likewise. + * sysdeps/generic/stpncpy.c (__stpncpy): Likewise. + * sysdeps/generic/strcasecmp.c (__strcasecmp): Likewise. + * sysdeps/generic/getpagesize.c (__getpagesize): Likewise. + Remove undef and INTDEF. + * sysdeps/generic/getpgid.c (__getpgid): Likewise. + * sysdeps/generic/getpid.c (__getpid): Likewise. + * sysdeps/generic/write.c (__libc_write): Likewise. + (__write): Add libc_hidden_weak. Remove undef and INTDEF. + * sysdeps/i386/rawmemchr.S (__rawmemchr): Add libc_hidden_def. + * sysdeps/i386/stpncpy.S (__stpncpy): Likewise. + * sysdeps/m68k/rawmemchr.S (__rawmemchr): Likewise. + * sysdeps/mach/hurd/chown.c (__chown): Likewise. Remove INTDEF. + * sysdeps/mach/hurd/close.c (__close): Add libc_hidden_def. + Remove undef and INTDEF. + * sysdeps/mach/hurd/dup2.c (__dup2): Likewise. + * sysdeps/mach/hurd/getpgid.c (__getpgid): Likewise. + * sysdeps/mach/hurd/getpid.c (__getpid): Likewise. + * sysdeps/mach/getpagesize.c (__getpagesize): Likewise. + * sysdeps/mach/hurd/write.c (__libc_write): Likewise. + (__write): Add libc_hidden_weak. Remove undef and INTDEF. + * sysdeps/mach/hurd/pipe.c: Include unistd.h. + (__pipe): Add libc_hidden_def. + * sysdeps/mach/hurd/dl-sysdep.c (__libc_read, __libc_write): Add + libc_hidden_weak. + * sysdeps/mach/hurd/poll.c (__poll): Add libc_hidden_def. + * sysdeps/mach/hurd/profil.c (__profile_frequency): Likewise. + * sysdeps/mach/hurd/read.c (__libc_read): Likewise. + (__read): Add libc_hidden_weak. + * sysdeps/mach/hurd/pwrite64.c (__pwrite64): Likewise. + (__libc_pwrite64): Add libc_hidden_def. + * sysdeps/mach/hurd/sbrk.c (__sbrk): Likewise. + * sysdeps/mach/hurd/select.c (__select): Likewise. + * sysdeps/mach/hurd/send.c (__send): Likewise. + * sysdeps/mach/hurd/setpgid.c (__setpgid): Likewise. + * sysdeps/mach/hurd/sigaction.c (__sigaction): Likewise. + * sysdeps/mach/hurd/sigsuspend.c (__sigsuspend): Likewise. + * sysdeps/mach/hurd/statfs.c (__statfs): Likewise. + * sysdeps/posix/dup2.c: Likewise. + Remove undef and INTDEF. + * sysdeps/posix/getpagesize.c (__getpagesize): Likewise. + * sysdeps/posix/pwrite64.c (__libc_pwrite64): Add libc_hidden_def. + (__pwrite64): Add libc_hidden_weak. + * sysdeps/posix/sigsuspend.c (__sigsuspend): Add libc_hidden_def. + * sysdeps/sparc/sparc64/rawmemchr.S (__rawmemchr): Likewise. + * sysdeps/sparc/sparc64/stpncpy.S (__stpncpy): Likewise. + * sysdeps/standalone/close.c (__close): Likewise. + * sysdeps/standalone/write.c (__libc_write): Likewise. + (__write): Add libc_hidden_weak. + * sysdeps/standalone/read.c (__read): Likewise. + (__libc_read): Add libc_hidden_def. + * sysdeps/unix/grantpt.c (grantpt): Remove INTUSE. + * sysdeps/unix/bsd/m68k/pipe.S (__pipe): Add libc_hidden_def. + * sysdeps/unix/bsd/osf/alpha/pipe.S (__pipe): Likewise. + * sysdeps/unix/bsd/vax/pipe.S (__pipe): Likewise. + * sysdeps/unix/bsd/syscalls.list (__GI___getpagesize): Likewise. + * sysdeps/unix/bsd/poll.c (__poll): Likewise. + * sysdeps/unix/bsd/sigaction.c (__sigaction): Likewise. + * sysdeps/unix/bsd/sigsuspend.c (__sigsuspend): Likewise. + * sysdeps/unix/common/syscalls.list (__GI___getpgid, __GI___setpgid, + __GI___sigaction): Add. + * sysdeps/unix/i386/pipe.S (__pipe): Add libc_hidden_def. + * sysdeps/unix/inet/syscalls.list (__GI___send): Add. + * sysdeps/unix/mips/pipe.S (__pipe): Add libc_hidden_def. + * sysdeps/unix/sparc/pipe.S (__pipe): Likewise. + * sysdeps/unix/sysv/irix4/syscalls.list (__GI___getpgid, + __GI___setpgid): Add. + * sysdeps/unix/sysv/aix/chown.c (__chown): Add libc_hidden_def. + Remove undef and INTDEF. + * sysdeps/unix/sysv/aix/getpgid.c (__getpgid): Likewise. + * sysdeps/unix/sysv/aix/write.c (__write, __libc_write): Likewise. + * sysdeps/unix/sysv/aix/close.c (__close): Add libc_hidden_def. + * sysdeps/unix/sysv/aix/getpid.c (__getpid): Likewise. + * sysdeps/unix/sysv/aix/pipe.c (__pipe): Likewise. + * sysdeps/unix/sysv/aix/read.c (__read, __libc_read): Likewise. + * sysdeps/unix/sysv/aix/poll.c (__poll): Likewise. + * sysdeps/unix/sysv/aix/sbrk.c (__sbrk): Likewise. + * sysdeps/unix/sysv/aix/sigaction.c (__sigaction): Likewise. + * sysdeps/unix/sysv/aix/sigsuspend.c (__sigsuspend): Likewise. + * sysdeps/unix/sysv/aix/statfs.c (__statfs): Likewise. + * sysdeps/unix/sysv/aix/select.c (__select): Likewise. + * sysdeps/unix/sysv/aix/setpgid.c (__setpgid): Likewise. + * sysdeps/unix/sysv/linux/alpha/pipe.S (__pipe): Likewise. + * sysdeps/unix/sysv/linux/alpha/syscalls.list (__GI___pwrite64, + __GI___statfs, __GI___send): Add. + * sysdeps/unix/sysv/linux/alpha/select.S (__select): Add + libc_hidden_ver resp. libc_hidden_def. + * sysdeps/unix/sysv/linux/alpha/sigsuspend.S (__sigsuspend): Add + libc_hidden_def. + * sysdeps/unix/sysv/linux/ia64/getpagesize.c (__getpagesize): + Likewise. Remove undef and INTDEF. + * sysdeps/unix/sysv/linux/ia64/pipe.S (__pipe): Add libc_hidden_def. + * sysdeps/unix/sysv/linux/ia64/syscalls.list (__GI___pwrite64, + __GI___statfs, __GI___send): Add. + * sysdeps/unix/sysv/linux/ia64/sigaction.c (__sigaction): Add + libc_hidden_def. + * sysdeps/unix/sysv/linux/ia64/sigsuspend.c (__sigsuspend): + Likewise. + * sysdeps/unix/sysv/linux/sh/pipe.S (__pipe): Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/chown.c (__chown): Add + libc_hidden_ver resp. libc_hidden_def. + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (__GI___pwrite64, + __GI___send): Add. + * sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c (__sigaction): + Add libc_hidden_weak. + * sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c (__sigsuspend): + Add libc_hidden_def. + * sysdeps/unix/sysv/linux/hppa/syscalls.list (__GI___send): Add. + * sysdeps/unix/sysv/linux/arm/sigaction.c (__sigaction): Add + libc_hidden_weak. + * sysdeps/unix/sysv/linux/i386/chown.c (__chown): Add libc_hidden_ver + resp. libc_hidden_def. + * sysdeps/unix/sysv/linux/i386/sigaction.c (__sigaction): Add + libc_hidden_weak. + * sysdeps/unix/sysv/linux/m68k/chown.c (__chown): Likewise. Remove + INTDEF. + * sysdeps/unix/sysv/linux/m68k/getpagesize.c (__getpagesize): + Likewise. Remove undef. + * sysdeps/unix/sysv/linux/mips/pwrite64.c (__pwrite64): Add + libc_hidden_weak. + * sysdeps/unix/sysv/linux/mips/syscalls.list (__GI___send): Add. + * sysdeps/unix/sysv/linux/mips/sigaction.c (__sigaction): Add + libc_hidden_weak. + * sysdeps/unix/sysv/linux/powerpc/chown.c (__chown): Add + libc_hidden_def. + * sysdeps/unix/sysv/linux/powerpc/pwrite64.c (__pwrite64): Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/getpagesize.c (__getpagesize): + Likewise. Remove undef and INTDEF. + * sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S (__pipe): Add + libc_hidden_def. + * sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c (__sigaction): Add + libc_hidden_weak. + * sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S (__pipe): Add + libc_hidden_def. + * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list + (__GI___pwrite64, __GI___statfs, __GI___select, __GI___send): Add. + * sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c (__sigaction): Add + libc_hidden_weak. + * sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c (__sigsuspend): + Add libc_hidden_def. + * sysdeps/unix/sysv/linux/x86_64/syscalls.list (__GI___pwrite64, + __GI___statfs): Add. + * sysdeps/unix/sysv/linux/x86_64/send.c (__send): Add + libc_hidden_weak. + * sysdeps/unix/sysv/linux/x86_64/sigaction.c (__sigaction): Likewise. + * sysdeps/unix/sysv/linux/getpagesize.c: Add libc_hidden_def. + Remove undef and INTDEF. + * sysdeps/unix/sysv/linux/poll.c (__poll): Add libc_hidden_def. + * sysdeps/unix/sysv/linux/pwrite64.c (__pwrite64): Add + libc_hidden_def. + * sysdeps/unix/sysv/linux/send.S (__send): Likewise. + * sysdeps/unix/sysv/linux/sigaction.c (__sigaction): Add + libc_hidden_weak. + * sysdeps/unix/sysv/linux/sigsuspend.c (__sigsuspend): Add + libc_hidden_def. + * sysdeps/unix/sysv/sco3.2.4/__setpgid.c (__setpgid): Likewise. + * sysdeps/unix/sysv/sco3.2.4/sigaction.S (__sigaction): Likewise. + * sysdeps/unix/sysv/sysv4/solaris2/syscalls.list (__GI___sigaction): + Add. + * sysdeps/unix/sysv/sysv4/__getpgid.c (__getpgid): Add + libc_hidden_def. Remove undef and INTDEF. + * sysdeps/unix/sysv/sysv4/getpgid.c (__getpgid): Likewise. + * sysdeps/unix/sysv/sysv4/__setpgid.c (__setpgid): Add + libc_hidden_def. + * sysdeps/unix/sysv/sysv4/setpgid.c (__setpgid): Likewise. + * sysdeps/unix/sysv/sysv4/sigaction.c (__sigaction): Likewise. + * sysdeps/unix/sysv/sigaction.c (__sigaction): Likewise. + * sysdeps/unix/getpagesize.c (__getpagesize): Add libc_hidden_def. + Remove undef and INTDEF. + * configure.in (HAVE_BROKEN_VISIBILITY_ATTRIBUTE): Add check for + broken visibility attribute handling. + * config.h.in (HAVE_BROKEN_VISIBILITY_ATTRIBUTE): Add. + +2002-08-02 Ulrich Drepper + + * locale/iso-639.def: Add entries for Venda and Nothern Sotho. + Reported by Dwayne Bailey . + + * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr_r): Adapt + previous patch. + +2002-06-29 Todd Fries + + * resolv/gethnamaddr.c (gethostbyaddr): Try ip6.int if ip6.arpa fails. + +2002-08-02 Jakub Jelinek + + * include/errno.h: Don't include tls.h if _ISOMAC is defined. + +2002-07-30 Roland McGrath + + * resolv/resolv.h (_res): Define macro unconditionally. + [! _LIBC_REENTRANT] (_res): Move this conditional decl to ... + * include/resolv.h: ... here. + [USE_TLS && HAVE___THREAD] (_res): #undef it and declare + as a __thread variable. + * resolv/res_libc.c [USE_TLS && HAVE___THREAD] (_res): Define it as + a __thread variable instead of a global. + * resolv/res_data.c [_LIBC]: Don't #undef _res. + + * include/errno.h: Include to make sure USE_TLS defined by the + time we test it. + + * intl/loadmsgcat.c [__GNUC__]: #undef alloca before defining it. + + * malloc/malloc.c [_LIBC]: Include instead of using local + decls of memset and memcpy. + + * sysdeps/generic/sysdep.h (END): Conditionalize on [__ASSEMBLER__]. + * sysdeps/unix/sysv/linux/i386/sysdep.h (L): Likewise. + + * elf/dl-load.c (_dl_map_object_from_fd): Comment fix. + + * sysdeps/generic/bits/libc-tsd.h [USE_TLS && HAVE___THREAD] + (__libc_tsd_define): Define using __thread. + + * sunrpc/rpc_thread.c: Use __libc_tsd_define. + (__rpc_thread_variables): Use __libc_tsd_get. + (__rpc_thread_destroy): Use __libc_tsd_get instead of calling + __rpc_thread_variables, which might allocate what we're about to free. + + * inet/herrno.c [USE_TLS && HAVE___THREAD] (h_errno): Define as a + thread-local variable. + * resolv/netdb.h (h_errno): Define macro unconditionally. + [_LIBC] (__set_h_errno): Macro moved to ... + * include/netdb.h: ... here. + [USE_TLS && HAVE___THREAD] (h_errno): Declare __thread variable. + [USE_TLS && HAVE___THREAD] (__set_h_errno): Define using that. + [! _LIBC_REENTRANT]: #undef h_errno here. + + * include/errno.h: Protect from multiple inclusion. + + * misc/sys/select.h (__NFDBITS, __FDELT, __FDMASK): #undef these + before defining them, since Linux's might have + defined them. + +2002-08-02 Jakub Jelinek + + * malloc/malloc.c (public_cALLOc): Check for overflow on + multiplication. + * sunrpc/xdr_array.c (xdr_array): Likewise. + * sunrpc/rpc/types.h (mem_free): Add comment. + Patch by Solar Designer . + +2002-08-02 Jakub Jelinek + + * sysdeps/unix/sysv/linux/kernel-features.h + (__ASSUME_SET_THREAD_AREA_SYSCALL): Define. + +2002-08-01 Roland McGrath + + * libio/fileops.c (_IO_file_sync_mmap): New function. + (_IO_file_jumps_mmap): Use it. + (_IO_file_underflow_mmap): Rewritten. If after EOF or fflush, + repeat the stat check and resize the mapped buffer as necessary. + +2002-07-31 Roland McGrath + + * libio/fileops.c (decide_maybe_mmap): New static function. + Code taken from libio/iofopen.c:__fopen_maybe_mmap to try to + mmap the file contents. Then switch the jump tables to the mmap + tables if it worked, or the vanilla file tables if not. + (_IO_file_underflow_maybe_mmap): New function. + (_IO_file_seekoff_maybe_mmap): New function. + (_IO_file_xsgetn_maybe_mmap): New function. + (_IO_file_jumps_maybe_mmap): New variable, jump table using those. + * libio/libioP.h: Declare those. + * libio/wfileops.c (_IO_wfile_underflow_maybe_mmap): New function. + (_IO_wfile_jumps_maybe_mmap): New variable, jump table using that. + * libio/iofopen.c (__fopen_maybe_mmap): Don't try to mmap here. + If the stream is read-only, set its jump tables to those new ones. + * libio/iofdopen.c (_IO_new_fdopen) [_G_HAVE_MMAP]: Set the initial + jump tables to the maybe_mmap ones, and don't call __fopen_maybe_mmap. + We need the tables set before _IO_file_attach. + + * libio/tst-mmap-eofsync.c: New file. + * libio/tst-mmap-fflushsync.c: New file. + * libio/bug-mmap-fflush.c: New file. + * libio/tst-mmap2-eofsync.c: New file. + * libio/Makefile (tests): Add them. + + * libio/wfileops.c (_IO_wfile_underflow_mmap): Don't set EOF bit when + _IO_file_underflow_mmap fails, it already set the appropriate bit. + +2002-07-31 Jeff Bailey + + * libio/stdio.h (sys_errlist, sys_nerr, _sys_errlist, _sys_nerr): + Declarations moved to . Include that file. + * libio/Makefile (headers): Add bits/sys_errlist.h to the list. + * sysdeps/generic/bits/sys_errlist.h: New file. This does *not* + declare sys_errlist and sys_nerr. + * sysdeps/unix/sysv/linux/bits/sys_errlist.h: New file. Does + provide declarations. + +2002-07-31 Roland McGrath + + * elf/rtld.c (dl_main): Fix typo in error message. + +2002-07-31 Roland McGrath + + * sysdeps/mach/hurd/Versions (ld: GLIBC_2.0): __fxstat -> __fxstat64, + __xstat -> __xstat64, __lseek -> __libc_lseek64. Completes 2002-06-09 + sysdeps/mach/hurd/dl-sysdep.c change. + +2002-07-28 Ulrich Drepper + + * sysdeps/unix/sysv/linux/configure.in: Check /lib/modules/`uname + -r`/build/include for kernel headers. + + * po/fi.po: New file. + +2002-07-15 Alexandre Oliva + + * configure.in (static_nss): Set to `yes' if --disable-shared. + +2002-07-23 Bruno Haible + + * intl/loadmsgcat.c (PRI*): Redefine the macros if PRI_MACROS_BROKEN + is set. + +2002-07-25 Jakub Jelinek + + * sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h: New file. + * sysdeps/unix/sysv/linux/ia64/profil-counter.h: Fix profil_counter + arguments. + +2002-07-25 Jakub Jelinek + + * sysdeps/unix/sysv/linux/alpha/adjtime.c (__adjtimex_internal): Add + alias. + +2002-07-21 Bruno Haible + + * intl/libintl.h (__GNU_GETTEXT_SUPPORTED_REVISION): New macro. + * intl/gettext.h (struct mo_file_header): New fields n_sysdep_segments, + sysdep_segments_offset, n_sysdep_strings, orig_sysdep_tab_offset, + trans_sysdep_tab_offset. + (struct sysdep_segment): New type. + (struct sysdep_string): New type. + (SEGMENTS_END): New macro. + * intl/gettextP.h (struct sysdep_string_desc): New type. + (struct loaded_domain): New fields malloced, n_sysdep_strings, + orig_sysdep_tab, trans_sysdep_tab, must_swap_hash_tab. Make fields + orig_tab, trans_tab, hash_tab to const pointers because they point + into read-only memory. + * intl/loadmsgcat.c: Include stdint.h, inttypes.h, hash-string.h. + (PRI*): Define fallback values. + (get_sysdep_segment_value): New function. + (_nl_load_domain): Distinguish major and minor revision parts. Add + support for minor revision 1 with system dependent strings. + (_nl_unload_domain): Also free the 'malloced' field. + * intl/dcigettext.c (_nl_find_msg): Remove test for domain->hash_size, + now done in loadmsgcat.c. Add support for system dependent strings. + +2002-07-16 Stepan Kasal + + * posix/bug-regex7.c: New file. + * posix/bug-regex8.c: New file. + * posix/Makefile (tests): Add bug-regex7 and bug-regex8. + +2002-07-16 Stepan Kasal + + * posix/bug-regex4.c (main): Fix typos. + * posix/bug-regex6.c (main): Likewise. + +2002-07-27 Ulrich Drepper + + * posix/bug-regex6.c (main): Fix warnings. + + * iconvdata/Makefile (CPPFLAGS): Add NOT_IN_libc. + + * iconv/iconv_prog.c (main): Improve error message for the cases + where -t and/or -f parameter are missing. + +2002-07-10 Stepan Kasal + + * posix/regexec.c (re_match): Reorganize to remove duplicate code. + (re_search): Likewise. + (re_match_2): Likewise. + (re_search_2): Likewise. + (re_search_stub): New function. + (re_search_2_stub): New function. + * regcomp.c (re_compile_pattern): Typo in a comment fixed. + +2002-07-10 Isamu Hasegawa + + * posix/regex_internal.h: Add new member STOP to struct re_string_t. + (re_string_eoi): Use STOP instead of LEN. + * posix/regex_internal.c (re_string_allocate): Initialize pstr->len. + (re_string_construct): Likewise. + (re_string_reconstruct): Adjust pstr->stop like pstr->len. + * posix/regexec.c (re_search_internal): Add a new argument STOP + so that it can handle the argument STOP of re_search_2 and re_match_2 + correctly. + (regexec): Adapt to new I/F of re_search_internal. + (re_search_stub): Likewise. + +2002-07-25 Ulrich Drepper + + * sunrpc/clnt_gen.c: Don't include . + + * elf/dl-minimal.c: Remove definition of __assert_perror_fail. + + * sysdeps/wordsize-32/divdi3.c: Define __divdi3_internal. + * sysdeps/wordsize-32/lldiv.c: Make gcc use __divdi3_internal instead + of __divdi3. + + * sysdeps/unix/sysv/linux/adjtime.c: Use __adjtimex_internal. + * sysdeps/unix/sysv/linux/ntp_gettime.c: Likewise. + * sysdeps/unix/sysv/linux/syscalls.list: Add __adjtimex_internal + alias for adjtimex syscall. + + * elf/dl-minimal.c: Define __assert_fail_internal. + * assert/assert.c: Likewise. + * include/assert.h: Define __assert_file macro if !SHARED and not + NOT_IN_libc. + + * iconv/Makefile: Define NOT_IN_libc for objects in standalone + programs. + * locale/Makefile: Likewise. + * nscd/Makefile: Likewise. + * catgets/Makefile: Likewise. + +2002-07-24 Ulrich Drepper + + * libio/fileops.c (_IO_file_seekoff_mmap): Do use fp->_offset to + compute current position. + + * stdio-common/tst-fseek.c (main): Improve error messages. + + * libio/tst-freopen.c (main): Remove unused variable. + + * libio/fileops.c (_IO_file_seekoff_mmap): Set fp->_offset after + succesful seek call. Simplify error checking. + +2002-07-25 Jakub Jelinek + + * config.h.in: Use __ASSEMBLER__ test macro not ASSEMBLER. + * sysdeps/ia64/fpu/libm_support.h: Likewise. + +2002-07-19 Roland McGrath + + * hurd/hurdsig.c (_hurdsig_getenv): Always return null if + __libc_enable_secure is set. + +2002-07-24 Roland McGrath + + Added interface with functions `getifaddrs', `freeifaddrs'. + This implementation supports only IPv4. + * inet/ifaddrs.h: New file. + * sysdeps/generic/ifaddrs.c: New file. + * sysdeps/gnu/ifaddrs.c: New file. + * inet/test-ifaddrs.c: New file. + * inet/Makefile (routines): Add ifaddrs. + (headers): Add ifaddrs.h here. + (tests): Add test-ifaddrs. + * inet/Versions (GLIBC_2.3): New set, add getifaddrs and freeifaddrs. + + * resolv/res_hconf.c (_res_hconf_reorder_addrs): Use an explicit + socket call to get an AF_INET socket, instead of using __opensock. + The SIOCGIFNETMASK ioctl will work only with a PF_INET socket. + + * sysdeps/generic/ifreq.h (__ifreq): Take third argument SOCKFD, + if not -1 use it instead of calling __opensock. + * sysdeps/unix/sysv/linux/ifreq.h (__ifreq): Likewise. + * sysdeps/mach/hurd/ifreq.h (__ifreq): Take new argument and ignore it. + * resolv/res_hconf.c (_res_hconf_reorder_addrs): Pass new argument. + + * sysdeps/mach/hurd/ifreq.h: New file. + * sysdeps/generic/ifreq.h (__if_freereq): Take second argument NUM_IFS. + * sysdeps/unix/sysv/linux/ifreq.h (__if_freereq): Likewise. + * resolv/res_hconf.c (_res_hconf_reorder_addrs): Update caller. + + * libio/fileops.c (_IO_file_seekoff_mmap): Don't rely on FP->_offset, + which gets moved around. Calculate size of mmap'd buffer instead. + +2002-07-24 Philip Blundell + + * sysdeps/unix/arm/brk.S: Improve schedule. + * sysdeps/unix/sysv/linux/arm/socket.S (PUSHARGS_1): Use more + efficient instruction. + (__socket): Optimize return sequence. + +2002-07-24 Ulrich Drepper + + * sysdeps/unix/sysv/linux/opensock.c (__opensock): Prefer inet + sockets on old kernels. + +2002-07-22 Philip Blundell + + * sysdeps/unix/sysv/linux/arm/errlist.c: Remove extra weak alias + definiton of _old_sys_nerr. Define _old_sys_errlist as strong + alias. + +2002-07-24 Ulrich Drepper + + * locale/hashval.h: Make more self-contained by defining LONG_BITS. + * locale/programs/simple-hash.c: Remove LONG_BITS definition. + + * locale/programs/locarchive.c (add_locale_to_archive): Correct + test to detect duplicate locales. + + * libio/fileops.c (_IO_new_file_seekoff): Fail if relative + position would be before beginning of file. + (_IO_file_seekoff_mmap): Likewise. + * libio/Makefile (tests): Add bug-fseek. + * libio/bug-fseek.c: New file. + + * intl/explodename.c: Remove support for CEN-style locale variables. + It was never used and shouldn't be since it's not portable. + * intl/finddomain.c: Likewise. + * intl/l10nflist.c: Likewise. + * intl/loadinfo.h: Likewise. + * locale/findlocale.c: Likewise. + +2002-07-24 Roland McGrath + + * libio/fileops.c (_IO_file_seekoff_mmap): When just examining the + position, calculate it to take into account an active pushback buffer. + + * libio/Makefile (tests): Add bug-ungetc. + * libio/bug-ungetc.c: New file. + +2002-07-23 Ulrich Drepper + + * sysdeps/generic/libc-tls.c: New file. + * csu/Makefile (routines): Add libc-tls. + (static-only-routines): Add libc-tls. + * elf/dl-support.c (_dl_phdr): New variable. + (_dl_phnum): New variable. + (_dl_aux_init): Initialize _dl_phdr and _dl_phnum from aux vector. + * sysdeps/generic/libc-start.c (__libc_start_main): Reorganize code + for !SHARED. First look through auxiliary vector. If TLS always + call __pthread_initialize_minimal. + + * sysdeps/generic/dl-tls.c (_dl_allocate_tls): Make sure size argument + in mmap call is never zero. + +2002-07-23 Andreas Jaeger + + * sysdeps/x86_64/fpu/s_copysign.S: Use optimized version. + * sysdeps/x86_64/fpu/s_copysignf.S: Likewise. + +2002-07-22 Ulrich Drepper + + * libio/tst-eof.c: Rewrite to let test-skeleton.c deal with + creation and removal of the temp file. + + * libio/bug-rewind.c: Use test skeleton. Use create_temp_file for + file creation. + * test-skeleton.c (create_temp_file): New function. + +2002-07-22 Andreas Jaeger + + * sysdeps/x86_64/dl-machine.h (elf_machine_load_address): Use + local label. + +2002-07-21 Roland McGrath + + * wcsmbs/Makefile (strtox-CFLAGS): New variable, + put -I../include before -I../stdlib so we get the right errno.h et al. + (CFLAGS-wcstod.c): Use that variable instead of -I../stdlib. + (CFLAGS-wcstof.c): Likewise. + (CFLAGS-wcstold.c): Likewise. + (CFLAGS-wcstod_l.c): Likewise. + (CFLAGS-wcstof_l.c): Likewise. + (CFLAGS-wcstold_l.c): Likewise. + +2002-07-19 Roland McGrath + + * sysdeps/mach/hurd/errnos.awk: Remove __set_errno defn from output. + +2002-07-20 Ulrich Drepper + + * sysdeps/unix/sysv/linux/ldsodefs.h (HAVE_AUX_XID): Define if + __ASSUME_AT_XID is defined. + * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_AT_XID): Define + for 2.4.1 and up. + * sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Optimize handling + of AT_UID, AT_EUID, AT_GID, and AT_EGID. + + * wcsmbs/Makefile (CFLAGS-wcstod.c): Add -I../stdlib. + (CFLAGS-wcstof.c): Likewise. + (CFLAGS-wcstold.c): Likewise. + (CFLAGS-wcstod_l.c): Likewise. + (CFLAGS-wcstof_l.c): Likewise. + (CFLAGS-wcstold_l.c): Likewise. + +2002-07-18 Jakub Jelinek + + * resource/sys/resource.h (__rlimit_resource_t, __rusage_who_t, + __priority_which_t): Always typedef to int for C++. + +2002-07-19 Ulrich Drepper + + * configure.in: Add test for __thread support in compiler. + * config.h.in: Add HAVE___THREAD. + * Makefile (headers): Remove errno.h, sys/errno.h, and bits/errno.h. + * include/sys/errno.h: Moved to... + * stdlib/sys/errno.h: ...here. New file. + * stdlib/errno.h: New file. Moved from... + * include/errno.h: ...here. Changed into an internal header defining + libc-local things like __set_errno. + * stdlib/Makefile (headers): Add errno.h, sys/errno.h, and + bits/errno.h. + * elf/dl-minimal.c: Include . Define errno as thread-local + variable if USE_TLS && HAVE___THREAD. Don't define __errno_location + either. + * elf/rtld.c (_dl_start): Add code to initialize TLS for ld.so + from... + (_dl_start_final): ...here. Add code to initialize tls elements from + bootstrap_map. + * sysdeps/generic/errno-loc.c: Define errno as thread-local variable + if USE_TLS && HAVE___THREAD. + * sysdeps/generic/bits/errno.h: Remove __set_errno definition. + * sysdeps/mach/hurd/bits/errno.h: Likewise. + * sysdeps/standalone/arm/bits/errno.h: Likewise. + * sysdeps/standalone/bits/errno.h: Likewise. + * sysdeps/unix/bsd/bsd4.4/bits/errno.h: Likewise. + * sysdeps/unix/sysv/aix/bits/errno.h: Likewise. + * sysdeps/unix/sysv/hpux/bits/errno.h: Likewise. + * sysdeps/unix/sysv/linux/bits/errno.h: Likewise. + * sysdeps/unix/sysv/linux/hppa/bits/errno.h: Likewise. + * sysdeps/unix/sysv/linux/mips/bits/errno.h: Likewise. + * sysdeps/unix/sysv/sysv4/solaris2/bits/errno.h: Likewise. + * sysdeps/i386/dl-machine.c (elf_machine_rel) [RTLD_BOOTSTRAP]: Don't + use GL(dl_rtld_map), use map parameter. + * sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise. + * sysdeps/unix/sysv/linux/i386/sysdep.S: Define errno in .tbss if + USE_TLS && HAVE___THREAD. + * sysdeps/unix/sysv/linux/i386/sysdep.h: Unify SETUP_PIC_REG + definitions. If USE_TLS && HAVE___THREAD store errooor value using + TLS code sequence. + * sysdeps/unix/sysv/linux/i386/i686/sysdep.h: Likewise. + + * sysdeps/unix/sysv/linux/getcwd.c: No real need to restore errno. + * sysdeps/unix/sysv/linux/grantpt.c: Likewise. + * sysdeps/unix/sysv/linux/internal_statvfs.c: Likewise. + * sysdeps/unix/sysv/linux/msgctl.c: Likewise. + * sysdeps/unix/sysv/linux/readv.c: Likewise. + * sysdeps/unix/sysv/linux/writev.c: Likewise. + +2002-07-17 Ulrich Drepper + + * sysdeps/unix/sysv/linux/ia64/bits/mman.h: Fix MS_SYNC and + MS_INVALIDATE values. + +2002-07-17 Andreas Schwab + Ulrich Drepper + + * sysdeps/unix/sysv/linux/pread.c: Sign extend offset. + * sysdeps/unix/sysv/linux/pwrite.c: Likewise. + * sysdeps/unix/sysv/linux/mips/pread.c: Likewise. + * sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise. + +2002-07-01 H.J. Lu + + * elf/circleload1.c (load_dso): Call "circlemod1" and check + return value. + + * elf/circlemod1.c (circlemod1): Return int. + * elf/circlemod2.c (circlemod2): Likewise. + * elf/circlemod2a.c (circlemod2): Likewise. + * elf/circlemod3.c (circlemod3): Likewise. + (circlemod3a): A new function. + +2002-07-16 Ulrich Drepper + + * catgets/tst-catgets.c (main): Don't expect results for + untranslated messages. + + * glibcbug.in: Fix little typo. Remove STDIO. + + * config.h.in: Fail if __FAST_MATH__ is defined. + * math/Makefile (CPPFLAGS-test-ifloat.c): Also define TEST_FAST_MATH. + (CPPFLAGS-test-idouble.c): Likewise. + (CPPFLAGS-test-ildouble.c): Likewise. + +2002-07-15 Ulrich Drepper + + * intl/tst-gettext.sh: Pass -f option to msgfmt. + * intl/tst-gettext.c: Correctly handle untranslated messages in + positive tests. + + * po/de.po: Update from translation team. + +2002-07-02 H.J. Lu + + * sysdeps/mips/atomicity.h: Don't include . Always + use ll/sc. + * sysdeps/unix/sysv/linux/mips/sys/tas.h: Likewise. + + * sysdeps/unix/sysv/linux/configure.in: Set arch_minimum_kernel + to 2.4.0 for mips. + +2002-07-15 Ulrich Drepper + + * elf/dl-load.c (_dl_map_object_from_fd): If loaded object uses + TLS fail if USE_TLS is not defined. + + * libio/wfileops.c (_IO_wfile_seekoff): Reposition wide pointers + and adjust state for seek position. [PR libc/4070] + * libio/Makefile (tests): Add bug-rewind. + * libio/bug-rewind.c: New file. + +2002-07-12 Philip Blundell + + * sysdeps/generic/backtrace.c (FIRST_FRAME_POINTER): New macro. + (__backtrace): Use it. + * sysdeps/arm/frame.h (FIRST_FRAME_POINTER): Define. [PR libc/2632] + +2002-07-12 Philip Blundell + + * sysdeps/arm/dl-machine.h (elf_machine_rel): Don't handle + R_ARM_RELATIVE if RTLD_BOOTSTRAP and HAVE_Z_COMBRELOC. Only check + for rtld map if neither RTLD_BOOTSTRAP nor HAVE_Z_COMBRELOC is defined. + (elf_machine_rela): Remove unused variable. + + * sysdeps/unix/sysv/linux/arm/Makefile [subdir=elf] + (sysdep-rtld-routines, sysdep_routines, sysdep-dl-routines): Don't + define. + +2002-07-12 Ulrich Drepper + + * iconvdata/gconv-modules: Add aliases for ISO-8859-11. + +2002-07-14 Andreas Jaeger + + * sysdeps/x86_64/bits/link.h: Add biarch support. + +2002-07-13 Andreas Jaeger + + * sysdeps/unix/sysv/linux/mips/register-dump.h (register_dump): + Use correct indices. + Patch by Eliot Dresselhaus . + +2002-07-09 Martin Schwidefsky + + * sysdeps/s390/bits/byteswap.h: Unified 31/64 bit byteswap.h. + * sysdeps/s390/s390-32/bits/byteswap.h: Remove. + * sysdeps/s390/s390-64/bits/byteswap.h: Remove. + * sysdeps/s390/bits/link.h: Unified 31/64 bit link.h. + * sysdeps/s390/s390-32/bits/link.h: Remove. + * sysdeps/s390/s390-64/bits/link.h: Remove. + * sysdeps/s390/bits/setjmp.h: Unified 31/64 bit setjmp.h. + * sysdeps/s390/s390-32/bits/setjmp.h: Remove. + * sysdeps/s390/s390-64/bits/setjmp.h: Remove. + * sysdeps/s390/bits/wordsize.h: New file. + * sysdeps/unix/sysv/linux/s390/bits/elfclass.h: Unified 31/64 bit + elfclass.h. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/elfclass.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Unified 31/64 bit fcntl.h. + * sysdeps/unix/sysv/linux/s390/s390-32/bits/fcntl.h: Remove. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/fcntl.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/ipc.h: Unified 31/64 bit ipc.h. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/ipc.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/mman.h: Unified 31/64 bit mman.h. + * sysdeps/unix/sysv/linux/s390/s390-32/bits/mman.h: Remove. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/mman.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/msq.h: Unified 31/64 bit msq.h. + * ysdeps/unix/sysv/linux/s390/s390-64/bits/msq.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/resource.h: Unified 31/64 bit + resource.h. + * sysdeps/unix/sysv/linux/s390/s390-32/bits/resource.h: Remove. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/resource.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/sem.h: Unified 31/64 bit sem.h. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/sem.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/shm.h: Unified 31/64 bit shm.h. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/shm.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/sigaction.h: Unified 31/64 bit + sigaction.h. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/sigaction.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/siginfo.h: Unified 31/64 bit + siginfo.h. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/siginfo.h: Remove. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/sigstack.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/socket.h: Unified 31/64 bit + socket.h. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/socket.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/stat.h: Unified 31/64 bit stat.h. + * sysdeps/unix/sysv/linux/s390/s390-32/bits/stat.h: Remove. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/stat.h: Remove. + * sysdeps/unix/sysv/linux/s390/bits/types.h: Unified 31/64 bit types.h. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/types.h: Remove. + * sysdeps/unix/sysv/linux/s390/net/route.h: New file. + * sysdeps/unix/sysv/linux/s390/sys/procfs.h: Unified 31/64 bit + procfs.h. + * sysdeps/unix/sysv/linux/s390/s390-32/sys/procfs.h: Remove. + * sysdeps/unix/sysv/linux/s390/s390-64/sys/procfs.h: Remove. + * sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Unified 31/64 bit + ucontext.h. + * sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h: Remove. + * sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h: Remove. + +2002-07-11 Ulrich Drepper + + * Versions.def (libc): Add GLIBC_2.3. + * stdlib/Versions [libc] (GLIBC_2.3): Add realpath. + * stdlib/canonicalize.c: Add compatibility version for realpath + and make new code available in GLIBC_2.3. + +2002-07-06 Bruno Haible + + * malloc/hooks.c (public_gET_STATe): Access max_total_mem in mp_. + +2002-07-11 Ulrich Drepper + + * resolv/res_hconf.c (_res_hconf_init): Move code into new + function do_init. Use __libc_once. + (do_init): New function. + + * iconvdata/iso8859-11.h: Removed. + * iconvdata/Makefile (gen-8bit-gap-modules): Add iso8859-11. + (distribute): Remove iso8859-11.h. + * iconvdata/tst-tables.sh: Add ISO-8859-11. + + * stdio-common/vfscanf.c (inchar): Restore errno from previous + underflow operation if c == (W)EOF. + +2002-07-03 Jakub Jelinek + + * stdio-common/printf_fp.c (__printf_fp): If _FPIO_CONST_SHIFT is + non-zero, adjust exponent. + * sysdeps/ieee754/ldbl-128/s_erfl.c (__erfl, erfl, __erfcl, erfcl): + Remove NO_LONG_DOUBLE aliases. + * sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l, expm1l): Likewise. + * sysdeps/ieee754/ldbl-128/s_log1pl.c (__log1pl, log1pl): Likewise. + (__log1pl): Raise divide by zero and invalid exceptions when needed. + * sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Special case + 1**y and -1**+-Inf. + * sysdeps/ieee754/ldbl-128/ldbl2mpn.c (__mpn_extract_long_double): + Fix BITS_PER_MP_LIMB 32 extraction. + * sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Don't raise + exceptions for qNaNs. + * sysdeps/ieee754/ldbl-128/e_log10l.c (__ieee754_log10l): Likewise. + * sysdeps/ieee754/ldbl-128/e_lgammal_r.c (__ieee754_lgamma_r): + Raise exceptions when needed. Don't recurse unnecessarily. + Special case 1.0L and 2.0L arguments to avoid -0.0L as result. + * sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_y0l): Don't raise + exceptions for qNaNs. + * sysdeps/ieee754/ldbl-128/s_remquol.c (__remquol): Make qs 64-bit + to fix *quo return value sign. + * sysdeps/ieee754/ldbl-128/e_gammal_r.c (__ieee754_gamma_r): Special + case -Inf argument. + * soft-fp/op-4.h (_FP_FRAC_CLZ_4): Fix a pasto. + +2002-07-01 Jakub Jelinek + + * libio/tst-eof.c (do_test): Remove unused ch and tm variables. + * iconvdata/iso-2022-jp-3.c (EMIT_SHIFT_TO_INIT): Kill warnings if + -DNDEBUG. + +2002-07-10 Ulrich Drepper + + * malloc/hooks.c (realloc_check): If mremap succeeds actually use + the result. + + * sysdeps/i386/i486/bits/string.h: Add early clobber for "a" + output parameter. Reported by Denis Zaitsev . + + * Versions.def (libthread_db): Add GLIBC_2.3. + +2002-07-09 Jakub Jelinek + + * libio/freopen.c (freopen): Reset jump tables, use mmap stdio for the + new stream if possible. + * libio/freopen64.c (freopen64): Likewise. + * libio/Makefile (tests): Add tst-freopen. + * libio/tst-freopen.c: New file. + +2002-07-03 Jakub Jelinek + + * libio/stdio.h (obstack_printf): Add format attribute. + (obstack_vprintf): Likewise. + +2002-07-04 Jakub Jelinek + + * posix/regex_internal.h (re_token_t): Shrink the structure to 8 + resp. 16 bytes on 32-bit resp. 64-bit platforms. + (re_charset_t, re_string_t): Reorder structure members for 64-bit + architectures. + +2002-07-04 Jakub Jelinek + + * posix/regcomp.c (re_compile_internal): Move clearing of dfa... + (init_dfa): ...here. + +2002-07-05 Isamu Hasegawa + + * posix/regcomp.c (parse_sub_exp): Add nodes OP_OPEN_SUBEXP and + OP_CLOSE_SUBEXP at both ends of sub expressions instead of SUBEXP + nodes in parse trees. + (calc_first): Fix the Definition of `firsts' of OP_OPEN_SUBEXP + and OP_CLOSE_SUBEXP, and remove the definition of SUBEXP. + (calc_epsdest): Treat OP_OPEN_SUBEXP and OP_CLOSE_SUBEXP as the + nodes which can epsilon transit. + * posix/regex_internal.h: Add OP_OPEN_SUBEXP and OP_CLOSE_SUBEXP + to IS_EPSILON_NODE macro. + * posix/regexec.c (update_regs): New function to update registers + by refering OP_OPEN_SUBEXP and OP_CLOSE_SUBEXP nodes. + (proceed_next_node): Use the entities of the nodes to determine + whether the node can transit to. + (set_regs): Use update_regs function to update registers. + +2002-07-03 Jakub Jelinek + + * posix/bug-regex4.c (main): Remove duplicate setlocale. + * posix/bug-regex6.c: New file. + * posix/Makefile (tests): Add bug-regex6. + (bug-regex6-ENV): Set LOCPATH. + +2002-07-10 Ulrich Drepper + + * Versions.def [libpthread]: Add GLIBC_2.2.6. + * posix/Versions [libc] (GLIBC_2.2.6): Add __nanosleep. + +2002-07-06 Bruno Haible + + * sysdeps/unix/sysv/sysv4/bits/sigset.h (__NSSBITS): Correct value. + +2002-07-06 Bruno Haible + + * include/sys/socket.h (__libc_sendto, __libc_recvfrom): New + declarations. + + * sysdeps/i386/fpu/libm-test-ulps: Add some ulps for AMD K7. + + * rt/Makefile (tests): Don't add tst-aio* in a single-threaded build. + + * sysdeps/unix/bsd/sun/sunos4/bits/utsname.h: Test for _SYS_UTSNAME_H, + not _UTSNAME_H. + * sysdeps/unix/bsd/ultrix4/bits/utsname.h: Likewise. + + * sysdeps/generic/bits/stropts.h: Protect against direct inclusion. + * sysdeps/generic/bits/ustat.h: Likewise. + + * sysdeps/unix/sysv/linux/bits/statvfs.h (ST_NODIRATIME): Set to 2048. + +2002-07-08 Andreas Jaeger + + * sysdeps/x86_64/elf/initfini.c (__asm__): Call call_gmon_start. + +2002-07-08 Andreas Jaeger + + * sysdeps/x86_64/fpu/s_fdiml.S: Fix wrong register name. + +2002-07-06 Andreas Jaeger + + * sysdeps/x86_64/fpu/bits/mathinline.h: New file. + * sysdeps/x86_64/fpu/s_copysign.S: New file. + * sysdeps/x86_64/fpu/s_copysignf.S: New file. + * sysdeps/x86_64/fpu/s_copysignl.S: New file. + * sysdeps/x86_64/fpu/s_finitel.S: New file. + * sysdeps/x86_64/fpu/s_fmax.S: New file. + * sysdeps/x86_64/fpu/s_fmaxf.S: New file. + * sysdeps/x86_64/fpu/s_fmaxl.S: New file. + * sysdeps/x86_64/fpu/s_fmin.S: New file. + * sysdeps/x86_64/fpu/s_fminf.S: New file. + * sysdeps/x86_64/fpu/s_fminl.S: New file. + +2002-06-05 Brian Youmans <3diff@gnu.org> + + * sysdeps/ia64/fpu/e_acos.S: Added text of Intel license. + * sysdeps/ia64/fpu/e_acosf.S: Likewise. + * sysdeps/ia64/fpu/e_acosl.S: Likewise. + * sysdeps/ia64/fpu/e_asin.S: Likewise. + * sysdeps/ia64/fpu/e_asinf.S: Likewise. + * sysdeps/ia64/fpu/e_asinl.S: Likewise. + * sysdeps/ia64/fpu/e_atan2.S: Likewise. + * sysdeps/ia64/fpu/e_atan2f.S: Likewise. + * sysdeps/ia64/fpu/e_cosh.S: Likewise. + * sysdeps/ia64/fpu/e_coshf.S: Likewise. + * sysdeps/ia64/fpu/e_coshl.S: Likewise. + * sysdeps/ia64/fpu/e_exp.S: Likewise. + * sysdeps/ia64/fpu/e_expf.S: Likewise. + * sysdeps/ia64/fpu/e_fmod.S: Likewise. + * sysdeps/ia64/fpu/e_fmodf.S: Likewise. + * sysdeps/ia64/fpu/e_fmodl.S: Likewise. + * sysdeps/ia64/fpu/e_hypot.S: Likewise. + * sysdeps/ia64/fpu/e_hypotf.S: Likewise. + * sysdeps/ia64/fpu/e_hypotl.S: Likewise. + * sysdeps/ia64/fpu/e_log.S: Likewise. + * sysdeps/ia64/fpu/e_logf.S: Likewise. + * sysdeps/ia64/fpu/e_pow.S: Likewise. + * sysdeps/ia64/fpu/e_powf.S: Likewise. + * sysdeps/ia64/fpu/e_powl.S: Likewise. + * sysdeps/ia64/fpu/e_remainder.S: Likewise. + * sysdeps/ia64/fpu/e_remainderf.S: Likewise. + * sysdeps/ia64/fpu/e_remainderl.S: Likewise. + * sysdeps/ia64/fpu/e_scalb.S: Likewise. + * sysdeps/ia64/fpu/e_scalbf.S: Likewise. + * sysdeps/ia64/fpu/e_scalbl.S: Likewise. + * sysdeps/ia64/fpu/e_sinh.S: Likewise. + * sysdeps/ia64/fpu/e_sinhf.S: Likewise. + * sysdeps/ia64/fpu/e_sinhl.S: Likewise. + * sysdeps/ia64/fpu/e_sqrt.S: Likewise. + * sysdeps/ia64/fpu/e_sqrtf.S: Likewise. + * sysdeps/ia64/fpu/e_sqrtl.S: Likewise. + * sysdeps/ia64/fpu/libm_atan2_req.S: Likewise. + * sysdeps/ia64/fpu/libm_error.c: Likewise. + * sysdeps/ia64/fpu/libm_frexp4.S: Likewise. + * sysdeps/ia64/fpu/libm_frexp4f.S: Likewise. + * sysdeps/ia64/fpu/s_frexpl.c: Likewise. + * sysdeps/ia64/fpu/s_ilogb.S: Likewise. + * sysdeps/ia64/fpu/s_ilogbf.S: Likewise. + * sysdeps/ia64/fpu/s_ilogbl.S: Likewise. + * sysdeps/ia64/fpu/s_ldexp.S: Likewise. + * sysdeps/ia64/fpu/s_ldexpf.S: Likewise. + * sysdeps/ia64/fpu/s_ldexpl.S: Likewise. + * sysdeps/ia64/fpu/s_log1p.S: Likewise. + * sysdeps/ia64/fpu/s_log1pf.S: Likewise. + * sysdeps/ia64/fpu/s_log1pl.S: Likewise. + * sysdeps/ia64/fpu/s_logb.S: Likewise. + * sysdeps/ia64/fpu/s_logbf.S: Likewise. + * sysdeps/ia64/fpu/s_logbl.S: Likewise. + * sysdeps/ia64/fpu/s_modf.S: Likewise. + * sysdeps/ia64/fpu/s_modff.S: Likewise. + * sysdeps/ia64/fpu/s_modfl.S: Likewise. + * sysdeps/ia64/fpu/s_nearbyint.S: Likewise. + * sysdeps/ia64/fpu/s_nearbyintf.S: Likewise. + * sysdeps/ia64/fpu/s_nearbyintl.S: Likewise. + * sysdeps/ia64/fpu/s_rint.S: Likewise. + * sysdeps/ia64/fpu/s_rintf.S: Likewise. + * sysdeps/ia64/fpu/s_rintl.S: Likewise. + * sysdeps/ia64/fpu/s_round.S: Likewise. + * sysdeps/ia64/fpu/s_roundf.S: Likewise. + * sysdeps/ia64/fpu/s_roundl.S: Likewise. + * sysdeps/ia64/fpu/s_scalbn.S: Likewise. + * sysdeps/ia64/fpu/s_scalbnf.S: Likewise. + * sysdeps/ia64/fpu/s_scalbnl.S: Likewise. + * sysdeps/ia64/fpu/s_significand.S: Likewise. + * sysdeps/ia64/fpu/s_significandf.S: Likewise. + * sysdeps/ia64/fpu/s_significandl.S: Likewise. + * sysdeps/ia64/fpu/s_tan.S: Likewise. + * sysdeps/ia64/fpu/s_tanf.S: Likewise. + * sysdeps/ia64/fpu/s_tanl.S: Likewise. + * sysdeps/ia64/fpu/s_trunc.S: Likewise. + * sysdeps/ia64/fpu/s_truncf.S: Likewise. + * sysdeps/ia64/fpu/s_truncl.S: Likewise. + * sysdeps/ieee754/dbl-64/doasin.c: Changed copyright notice to + reflect IBM donation of math library to FSF + * sysdeps/ieee754/dbl-64/dosincos.c: Likewise. + * sysdeps/ieee754/dbl-64/e_asin.c: Likewise. + * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise. + * sysdeps/ieee754/dbl-64/e_exp.c: Likewise. + * sysdeps/ieee754/dbl-64/e_log.c: Likewise. + * sysdeps/ieee754/dbl-64/e_pow.c: Likewise. + * sysdeps/ieee754/dbl-64/e_remainder.c: Likewise. + * sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise. + * sysdeps/ieee754/dbl-64/halfulp.c: Likewise. + * sysdeps/ieee754/dbl-64/mpa.c: Likewise. + * sysdeps/ieee754/dbl-64/mpatan.c: Likewise. + * sysdeps/ieee754/dbl-64/mpatan2.c: Likewise. + * sysdeps/ieee754/dbl-64/mpexp.c: Likewise. + * sysdeps/ieee754/dbl-64/mplog.c: Likewise. + * sysdeps/ieee754/dbl-64/mpsqrt.c: Likewise. + * sysdeps/ieee754/dbl-64/mptan.c: Likewise. + * sysdeps/ieee754/dbl-64/s_atan.c: Likewise. + * sysdeps/ieee754/dbl-64/s_sin.c: Likewise. + * sysdeps/ieee754/dbl-64/s_tan.c: Likewise. + * sysdeps/ieee754/dbl-64/sincos32.c: Likewise. + * sysdeps/ieee754/dbl-64/slowexp.c: Likewise. + * sysdeps/ieee754/dbl-64/slowpow.c: Likewise. + * sysdeps/gnu/netinet/udp.h: Added BSD copying permission notice + * sysdeps/vax/__longjmp.c: Likewise. + * sysdeps/vax/setjmp.c: Likewise. + * libio/filedoalloc.c: Fixed BSD copying permission notice to + remove advertising clause + * sysdeps/vax/htonl.s: Likewise. + * sysdeps/vax/htons.s: Likewise. + * libio/wfiledoalloc.c: Likewise. + * stdlib/random.c: Likewise. + * stdlib/random_r.c: Likewise. + * sysdeps/mach/sys/reboot.h: Likewise. + * inet/getnameinfo.c: Deleted advertising clause from Inner Net License + * sysdeps/posix/getaddrinfo.c: Likewise. + * sunrpc/des_impl.c: Updated license permission notice to Lesser + GPL and corrected pointer to point to the correct license. + +2002-07-04 Andreas Jaeger + + * scripts/config.guess: New upstream version. + * scripts/config.sub: Likewise. + +2002-07-02 Andreas Schwab + + * resolv/nss_dns/dns-network.c (getanswer_r): Reduce linebuflen + in parallel to bumping up the buffer pointer. + +2002-07-01 Jakub Jelinek + + * math/libm-test.inc (acos_test): Add missing L suffix for + expected result. + (cpow_test): Likewise. + * sysdeps/i386/fpu/libm-test-ulps: Adjust errors for cpow, remove + error for acos (0.0625). + +2002-06-30 Ulrich Drepper + + * locale/iso-639.def: Add entry for Ganda. + * locale/programs/ld-address.c (DEFINE_LANGUAGE_CODE3): New + definition. + (address_finish): Handle entries with two letter ISO 639 code. + + * iconvdata/Makefile: Recreate gconv-modules.cache file in target + directory if it existed before. + * iconv/iconvconfig.c: Implement --prefix option. + + * math/libm-test.inc (cexp_test): Add missing L suffix for + expected result. Reported by Stephen L Moshier . + * sysdeps/i386/fpu/libm-test-ulps: Adjust error for cexp (0.75 + + 1.25 i). + +2002-05-29 H.J. Lu + + * elf/dl-error.c (_dl_signal_cerror): Report error if ld.so debug + is turned on. + +2002-05-28 H.J. Lu + + * elf/dl-deps.c (_dl_map_object_deps): Don't add objects which + are not dlopened on the dependency list of a dlopened object. + +2002-06-30 Ulrich Drepper + + * elf/dl-lookup.c (add_dependency): It is not necessary to add + dependencies if they are created between objects which are created + while processing RTLD_NOW for objects loaded as part of the same + dlopen call. + +2002-06-14 H.J. Lu + + * elf/Makefile (tests): Add circleload1. + (modules-names): Add circlemod1, circlemod2, circlemod3, + circlemod1a, circlemod2a and circlemod3a. + ($(objpfx)circleload1): New target. + ($(objpfx)circleload1.out): Likewise. + ($(objpfx)circlemod1.so): Likewise. + ($(objpfx)circlemod2.so): Likewise. + ($(objpfx)circlemod1a.so): Likewise. + ($(objpfx)circlemod2a.so): Likewise. + * elf/circleload1.c: New file. + * elf/circlemod1.c: New file. + * elf/circlemod1a.c: New file. + * elf/circlemod2.c: New file. + * elf/circlemod2a.c: New file. + * elf/circlemod3.c: New file. + * elf/circlemod3a.c: New file. + +2002-06-18 Amos Waterland + + * sysdeps/pthread/aio_cancel.c (aio_cancel): Add check for invalid + file descriptor. + * sysdeps/pthread/aio_fsync.c (aio_fsync): Add check for invalid fd; + add check for fd not open for writing. + + * sysdeps/pthread/aio_suspend.c (aio_suspend): Add check for + completed element(s) and do not suspend thread if so. Patch + heavily modified by drepper. + + * rt/tst-aio7.c: New file. Regression test for problems which the + above three changes fix. + * rt/Makefile (tests): Add tst-aio7. + +2002-06-29 Ulrich Drepper + + * rt/tst-aio6.c: Fix comment. + + * catgets/gencat.c (read_input_file): Handle more than one slash + at end of line correctly [PR libc/3926]. + Based on a patch by Steven Kim . + + * catgets/sample.SJIS: Add test case for above bug. + * catgets/test-gencat.c: Adjust test code. + * catgets/test-gencat.sh: Adjust expected results. + + * elf/do-rel.h (elf_dynamic_do_rel): Avoid overflow in computation + to skip relative relocations. + Patch by Geoff Keating . + +2002-05-26 Bruno Haible + + * iconv/loop.c (STANDARD_FROM_LOOP_ERR_HANDLER): New macro. + (STANDARD_TO_LOOP_ERR_HANDLER): Renamed from STANDARD_ERR_HANDLER. + All callers changed. + * iconv/gconv_simple.c (ascii_internal_loop): For error handling use + STANDARD_FROM_LOOP_ERR_HANDLER. + (utf8_internal_loop): Likewise. + (ucs2_internal_loop): Likewise. + (internal_ucs2_loop): Perform error handling like in + STANDARD_FROM_LOOP_ERR_HANDLER. + * iconvdata/unicode.c (BODY for TO_LOOP): Perform error handling like + in STANDARD_FROM_LOOP_ERR_HANDLER. + (BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error + handling. + * iconvdata/utf-16.c (BODY for TO_LOOP): Perform error handling like + in STANDARD_FROM_LOOP_ERR_HANDLER. + (BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error + handling. + * iconvdata/utf-32.c (BODY for TO_LOOP): Perform error handling like + in STANDARD_FROM_LOOP_ERR_HANDLER. + (BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error + handling. + * iconvdata/big5.c (BODY for FROM_LOOP): For error handling use + STANDARD_FROM_LOOP_ERR_HANDLER. + * iconvdata/iso-2022-jp.c (BODY for FROM_LOOP): Likewise. + * iconvdata/8bit-gap.c (BODY for FROM_LOOP): Likewise. + * iconvdata/8bit-generic.c (BODY for FROM_LOOP): Likewise. + * iconvdata/ansi_x3.110.c (BODY for FROM_LOOP): Likewise. + * iconvdata/armscii-8.c (BODY for FROM_LOOP): Likewise. + * iconvdata/cp1255.c (BODY for FROM_LOOP): Likewise. + * iconvdata/cp1258.c (BODY for FROM_LOOP): Likewise. + * iconvdata/euc-cn.c (BODY for FROM_LOOP): Likewise. + * iconvdata/euc-jisx0213.c (BODY for FROM_LOOP): Likewise. + * iconvdata/euc-jp.c (BODY for FROM_LOOP): Likewise. + * iconvdata/euc-kr.c (BODY for FROM_LOOP): Likewise. + * iconvdata/euc-tw.c (BODY for FROM_LOOP): Likewise. + * iconvdata/big5hkscs.c (BODY for FROM_LOOP): Likewise. + * iconvdata/gb18030.c (BODY for FROM_LOOP): Likewise. + * iconvdata/gbk.c (BODY for FROM_LOOP): Likewise. + * iconvdata/iso-2022-cn-ext.c (BODY for FROM_LOOP): Likewise. + * iconvdata/iso-2022-cn.c (BODY for FROM_LOOP): Likewise. + * iconvdata/iso-2022-jp-3.c (BODY for FROM_LOOP): Likewise. + * iconvdata/iso-2022-kr.c (BODY for FROM_LOOP): Likewise. + * iconvdata/iso646.c (BODY for FROM_LOOP): Likewise. + * iconvdata/iso_6937-2.c (BODY for FROM_LOOP): Likewise. + * iconvdata/iso_6937.c (BODY for FROM_LOOP): Likewise. + * iconvdata/johab.c (BODY for FROM_LOOP): Likewise. + * iconvdata/shift_jisx0213.c (BODY for FROM_LOOP): Likewise. + * iconvdata/sjis.c (BODY for FROM_LOOP): Likewise. + * iconvdata/t.61.c (BODY for FROM_LOOP): Likewise. + * iconvdata/uhc.c (BODY for FROM_LOOP): Likewise. + * iconvdata/utf-7.c (BODY for FROM_LOOP): Likewise. + * iconvdata/gbbig5.c (BODY for FROM_LOOP): Likewise. When ignoring + an error, still set result = __GCONV_ILLEGAL_INPUT. + (BODY for TO_LOOP): Likewise. + * iconvdata/ibm930.c (BODY for FROM_LOOP): For error handling use + STANDARD_FROM_LOOP_ERR_HANDLER. + (BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER. + * iconvdata/ibm932.c: Include and . + (BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error + handling. + (BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER. + * iconvdata/ibm933.c (BODY for FROM_LOOP): For error handling use + STANDARD_FROM_LOOP_ERR_HANDLER. + (BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER. + * iconvdata/ibm935.c (BODY for FROM_LOOP): For error handling use + STANDARD_FROM_LOOP_ERR_HANDLER. + (BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER. + * iconvdata/ibm937.c (BODY for FROM_LOOP): For error handling use + STANDARD_FROM_LOOP_ERR_HANDLER. + (BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER. + * iconvdata/ibm939.c (BODY for FROM_LOOP): For error handling use + STANDARD_FROM_LOOP_ERR_HANDLER. + (BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER. + * iconvdata/ibm943.c: Include and . + (BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error + handling. + (BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER. + * iconvdata/gbgbk.c (BODY for FROM_LOOP): Update. + * iconvdata/iso8859-1.c (BODY for TO_LOOP): Update. + * iconvdata/tcvn5712-1.c (BODY for TO_LOOP): Update. + +2002-06-28 Kaz Kojima + + * sysdeps/sh/dl-machine.h (elf_machine_load_address): Use local + labels in assembler instructions. + +2002-06-25 Ulrich Drepper + + * libio/fileops.c (_IO_file_xsgetn_mmap): Always set EOF flag if + not enough content is available. + * libio/tst-eof.c: New file. + * libio/Makefile (tests): Add tst-eof. + + * libio/fileops.c (_IO_file_underflow_mmap): Read a single byte to + update atime. + * libio/tst-atime.c: New file. + * libio/Makefile (tests): Add tst-atime. + + * argp/argp-fmtstream.c (__argp_fmtstream_update): Avoid crash in + handling of overly long words. + +2002-06-25 Andreas Jaeger + + * sysdeps/x86-64/dl-machine.h (elf_machine_load_address): Rewrite + to not use 32-bit pc relative relocations. + (elf_machine_dynamic): Likewise. + +2002-06-21 Ulrich Drepper + + * sysdeps/unix/sysv/linux/getdents.c [__ASSUME_GETDENTS64_SYSCALL] + (__GETDENTS): Check for failed getdents64 syscall. + * dirent/Makefile (tests): Add bug-readdir1. + * dirent/bug-readdir1.c: New file. + +2002-06-17 Jakub Jelinek + + * elf/dl-lookup.c (_dl_debug_bindings): Use type_class 4 for TLS + lookups. + * elf/rtld.c (dl_main): Move TLS setup code before LD_TRACE_PRELINKING + code. Print TLS modid and offset for modules containing PT_TLS + segments. + +2002-06-09 Jakub Jelinek + + * sysdeps/unix/sysv/linux/i386/dl-brk.c: Move... + * sysdeps/unix/sysv/linux/dl-brk.c: ...here. + * sysdeps/unix/sysv/linux/i386/dl-sbrk.c: Move... + * sysdeps/unix/sysv/linux/dl-sbrk.c: ...here. + +2002-06-07 Jakub Jelinek + + * nss/getXXbyYY_r.c (NEW, NEW1): Define. + (NEW (REENTRANT_NAME)): Strong alias to INTERNAL (REENTRANT_NAME). + (REENTRANT_NAME@@GLIBC_2.1.2): Use NEW (REENTRANT_NAME). + * nss/getXXent_r.c (NEW, NEW1): Define. + (NEW (REENTRANT_GETNAME)): Strong alias to + INTERNAL (REENTRANT_GETNAME). + (REENTRANT_GETNAME@@GLIBC_2.1.2): Use NEW (REENTRANT_GETNAME). + +2002-06-21 Ulrich Drepper + + * libio/fileops.c (_IO_file_setbuf_mmap): New function. + (_IO_file_jumps_mmap): Use it. + * libio/iosetvbuf.c: Don't call _IO_WSETBUF. + * libio/libioP.h: Remove _IO_wdefault_setbuf and + _IO_wdefault_setbuf_internal prorotypes. Add _IO_file_setbuf_mmap + prototype. + * libio/wfileops.c (_IO_wfile_setbuf): Removed. + (_IO_wfile_jumps_mmap): Don't use it anymore. + * libio/wgenops.c (_IO_wdefault_setbuf): Removed. + * libio/memstream.c (_IO_wmem_jumps): Use _IO_default_setbuf not + _IO_wdefault_setbuf. + * libio/vswprintf.c (_IO_wstrn_jumps): Likewise. + * libio/wstrops.c (_IO_wstr_jumps): Likewise. + * stdio-common/vfprintf.c (_IO_helper_jumps): Likewise. + +2002-06-05 Jakub Jelinek + + * libio/Makefile (tests): Add tst-mmap-setvbuf. + * libio/tst-mmap-setvbuf.c: New test. + +2002-06-21 Andreas Jaeger + + * sysdeps/i386/fpu/libm-test-ulps: Add some ulps from my P3. + +2002-06-18 Jakub Jelinek + + * include/unistd.h (__fork_internal): Remove. + (__fork): Don't define to __fork_internal. + * sysdeps/mach/hurd/fork.c (__fork): Remove INTDEF. + * sysdeps/unix/sysv/aix/fork.c (__fork): Likewise. + * sysdeps/unix/sysv/linux/ia64/fork.S (__fork_internal): Remove alias. + * sysdeps/unix/sysv/linux/sparc/fork.S (__fork_internal): Likewise. + * sysdeps/unix/sysv/linux/syscalls.list (__fork_internal): Likewise. + +2002-06-20 Ulrich Drepper + + * po/hr.po: New file. + +2002-06-11 Wolfram Gloger + + * malloc/malloc.c: Fix error path when new_heap() returns NULL. + Reported by Michael Meissner . + +2002-06-20 Ulrich Drepper + + * sysdeps/unix/sysv/linux/ia64/getcontext.S: Fix typo. + Patch by Hans Boehm . + +2002-06-20 Andreas Jaeger + + * math/libm-test.inc: Use exact values as input parameters, + compute output parameters with 36 digits for 128-bit long doubles. + * sysdeps/i386/fpu/libm-test-ulps: Regenerated. + * sysdeps/x86-64/fpu/libm-test-ulps: Regenerated. + * sysdeps/ia64/fpu/libm-test-ulps: Regenerated. + +2002-06-13 Stephen L Moshier + + * sysdeps/ieee754/ldbl-96/s_scalbnl.c: Fix cases in which + argument or result is subnormal. + +2002-06-19 Ulrich Drepper + + * sysdeps/i386/fpu/s_remquo.S: Fix three mistakes in computing the + quotient. + * sysdeps/i386/fpu/s_remquof.S: Likewise. + * sysdeps/i386/fpu/s_remquol.S: Likewise. + + * sysdeps/hppa/dl-machine.h: Don't use multi-line string literals. + +2002-06-17 David Mosberger + + * sysdeps/unix/sysv/linux/ia64/sys/ucontext.h (uc_sigmask): Fix + typo: corresponding sigcontext field is called sc_mask, not sc_sigmask. + Reported by Peter A. Buhr. + +2002-06-15 Roland McGrath + + * sysdeps/mach/hurd/mmap.c (__mmap): Add a dead case that quiets a + warning. + + * sysdeps/mach/hurd/getcwd.c + (_hurd_canonicalize_directory_name_internal): unsigned int -> size_t + + * sysdeps/unix/sysv/linux/bits/ustat.h: Moved to ... + * sysdeps/generic/bits/ustat.h: ... here (was almost identical). + + * sysdeps/alpha/divrem.h: Use local label instead of global one for + jump to local subroutine. + +2002-06-14 Roland McGrath + + * sysdeps/mach/hurd/i386/Makeconfig: File moved to ... + * sysdeps/mach/hurd/Makeconfig: ... here. + +2002-06-13 Andreas Schwab + + * sysdeps/m68k/fpu/s_finite.c: Remove INTDEF. + * sysdeps/m68k/fpu/s_finitef.c: Likewise. + * sysdeps/m68k/fpu/s_finitel.c: Likewise. + +2002-06-13 Roland McGrath + + * hurd/hurdstartup.h (_hurd_startup): int -> intptr_t in MAIN arg type. + * hurd/hurdstartup.c (_hurd_startup): Likewise. + Use intptr_t instead of int for argc in stack layout. + * sysdeps/mach/hurd/alpha/init-first.c (init): Fix argument type. + (_dl_init_first): Likewise. + (_hurd_stack_setup): Likewise. + (init1): Add a cast. + * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start: go): Fix arg type. + + * sysdeps/mach/hurd/if_index.c (if_nameindex): Use size_t for AMOUNT + argument to pfinet_siocgifconf RPC. + +2002-06-13 Andreas Schwab + + * sysdeps/m68k/fpu/s_isinf.c (INTDEFX): Define to get correct + expansion order. + +2002-06-12 Roland McGrath + + * sysdeps/generic/tmpfile.c [USE_IN_LIBIO] (tmpfile): Don't #define + if already defined. + [USE_IN_LIBIO]: Conditionalize versioned_symbol use on + [GEN_THIS == __GT_FILE] so that tmpfile64.c's inclusion doesn't get it. + +2002-06-11 Roland McGrath + + * sysdeps/mach/hurd/xstat64.c: Conditionalize entire contents of the + file on [!RTLD_STAT64]. + * sysdeps/mach/hurd/fxstat64.c: Likewise. + + * sysdeps/mach/hurd/tmpfile.c (tmpfile64): Define as alias of tmpfile. + (__fdopen): Use INTUSE. + * sysdeps/mach/hurd/tmpfile64.c: New file, empty placeholder. + + * stdio-common/tmpfile64.c: File removed. + * sysdeps/generic/tmpfile64.c: New file. + * sysdeps/generic/tmpfile.c (GEN_THIS): New macro, define to __GT_FILE + if not already defined. + (tmpfile): Use it in place of __GT_FILE. + + * include/unistd.h: Declare __chown_internal. + + * sysdeps/mach/hurd/sendfile64.c (sendfile64): Do real work here. + * sysdeps/mach/hurd/sendfile.c (sendfile): Call that. + +2002-06-09 Roland McGrath + + Update to new Hurd RPC interfaces supporting 64-bit file sizes. + * sysdeps/mach/hurd/configure.in: Check for with + value of HURD_INTERFACE_VERSION >= 20020609. + * sysdeps/mach/hurd/configure: Regenerated. + * shlib-versions (.*-.*-gnu-gnu.*): Set libhurduser=0.3. + * sysdeps/mach/hurd/xstatconv.c (xstat64_conv): Rewritten to + convert a struct stat64 into a struct stat and return 0 or -1 + with errno set to EOVERFLOW. + * sysdeps/mach/hurd/statfsconv.c (statfs64_conv): Likewise + for struct statfs64 to struct statfs. + * sysdeps/mach/hurd/xstat.c (__xstat): Use converter and call ... + * sysdeps/mach/hurd/xstat64.c (__xstat64): ... this, real work here. + * sysdeps/mach/hurd/fxstat.c (__fxstat): Likewise. + * sysdeps/mach/hurd/fxstat64.c (__fxstat64): Likewise. + * sysdeps/mach/hurd/lxstat.c (__lxstat): Likewise. + * sysdeps/mach/hurd/lxstat64.c (__lxstat64): Likewise. + * sysdeps/mach/hurd/statfs.c (__statfs): Likewise. + * sysdeps/mach/hurd/statfs64.c (__statfs64): Likewise. + * sysdeps/mach/hurd/fstatfs.c (__fstatfs): Likewise. + * sysdeps/mach/hurd/fstatfs64.c (__fstatfs64): Likewise. + * sysdeps/mach/hurd/pwrite64.c (__libc_pwrite64): Do real work here. + * sysdeps/mach/hurd/pwrite.c (__libc_pwrite): Call that. + * sysdeps/mach/hurd/pread64.c (__libc_pread64): Do real work here. + * sysdeps/mach/hurd/pread.c (__libc_pread): Call that. + * sysdeps/mach/hurd/lseek64.c (__libc_lseek64): Do real work here. + * sysdeps/mach/hurd/lseek.c (__libc_lseek): Call that. + * sysdeps/mach/hurd/readdir64.c (__readdir64): Do real work here. + * sysdeps/mach/hurd/readdir.c (__readdir): Call that. + * sysdeps/mach/hurd/readdir64_r.c (__readdir64_r): Do real work here. + * sysdeps/mach/hurd/readdir_r.c (__readdir64_r): Call that. + * hurd/lookup-retry.c (__hurd_file_name_lookup_retry): + Use struct stat64 for io_stat argument. + * sysdeps/mach/hurd/readlink.c (__readlink): Likewise. + * hurd/fopenport.c (seekio): Remove EOVERFLOW check, pass POS directly + to io_seek. + * hurd/fd-read.c (_hurd_fd_read): Use loff_t for OFFSET argument. + * hurd/fd-write.c (_hurd_fd_write): Likewise. + * hurd/hurd/fd.h: Update decls. + * sysdeps/mach/hurd/getcwd.c + (_hurd_canonicalize_directory_name_internal): Use ino64_t + and struct dirent64. + * sysdeps/mach/hurd/dl-sysdep.c (open_file): Use struct stat64. + (__xstat): Renamed to __xstat64, use struct stat64 for argument. + (__fxstat): Renamed to __fxstat64, use struct stat64 for argument. + (__lseek): Renamed to __libc_lseek64, use off64_t for argument. + +2002-06-08 Roland McGrath + + * sysdeps/mach/hurd/dirstream.h (struct __dirstream): Use size_t + instead of unsigned long int for __allocation and __size members. + +2002-06-09 Jakub Jelinek + + * sysdeps/unix/sysv/linux/i386/dl-brk.c: Move... + * sysdeps/unix/sysv/linux/dl-brk.c: ...here. + * sysdeps/unix/sysv/linux/i386/dl-sbrk.c: Move... + * sysdeps/unix/sysv/linux/dl-sbrk.c: ...here. + +2002-06-07 Roland McGrath + + * sysdeps/mach/hurd/bits/environments.h: File removed. + +2002-06-07 Jakub Jelinek + + * sysdeps/unix/sysv/linux/alpha/sendfile64.c: New file. + * sysdeps/unix/sysv/linux/ia64/sendfile64.c: New file. + * sysdeps/unix/sysv/linux/sparc/sparc64/sendfile64.c: New file. + * sysdeps/unix/sysv/linux/x86_64/sendfile64.c: New file. + * sysdeps/unix/sysv/linux/syscalls.list (sendfile): Remove EXTRA. + (sendfile64): Likewise. + * sysdeps/unix/sysv/linux/alpha/syscalls.list (sendfile): Likewise. + * sysdeps/unix/sysv/linux/ia64/syscalls.list (sendfile): Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (sendfile): + Likewise. + * sysdeps/unix/sysv/linux/x86_64/syscalls.list (sendfile): Likewise. + + * include/sys/stat.h (__fxstat64, __lxstat64): Only define if not + already defined. + +2002-06-04 Bruno Haible + + * sysdeps/cris/stackinfo.h: New file. + + * sysdeps/hppa/dl-machine.h (elf_machine_rela): Cast reloc_addr + to an integer type before performing bit operations on it. + +2002-06-05 Roland McGrath + + * sysdeps/generic/sendfile.c: Include . + * sysdeps/generic/sendfile64.c: Likewise. + + * io/Makefile (routines): Add sendfile and sendfile64. + (headers): Add sys/sendfile.h to the list. + * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Don't add it here. + * sysdeps/unix/sysv/linux/sys/sendfile.h: Moved to ... + * io/sys/sendfile.h: ... here. + * sysdeps/generic/sendfile.c: New file. + * sysdeps/generic/sendfile64.c: New file. + + * sysdeps/unix/sysv/linux/Versions (GLIBC_2.1, GLIBC_2.3): + Move sendfile, sendfile64 to ... + * io/Versions (GLIBC_2.1, GLIBC_2.3): ... here. + * sysdeps/mach/hurd/sendfile.c: New file. + * sysdeps/mach/hurd/sendfile64.c: New file. + + * sysdeps/mach/nanosleep.c: New file. + +2002-06-04 Roland McGrath + + * sysdeps/alpha/elf/configure.in: New file. Check for TLS support. + * sysdeps/alpha/elf/configure: New file (generated). + +2002-06-02 Roland McGrath + + * include/link.h: Include to make sure USE_TLS is defined. + +2002-06-01 Roland McGrath + + * sysdeps/mach/hurd/alpha/init-first.c: New file, modified from + i386/init-first.c by Andrew M. Miklic . + +2002-05-19 Ulrich Drepper + + * resolv/resolv.h (struct __res_state): Remove unused nstimes. + Add nsmap. + * resolv/res_init.c (__res_vinit): Initialize nsmap array. + Remove nstimes setting. + (res_nclose): Check all MAXNS nameservers with non-NULL nsaddrs. + * resolv/res_send.c (res_nsend): Don't close unconditionally if + there is mix of IPv6 and IPv4 nameservers. + Use nsmap array to find free slots and preserve nameserver ordering. + Fix RES_ROTATE. + +2002-05-30 Ulrich Drepper + + * sysdeps/unix/sysv/linux/sys/sendfile.h: It is now possible to + use this header with LFS. + + * po/sk.po: Update from translation team. + +2002-05-28 Andreas Schwab + + * sysdeps/generic/readelflib.c (process_elf_file): Give correct + message when finding object of wrong class. + +2002-05-28 Jakub Jelinek + + * sysdeps/wordsize-32/divdi3.c (__moddi3): Fix pasto. + Patch by . + +2002-05-30 Ulrich Drepper + + * sysdeps/unix/sysv/linux/Makefile [$(subdir)==misc] (sysdep_routines): + Add readahead. + * sysdeps/unix/sysv/linux/readahead.c: New file. + * sysdeps/unix/sysv/linux/syscalls.list: Add sendfile64 syscall. + * sysdeps/unix/sysv/linux/Versions: Export readahead and sendfile64. + * sysdeps/unix/sysv/linux/alpha/syscalls.list: Add readahead syscall. + Add sendfile64 alias to sendfile syscall. + * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/powerpc/syscalls.list: Add s_readahead + syscall. + + * sysdeps/unix/sysv/linux/i386/sysdep.h: Use __i686.get_pc_thunk.XX + special section for PIC register loading. + * sysdeps/unix/sysv/linux/i386/i686/sysdep.h: Likewise. + + * config.h.in: Define HAVE_HIDDEN. + * configure.in: Also define HAVE_HIDDEN if HAVE_PROTECTED is defined. + + * elf/elf.h: Correct Alpha TLS relocations according to last spec. + +2002-05-28 Roland McGrath + + * sysdeps/mach/alpha/setfpucw.c: New file. + +2002-05-26 Roland McGrath + + * sysdeps/mach/hurd/ioctl.c (__ioctl): Don't use sizeof in _IOTS. + Use integer_t instead of int for IOC_VOID case. + +2002-05-27 Alexandre Oliva + + * configure.in (DO_STATIC_NSS): Define if --disable-shared. + +2002-05-26 Bruno Haible + + * iconvdata/iso-2022-jp.c (BODY for TO_LOOP): Avoid running off the + end of the ISO-8859-7 from idx table. + +2002-05-27 Ulrich Drepper + + * manual/lang.texi: Fix FLT_EPSILON description [PR libc/3649]. + +2002-05-24 David S. Miller + + * string/bits/string2.h (memset): Do not try to optimize when + not _STRING_ARCH_unaligned if GCC will do the right thing. + +2002-05-21 Isamu Hasegawa + + * posix/regex.c: Define `inline' as a macro into nothing for the + compilers which lack the keyword. + * posix/regex.h: (RE_SYNTAX_GNU_AWK): Remove RE_CONTEXT_INVALID_OPS + for the compatibility of gawk. + * posix/regcomp.c: Add fake implementation of isblank() for the + environments which lack the function. + Don't use free_charset() in case of non-i18n envs. + (build_range_exp): Don't use i18n related code in case of non-i18n + envs. + (build_collating_symbol): Likewise. + (build_equiv_class): Likewise. + (build_charclass): Likewise. + (re_compile_fastmap_iter): Likewise. + (parse_bracket_exp): Likewise. + (build_word_op): Likewise. + (regfree): Don't use free_charset() in case of non-i18n envs. + * posix/regex_internal.h: Remove COMPLEX_BRACKET from + re_token_type_t in case of non-i18n envs. + Don't define re_charset_t in case of non-i18n envs. + Change the type of wcs of re_string_t from wchar_t to wint_t, + since we store also WEOF. + * posix/regex_internal.c: (re_string_realloc_buffers): Change + the type of wcs of re_string_t from wchar_t to wint_t. + (re_string_reconstruct): Likewise. + (create_ci_newstate): Don't use i18n related code in case of + non-i18n envs. + (create_cd_newstate): Likewise. + +2002-05-24 Ulrich Drepper + + * iconv/loop.c: Fix typo. + +2002-05-23 Jakub Jelinek + + * inet/ether_line.c (ether_line): Fix a typo causing only + lower 4 bits of each ethernet address byte being assigned. + Don't modify what line points to. + * inet/tst-ether_aton.c (main): Add ether_line tests. + +2002-05-23 Marcus Brinkmann + + * manual/filesys.texi: Don't make readlink example leak memory + when readlink fails. + +2002-05-20 Ulrich Drepper + + * iconv/loop.c: Fix condition for defining unaligned loop. Add + some more security checks. + +2002-05-17 David S. Miller + + * sysdeps/unix/sysv/linux/sparc/fork.S: Define _internal aliases. + +2002-05-16 David S. Miller + + * sysdeps/sparc/sparc32/dl-machine.h (LOAD_PIC_REG): Define. + (elf_machine_dynamic): Use it to force PIC register to be loaded. + (elf_machine_load_address): Likewise. + * sysdeps/sparc/sparc64/dl-machine.h: Mirror sparc32 changes. + + * sysdeps/sparc/sparc64/strncmp.S: When second argument pointer + is unaligned, do not forget to fully initialize %g1 magic value. + + * sysdeps/unix/sysv/linux/sparc/sys/procfs.h: Fix 64-bit elf + register definitions and provide 32-bit variants of structures + during 64-bit builds. + + * soft-fp/op-1.h (_FP_FRAC_CLEAR_OVERP_1): Define. + * soft-fp/op-2.h (_FP_FRAC_CLEAR_OVERP_2): Define. + * soft-fp/op-4.h (_FP_FRAC_CLEAR_OVERP_4): Define. + * soft-fp/op-common.h (_FP_PACK_CANONICAL): After rounding, if + _FP_FRAC_OVERP_X is set, use _FP_FRAC_CLEAR_OVERP_X to clear it. + (_FP_FROM_INT): Perform right shifts on unsigned integer type. + Do not clear implicit one bit here, it must be done post-rounding. + Only pad to the left using left shift if value uses less than the + available fractional bits. + +2002-05-20 Franz Sirl + + * sysdeps/powerpc/Makefile (sysdeps_routines): Use libgcc-compat + instead of cmpdi2, shdi3, fixdfdi, fixsfdi in csu dir. + (shared-only-routines): Likewise. + * sysdeps/powerpc/libgcc-compat.c: New file. + * sysdeps/wordsize-32/cmpdi2.c: Removed. + * sysdeps/wordsize-32/fixdfdi.c: Removed. + * sysdeps/wordsize-32/fixsfdi.c: Removed. + * sysdeps/wordsize-32/shdi3.c: Removed. + +2002-05-16 Bruno Haible + + * MakeTAGS (libc.pot): Don't sort the output. + * po/header.pot: Update to match xgettext 0.11 output. + +2002-05-16 Bruno Haible + + * MakeTAGS (subdirs): Remove duplicates. + +2002-05-19 Ulrich Drepper + + * sysdeps/unix/sysv/linux/errlist.c: Remove extra weak alias + definiton of _old_sys_nerr. Define _old_sys_errlist as strong + alias. + +2002-05-19 Andreas Jaeger + + * sysdeps/unix/sysv/linux/configure.in: Warn against an + installation in /usr/local. + +2002-05-16 Bruno Haible + + * sysdeps/unix/sysv/aix/bits/ioctl-types.h: Don't use multiline + string as argument of #error. + +2002-05-15 Ulrich Drepper + + * stdlib/canonicalize.c (canonicalize): Rename to __realpath and + don't define static. Remove old __realpath function. TC1 of + POSIX 2001 will allow the second parameter to be NULL. + * stdlib/test-canon.c: Comment out test for NULL as second + parameter of realpath. + + * time/offtime.c (__offtime): Set errno if overflow is detected. + + * elf/Makefile (rtld-routines): Remove dl-brk and dl-sbrk. + * sysdeps/unix/sysv/linux/Makefile (sysdep-rtld-routines): Add + dl-brk and dl-sbrk. + + * sysdeps/sparc/fpu/bits/mathinline.h (fdim): Add __THROW. + (fdimf): Likewise. + +2002-05-15 Roland McGrath + + * hurd/report-wait.c (_S_msg_report_wait): Use mach_msg_id_t for arg. + +2002-05-12 Bruno Haible + + * iconvdata/testdata/EUC-JISX0213: New file. + * iconvdata/testdata/EUC-JISX0213..UTF8: New file. + * iconvdata/testdata/SHIFT_JISX0213: New file. + * iconvdata/testdata/SHIFT_JISX0213..UTF8: New file. + * iconvdata/testdata/ISO-2022-JP-3: New file. + * iconvdata/testdata/ISO-2022-JP-3..UTF8: New file. + * iconvdata/TESTS: Add EUC-JISX0213, SHIFT_JISX0213, ISO-2022-JP-3. + * iconvdata/run-iconv-test.sh: Skip the charmap test if the charmap + contains comments indicating precomposed characters. + +2002-04-21 Bruno Haible + + * iconvdata/iso-2022-jp-3.c: New file. + * iconvdata/gconv-modules (ISO-2022-JP-3): New module. + * iconvdata/Makefile (modules): Add ISO-2022-JP-3. + (LDFLAGS-ISO-2022-JP-3.so): New variable. + (ISO-2022-JP-3.so): Depend on libJIS.so and libJISX0213.so. + (distribute): Add iso-2022-jp-3.c. + +2002-05-12 Bruno Haible + + * iconvdata/tst-table-to.c (main): Restore handling of + transliterations, broken by last patch. + +2002-05-12 Bruno Haible + + * iconvdata/TESTS: Add IBM922, IBM1124, IBM1129. + +2002-05-12 Bruno Haible + + * iconvdata/euc-jisx0213.c (BODY for FROM_LOOP): Don't advance inptr + when there is not enough room in the output buffer. + * iconvdata/shift_jisx0213.c (BODY for FROM_LOOP): Likewise. + +2002-04-20 Bruno Haible + + * iconv/skeleton.c ({FROM,TO}_LOOP_{MIN,MAX}_NEEDED_{FROM,TO}): New + macros. + (RESET_INPUT_BUFFER): Use them instead of {MIN,MAX}_NEEDED_{FROM,TO}. + Also make this macro work if FROM_DIRECTION evaluates to 0. + (gconv_init): Use the new macros instead of {MIN,MAX}_NEEDED_{FROM,TO}. + (FUNCTION_NAME): Likewise, in the handling of unaligned accesses and + of consume_incomplete. + * iconvdata/cp1255.c: Define {FROM,TO}_LOOP_{MIN,MAX}_NEEDED_{FROM,TO} + instead of {MIN,MAX}_NEEDED_{FROM,TO}. Set FROM_LOOP_MAX_NEEDED_TO to + 4, not 8. + * iconvdata/cp1258.c: Likewise. + * iconvdata/ibm930.c: Define {FROM,TO}_LOOP_{MIN,MAX}_NEEDED_{FROM,TO} + instead of {MIN,MAX}_NEEDED_{FROM,TO}. Set TO_LOOP_MAX_NEEDED_TO to 3, + not 2. + * iconvdata/ibm933.c: Likewise. + * iconvdata/ibm935.c: Likewise. + * iconvdata/ibm937.c: Likewise. + * iconvdata/ibm939.c: Likewise. + * iconvdata/iso-2022-cn.c: Define + {FROM,TO}_LOOP_{MIN,MAX}_NEEDED_{FROM,TO} instead of + {MIN,MAX}_NEEDED_{FROM,TO}. Set TO_LOOP_MAX_NEEDED_TO to 6, not 4. + * iconvdata/iso-2022-cn-ext.c: Likewise. + * iconvdata/iso-2022-jp.c: Define + {FROM,TO}_LOOP_{MIN,MAX}_NEEDED_{FROM,TO} instead of + {MIN,MAX}_NEEDED_{FROM,TO}. + * iconvdata/tcvn5712-1.c: Define + {FROM,TO}_LOOP_{MIN,MAX}_NEEDED_{FROM,TO} instead of + {MIN,MAX}_NEEDED_{FROM,TO}. Set FROM_LOOP_MAX_NEEDED_FROM to 1, not 2. + * iconvdata/euc-jisx0213.c: Define + {FROM,TO}_LOOP_{MIN,MAX}_NEEDED_{FROM,TO} instead of + {MIN,MAX}_NEEDED_{FROM,TO}. Set FROM_LOOP_MAX_NEEDED_TO to 8, not 4. + * iconvdata/shift_jisx0213.c: Likewise. + +2002-05-14 Franz Sirl + + * sysdeps/powerpc/Makefile (sysdeps_routines): Add divdi3, cmpdi2, + shdi3, fixdfdi, fixsfdi in csu dir. + (shared-only-routines): Likewise. + * sysdeps/wordsize-32/cmpdi2.c: New file. + * sysdeps/wordsize-32/shdi3.c: New file. + * sysdeps/wordsize-32/fixdfdi.c: New file. + * sysdeps/wordsize-32/fixsfdi.c: New file. + * sysdeps/powerpc/Versions (__divdi3, __moddi3, __udivdi3, __umoddi3, + __ashldi3, __ashrdi3, __lshrdi3, __cmpdi2, __ucmpdi2, __fixdfdi, + __fixsfdi, __fixunsdfdi, __fixunssfdi): Export at GLIBC_2.0. + + * sysdeps/unix/sysv/linux/semctl.c (__old_semctl, __new_semctl): + Only use va_arg if the argument will be used [PR libc/3259]. + +2002-05-06 Michael A. Schmidt + + * catgets/catgets.c (catopen): Free buffer if internal catalog + open fails. + +2002-05-14 Ulrich Drepper + + * debug/xtrace.sh: Make more robust. For realtime tracking use + non-buffering methods. + * debug/pcprofiledump.c: Implement -u option. + Patch by Roger Luethi . + +2002-05-11 Jakub Jelinek + + * include/netinet/in.h (bindresvport_internal): Add prototype. + * include/rpc/auth.h (authunix_create_internal, + authunix_create_default_internal, authnone_create_internal, + authdes_pk_create_internal): Add prototypes. + * include/rpc/clnt.h (clnt_create_internal, clnttcp_create_internal, + clntudp_create_internal, clntudp_bufcreate_internal, + clntunix_create_internal): Add prototypes. + * include/rpc/svc.h (svc_sendreply_internal, svcerr_decode_internal, + svc_getreq_internal, svc_getreq_common_internal, + svc_getreqset_internal, svc_getreq_poll_internal, + svc_register_internal, svc_unregister_internal, + svcudp_create_internal, svcudp_bufcreate_internal): Add prototypes. + * include/rpc/svc_auth.h (_authenticate_internal): Add prototype. + * include/sys/socket.h (__sendto, __recvfrom, __sendmsg, __recvmsg, + __setsockopt, __getsockname, __bind, __listen): Add prototypes. + * inet/rexec.c (rexec_af): Use __listen and __getsockname. + * inet/rcmd.c (rcmd_af): Use __listen. + (rresvport_af): Use __bind. + * sunrpc/clnt_udp.c: Use INTUSE calls to bindresvport, + authunix_create, authunix_create_default, authnone_create, + authdes_pk_create, clnt_create, clnttcp_create, clntudp_create, + clntudp_bufcreate, clntunix_create svc_sendreply, svcerr_decode, + svc_getreq, svc_getreq_common, svc_getreqset, svc_getreq_poll, + svc_register, svc_unregister, svcudp_create, svcudp_bufcreate, + _authenticate, add INTDEF after such function definitions. + Use __listen, __bind, __sendto, __recvfrom, __sendmsg, __recvmsg, + __setsockopt, __getsockname instead of non-__ variants. + * sunrpc/pmap_rmt.c: Likewise. + * sunrpc/rtime.c: Likewise. + * sunrpc/svc_udp.c: Likewise. + * sunrpc/clnt_unix.c: Likewise. + * sunrpc/svc_unix.c: Likewise. + * sunrpc/bindrsvprt.c: Likewise. + * sunrpc/svc_tcp.c: Likewise. + * sunrpc/auth_none.c: Likewise. + * sunrpc/clnt_raw.c: Likewise. + * sunrpc/clnt_tcp.c: Likewise. + * sunrpc/auth_unix.c: Likewise. + * sunrpc/key_call.c: Likewise. + * sunrpc/clnt_gen.c: Likewise. + * sunrpc/pm_getmaps.c: Likewise. + * sunrpc/clnt_simp.c: Likewise. + * sunrpc/pmap_clnt.c: Likewise. + * sunrpc/svc_run.c: Likewise. + * sunrpc/svc.c: Likewise. + * sunrpc/svc_simple.c: Likewise. + * sunrpc/pm_getport.c: Likewise. + * sunrpc/auth_des.c: Likewise. + * sunrpc/svc_auth.c: Likewise. + * sysdeps/generic/unwind-dw2-fde.c (__register_frame_info_bases, + __register_frame_info_table_bases, __deregister_frame_info_bases): + Add INTDEF. + (__register_frame_info_bases_internal, + __register_frame_info_table_bases_internal, + __deregister_frame_info_bases_internal): Add prototypes. + (__register_frame_info, __register_frame): Use INTUSE in call to + __register_frame_info_bases. + (__register_frame_info_table): Similarly. + (__deregister_frame_info, __deregister_frame): Similarly. + * sysdeps/generic/sendto.c (__sendto): Renamed from sendto, add + sendto as weak alias. + * sysdeps/mach/hurd/sendto.c: Likewise. + * sysdeps/generic/recvfrom.c (__recvfrom): Renamed from recvfrom, add + recvfrom as weak alias. + * sysdeps/mach/hurd/recvfrom.c: Likewise. + * sysdeps/unix/sysv/aix/recvfrom.c: Likewise. + * sysdeps/generic/recvmsg.c (__recvmsg): Renamed from recvmsg, add + recvmsg as weak alias. + * sysdeps/unix/sysv/aix/recvmsg.c: Likewise. + * sysdeps/generic/sendmsg.c (__sendmsg): Renamed from sendmsg, add + sendmsg as weak alias. + * sysdeps/unix/sysv/aix/sendmsg.c: Likewise. + * sysdeps/generic/setsockopt.c (__setsockopt): Renamed from + setsockopt, add setsockopt as weak alias. + * sysdeps/mach/hurd/setsockopt.c: Likewise. + * sysdeps/generic/bind.c (__bind): Renamed from bind, add bind as + weak alias. + * sysdeps/mach/hurd/bind.c: Likewise. + * sysdeps/generic/listen.c (__listen): Renamed from listen, add listen + as weak alias. + * sysdeps/mach/hurd/listen.c: Likewise. + * sysdeps/generic/getsockname.c (__getsockname): Renamed from + getsockname, add getsockname as weak alias. + * sysdeps/mach/hurd/getsockname.c: Likewise. + * sysdeps/unix/sysv/aix/getsockname.c: Likewise. + * sysdeps/mach/hurd/recvmsg.c (__recvmsg): Add weak alias. + * sysdeps/mach/hurd/sendmsg.c (__sendmsg): Add weak alias. + * sysdeps/unix/inet/syscalls.list (__bind, __listen, __recvmsg, + __recvfrom, __sendmsg, __sendto, __setsockopt): Add aliases. + * sysdeps/unix/sysv/linux/alpha/syscalls.list (__recvmsg, __sendmsg): + Add aliases. + * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/recvfrom.S (__recvfrom): Add weak alias. + * sysdeps/unix/sysv/linux/recvmsg.S (__recvmsg): Likewise. + * sysdeps/unix/sysv/linux/sendmsg.S (__sendmsg): Likewise. + * sysdeps/unix/sysv/linux/sendto.S (__sendto): Likewise. + * sysdeps/unix/sysv/linux/setsockopt.S (__setsockopt): Likewise. + * sysdeps/unix/sysv/linux/bind.S (__bind): Likewise. + * sysdeps/unix/sysv/linux/listen.S (__listen): Likewise. + * sysdeps/unix/sysv/linux/getsockname.S (__getsockname): Likewise. + +2002-05-10 Jakub Jelinek + + * locale/programs/localedef.h (show_archive_content): Add verbose + argument. + * locale/programs/localedef.c (main): Adjust caller. + * locale/programs/locarchive.c (struct nameent, struct dataent): New + types. + (nameentcmp, dataentcmp): New functions. + (xstrcmp): Remove. + (show_archive_content): Print verbose listing with --list-archive -v. + +2002-05-14 Ulrich Drepper + + * locale/programs/locarchive.c (open_archive): Take extra argument + readonly. If true open file with O_RDONLY and don't create the + archive if it doesn't exist. + Adapt all callers. + (close_archive): Don't do anything if fd element is -1. + * locale/programs/localedef.h (open_archive): Adjust prototype. + * locale/programs/locfile.c (write_all_categories): Adjust open_archive + call. + + * malloc/malloc.c (__posix_memalign): Correct check for size of + alignment value [PR libc/3444]. + + * include/stdio.h: Remove references to old stdio implementation. + + * libio/Makefile (bug-ungetwc2-ENV): Define. + +2002-05-13 Roland McGrath + + * iconv/gconv_charset.h (upstr): Add inline keyword, quiets warning. + + * hurd/hurdinit.c (_hurd_init): Use internal name _hurd_new_proc_init. + +2002-05-13 Marcus Brinkmann + + * hurd/hurdchdir.c (_hurd_change_directory_port_from_name): + Allocate three, not two, more than LEN when appending '/.'. + * sysdeps/mach/hurd/chroot.c (chroot): Likewise. Don't check + if NAME ends with '/.' if it is shorter than 2 chars. + +2002-05-12 Roland McGrath + + * mach/Makefile ($(mach-syscalls:%=$(objpfx)%.S)): Make the generated + files #include instead of . + + * hurd/hurdexec.c (_hurd_exec): Reauthenticate ports/dtable used in + file_exec to effect svuid=euid, svgid=egid if that is not a no-op. + +2002-05-10 Jakub Jelinek + + * sysdeps/ia64/Makefile: Remove extra endif. + * sysdeps/ia64/ia64libgcc.S (__divsf3): Fix typo in symbol version. + +2002-05-10 Andreas Schwab + + * sysdeps/powerpc/fpu/w_sqrt.c: Add sqrtl alias. + +2002-05-09 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/sys/io.h: New file. + * sysdeps/unix/sysv/linux/x86_64/Dist: Add it. + * sysdeps/unix/sysv/linux/x86_64/Makefile (sysdep_headers): Add it. + + * sysdeps/unix/sysv/linux/ia64/glob.c: Move to ... + * sysdeps/wordsize-64/glob.c: ...here. + * sysdeps/unix/sysv/linux/x86_64/glob.c: Remove. + * sysdeps/unix/sysv/linux/s390/s390-64/glob.c: Remove. + * sysdeps/unix/sysv/linux/sparc/sparc64/glob.c: Remove. + +2002-05-08 Roland McGrath + + * hurd/hurdfchdir.c (_hurd_change_directory_port_from_fd): Use + O_NOTRANS flag in "." lookup. + +2002-05-05 Ulrich Drepper + + * malloc/mtrace.c: Comment out use of _mtrace_file and _mtrace_len. + +2002-05-04 Ulrich Drepper + + * locale/duplocale.c (__duplocale): Update special members only + when allocation succeeded. + +2002-05-03 Roland McGrath + + * shlib-versions (.*-.*-gnu-gnu.*): Remove USE_IN_LIBIO conditionals; + we can only build libc.so.0.3(GLIBC_2.2.6) now. + +2002-05-02 Jakub Jelinek + + * sysdeps/ia64/Makefile: Add ia64libgcc in csu subdir. + * sysdeps/ia64/Versions (__divtf3, __divdf3, __divsf3, __divdi3, + __moddi3, __udivdi3, __umoddi3, __multi3): Export at GLIBC_2.0. + * sysdeps/ia64/ia64libgcc.S: New file. + +2002-05-02 Ulrich Drepper + + * sysdeps/generic/dl-tls.c (oom): Implement using _dl_fatal_printf. + + * malloc/memusage.c: Distinguish anonymous mmap. + +2002-05-01 Roland McGrath + + * sysdeps/mach/hurd/close.c: #undef __close before function defn, + and use INTDEF on it. + * sysdeps/mach/hurd/fcntl.c: Use INTDEF2. + + * sysdeps/mach/hurd/dl-sysdep.c (errno): New variable. + + * sysdeps/mach/hurd/alpha/static-start.S: New file (unfinished). + +2002-05-01 Ulrich Drepper + + * malloc/memusage.c: Add support for tracking mmap & friends. + * malloc/memusage.sh: Implement -m/--mmap option. + +2002-04-30 Jakub Jelinek + + * locale/programs/locarchive.c (create_archive): Add archivefname + argument, create fname from it. + (enlarge_archive): Honour output_prefix. + (open_archive): Likewise. + +2002-04-30 Jakub Jelinek + + * locale/programs/locarchive.c (add_locales_to_archive): Don't nest + too many stpcpy macros. + +2002-04-26 Bruno Haible + + * locale/programs/ld-collate.c (collate_read): Cast first argument + for "%.*s" to int. + +2002-04-26 Bruno Haible + + * include/libintl.h (__ngettext, __dngettext, __dcngettext, + __dcngettext_internal): New declarations. + (__gettext, __dgettext, __dcgettext, __dcgettext_internal): Add + attribute declarations. + +2002-04-30 Roland McGrath + + Removed old GNU stdio implementation; GNU libio is now the only option. + * configure.in: Removed --enable-libio option and @stdio@ subst var. + Define USE_IN_LIBIO unconditionally. + * configure: Regenerated. + * Makeconfig (stdio): Set to libio by default. + * config.make.in (stdio): Variable removed. + * sysdeps/unix/sysv/linux/configure.in: Don't set $stdio. + * sysdeps/unix/sysv/linux/configure: Regenerated. + * sysdeps/mach/hurd/configure.in: Don't test $stdio. + * sysdeps/mach/hurd/configure: Regenerated. + * stdio/.cvsignore: File removed. + * stdio/Makefile: File removed. + * stdio/Versions: File removed. + * stdio/__fbufsize.c: File removed. + * stdio/__flbf.c: File removed. + * stdio/__fpending.c: File removed. + * stdio/__fpurge.c: File removed. + * stdio/__freadable.c: File removed. + * stdio/__freading.c: File removed. + * stdio/__fsetlocking.c: File removed. + * stdio/__fwritable.c: File removed. + * stdio/__fwriting.c: File removed. + * stdio/clearerr.c: File removed. + * stdio/fclose.c: File removed. + * stdio/fcloseall.c: File removed. + * stdio/feof.c: File removed. + * stdio/ferror.c: File removed. + * stdio/fflush.c: File removed. + * stdio/fgetc.c: File removed. + * stdio/fgetpos.c: File removed. + * stdio/fgets.c: File removed. + * stdio/fileno.c: File removed. + * stdio/fmemopen.c: File removed. + * stdio/fopen.c: File removed. + * stdio/fopncook.c: File removed. + * stdio/fputc.c: File removed. + * stdio/fputs.c: File removed. + * stdio/fread.c: File removed. + * stdio/freopen.c: File removed. + * stdio/fseek.c: File removed. + * stdio/fsetpos.c: File removed. + * stdio/ftell.c: File removed. + * stdio/fwrite.c: File removed. + * stdio/getc.c: File removed. + * stdio/getchar.c: File removed. + * stdio/getdelim.c: File removed. + * stdio/gets.c: File removed. + * stdio/glue.c: File removed. + * stdio/internals.c: File removed. + * stdio/linewrap.c: File removed. + * stdio/linewrap.h: File removed. + * stdio/memstream.c: File removed. + * stdio/newstream.c: File removed. + * stdio/obstream.c: File removed. + * stdio/putc.c: File removed. + * stdio/putchar.c: File removed. + * stdio/puts.c: File removed. + * stdio/rewind.c: File removed. + * stdio/setbuf.c: File removed. + * stdio/setbuffer.c: File removed. + * stdio/setlinebuf.c: File removed. + * stdio/setvbuf.c: File removed. + * stdio/stdio.h: File removed. + * stdio/ungetc.c: File removed. + * stdio/vasprintf.c: File removed. + * stdio/vscanf.c: File removed. + * stdio/vsnprintf.c: File removed. + * stdio/vsprintf.c: File removed. + * stdio/vsscanf.c: File removed. + * sysdeps/generic/defs.c: File removed. + * sysdeps/generic/fdopen.c: File removed. + * sysdeps/generic/pipestream.c: File removed. + * sysdeps/generic/stdio_init.c: File removed. + * sysdeps/generic/sysd-stdio.c: File removed. + * sysdeps/generic/vdprintf.c: File removed. + * sysdeps/mach/hurd/defs.c: File removed. + * sysdeps/mach/hurd/fdopen.c: File removed. + * sysdeps/mach/hurd/pipestream.c: File removed. + * sysdeps/mach/hurd/stdio_init.c: File removed. + * sysdeps/mach/hurd/sysd-stdio.c: File removed. + * sysdeps/mach/hurd/vdprintf.c: File removed. + * sysdeps/posix/defs.c: File removed. + * sysdeps/posix/fdopen.c: File removed. + * sysdeps/posix/pipestream.c: File removed. + * sysdeps/posix/stdio_init.c: File removed. + * sysdeps/posix/vdprintf.c: File removed. + * sysdeps/unix/pipestream.c: File removed. + * sysdeps/unix/sysv/sysd-stdio.c: File removed. + * sysdeps/unix/sysv/sco3.2.4/pipestream.c: File removed. + * sysdeps/unix/sysv/sysv4/pipestream.c: File removed. + +2002-04-29 Roland McGrath + + * include/libc-symbols.h (link_warning): Use `unused' attribute. + +2002-04-28 Ulrich Drepper + + * sysdeps/generic/tls.h: Describe what must be defined. + + * sysdeps/generic/glob.c (glob): Don't pass GLOB_NOMAGIC flag to + glob_in_dir [PR libc/3385]. + * posix/globtest.sh: Add test case. + + * intl/loadmsgcat.c [!_LIBC] (_nl_init_domain_conv): Don't add + //TRANSLIT twice. + +2002-04-27 Ulrich Drepper + + * sysdeps/unix/sysv/linux/ia64/fxstat.c: Fix a few issues with the + _internal symbol handling. + * sysdeps/unix/sysv/linux/ia64/lxstat.c: Likewise. + +2002-04-26 Ulrich Drepper + + * sysdeps/ia64/fpu/s_finite.S: Define _internal aliases. + * sysdeps/unix/sysv/linux/ia64/fork.S: Likewise. + +2002-04-26 Isamu Hasegawa + + * posix/regcomp.c (re_compile_fastmap_iter): Fix fastmap in case of + not _LIBC and RE_ENABLE_I18N. + (build_range_exp): Implement for not _LIBC. + (build_collating_symbol): Likewise. + (parse_bracket_exp): Unify redundant error handlings. + Don't erase mbcset for non matching list in multibyte envs. + (build_word_op): Add '_' to matching list for \w operator. + * posix/regex_internal.c (re_string_construct): Invoke + build_upper_buffer in case of not RE_ENABLE_I18N. + (re_string_reconstruct): Don't touch cur_state in case of not + RE_ENABLE_I18N. + * posix/regex_internal.h (attribute_hidden): New macro in case of + not _LIBC. + (re_charset_t): Define range_starts/ends in case of not _LIBC. + * posix/regexec.c (sift_states_iter_mb): Hide in case of not + RE_ENABLE_I18N. + (transit_state_mb): Likewise. + (check_node_accept_bytes): Implement the code evaluating range + expression in case of not _LIBC. + (find_collation_sequence_value): Hide in case of not _LIBC. + +2002-04-26 Jakub Jelinek + + * sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c: Copied from + i386/semctl.c. + (__old_semctl, __new_semctl): Only use va_arg if the argument will + be used. + +2002-04-26 Ulrich Drepper + + * sysdeps/ia64/fpu/s_isinf.S: Fix definition of _internal names. + + * sysdeps/ia64/strncpy.S: Fix recovery code. + Patch by David Mosberger . + +2002-04-24 Ulrich Drepper + + * sysdeps/unix/sysv/linux/ia64/Versions [libc]: Add getunwind for + GLIBC_2.2.6. + +2002-04-14 Bruno Haible + + * posix/regex.c (re_max_failures): Add back symbol for binary + compatibility. + +2002-04-22 Isamu Hasegawa + + * posix/regcomp.c (re_compile_internal): Adapt it to new interface + of buffer building functions. + * posix/regex_internal.c (re_string_allocate): New function. + (re_string_realloc_buffers): New function. + (re_string_skip_chars): New function. + (re_string_reconstruct): New function. + (re_string_construct): Adapt it to new interface of buffer building + functions. + (re_string_construct_common): Likewise. + (build_wcs_buffer): Likewise. + (build_wcs_upper_buffer): Likewise. + (build_upper_buffer): Likewise. + (re_string_translate_buffer): Likewise. + (re_string_context_at): Adapt it to variable length buffers. + * posix/regex_internal.h (re_string_t): Add new fields to handle + variable length buffers. + (re_match_context_t): Likewise. + * posix/regexec.c (re_search_internal): Adapt it to new interface + of re_string_t and re_match_context_t. + (acquire_init_state_context): Likewise. + (check_matching): Likewise. + (check_halt_state_context): Likewise. + (proceed_next_node): Likewise. + (set_regs): Likewise. + (sift_states_backward): Likewise. + (clean_state_log_if_need): Likewise. + (sift_states_iter_mb): Likewise. + (sift_states_iter_bkref): Likewise. + (add_epsilon_backreference): Likewise. + (transit_state): Likewise. + (transit_state_sb): Likewise. + (transit_state_mb): Likewise. + (transit_state_bkref): Likewise. + (transit_state_bkref_loop): Likewise. + (check_node_accept): Likewise. + (match_ctx_init): Likewise. + (extend_buffers): New function. + +2002-04-21 Bruno Haible + + * iconvdata/tst-table.sh: For the second check, use the truncated + GB18030 charmap table, like for the first check. + +2002-04-24 Ulrich Drepper + + * elf/dl-load.c (open_verify): Correct __lseek parameters. + Patch by Simon Hildrew [PR libc/3354]. + +2002-04-23 H.J. Lu + + * include/math.h (isfinite): Fix a typo. + +2002-04-24 Ulrich Drepper + + * libio/bug-ungetwc2.c (test_locale): Use the de_DE.UTF-8 locale + which is created by the test suite. + +2002-04-20 Bruno Haible + + * iconvdata/iso-2002-kr.c (MAX_NEEDED_FROM): Set to 4. + (BODY for FROM_LOOP): Fix comparisons between inptr and inend. + +2002-04-20 Bruno Haible + + * iconvdata/johab.c (BODY for FROM_LOOP): Change type of i, m, f, + to avoid gcc warning. + +2002-04-20 Bruno Haible + + * iconvdata/iso-2022-jp.c (EMIT_SHIFT_TO_INIT): Fix modification mask + of data->__statep->__count. + +2002-04-20 Bruno Haible + + * iconvdata/euc-jisx0213.c (BODY for TO_LOOP): Really ignore Unicode + tag characters. + * iconvdata/shift_jisx0213.c (BODY for TO_LOOP): Likewise. + +2002-04-24 Roland McGrath + + * sysdeps/mach/alpha/syscall.S: Don't use .frame, ENTRY will have it; + use END macro instead of our own .end directive. + Use `callsys' insn mnemonic instead of `call_pal'. + + * sysdeps/mach/alpha/sysdep.h (ENTRY): New macro. + + * sysdeps/alpha/dl-machine.h (ELF_MACHINE_USER_ADDRESS_MASK): New + macro; we need this for Hurd. + + Log entry was missing for 2002/03/24 commit of rev 1.8, + goes with 2002-03-17 changes. + * sysdeps/mach/hurd/i386/Makefile [$(subdir) = misc] + (sysdep_routines): Append ioperm here. + (sysdep_headers): Append sys/io.h here. + +2002-04-23 Roland McGrath + + * sysdeps/mach/hurd/send.c: int -> size_t for WROTE. + * sysdeps/mach/hurd/sendto.c: Likewise. + * hurd/hurdioctl.c (siocgifconf): int -> size_t for DATA_LEN. + * sysdeps/mach/hurd/wait4.c (__wait4): natural_t -> int for SIGCODE. + * sysdeps/mach/hurd/getpriority.c: unsigned int -> size_t for PISIZE. + +2002-04-22 Roland McGrath + + * sysdeps/mach/hurd/i386/ioperm.c (ioperm): Translate MIG_BAD_ID + failure from i386_io_perm_* RPCs to ENOSYS. + +2002-04-22 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/ldconfig.h: New file. + + * sysdeps/unix/sysv/linux/x86_64/dl-cache.h: New file. + + * sysdeps/unix/sysv/linux/x86_64/vfork.S: Use %rdi as temp + register instead of destroying %rbx. + +2002-04-21 Ulrich Drepper + + * string/string.h: Declare strerror_r also for XPG6. + +2002-04-19 Roland McGrath + + * sysdeps/mach/hurd/tmpfile.c: Create a file descriptor and use fdopen. + +2002-04-20 Ulrich Drepper + + * Makefile: Add handling of xtests and xcheck targets. + * MakeTAGS: Likewise. + * Makeconfig: Likewise. + * Makerules: Likewise. + * Rules: Likewise. + * manual/Makefile: Likewise. + * sunrpc/Makefile (xtests): Add thrsvc if thread library available. + * sunrpc/thrsvc.c: New file. By Zack Weinberg. + +2002-04-11 Zack Weinberg + + * include/rpc/rpc.h (struct rpc_thread_variables): Remove + authnone_private_s. + * sunrpc/auth_none.c: Include bits/libc-lock.h. + Delete #ifdef _RPC_THREAD_SAFE_ block. + (authnone_private): Make a struct, not a pointer to struct. + (authnone_private_guard): New once-control variable. + (authnone_create_once): New function, split out of + authnone_create. No need to allocate memory. + (authnone_create): Just call authnone_create_once via + __libc_once, then return &authnone_private->no_client. + (authnone_marshal): Access private data via CLIENT argument, + not authnone_private pointer. + Fix typo (MAX_MARSHEL_SIZE -> MAX_MARSHAL_SIZE). + * sunrpc/rpc_thread.c (__rpc_thread_destroy): No need to free + authnone_private_s. + +2002-04-12 H.J. Lu + + * sunrpc/clnt_raw.c (clntraw_create): Properly set xdrs and client. + +2002-04-18 Bruno Haible + + * iconvdata/euc-jisx0213.c (EMIT_SHIFT_TO_INIT, BODY for + FROM_DIRECTION): Make the FROM direction stateless. + * iconvdata/shift_jisx0213.c (EMIT_SHIFT_TO_INIT, BODY for + FROM_DIRECTION): Likewise. + +2002-04-15 Bruno Haible + + * iconvdata/JISX0213.TXT: New file. + * iconvdata/jisx0213.h: New file. + * iconvdata/jisx0213.c: New file. + * iconvdata/euc-jisx0213.c: New file. + * iconvdata/shift_jisx0213.c: New file. + * iconvdata/gconv-modules (EUC-JISX0213, SHIFT_JISX0213): New modules. + * iconvdata/EUC-JISX0213.precomposed: New file. + * iconvdata/SHIFT_JISX0213.precomposed: New file. + * iconvdata/SHIFT_JISX0213.irreversible: New file. + * iconvdata/tst-table-to.c (main): Make it work for encodings for + which the "to" direction is stateful. + * iconvdata/tst-tables.sh: Add EUC-JISX0213, SHIFT_JISX0213. + * iconvdata/Makefile (modules): Add libJISX0213, EUC-JISX0213, + SHIFT_JISX0213. + (libJISX0213-routines): New variable. + (LDFLAGS-EUC-JISX0213.so, LDFLAGS-SHIFT_JISX0213.so): New variables. + (EUC-JISX0213.so, SHIFT_JISX0213.so): Depend on libJISX0213.so. + (LDFLAGS-libJISX0213.so): New variable. + (distribute): Add JISX0213.TXT, EUC-JISX0213.precomposed, + SHIFT_JISX0213.precomposed, SHIFT_JISX0213.irreversible, + jisx0213.c, jisx0213.h, euc-jisx0213.c, shift_jisx0213.c. + +2002-04-15 Bruno Haible + + * iconvdata/big5hkscs.c (big5hkscs_to_ucs): Change element type to + uint32_t. Update to Unicode 3.2. + (from_ucs4, from_ucs4_idx): Update to Unicode 3.2. + (BODY for TO_LOOP): Handle the ASCII range specially. + * iconvdata/BIG5HKSCS.irreversible: Add one more entry. + * iconvdata/testdata/BIG5HKSCS: Remove a character. + * iconvdata/testdata/BIG5HKSCS..UTF-8: Regenerated. + +2002-04-15 Bruno Haible + + * iconvdata/gb18030.c (__twobyte_to_ucs, __fourbyte_to_ucs, + __ucs_to_gb18030_tab1, __ucs_to_gb18030_tab2): Update to Unicode 3.2. + +2002-04-15 Bruno Haible + + * iconvdata/cns11643.h (__cns11643_from_ucs4p2c_tab): New declaration. + (ucs4_to_cns11643): Update. + * iconvdata/cns11643.c: Update to Unicode 3.2. + (__cns11643l2*_to_ucs4_tab, __cns11643_from_ucs4p0_tab, + __cns11643_from_ucs4p2_tab): Regenerated. + (__cns11643_from_ucs4p2c_tab): New array. + * iconvdata/cvs11643l1.c: Update comments. + * iconvdata/EUC-TW.irreversible: Remove two entries. + +2002-04-15 Bruno Haible + + * locale/C-translit.h.in: Update to Unicode 3.2. + Add , .., .., .., + , .., .., ... + +2002-04-15 Bruno Haible + + * iconvdata/sjis.c (halfkana_to_ucs4): Remove array. + (BODY for FROM_LOOP): Optimize the JISX0201:GR to Unicode conversion. + +2002-04-15 Bruno Haible + + * iconvdata/euc-jp.c (BODY for FROM_LOOP): When encountering an + invalid input (e.g. a byte > 0x80 followed by a byte < 0x80), skip + always one byte, not 0 bytes in some cases and 2 bytes in others. + + * iconvdata/tst-table-from.c (main): Correct the usage message. + +2002-04-19 Isamu Hasegawa + + * posix/regcomp.c (parse_expression): Fix incorrect error code. + (parse_dup_op): Fix error handling like "a{}". + (parse_bracket_exp): Add error handling. + (fetch_number): Add error handling for "a{}". + +2002-04-19 Isamu Hasegawa + + * posix/regcomp.c (parse_bracket_symbol): Add error handling + in case that the symbol name is too long. + (build_charclass): Handle [:lower:]/[:uppper:] correctly + in case of REG_ICASE. + +2002-04-19 Andreas Jaeger + + * math/libm-test.inc: Fix comment, suggested by Hartvig Ekner + . + +2002-04-15 H.J. Lu + + * include/math.h (__finitel_internal): Declare only if + __NO_LONG_DOUBLE_MATH is not defined. + (__isinfl_internal): Likewise. + (__isnanl_internal): Likewise. + + * sysdeps/unix/sysv/linux/alpha/syscalls.list: Add __connect_internal. + * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise. + + * sysdeps/unix/sysv/linux/syscalls.list: Add __chown_internal and + __fcntl_internal. + + * sysdeps/unix/sysv/linux/fxstat.c (__fxstat64_internal): Added. + * sysdeps/unix/sysv/linux/lxstat.c (__lxstat64_internal): Added. + +2002-04-15 Bruno Haible + + * iconvdata/armscii-8.c (BODY for FROM_LOOP): Fix array access. + (BODY for TO_LOOP): Likewise. + * iconvdata/tcvn5712-1.c (from_ucs4): Map U+0309 to 0xB1. + * iconvdata/tst-table.sh: Add support for encodings which contain + precomposed Unicode characters, known to the iconv converter in both + directions but not listed in the charmap. + * iconvdata/IBM856.irreversible: New file. + * iconvdata/IBM922.irreversible: New file. + * iconvdata/IBM1132.irreversible: New file. + * iconvdata/IBM1133.irreversible: New file. + * iconvdata/IBM1160.irreversible: New file. + * iconvdata/IBM1161.irreversible: New file. + * iconvdata/IBM1163.irreversible: New file. + * iconvdata/IBM1164.irreversible: New file. + * iconvdata/ARMSCII-8.irreversible: New file. + * iconvdata/TCVN5712-1.precomposed: New file. + * iconvdata/tst-tables.sh: Add IBM856, IBM922, IBM1124, IBM1129, + IBM1160, IBM1161, IBM1132, IBM1133, IBM1162, IBM1163, IBM1164, + ARMSCII-8, TCVN5712-1. + * iconvdata/Makefile (distribute): Add IBM856.irreversible, + IBM922.irreversible, IBM1132.irreversible, IBM1133.irreversible, + IBM1160.irreversible, IBM1161.irreversible, IBM1163.irreversible, + IBM1164.irreversible, ARMSCII-8.irreversible, TCVN5712-1.precomposed. + +2002-04-17 Jakub Jelinek + + * time/tst-mktime.c: Include . Use %d, not %ld format + for EVENING69. Include offsets in TZ environment variable. + +2002-04-18 Ulrich Drepper + + * iconv/skeleton.c (RESET_INPUT_BUFFER): Replace ifs with #ifs to + avoid compiler warnings. + + * locale/programs/localedef.c (main): Always call + construct_output_path. + + * iconv/Makefile (CFLAGS-simple-hash.c): Define to find hashval.h. + + * locale/programs/locfile.c (to_archive): New variable. To collect + data which has to be added to the locale archive. + (write_all_categories): Take new third parameter with locale name. + Unless no_archive flag set add new locale data to the archive + (write_locale_data): Unless no-archive flag set store generated data + in to_archive data structure instead of generation output file. + Add new parameter with locale category index. + * locale/programs/locfile.h: Add new parameters in declaractions of + write_all_categories and write_locale_data. + * locale/programs/localedef.c: Recognize --no-archive, --list-archive, + --add-to-archive, and --delete-from-archive options. Pass extra + parameter to write_all_categories. + * locale/programs/localedef.h: Add prototypes for functions in + locarchive.c. + * locale/locarchive.h: New file. + * locale/programs/locarchive.c: New file. + * locale/Makefile (distribute): Add programs/locarchive.c and + locarchive.h. + (localedef-modules): Add md5 and locarchive. + Add vpath to crypt subdir for md5.c. + + * locale/programs/ld-address.c: Pass locale category ID as new second + parameter to write_locale_data. + * locale/programs/ld-collate.c: Likewise. + * locale/programs/ld-ctype.c: Likewise. + * locale/programs/ld-identification.c: Likewise. + * locale/programs/ld-measurement.c: Likewise. + * locale/programs/ld-messages.c: Likewise. + * locale/programs/ld-monetary.c: Likewise. + * locale/programs/ld-name.c: Likewise. + * locale/programs/ld-numeric.c: Likewise. + * locale/programs/ld-paper.c: Likewise. + * locale/programs/ld-telephone.c: Likewise. + * locale/programs/ld-time.c: Likewise. + + * locale/simple-hash.c: Move compute_hashval function from here... + * locale/hashval.h: ...to here. New file. + * locale/simple-hash.h: Add prototype for compute_hashval. + + * include/libintl.h: Minor cleanups. + +2002-04-16 Ulrich Drepper + + * posix/regcomp.c (gettext): Use INTUSE for _libc_intl_domainname. + +2002-04-15 Ulrich Drepper + + * include/sys/stat.h: Fix typo. Patch by HJ Lu. + +2002-04-14 Bruno Haible + + * locale/programs/charmap.c (charmap_read): Don't access result if + result == NULL. + +2002-02-17 Andreas Schwab + + * elf/reldep7.c: New file. + * elf/reldep7mod1.c: New file. + * elf/reldep7mod2.c: New file. + * elf/Makefile: Add rules to build and run reldep7. + +2002-04-14 Jakub Jelinek + + * elf/dl-lookup.c (_dl_lookup_symbol): Move add_dependency call to + the end of the function. Pass original flags to recursive call if + add_dependency failed. + (_dl_lookup_versioned_symbol): Likewise. + +2002-04-13 Jakub Jelinek + + * time/mktime.c (__mktime_internal): If year is 69, don't bail out + early, but check whether it overflowed afterwards. + * time/tst-mktime.c (main): Add new tests. + +2002-04-14 Ulrich Drepper + + * debug/xtrace.sh: Fix program name in help message. + Patch by Roger Luethi . + + * include/sys/stat.h: Add prototypes for __lxstat_internal and + __lxstat64_internal. Add macros __lxstat and __lxstat64 if not + NOT_IN_libc. + * sysdeps/generic/lxstat.c: Use INTDEF for __lxstat. + * sysdeps/mach/hurd/lxstat.c: Likewise. + * sysdeps/unix/common/lxstat.c: Likewise. + * sysdeps/unix/sysv/aix/lxstat.c: Likewise. + * sysdeps/unix/sysv/linux/lxstat.c: Likewise. + * sysdeps/unix/sysv/linux/i386/lxstat.c: Likewise. + * sysdeps/unix/sysv/linux/ia64/lxstat.c: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/lxstat.c: Likewise. + * sysdeps/generic/lxstat64.c: Use INTDEF for __lxstat64. + * sysdeps/mach/hurd/lxstat64.c: Likewise. + * sysdeps/unix/sysv/aix/lxstat64.c: Likewise. + * sysdeps/unix/sysv/linux/lxstat64.c: Likewise. + + * include/wchar.h: Declare __mbrtowc_internal and __mbrlen_internal + prototypes. Add __mbrlen and __mbrtowc macros. + * wcsmbs/mbrlen.c: Use INTDEF for __mbrlen. + * wcsmbs/mbrtowc.c: Use INTDEF for __mbrtowc. + + * include/unistd.h: Add prototype for __write_internal and add + __libc_write macro is SHARED. + * sysdeps/generic/write.c: Use INTDEF for __write. + * sysdeps/mach/hurd/write.c: Likewise. + * sysdeps/unix/sysv/aix/write.c: Likewise. + * sysdeps/unix/syscalls.list: Add __libc_write alias. + + * assert/assert.c: Replace STR_N_SIZE with something usable in + macro arguments. + * assert/assert-perr.c: Likewise. + + * include/sys/socket.h: Declare __libc_sa_len_internal and define + SA_LEN macro to use it if not NOT_IN_libc. + * sysdeps/unix/sysv/linux/sa_len.c: Use INTDEF for __libc_sa_len. + + * include/fcntl.h: Declare __open_internal and define __open and + __libc_open macros if not NOT_IN_libc. + * sysdeps/generic/open.c: Use INTDEF for __open. + * sysdeps/mach/hurd/open.c: Likewise. + * sysdeps/unix/sysv/aix/open.c: Likewise. + * sysdeps/unix/syscalls.list: Add __open_internal alias. + + * sysdeps/generic/check_fds.c: Make sure newly opened file descriptor + has correct number. + + * include/fcntl.h: Define __libc_fcntl macro if not NOT_IN_libc. + * sysdeps/mach/hurd/fcntl.c: Undefine __libc_fcntl as well. + * sysdeps/unix/sysv/aix/fcntl.c: Likewise. + * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise. + + * include/wctype.h: Declare __iswalpha_l_internal, + __iswdigit_l_internal, __iswspace_l_internal, + __iswxdigit_l_internal, and __iswctype_internal. Define + __iswalpha_l, __iswctype, __iswdigit_l, __iswspace_l, and + __iswxdigit_l macros if not NOT_IN_libc. + * wctype/iswctype.c: Use INTDEF for __iswctype. + * wctype/wcfuncs_l.c: Use INTDEF for all __iswXXX_l. + + * include/math.h: Declare __isinf_internal, __isinfl_internal, + __isnan_internal, and __isnanl_internal. + * stdio-common/printf_fp.c: Use INTUSE for calls to __isinf, __isinfl, + __isnan, and __isnanl. + * stdio-common/printf_size.c: Likewise. + * sysdeps/generic/printf_fphex.c: Likewise. + * sysdeps/i386/fpu/s_isinfl.c: Also define _internal alias. + * sysdeps/i386/fpu/s_isnanl.c: Likewise. + * sysdeps/ia64/fpu/s_isinf.S: Likewise. + * sysdeps/ia64/fpu/s_isnan.S: Likewise. + * sysdeps/ieee754/dbl-64/s_isinf.c: Likewise. + * sysdeps/ieee754/dbl-64/s_isnan.c: Likewise. + * sysdeps/ieee754/flt-32/s_isinff.c: Likewise. + * sysdeps/ieee754/flt-32/s_isnanf.c: Likewise. + * sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise. + * sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise. + * sysdeps/ieee754/ldbl-96/s_isinfl.c: Likewise. + * sysdeps/m68k/s_isinfl.c: Likewise. + * sysdeps/m68k/fpu/s_isinf.c: Likewise. + * sysdeps/powerpc/fpu/s_isnan.c: Likewise. + + * include/sys/time.h: Declare __gettimeofday_internal and define + __gettimeofday macro if not NOT_IN_libc. + * sysdeps/generic/gettimeofday.c: Use INTEDEF for __gettimeofday. + * sysdeps/mach/gettimeofday.c: Likewise. + * sysdeps/posix/gettimeofday.c: Likewise. + * sysdeps/unix/sysv/aix/gettimeofday.c: Likewise. + * sysdeps/unix/common/syscalls.list: Define __gettimeofday alias. + * sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/gettimeofday.S: Likewise. + + * include/sys/stat.h: Declare __fxstat_internal and __fxstat64_internal + and define __fxstate and __fxstat64 macros if not NOT_IN_libc. + Remove __lstat and __fstat inline functions. + * sysdeps/generic/fxstat.c: Use INTDEF for __fxstat. + * sysdeps/mach/hurd/fxstat.c: Likewise. + * sysdeps/unix/fxstat.c: Likewise. + * sysdeps/unix/sysv/aix/fxstat.c: Likewise. + * sysdeps/unix/sysv/linux/fxstat.c: Likewise. + * sysdeps/unix/sysv/linux/i386/fxstat.c: Likewise. + * sysdeps/unix/sysv/linux/ia64/fxstat.c: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/fxstat.c: Likewise. + * sysdeps/generic/fxstat64.c: Use INTDEF for __fxstat64. + * sysdeps/mach/hurd/fxstat64.c: Likewise. + * sysdeps/unix/sysv/aix/fxstat64.c: Likewise. + * sysdeps/unix/sysv/linux/fxstat64.c: Likewise. + + * include/unistd.h: Declare __getpid_internal and define + __getpid macro if not NOT_IN_libc. + * sysdeps/mach/hurd/getpid.c: Use INTDEF for __getpid. + * sysdeps/generic/getpid.c: Likewise. + * sysdeps/unix/syscalls.list: Add __getpid_internal alias. + * posix/bsd-getpgrp.c: Use INTUSE for __getpgid call. + + * include/unistd.h: Declare __getpgid_internal and define + __getpgid macro if not NOT_IN_libc. + * sysdeps/generic/getpgid.c: Use INTDEF for __getpgid. + * sysdeps/mach/hurd/getpgid.c: Likewise. + * sysdeps/unix/sysv/aix/getpgid.c: Likewise. + * sysdeps/unix/sysv/sysv4/__getpgid.c: Likewise. + * sysdeps/unix/sysv/sysv4/getpgid.c: Likewise. + * sysdeps/unix/sysv/linux/syscalls.list: Add _getpgid_internal alias. + + * include/unistd.h: Declare __getpagesize_internal and define + __getpagesize macro if not NOT_IN_libc. + * sysdeps/unix/sysv/linux/shmat.c: Include for + __getpagesize. + * sysdeps/generic/getpagesize.c: Use INTDEF for __getpagesize. + * sysdeps/mach/getpagesize.c: Likewise. + * sysdeps/posix/getpagesize.c: Likewise. + * sysdeps/unix/getpagesize.c: Likewise. + * sysdeps/unix/sysv/linux/getpagesize.c: Likewise. + * sysdeps/unix/sysv/linux/ia64/getpagesize.c: Likewise. + * sysdeps/unix/sysv/linux/m68k/getpagesize.c: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/getpagesize.c: Likewise. + +2002-04-13 Andreas Jaeger + + * sysdeps/i386/i486/bits/string.h (__strcspn_cg): Use only memory + as clobber to reduce register pressure. + (__strpbrk_cg): Likewise. + (__mempcpy_by4): Likewise. + (__strstr_cg): Likewise. + Add prototype for __memrchr. + +2002-04-13 Andreas Schwab + + * sysdeps/m68k/fpu/s_finite.c: Add internal alias. + * sysdeps/m68k/fpu/s_finitef.c: Likewise. + * sysdeps/m68k/fpu/s_finitel.c: Likewise. + +2002-04-13 Ulrich Drepper + + * elf/do-lookup.h [!VERSIONED]: Add new parameter flags. Use it to + check whether the caller prefers getting the most recent version of + a symbol of the earliest version. + * elf/dl-lookup.c: Adjust all callers of do_lookup. Change + _dl_do_lookup to also take the new parameter and pass it on. + Change 'explicit' parameter of _dl_lookup_symbol and + _dl_lookup_versioned_symbol to flags. Adjust tests. + * sysdeps/generic/ldsodefs.h: Adjust prototypes. + * elf/dl-libc.c: Adjust all callers of _dl_lookup_symbol and + _dl_lookup_versioned_symbol. + * elf/dl-reloc.c: Likewise. + * elf/dl-runtime.c: Likewise. + * elf/dl-sym.c: Likewise. + * sysdeps/mips/dl-machine.h: Likewise. + +2002-04-11 Jakub Jelinek + + * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (LOC): Don't paste + in a token. + * sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h (LOC): Likewise. + +2002-04-10 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/glob.c: New file. + + * include/argz.h: Remove extra char from last patch. + +2002-04-09 Ulrich Drepper + + * sysdeps/mach/hurd/chown.c: Use INTDEF for __chown. + * sysdeps/unix/sysv/aix/chown.c: Likewise. + * sysdeps/unix/grantpt.c: Use INTUSE for __chown calls. + * sysdeps/unix/sysv/linux/m68k/chown.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/chown.c: Likewise. + * sysdeps/unix/sysv/linux/i386/chown.c: Use INTDEF2 to define + __chown_internal. + * sysdeps/unix/sysv/linux/s390/s390-32/chown.c: Likewise. + + * intl/dcngettext.c [_LIBC]: Use INTUSE for __dcngettext. + * intl/dngettext.c [_LIBC] (DCNGETTEXT): Use INTUSE. + * intl/ngettext.c: Likewise. + + * include/sys/socket.h: Declare __connect_internal and define + __connect macro if not NOT_IN_libc. + * sysdeps/mach/hurd/connect.c: Use INTDEF for __connect. + * sysdeps/unix/sysv/aix/connect.c: Likewise. + * sysdeps/unix/sysv/linux/connect.S: Add __connect_internal alias. + + * include/unistd.h: Declare __close_internal and define __close macro + if not NOT_IN_libc. + * libio/libioP.h (JUMO0, JUMP1, JUMP2, JUMP3, WJUMP0, WJUMP1, WJUMP2, + WJUMP3): Add extra parenthesis to avoid expanding element names with + macors like __close. + * sysdeps/unix/syscalls.list: Add __close_internal alias. + + * include/unistd.h: Declare __dup2_internal and define __dup2 macro + if not NOT_IN_libc. + * sysdeps/mach/hurd/dup2.c: Use INTDEF for __dup2. + * sysdeps/posix/dup2.c: Use INTDEF for __dup2. + * sysdeps/unix/syscalls.list: Add __dup2_internal alias. + + * include/unistd.h: Declare __fork_internal and define __fork macro + if not NOT_IN_libc. + * sysdeps/mach/hurd/fork.c: Use INTDEF for __fork. + * sysdeps/unix/sysv/aix/fork.c: Likewise. + * sysdeps/unix/sysv/linux/syscalls.list: Add __fork_internal alias. + + * include/stdio_ext.h: Declare __fsetlocking_internal and define + __fsetlocking macro to use it if not NOT_IN_libc. + * libio/__fsetlocking.c: Use INTDEF for __fsetlocking. + + * libio/__fbufsize.c: Correct copyright. + * libio/__flbf.c: Likewise. + * libio/__fpending.c: Likewise. + * libio/__fpurge.c: Likewise. + * libio/__freadable.c: Likewise. + * libio/__freading.c: Likewise. + * libio/__fsetlocking.c: Likewise. + * libio/__fwritable.c: Likewise. + * libio/__fwriting.c: Likewise. + + * include/stdio.h: Declare __asprintf_internal and define __asprintf + macro to use it if not NOT_IN_libc. + * stdio-common/asprintf.c: Use INTDEF for __asprintf. + + * include/mntent.h: Declare __setmntent_internal, + __getmntent_r_internal, __endmntent_internal. Define __setmntent, + __getmntent_r, and __endmntent macros to use these functions if not + NOT_IN_libc. + * misc/mntent_r.c: Use INTDEF for __setmntent, __getmntent_r, and + __endmntent. + + * include/math.h: Declare __finite_internal, __finitef_internal, and + __finitel_internal. Redefine isfinite macro if in libc or libm using + these functions. + * sysdeps/generic/s_ldexp.c: Use INTUSE for __finite calls. + * sysdeps/generic/s_ldexpf.c: Use INTUSE for __finitef calls. + * sysdeps/generic/s_ldexpl.c: Use INTUSE for __finitel calls. + * sysdeps/i386/fpu/s_finite.S: Define _internal alias. + * sysdeps/i386/fpu/s_finitef.S: Likewise. + * sysdeps/i386/fpu/s_finitel.S: Likewise. + * sysdeps/ieee754/dbl-64/s_finite.c: Likewise. + * sysdeps/ieee754/flt-32/s_finitef.c: Likewise. + * sysdeps/ieee754/ldbl-128/s_finitel.c: Likewise. + * sysdeps/ieee754/ldbl-96/s_finitel.c: Likewise. + + * include/fcntl.h: Declare __fcntl_internal. Define __fcntl macro + to use this function if not NOT_IN_libc. + * libio/iofdopen.c (_IO_fcntl): Use INTUSE. + * sysdeps/generic/fcntl.c: Use INTDEF for __fcntl. + * sysdeps/mach/hurd/fcntl.c: Likewise. + * sysdeps/unix/sysv/aix/fcntl.c: Likewise. + * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise. + + * include/argz.h: Declare __argz_count_internal and + __argz_stringify_internal. + * intl/l10nflist.c [_LIBC]: Use INTUSE for __argz_count and + __argz_stringify. + * string/argz-count.c: Use INTDEF for __argz_count. + * string/argz-stringify.c: Use INTDEF for __argz_stringify. + + * include/stdlib.h: Declare __cxa_atexit_internal and define + __cxa_atexit macro if not NOT_IN_libc. + * stdlib/cxa_atexit.c: Use INTDEF for __cxa_atexit. + * dlfcn/Makefile: Define NOT_IN_libc when compiling modcxaatexit.c. + + * assert/assert.c: Use INTDEF for __assert_fail. + * assert/__assert.c: Use INTUSE for call to __assert_fail. + * include/assert.h: Declare __assert_fail_internal. + + * extra-lib.mk: Mark assignment to lib with override. + +2002-04-08 Ulrich Drepper + + * Makerules: Use cppflags-iterator.mk to add defines for all test + source files. + +2002-04-08 kaz Kojima + + * elf/elf.h: Define R_SH_TLS_xxx macros. + * elf/rtld.c: Remove an extra parenthesis. + * elf/tls-macros.h: Define SH version TLS_LE, TLS_IE, TLS_LD and + TLS_GD macros. + * sysdeps/generic/dl-tls.c: Add a missing semi-colon. + * sysdeps/sh/dl-lookupcfg.h: New file. + * sysdeps/sh/dl-tls.h: New file. + * sysdeps/sh/dl-machine.h (elf_machine_type_class): Set + ELF_RTYPE_CLASS_PLT also for the three TLS relocations. + (elf_machine_rela): Handle R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32 and + R_SH_TLS_TPOFF32 relocations. + +2002-04-08 Ulrich Drepper + + * cppflags-iterator.mk (cpp-srcs-left): Define NOT_IN_libc instead + of NOT_IN_LIBC. + * include/libintl.h: Test for NOT_IN_libc not NOT_IN_LIBC. + * include/stdlib.h: Likewise. + +2002-04-08 Jakub Jelinek + + * elf/Makefile (CFLAGS-.os): Define NOT_IN_libc and IS_IN_rtld + instead of _RTLD_LOCAL. + * elf/dl-dst.h: Use IS_IN_rtld instead of _RTLD_LOCAL. + * include/unistd.h: Likewise. + * sysdeps/generic/ldsodefs.h: Likewise. + + * stdio-common/_itoa.h (_itoa_word): Only use internal digit arrays + if in libc or ld.so. + +2002-04-08 Andreas Jaeger + + * elf/cache.c (print_entry): Support x86-64. + +2002-04-08 Ulrich Drepper + + * include/stdlib.h: For libc itself replace MB_CUR_MAX definition + with one accessing the locale data structures directly. + * stdio-common/printf-prs.c: Include localeinfo.h for new + MB_CUR_MAX definition. + + * Makeconfig (CPPFLAGS): Also add CPPFLAGS- where + is the name of the source file without extension. + * Makefile (distribute): Add cppflags-iterator.mk. + * cppflags-iterator.mk: New file. + * extra-lib.mk: For the sources of the library run + cppflags-iterator.mk. + + * include/libintl.h: Declare __dcgettext_internal and + _libc_intl_domainname_internal. Define __dcgettext using these + two symbols if used in libc itself. + * argp/argp-help.c: Define dgettext using __dcgettext_internal and + _libc_intl_domainname_internal. + * argp/argp-parse.c: Likewise. + * intl/dcgettext.c (__dcgettext): Use INTDEF to define alias. + * intl/dgettext.c: Call __dcgettext_internal instead of __dcgettext. + * intl/gettext.c: Likewise. + * locale/SYS_libc.c (_libc_intl_domainname): Use INTDEF to define + alias. + * posix/regcomp.c (gettext): Use __dcgettext_internal instead of + __dcgettext. + * posix/regex_internal.c (gettext): Likewise. + +2002-04-08 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed: Fix rewrite rule. + + * sysdeps/x86_64/fpu/s_llrint.S: New file. + * sysdeps/x86_64/fpu/s_llrintf.S: New file. + * sysdeps/x86_64/fpu/s_llrintl.S: New file. + * sysdeps/x86_64/fpu/s_lrint.S: New file. + * sysdeps/x86_64/fpu/s_lrintf.S: New file. + * sysdeps/x86_64/fpu/s_lrintl.S: New file. + +2002-04-08 Roland McGrath + + * sysdeps/mach/hurd/dl-sysdep.c (__mmap): Use MAP_FAILED instead of + widening __hurd_fail value. + +2002-04-07 Roland McGrath + + * sysdeps/mach/hurd/alpha/trampoline.c: Don't include + . + (_hurd_setup_sighandler): Take proper arguments for current decls. + Update code to use _hurdsig_catch_fault. + Use `callsys' instruction instead of `call_pal'. + * sysdeps/mach/hurd/alpha/intr-msg.h: New file. + + * sysdeps/mach/alpha/sysdep.h: Include . + (ALIGN, at, AT, fp): New macros. + +2002-04-06 Roland McGrath + + * mach/setup-thread.c (__mach_setup_thread): int -> natural_t + + * sysdeps/mach/hurd/dl-sysdep.c: Use ElfW(TYPE) in place of Elf32_TYPE. + (__mmap): Use MAP_FAILED instead of widening __hurd_fail value. + + * sysdeps/mach/hurd/bind.c: Use prototype definition. + * sysdeps/mach/hurd/connect.c: Likewise. + * sysdeps/mach/hurd/getsockopt.c: Likewise. + * sysdeps/mach/hurd/setsockopt.c: Likewise. + + * sysdeps/mach/hurd/alpha/sigreturn.c: Pass missing argument to + __msg_sig_post RPC. + + * hurd/catch-exc.c: Use integer_t instead of int. + * hurd/hurdfault.c: Likewise. + + * sysdeps/mach/hurd/alpha/exc2signal.c + (_hurd_exception2signal): Rewritten. + * sysdeps/mach/hurd/alpha/longjmp-ts.c + (_hurd_longjmp_thread_state): Rewritten. + +2002-04-07 Ulrich Drepper + + * nss/getXXbyYY_r.c: If NSS_attribute_hidden is defined use it with the + DB_LOOKUP_FCT prototype. + * nss/getXXent_r.c: Likewise. + * inet/getaliasent_r.c: Define NSS_attribute_hidden. + * inet/getaliasname_r.c: Likewise. + * inet/getnetbyad_r.c: Likewise. + * inet/getnetbynm_r.c: Likewise. + * inet/getnetent_r.c: Likewise. + * inet/getproto_r.c: Likewise. + * inet/getprtent_r.c: Likewise. + * inet/getprtname_r.c: Likewise. + * inet/getrpcbyname_r.c: Likewise. + * inet/getrpcbynumber_r.c: Likewise. + * inet/getrpcent_r.c: Likewise. + * inet/getservent_r.c: Likewise. + * inet/getsrvbynm_r.c: Likewise. + * inet/getsrvbypt_r.c: Likewise. + * shadow/getspent_r.c: Likewise. + * shadow/getspnam_r.c: Likewise. + + * malloc/thread-m.h: Define __libc_tsd_MALLOC_data as static. + + * sysdeps/i386/elf/bsd-setjmp.S: Use GOTOFF for __sigjmp_save access. + Use i686-friendly PIC code. + * sysdeps/i386/elf/setjmp.S: Likewise. + + * sysdeps/unix/sysv/linux/i386/sysdep.h: Use i686-friendly PIC code. + + * sysdeps/mach/hurd/Versions: Add _dl_init_first to libc and ld export + list. + * elf/Versions: Remove it here. + +2002-04-06 Ulrich Drepper + + * iconvdata/tcvn5712-1.c (MAX_NEEDED_INPUT): Define for from + direction. Reported by H . J . Lu . + +2002-04-05 Ulrich Drepper + + * intl/tst-gettext.sh: Set GCONV_PATH and LOCPATH to values for the + test just before the test runs. + * intl/tst-translit.sh: Likewise. + * intl/tst-codeset.sh: Likewise. + + * timezone/zic.c: Update from tzcode2002c. + * timezone/asia: Update from tzdata2002c. + * timezone/backward: Likewise. + * timezone/europe: Likewise. + * timezone/northamerica: Likewise. + * timezone/northamerica: Likewise. + * timezone/northamerica: Likewise. + * timezone/southamerica: Likewise. + * timezone/zone.tab: Likewise. + +2002-03-23 Jakub Jelinek + + * sysdeps/generic/brk.c (__curbrk): Declare. + * sysdeps/generic/dl-brk.c: Add attribute_hidden to __curbrk. + * sysdeps/generic/dl-sbrk.c: Likewise. + * sysdeps/unix/arm/dl-brk.S: New file. + * sysdeps/unix/bsd/hp/m68k/dl-brk.S: New file. + * sysdeps/unix/bsd/osf/alpha/dl-brk.S: New file. + * sysdeps/unix/bsd/sun/m68k/dl-brk.S: New file. + * sysdeps/unix/bsd/vax/dl-brk.S: New file. + * sysdeps/unix/i386/dl-brk.S: New file. + * sysdeps/unix/mips/dl-brk.S: New file. + * sysdeps/unix/sparc/dl-brk.S: New file. + * sysdeps/unix/sysv/linux/alpha/dl-brk.S: New file. + * sysdeps/unix/sysv/linux/ia64/dl-brk.S: New file. + * sysdeps/unix/sysv/linux/powerpc/dl-brk.S: New file. + * sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S: New file. + +2002-04-03 Andreas Schwab + + * Makefile (headers): Add gnu/lib-names.h here instead of + install-others. + ($(inst_includedir)/gnu/lib-names.h): Remove explicit + installation rule. + (install-headers): Add dependency on install-headers-nosubdir. + * stdio-common/Makefile (headers): Add bits/stdio_lim.h here + instead of install-others. + ($(inst_includedir)/bits/stdio_lim.h): Remove explicit + installation rule. + +2002-04-05 Ulrich Drepper + + * manual/users.tex (Enable/Disable Setuid): Fix typo in example. + Reported by Sam Roberts . + +2002-04-03 Jakub Jelinek + + * elf/do-rel.h (elf_dynamic_do_rel): Skip relative relocs if + l_addr == 0 and ELF_MACHINE_REL_RELATIVE. + * sysdeps/alpha/dl-machine.h (ELF_MACHINE_REL_RELATIVE): Define. + * sysdeps/ia64/dl-machine.h (ELF_MACHINE_REL_RELATIVE): Define. + +2002-04-03 David Mosberger + + * sysdeps/ia64/dl-machine.h (TRAMPOLINE_TEMPLATE): Add unwind info. + (RTLD_START): Ditto. + (__ia64_init_bootstrap_fdesc_table): Insert stop bit to avoid RAW + dependency violation. + +2002-04-05 Jakub Jelinek + + * time/mktime.c (__mktime_internal): Move check for year < 70 below + all variable declarations. + +2002-04-04 Andreas Schwab + + * sysdeps/unix/sysv/linux/ia64/pipe.S: Don't overwrite r8 on error. + +2002-04-04 Andreas Jaeger + + * sysdeps/x86_64/fpu/e_sqrt.c: New file. + * sysdeps/x86_64/fpu/e_sqrtf.c: New file. + + * sysdeps/x86_64/fpu/s_fabs.c: New file. + * sysdeps/x86_64/fpu/s_fabsf.c: New file. + * sysdeps/x86_64/fpu/s_fabsl.c: New file. + + * sysdeps/unix/sysv/linux/x86_64/time.S: New file. + + * sysdeps/unix/sysv/linux/x86_64/gettimeofday.S: New file. + + * sysdeps/unix/sysv/linux/x86_64/gettimeofday.c: Removed. + * sysdeps/unix/sysv/linux/x86_64/time.c: Removed. + + * configure.in: Handle all mips entries the same. + + * sysdeps/mips/dec/bits/endian.h: Removed since arch is not supported. + * sysdeps/mips/mips3/*: Likewise. + * sysdeps/mips/p40/bits/endian.h: Likewise. + +2002-04-04 Ulrich Drepper + + * misc/dirname.c (dirname): Ignore trailing slashes at end of + non-null result [PR libc/2600]. + + * misc/tst-dirname.c: Add more tests. + +2002-04-03 Ulrich Drepper + + * locale/programs/charmap.c (charmap_read): If the charmap doesn't + define a code_set_name provide one based on the filename. + + * malloc/hooks.c: Define weak_variable correctly for _LIBC. + +2001-12-28 Andreas Jaeger + + * time/mktime.c (__mktime_internal): Check for year < 70 + [PR libc/2738]. + +2002-04-03 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Fix arguments for + shmat. + Reported by Andi Kleen . + +2002-04-03 Ulrich Drepper + + * sysdeps/generic/w_lgamma.c: Initialized local_signgam. + * sysdeps/generic/w_lgammaf.c: Likewise. + * sysdeps/generic/w_lgammal.c: Likewise [PR libc/2854]. + + * debug/catchsegv.sh (exval): Quote [ in pattern [PR libc/2902]. + Adjust for new output format of the backtrace functions. + + * misc/syslog.c (vsyslog): Only use cleanup handler if + _LIBC_REENTRANT is defined [PR libc/2924]. + + * libio/Makefile (tests): Add bug-ungetwc2. + * libio/bug-ungetwc2.c: New file. + + * manual/install.texi: Typographical and grammatical cleanup. + Patch by Dennis Grace . + + * sunrpc/rpc_svcout.c (write_real_program): Write "result, " + parameter if mtflag. Patch by . + + * sunrpc/rpc_svcout.c (printif): Remove third parameter. It was + always "&". Adjust callers. + Add "_" prefix to several generated definitions. + Patch by paul@serice.net [PR libc/3158]. + +2002-04-02 Ulrich Drepper + + * sysdeps/unix/sysv/linux/arm/dl-procinfo.c: Completely specify + size of _dl_arm_cap_flags. + Patch by enrico.scholz@informatik.tu-chemnitz.de [PR libc/3155]. + + * sysdeps/unix/sysv/linux/arm/dl-procinfo.h (_DL_HWCAP_COUNT): + Define as 8. + +2002-03-22 H.J. Lu + + * scripts/firstversions.awk: Check the first version. + +2002-04-02 Ulrich Drepper + + * elf/dl-deps.c (_dl_map_object_deps): The sorting of the + dependencies must be stable to work correctly. + Reported by martin.lubich@datacon.at. + + * libio/bug-ungetwc1.c: New file. + * libio/Makefile (tests): Add bug-ungetwc1. + + * libio/fileops.c (_IO_new_file_close_it): Only call _IO_do_flush + if stream was last used for writing. + + * elf/do-lookup.h (do_lookup): 2 is the first user-defined version + number [PR libc/3111]. + + * libio/iofclose.c (_IO_new_fclose): Move freeing of backup buffer + to ... + * libio/fileops.c (_IO_new_file_close_it): ...here [PR libc/3190]. + +2002-04-02 Jakub Jelinek + + * inet/ether_ntoh.c (__nss_ethers_lookup): Add internal_function. + * inet/ether_hton.c (__nss_ethers_lookup): Likewise. + * inet/getnetgrent_r.c (__nss_netgroup_lookup): Likewise. + * sunrpc/netname.c (__nss_publickey_lookup): Likewise. + * sunrpc/publickey.c (__nss_publickey_lookup): Likewise. + +2002-03-30 Jakub Jelinek + + * elf/dynamic-link.h (elf_get_dynamic_info): Don't abort on unknown + dynamic tags. + +2002-03-29 Jakub Jelinek + + * sysdeps/i386/fpu/s_fabs.S: New file. + * sysdeps/i386/fpu/s_fabsf.S: New file. + * sysdeps/i386/fpu/s_fabsl.S: New file. + * sysdeps/sparc/sparc64/fpu/s_fabs.c: New file. + * sysdeps/sparc/sparc64/fpu/s_fabsf.c: New file. + * sysdeps/sparc/sparc64/fpu/s_fabsl.c: New file. + +2002-04-02 Ulrich Drepper + + * rt/tst-shm.c (do_test): Add one more test for size of shared + memory object. + +2002-03-29 Wolfram Gloger + + * malloc/malloc.c: Add short description and prototypes for + malloc_get_state, malloc_set_state and posix_memalign, for + consistency and to avoid warnings with -Wstrict-prototypes. + Reported by Andreas Jaeger . + +2002-04-02 Ulrich Drepper + + * po/gl.po: Update from translation team. + +2002-03-31 Roland McGrath + + * hurd/hurdselect.c (_hurd_select): Fix + MACH_MSG_TYPE_INTEGER_T -> integer_t in sizeof. + Use a union rather than casts to compare mach_msg_type_t as int. + +2002-03-25 Roland McGrath + + * hurd/hurdchdir.c (_hurd_change_directory_port_from_name): Don't + check off the end of NAME when it's shorter than 2 chars. + Reported by Ognyan Kulev . + +2002-03-17 Roland McGrath + + * sysdeps/mach/hurd/i386/sys/io.h: New file. + * sysdeps/mach/hurd/i386/ioperm.c: New file. + * sysdeps/mach/hurd/i386/Dist: Add them. + * sysdeps/mach/hurd/i386/Versions + (libc: GLIBC_2.2.6): New set, add ioperm. + * sysdeps/mach/configure.in: New check to set HAVE_I386_IO_PERM_MODIFY. + (mach_interface_list): Check for mach_i386.defs. + * config.h.in (HAVE_I386_IO_PERM_MODIFY): #undef it. + * sysdeps/mach/configure: Regenerated. + +2002-03-22 Ulrich Drepper + + * po/fr.po: Update from translation team. + +2002-03-21 Martin Schwidefsky + + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Remove + getpriority from syscalls list. + +2002-03-28 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/swapcontext.S: New file. + * sysdeps/unix/sysv/linux/x86_64/getcontext.S: New file. + * sysdeps/unix/sysv/linux/x86_64/setcontext.S: New file. + * sysdeps/unix/sysv/linux/x86_64/ucontext_i.h: New file. + +2002-03-27 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h (struct + sigcontext): Follow further kernel change. + + * sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h: Follow further + kernel change. + + * sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h (GET_STACK): + Change for struct sigcontext change. + + * sysdeps/unix/sysv/linux/x86_64/register-dump.h (register_dump): + Follow changes in struct sigcontext. + + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Remove ptrace + sysycall, use wrapper instead. + +2002-03-26 Andreas Jaeger + + * sysdeps/i386/i486/bits/string.h (__memcpy_by4): Describe memory + read and write accesses as detailed as possible. + (__memcpy_by2): Likewise. + (__memcpy_g): Likewise. + (memmove): Likewise. + (memcmp): Likewise. + (__memset_ccn_by4): Likewise. + (__memset_ccn_by2): Likewise. + (__memset_gcn_by4): Likewise. + (__memset_gcn_by2): Likewise. + (memchr): Likewise. + (__memrchr): Likewise. + (rawmemchr): Likewise. + (__strlen_g): Likewise. + (__strcpy_g): Likewise. + (__mempcpy_by4): Likewise. + (__mempcpy_by2): Likewise. + (__mempcpy_byn): Likewise. + (__stpcpy_g): Likewise. + (__strncpy_by4): Likewise. + (__strncpy_by2): Likewise. + (__strncpy_byn): Likewise. + (__strncpy_gg): Likewise. + (__strcat_c): Likewise. + (__strcat_g): Likewise. + (__strncat_g): Likewise. + (__strcmp_gg): Likewise. + (__strncmp_g): Likewise. + (__strchr_c): Likewise. + (__strchr_g): Likewise. + (__strchrnul_c): Likewise. + (__strchrnul_g): Likewise. + (__strrchr_c): Likewise. + (__strrchr_g): Likewise. + (__strrchr_c): Likewise. + (__strrchr_g): Likewise. + (__strcspn_c1): Likewise. + (__strcspn_cg): Likewise. + (__strcspn_g): Likewise. + (__strcspn_g): Likewise. + (__strspn_c1): Likewise. + (__strspn_cg): Likewise. + (__strspn_g): Likewise. + (__strspn_g): Likewise. + (__strpbrk_cg): Likewise. + (__strpbrk_g): Likewise. + (__strstr_cg): Likewise. + (__strstr_g): Likewise. + + * sysdeps/unix/sysv/linux/x86_64/sys/reg.h: Fix typo. Reported by + Michal Ludvig . + + * sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h: Add 32-bit + compatibilty, adjust for kernel changes. + + * sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h (struct + sigcontext): Adjust for kernel changes. + +2002-03-25 Andreas Jaeger + + * iconv/gconv_simple.c (ucs4le_internal_loop_single): Handle + little endian. + Reported by Artur Zaprzala . + +2002-03-24 Andreas Jaeger + + * manual/memory.texi (Aligned Memory Blocks): Fix typo. + + * stdio-common/tst-fdopen.c (main): Remove unused variable. + + * iconv/tst-iconv3.c (main): Use correct printf strings. + +2002-03-18 Roland McGrath + + * sysdeps/unix/bsd/bsd4.4/bits/socket.h (struct cmsgcred): New type. + (CMGROUP_MAX): New macro. + +2002-03-23 Roland McGrath + + * sysdeps/posix/shm_open.c (SHMDIR): /var/run/shm -> /dev/shm + * sysdeps/posix/shm_unlink.c: Likewise. + +2002-03-22 Roland McGrath + + * shlib-versions [USE_IN_LIBIO] (.*-.*-gnu-gnu.*): Make 2.2.6 default. + * sysdeps/mach/hurd/configure.in: Default oldest ABI is 2.2.6 + under --enable-libio. + * sysdeps/mach/hurd/configure: Regenerated. + +2002-03-23 Roland McGrath + + * sysdeps/mach/hurd/i386/Makefile + (sysdep_routines, shared-only-routines): Don't add framestate, + reverting 2001-10-02 change. + * sysdeps/unix/sysv/linux/arm/Makefile: Likewise. + * sysdeps/unix/sysv/linux/alpha/Makefile: Likewise. + * sysdeps/unix/sysv/linux/i386/Makefile: Likewise. + * sysdeps/unix/sysv/linux/m68k/Makefile: Likewise. + * sysdeps/unix/sysv/linux/mips/Makefile: Likewise. + * sysdeps/unix/sysv/linux/powerpc/Makefile: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/Makefile: Likewise. + * sysdeps/unix/sysv/linux/sparc/Makefile: Likewise. + * sysdeps/generic/Makefile (sysdep_routines, shared-only-routines): + Do it here instead, only if [$(unwind-find-fde) = yes]. + +2002-03-23 Andreas Jaeger + + * signal/signal.h: Fix typo. Patch by Steve Kemp + . + +2002-03-22 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Add getresgid and + getresuid. + + * sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h (struct + _fpstate): Rename fwd to ftw, use _fpxreg and _xmmreg. + * sysdeps/unix/sysv/linux/x86_64/sys/user.h (struct + user_fpregs_struct): Rename fwd. + + * sysdeps/unix/sysv/linux/x86_64/register-dump.h (register_dump): + Follow sigcontext changes. + +2002-03-22 Andreas Jaeger + + * sysdeps/mips/bits/nan.h: New file. Copy from generic one with + changes for NaNs on MIPS. + Patch by Hartvig Ekner . + +2002-03-21 Ulrich Drepper + + * nscd/grpcache.c (addgrbyname): Improve buffer allocate with alloca. + Use realloc if too large. + (addgrbyid): Likewise. + * nscd/hstcache.c (addhstbyname): Likewise. + (addhstbyaddr): Likewise. + (addhstbynamev6): Likewise. + (addhstbyaddrv6): Likewise. + * nscd/pwdcache.c (addpwbyname): Likewise. + (addpwbyuid): Likewise. + +2002-03-21 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h (struct + _fpstate): Add separate struct for x86-64. + + * sysdeps/unix/sysv/linux/x86_64/sys/user.h (struct + user_fpregs_struct): Change member names to follow kernel. + +2002-03-20 Ulrich Drepper + + * nis/ypclnt.c (yp_all): Remove the hack introduced on 1998-09-29. + Correctly close the UDP connection right away [PR libc/3120]. + +2002-03-20 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/sys/user.h (struct + user_fpregs_struct): Fix for changed kernel struct. + (struct user_regs_struct): Likewise. + (struct user): Likewise. + Add 32-bit x86 compatibility. + + * sysdeps/unix/sysv/linux/x86_64/sys/reg.h: Add more registers. + +2002-03-19 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/bits/types.h: Cleanup x86 types. + +2002-03-18 Andreas Jaeger + + * iconvdata/Makefile: Only run tests when shared libs are + available. + +2002-03-17 Andreas Jaeger + + * sysdeps/mips/fpu/fraiseexcpt.c (__feraiseexcept): Set cause bits. + + * sysdeps/mips/fpu/fgetexcptflg.c (__fegetexceptflag): Add comment. + + * sysdeps/mips/fpu/fclrexcpt.c (__feclearexcept): Clear also cause + bits. + + * sysdeps/mips/fpu/fenv_libc.h (CAUSE_MASK): New macro. + (CAUSE_SHIFT): New macro. + Patch by Hartvig Ekner . + + * sysdeps/generic/unwind-dw2-fde-glibc.c: Add prototypes. + * sysdeps/generic/unwind-pe.h: Likewise. + + * libio/iofdopen.c (_IO_new_fdopen): Pass parameter of correct + type to _IO_setb. + + * libio/stdio.c (AL2): Define variant when visibility attribute is + not supported. + + * include/libc-symbols.h (_INTVARDEF): Define variant when + visibility attribute is not supported. + +2002-03-16 Ulrich Drepper + + * po/fr.po: Update from translation team. + +2002-02-25 Bruno Haible + + * MakeTAGS (extract): Use --sort-by-file instead of --sort-output. + +2002-03-15 Ulrich Drepper + + * libio/iofdopen.c (_IO_new_fdopen): Call _IO_setb to deallocate + buffers if _IO_file_attach failed. + + * libio/fileops.c (_IO_file_open): Close file descriptor if + _IO_SEEKOFF call failed. + +2002-03-15 H.J. Lu + Ulrich Drepper + + * configure.in: Check for availability of + init_array/fini_array/preinit_array handling in binutils. + * config.h.in (HAVE_INITFINI_ARRAY): New macro. + * config.make.in (have-initfini-array): New variable. + +2002-03-15 Ulrich Drepper + + * stdio-common/tst-printf.c (main): Comment out one test which + checked the compiler's ability to fold floating-point constants + but not really printf. + (rfg3): Make s const. + * stdio-common/tst-printf.sh: Adjust for removed test. + + * sysdeps/i386/i386-mcount.S: Just call __mcount_internal, it is an + internal function. Adjust for internal_function calling convention. + * sysdeps/i386/machine-gmon.h: Declare and define __mcount_internal + as internal_function. + + * sysdeps/generic/framestate.c: Declare fallback_frame_state_for as + hidden. + + * nss/XXX-lookup.c (DB_LOOKUP_FCT): Add internal_function to + declaration and definition. + * nss/getXXbyYY_r.c (DB_LOOKUP_FCT): Add internal_function to + declaration. + * nss/getXXent_r.c: Likewise. + * nss/nsswitch.h (db_lookup_function): Add internal_function to + definition. + + * include/time.h: Declare __localtime_r as hidden. + + * include/aliases.h: Declare __getaliasent_r as hidden. + * include/grp.h: Declare __getgrent_r as hidden. + * include/netdb.h: Declare __gethostent_r, __getnetent_r, + __getservent_r, and __getprotoent_r as hidden. + * include/pwd.h: Declare __getpwent_r as hidden. + * include/shadow.h: Declare __getspent_r as hidden. + * include/rpc/netdb.h: Declare __getrpcent_r as hidden. + + * iconv/gconv_int.h: Declare __gconv_read_conf, __gconv_alias_compare, + and __gconv_transliterate as hidden. + Add internal_function to __gconv_get_path declaration. + * iconv/gconv_conf.c: Add internal_function to __gconv_get_path + definition. Add attribute_hidden to __gconv_read_conf definition. + +2002-03-14 Ulrich Drepper + + * elf/rtld.c: Declare _environ as hidden. + * sysdeps/generic/dl-environ.c: Likewise. + * sysdeps/generic/dl-sysdep.c: Likewise. + + * sysdeps/generic/ldsodefs.h: Declare _dl_debug_state_internal and + _dl_mcount_internal as hidden. + + * elf/Makefile (rtld-routines): Add dl-sbrk and dl-brk. + * sysdeps/generic/dl-brk.c: New file. + * sysdeps/generic/dl-sbrk.c: New file. + * sysdeps/unix/sysv/linux/i386/dl-brk.c: New file. + * sysdeps/unix/sysv/linux/i386/dl-sbrk.c: New file. + + * elf/dl-minimal.c (malloc): Declare _end as hidden. + (__errno_location): New function. Declare errno as hidden. + * elf/rtld.c (_dl_argc): Define as hidden. + (_dl_skip_args): Define as hidden. + (_begin, _end): Declare as hidden. + * sysdeps/generic/dl-sysdep.c (_end): Declare as hidden. + * sysdeps/generic/entry.h (_start): Declare as hidden. + * sysdeps/generic/ldsodefs.h (_dl_argc): Declare as hidden. + * sysdeps/i386/dl-machine.h (elf_machine_runtime_setup): Declare + _dl_runtime_resolve and _dl_runtime_profile as hidden. + (RTLD_START): Use GOTOFF to access _dl_skip_args and _dl_fini. + +2002-03-14 Roland McGrath + + * Makerules ($(common-objpfx)Versions.v.i): Depend on abi-versions.h. + + * Makeconfig (%.v.i, %.v): New implicit rules. + (preprocess-versions): Variable removed. + ($(common-objpfx)shlib-versions.v.i): New target giving just the + shlib-versions input files as dependencies. + ($(common-objpfx)soversions.i): Depend on that instead of the input + files. Use it as input instead of using a pipeline. + (postclean-generated): Append soversions.i, shlib-versions.v, and + shlib-versions.v.i here. + * Makerules ($(common-objpfx)Versions.def.v.i): New target giving just + the Versions.def input files as dependencies. + ($(common-objpfx)Versions.v.i): Likewise for Versions files. + ($(common-objpfx)Versions.all): Depend on that instead of the input + files. Use it as input instead of using a pipeline. + ($(common-objpfx)sysd-versions): Likewise with Versions.v.i. + (postclean-generated): Append those .v and .v.i files here. + +2002-03-14 Jakub Jelinek + + * locale/broken_cur_max.c (__ctype_get_mb_cur_max): Use nl_langinfo. + * locale/Versions (_nl_current_LC_COLLATE, _nl_current_LC_CTYPE): + Remove. + +2002-03-14 Jakub Jelinek + + * sysdeps/generic/mp_clz_tab.c: New file. + * sysdeps/i386/mp_clz_tab.c: New file. + * sysdeps/hppa/mp_clz_tab.c: New file. + * sysdeps/powerpc/mp_clz_tab.c: New file. + * stdlib/Makefile (aux): Revert last patch. + * math/Makefile (gmp-objs): Likewise. + +2002-03-13 Paul Eggert + + * time/strftime.c: Comment fixes for references to obsolescent + standards, In most cases the simplest fix is to remove the + confusing comments. Cross-referencing all the standards properly + is a bit of a pain, and it should be enough to put that info in + the documentation as I did in my recent time.texi patch. + +2002-03-13 Paul Eggert + + * manual/time.texi (Formatting Calendar Time): + ISO C99 also specifies the E and O modifiers. + %P is a GNU extension, and is not in ISO C99. + Mention that %r is equivalent to %I:%M:%S %p in the POSIX locale. + %T is also in ISO C99. + The RFC 822 example is not valid in arbitrary locales. + Reword the POSIX.2 wording slightly, to make it a bit clearer + that POSIX.2 formats are also supported by later POSIX versions. + If a format was introduced in ISO C99 it is also required by + POSIX.1-2001. + +2002-03-13 Ulrich Drepper + + * sysdeps/gnu/errlist.awk: Define _sys_errlist_internal and + _sys_nerr_internal with INTVARDEF2. + * include/libc-symbols.h (INTVARDEF2): New macro. + * include/stdio.h (_sys_errlist_internal): Declare as hidden. + (_sys_nerr_internal): Library. + + * sysdeps/posix/signal.c (_sigintr): Define as hidden. + * sysdeps/posix/sigintr.c (_sigintr): Declare as hidden. + + * stdio-common/tst-printf.sh: Adjust for last change in tst-printf.c. + +2002-03-13 Wolfram Gloger + + * malloc/malloc.c (sYSMALLOc): Don't change brk if mmap failed. + +2002-03-02 Andreas Schwab + + * stdio-common/vfprintf.c (process_arg): Fix decimal format with + 'h' flag and positional arg. + * stdio-common/tst-printf.c (rfg3): New function to test + positional arguments. + (main): Fix some warnings. + +2002-03-13 Jakub Jelinek + + * elf/dl-minimal.c (_itoa): Use _itoa_lower_digits_internal if SHARED. + * elf/dl-reloc.c (_dl_reloc_bad_type): Likewise. + +2002-03-13 Ulrich Drepper + + * grp/initgroups.c (__nss_group_data): Declare as hidden. + + * include/locale.h (_nl_C_locobj): Declare as hidden. + + * time/asctime.c (_nl_C_LC_TIME): Declare as hidden. + * time/strptime.c (_nl_C_LC_TIME): Likewise. + + * include/netinet/in.h (in6addr_any_internal): Mark as hidden. + + * include/sys/gmon.h: Declare _gmonparam as hidden. + + * locale/lc-ctype.c (__ctype32_wctype): Declare as hidden. + (__ctype32_wctrans): Likewise. + (__ctype32_width): Likewise. + + * sysdeps/unix/sysv/linux/ttyname.c: Comment out definition and + use of __ttyname. + + * posix/regcomp.c (__re_error_msgid): Renamed from re_error_msgid. + Define as hidden. + (__re_error_msgid_idx): Renamed from re_error_msgid_idx. Define as + hidden. Change all users of these variables. + + * posix/regex_internal.h (__re_error_msgid): Renamed from + re_error_msgid. Declare as hidden. + (__re_error_msgid_idx): Renamed from re_error_msgid_idx. Declare as + hidden. + + * stdio-common/reg-printf.c (__printf_arginfo_table): Define as hidden. + (__printf_function_table): Likewise. + * stdio-common/printf-parse.h (__printf_arginfo_table): Declare as + hidden. + (__printf_function_table): Likewise. + + * nscd/nscd_proto.h: Declare __nss_not_use_nscd_passwd, + __nss_not_use_nscd_group, and __nss_not_use_nscd_hosts as hidden. + + * nss/XXX-lookup.c (DATABASE_NAME_SYMBOL): Define as hidden. + * nss/nsswitch.c: Declare _nss_*_database as hidden. + + * stdlib/wctomb.c (__no_r_state): Declare as hidden. + * stdlib/mbtowc.c (__no_r_state): Define as hidden. + +2002-03-12 Ulrich Drepper + + * ctype/ctype-info.c: Declare _nl_C_LC_CTYPE_class, + _nl_C_LC_CTYPE_class32, _nl_C_LC_CTYPE_toupper, _nl_C_LC_CTYPE_tolower, + _nl_C_LC_CTYPE_class_upper, _nl_C_LC_CTYPE_class_lower, + _nl_C_LC_CTYPE_class_alpha, _nl_C_LC_CTYPE_class_digit, + _nl_C_LC_CTYPE_class_xdigit, _nl_C_LC_CTYPE_class_space, + _nl_C_LC_CTYPE_class_print, _nl_C_LC_CTYPE_class_graph, + _nl_C_LC_CTYPE_class_blank, _nl_C_LC_CTYPE_class_cntrl, + _nl_C_LC_CTYPE_class_punct, _nl_C_LC_CTYPE_class_alnum, + _nl_C_LC_CTYPE_map_toupper, _nl_C_LC_CTYPE_map_tolower, and + _nl_C_LC_CTYPE_width: Declare as hidden. + * include/locale.h: Declare _nl_locale_file_list. + * locale/C-address.c: Define _nl_C_LC_ADDRESS as hidden. + * locale/C-collate.c: Define _nl_C_LC_COLLATE as hidden. + * locale/C-identification.c: Define _nl_C_LC_IDENTIFICATION as hidden. + * locale/C-measurement.c: Define _nl_C_LC_MEASUREMENT as hidden. + * locale/C-messages.c: Define _nl_C_LC_MESSAGES as hidden. + * locale/C-monetary.c: Define _nl_C_LC_MONETARY as hidden. + * locale/C-name.c: Define _nl_C_LC_NAME as hidden. + * locale/C-numeric.c: Define _nl_C_LC_NUMERIC as hidden. + * locale/C-paper.c: Define _nl_C_LC_PAPER as hidden. + * locale/C-telephone.c: Define _nl_C_LC_TELEPHONE as hidden. + * locale/C-time.c: Define _nl_C_LC_TIME as hidden. + * locale/C-ctype.c: Define _nl_C_LC_CTYPE_class, + _nl_C_LC_CTYPE_class32, _nl_C_LC_CTYPE_toupper, _nl_C_LC_CTYPE_tolower, + _nl_C_LC_CTYPE_class_upper, _nl_C_LC_CTYPE_class_lower, + _nl_C_LC_CTYPE_class_alpha, _nl_C_LC_CTYPE_class_digit, + _nl_C_LC_CTYPE_class_xdigit, _nl_C_LC_CTYPE_class_space, + _nl_C_LC_CTYPE_class_print, _nl_C_LC_CTYPE_class_graph, + _nl_C_LC_CTYPE_class_blank, _nl_C_LC_CTYPE_class_cntrl, + _nl_C_LC_CTYPE_class_punct, _nl_C_LC_CTYPE_class_alnum, + _nl_C_LC_CTYPE_map_toupper, _nl_C_LC_CTYPE_map_tolower, + _nl_C_LC_CTYPE_width, and as hidden. + * locale/findlocale.c: Declare _nl_C as hidden. + * locale/newlocale.c: Likewise. + * locale/setlocale.c: Define _nl_C as hidden. Remove declaration of + _nl_locale_file_list. + * locale/xlocale.c: Declare _nl_C_LC_CTYPE_class, + _nl_C_LC_CTYPE_toupper, and _nl_C_LC_CTYPE_tolower as hidden. + Define _nl_C_locobj as hidden. + + * malloc/mtrace.c (_mtrace_file): Define as hidden. + (_mtrace_line): Likewise. + + * include/time.h: Declare __mon_yday as hidden. + * time/strptime.c [_LIBC] (__mon_yday): Remove declaration. + + * libio/libioP.h: Declare __libio_codecvt as hidden. + * libio/fileops.c: Declare __libio_translit as hidden. + * libio/iofwide.c: Define __libio_translit as hidden. + + * login/getutent_r.c: Define __libc_utmp_lock as hidden. + * login/getutid_r.c: Declare __libc_utmp_lock as hidden. + * login/getutline_r.c: Likewise. + * login/utmpname.c: Likewise. + + * login/utmp-private.h: Declare __libc_utmp_file_functions, + __libc_utmp_unknown_functions, __libc_utmp_jump_table, and + __libc_utmp_file_name as hidden. + + * locale/setlocale.c (__libc_setlocale_lock): Define as hidden. + * locale/duplocale.c (__libc_setlocale_lock): Declare as hidden. + * locale/freelocale.c: Likewise. + * locale/lc-time.c: Likewise. + + * sysdeps/unix/bsd/getpt.c (__libc_ptyname1): Define as hidden. + (__libc_ptyname2): Likewise. + * sysdeps/unix/sysv/linux/ptsname.c (__libc_ptyname1): Declare as + hidden. + (__libc_ptyname2): Likewise. + + * sysdeps/generic/sbrk.c: Declare __libc_multiple_libcs as hidden. + * sysdeps/arm/init-first.c (__libc_multiple_libcs): Define as hidden. + * sysdeps/generic/init-first.c: Likewise. + * sysdeps/i386/init-first.c: Likewise. + * sysdeps/mach/hurd/i386/init-first.c: Likewise. + * sysdeps/mach/hurd/mips/init-first.c: Likewise. + * sysdeps/mach/hurd/powerpc/init-first.c: Likewise. + * sysdeps/sh/init-first.c: Likewise. + * sysdeps/unix/sysv/aix/init-first.c: Likewise. + * sysdeps/unix/sysv/linux/init-first.c: Likewise. + + * stdio-common/itowa-digits.c (_itowa_lower_digits): Define as hidden. + (_itowa_upper_digits): Likewise. + + * libio/stdio.c (_IO_stdin, _IO_stdout, _IO_stderr): Define as hidden. + * libio/libio.h [_LIBC] (_IO_stdin, _IO_stdout, _IO_stderr): Declare + as hidden. + + * libio/libioP.h: Declare _IO_file_jumps_mmap, _IO_wfile_jumps, + _IO_wfile_jumps_mmap, _IO_proc_jumps, _IO_old_proc_jumps, + _IO_str_jumps, _IO_wstr_jumps, _IO_file_jumps_internal, + _IO_wfile_jumps_internal, and _IO_list_all_internal as hidden. + + * gmon/gmon.c (__bb_head): Define as hidden. + * gmon/bb_exit_func.c (__bb_head): Declare as hidden. + + * argp/argp-parse.c (_argp_hang): Define as static. + + * include/libc-symbols.h (_INTVARDEF): Adjust for visibility + handling in latest compilers. + + * inet/in6_addr.c (in6addr_any): Use INTVARDEF not INTDEF to + define alias. + * libio/fileops.c (_IO_file_jumps): Likewise. + * libio/stdfiles.c (_IO_list_all): Likewise. + * libio/wfileops.c (_IO_wfile_jumps): Likewise. + + * malloc/malloc.h: Move __libc_malloc_initialized declaration to + include/malloc.h. + * include/malloc.h: Add __libc_malloc_initialized declaration + here. Mark variable hidden. + * malloc/malloc.c: Include not "malloc.h". + + * elf/dl-open.c (__libc_argc): Declare as hidden. + (__libc_argv): Likewise. + * sysdeps/generic/wordexp.c (__libc_argc): Declare as hidden. + (__libc_argv): Likewise. + * sysdeps/mach/hurd/i386/init-first.c: Define __libc_argc and + __libc_argv as hidden. + * sysdeps/mach/hurd/mips/init-first.c: Likewise. + * sysdeps/mach/hurd/powerpc/init-first.c: Likewise. + * sysdeps/unix/sysv/aix/init-first.c: Likewise. + * sysdeps/unix/sysv/linux/init-first.c: Likewise. + + * include/stdlib.h (__libc_drand48_data): Declare as hidden. + * stdlib/drand48.c: Remove declaration of __libc_drand48_data here. + * stdlib/erand48.c: Likewise. + * stdlib/jrand48.c: Likewise. + * stdlib/lcong48.c: Likewise. + * stdlib/lrand48.c: Likewise. + * stdlib/mrand48.c: Likewise. + * stdlib/nrand48.c: Likewise. + * stdlib/seed48.c: Likewise. + * stdlib/srand48.c: Likewise. + + * stdio-common/_itoa.c (_itoa_base_table): Declare as hidden. + (_itoa_lower_digits_internal): New declaration. + (_itoa_upper_digits_internal): New declaration. + (_itoa): Use INTUSE to acces _itoa_upper_digits and _itoa_lower_digits. + * stdio-common.h (_itoa_lower_digits_internal): New declaration. + (_itoa_upper_digits_internal): New declaration. + (_itoa_word): Use INTUSE to acces _itoa_upper_digits and + _itoa_lower_digits. + * stdio-common/itoa-digits.c: Use INTVARDEF with _itoa_lower_digits. + * stdio-common/itoa-udigits.c: Use INTVARDEF with _itoa_upper_digits. + + * elf/dl-minimal.c (_itoa): Declare _itoa_lower_digits as hidden. + * elf/dl-reloc.c (_dl_reloc_bad_type): Likewise. + + * stdio-common/_itowa.c (_itoa_base_table): Declare as hidden. + (_itowa_lower_digits): Likewise. + (_itowa_upper_digits): Likewise. + * stdio-common/_itowa.h (_itowa_lower_digits): Likewise. + (_itowa_upper_digits): Likewise. + + * intl/plural-exp.h (attribute_hidden): Define as empty macro if + not already defined. + (GERMANIC_PLURAL): Declare as hidden. + + * posix/getopt.c (__getopt_initialized): Declare as hidden. + (attribute_hidden): Define as empty macro if not already defined. + + * iconv/gconv_int.h (__gconv_path_elem): Declare hidden. + (__gconv_max_path_elem_len): Likewise. + (__gconv_path_envvar): Likewise. + + * math/Makefile (gmp-objs): Remove mp_clz_tab. + * stdlib/Makefile (aux): Remove mp_clz_tab. + * stdlib/mp_clz_tab.c: Removed. Not needed anywhere. + + * stdlib/exit.h (__exit_funcs): Declare as hidden. + + * posix/bug-regex5.c (main): Use nl_langinfo instead of _NL_CURRENT. + + * locale/localeinfo.h: Add attribute_hidden to _nl_current_LC_XXX, + _nl_category_names, _nl_category_name_sizes, _nl_current, + _nl_C_name, _nl_POSIX_name, _nl_C_codeset, and _nl_C_LC_XXX. + + * intl/dcigettext.c (_nl_default_default_domain): Define as hidden. + (_nl_current_default_domain): Likewise + (_nl_state_lock): Likewise. + * intl/textdomain.c (_nl_default_default_domain): Declare as hidden. + (_nl_current_default_domain): Likewise + (_nl_state_lock): Likewise. + * intl/bindtextdom.c (_nl_state_lock): Likewise. + + * stdlib/fpioconst.h (__tens): Add attribute_hidden. + (_fpioconst_pow10): Likewise. + + * include/time.h (_tmbuf): Add attribute_hidden. + + * time/tzset.c (tzstring_list): Define as static. + + * include/time.h: Add attribute_hidden to __tzname_cur_max and + __use_tzfile declaration. + + * wcsmbs/wcsmbsload.h: Add attribute_hidden to __wcsmbs_gconv_fcts + and __wcsmbs_last_locale declaration. + +2002-02-25 Paul Eggert + + * timezone/Makefile (tzbases): Move systemv from here... + (tzlinks): to here, since the entries in systemv were all changed + from Zone to Link lines in tz-2001a. Bug reported (and patch + tested) by Peter Breitenlohner. + +2002-03-07 Jakub Jelinek + + * time/tst-posixtz.c (tests): Add new tests. + (main): Test whether tzset() sets daylight properly. + +2002-03-06 Jakub Jelinek + + * time/tzset.c (tz_compute): Move __daylight, __tzname and + __tzname_cur_max setting... + (tzset_internal): ...here. + +2002-03-06 Jakub Jelinek + + * time/tzset.c (compute_change): Don't return any value. + (tz_compute): Likewise. Don't handle southern hemisphere here. + (__tz_convert): But here. + +2002-03-11 Ulrich Drepper + + * manual/examples/mkfsock.c: Include as well. + Patch by Alain De Carolis . + +2002-03-06 Isamu Hasegawa + + * posix/regexec.c (re_match): Fix incorrect register sizes. + (re_search): Likewise. + +2002-03-05 Isamu Hasegawa + + * posix/regcomp.c (regfree): Remove a disused condition. + * posix/regex_internal.c (re_acquire_state): Likewise. + (re_acquire_state_context): Likewise. + (register_state): Remove a redundant malloc invocation. + * posix/regex_internal.h: (re_state_table_entry): Simplify + the structure. + +2002-03-05 Isamu Hasegawa + + * posix/regcomp.c (regcomp): Add __builtin_expect to error + handling conditions. + (regerror): Likewise. + (regfree): Likewise. + (re_compile_internal): Likewise. + (init_dfa): Likewise. + (init_word_char): Likewise. + (create_initial_state): Likewise. + (analyze): Likewise. + (analyze_tree): Likewise. + (duplicate_node): Likewise. + (calc_eclosure): Likewise. + (calc_eclosure_iter): Likewise. + (parse): Likewise. + (parse_reg_exp): Likewise. + (parse_branch): Likewise. + (parse_expression): Likewise. + (parse_subexp): Likewise. + (parse_dup_op): Likewise. + (parse_bracket_exp): Likewise. + (build_equiv_class): Likewise. + (build_charclass): Likewise. + (build_word_op): Likewise. + (fetch_number): Likewise. + (create_tree): Likewise. + (duplicate_tree): Likewise. + * posix/regex.c (BE): New macro. + * posix/regexec.c (re_match): Add __builtin_expect to error + handling conditions. + (re_match_2): Likewise. + (re_search): Likewise. + (re_search_internal): Likewise. + (check_matching): Likewise. + (proceed_next_node): Likewise. + (set_regs): Likewise. + (sift_states_backward): Likewise. + (add_epsilon_backreference): Likewise. + (transit_state): Likewise. + (transit_state_sb): Likewise. + (transit_state_mb): Likewise. + (transit_state_bkref): Likewise. + (transit_state_bkref_loop): Likewise. + (build_trtable): Likewise. + (group_nodes_into_DFAstates): Likewise. + (match_ctx_init): Likewise. + (match_ctx_add_entry): Likewise. + * posix/regex_internal.c (re_string_construct): Add __builtin_expect + to error handling conditions. + (re_string_construct_toupper): Likewise. + (build_wcs_buffer): Likewise. + (build_wcs_upper_buffer): Likewise. + (build_upper_buffer): Likewise. + (re_string_translate_buffer): Likewise. + (re_node_set_alloc): Likewise. + (re_node_set_init_1): Likewise. + (re_node_set_init_2): Likewise. + (re_node_set_init_copy): Likewise. + (re_node_set_intersect): Likewise. + (re_node_set_init_union): Likewise. + (re_node_set_merge): Likewise. + (re_node_set_insert): Likewise. + (re_dfa_add_node): Likewise. + (re_acquire_state): Likewise. + (re_acquire_state_context): Likewise. + (create_new_state_common): Likewise. + (register_state): Likewise. + (create_ci_new_state): Likewise. + (create_cd_new_state): Likewise. + (re_string_context_at): Remove redundant condition. + +2002-01-16 Roger Sayle + + * sysdeps/i386/i686/strcmp.S: Avoid unconditional jump to a ret. + + * sysdeps/i386/i586/strlen.S: Fix typo in comment. + +2002-03-11 Jakub Jelinek + + * sysdeps/i386/elf/configure.in: Fix comment. + + * sysdeps/sparc/sparc64/configure.in: New file. + * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_load_address): Fix + if .dynamic comes before .got. + * config.h.in (SPARC64_DYNAMIC_BEFORE_GOT): Add. + + * sysdeps/sparc/sparc64/hp-timing.h (HP_TIMING_DIFF, + HP_TIMING_ACCUM): Fix typos. + +2002-03-11 Ulrich Drepper + + * string/strfry.c: Add some more randomness to the seed. + Patch by James A Morrison . + + * po/es.po: Update from translation team. + * po/fr.po: Likewise. + + * stdio-common/tfformat.c (sprint_doubles): A test for %F format. + + * stdio-common/printf_fp.c (__printf_fp): Correct check for %F format + when determining type of format. + Patch by James Antill [PR libc/2787]. + +2002-03-04 Jakub Jelinek + + * sysdeps/unix/bsd/ftime.c (ftime): Don't return 1000 in millitm. + +2002-03-11 Roland McGrath + + * hurd/hurd/threadvar.h: Include for __THROW macro. + + * Versions.def (libc): Add GLIBC_2.2.6. + * hurd/Versions (libc: GLIBC_2.2.6): Add __errno_location. + * sysdeps/mach/hurd/errnos.awk: In generated macro, use + __errno_location instead of __hurd_errno_location, and don't inline it. + * sysdeps/mach/hurd/bits/errno.h: Regenerated. + * hurd/errno.c: New file. + * hurd/Makefile (routines): Add errno. + +2002-03-11 Ulrich Drepper + + * stdio-common/vfprintf.c (vfprintf): Avoid crashing for + ridiculously large widths and precisions [PR libc/3026]. + +2002-03-11 Andreas Jaeger + + * sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed: Fix for bi-arch + support. + Patch by Susanne Oberhauser . + +2002-03-11 Ulrich Drepper + + * inet/rexec.c (ahostbuf): Define as static. + + * wctype/wcfuncs.c (__ctype32_wctype): Declare as hidden. + (__ctype32_wctrans): Likewise. + * wcsmbs/wcwidth.h (__ctype32_width): Declare as hidden. + * ctype/ctype-info.c (__ctype32_wctype): Add attribute_hidden. + (__ctype32_wctrans): Likewise. + (__ctype32_width): Likewise. + + * gmon/Makefile (elide-routines.os): Add bb_init_func and bb_exit_func. + They were never exported anyway. + + * gmon/gmon.c (_gmonparam): Add attribute_hidden. + * gmon/sys/gmon.h: Remove declaration of _gmonparam. It wasn't + exported. + * include/sys/gmon.h: Declare _gmonparam. + + * sysdeps/unix/sysv/linux/i386/getdents64.c: Don't define compatibility + symbols for getdents64. They were never exported. + +2002-03-09 Roland McGrath + + * hurd/hurdsig.c (write_corefile): Fix swapped arguments to __dir_link. + Reported by Jon Arney . + +2002-02-23 Roland McGrath + + * hurd/hurd/threadvar.h (__hurd_threadvar_location): Add __THROW to + declaration. + (__hurd_errno_location): Function removed. + +2002-03-06 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/sys/reg.h: Add compatibility for + 32-bit. + +2002-03-04 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/readelflib.c: New file. + + * sysdeps/unix/sysv/linux/kernel-features.h: Add defines for + x86-64. + + * sysdeps/unix/sysv/linux/x86_64/bits/socket.h: New file. + + * sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h: New file. + + * sysdeps/unix/sysv/linux/x86_64/bits/shm.h: New file. + + * sysdeps/x86_64/bits/setjmp.h: New file. + + * sysdeps/unix/sysv/linux/x86_64/bits/sem.h: New file. + + * sysdeps/unix/sysv/linux/x86_64/bits/resource.h: New file. + + * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Add compatibilty + for x86. + * sysdeps/unix/sysv/linux/x86_64/bits/msq.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/bits/types.h: Likewise. + +2002-02-28 Bo Thorsen + + * sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Merge with i386 + version. + +2002-03-03 Andreas Jaeger + + * sysdeps/x86_64/bits/wordsize.h: New file. + + * elf/nodlopenmod2.c: Provide prototype to avoid warning. + * elf/tst-tlsmod1.c: Likewise. + + * posix/regcomp.c: Get regex.h from include dir for internal + prototypes. + + * sysdeps/unix/sysv/linux/init-first.c: Move __init_misc prototype + to libc-internal.h and include it. + * include/libc-internal.h: Add __init_misc. + + * misc/init-misc.c: Include libc-internal.h for prototypes. + + * sysdeps/wordsize-32/divdi3.c: Add prototypes to avoid warnings. + + * misc/error.c [_LIBC]: Include libioP.h for prototype of + _IO_putc_internal. + +2002-03-03 Ulrich Drepper + + * posix/regcomp.c: Compatibility changes to allow using the code + outside glibc. + +2002-02-28 Hartvig Ekner + + * sysdeps/mips/elf/start.S: Added initialization of GP (to _gp) if + compiled non-PIC. + +2002-03-02 Ulrich Drepper + + * sysdeps/generic/dl-sysdep.c (_dl_important_hwcaps): Fix creation + of .str elements in the returned data structure. + + * elf/elf.h: Add Alpha TLS bits. + +2002-02-28 Jakub Jelinek + + * sysdeps/unix/sysv/linux/nice.c: New file. + +2002-03-01 Ulrich Drepper + + * elf/Makefile (dl-routines): Add dl-origin. + (elide-routines.os): Add dl-origin. + * elf/Versions [ld] (GLIBC_PRIVATE): Add _dl_get_origin. + * elf/dl-debug.c (_dl_debug_initialize): Add missing INTUSE around + _dl_debug_state. + * include/libc-symbols.c: Define attribute_hidden depending on + HAVE_VISIBILITY_ATTRIBUTE. Add definition of INTVARDEF. + + * elf/dl-deps.c: Use INTUSE with __libc_enable_secure. + * elf/dl-load.c: Likewise. + * elf/rtld.c: Likewise. + * include/unistd.h: Declare __libc_enable_secure_internal. + * sysdeps/generic/dl-sysdep.c: Use INTVARDEF with __libc_enable_secure. + Use INTUSE with __libc_enable_secure. + * sysdeps/mach/hurd/dl-sysdep.c: Likewise. + + * elf/dl-deps.c: Use INTUSE with _dl_out_of_memory. + * elf/dl-error.c: Likewise, + * sysdeps/generic/ldsodefs.h: Declare _dl_out_of_memory_internal. + + * elf/dl-dst.h [_RTLD_GLOBAL]: Define _dl_get_origin to use INTUSE. + * sysdeps/generic/dl-origin.c: Undefine _dl_get_origin macro before + function definition. Use INTDEF with _dl_get_origin. + * sysdeps/unix/sysv/linux/dl-origin.c: Likewise. + + * elf/dl-init.c: Use INTUSE with _dl_starting_up. + * elf/rtld.c: Likewise. Use INTVARDEF for _dl_starting_up. + + * elf/dl-profile.c: Use INTDEF for _dl_mcount. + * elf/dl-runtime.c: Use INTUSE with _dl_mcount. + * sysdeps/generic/ldsodefs.h: Declare _dl_mcount_internal. + + * elf/dl-conflict.c: Use rtld_progrname instead of _dl_argv[0]. + * elf/dl-deps.c: Likewise. + * elf/dl-error.c: Likewise. + * elf/dl-fini.c: Likewise. + * elf/dl-init.c: Likewise. + * elf/dl-load.c: Likewise. + * elf/dl-lookup.c: Likewise. + * elf/dl-reloc.c: Likewise. + * elf/dl-version.c: Likewise. + * elf/do-lookup.h: Likewise. + * sysdeps/arm/dl-machine.h: Likewise. + * sysdeps/cris/dl-machine.h: Likewise. + * sysdeps/hppa/dl-machine.h: Likewise. + * sysdeps/i386/dl-machine.h: Likewise. + * sysdeps/m68k/dl-machine.h: Likewise. + * sysdeps/powerpc/dl-machine.h: Likewise. + * sysdeps/s390/s390-32/dl-machine.h: Likewise. + * sysdeps/s390/s390-64/dl-machine.h: Likewise. + * sysdeps/sh/dl-machine.h: Likewise. + * sysdeps/sparc/sparc-32/dl-machine.h: Likewise. + * sysdeps/sparc/sparc-64/dl-machine.h: Likewise. + * sysdeps/x86_64/dl-machine.h: Likewise. + * elf/rtld.c: Use INTDEF for _dl_argv. Use rtld_progrname instead of + _dl_argv[0]. Use INTUSE with _dl_argv. + * sysdeps/generic/dl-sysdep.c: Use INTUSE with _dl_argv. + * sysdeps/generic/ldsodefs.h: Define rtld_progname macro. + +2002-02-28 Jakub Jelinek + + * elf/rtld.c (_rtld_global): Remove .protected. + (_rtld_local): Strong alias to _rtld_global. + * elf/Makefile (CFLAGS-.os): Add -D_RTLD_LOCAL if compiling rtld + only .os object. + * sysdeps/generic/ldsodefs.h (GL): If SHARED and _RTLD_LOCAL, use + _rtld_local instead of _rtld_global. + (_rtld_local): Add hidden extern, possibly in .sdata section. + * configure.in: Add tests for visibility attribute and .sdata. + * config.h.in: Add HAVE_VISIBILITY_ATTRIBUTE and HAVE_SDATA_SECTION. + * sysdeps/alpha/dl-machine.h: Use _rtld_local instead of _rtld_global. + * sysdeps/arm/dl-machine.h: Likewise. + * sysdeps/generic/ldsodefs.h: Likewise. + * sysdeps/hppa/dl-machine.h: Likewise. + * sysdeps/cris/dl-machine.h: Likewise. + * sysdeps/i386/dl-machine.h: Likewise. + * sysdeps/ia64/dl-machine.h: Likewise. + * sysdeps/m68k/dl-machine.h: Likewise. + * sysdeps/mips/mips64/dl-machine.h: Likewise. + * sysdeps/mips/dl-machine.h: Likewise. + * sysdeps/sparc/sparc32/dl-machine.h: Likewise. + * sysdeps/sparc/sparc64/dl-machine.h: Likewise. + * sysdeps/sh/dl-machine.h: Likewise. + * sysdeps/s390/s390-32/dl-machine.h: Likewise. + * sysdeps/s390/s390-64/dl-machine.h: Likewise. + * sysdeps/x86_64/dl-machine.h: Likewise. + +2002-02-28 Ulrich Drepper + + * login/login.c (login): Always initialize ut_line field + [PR libc/2991]. + +2002-02-28 Jakub Jelinek + + * sysdeps/i386/Makefile (sysdep_routines): Add + divdi3 in csu dir. + (shared-only-routines): Likewise. + * sysdeps/m68k/Makefile (sysdep_routines): Likewise. + (shared-only-routines): Likewise. + * sysdeps/s390/s390-32/Makefile (sysdep_routines): Likewise. + (shared-only-routines): Likewise. + * sysdeps/wordsize-32/divdi3.c: New file. + +2002-02-28 Ulrich Drepper + + * locale/iso-4217.def: Remove obsolete currencies for countries + with Euro. + +2002-02-28 Isamu Hasegawa + + * posix/regcomp.c (regcomp): Remove a redundant condition. + (init_word_char): Add a check on malloc failure. + (create_initial_state): Likewise. + (duplicate_node): Likewise. + (calc_eclosure): Likewise. + (calc_eclosure_iter): Likewise. + (parse_expression): Likewise. + (parse_bracket_exp): Remove unnecessary malloc invocations. + (build_equiv_class): Likewise. + (build_charclass): Likewise. + * posix/regex_internal.c (re_node_set_intersect): Add a check + on malloc failure. + (re_node_set_add_intersect): Likewise. + (re_node_set_merge): Likewise. + (re_acquire_state): Likewise. + (re_acquire_state_context): Likewise. + (create_newstate_common): Likewise. + (register_state): Likewise. + (create_ci_newstate): Likewise. + (create_cd_newstate): Likewise. + * posix/regex_internal.h: Fix prototypes of re_acquire_state + and re_acquire_state_context. + * posix/regexec.c (regexec): Suit it to the error handling of + re_search_internal. + (re_match): Likewise. + (re_search): Likewise. + (re_search_internal): Add a check on malloc failure. + (acquire_init_state_context): Likewise. + (check_matching): Likewise. + (proceed_next_node): Likewise. + (set_regs): Likewise. + (sift_states_backward): Likewise. + (sift_states_iter_bkref): Likewise. + (add_epsilon_backreference): Likewise. + (transit_state): Likewise. + (transit_state_sb): Likewise. + (transit_state_mb): Likewise. + (transit_state_bkref_loop): Likewise. + (build_trtable): Likewise. + (group_nodes_into_DFAstates): Likewise. + (match_ctx_init): Likewise. + (match_ctx_add_entry): Likewise. + +2002-02-27 Ulrich Drepper + + * elf/dl-load.c (_dl_map_object_from_fd): Always add SONAME to + l_libname if profiling is enabled [PR libc/2916]. + + * sysdeps/ia64/dl-tls.h: New file. + +2002-02-27 Jakub Jelinek + + * sysdeps/alpha/dl-machine.h (elf_machine_load_address, RTLD_START): + Work around an Alpha gas bug. + +2002-02-27 Ulrich Drepper + + * catgets/open_catalog.c (__open_catalog): Fix typo in code which + uses read to load the catalog. + Patch by Andy Isaacson [PR libc/3011]. + +2002-02-26 Ulrich Drepper + + * posix/Makefile (distribute): Add regcomp.c, regexec.c, + regex_internal.c, and regex_internal.h. + (CFLAGS-regex.c): Replace -DMBS_SUPPORT with -DRE_ENABLE_I18N. + * posix/regex.c: Complete rewrite. + * posix/regexec.c: New file. + * posix/regcomp.c: New file. + * posix/regex_internal.c: New file. + * posix/regex_internal.h: New file. + * posix/regex.h (RE_ICASE): New macro. + Contributed by Isamu Hasegawa . + + * stdio-common/vfscanf.c (_IO_vfwscanf): Always use ungetc, never + ungetwc. It's a macro. + * libio/tst-swscanf.c (do_test): Adjust for now fixed wscanf + implementation. + Reported by Jason Merrill . + +2002-02-25 Jakub Jelinek + + * libio/iofopen.c (__fopen_maybe_mmap): Set the initial + position to fp->_offset if it is set. + * stdio-common/Makefile (tests): Add tst-fdopen. + * stdio-common/tst-fdopen.c: New test. + +2002-02-25 Jakub Jelinek + + * libio/fileops.c (_IO_file_xsgetn_mmap): Handle reading from backup. + * stdio-common/tst-ungetc.c (main): Add another test. + +2002-02-25 Ulrich Drepper + + * assert/assert-perr.c: Use INTUSE to reference functions and variables + inside libc itself. Use INTDEF and INTDEF2 to define appropriate + aliases. Add prototypes for the new aliases. + * assert/assert.c: Likewise. + * include/libc-symbols.h: Likewise. + * include/stdio.h: Likewise. + * include/netinet/in.h: Likewise. + * include/rpc/auth.h: Likewise. + * include/rpc/auth_unix.h: Likewise. + * include/rpc/key_prot.h: Likewise. + * include/rpc/pmap_prot.h: Likewise. + * include/rpc/pmap_rmt.h: Likewise. + * include/rpc/rpc_msg.h: Likewise. + * include/rpc/xdr.h: Likewise. + * inet/gethstbyad_r.c: Likewise. + * inet/gethstbynm2_r.c: Likewise. + * inet/gethstbynm_r.c: Likewise. + * inet/gethstent_r.c: Likewise. + * inet/in6_addr.c: Likewise. + * libio/__fpurge.c: Likewise. + * libio/filedoalloc.c: Likewise. + * libio/fileops.c: Likewise. + * libio/ftello.c: Likewise. + * libio/ftello64.c: Likewise. + * libio/genops.c: Likewise. + * libio/iofclose.c: Likewise. + * libio/iofdopen.c: Likewise. + * libio/iofflush.c: Likewise. + * libio/iofflush_u.c: Likewise. + * libio/iofgetpos.c: Likewise. + * libio/iofgetpos64.c: Likewise. + * libio/iofgets.c: Likewise. + * libio/iofgets_u.c: Likewise. + * libio/iofopen.c: Likewise. + * libio/iofopncook.c: Likewise. + * libio/iofputs.c: Likewise. + * libio/iofread.c: Likewise. + * libio/iofread_u.c: Likewise. + * libio/iofsetpos.c: Likewise. + * libio/iofsetpos64.c: Likewise. + * libio/ioftell.c: Likewise. + * libio/iofwrite.c: Likewise. + * libio/iogetline.c: Likewise. + * libio/iogets.c: Likewise. + * libio/iogetwline.c: Likewise. + * libio/iolibio.h: Likewise. + * libio/iopadn.c: Likewise. + * libio/iopopen.c: Likewise. + * libio/ioseekoff.c: Likewise. + * libio/ioseekpos.c: Likewise. + * libio/iosetbuffer.c: Likewise. + * libio/iosetvbuf.c: Likewise. + * libio/ioungetc.c: Likewise. + * libio/ioungetwc.c: Likewise. + * libio/iovdprintf.c: Likewise. + * libio/iovsprintf.c: Likewise. + * libio/iovsscanf.c: Likewise. + * libio/libioP.h: Likewise. + * libio/memstream.c: Likewise. + * libio/obprintf.c: Likewise. + * libio/oldfileops.c: Likewise. + * libio/oldiofclose.c: Likewise. + * libio/oldiofdopen.c: Likewise. + * libio/oldiofgetpos.c: Likewise. + * libio/oldiofgetpos64.c: Likewise. + * libio/oldiofopen.c: Likewise. + * libio/oldiofsetpos.c: Likewise. + * libio/oldiofsetpos64.c: Likewise. + * libio/oldiopopen.c: Likewise. + * libio/oldstdfiles.c: Likewise. + * libio/putc.c: Likewise. + * libio/setbuf.c: Likewise. + * libio/setlinebuf.c: Likewise. + * libio/stdfiles.c: Likewise. + * libio/stdio.c: Likewise. + * libio/strops.c: Likewise. + * libio/vasprintf.c: Likewise. + * libio/vscanf.c: Likewise. + * libio/vsnprintf.c: Likewise. + * libio/vswprintf.c: Likewise. + * libio/wfiledoalloc.c: Likewise. + * libio/wfileops.c: Likewise. + * libio/wgenops.c: Likewise. + * libio/wstrops.c: Likewise. + * malloc/mtrace.c: Likewise. + * misc/error.c: Likewise. + * misc/syslog.c: Likewise. + * nss/getXXbyYY_r.c: Likewise. + * nss/getXXent_r.c: Likewise. + * nss/hosts-lookup.c: Likewise. + * stdio-common/getw.c + * stdio-common/printf-prs.c: Likewise. + * stdio-common/printf_fp.c: Likewise. + * stdio-common/printf_size.c: Likewise. + * stdio-common/putw.c: Likewise. + * stdio-common/scanf.c: Likewise. + * stdio-common/sprintf.c: Likewise. + * stdio-common/tmpfile64.c: Likewise. + * stdio-common/vfprintf.c: Likewise. + * stdio-common/vfscanf.c: Likewise. + * stdlib/strfmon.c: Likewise. + * sunrpc/auth_des.c: Likewise. + * sunrpc/auth_none.c: Likewise. + * sunrpc/auth_unix.c: Likewise. + * sunrpc/authdes_prot.c: Likewise. + * sunrpc/authuxprot.c: Likewise. + * sunrpc/clnt_perr.c: Likewise. + * sunrpc/clnt_raw.c: Likewise. + * sunrpc/clnt_tcp.c: Likewise. + * sunrpc/clnt_udp.c: Likewise. + * sunrpc/clnt_unix.c: Likewise. + * sunrpc/key_call.c: Likewise. + * sunrpc/key_prot.c: Likewise. + * sunrpc/openchild.c: Likewise. + * sunrpc/pm_getmaps.c: Likewise. + * sunrpc/pm_getport.c: Likewise. + * sunrpc/pmap_clnt.c: Likewise. + * sunrpc/pmap_prot.c: Likewise. + * sunrpc/pmap_prot2.c: Likewise. + * sunrpc/pmap_rmt.c: Likewise. + * sunrpc/rpc_cmsg.c: Likewise. + * sunrpc/rpc_prot.c: Likewise. + * sunrpc/svc_authux.c: Likewise. + * sunrpc/svc_raw.c: Likewise. + * sunrpc/svc_simple.c: Likewise. + * sunrpc/svc_tcp.c: Likewise. + * sunrpc/svc_udp.c: Likewise. + * sunrpc/svc_unix.c: Likewise. + * sunrpc/xdr.c: Likewise. + * sunrpc/xdr_array.c: Likewise. + * sunrpc/xdr_mem.c: Likewise. + * sunrpc/xdr_rec.c: Likewise. + * sunrpc/xdr_ref.c: Likewise. + * sunrpc/xdr_stdio.c: Likewise. + * sysdeps/generic/_strerror.c: Likewise. + * sysdeps/generic/printf_fphex.c: Likewise. + * sysdeps/generic/tmpfile.c: Likewise. + * sysdeps/gnu/errlist.awk: Likewise. + * sysdeps/gnu/errlist.c: Likewise. + + * libio/Makefile (routines): Remove iosprint. + * libio/iosprintf.c: Removed + + +2002-02-24 Ulrich Drepper + + * elf/dl-support.c (_dl_non_dynamic_init): Renamed from + non_dynamic_init and exported now. + * sysdeps/unix/sysv/linux/ldsodefs.h: Declare _dl_non_dynamic_init. + * sysdeps/unix/sysv/linux/init-first.c: Call _dl_non_dynamic_init for + !SHARED. + * sysdeps/mach/hurd/i386/init-first.c: Likewise. + * sysdeps/mach/hurd/powerpc/init-first.c: Likewise. + * sysdeps/mach/hurd/mips/init-first.c: Likewise. + +2002-02-23 Ulrich Drepper + + * elf/dl-close.c (free_slotinfo): Check for end of list and return + true in this case. + + * locale/iso-639.def: Add language codes for Walloon. + + * elf/dl-fini.c (_dl_fini): Print some final statistics on the + total number of relocations performed. + + * elf/sprof.c (load_profdata): If do_test provide information as + to why loading failed. + * elf/dl-profile.c (_dl_start_profile): Initialize all of + hist_hdr.dimen. + + * csu/set-init.c: Moved to... + * sysdeps/mach/hurd/set-init.c: ...here. New file. + * csu/Makefile: Don't compile set-init. + * sysdeps/mach/hurd/Makefile: Compile set-init for subdir csu. + * sysdeps/mach/hurd/i386/init-first.c: Call __init_misc in addition + to __libc_init. + * sysdeps/mach/hurd/mips/init-first.c: Likewise. + * sysdeps/mach/hurd/powerpc/init-first.c: Likewise. + * sysdeps/unix/sysv/linux/init-first.c: Call __init_misc instead of + __libc_init. + * misc/init-misc.c: Always export __init_misc. Don't define hooks for + __libc_subinit. + +2002-02-22 Ulrich Drepper + + * elf/Versions: Add _dl_allocate_tls and _dl_deallocate_tls. + * elf/rtld.c (dl_main): Use _dl_allocate_tls with INTUSE. + * sysdeps/generic/dl-tls.c: Add INTDEF for _dl_allocate_tls. + (_dl_deallocate_tls): New function. + * sysdeps/generic/ldsodefs.h: Declare _dl_allocate_tls_internal and + _dl_deallocate_tls. + +2002-02-21 Jakub Jelinek + + * libio/fileops.c (_IO_file_seekoff_mmap): Fix fseek SEEK_END. + * stdio-common/tst-fseek.c (main): Add test for this. + +2002-02-19 Ulrich Drepper + + * stdlib/Versions: Move __on_exit to GLIBC_PRIVATE. + +2002-02-19 Jakub Jelinek + + * libio/fileops.c (_IO_file_underflow_mmap): Cast to unsigned char + pointer before dereferencing. + +2002-02-18 Roland McGrath + + * sysdeps/mach/hurd/times.c: Fix typo in last change. + + * sysdeps/mach/hurd/setpriority.c [POLICY_TIMESHARE_BASE_COUNT]: + Use task_policy in place of task_priority. + + * sysdeps/generic/bits/mman.h + (MS_ASYNC, MS_SYNC, MS_INVALIDATE): New macros. + * sysdeps/mach/msync.c: New file. + + * sysdeps/mach/powerpc/syscall.S: New file. + + * mach/msg.c [MACH_MSG_OVERWRITE] + (__mach_msg_trap, __mach_msg_overwrite): New functions. + * mach/Versions (libc: GLIBC_2.0): Add mach_msg_overwrite and __ name. + + * sysdeps/mach/configure.in: Check for clock.defs to put into + mach_interface_list. + * sysdeps/mach/configure: Regenerated. + + * mach/Makefile (mach-machine): New variable, set from $(base-machine). + ($(objpfx)mach-syscalls.mk): Use it in place of $(base-machine). + ($(mach-syscalls:%=$(objpfx)%.S) static pattern rule): + Use instead of . + (mach-shortcuts): Add device_read_overwrite_request, + device_read_overwrite, vm_read_overwrite, thread_switch. + + * configure.in (base_machine): Set to $machine by default. + * configure: Regenerated. + + * sysdeps/mach/configure.in: Check for + or and add -DNDR_DEF_HEADER=... to DEFINES. + * sysdeps/mach/configure: Regenerated. + * mach/mach_init.c [NDR_DEF_HEADER]: #include it. + + * hurd/hurdfault.c (_hurdsig_fault_init): Add a cast. + + * hurd/hurd/signal.h: Include for `jmp_buf' decl. + + * mach/msgserver.c (__mach_msg_server_timeout) [! MACH_RCV_LARGE]: + Double MAX_SIZE and don't retry on MACH_RCV_TOO_LARGE. + +2002-02-17 Roland McGrath + + * sysdeps/mach/hurd/times.c + [NO_CREATION_TIME] (startup_time): New static variable. + [NO_CREATION_TIME] (times_init): New static function in __libc_subinit. + (__times) [NO_CREATION_TIME]: Use startup_time in lieu of task + creation_time from task_basic_info. + (__times): Use __gettimeofday instead of __host_get_time. + + * hurd/intr-msg.c (_hurd_intr_rpc_mach_msg) [! MACH_MSG_TYPE_BIT]: + Use untyped Mach IPC message format. + + * hurd/catch-exc.c: Include , missing from last change. + + * hurd/Versions (libc: GLIBC_2.0): Add _S_catch_exception_raise_state, + _S_catch_exception_raise_state_identity, + _hurdsig_fault_catch_exception_raise_state, + _hurdsig_fault_catch_exception_raise_state_identity. + + * mach/shortcut.awk: Don't apply the /^}$/ rule when $proto == "". + + * sysdeps/mach/getsysstats.c (__get_avphys_pages) [HOST_VM_INFO]: Use + __host_info with HOST_VM_INFO flavor instead of __vm_statistics. + + * sysdeps/mach/hurd/getpriority.c [TASK_SCHED_TIMESHARE_INFO]: Find + `base_priority' in PIP->timeshare_base_info instead of PIP->taskinfo. + + * sysdeps/mach/hurd/dl-sysdep.c [FMH]: Define for i386 only. + (fmh, unfmh): Define these functions only #if FMH. Otherwise define + them as no-op macros. + [FMH] (ELF_MACHINE_USER_ADDRESS_MASK): Redefine it to zero. + (__mmap): Uncomment uses of ELF_MACHINE_USER_ADDRESS_MASK. + + * sysdeps/powerpc/dl-machine.h + (ELF_MACHINE_USER_ADDRESS_MASK): New macro. + + * hurd/hurdselect.c (_hurd_select) [MACH_MSG_TRAILER_MINIMUM_SIZE]: + Use untyped Mach IPC message format. + + * sysdeps/mach/hurd/ioctl.c (__ioctl) [! MACH_MSG_TYPE_BIT]: + Handle untyped Mach IPC message formats. + + * hurd/catch-exc.c (_S_catch_exception_raise) [EXC_MASK_ALL]: + Expect different argument conventions when this is defined. + [EXC_MASK_ALL] (_S_catch_exception_raise_state): New stub function. + [EXC_MASK_ALL] (_S_catch_exception_raise_state_identity): Likewise. + * hurd/hurdfault.c: Likewise for _hurdsig_fault_catch_exception_*. + [NDR_CHAR_ASCII] (mig_reply_header_t): #define as mig_reply_error_t + for OSF Mach variant. + (faulted): Use mig_reply_error_t for REPLY. + (_hurdsig_fault_init) [EXC_MASK_ALL]: Use EXCEPTION_STATE_IDENTITY + in __thread_set_exception_ports call. + (_hurdsig_fault_init) [MACH_PORT_RECEIVE_STATUS]: Use + __mach_port_set_attributes in place of __mach_port_set_qlimit. + + * sysdeps/mach/powerpc/sysdep.h (_MACH_MACHINE_ASM_H): Define this + before include , to inhibit + on Darwin, which includes bogons. + + * sysdeps/powerpc/dl-machine.h (elf_machine_rela): Move local + variable LOADBASE so it's not declared when it's not used. + +2002-02-16 Roland McGrath + + * sysdeps/mach/hurd/times.c (__times) [NO_CREATION_TIME]: Don't try + to use BI.creation_time. + + * mach/Machrules (MIG): Add -x c to CPP value passed down. + + * config.h.in: Add #undef HAVE_HOST_PAGE_SIZE. + * sysdeps/mach/configure.in: Check for host_page_size RPC to define it. + * mach/mach_init.c (__mach_init) [HAVE_HOST_PAGE_SIZE]: Use + host_page_size instead of vm_statistics. + + * sysdeps/mach/Makefile (mach-before-compile): Don't include + mach_interface.h here, since not all variants use that name. + + * sysdeps/mach/configure.in: Add some checks for Mach headers + to ensure a sane installation. + (mach_interface_list): Define this variable by checking for .defs + files found in various variants. + * configure.in (mach_interface_list): AC_SUBST this. + * config.make.in (mach-interface-list): New substituted variable. + * mach/Makefile (user-interfaces): Define this using the value + of $(mach-interface-list) instead of mach, mach4. + Updated other references to mach_interface to use it as well. + + * sysdeps/mach/powerpc/machine-lock.h: Avoid multi-line strings. + + * mach/msgserver.c [NDR_CHAR_ASCII] (mig_reply_header_t): #define as + mig_reply_error_t for OSF Mach variant. + + * mach/Makefile (routines): Remove bootprivport. + * mach/bootprivport.c: File removed. It has never been used. + + * mach/msg-destroy.c (__mach_msg_destroy) [MACH_MSG_PORT_DESCRIPTOR]: + Grok the OSF flavor of message format. + (mach_msg_destroy_port): For MAKE_SEND and + MAKE_SEND_ONCE rights, create an destroy a right to ensure proper + no-senders notification. + +2002-02-06 Roland McGrath + + * hurd/Versions (libc: GLIBC_2.0): Move cthread_fork, cthread_detach + to here if 2.0 compatibility enabled ... + (libc: GLIBC_2.1.3): ... from here. + +2002-02-15 Ulrich Drepper + + * elf/dl-open.c (dl_open_worker): Catch wrap-around of TLS + generation counter. + * elf/dl-close.c (_dl_close): Likewise. + +2002-02-14 Ulrich Drepper + + * elf/Makefile: Add rules to build and run tst-tls8. + * elf/tst-tls8.c: New file. + * elf/tst-tlsmod4.c: New file. + + * stdlib/test-a64l.c (tests): Add more test cases. + + * sunrpc/rtime.c (rtime): Change type of thetime to uint32_t. + Reported by Walter Harms . + +2002-02-11 Jes Sorensen + + * sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h: Add sc_flag bit + definitions for struct sigcontext. + Suggested by David Mosberger-Tang. + +2002-02-13 Ulrich Drepper + + * elf/dl-close.c (remove_slotinfo): New function. Handles everything + for removing reference of module in slotinfo list. + (_dl_close): Use remove_slotinfo. + * sysdeps/generic/dl-tls.c: General pretty printing. + (oom): Define only if SHARED. + (_dl_next_tls_modid): Correct starting point for the case we assume + there is a gap. Add missing instruction grouping (doh!). Correct + tests for reaching maximum index. + * elf/Makefile: Add rules to build and run tst-tls7. + * elf/tst-tls7.c: New file. + * elf/tst-tlsmod3.c: New file. + + * elf/tst-tlsmod1.c: Move #include "tls-macros.h" instead #ifdef + USE_TLS. + * elf/tst-tlsmod2.c: Likewise. + + * elf/dl-close.c (_dl_close): When closing an object using TLS + either decrement dl_tls_max_dtv_idx or set dl_tls_dtv_gaps to + true. Increment dl_tls_generation only if we closed any TLS-using + object. + * elf/tst-tls6.c: New file. + * elf/Makefile: Add rules to build and run tst-tls6. + + * po/da.po: Update from translation team. + + * locale/categories.def: Fix typo [PR libc/2948]. + * po/Makefile (BROKEN_LINGUAS): Works with current gettext + [PR libc/2949]. + * locale/iso-4217.def: Update from official version [PR libc/2950]. + * glibcbug.in: Honor TMPDIR [PR libc/2951]. + * locale/programs/ld-collate.c (collate_finish): Bail out with a + message if input is too confusion instead of using assert. + (collate_read): Don't crash on unknown symbol [PR libc/2952]. + Patches by Alastair McKinstry . + + * elf/tst-tls1.c: Move #include "tls-macros.h" inside #ifdef USE_TLS. + * elf/tst-tls2.c: Likewise. + * elf/tst-tls3.c: Likewise. + +2002-02-13 Jakub Jelinek + + * elf/dl-close.c (free_slotinfo): Only define if TLS supported. + +2002-02-13 Ulrich Drepper + + * elf/dl-open.c (dl_open_worker): Only bump the generation counter + if this is really necessary. + + * elf/dl-close.c (_dl_close): Implement freeing entries in the + slotinfo array. + (free_mem): Free memory for the slotinfo array if possible. + +2002-02-12 Andreas Schwab + + * csu/gmon-start.c (__gmon_start__): Remove '&' from ENTRY_POINT. + +2002-02-12 Ulrich Drepper + + * sysdeps/generic/dl-tls.c (TLS_DTV_UNALLOCATED): Renamed from + TLS_DTV_UNALLOCATE. + (oom): New function. + (_dl_next_tls_modid): Rewrite to handle dl_tls_dtv_slotinfo_list. + (_dl_determine_tlsoffset): Likewise. + (_dl_allocate_tls): Likewise. + (__TLS_GET_ADDR): Define if not already defined. + (_dl_tls_symaddr): New function. + (allocate_and_init): New function. + (__tls_get_addr): Actually implement handling of generation counter + and deferred allocation. + * sysdeps/generic/ldsodefs.h (_rtld_global): Remove _dl_initimage_list, + add _dl_tls_dtv_slotinfo_list, _dl_tls_static_nelem, and + _dl_tls_generation. + Define TLS_SLOTINFO_SURPLUS and DTV_SURPLUS. + Declare _dl_tls_symaddr. + * sysdeps/i386/dl-tls.h: Disable __tls_get_addr handling unless + SHARED. + * include/link.h (struct link_map): Remove l_tls_nextimage and + l_tls_previmage. + * elf/dl-sym.c (_dl_sym): After successful lookup call _dl_tls_symaddr + instead of DL_SYMBOL_ADDRESS for STT_TLS symbols. + (_dl_vsym): Likewise. + * elf/rtld.c (_dl_start_final): Adjust initdtv initialization for new + layout. + (dl_main): Allow PT_TLS be present for empty segment. Remove + nextimage list handling. Instead add all modules using TLS to + dl_tls_dtv_slotinfo_list. + * elf/dl-open.c (dl_open_worker): After successfully loading all + objects add those with TLS to the dl_tls_dtv_slotinfo_list list. + * elf/dl-load.c (_dl_map_object_from_fd): If PT_TLS entry is for an + empty segment don't do anything. Remove handling of initimage list. + * elf/Versions [ld] (GLIBC_2.0): Add __libc_memalign. + (GLIBC_PRIVATE): Add _dl_tls_symaddr. + * elf/dl-minimal.c: Define __libc_memalign. + * elf/dl-support.c: Remove _dl_initimage_list. Add + _dl_tls_dtv_slotinfo_list, _dl_tls_static_nelem, and + _dl_tls_generation. + * include/stdlib.h: Declare __libc_memalign. + + * elf/Makefile: Add rules to build and run tst-tls4 and tst-tls5. + * elf/tst-tls4.c: New file. + * elf/tst-tls5.c: New file. + * elf/tst-tlsmod2.c: New file. + + * elf/tls-macros.h: asms using ___tls_get_addr destroy %ecx and %edx. + + * elf/tst-tlsmod1.c: Don't define variables unles USE_TLS. + + * elf/tst-tls1.c: Use test-skeleton.c. + * elf/tst-tls2.c: Likewise. + * elf/tst-tls3.c: Likewise. + + * elf/dl-conflict.c (RESOLVE_MAP): Return NULL not 0. + +2002-02-08 Daniel Jacobowitz + + * sysdeps/mips/machine-gmon.h: Update MCOUNT for current GCC behavior. + +2002-02-10 Ulrich Drepper + + * elf/elf.h: Define R_386_TLS_GD and R_386_TLS_LDM. + + * elf/tst-tls3.c: New file. + * elf/tst-tlsmod1.c: New file. + * elf/Makefile: Add rules to build and run tst-tls3. + + * sysdeps/i386/dl-machine.h: Include . + (elf_machine_type_class): Set ELF_RTYPE_CLASS_PLT also for the three + TLS relocations. + + * elf/do-lookup.h (FCT): st_value can be zero for STT_TLS symbols. + + * po/fr.po: Update from translation team. + + * elf/tls-macros.h: Add alternative macros for use in PIC. + + * elf/dl-lookup.c: Include . + * elf/do-lookup.h (FCT): Don't discard STT_TLS symbols. + + * sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): More changes + required by passing pointer to last element of the list. + + * elf/dl-load.c (_dl_map_object_from_fd): Move adjustment of + l_tls_initimage to a place where it actually is performed. + + * sysdeps/generic/glob.c (glob): Explicitly set gl_pathc to zero + after globfree() calls. + + * elf/dl-deps.c (struct openaux_args): Add open_mode element. + (openaux): Pass open_mode as new last argument to _dl_map_object. + (_dl_map_object_deps): Add new argument open_mode. Initialize + open_mode element of args variable with it. + * elf/dl-open.c (dl_open_worker): Pass __RTLD_DLOPEN flag is set to + _dl_map_object_deps. + * elf/rtld.c (dl_main): Add zero as last parameter to + _dl_map_object_deps call. + * sysdeps/generic/ldsodefs.h: Adjust prototype of _dl_map_object_deps. + * elf/nodlopen2.c: New file. + * elf/nodlopenmod2.c: New file. + * elf/Makefile: Add rules to build and run nodlopen2. + + * elf/tst-tls1.c: Move TLS helper macros to... + * elf/tls-macros.h: ...here. New file. + * elf/tst-tls2.c: New file. + * elf/Makefile (tests): Add tst-tls2. + (distribute): Add tls-macros.h. + + * po/sv.po: Update from translation team. + + * elf/tst-tls1.c (main): Add complete set of tests. Split + architecture specific definitions from the actual test code. + + * po/tr.po: Update from translation team. + +2002-02-09 Ulrich Drepper + + * elf/Makefile (tests): Add tst-tls1. + * elf/tst-tls1.c: New file. + + * sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): Don't handle + alignment of TCB for now. + + * elf/rtld.c (dl_main): Use p_vaddr as address of TLS + initialization image for the application itself. + + * sysdeps/generic/dl-tls.c (_dl_allocate_tls): Correctly terminate + loop to initialize TLS block. + +2002-02-08 Richard Henderson + + * sysdeps/generic/ldsodefs.h (struct rtld_global): Also include + _dl_cpuclock_offset if HP_SMALL_TIMING_AVAIL. + + * sysdeps/alpha/elf/initfini.c: Use \n\ for multiline string. + +2002-02-09 Jakub Jelinek + + * sysdeps/generic/dl-environ.c (unsetenv): Clear cnt before use. + +2002-02-08 Ulrich Drepper + + * po/ca.po: Update from translation team. + * po/sk.po: Likewise. + + * elf/rtld.c (_dl_start_final): Install DTV explicitly. + (dl_main): Move dtv/static TLS handling before relocation. + Unconditionally call _dl_tlsoffset. Call _dl_allocate_tls and + TLS_INIT_TP to allocate and install the dtv/static TLS block. + * sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): If no object + so far uses TLS initialize GL(dl_tls_static_size) and + GL(dl_tls_static_align) to account for the TCB. + (_dl_allocate_tls): New function. + * sysdeps/generic/ldsodefs.h (rtld_global): Add + _dl_initial_dtv_malloced. + + * configure.in: Test for __builtin_memset more realistically. + + * csu/version.c (banner): If TLS support is available say so. + +2002-02-04 H.J. Lu + + * sysdeps/mips/dl-machine.h (elf_machine_matches_host): Use + __attribute_used__. + (__dl_runtime_resolve): Likewise. + + * sysdeps/mips/machine-gmon.h (_MCOUNT_DECL): Make it a real + declaration. + +2001-11-15 H.J. Lu + + * sysdeps/unix/sysv/linux/mips/sys/procfs.h: Don't include + , nor . Updated for gdb. + + * sysdeps/unix/sysv/linux/mips/sys/user.h: New file. + +2002-02-07 H.J. Lu + + * sysdeps/mips/atomicity.h (compare_and_swap): Remove + ".set noreorder". + * sysdeps/unix/sysv/linux/mips/sys/tas.h (_test_and_set): + Likewise. + +2002-02-07 Ulrich Drepper + + * sysdeps/unix/sysv/linux/bits/stat.h: Undo last patch. + + * sysdeps/i386/dl-tls.h (__tls_get_addr): Call + ___tls_get_addr_internal. + (___tls_get_addr_internal): Define as alias for ___tls_get_addr. + + * po/ko.po: Update from translation team. + +2002-02-07 Jakub Jelinek + + * sysdeps/unix/sysv/linux/bits/stat.h (struct stat): Remove packed + attribute, change __pad{1,2} type to unsigned int. + (struct stat64): Remove packed attribute. + +2002-02-07 Ulrich Drepper + + * sysdeps/i386/dl-tls.h: No need for #ifdef USE_TLS. + +2002-02-07 Andreas Schwab + + * configure.in: Fix check for -zcombreloc. + +2002-02-06 H.J. Lu + + * config.h.in (HAVE_BUILTIN_MEMSET): New macro. + * configure.in: Check if __builtin_memset really works. + * elf/rtld.c (_dl_start): Check HAVE_BUILTIN_MEMSET instead of + __GNUC_PREREQ (2, 96) before using __builtin_memset. + +2002-02-06 Jakub Jelinek + + * io/bug-ftw3.c (main): Don't try the test if root. + +2002-02-06 Martin Schwidefsky + + * sysdeps/unix/sysv/linux/s390/brk.c (__brk): Correct inline assembly + constraints. + * sysdeps/unix/sysv/linux/s390/s390-32/bits/resource.h (RLIMIT_LOCKS): + Add RLIMIT_LOCKS and adjust RLIMIT_NLIMITS. + * sysdeps/unix/sysv/linux/s390/s390-64/bits/resource.h (RLIMIT_LOCKS): + Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/clone.S (clone): Make clone + a weak alias for __clone. + * sysdeps/unix/sysv/linux/s390/s390-64/clone.S (clone): Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h: Fix typo. + * sysdeps/unix/sysv/linux/s390/s390-64/Makefile: Add framestate. + * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file. + * sysdeps/unix/sysv/linux/s390/s390-64/mmap.S (__mmap64): Make __mmap + a weak alias for __mmap64. + +2002-02-05 H.J. Lu + + * sysdeps/mips/atomicity.h (exchange_and_add): Not use branch likely. + (atomic_add): Likewise. + (compare_and_swap): Likewise. + * sysdeps/unix/sysv/linux/mips/sys/tas.h (_test_and_set): Likewise. + +2002-02-07 Ulrich Drepper + + * sysdeps/generic/dl-tls.c: Don't read TLS header if TLS is not needed. + + * sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): Account for + alignment of the TCB and store total size and alignment of static + TLS block in _dl_tls_static_size and _dl_tls_static_align. + tls_index is a typedef. + * sysdeps/generic/ldsodefs.h: Declare _dl_tls_static_size and + _dl_tls_static_align. + * sysdeps/i386/dl-tls.h: tls_index is a typedef. + * elf/dl-support.c: Define _dl_tls_static_size and + _dl_tls_static_align. + +2002-02-06 Ulrich Drepper + + * configure.in: Add --without-tls option. + * sysdeps/i386/elf/configure.in: Don't check for TLS support if + --without-tls is given. + + * sysdeps/generic/dl-tls.c: Include . + + * sysdeps/i386/dl-tls.h: Don't define anything if !USE_TLS. + +2002-02-06 Roland McGrath + + * malloc/hooks.c [! HAVE_MREMAP]: Conditionalize unused decls. + * malloc/malloc.c [! HAVE_MREMAP]: Likewise. + + * scripts/versions.awk: Improve error message for missing version. + Each version inherits from the last one only if they have the same + nonnumeric prefix, i.e. GLIBC_x.y and GLIBC_x.z or FOO_x and FOO_y + but not GLIBC_x and FOO_y. + + * scripts/firstversions.awk: Handle libraries that don't have each + particular version named in the third column of shlib-versions. + + * scripts/firstversions.awk: Don't mess with GLIBC_PRIVATE. + +2002-02-06 Ulrich Drepper + + * Versions.def [ld]: Add GLIBC_2.3. + * elf/Versions [ld]: Add __tls_get_addr to GLIBC_2.3. + * elf/Makefile (dl-routines): Add dl-tls. + (distribute): Add dl-tls.h. + * sysdeps/generic/ldsodefs.h (struct rtld_global): Remove + _dl_tls_module_cnt, add _dl_tls_max_dtv_idx and _dl_tls_dtv_gaps. + Add prototypes for _dl_next_tls_modid and _dl_determine_tlsoffset. + * elf/dl-load.c (_dl_map_object_from_fd): Store alignment requirement + along with the other info in the link map. Change queueing of init + images for double linked list. Use _dl_next_tls_modid to compute + l_tls_modid. + * elf/rtld.c (_dl_start_final): Store alignment requirement + along with the other info in rtld map and executable map. + (dl_main): Add ld.so to the init image list if necessary. Compute + final module ID with _dl_next_tls_modid. + * include/link.h (struct link_map): Add l_tls_previmage and + l_tls_align. + * eld/dl-support.c: Define _dl_tls_max_dtv_idx and _dl_tls_dtv_gaps. + * sysdeps/i386/elf/Versions: New file. + * sysdeps/generic/dl-tls.c: New file. + * sysdeps/generic/dl-tls.h: New file. + * sysdeps/i386/dl-tls.h: New file. + +2002-02-06 Roland McGrath + + * sysdeps/unix/sysv/linux/netinet/ip.h: Moved to ... + * sysdeps/generic/netinet/ip.h: ... here, replacing old file. + +2002-01-05 Roland McGrath + + * sysdeps/mach/configure.in: New file. + * sysdeps/mach/configure: New generated file. + + * mach/Makefile (user-interfaces): Remove default_pager_helper. + It has never been used by anything. + +2002-02-06 H.J. Lu + + * sysdeps/mips/elf/ldsodefs.h: Make sure the right + is included. + +2002-02-06 Ulrich Drepper + + * sysdeps/unix/sysv/linux/bits/stat.h (struct stat): Add + attribute((packed)) to counter stupid people misusing gcc options. + (struct stat64): Likewise. + +2002-02-05 Ulrich Drepper + + * elf/rtld.c (dl_main): Correct indentation. Use bool as type for + the variables which are used as booleans. + +2002-02-06 Andreas Jaeger + + * include/libc-symbols.h (INTUSE): Renamed from INT. + * elf/dl-deps.c: Change users. + * sysdeps/generic/dl-sysdep.c: Likewise. + * sysdeps/generic/dl-cache.c: Likewise. + * elf/dl-reloc.c: Likewise. + * elf/rtld.c: Likewise. + * elf/dl-version.c: Likewise. + * elf/dl-load.c: Likewise. + * elf/dl-dst.h: Likewise. + * elf/dl-init.c: Likewise. + * elf/dl-error.c: Likewise. + * elf/dl-fini.c: Likewise. + * elf/dl-runtime.c: Likewise. + * elf/do-lookup.h: Likewise. + + * stdio-common/_itoa.h: Undefine SPECIAL to avoid duplicate + definition. + * stdio-common/_itowa.h: Likewise. + +2002-02-05 Ulrich Drepper + + * elf/dl-minimal.c: Define _itoa_lower_digits. + + * elf/dynamic-link.h (elf_get_dynamic_info): ld.so can have + DT_FLAGS set. + + * elf/dl-load.c (_dl_map_object_from_fd): Prevent dynamically + loading modules with the DF_STATIC_TLS flag set. + * elf/dynamic-link.h (elf_get_dynamic_info): Initialize l_flags + element. + * include/link.h (struct link_map): Add l_flags field. + * elf/elf.h (DF_STATIC_TLS): New definition. + + * dlfcn/Makefile: Add rules to build and run bug-dlopen1. + * dlfcn/bug-dlopen1.c: New file. By Bruno Haible. + + * elf/rtld.c (process_dl_debug): Correct printing help message. + * elf/dl-misc.c (_dl_debug_vdprintf): Implement precision handling + for %s. + + * inet/getnetgrent_r.c (innetgr): Add int* parameter to getfct + definition and pass &errno in use of this variable. + Reported by Simon Wilkinson [PR libc/2911]. + +2002-02-04 Andreas Schwab + + * locale/programs/localedef.h (WITH_CUR_LOCALE): Define. + * locale/programs/charmap-dir.c: Wrap calls that output messages + with WITH_CUR_LOCALE. Include "localedef.h" first. + * locale/programs/charmap.c: Likewise. + * locale/programs/ld-address.c: Likewise. + * locale/programs/ld-collate.c: Likewise. + * locale/programs/ld-ctype.c: Likewise. + * locale/programs/ld-identification.c: Likewise. + * locale/programs/ld-measurement.c: Likewise. + * locale/programs/ld-messages.c: Likewise. + * locale/programs/ld-monetary.c: Likewise. + * locale/programs/ld-name.c: Likewise. + * locale/programs/ld-numeric.c: Likewise. + * locale/programs/ld-paper.c: Likewise. + * locale/programs/ld-telephone.c: Likewise. + * locale/programs/ld-time.c: Likewise. + * locale/programs/linereader.c: Likewise. + * locale/programs/linereader.h: Likewise. + * locale/programs/localedef.c: Likewise. + * locale/programs/locfile.c: Likewise. + * locale/programs/repertoire.c: Likewise. + +2002-02-05 Ulrich Drepper + + * elf/rtld.c (_dl_start_final): Determine load address to locate + ehdr with GL(dl_rtld_map).l_map_start. + + * po/ca.po: Update from translation team. + + * elf/rtld.c (dl_main): Read PT_TLS entry of the executable. + * elf/dl-load.c (_dl_map_object_from_fd): Handle PT_TLS program + header entry. + * sysdeps/generic/ldsodefs.h (struct rtld_global): Add + _dl_tls_module_cnt. + * elf/dl-support.c: Define _dl_initimage_list and _dl_tls_module_cnt. + +2002-02-04 Ulrich Drepper + + * elf/rtld.c (_dl_start): Fill TLS values in link map for rtld. + * include/link.h (struct link_map): Add various members for TLS + information. + * sysdeps/generic/ldsodefs.h (struct rtld_global): Remove + _rtld_tlsoffset, add _dl_initimage_list. + * sysdeps/i386/dl-lookupcfg.h: New file. + * sysdeps/i386/dl-machine.h (elf_machine_rel): Implement missing + TLS relocation. When using TLS we now use RESOLVE_MAP. + (elf_machine_rela): Use RESOLVE_MAP instead of RESOLVE_MAP if TLS + is used. + + * sysdeps/generic/dl-cache.c (_dl_cache_libcmp): Mark as possibly + unused. + + * elf/rtld.c (_dl_start_final): Allocate TLS and initialize + thread-pointer as soon as possible. + * sysdeps/generic/ldsodefs.h: Include . Define first TLS + elements in rtld_global. + * sysdeps/generic/tls.h: New file. + * elf/Makefile (distribute): Add tls.h. + * sysdeps/i386/dl-machine.h (elf_machine_rel): Add support for TLS + relocations. Not complete yet. + + * resolv/resolv.h: Allow user to define __need_res_state and only + define __res_start structure then. + * include/resolv.h: Only declare functions if _RESOLV_H_ is defined. + + * sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Move + dl_cpuclock_offset initialization to _dl_start_final. + (_dl_show_auxv): Avoid unnecessary sign extension. + * elf/rtld.c (_dl_start_final): Initialize dl_cpuclock_offset. + +2002-02-03 Ulrich Drepper + + * config.h.in: Add HAVE_TLS_SUPPORT. + * sysdeps/i386/elf/configure.in: New file. + +2002-02-03 Andreas Schwab + + * sysdeps/posix/readv.c: Use ssize_t for bytes_read. + * sysdeps/posix/writev.c: Use ssize_t for bytes_written. Fix comment. + +2002-02-03 Thorsten Kukuk + + * sysdeps/posix/writev.c: Check for ssize_t overflow, don't use + alloca if the memory reqirements are too high. + +2002-02-03 Ulrich Drepper + + * elf/dl-load.c (decompose_rpath): Avoid using strstr. + * elf/dl-minimal.c (_strerror_r): Use _itoa instead of _itoa_word since + the former is available anyway and speed isn't important here. + * elf/dl-misc.c (_dl_debug_vdprintf): Likewise. + * elf/dl-version.c (match_symbol): Likewise. + (_dl_check_map_versions): Likewise. + * elf/rtld.c (process_envvars): Likewise. + (print_statistics): Likewise. + * sysdeps/generic/dl-sysdep.c (_dl_show_auxv): Likewise. + * elf/dl-minimal.c (_itoa): Always define it. Make it work for all + bases. Add assert to catch uses of unimplemented features. + (__strsep): Add assert to catch uses of unimplemented features. + * elf/dl-object.c (_dl_new_object): Don't use rawmemchr. Use strchr + and avoid inline optimization. + * elf/rtld.c (process_envvars): Likewise. + * elf/dl-open.c: Don't include . + * elf/dl-profile.c (_dl_start_profile): Help compiler to avoid ffs. + * elf/rtld.c (dl_main): Avoid strsep inline optimization. + +2002-02-02 Ulrich Drepper + + * stdio-common/_itoa.h: Minor simplifications of the code. + * stdio-common/_itoa.c: Likewise. + + * elf/dl-reloc.c (_dl_relocate_object): Use _dl_debug_printf + instead of _dl_printf for debugging info output. + + * manual/examples/mkfsock.c (make_named_socket): Make sure name is + always NUL-terminated. Patch by Chris D. Sloan . + +2002-02-01 H.J. Lu + + * sysdeps/mips/atomicity.h (exchange_and_add): Use branch likely. + (atomic_add): Likewise. + (compare_and_swap): Return 0 only when failed to compare. Use + branch likely. + + * sysdeps/unix/sysv/linux/mips/sys/tas.h (_test_and_set): Use + branch likely. + +2002-02-03 kaz Kojima + + * sysdeps/sh/dl-machine.h (elf_machine_rela): Fix a typo. + +2002-02-02 Ulrich Drepper + + * elf/dl-minimal.c (__strsep): New minimal implementation. + +2002-02-02 Paul Eggert + + * src/mktime.c [defined DEBUG && STDC_HEADERS]: Include . + (__mktime_internal): If no tm_isdst is requested, prefer solutions + with tm_isdst > 0 when the requested time falls within a + spring-forward gap [PR libc/2894]. + +2002-02-03 Andreas Schwab + + * stdio-common/tst-rndseek.c: Increase timeout. + +2002-02-02 Ulrich Drepper + + Change ld.so to not use functions which are exported. One cannot + interpose them anyway. Use INT() to mark uses, INTDEF() to mark + definitions. + * include/libc-symbols.h: Define INT and INTDEF. + * sysdeps/generic/ldsodefs.h: Declare _dl_debug_printf_internal, + _dl_signal_error_internal, _dl_map_object_internal, + _dl_map_object_deps_internal, _dl_lookup_symbol_internal, + _dl_lookup_versioned_symbol_internal, + _dl_relocate_object_internal, _dl_debug_state_internal, + _dl_start_profile_internal, and _dl_unload_cache_internal. + * include/dlfcn.h: Declare _dl_catch_error_internal. + * elf/rtld.c: Use INT for calls to any of the *_internal functions + above. Add INTDEF to function definitions. + * elf/dl-debug.c: Likewise. + * elf/dl-deps.c: Likewise. + * elf/dl-dst.h: Likewise. + * elf/dl-error.c: Likewise. + * elf/dl-fini.c: Likewise. + * elf/dl-init.c: Likewise. + * elf/dl-load.c: Likewise. + * elf/dl-lookup.c: Likewise. + * elf/dl-misc.c: Likewise. + * elf/dl-open.c: Likewise. + * elf/dl-profile.c: Likewise. + * elf/dl-reloc.c: Likewise. + * elf/dl-runtime.c: Likewise. + * elf/dl-version.c: Likewise. + * elf/do-lookup.h: Likewise. + * sysdeps/generic/dl-cache.c: Likewise. + * sysdeps/generic/dl-sysdep.c: Likewise. + * sysdeps/alpha/dl-machine.h (RTLD_START): Call _dl_init_internal + instead of _dl_init. + * sysdeps/arm/dl-machine.h: Likewise. + * sysdeps/cris/dl-machine.h: Likewise. + * sysdeps/hppa/dl-machine.h: Likewise. + * sysdeps/i386/dl-machine.h: Likewise. + * sysdeps/ia64/dl-machine.h: Likewise. + * sysdeps/m68k/dl-machine.h: Likewise. + * sysdeps/mips/dl-machine.h: Likewise. + * sysdeps/mips/mips64/dl-machine.h: Likewise. + * sysdeps/s390/s390-32/dl-machine.h: Likewise. + * sysdeps/s390/s390-64/dl-machine.h: Likewise. + * sysdeps/sh/dl-machine.h: Likewise. + * sysdeps/sparc/sparc32/dl-machine.h: Likewise. + * sysdeps/sparc/sparc64/dl-machine.h: Likewise. + * sysdeps/x86_64/dl-machine.h: Likewise. + * sysdeps/powerpc/dl-start.S (_dl_start_user): Likewise. + + * elf/Versions: Don't export _dl_check_all_versions, _dl_sysdep_start, + and _dl_debug_initialize. + + * elf/dl-object.c (_dl_new_object): Avoid using strrchr. We have + more information. + * elf/rtld.c (dl_main): Avoid strrchr. + * sysdeps/unix/sysv/linux/dl-origin.c (_dl_get_origin): Use the + result of readlink. Search from the back for '/'. + + * elf/dl-profile.c (_dl_start_profile): Help the compiler to avoid + strncpy if possible. + + * sysdeps/generic/dl-environ.c (unsetenv): Optimize. Don't use + strncmp. + * elf/dl-load.c (is_dst): Optimize. Don't call strncmp twice. + * elf/rtld.c (process_dl_debug): Optimize. Avoid calls to strncmp, + strspn, and strcspn. + (process_envvars): Don't use strcspn. + + * elf/dl-load.c (_dl_dst_count): Fix possible endless loop. + (_dl_dst_substitute): Likewise. + +2002-02-01 Ulrich Drepper + + * elf/do-rel.h (elf_dynamic_do_rel): Help the compiler recognize + code which is never used when relocating ld.so itself. + + * elf/dynamic-link.h (elf_get_dynamic_info): Optimize a bit for + starting ld.so itself. Move l_addr variable initialization closer + to use. + (_ELF_DYNAMIC_DO_RELOC): Help the compiler optimize a bit. + +2002-02-01 Jakub Jelinek + + * Versions.def (libc): Add GLIBC_PRIVATE. + (libdb, libnss_db, libdb1): Remove. + (libnss_compat, libnss_dns, libnss_files, libnss_hesiod, libnss_nis, + libnss_nisplus): Move all symbols to GLIBC_PRIVATE. + (libpthread): Add GLIBC_PRIVATE. + (libresolv): Likewise, remove GLIBC_2.1. + (ld): Add GLIBC_PRIVATE, remove GLIBC_2.1.1, GLIBC_2.2, GLIBC_2.2.1, + GLIBC_2.2.3, GLIBC_2.3. + * catgets/Versions (__open_catalog): Move to GLIBC_PRIVATE. + * elf/Versions (_dl_open, _dl_close, _dl_addr, _dl_init_first, + _dl_sym, _dl_vsym): Likewise. + (__libc_enable_secure, __libc_stack_end, _dl_argv, _dl_catch_error, + _dl_check_all_versions, _dl_check_map_versions, _dl_debug_initialize, + _dl_debug_printf, _dl_debug_state, _dl_dst_count, _dl_dst_substitute, + _dl_init, _dl_lookup_symbol, _dl_lookup_symbol_skip, + _dl_lookup_versioned_symbol, _dl_lookup_versioned_symbol_skip, + _dl_map_object, _dl_map_object_deps, _dl_out_of_memory, + _dl_relocate_object, _dl_signal_error, _dl_start_profile, + _dl_starting_up, _dl_sysdep_start, _dl_unload_cache, _rtld_global): + Likewise. + (_dl_object_relocation_scope): Remove. + * hesiod/Versions: Move all symbols to GLIBC_PRIVATE. + * iconv/Versions (__gconv_alias_db, __gconv_modules_db, + __gconv_cache): Move to GLIBC_PRIVATE. + * inet/Versions (__internal_endnetgrent, __internal_getnetgrent_r, + __internal_setnetgrent): Likewise. + * io/Versions (__libc_open, __libc_close, __libc_read, __libc_write, + __libc_lseek, __libc_fcntl, __libc_open64, __libc_lseek64): Likewise. + * locale/Versions (__collate_element_hash, __collate_element_strings, + __collate_symbol_classes, __collate_symbol_hash, + __collate_symbol_strings, _nl_current_LC_COLLATE, + _nl_current_LC_CTYPE): Likewise. + * misc/Versions (__libc_fsync, __libc_msync): Likewise. + * nis/Versions (libnss_compat): Move all symbols to GLIBC_PRIVATE. + (libnss_nis, libnss_nisplus): Likewise. + * nss/Versions (_nss_files_parse_grent, _nss_files_parse_pwent, + _nss_files_parse_spent): Move to GLIBC_PRIVATE. + (libnss_files): Move all symbols to GLIBC_PRIVATE. + * posix/Versions (__libc_wait, __libc_waitpid, __libc_pause, + __libc_nanosleep, __libc_fork, __libc_pread, __libc_pread64, + __libc_pwrite, __libc_pwrite64): Move to GLIBC_PRIVATE. + * resolv/Versions (__gai_sigqueue, __ns_name_unpack, __ns_name_ntop, + __ns_get16, __ns_samename): Likewise. + (libnss_dns): Move all symbols to GLIBC_PRIVATE. + * setjmp/Versions (__libc_longjmp, __libc_siglongjmp): Move to + GLIBC_PRIVATE. + * socket/Versions (__libc_accept, __libc_send, __libc_recvfrom, + __libc_recvmsg, __libc_sendmsg, __libc_recv, __libc_sendto, + __libc_connect): Likewise. + * stdio-common/Versions (_itoa_lower_digits, _itoa_upper_digits): + Likewise. + * stdlib/Versions (__libc_system): Likewise. + * sunrpc/Versions (__rpc_thread_destroy): Likewise. + * sysdeps/hppa/Versions: Move all symbols to GLIBC_PRIVATE. + * sysdeps/ia64/fpu/Versions: Likewise. + * sysdeps/ia64/Versions: Likewise. + * sysdeps/unix/sysv/linux/ia64/Versions: Likewise. + * sysdeps/unix/sysv/linux/i386/Versions (__modify_ldt): Move + to GLIBC_PRIVATE. + * sysdeps/unix/sysv/linux/x86_64/Versions (__modify_ldt): Likewise. + * sysdeps/unix/sysv/linux/Versions (__syscall_rt_sigqueueinfo, + __libc_sigaction): Likewise. + * termios/Versions (__libc_tcdrain): Likewise. + + * misc/sys/cdefs (__attribute_noinline__): Define. + * elf/dl-lookup.c (_dl_do_lookup, _dl_do_lookup_versioned): Add + __attribute_noinline__. + + * elf/Makefile (rtld-routines): Add dl-xstat64, dl-fxstat64. + * elf/dl-xstat64.c: New file. + * elf/dl-fxstat64.c: New file. + * sysdeps/unix/sysv/linux/fxstat64.c: If RTLD_STAT64 is defined, + don't export __fxstat64 at multiple versions. + * sysdeps/unix/sysv/linux/lxstat64.c: Similarly. + * sysdeps/unix/sysv/linux/xstat64.c: Similarly. + +2002-01-18 Isamu Hasegawa + + * locale/program/ld-collate.c (collate_finish): Assign a wide + char collation sequence value to multi character collating + elements, and avoid over writing by non-character elements. + +2002-02-01 Ulrich Drepper + + * elf/Makefile (distribute): Add dl-procinfo.c. + * sysdeps/unix/sysv/linux/i386/Dist: Remove dl-procinfo.c. + * sysdeps/unix/sysv/linux/arm/Dist: Likewise. + +2002-02-01 Jakub Jelinek + + * sysdeps/generic/ldsodefs.h (_dl_load_lock): Remove duplicate + definition. + * sysdeps/ia64/hp-timing.h: Move _dl_hp_timing_overhead in + _rtld_global struct. + * sysdeps/sparc/sparc32/sparcv9/hp-timing.h: Likewise. + * sysdeps/sparc/sparc64/hp-timing.c: Likewise. + * sysdeps/sparc/sparc64/hp-timing.h: Likewise. + * sysdeps/sparc/sparc64/Makefile: Make hp-timing static only. + * sysdeps/unix/sysv/aix/init-first.c (_dl_fpu_control, + _dl_fpu_control_set): Remove unused externs. + * sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c: New file. + * sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c: New file. + * sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h: Move procinfo + related variables in _rtld_global struct. + * sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h: Likewise. + * sysdeps/unix/sysv/linux/init-first.c (_dl_fpu_control_set): Remove + unused extern. + +2002-02-01 Ulrich Drepper + + * sysdeps/generic/dl-procinfo.c: New file. + +2002-02-01 Andreas Schwab + + * sysdeps/m68k/dl-machine.h: Don't use multi-line string literals. + +2002-02-01 Ulrich Drepper + + * elf/rtld.c (_dl_start): Mark as internal_function. + * sysdeps/i386/dl-machine.h (RTLD_START): Pass parameter for _dl_start + in register. + (elf_machine_rel): Cleanup and minor optimization for RTLD_BOOTSTRAP. + General pretty printing. + +2002-01-31 Ulrich Drepper + + * elf/dl-minimal.c: Define _itoa for 32-bit machines with HP timing. + * elf/dl-reloc.c: Pretty printing. + * sysdeps/generic/ldsodefs.h: Move _dl_hp_timing_overhead and + procinfo-related variables in rtld_global struct. + * elf/dl-support.c: Likewise. + * elf/rtld.c: Likewise. + * sysdeps/i386/i686/Makefile: Likewise. + * sysdeps/i386/i686/hp-timing.c: Likewise. + * sysdeps/i386/i686/hp-timing.h: Likewise. + * sysdeps/ia64/Makefile: Likewise. + * sysdeps/ia64/hp-timing.c: Likewise. + * sysdeps/sparc/sparc32/sparcv9/Makefile: Likewise. + * sysdeps/sparc/sparc32/sparcv9/hp-timing.c: Likewise. + * sysdeps/unix/sysv/linux/arm/dl-procinfo.c: Likewise. + * sysdeps/unix/sysv/linux/arm/dl-procinfo.h: Likewise. + * sysdeps/unix/sysv/linux/i386/Makefile: Likewise. + * sysdeps/unix/sysv/linux/i386/dl-procinfo.c: Likewise. + * sysdeps/unix/sysv/linux/i386/dl-procinfo.h: Likewise. + * sysdeps/x86_64/Makefile: Likewise. + + * sysdeps/generic/ldsodefs.h: Add _dl_load_lock, _dl_lazy, + _dl_dynamic_weak, _dl_fpu_control, _dl_cpuclock_offset, and + _dl_debug_fd to rtld_global. + * elf/Versions: Likewise. + * elf/dl-close.c: Likewise. + * elf/dl-iteratephdr.c: Likewise. + * elf/dl-lookup.c: Likewise. + * elf/dl-misc.c: Likewise. + * elf/dl-open.c: Likewise. + * elf/dl-support.c: Likewise. + * elf/do-lookup.h: Likewise. + * elf/rtld.c: Likewise. + * sysdeps/generic/dl-cache.c: Likewise. + * sysdeps/generic/dl-sysdep.c: Likewise. + * sysdeps/ia64/Versions: Likewise. + * sysdeps/unix/clock_gettime.c: Likewise. + * sysdeps/unix/clock_settime.c: Likewise. + * sysdeps/unix/sysv/linux/init-first.c: Likewise. + * sysdeps/sparc/Versions: Removed. + * sysdeps/i386/i686/Versions : Removed. + * sysdeps/x86_64/Versions: Removed. + * configure.in: Define HAVE_PROTECTED if .protected is available. + * config.h.in: Add entry for HAVE_PROTECTED. + +2002-01-31 Jakub Jelinek + + * sysdeps/posix/readv.c: Don't use alloca if the memory requirements + are too high. + +2002-01-31 Andreas Schwab + + * sysdeps/posix/readv.c: Check for ssize_t overflow. + +2002-01-31 Andreas Schwab + + * sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Fix leftover + reference to _dl_pagesize. + +2002-01-30 Ulrich Drepper + + * Versions.def [ld]: Add GLIBC_2.3. + * elf/dl-addr.c: Move global variables for SHARED code in struct + _rtld_global. Export this struct, remove all exports for the + signal variables. + * elf/dl-close.c: Likewise. + * elf/dl-conflict.c: Likewise. + * elf/dl-debug.c: Likewise. + * elf/dl-deps.c: Likewise. + * elf/dl-dst.h: Likewise. + * elf/dl-error.c: Likewise. + * elf/dl-fini.c: Likewise. + * elf/dl-init.c: Likewise. + * elf/dl-iteratephdr.c: Likewise. + * elf/dl-libc.c: Likewise. + * elf/dl-load.c: Likewise. + * elf/dl-lookup.c: Likewise. + * elf/dl-minimal.c: Likewise. + * elf/dl-object.c: Likewise. + * elf/dl-open.c: Likewise. + * elf/dl-profile.c: Likewise. + * elf/dl-profstub.c: Likewise. + * elf/dl-reloc.c: Likewise. + * elf/dl-runtime.c: Likewise. + * elf/dl-support.c: Likewise. + * elf/dl-sym.c: Likewise. + * elf/dl-version.c: Likewise. + * elf/do-lookup.h: Likewise. + * elf/do-rel.h: Likewise. + * elf/dynamic-link.h: Likewise. + * elf/rtld.c: Likewise. + * sysdeps/generic/dl-cache.c: Likewise. + * sysdeps/generic/dl-sysdep.c: Likewise. + * sysdeps/generic/ldsodefs.h: Likewise. + * sysdeps/generic/libc-start.c: Likewise. + * sysdeps/i386/dl-machine.h: Likewise. + * sysdeps/ia64/dl-fptr.c: Likewise. + * sysdeps/ia64/dl-machine.h: Likewise. + * sysdeps/unix/sysv/linux/dl-librecon.h: Likewise. + * sysdeps/unix/sysv/linux/dl-origin.c: Likewise. + * sysdeps/unix/sysv/linux/dl-osinfo.h: Likewise. + * sysdeps/unix/sysv/linux/getclktck.c: Likewise. + * sysdeps/unix/sysv/linux/getpagesize.c: Likewise. + * sysdeps/unix/sysv/linux/i386/dl-librecon.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/dl-static.c: Likewise. + * sysdeps/unix/sysv/linux/ia64/getpagesize.c: Likewise. + +2002-01-29 Ulrich Drepper + + * sysdeps/ia64/dl-lookupcfg.h (DL_AUTO_FUNCTION_ADDRESS): Add cast + to avoid warning + (DL_STATIC_FUNCTION_ADDRESS): Likewise. + + * elf/dl-lookup.c: Only define or handle _dl_num_relocations for the + SHARED version. + * elf/dl-reloc.c: Likewise for _dl_num_cache_relocations. + + * elf/rtld.c (_dl_start): Use __builtin_memset if available. + +2002-01-29 Ben Collins + + * string/bits/string2.h (__mempcpy): Protect size arg for + addition when using __builtin_memcpy. + +2002-01-29 Ulrich Drepper + + * stdlib/Makefile (tests): Add tst-qsort. + * stdlib/tst-qsort.c: New file. Written by Paul Eggert. + + * manual/signal.texi (Process Signal Mask): Document that + pthread_sigmask, not sigprocmask, must be used in MT programs. + Patch by Bertold Kolics . + + * misc/hsearch_r.c (hsearch_r): Don't insert anything if entry is + found. + * misc/Makefile (tests): Add tst-hsearch. + * misc/tst-hsearch.c: New file. + +2002-01-18 Wolfram Gloger + + * malloc/malloc.c: Rewrite, adapted from Doug Lea's malloc-2.7.0.c. + * malloc/malloc.h: Likewise. + * malloc/thread-m.h: Spinlock definitions for x86/x86_64. + * malloc/arena.c: New file. + * malloc/hooks.c: New file. + * malloc/tst-mallocstate.c: New file. + * malloc/Makefile: Add new testcase tst-mallocstate. + Add arena.c and hooks.c to distribute. Fix commented CPPFLAGS. + +2002-01-28 Ulrich Drepper + + * stdlib/msort.c: Remove last patch. The optimization violates the + same rule which qsort.c had problems with. + +2002-01-27 Paul Eggert + + * stdlib/qsort.c (_quicksort): Do not apply the comparison function + to a pivot element that lies outside the array to be sorted, as + ISO C99 requires that the comparison function be called only with + addresses of array elements [PR libc/2880]. + +2002-01-28 Ulrich Drepper + + * elf/dl-load.c (_dl_map_object): Remove incorrect optimization + for SHARED code. Reported by Ben Collins . + + * timezone/asia: Update from tzdata2002b. + * timezone/australasia: Likewise. + * timezone/backward: Likewise. + * timezone/europe: Likewise. + * timezone/leapseconds: Likewise. + * timezone/iso3166.tab: Likewise. + * timezone/zone.tab: Likewise. + +2002-01-23 Richard Henderson + + * sysdeps/alpha/Makefile (pic-ccflag): New variable. + +2002-01-28 Ulrich Drepper + + * string/strxfrm.c: Allocate one more byte for rulearr and clear + this element [PR libc/2855]. + + * string/strcoll.c: Handle zero-length arguments specially + [PR libc/2856]. + +2002-01-23 Jakub Jelinek + + * string/bits/string2.h (__mempcpy): For gcc 3.0+, don't use + __mempcpy_small but instead use __builtin_memcpy ( , , n) + n for + short lengths and constant src. + (strcpy): Don't optimize for gcc 3.0+. + (__stpcpy): For gcc 3.0+, don't use + __stpcpy_small but instead use __builtin_strcpy (, src) + strlen (src) + for short string literal src. + +2002-01-23 Jeroen Dobbelaere + + * sysdeps/unix/sysv/linux/configure.in (libc_cv_gcc_unwind_find_fde): + Set for arm, too. + +2001-01-22 Paul Eggert + + * manual/llio.texi (Linked Channels, Cleaning Streams): + Make it clearer that a just-opened input stream might need cleaning. + +2002-01-21 H.J. Lu + + * sysdeps/mips/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC): + Don't use label at end of compound statement. + +2002-01-28 Stephen L Moshier + + * sysdeps/ieee754/ldbl-96/e_lgammal_r.c (__ieee754_lgammal_r): + Remove test for negative integer arg; sin_pi does it correctly. + +2002-01-20 Ulrich Drepper + + * nscd/Makefile (distribute): Filter out xmalloc.c. + +2002-01-19 Ulrich Drepper + + * libio/fileops.c (_IO_file_underflow_mmap): Don't define as static. + Set offset if read end wasn't the buffer end. + (_IO_file_seekoff_mmap): New function. + (_IO_file_xsgetn_mmap): New function. + (_IO_file_jumps_mmap): Use the two new functions. + * libio/wfileops.c (_IO_wfile_underflow_mmap): Handle end read buffer + != end buffer. + * libio/libioP.h: Declare _IO_file_seekoff_mmap and + _IO_file_underflow_mmap. + * libio/iofopen.c: Don't position file descriptor at end of file. + * libio/tst-widetext.c: Improve error messages. + * stdio-common/tst-rndseek.c: Likewise. + +2002-01-18 Ulrich Drepper + + * sysdeps/unix/sysv/linux/bits/statvfs.h: Avoid warning about comma at + end of enum for !_GNU_SOURCE. + * sysdeps/unix/sysv/linux/alpha/bits/statvfs.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/bits/statvfs.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/bits/statvfs.h: Likewise. + * sysdeps/mach/hurd/bits/statvfs.h: Don't define non-standard ST_* + values unless _GNU_SOURCE. + + * iconvdata/tcvn5712-1.c: Minor cleanups. + 2002-01-18 Andreas Schwab * sysdeps/unix/sysv/linux/configure.in (libc_cv_gcc_unwind_find_fde): Set for m68k, too. +2002-01-16 Roger Sayle + + * stdlib/msort.c (msort_with_tmp): Replace implementation with + more efficient "Towers of Hanoi" mergesort. + (hanoi_sort, hanoi_sort_int, hanoi_sort_long): New functions, + for generic, sizeof(int) and sizeof(long) variants respectively. + 2002-01-17 Ulrich Drepper + * manual/syslog.texi (openlog): Describe possible problems with + first parameter. + Patch by Christopher Allen Wing . + * nscd/nscd.c (drop_privileges): Removed. Adjust caller. * nscd/connections.c (begin_drop_privileges): New function. (finish_drop_privileges): New function. (nscd_init): Call the new functions which also install all groups for the server user. + * nscd/Makefile (nscd-modules): Add xmalloc for nscd. Patch by Christopher Allen Wing . +2002-01-17 H.J. Lu + + * sysdeps/mips/dl-machine.h (__dl_runtime_resolve): Remove + `const' from `got'. + 2002-01-17 Martin Schwidefsky * sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S: Use 64 bit @@ -24,7 +10853,7 @@ __uint128_t build-in. * sysdeps/unix/sysv/linux/configure.in: Fix check for S390 and - PowerPC. + PowerPC, sync with 2.2 branch. 2002-01-16 Ulrich Drepper @@ -50,6 +10879,11 @@ * sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed: Fix regexp to reliably remove "-ia64" from rtld name. +2002-01-16 Ulrich Drepper + + * iconvdata/gb18030.c: Bug fixes and support for more characters. + Patch by Yu Shao . + 2002-01-16 Martin Schwidefsky * sysdeps/unix/sysv/linux/s390/swapcontext.c: Remove. @@ -60,18 +10894,18 @@ * sysdeps/s390/fpu/libm-test-ulps: Update. -2002-01-11 Martin Schwidefsky +2002-01-11 Ulrich Drepper - * sysdeps/unix/sysv/linux/configure.in (libc_cv_gcc_unwind_find_fde): - Set for s390 and s390x architectures. - (arch_minimum_kernel): Set for s390 and s390x. - * sysdeps/unix/sysv/linux/s390/brk.c (__brk): Correct inline - assembly contraints. - * sysdeps/unix/sysv/linux/s390/profil-counter.h: Move/copy to ... - * sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h: ... here, - remove high order bit from the program counter. - * sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h: ... and here. - * sysdeps/unix/sysv/linux/s390/s390-64/Makefile: Add framestate. + * elf/elf.h: Update x86 relocations. + +2002-01-10 Ulrich Drepper + + * locale/programs/charmap.c (new_width): Check whether byte + sequences for both ends of range have the same length. + +2002-01-09 Jakub Jelinek + + * elf/elf.h (SHN_UNDEF): Remove duplicate definition. 2002-01-09 Jakub Jelinek @@ -84,29 +10918,8 @@ * sysdeps/generic/group_member.c (__group_member): Also check groups[0] [PR libc/2781]. -2001-12-02 Roland McGrath - - * mach/Makefile, mach/Machrules: Move comments out of \ continuations. - - * hurd/hurd.h (__hurd_fail): Add `break;' to silence new gcc-3 warning. - Reported by Jeff Bailey . - - * hurd/hurd.h (_hurd_umask): Remove volatile qualifier from decl. - Reported by Jeff Bailey . - - * mach/Makefile ($(objpfx)mach-syscalls.mk): Pass $(CFLAGS) to $(CC). - * mach/Machrules ($(objpfx)%.udeps static pattern rule): Likewise. - Reported by Jeff Bailey . - -2002-01-07 Roland McGrath - - * sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup): Use - volatile on type of ARGC so the compiler doesn't get clever. - 2002-01-08 Ulrich Drepper - * version.h (VERSION): Bump to 2.2.5. - * Makefile (distribute): Add scripts/cpp. * elf/Makefile (distribute): Add reldep6mod[01234].c, unwind-dw2.c, unwind-dw2-fde.c, unwind.h, unwind-pe.h, @@ -116,6 +10929,11 @@ * sysdeps/unix/sysv/linux/ia64/Dist: Add ldd-rewrite.sed. * sysdeps/unix/sysv/linux/s390/Dist: Likewise. +2002-01-07 Roland McGrath + + * sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup): Use + volatile on type of ARGC so the compiler doesn't get clever. + 2002-01-07 Andreas Jaeger * sysdeps/generic/bits/byteswap.h: Prevent double inclusion. @@ -123,12 +10941,25 @@ * sysdeps/ia64/bits/byteswap.h: Likewise. * sysdeps/m68k/bits/byteswap.h: Likewise. * sysdeps/s390/s390-32/bits/byteswap.h: Likewise. - * sysdeps/s390/s390-64/bits/byteswap.h: Likewise. + * sysdeps/s390/s390-64/bits/byteswap.h: Likewise [PR libc/2757]. 2002-01-02 Bruno Haible * intl/plural.y: Fix %expect count. +2002-01-03 Jakub Jelinek + + * elf/Makefile (routines, shared-only-routines): Add + unwind-dw2-fde-glibc instead of unwind-dw2-fde. + * elf/elf.h (PT_GNU_EH_FRAME): Define. + * sysdeps/generic/unwind-dw2-fde-glibc.c: New file. + * sysdeps/generic/unwind-dw2-fde.c (__register_frame_info_bases): + Optimize if .eh_frame section contains no FDEs. + (__register_frame, __deregister_frame_info_bases, + __deregister_frame): Likewise. + * sysdeps/generic/unwind-dw2.c (execute_cfa_program): Fix + DW_CFA_restore handling. + 2002-01-07 Stephen L Moshier * sysdeps/ieee754/ldbl-96/s_erfl.c (erfcl): Fix K&R header. @@ -137,31 +10968,263 @@ for x < 0.25 and restore original range reduction method. (__ieee754_lgammal_r): Make sure signgam is set before returning. +2002-01-07 Ulrich Drepper + + * libio/fileops.c (_IO_file_underflow_mmap): New function. + (_IO_file_close_mmap): New function. + (_IO_file_jumps_mmap): New variable. + * libio/wfileops.c (_IO_wfile_underflow): Reset read pointer before + trying to convert rest of byte buffer. + (_IO_wfile_underflow_mmap): New function. + (_IO_wfile_jumps_mmap): New variable. + * libio/iofopen.c (__fopen_maybe_mmap): New function. + (__fopen_internal): New function. Split out from _IO_new_fopen. + (_IO_new_fopen): Call __fopen_internal. + * libio/iofopen64.c: Just call __fopen_internal. + * libio/iofdopen.c: Call __fopen_maybe_mmap before returning + successfully. + * libio/iolibio.h: Declare __fopen_internal and __fopen_maybe_mmap. + * libio/libioP.h: Declare _IO_file_jumps_mmap, _IO_wfile_jumps_mmap, + _IO_file_close_mmap. + + * sysdeps/gnu/_G_config.h: Define _G_MMAP64. + * sysdeps/unix/sysv/linux/cris/_G_config.h: Likewise. + + * stdio-common/Makefile (tests): Add tst-rndseek. + * stdio-common/tst-rndseek.c: New file. + +2002-01-05 Roland McGrath + + * config.h.in (HAVE_MIG_RETCODE): New #undef. + * sysdeps/mach/hurd/configure.in (hurd_MIG_RETCODE: New macro + swiped from hurd package's aclocal.m4; use it to set HAVE_MIG_RETCODE. + * sysdeps/mach/hurd/configure: Regenerated. + +2002-01-03 Ulrich Drepper + + * elf/elf.h: Add more TLS definitions. + +2002-01-02 Ulrich Drepper + + * include/features.h (__GLIBC_MINOR__): Bump to 3. + +2002-01-02 Roland McGrath + + * sysdeps/mach/hurd/sigwait.c (__sigwait): Use __sigandset, + __sigisemptyset. Don't use MASK uninitialized. + + * sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Use __sigorset. + * hurd/hurdinit.c (_hurd_new_proc_init): Use __sigisemptyset. + * hurd/hurdsig.c (_hurd_internal_post_signal): Use __sigismember, + __sigdelset, __sigaddset, __sigorset. + + * sysdeps/generic/htonl.c: Use uint32_t instead of u_int32_t. + * sysdeps/generic/htons.c: Use uint16_t instead of u_int16_t. + + * hurd/hurdinit.c (_hurd_ports_use): Return EGRATUITOUS when + _hurd_ports is null. + + * hurd/hurdsig.c (_hurdsig_init): Conditionalize exception port setup + for old CMU and new OSF Mach interface flavors. + * hurd/hurdfault.c (_hurdsig_fault_init): Likewise. + * sysdeps/mach/hurd/fork.c (__fork): Likewise. + + * hurd/hurdsig.c (_hurd_internal_post_signal): Leave msgh_seqno unset. + + * sysdeps/mach/hurd/spawni.c (__spawni) [KERN_INVALID_LEDGER]: + Pass extra arguments to task_create for OSF variant. + * sysdeps/mach/hurd/fork.c (__fork): Likewise. + + * sysdeps/powerpc/elf/libc-start.c: Make AUXVEC diddling code + conditional on [HAVE_AUX_VECTOR]. + + * mach/mach/mach_traps.h (thread_switch, __thread_switch): Use + mach_msg_timeout_t as type of final argument. + + * hurd/privports.c (__get_privileged_ports): + Change host_priv_t to mach_port_t in argument type. + * hurd/hurd.h (get_privileged_ports, __get_privileged_ports): + Update decls. + + * sysdeps/mach/hurd/i386/bits/sigcontext.h: Protect from + multiple inclusion. Inhibit #error under [_SYS_UCONTEXT_H]. + * sysdeps/mach/hurd/alpha/bits/sigcontext.h: Likewise. + * sysdeps/mach/hurd/hppa/bits/sigcontext.h: Likewise. + * sysdeps/mach/hurd/mips/bits/sigcontext.h: Likewise. + * sysdeps/mach/hurd/powerpc/bits/sigcontext.h: Likewise. + +2002-01-01 Roland McGrath + + * sysdeps/mach/hurd/errnos.awk: Tighten up device_types.h matching. + +2002-01-01 Ulrich Drepper + + * include/stdlib.h: Define inlines for the _l variants of the strto* + functions. + +2002-01-01 Roland McGrath + + * sysdeps/mach/hurd/powerpc/intr-msg.h: Remove extraneous backslash. + + * mach/Machrules (MIG): Set CPP as well as CC. + 2001-12-31 Ulrich Drepper * sysdeps/unix/sysv/linux/getloadavg.c (getloadavg): Always use C locale to parse /proc/loadavg [PR libc/2760]. +2001-12-31 Jakub Jelinek + + * elf/dl-conflict.c: Include sys/param.h. + (RESOLVE_CONFLICT_FIND_MAP): Cast r_offset to ElfW(Addr). + * sysdeps/alpha/dl-machine.h (elf_machine_runtime_setup): Avoid + warning. + (TRAMPOLINE_TEMPLATE, RTLD_START): Don't use multi-line string + literals to avoid warnings. + +2001-12-31 Andreas Jaeger + + * configure.in: Don't check for gsed since we do not use it anywhere. + +2001-12-25 Dmitry V. Levin + + * io/fts.c: Update from BSD to fix memory leaks. + +2001-12-25 Dmitry V. Levin + + * crypt/md5-crypt.c: Realloc error handling memory leak fix. + * elf/chroot_canon.c: Likewise. + * elf/dl-object.c: Likewise. + * iconv/iconv_charmap.c: Likewise. + * iconv/iconv_prog.c: Likewise. + * libio/iogetdelim.c: Likewise. + * locale/lc-time.c: Likewise. + * stdlib/canonicalize.c: Likewise. + * sunrpc/svc.c: Likewise. + * sysdeps/generic/glob.c: Likewise. + +2001-12-19 Martin Schwidefsky + + * sysdeps/unix/sysv/linux/s390/profil-counter.h: Move/copy to ... + * sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h: ... here, + remove high order bit from the program counter. + * sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h: ... and here. + +2001-12-19 Martin Schwidefsky + + * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Remove + unnecessary code and add missing reloc types. + * sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela): Add empty + case for reloc type R_390_NONE. + +2001-12-28 Andreas Jaeger + + * io/bug-ftw3.c: Include string.h for prototypes. + + * crypt/md5test.c (main): Remove unused variable. + + * dlfcn/modstatic.c: Add prototype to avoid warning. + +2001-12-26 Roland McGrath + + * sysdeps/mach/hurd/sigwait.c (__sigwait): When returning immediately, + check only (SS->pending & MASK) for the signal to return. + From Jeroen Dekkers . + 2001-12-22 Roland McGrath + * iconv/skeleton.c [!RESET_INPUT_BUFFER && !SAVE_RESET_STATE]: + Use preprocessor #if conditionals instead of `if' to avoid + warnings about divide by zero in dead code. + * hurd/Versions (libc: GLIBC_2.2.5): Add _hurd_port_set, _hurd_port_init, and __hurd_self_sigstate. * mach/Versions (libc: GLIBC_2.2.5): Add mig_strncpy. +2001-12-21 Andreas Jaeger + + * elf/dblloadmod1.c: Add prototype to avoid warning. + * elf/dblloadmod2.c: Likewise. + * elf/dblloadmod3.c: Likewise. + * elf/reldepmod5.c: Likewise. + * elf/reldepmod6.c: Likewise. + + * elf/dl-conflict.c (_dl_resolve_conflicts): Add unused attribute + for resolve_conflict_map since RESOLVE_CONFLICT_FIND_MAP is not + used on all architectures. + + * sunrpc/svc_tcp.c: Add noreturn attribute for + svctcp_rendezvous_abort. + * sunrpc/svc_unix.c: Likewise for svcunix_rendezvous_abort. + + * sysdeps/generic/strstr.c (strstr): Add paranthese for assignment + to avoid warning. + +2001-12-19 Jakub Jelinek + + * manual/llio.texi (aio_fsync): Fix a typo. + Patch by Tammy Fox . + 2001-12-18 Jakub Jelinek * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (clone): Subtract stack bias from child stack pointer before passing it to clone syscall. +2001-12-18 Ulrich Drepper + + * sysdeps/posix/sysconf.c (__sysconf): Respect POSIX minimum for + _SC_TZNAME_MAX. + * sysdeps/generic/sysconf.c (__sysconf): Likewise. + Reported by Thorsten Kukuk . + + * sysdeps/unix/grantpt.c (grantpt): Correct typo in comment and + add some casts. + + * sysdeps/unix/sysv/linux/grantpt.c: Make __unix_grantpt static. + +2001-12-18 Thorsten Kukuk + + * sysdeps/unix/sysv/linux/grantpt.c: Make errno results standard + conforming: return EBADF if file descriptor is invalid and EINVAL + if file descriptor is no valid tty. + * login/tst-grantpt.c: New file. + * login/Makefile (tests): Add tst-grantpt. + +2001-12-17 Ulrich Drepper + + * io/ftw.c (ftw_dir): Handle inaccessibility of toplevel dir + different than implemented in last patch. + * io/bug-ftw3.c: Adjust test for changed handling of + inaccessibility of toplevel dir. + +2001-12-16 Roland McGrath + + * nss/nsswitch.c (__nss_next): Don't use __FUNCTION__ as literal. + * grp/initgroups.c (internal_getgrouplist): Likewise. + + * hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Add `break' after + `default:' to silence new GCC warning. + Rewrite cast of lvalue to silence new GCC warning. + + * sysdeps/mach/hurd/i386/init-first.c: Avoid multi-line strings in asm. + + * sysdeps/mach/hurd/spawni.c: New file, by me with a + couple fixes by Neal H Walfield . + 2001-12-14 Ulrich Drepper + * sysdeps/generic/strstr.c (strstr): Update. New optimized version. + Patch by Stephen R. van den Berg. + * crypt/md5.h: Define md5_uintptr. -2001-11-29 Andreas Jaeger +2001-12-13 Ulrich Drepper - * sysdeps/unix/sysv/linux/x86_64/Versions: Add arch_prctl. - * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Add arch_prctl call. + * libio/tst_swprintf.c (main): Add test for string argument with + zero precision. + * stdio-common/Makefile (tests): Add tst-sprintf. + * stdio-common/tst-sprintf.c: New file. 2001-12-13 Andreas Schwab @@ -178,6 +11241,9 @@ * crypt/md5.c (md5_process_bytes): Correct handling of alignment. Patch by Eric Sharkey . + * crypt/md5test.c (main): Add test for multiple calls to + __md5_process_bytes to itererate over input string. + 2001-12-12 Ulrich Drepper * nis/nis_findserv.c (__nis_findfastest_with_timeout): Mostly the code @@ -191,11 +11257,126 @@ * configure.in: Use -nostartfiles -nostdlib for linker tests, fix combreloc test so that it works in this case. + * sysdeps/arm/dl-machine.h (elf_machine_rela): Fix typo in last patch. + +2001-12-12 NIIBE Yutaka + + * sysdeps/sh/Makefile: New file. + * sysdeps/sh/_mcount.S: New file. + * sysdeps/sh/sysdep.h (CALL_MCOUNT): Implemented. + * sysdeps/sh/machine-gmon.h: Remove "NOTYET" comment, as we are ready. + 2001-12-11 Ulrich Drepper * resolv/nss_dns/dns-host.c (getanswer_r): Remove MAX_NR_ADDRS limitation [PR libc/2564]. +2001-12-11 Jakub Jelinek + + * elf/Makefile (dl-routines): Add conflict. + (rtld-ldscript-in, rtld-ldscript, rtld-parms): Remove. + (ld.so): Add _begin local symbol. + * elf/elf.h (DT_VALTAGIDX, DT_VALNUM, DT_ADDRTAGIDX, DT_ADDRNUM): + Define. + * elf/dl-deps.c (_dl_build_local_scope): New function. + (_dl_map_object_deps): If LD_TRACE_PRELINKING, compute local scopes + of all libraries. + * elf/do-rel.h (VALIDX): Define. + (elf_dynamic_do_rel): If ELF_MACHINE_PLT_REL is defined, don't do + lazy binding for RELA. If DT_GNU_PRELINKED, DT_RELACOUNT relocations + can be skipped. + * elf/dl-conflict.c: New file. + * elf/dl-lookup.c (_dl_debug_bindings): New function. + (_dl_lookup_symbol): Use _dl_debug_bindings. Reference_name is always + non-NULL. + (_dl_lookup_symbol_skip): Likewise. + (_dl_lookup_versioned_symbol): Likewise. + (_dl_lookup_versioned_symbol_skip): Likewise. + * elf/dl-runtime.c (PLTREL): If ELF_MACHINE_PLT_REL is defined, + define to ElfW(Rel). + * elf/dynamic-link.h (elf_get_dynamic_info): Record selected dynamic + tags in the DT_VALRNGLO..DT_VALRNGHI and DT_ADDRRNGLO..DT_ADDRRNGHI + ranges. + Don't adjust address dynamic tags if l_addr is 0. + * elf/rtld.c (_dl_trace_prelink, _dl_trace_prelink_map): New variables. + (_dl_start): Skip ELF_DYNAMIC_RELOCATE if ld.so is prelinked. + (VALIDX, ADDRIDX): Define. + (_dl_start_final): Initialize _dl_rtld_map's l_map_start and l_map_end. + (dl_main): Print library list for LD_TRACE_PRELINKING. + If prelinking information can be used, skip relocating libraries and + call _dl_resolve_conflicts instead. + (process_envvars): Handle LD_TRACE_PRELINKING envvar. + * elf/dl-load.c (_dl_map_object): Don't create fake libs + if LD_TRACE_PRELINKING. + * include/link.h (struct link_map) [l_info]: Add DT_VALNUM + + DT_ADDRNUM. + * sysdeps/generic/ldsodefs.h (_dl_trace_prelink_map): New declaration. + (DL_DEBUG_PRELINK): Define. + (_dl_resolve_conflicts): Add prototype. + + * sysdeps/alpha/dl-machine.h (elf_machine_runtime_setup): Reinitialize + .plt for prelinked libraries where prelinking info cannot be used. + (elf_machine_rela): If relocating R_ALPHA_JMP_SLOT in .gnu.conflict + section, use RESOLVE_CONFLICT_FIND_MAP to find out reloc's link_map. + * sysdeps/arm/bits/link.h: New file. + * sysdeps/arm/dl-machine.h (elf_machine_runtime_setup): Save original + content of .got[1]. + (ELF_MACHINE_NO_RELA): Only define if RTLD_BOOTSTRAP. + (ELF_MACHINE_PLT_REL): Define. + (elf_machine_rela, elf_machine_rela_relative): New functions. + (elf_machine_lazy_rel): Reinitialize R_ARM_JUMP_SLOT address instead + of adjusting it if prelinked and prelinking cannot be used. + * sysdeps/i386/bits/link.h: New file. + * sysdeps/i386/dl-machine.h (elf_machine_runtime_setup): Save original + content of .got[1]. + (ELF_MACHINE_NO_RELA): Only define if RTLD_BOOTSTRAP. + (ELF_MACHINE_PLT_REL): Define. + (elf_machine_rela, elf_machine_rela_relative): New functions. + (elf_machine_lazy_rel): Reinitialize R_386_JUMP_SLOT address instead + of adjusting it if prelinked and prelinking cannot be used. + * sysdeps/powerpc/dl-machine.h (elf_machine_rela): If relocating + conflicts, skip finaladdr computation. Use RESOLVE_CONFLICT_FIND_MAP + to find out map for R_PPC_JMP_SLOT relocs. + * sysdeps/sparc/sparc32/dl-machine.h (VALIDX): Define. + (OPCODE_BA): Define. + (elf_machine_runtime_setup): Reinitialize .plt for prelinked + libraries where prelinking info cannot be used. + (sparc_fixup_plt): Renamed from elf_machine_fixup_plt. + (elf_machine_fixup_plt): Call sparc_fixup_plt. + (elf_machine_rela): Set value to 0 if relocating conflicts. + Call sparc_fixup_plt for R_SPARC_JMP_SLOT. + * sysdeps/sparc/sparc64/dl-machine.h (VALIDX): Define. + (sparc64_fixup_plt): Fix a typo. + (elf_machine_rela): Set value to 0 if relocating conflicts. + Handle R_SPARC_JMP_SLOT relocs when relocating conflicts. + (elf_machine_runtime_setup): Reinitialize .plt for prelinked + libraries where prelinking info cannot be used. + * sysdeps/sh/bits/link.h: New file. + * sysdeps/sh/dl-machine.h (elf_machine_runtime_setup): Save original + content of .got[1]. + (elf_machine_lazy_rel): Reinitialize R_SH_JMP_SLOT address instead + of adjusting it if prelinked and prelinking cannot be used. + * sysdeps/s390/s390-32/bits/link.h: New file. + * sysdeps/s390/s390-32/dl-machine.h (elf_machine_runtime_setup): + Save original content of .got[1]. + (elf_machine_lazy_rel): Reinitialize R_390_JMP_SLOT address instead + of adjusting it if prelinked and prelinking cannot be used. + * sysdeps/s390/s390-64/bits/link.h: New file. + * sysdeps/s390/s390-64/dl-machine.h (elf_machine_runtime_setup): + Save original content of .got[1]. + (elf_machine_lazy_rel): Reinitialize R_390_JMP_SLOT address instead + of adjusting it if prelinked and prelinking cannot be used. + * sysdeps/x86_64/bits/link.h: New file. + * sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup): + Save original content of .got[1]. + (elf_machine_lazy_rel): Reinitialize R_X86_64_JMP_SLOT address instead + of adjusting it if prelinked and prelinking cannot be used. + +2001-12-11 Ulrich Drepper + + * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): Use sizeof + where appropriate instead of numbers. Little optimizations. + 2001-12-10 Roland McGrath * sysdeps/mach/hurd/bind.c (bind): Don't deallocate IFSOCK if we never @@ -214,27 +11395,187 @@ 2001-12-10 Ulrich Drepper + * io/Makefile (tests): Add bug-ftw3. + * io/bug-ftw3.c: New file. + * sysdeps/generic/glob.c (glob): Return only pattern if nothing matches and GLOB_NOCHECK is set. * posix/globtest.sh: Correct expected result for NOCHECK test. * po/ca.po: Update from translation team. +2001-12-09 Ulrich Drepper + + Implement transliteration of characters in strings of the locale + definitions. + * locale/programs/linereader.c: Adjust for additional parameter to + lr_token. + (get_string): If character is not found try to transliterate + it. + * locale/programs/ld-ctype.c: Adjust for additional parameter to + lr_token. Add const to charmap parameter of all functions. + (find_translit, find_translit2): New functions. + * locale/programs/charmap.c: Adjust for additional parameter to + lr_token. + * locale/programs/repertoire.c: Likewise. + * locale/programs/linereader.h: Likewise. + * locale/programs/ld-address.c: Likewise. Add const to charmap + parameter of all functions. + * locale/programs/ld-collate.c: Likewise. + * locale/programs/ld-identification.c: Likewise. + * locale/programs/ld-measurement.c: Likewise. + * locale/programs/ld-messages.c: Likewise. + * locale/programs/ld-monetary.c: Likewise. + * locale/programs/ld-name.c: Likewise. + * locale/programs/ld-numeric.c: Likewise. + * locale/programs/ld-paper.c: Likewise. + * locale/programs/ld-paper.c: Likewise. + * locale/programs/ld-telephone.c: Likewise. + * locale/programs/ld-time.c: Likewise. + * locale/programs/locfile.c: Likewise. + * locale/programs/localedef.c: Likewise. + * locale/programs/localedef.h: Likewise. + * locale/programs/locfile.h: Likewise. Add declaration for + find_translit. + * locale/programs/simple-hash.c: Add const to first parameter of + find_entry, iterate_table, and lookup. + * locale/programs/simple-hash.h: Likewise. + * locale/localeinfo.h: Don't define __LC_LAST here. Include + instead. + * include/locale.h: Define __LC_LAST. + * iconv/Makefile (CFLAGS-linereader.c): Define to -DNO_TRANSLITERATION. + +2001-12-07 Geoff Keating + + * sysdeps/powerpc/Dist: Update for recent FP changes. + * sysdeps/powerpc/fpu/Dist: Likewise. + +2001-12-07 Andreas Schwab + + * sysdeps/unix/sysv/linux/opensock.c: Include . + +2001-12-06 Geoff Keating + + * sysdeps/powerpc/Makefile (sysdep_routines): Don't build the fpr + save/restore functions here. + (libm-support): Don't define these functions here. + * sysdeps/powerpc/fpu/Makefile: Build the fpr save/restore + functions here. + * sysdeps/powerpc/fe_nomask.c: Move to... + * sysdeps/powerpc/fpu/fe_nomask.c: ... here. + * sysdeps/powerpc/fprrest.S: Move to... + * sysdeps/powerpc/fpu/fprrest.S: ... here. + * sysdeps/powerpc/fprsave.S: Move to... + * sysdeps/powerpc/fpu/fprsave.S: ... here. + +2001-12-06 Ulrich Drepper + + * sysdeps/unix/sysv/linux/opensock.c: New file. + +2001-12-06 Geoff Keating + + * config.make.in (with-fp): Define from configure. + * configure.in: Substitute with_fp. + * configure: Regenerate. + * sysdeps/powerpc/Makefile: Set -msoft-float when --without-fp is + specified, and don't change FPU environment. + +2001-12-06 Ulrich Drepper + + * libio/vasprintf.c (_IO_vasprintf): Free buffer on failure. + * assert/assert.c: Check result of __asprintf call and don't use + string if it failed. + * assert/assert-perr.c: Likewise. + * inet/rcmd.c: Likewise. + * locale/programs/localedef.c (main): Check result of + construct_output_path and exit if it failed. + (construct_output_path): Check result of asprintf and mkdir calls and + fail if they failed. + * posix/getopt.c: Check result of __asprintf calls and fail if + they failed. + Patch by Dmitry V. Levin . + 2001-12-05 Ulrich Drepper + * sysdeps/generic/strcasecmp.c (__strcasecmp): Little performance + patch. + * sysdeps/generic/strncase.c: Likewise. + * string/tester.c: Add tests for strcasecmp and strncasecmp. + +2001-12-05 Geoff Keating + + * scripts/cpp: Test the exit status from 'type', not 'awk'. + + * sysdeps/powerpc/__longjmp.S: Don't restore FP registers. + * sysdeps/powerpc/fpu/__longjmp.S: Do restore FP registers. + * sysdeps/powerpc/setjmp.S: Don't save FP registers. + * sysdeps/powerpc/fpu/setjmp.S: Do save FP registers. + * sysdeps/powerpc/fclrexcpt.c: Move to... + * sysdeps/powerpc/fpu/fclrexcpt.c: ... here. + * sysdeps/powerpc/fpu_control.h: Move to... + * sysdeps/powerpc/fpu/fpu_control.h: ... here. + +2001-12-05 Ulrich Drepper + + * iconvdata/ibm1129.h: Remove duplicate mappings. + * iconvdata/ibm937.c: Handle overflow errors. Handle new tables. + * iconvdata/ibm937.h: Reorganize table to safe a lot of space. + Patch by Masahide Washizawa . + * timezone/zic.c: Fix handling of turnaround times. Patch by Arthur David Olson . +2001-12-02 Moshe Olshansky + + * sysdeps/ieee754/dbl-64/e_remainder.c (__ieee754_remainder): Fix + overflow problem. + +2001-12-05 Ulrich Drepper + + * posix/regex.c: For use outside glibc defined bounded pointer + macros here. Patch by Jim Meyering . + + * iconvdata/Makefile (modules): Add TCVN5712-1. + * iconvdata/TESTS: Add TCVN5712-1. + * iconvdata/gconv-modules: Likewise. + * iconvdata/tcvn5712-1.c: New file. + * iconvdata/testdata/TCVN-5712: New file. + * iconvdata/testdata/TCVN-5712..UTF8: New file. + +2001-12-04 Ulrich Drepper + + * iconvdata/cp1258.c: Optimize conversion from UCS4. + +2001-12-02 Roland McGrath + + * mach/Makefile, mach/Machrules: Move comments out of \ continuations. + + * hurd/hurd.h (__hurd_fail): Add `break;' to silence new gcc-3 warning. + Reported by Jeff Bailey . + + * hurd/hurd.h (_hurd_umask): Remove volatile qualifier from decl. + Reported by Jeff Bailey . + + * mach/Makefile ($(objpfx)mach-syscalls.mk): Pass $(CFLAGS) to $(CC). + * mach/Machrules ($(objpfx)%.udeps static pattern rule): Likewise. + Reported by Jeff Bailey . + 2001-12-01 Roland McGrath * sysdeps/mach/hurd/configure.in (libc_cv_gcc_unwind_find_fde): Add missing backslash in test arguments. * sysdeps/mach/hurd/configure: Regenerated. -2001-12-02 Moshe Olshansky +2001-11-26 Roland McGrath - * sysdeps/ieee754/dbl-64/e_remainder.c (__ieee754_remainder): Fix - overflow problem. + * hurd/hurdinit.c (_hurd_ports_use): Check if _hurd_ports is null. + Reported by John Tobey . + +2001-11-30 Ulrich Drepper + + * iconvdata/Makefile (modules): Add ARMSCII-8. + * iconvdata/gconv-modules: Add entries for ARMSCII-8. + * iconvdata/armscii-8.c: New file. 2001-11-29 Jakub Jelinek @@ -243,8 +11584,58 @@ Patch by Flavio Veloso . * posix/globtest.sh: Add new tests. +2001-11-29 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/Versions: Add arch_prctl. + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Add arch_prctl call. + + * sysdeps/generic/abort.c: Include libioP.h for + _IO_flush_all_lockp prototype. + +2001-11-29 Ulrich Drepper + + * posix/regex.h: Define __restrict_arr correctly. + 2001-11-28 Ulrich Drepper + * iconvdata/ibm1163.c: New file. + * iconvdata/ibm1163.h: New file. + * iconvdata/ibm1164.c: New file. + * iconvdata/ibm1164.h: New file. + * iconvdata/TESTS: Add entries for IBM1163 and IBM1164. + * iconvdata/Makefile: Likewise. + * iconvdata/testdata/IBM1163: New file. + * iconvdata/testdata/IBM1163..UTF8: New file. + * iconvdata/testdata/IBM1164: New file. + * iconvdata/testdata/IBM1164..UTF8: New file. + Patch by Masahide Washizawa . + + * iconvdata/ibm1046.h: Optimize. Remove duplicate mappings. + * iconvdata/ibm1124.h: Likewise. + * iconvdata/ibm1132.h: Likewise. + * iconvdata/ibm1133.h: Likewise. + * iconvdata/ibm1160.h: Likewise. + * iconvdata/ibm1161.h: Likewise. + * iconvdata/ibm1162.h: Likewise. + * iconvdata/ibm856.h: Likewise. + * iconvdata/ibm922.h: Likewise. + * iconvdata/ibm930.h: Likewise. + * iconvdata/ibm932.h: Likewise. + * iconvdata/ibm933.h: Likewise. + * iconvdata/ibm935.h: Likewise. + * iconvdata/ibm937.h: Likewise. + * iconvdata/ibm939.h: Likewise. + * iconvdata/ibm943.h: Likewise. + * iconvdata/ibm930.c: Pretty printing. + * iconvdata/ibm937.c: Avoid access accross array boundary. + + * iconv/gconv_open.c (__gconv_open): Empty codeset name now means using + the current locale's codeset. + * iconv/iconv_open.c (iconv_open): Don't strip out everything for + empty input string. + * iconv/iconv_prog.c: Pass empty strings as default value for to- + and from-charset. Don't determine locale's charset here. + * libio/genops.c (_IO_flush_all_lockp): New function. The same code as the old _IO_flush_all but lock only if parameter is nonzero. (_IO_flush_all): Call _IO_flush_all_lockp with 1 as parameter. @@ -268,11 +11659,161 @@ overflow test for platforms with signed char. Reported by Andrew Haley . +2001-11-28 Bruno Haible + + * locale/programs/simple-hash.c (lookup_2): Remove function. + (insert_entry_2): Call lookup instead of lookup_2. + +2001-03-04 Bruno Haible + + * intl/dcigettext.c (DCIGETTEXT): Increment path_max proportionally. + +2001-10-31 Bruno Haible + + * intl/plural.y: Include , needed for NULL with SunOS 4 cc. + +2001-03-21 Bruno Haible + + * intl/dcigettext.c (_nl_state_lock): Mark as #ifdef _LIBC. AIX 3 xlc + chokes on empty macro arguments. + * intl/plural.y: Add #pragma for alloca on AIX 3. + +2001-11-27 Ulrich Drepper + + * intl/dcigettext.c (guess_category_value): Only implement for + glibc. Otherwise rely on function _nl_locale_name which isn't + present in the glibc sources. + +2001-09-24 Bruno Haible + + * intl/loadmsgcat.c (_nl_init_domain_conv): Also enable + transliteration when building on a glibc system but outside glibc. + +2001-09-22 Bruno Haible + + * intl/plural-eval.c: New file, extracted from dcigettext.c. + * intl/dcigettext.c (plural_eval): Remove function, moved to + intl/plural-eval.c. + (plural_lookup): Call PLURAL_EVAL instead of plural_eval. + Include plural-eval.c. + +2001-09-22 Bruno Haible + + * intl/plural-exp.c (EXTRACT_PLURAL_EXPRESSION): Reject numbers that + don't start with a digit; nplurals must be positive. + +2001-09-02 Bruno Haible + + * intl/plural-exp.h: New file, extracted from gettextP.h. + * intl/plural-exp.c: New file, extracted from loadmsgcat.c. + * intl/gettextP.h (struct expression, struct parse_args, + __gettext_free_exp, __gettextparse): Move to plural-exp.h. + * intl/loadmsgcat.c: Include plural-exp.h. + (PLURAL_PARSE): Move macro to plural-exp.h. + (plvar, plone, germanic_plural, INIT_GERMANIC_PLURAL): Move to + plural-exp.c. + (_nl_load_domain): Move plural handling code to plural-exp.c. Call + EXTRACT_PLURAL_EXPRESSION. + (_nl_unload_domain): Update. + * intl/dcigettext.c: Include plural-exp.h. + * intl/plural.y: Include plural-exp.h, not gettextP.h. + (FREE_EXPRESSION): Move macro to plural-exp.h. + * intl/Makefile (routines): Add plural-exp. + (distribute): Add plural-exp.h. + +2001-07-28 Bruno Haible + + * intl/l10nflist.c (_nl_normalize_codeset): Cast isalnum, isalpha, + isdigit, tolower argument to 'unsigned char'. + * intl/loadmsgcat.c (_nl_load_domain): Cast isspace argument to + 'unsigned char'. + * intl/localealias.c (read_alias_file): Cast isspace argument to + 'unsigned char'. + +2001-10-20 Bruno Haible + + Assume strchr() exists. (Without it, intl/explodename.c wouldn't link + anyway.) + * intl/dcigettext.c (strchr): Remove fallback definition; it conflicts + with the variable 'index' in plural_lookup. + * intl/l10nflist.c (strchr): Likewise. + * intl/localealias.c (strchr): Likewise. + + Assume , , , exist. + * intl/bindtextdom.c: Likewise. + * intl/dcigettext.c: Likewise. + * intl/dgettext.c: Likewise. + * intl/dngettext.c: Likewise. + * intl/explodename.c: Likewise. + * intl/finddomain.c: Likewise. + * intl/gettext.c: Likewise. + * intl/l10nflist.c: Likewise. + * intl/loadmsgcat.c: Likewise. + * intl/localealias.c: Likewise. + * intl/ngettext.c: Likewise. + * intl/textdomain.c: Likewise. + * intl/gettext.h: Assume exists. + +2001-11-27 Ulrich Drepper + + * stdio-common/Makefile (tests): Add scanf11. + * stdio-common/scanf11.c: New file. + +2001-11-26 Ulrich Drepper + + * version.h (RELEASE): Define as development. + (VERSION): Set to 2.2.90. + +2001-11-22 Thorsten Kukuk + + * nis/nss_compat/compat-grp.c: Print group id as unsigned long. + * nis/nss_nis/nis-grp.c: Likewise. + * nis/nss_nisplus/nisplus-grp.c: Likewise. + + * nis/nss_compat/compat-pwd.c: Print user id as unsigned long. + * nis/nss_nis/nis-pwd.c: Likewise. + * nis/nss_nisplus/nisplus-pwd.c: Likewise. + + * nis/nss_nis/nis-publickey.c: Use strtoul instead of atoi. + * nis/nss_nisplus/nisplus-parser.c: Likewise. + * nis/nss_nisplus/nisplus-publickey.c: Likewise. + + * nscd/grpcache.c: Use strtoul instead of atol. + * nscd/pwdcache.c: Likewise. + * nss/getent.c: Likewise. + +2001-11-27 Paul Eggert + + * sysdeps/posix/tempname.c (__gen_tempname): Try at least + ATTEMPTS_MIN or TMP_MAX times, whichever is greater. + +2001-11-19 Bruno Haible + + * locale/programs/simple-hash.c (insert_entry_2): Resize at 75%, not + 90%. + (compute_hashval): Shift by 9 bits, not by 4 bits. This drastically + improves the quality of the hash function, especially for short + strings. + 2001-11-26 Ulrich Drepper * stdio-common/vfscanf.c: If incomplete nan of inf(inity) strings are found call conv_error and not input_error [PR libc/2669]. + * math/bits/mathcalls.h: Mark ceil and floor as const. + Reported by David Mosberger. + +2001-11-21 Jim Meyering + + * posix/regex.c (iswctype, mbrtowc, wcslen, wcscoll, wcrtomb) [_LIBC]: + Define to be __-prefixed. + Remove unnecessary duplication in `#ifdef _LIBC' blocks. + +2001-11-26 Andreas Jaeger + + * sysdeps/unix/sysv/linux/hppa/brk.c: Remove __brk_addr alias, + avoid warning. + 2001-11-26 Stephen L Moshier * sysdeps/ieee754/ldbl-128/e_log10l.c (L102B): Fix typo in @@ -292,6 +11833,37 @@ * sysdeps/ieee754/ldbl-128/e_j1l.c (neval, deval): Likewise, and include local math header files. +2001-11-22 Andreas Jaeger + + * sysdeps/ieee754/ldbl-96/s_ilogbl.c (__ilogbl): Add brace to + avoid warning. + +2001-11-21 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h: New file. + + * sysdeps/unix/sysv/linux/x86_64/Makefile (sysdep_headers): Add + sys/debugreg.h + +2001-11-15 Andreas Jaeger + + * include/features.h (__GLIBC_HAVE_LONG_LONG): Define for + compilers that support it. + + * posix/sys/types.h: Use __GLIBC_HAVE_LONG_LONG. + * sysdeps/unix/sysv/linux/bits/types.h: Likewise. + * stdlib/stdlib.h: Likewise. + +2001-11-17 Ulrich Drepper + + * posix/regex.c (byte_re_match_2_internal): For gcc replace switch + statement with gotos. + Based on a patch by Paolo Bonzini . + +2001-11-16 Stephen L Moshier + + * sysdeps/ieee754/ldbl-96/s_erfl.c (__erfcl): Fix K&R header. + 2001-11-15 Ulrich Drepper * sysdeps/generic/unwind-dw2-fde.c: Don't use recursive mutexes. @@ -1854,7 +13426,8 @@ 2001-08-23 Jakub Jelinek - * elf/dl-lookup.c (lookup_cache, lookup_cache_versioned): New. + * elf/dl-lookup.c (lookup_cache, lookup_cache_versioned): New + functions. (_dl_lookup_symbol): Lookup relocations in cache and store successfull lookups in cache. (_dl_lookup_versioned_symbol): Likewise. diff -durpN glibc-2.2.5/config.h.in glibc-2.3/config.h.in --- glibc-2.2.5/config.h.in 2001-11-15 17:02:56.000000000 -0800 +++ glibc-2.3/config.h.in 2002-10-01 20:03:13.000000000 -0700 @@ -1,7 +1,13 @@ -#if !defined ASSEMBLER && !defined _ISOMAC && !defined __OPTIMIZE__ +#if !defined __ASSEMBLER__ && !defined _ISOMAC && !defined __OPTIMIZE__ # error "glibc cannot be compiled without optimization" #endif +/* Another evil option when it comes to compiling the C library is + --ffast-math since it alters the ABI. */ +#if defined __FAST_MATH__ && !defined TEST_FAST_MATH +# error "glibc must not be compiled with -ffast-math" +#endif + /* Define if using GNU ld, with support for weak symbols in a.out, and for symbol set and warning messages extensions in a.out and ELF. This implies HAVE_WEAK_SYMBOLS; set by --with-gnu-ld. */ @@ -45,6 +51,10 @@ declaring a symbol global (default `.globl'). */ #undef ASM_GLOBAL_DIRECTIVE +/* Define to the prefix before `object' or `function' in the + assembler's `.type' directive, if it has one. */ +#undef ASM_TYPE_DIRECTIVE_PREFIX + /* Define a symbol_name as a global .symbol_name for ld. */ #undef HAVE_ASM_GLOBAL_DOT_NAME @@ -85,6 +95,12 @@ /* Define if the compiler supports __builtin_expect. */ #undef HAVE_BUILTIN_EXPECT +/* Define if the compiler supports __builtin_memset. */ +#undef HAVE_BUILTIN_MEMSET + +/* Define if the __thread keyword is supported. */ +#undef HAVE___THREAD + /* Define if the regparm attribute shall be used for local functions (gcc on ix86 only). */ #undef USE_REGPARMS @@ -96,6 +112,41 @@ /* Define if the linker supports the -z combreloc option. */ #undef HAVE_Z_COMBRELOC +/* Define if the assembler supported .protected. */ +#undef HAVE_PROTECTED + +/* Define if the assembler supported .hidden. */ +#undef HAVE_HIDDEN + +/* Define if the compiler supports __attribute__ ((visibility (...))). */ +#undef HAVE_VISIBILITY_ATTRIBUTE + +/* Define if the compiler doesn't support __attribute__ ((visibility (...))) + together with __asm__ redirection properly. */ +#undef HAVE_BROKEN_VISIBILITY_ATTRIBUTE + +/* Define if the compiler doesn't support __attribute__ ((alias (...))) + together with __asm__ redirection properly. */ +#undef HAVE_BROKEN_ALIAS_ATTRIBUTE + +/* Define if _rtld_local structure should be forced into .sdata section. */ +#undef HAVE_SDATA_SECTION + +/* Define if binutils support TLS handling. */ +#undef HAVE_TLS_SUPPORT + +/* Define if the linker supports .preinit_array/.init_array/.fini_array + sections. */ +#undef HAVE_INITFINI_ARRAY + +/* Define if the access to static and hidden variables is position independent + and does not need relocations. */ +#undef PI_STATIC_AND_HIDDEN + +/* Define this to disable the `hidden_proto' et al macros in + include/libc-symbols.h that avoid PLT slots in the shared objects. */ +#undef NO_HIDDEN + /* Defined to some form of __attribute__ ((...)) if the compiler supports a different, more efficient calling convention. */ @@ -119,6 +170,15 @@ disabling the support as well. */ #undef USE_NONOPTION_FLAGS +/* Mach/Hurd specific: define if mig supports the `retcode' keyword. */ +#undef HAVE_MIG_RETCODE + +/* Mach specific: define if the `host_page_size' RPC is available. */ +#undef HAVE_HOST_PAGE_SIZE + +/* Mach/i386 specific: define if the `i386_io_perm_*' RPCs are available. */ +#undef HAVE_I386_IO_PERM_MODIFY + /* */ diff -durpN glibc-2.2.5/config.make.in glibc-2.3/config.make.in --- glibc-2.2.5/config.make.in 2001-11-15 17:03:15.000000000 -0800 +++ glibc-2.3/config.make.in 2002-05-04 19:25:48.000000000 -0700 @@ -1,5 +1,5 @@ # @configure_input@ -# From $Id: config.make.in,v 1.81 2001/11/16 01:03:15 drepper Exp $. +# From $Id: config.make.in,v 1.85 2002/04/30 22:00:45 roland Exp $. # Don't edit this file. Put configuration parameters in configparms instead. version = @VERSION@ @@ -44,9 +44,11 @@ have-z-combreloc = @libc_cv_z_combreloc@ have-initfini = @libc_cv_have_initfini@ have-Bgroup = @libc_cv_Bgroup@ need-nopic-initfini = @nopic_initfini@ +with-fp = @with_fp@ with-cvs = @with_cvs@ old-glibc-headers = @old_glibc_headers@ unwind-find-fde = @libc_cv_gcc_unwind_find_fde@ +have-initfini-array = @libc_cv_initfinit_array@ static-libgcc = @libc_cv_gcc_static_libgcc@ @@ -56,6 +58,8 @@ no-whole-archive = @no_whole_archive@ exceptions = @exceptions@ have_doors = @linux_doors@ +mach-interface-list = @mach_interface_list@ + have-bash2 = @libc_cv_have_bash2@ have-ksh = @libc_cv_have_ksh@ @@ -71,7 +75,6 @@ build-profile = @profile@ build-omitfp = @omitfp@ build-bounded = @bounded@ build-static-nss = @static_nss@ -stdio = @stdio@ add-ons = @subdirs@ cross-compiling = @cross_compiling@ force-install = @force_install@ diff -durpN glibc-2.2.5/configure glibc-2.3/configure --- glibc-2.2.5/configure 2002-01-08 14:16:44.000000000 -0800 +++ glibc-2.3/configure 2002-10-02 00:08:39.000000000 -0700 @@ -45,8 +45,6 @@ ac_help="$ac_help [e.g. /usr/src/linux/include] [default=compiler default]" ac_help="$ac_help - --enable-libio build in GNU libio instead of GNU stdio" -ac_help="$ac_help --disable-sanity-checks really do not use threads (should not be used except in special situations) [default=yes]" ac_help="$ac_help @@ -68,6 +66,10 @@ ac_help="$ac_help configure and build add-ons in DIR1,DIR2,... search for add-ons if no parameter given" ac_help="$ac_help + --with-tls enable support for TLS" +ac_help="$ac_help + --disable-hidden-plt do not hide internal function calls to avoid PLT" +ac_help="$ac_help --enable-static-nss build static NSS modules [default=no]" ac_help="$ac_help --disable-force-install don't force installation of files from this package, @@ -732,19 +734,6 @@ else fi -# Check whether --enable-libio or --disable-libio was given. -if test "${enable_libio+set}" = set; then - enableval="$enable_libio" - if test $enableval = yes; then - stdio=libio - else - stdio=stdio - fi -else - stdio=default -fi - - # Check whether --enable-sanity-checks or --disable-sanity-checks was given. if test "${enable_sanity_checks+set}" = set; then enableval="$enable_sanity_checks" @@ -827,6 +816,30 @@ else fi +# Check whether --with-tls or --without-tls was given. +if test "${with_tls+set}" = set; then + withval="$with_tls" + usetls=$withval +else + usetls=no +fi + + +# Check whether --enable-hidden-plt or --disable-hidden-plt was given. +if test "${enable_hidden_plt+set}" = set; then + enableval="$enable_hidden_plt" + hidden=$enableval +else + hidden=yes +fi + +if test "x$hidden" = xno; then + cat >> confdefs.h <<\EOF +#define NO_HIDDEN 1 +EOF + +fi + subdirs="$add_ons" add_ons_pfx= @@ -864,7 +877,8 @@ else static_nss=no fi -if test x"$static_nss" = xyes; then +if test x"$static_nss" = xyes || test x"$shared" = xno; then + static_nss=yes cat >> confdefs.h <<\EOF #define DO_STATIC_NSS 1 EOF @@ -911,7 +925,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:915: checking host system type" >&5 +echo "configure:929: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -964,7 +978,7 @@ case "$host_os" in # i586-linuxaout is mangled into i586-pc-linux-gnuaout linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*) ;; -gnu* | linux* | sysv4* | solaris2* | irix6*) +gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*) # These systems (almost) always use the ELF format. elf=yes ;; @@ -1026,11 +1040,9 @@ m68k) base_machine=m68k machine=m68k/m6 m88???) base_machine=m88k machine=m88k/$machine ;; m88k) base_machine=m88k machine=m88k/m88100 ;; mips64*) base_machine=mips64 machine=mips/mips64/$machine ;; -mips*) base_machine=mips - case "`uname -m`" in - IP22) machine=mips/mips3 ;; - *) machine=mips/$machine ;; - esac ;; +mips*) base_machine=mips machine=mips/$machine ;; +powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;; +powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;; s390) base_machine=s390 machine=s390/s390-32 ;; s390x) base_machine=s390 machine=s390/s390-64 ;; sh3*) base_machine=sh machine=sh/sh3 ;; @@ -1048,6 +1060,7 @@ sparc64 | ultrasparc) sparc64b | ultrasparc3) base_machine=sparc machine=sparc/sparc64/sparcv9b ;; thumb*) base_machine=thumb machine=arm/thumb/$machine ;; +*) base_machine=$machine ;; esac @@ -1062,7 +1075,7 @@ fi # This can take a while to compute. sysdep_dir=$srcdir/sysdeps echo $ac_n "checking sysdep dirs""... $ac_c" 1>&6 -echo "configure:1066: checking sysdep dirs" >&5 +echo "configure:1079: checking sysdep dirs" >&5 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1. os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`" @@ -1285,7 +1298,7 @@ echo "$ac_t""$default_sysnames" 1>&6 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1289: checking for a BSD compatible install" >&5 +echo "configure:1302: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1342,7 +1355,7 @@ if test "$INSTALL" = "${srcdir}/scripts/ INSTALL='\$(..)./scripts/install-sh -c' fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1346: checking whether ln -s works" >&5 +echo "configure:1359: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1371,7 +1384,7 @@ fi # Extract the first word of "pwd", so it can be a program name with args. set dummy pwd; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1375: checking for $ac_word" >&5 +echo "configure:1388: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PWD_P'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1410,7 +1423,7 @@ fi # These programs are version sensitive. echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1414: checking build system type" >&5 +echo "configure:1427: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1438,7 +1451,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1442: checking for $ac_word" >&5 +echo "configure:1455: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1472,11 +1485,11 @@ if test -z "$CC"; then else # Found it, now check the version. echo $ac_n "checking version of $CC""... $ac_c" 1>&6 -echo "configure:1476: checking version of $CC" >&5 +echo "configure:1489: checking version of $CC" >&5 ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - *gcc-2.9[5-9].*|*2.8.[1-9]*|*2.9|*2.9.[0-9]*|2.9[5-9]*|3.[0-9]*|cygnus-2.9[1-9]*|gcc-2.9[5-9]|gcc-2.1[0-9][0-9]|sgicc-*) + 3.[2-9]*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; @@ -1484,7 +1497,7 @@ echo "configure:1476: checking version o echo "$ac_t""$ac_prog_version" 1>&6 fi if test $ac_verc_fail = yes; then - critic_missing=gcc + critic_missing="$critic_missing gcc" fi for ac_prog in gnumake gmake make @@ -1492,7 +1505,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1496: checking for $ac_word" >&5 +echo "configure:1509: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1526,7 +1539,7 @@ if test -z "$MAKE"; then else # Found it, now check the version. echo $ac_n "checking version of $MAKE""... $ac_c" 1>&6 -echo "configure:1530: checking version of $MAKE" >&5 +echo "configure:1543: checking version of $MAKE" >&5 ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; @@ -1555,7 +1568,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1559: checking for $ac_word" >&5 +echo "configure:1572: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1589,7 +1602,7 @@ if test -z "$MSGFMT"; then else # Found it, now check the version. echo $ac_n "checking version of $MSGFMT""... $ac_c" 1>&6 -echo "configure:1593: checking version of $MSGFMT" >&5 +echo "configure:1606: checking version of $MSGFMT" >&5 ac_prog_version=`$MSGFMT --version 2>&1 | sed -n 's/^.*GNU gettext.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; @@ -1609,7 +1622,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1613: checking for $ac_word" >&5 +echo "configure:1626: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1643,7 +1656,7 @@ if test -z "$MAKEINFO"; then else # Found it, now check the version. echo $ac_n "checking version of $MAKEINFO""... $ac_c" 1>&6 -echo "configure:1647: checking version of $MAKEINFO" >&5 +echo "configure:1660: checking version of $MAKEINFO" >&5 ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; @@ -1658,12 +1671,12 @@ if test $ac_verc_fail = yes; then MAKEINFO=: aux_missing="$aux_missing makeinfo" fi -for ac_prog in gsed sed +for ac_prog in sed do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1667: checking for $ac_word" >&5 +echo "configure:1680: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_SED'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1697,7 +1710,7 @@ if test -z "$SED"; then else # Found it, now check the version. echo $ac_n "checking version of $SED""... $ac_c" 1>&6 -echo "configure:1701: checking version of $SED" >&5 +echo "configure:1714: checking version of $SED" >&5 ac_prog_version=`$SED --version 2>&1 | sed -n 's/^.*GNU sed version \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; @@ -1715,7 +1728,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1719: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1732: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1729,12 +1742,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1733 "configure" +#line 1746 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1765,7 +1778,7 @@ else cross_linkable=yes fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1769: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1782: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_cross'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1777,7 +1790,7 @@ echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1781: checking whether we are using GNU C" >&5 +echo "configure:1794: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1786,7 +1799,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1799,7 +1812,7 @@ if test $ac_cv_prog_gcc != yes; then fi echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1803: checking build system type" >&5 +echo "configure:1816: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1822,7 +1835,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1826: checking for $ac_word" >&5 +echo "configure:1839: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1854,7 +1867,7 @@ done fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1858: checking how to run the C preprocessor" >&5 +echo "configure:1871: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1869,13 +1882,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1886,13 +1899,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1903,13 +1916,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1945,14 +1958,14 @@ AR=`$CC -print-prog-name=ar` # ranlib has to be treated a bit differently since it might not exist at all. -RANLIB=`$CC -print-prog-name=ranlib` -if test $RANLIB = ranlib; then +ac_ranlib=`$CC -print-prog-name=ranlib` +if test "x$ac_ranlib" = xranlib; then # This extra check has to happen since gcc simply echos the parameter in # case it cannot find the value in its own directories. # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1956: checking for $ac_word" >&5 +echo "configure:1969: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1984,7 +1997,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1988: checking for $ac_word" >&5 +echo "configure:2001: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2016,12 +2029,14 @@ else fi fi +else + RANLIB=$ac_ranlib fi # Determine whether we are using GNU binutils. echo $ac_n "checking whether $AS is GNU as""... $ac_c" 1>&6 -echo "configure:2025: checking whether $AS is GNU as" >&5 +echo "configure:2040: checking whether $AS is GNU as" >&5 if eval "test \"`echo '$''{'libc_cv_prog_as_gnu'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2040,7 +2055,7 @@ rm -f a.out gnu_as=$libc_cv_prog_as_gnu echo $ac_n "checking whether $LD is GNU ld""... $ac_c" 1>&6 -echo "configure:2044: checking whether $LD is GNU ld" >&5 +echo "configure:2059: checking whether $LD is GNU ld" >&5 if eval "test \"`echo '$''{'libc_cv_prog_ld_gnu'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2060,7 +2075,7 @@ gnu_ld=$libc_cv_prog_ld_gnu # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. set dummy ${ac_tool_prefix}mig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2064: checking for $ac_word" >&5 +echo "configure:2079: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2077,7 +2092,6 @@ else fi done IFS="$ac_save_ifs" - test -z "$ac_cv_prog_MIG" && ac_cv_prog_MIG="mig" fi fi MIG="$ac_cv_prog_MIG" @@ -2088,6 +2102,42 @@ else fi +if test -z "$ac_cv_prog_MIG"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "mig", so it can be a program name with args. +set dummy mig; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2111: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$MIG"; then + ac_cv_prog_MIG="$MIG" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_MIG="mig" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_MIG" && ac_cv_prog_MIG="MISSING" +fi +fi +MIG="$ac_cv_prog_MIG" +if test -n "$MIG"; then + echo "$ac_t""$MIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + MIG="MISSING" +fi +fi # Accept binutils 2.10.1 or newer (and also any ia64 2.9 version) @@ -2117,7 +2167,7 @@ fi # check if ranlib is necessary echo $ac_n "checking whether ranlib is necessary""... $ac_c" 1>&6 -echo "configure:2121: checking whether ranlib is necessary" >&5 +echo "configure:2171: checking whether ranlib is necessary" >&5 if eval "test \"`echo '$''{'libc_cv_ranlib_necessary'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2127,7 +2177,7 @@ char b; void c(void) {} EOF $CC $CFLAGS -c conftest.c -$AR cr conftest.a conftest.c +$AR cr conftest.a conftest.o cp conftest.a conftest2.a $RANLIB conftest.a if cmp -s conftest.a conftest2.a; then @@ -2151,7 +2201,7 @@ fi # - two terminals occur directly after each other # - the path contains an element with a dot in it echo $ac_n "checking LD_LIBRARY_PATH variable""... $ac_c" 1>&6 -echo "configure:2155: checking LD_LIBRARY_PATH variable" >&5 +echo "configure:2205: checking LD_LIBRARY_PATH variable" >&5 case ${LD_LIBRARY_PATH} in [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* ) ld_library_path_setting="contains current directory" @@ -2169,7 +2219,7 @@ if test "$ld_library_path_setting" != "o fi echo $ac_n "checking whether GCC supports -static-libgcc""... $ac_c" 1>&6 -echo "configure:2173: checking whether GCC supports -static-libgcc" >&5 +echo "configure:2223: checking whether GCC supports -static-libgcc" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_static_libgcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2186,7 +2236,7 @@ echo "$ac_t""$libc_cv_gcc_static_libgcc" # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2190: checking for $ac_word" >&5 +echo "configure:2240: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2232,7 +2282,7 @@ if test "$BASH" = no; then # Extract the first word of "ksh", so it can be a program name with args. set dummy ksh; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2236: checking for $ac_word" >&5 +echo "configure:2286: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2277,12 +2327,12 @@ else fi -for ac_prog in mawk gawk nawk awk +for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2286: checking for $ac_word" >&5 +echo "configure:2336: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2314,7 +2364,7 @@ done # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2318: checking for $ac_word" >&5 +echo "configure:2368: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2354,7 +2404,7 @@ fi # Extract the first word of "install-info", so it can be a program name with args. set dummy install-info; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2358: checking for $ac_word" >&5 +echo "configure:2408: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_INSTALL_INFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2389,7 +2439,7 @@ fi if test "$INSTALL_INFO" != "no"; then echo $ac_n "checking for old Debian install-info""... $ac_c" 1>&6 -echo "configure:2393: checking for old Debian install-info" >&5 +echo "configure:2443: checking for old Debian install-info" >&5 if eval "test \"`echo '$''{'libc_cv_old_debian_install_info'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2424,7 +2474,7 @@ fi # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2428: checking for $ac_word" >&5 +echo "configure:2478: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2459,7 +2509,7 @@ fi echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6 -echo "configure:2463: checking for signed size_t type" >&5 +echo "configure:2513: checking for signed size_t type" >&5 if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2483,12 +2533,12 @@ EOF fi echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6 -echo "configure:2487: checking for libc-friendly stddef.h" >&5 +echo "configure:2537: checking for libc-friendly stddef.h" >&5 if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libc_cv_friendly_stddef=yes else @@ -2522,7 +2572,7 @@ override stddef.h = # The installed &6 -echo "configure:2526: checking whether we need to use -P to assemble .S files" >&5 +echo "configure:2576: checking whether we need to use -P to assemble .S files" >&5 if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2545,7 +2595,7 @@ asm-CPPFLAGS = -P # The assembler can't fi echo $ac_n "checking whether .text pseudo-op must be used""... $ac_c" 1>&6 -echo "configure:2549: checking whether .text pseudo-op must be used" >&5 +echo "configure:2599: checking whether .text pseudo-op must be used" >&5 if eval "test \"`echo '$''{'libc_cv_dot_text'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2566,7 +2616,7 @@ else fi echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6 -echo "configure:2570: checking for assembler global-symbol directive" >&5 +echo "configure:2620: checking for assembler global-symbol directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2596,7 +2646,7 @@ EOF fi echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6 -echo "configure:2600: checking for .set assembler directive" >&5 +echo "configure:2650: checking for .set assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2629,9 +2679,41 @@ EOF fi +echo $ac_n "checking for assembler .type directive prefix""... $ac_c" 1>&6 +echo "configure:2684: checking for assembler .type directive prefix" >&5 +if eval "test \"`echo '$''{'libc_cv_asm_type_prefix'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + libc_cv_asm_type_prefix=no +for ac_try_prefix in '@' '%' '#'; do + cat > conftest.s </dev/null; then + libc_cv_asm_type_prefix=${ac_try_prefix} + fi + rm -f conftest* + test "x$libc_cv_asm_type_prefix" != xno && break +done +fi + +echo "$ac_t""$libc_cv_asm_type_prefix" 1>&6 +if test "x$libc_cv_asm_type_prefix" != xno; then + cat >> confdefs.h <> confdefs.h <<\EOF #define HAVE_ASM_GLOBAL_DOT_NAME 1 EOF @@ -2639,7 +2721,7 @@ EOF esac echo $ac_n "checking for .symver assembler directive""... $ac_c" 1>&6 -echo "configure:2643: checking for .symver assembler directive" >&5 +echo "configure:2725: checking for .symver assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_symver_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2658,7 +2740,7 @@ fi echo "$ac_t""$libc_cv_asm_symver_directive" 1>&6 echo $ac_n "checking for ld --version-script""... $ac_c" 1>&6 -echo "configure:2662: checking for ld --version-script" >&5 +echo "configure:2744: checking for ld --version-script" >&5 if eval "test \"`echo '$''{'libc_cv_ld_version_script_option'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2681,7 +2763,7 @@ EOF if { ac_try='${CC-cc} $CFLAGS -shared -o conftest.so conftest.o -nostartfiles -nostdlib -Wl,--version-script,conftest.map - 1>&5'; { (eval echo configure:2685: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; + 1>&5'; { (eval echo configure:2767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_ld_version_script_option=yes else @@ -2720,7 +2802,7 @@ if test $elf = yes && test $shared != no fi if test $elf = yes; then echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6 -echo "configure:2724: checking for .previous assembler directive" >&5 +echo "configure:2806: checking for .previous assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2728,7 +2810,7 @@ else .section foo_section .previous EOF - if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_asm_previous_directive=yes else libc_cv_asm_previous_directive=no @@ -2744,7 +2826,7 @@ EOF else echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6 -echo "configure:2748: checking for .popsection assembler directive" >&5 +echo "configure:2830: checking for .popsection assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2752,7 +2834,7 @@ else .pushsection foo_section .popsection EOF - if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_asm_popsection_directive=yes else libc_cv_asm_popsection_directive=no @@ -2769,7 +2851,7 @@ EOF fi fi echo $ac_n "checking for .protected and .hidden assembler directive""... $ac_c" 1>&6 -echo "configure:2773: checking for .protected and .hidden assembler directive" >&5 +echo "configure:2855: checking for .protected and .hidden assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_protected_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2779,7 +2861,7 @@ foo: .hidden bar bar: EOF - if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_asm_protected_directive=yes else libc_cv_asm_protected_directive=no @@ -2789,9 +2871,169 @@ fi echo "$ac_t""$libc_cv_asm_protected_directive" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_PROTECTED 1 +EOF + + cat >> confdefs.h <<\EOF +#define HAVE_HIDDEN 1 +EOF + + + if test $libc_cv_asm_protected_directive = yes; then + echo $ac_n "checking whether __attribute__((visibility())) is supported""... $ac_c" 1>&6 +echo "configure:2886: checking whether __attribute__((visibility())) is supported" >&5 +if eval "test \"`echo '$''{'libc_cv_visibility_attribute'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c </dev/null 2>&1; then + if grep '\.hidden.*foo' conftest.s >/dev/null; then + if grep '\.protected.*bar' conftest.s >/dev/null; then + libc_cv_visibility_attribute=yes + fi + fi + fi + rm -f conftest.cs + +fi + +echo "$ac_t""$libc_cv_visibility_attribute" 1>&6 + if test $libc_cv_visibility_attribute = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_VISIBILITY_ATTRIBUTE 1 +EOF + + fi + fi + + if test $libc_cv_visibility_attribute = yes; then + echo $ac_n "checking for broken __attribute__((visibility()))""... $ac_c" 1>&6 +echo "configure:2917: checking for broken __attribute__((visibility()))" >&5 +if eval "test \"`echo '$''{'libc_cv_broken_visibility_attribute'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c </dev/null 2>&1; then + if grep '\.hidden[ _]foo' conftest.s >/dev/null; then + libc_cv_broken_visibility_attribute=no + fi + fi + rm -f conftest.c conftest.s + +fi + +echo "$ac_t""$libc_cv_broken_visibility_attribute" 1>&6 + if test $libc_cv_broken_visibility_attribute = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_BROKEN_VISIBILITY_ATTRIBUTE 1 +EOF + + fi + fi + + echo $ac_n "checking for broken __attribute__((alias()))""... $ac_c" 1>&6 +echo "configure:2946: checking for broken __attribute__((alias()))" >&5 +if eval "test \"`echo '$''{'libc_cv_broken_alias_attribute'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c </dev/null 2>&1; then + if grep 'xyzzy' conftest.s >/dev/null && + grep 'abccb' conftest.s >/dev/null; then + libc_cv_broken_alias_attribute=no + fi + fi + rm -f conftest.c conftest.s + +fi + +echo "$ac_t""$libc_cv_broken_alias_attribute" 1>&6 + if test $libc_cv_broken_alias_attribute = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_BROKEN_ALIAS_ATTRIBUTE 1 +EOF + + fi + + if test $libc_cv_visibility_attribute = yes -a $gnu_ld = yes; then + echo $ac_n "checking whether to put _rtld_local into .sdata section""... $ac_c" 1>&6 +echo "configure:2979: checking whether to put _rtld_local into .sdata section" >&5 +if eval "test \"`echo '$''{'libc_cv_have_sdata_section'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo "int i;" > conftest.c + libc_cv_have_sdata_section=no + if ${CC-cc} -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \ + | grep '\.sdata' >/dev/null; then + libc_cv_have_sdata_section=yes + fi + rm -f conftest.c conftest.so + +fi + +echo "$ac_t""$libc_cv_have_sdata_section" 1>&6 + if test $libc_cv_have_sdata_section = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SDATA_SECTION 1 +EOF + + fi + fi + + echo $ac_n "checking for .preinit_array/.init_array/.fini_array support""... $ac_c" 1>&6 +echo "configure:3003: checking for .preinit_array/.init_array/.fini_array support" >&5 +if eval "test \"`echo '$''{'libc_cv_initfinit_array'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } + then + if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then + libc_cv_initfinit_array=yes + else + libc_cv_initfinit_array=no + fi + else + libc_cv_initfinit_array=no + fi + rm -f conftest* +fi + +echo "$ac_t""$libc_cv_initfinit_array" 1>&6 + + if test $libc_cv_initfinit_array = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_INITFINI_ARRAY 1 +EOF + + fi echo $ac_n "checking for -z nodelete option""... $ac_c" 1>&6 -echo "configure:2795: checking for -z nodelete option" >&5 +echo "configure:3037: checking for -z nodelete option" >&5 if eval "test \"`echo '$''{'libc_cv_z_nodelete'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2800,7 +3042,7 @@ int _start (void) { return 42; } EOF if { ac_try='${CC-cc} -shared -o conftest.so conftest.c -nostartfiles -nostdlib - -Wl,--enable-new-dtags,-z,nodelete 1>&5'; { (eval echo configure:2804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + -Wl,--enable-new-dtags,-z,nodelete 1>&5'; { (eval echo configure:3046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then libc_cv_z_nodelete=yes else @@ -2813,7 +3055,7 @@ echo "$ac_t""$libc_cv_z_nodelete" 1>&6 echo $ac_n "checking for -z nodlopen option""... $ac_c" 1>&6 -echo "configure:2817: checking for -z nodlopen option" >&5 +echo "configure:3059: checking for -z nodlopen option" >&5 if eval "test \"`echo '$''{'libc_cv_z_nodlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2822,7 +3064,7 @@ int _start (void) { return 42; } EOF if { ac_try='${CC-cc} -shared -o conftest.so conftest.c -nostartfiles -nostdlib - -Wl,--enable-new-dtags,-z,nodlopen 1>&5'; { (eval echo configure:2826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + -Wl,--enable-new-dtags,-z,nodlopen 1>&5'; { (eval echo configure:3068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then libc_cv_z_nodlopen=yes else @@ -2835,7 +3077,7 @@ echo "$ac_t""$libc_cv_z_nodlopen" 1>&6 echo $ac_n "checking for -z initfirst option""... $ac_c" 1>&6 -echo "configure:2839: checking for -z initfirst option" >&5 +echo "configure:3081: checking for -z initfirst option" >&5 if eval "test \"`echo '$''{'libc_cv_z_initfirst'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2844,7 +3086,7 @@ int _start (void) { return 42; } EOF if { ac_try='${CC-cc} -shared -o conftest.so conftest.c -nostartfiles -nostdlib - -Wl,--enable-new-dtags,-z,initfirst 1>&5'; { (eval echo configure:2848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + -Wl,--enable-new-dtags,-z,initfirst 1>&5'; { (eval echo configure:3090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then libc_cv_z_initfirst=yes else @@ -2857,14 +3099,14 @@ echo "$ac_t""$libc_cv_z_initfirst" 1>&6 echo $ac_n "checking for -Bgroup option""... $ac_c" 1>&6 -echo "configure:2861: checking for -Bgroup option" >&5 +echo "configure:3103: checking for -Bgroup option" >&5 if eval "test \"`echo '$''{'libc_cv_Bgroup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } + if { ac_try='${CC-cc} -shared -o conftest.so conftest.c -Wl,-Bgroup -nostdlib 1>&5'; { (eval echo configure:3110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then libc_cv_Bgroup=yes else @@ -2877,17 +3119,18 @@ echo "$ac_t""$libc_cv_Bgroup" 1>&6 echo $ac_n "checking for -z combreloc""... $ac_c" 1>&6 -echo "configure:2881: checking for -z combreloc" >&5 +echo "configure:3123: checking for -z combreloc" >&5 if eval "test \"`echo '$''{'libc_cv_z_combreloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } + -Wl,-z,combreloc 1>&5'; { (eval echo configure:3134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then libc_cv_z_combreloc=yes @@ -2912,12 +3155,12 @@ fi if test $elf != yes; then echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6 -echo "configure:2916: checking for .init and .fini sections" >&5 +echo "configure:3159: checking for .init and .fini sections" >&5 if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libc_cv_have_initfini=yes else @@ -2949,7 +3192,7 @@ fi if test $elf = yes -a $gnu_ld = yes; then echo $ac_n "checking whether cc puts quotes around section names""... $ac_c" 1>&6 -echo "configure:2953: checking whether cc puts quotes around section names" >&5 +echo "configure:3196: checking whether cc puts quotes around section names" >&5 if eval "test \"`echo '$''{'libc_cv_have_section_quotes'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2986,19 +3229,19 @@ if test $elf = yes; then else if test $ac_cv_prog_cc_works = yes; then echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6 -echo "configure:2990: checking for _ prefix on C symbol names" >&5 +echo "configure:3233: checking for _ prefix on C symbol names" >&5 if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* libc_cv_asm_underscores=yes else @@ -3013,17 +3256,17 @@ fi echo "$ac_t""$libc_cv_asm_underscores" 1>&6 else echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6 -echo "configure:3017: checking for _ prefix on C symbol names" >&5 +echo "configure:3260: checking for _ prefix on C symbol names" >&5 if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if grep _underscore_test conftest* >/dev/null; then rm -f conftest* libc_cv_asm_underscores=yes @@ -3055,7 +3298,7 @@ if test $elf = yes; then fi echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6 -echo "configure:3059: checking for assembler .weak directive" >&5 +echo "configure:3302: checking for assembler .weak directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3078,7 +3321,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive if test $libc_cv_asm_weak_directive = no; then echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6 -echo "configure:3082: checking for assembler .weakext directive" >&5 +echo "configure:3325: checking for assembler .weakext directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3125,14 +3368,14 @@ EOF ;; hppa*linux*) echo $ac_n "checking for assembler line separator""... $ac_c" 1>&6 -echo "configure:3129: checking for assembler line separator" >&5 +echo "configure:3372: checking for assembler line separator" >&5 if eval "test \"`echo '$''{'libc_cv_asm_line_sep'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.s <&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:3379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_asm_line_sep='!' else if test -z "$enable_hacker_mode"; then @@ -3154,7 +3397,7 @@ EOF esac echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6 -echo "configure:3158: checking for ld --no-whole-archive" >&5 +echo "configure:3401: checking for ld --no-whole-archive" >&5 if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3165,7 +3408,7 @@ __throw () {} EOF if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles -Wl,--no-whole-archive - -o conftest conftest.c 1>&5'; { (eval echo configure:3169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c 1>&5'; { (eval echo configure:3412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_ld_no_whole_archive=yes else libc_cv_ld_no_whole_archive=no @@ -3179,7 +3422,7 @@ if test $libc_cv_ld_no_whole_archive = y fi echo $ac_n "checking for gcc -fexceptions""... $ac_c" 1>&6 -echo "configure:3183: checking for gcc -fexceptions" >&5 +echo "configure:3426: checking for gcc -fexceptions" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_exceptions'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3190,7 +3433,7 @@ __throw () {} EOF if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles -fexceptions - -o conftest conftest.c 1>&5'; { (eval echo configure:3194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c 1>&5'; { (eval echo configure:3437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_exceptions=yes else libc_cv_gcc_exceptions=no @@ -3205,14 +3448,14 @@ fi if test "$base_machine" = alpha ; then echo $ac_n "checking for function ..ng prefix""... $ac_c" 1>&6 -echo "configure:3209: checking for function ..ng prefix" >&5 +echo "configure:3452: checking for function ..ng prefix" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_alpha_ng_prefix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <<\EOF foo () { } EOF -if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null'; { (eval echo configure:3216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; +if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null'; { (eval echo configure:3459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_alpha_ng_prefix=yes else @@ -3239,19 +3482,19 @@ if test "$host_cpu" = powerpc ; then # Check for a bug present in at least versions 2.8.x of GCC # and versions 1.0.x of EGCS. echo $ac_n "checking whether clobbering cr0 causes problems""... $ac_c" 1>&6 -echo "configure:3243: checking whether clobbering cr0 causes problems" >&5 +echo "configure:3486: checking whether clobbering cr0 causes problems" >&5 if eval "test \"`echo '$''{'libc_cv_c_asmcr0_bug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3498: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libc_cv_c_asmcr0_bug='no' else @@ -3273,13 +3516,13 @@ fi fi echo $ac_n "checking for DWARF2 unwind info support""... $ac_c" 1>&6 -echo "configure:3277: checking for DWARF2 unwind info support" >&5 +echo "configure:3520: checking for DWARF2 unwind info support" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_dwarf2_unwind_info'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_dwarf2_unwind_info=static else libc_cv_gcc_dwarf2_unwind_info=no fi +if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame_info + -nostdlib -nostartfiles + -o conftest conftest.c -lgcc -lgcc_eh >&5'; { (eval echo configure:3560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if ${CC-cc} $CFLAGS -DCHECK__register_frame_info -nostdlib -nostartfiles \ + -o conftest conftest.c -lgcc -lgcc_eh -v 2>&1 >/dev/null \ + | grep -q -- --eh-frame-hdr; then + libc_cv_gcc_dwarf2_unwind_info=no_registry_needed + else + libc_cv_gcc_dwarf2_unwind_info=static + fi +else + libc_cv_gcc_dwarf2_unwind_info=no +fi if test $libc_cv_gcc_dwarf2_unwind_info = no; then if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame -nostdlib -nostartfiles - -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_dwarf2_unwind_info=yes else libc_cv_gcc_dwarf2_unwind_info=no @@ -3343,12 +3600,12 @@ EOF esac echo $ac_n "checking for __builtin_expect""... $ac_c" 1>&6 -echo "configure:3347: checking for __builtin_expect" >&5 +echo "configure:3604: checking for __builtin_expect" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_builtin_expect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_builtin_expect=yes else libc_cv_gcc_builtin_expect=no @@ -3372,13 +3629,41 @@ EOF fi +echo $ac_n "checking for __builtin_memset""... $ac_c" 1>&6 +echo "configure:3634: checking for __builtin_memset" >&5 +if eval "test \"`echo '$''{'libc_cv_gcc_builtin_memset'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<\EOF +void zero (void *x) +{ + __builtin_memset (x, 0, 1000); +} +EOF +if { ac_try='${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null'; { (eval echo configure:3644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; +then + libc_cv_gcc_builtin_memset=no +else + libc_cv_gcc_builtin_memset=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$libc_cv_gcc_builtin_memset" 1>&6 +if test "$libc_cv_gcc_builtin_memset" = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_BUILTIN_MEMSET 1 +EOF + +fi + echo $ac_n "checking for local label subtraction""... $ac_c" 1>&6 -echo "configure:3377: checking for local label subtraction" >&5 +echo "configure:3662: checking for local label subtraction" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_subtract_local_labels'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_subtract_local_labels=yes else libc_cv_gcc_subtract_local_labels=no @@ -3407,8 +3692,33 @@ EOF fi +echo $ac_n "checking for __thread""... $ac_c" 1>&6 +echo "configure:3697: checking for __thread" >&5 +if eval "test \"`echo '$''{'libc_cv_gcc___thread'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<\EOF +__thread int a = 42; +EOF +if { ac_try='${CC-cc} $CFLAGS -c conftest.c >&5'; { (eval echo configure:3704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + libc_cv_gcc___thread=yes +else + libc_cv_gcc___thread=no +fi +rm -f conftest* +fi + +echo "$ac_t""$libc_cv_gcc___thread" 1>&6 +if test "$libc_cv_gcc___thread" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE___THREAD 1 +EOF + +fi + + echo $ac_n "checking for libgd""... $ac_c" 1>&6 -echo "configure:3412: checking for libgd" >&5 +echo "configure:3722: checking for libgd" >&5 if test "$with_gd" != "no"; then old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $libgd_include" @@ -3417,14 +3727,14 @@ if test "$with_gd" != "no"; then old_LIBS="$LIBS" LIBS="$LIBS -lgd -lpng -lz -lm" cat > conftest.$ac_ext < int main() { gdImagePng (0, 0) ; return 0; } EOF -if { (eval echo configure:3428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBGD=yes else @@ -3444,7 +3754,7 @@ echo "$ac_t""$LIBGD" 1>&6 echo $ac_n "checking size of long double""... $ac_c" 1>&6 -echo "configure:3448: checking size of long double" >&5 +echo "configure:3758: checking size of long double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3452,18 +3762,18 @@ else ac_cv_sizeof_long_double=0 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(long double)); - exit(0); + return(0); } EOF -if { (eval echo configure:3467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_double=`cat conftestval` else @@ -3541,7 +3851,7 @@ if test "$uname" = "sysdeps/generic"; th fi echo $ac_n "checking OS release for uname""... $ac_c" 1>&6 -echo "configure:3545: checking OS release for uname" >&5 +echo "configure:3855: checking OS release for uname" >&5 if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3563,7 +3873,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>& uname_release="$libc_cv_uname_release" echo $ac_n "checking OS version for uname""... $ac_c" 1>&6 -echo "configure:3567: checking OS version for uname" >&5 +echo "configure:3877: checking OS version for uname" >&5 if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3584,22 +3894,15 @@ else config_uname= fi -echo $ac_n "checking stdio selection""... $ac_c" 1>&6 -echo "configure:3589: checking stdio selection" >&5 - -case $stdio in -libio) cat >> confdefs.h <<\EOF +cat >> confdefs.h <<\EOF #define USE_IN_LIBIO 1 EOF - ;; -default) stdio=stdio ;; -esac -echo "$ac_t""$stdio" 1>&6 + # Test for old glibc 2.0.x headers so that they can be removed properly # Search only in includedir. echo $ac_n "checking for old glibc 2.0.x headers""... $ac_c" 1>&6 -echo "configure:3603: checking for old glibc 2.0.x headers" >&5 +echo "configure:3906: checking for old glibc 2.0.x headers" >&5 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h" then old_glibc_headers=yes @@ -3660,7 +3963,7 @@ if test $shared = default; then fi echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6 -echo "configure:3664: checking whether -fPIC is default" >&5 +echo "configure:3967: checking whether -fPIC is default" >&5 if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3693,6 +3996,8 @@ case "$add_ons" in esac + + if test "`(cd $srcdir; pwd)`" = "`pwd`"; then config_makefile= else @@ -3886,6 +4191,7 @@ s%@OLD_DEBIAN_INSTALL_INFO@%$OLD_DEBIAN_ s%@BISON@%$BISON%g s%@VERSIONING@%$VERSIONING%g s%@libc_cv_asm_protected_directive@%$libc_cv_asm_protected_directive%g +s%@libc_cv_initfinit_array@%$libc_cv_initfinit_array%g s%@libc_cv_z_nodelete@%$libc_cv_z_nodelete%g s%@libc_cv_z_nodlopen@%$libc_cv_z_nodlopen%g s%@libc_cv_z_initfirst@%$libc_cv_z_initfirst%g @@ -3900,7 +4206,6 @@ s%@libc_cv_gcc_unwind_find_fde@%$libc_cv s%@uname_sysname@%$uname_sysname%g s%@uname_release@%$uname_release%g s%@uname_version@%$uname_version%g -s%@stdio@%$stdio%g s%@old_glibc_headers@%$old_glibc_headers%g s%@libc_cv_slibdir@%$libc_cv_slibdir%g s%@libc_cv_localedir@%$libc_cv_localedir%g @@ -3922,6 +4227,7 @@ s%@static_nss@%$static_nss%g s%@nopic_initfini@%$nopic_initfini%g s%@DEFINES@%$DEFINES%g s%@linux_doors@%$linux_doors%g +s%@mach_interface_list@%$mach_interface_list%g s%@VERSION@%$VERSION%g s%@RELEASE@%$RELEASE%g diff -durpN glibc-2.2.5/configure.in glibc-2.3/configure.in --- glibc-2.2.5/configure.in 2001-12-12 10:45:27.000000000 -0800 +++ glibc-2.3/configure.in 2002-10-01 20:03:15.000000000 -0700 @@ -86,15 +86,6 @@ AC_ARG_WITH(headers, dnl [default=compiler default]], sysheaders=$withval, sysheaders='') -AC_ARG_ENABLE(libio, dnl -[ --enable-libio build in GNU libio instead of GNU stdio], - [if test $enableval = yes; then - stdio=libio - else - stdio=stdio - fi], - stdio=default) - AC_ARG_ENABLE(sanity-checks, dnl [ --disable-sanity-checks really do not use threads (should not be used except in special situations) [default=yes]], @@ -148,6 +139,19 @@ AC_ARG_ENABLE(add-ons, dnl esac], [add_ons=]) +dnl Let the user avoid using TLS. Don't know why but... +dnl XXX For now we disable support by default. +AC_ARG_WITH(tls, dnl +[ --with-tls enable support for TLS], + usetls=$withval, usetls=no) + +AC_ARG_ENABLE(hidden-plt, dnl +[ --disable-hidden-plt do not hide internal function calls to avoid PLT], + hidden=$enableval, hidden=yes) +if test "x$hidden" = xno; then + AC_DEFINE(NO_HIDDEN) +fi + AC_CONFIG_SUBDIRS($add_ons) add_ons_pfx= if test x"$add_ons" != x; then @@ -181,7 +185,9 @@ dnl static NSS modules. AC_ARG_ENABLE(static-nss, dnl [ --enable-static-nss build static NSS modules [default=no]], static_nss=$enableval, static_nss=no) -if test x"$static_nss" = xyes; then +dnl Enable static NSS also if we build no shared objects. +if test x"$static_nss" = xyes || test x"$shared" = xno; then + static_nss=yes AC_DEFINE(DO_STATIC_NSS) fi @@ -249,7 +255,7 @@ case "$host_os" in # i586-linuxaout is mangled into i586-pc-linux-gnuaout linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*) ;; -gnu* | linux* | sysv4* | solaris2* | irix6*) +gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*) # These systems (almost) always use the ELF format. elf=yes ;; @@ -313,11 +319,9 @@ m68k) base_machine=m68k machine=m68k/m6 m88???) base_machine=m88k machine=m88k/$machine ;; m88k) base_machine=m88k machine=m88k/m88100 ;; mips64*) base_machine=mips64 machine=mips/mips64/$machine ;; -mips*) base_machine=mips - case "`uname -m`" in - IP22) machine=mips/mips3 ;; - *) machine=mips/$machine ;; - esac ;; +mips*) base_machine=mips machine=mips/$machine ;; +powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;; +powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;; s390) base_machine=s390 machine=s390/s390-32 ;; s390x) base_machine=s390 machine=s390/s390-64 ;; sh3*) base_machine=sh machine=sh/sh3 ;; @@ -335,6 +339,7 @@ sparc64 | ultrasparc) sparc64b | ultrasparc3) base_machine=sparc machine=sparc/sparc64/sparcv9b ;; thumb*) base_machine=thumb machine=arm/thumb/$machine ;; +*) base_machine=$machine ;; esac changequote([,])dnl AC_SUBST(base_machine) @@ -583,9 +588,8 @@ fi # These programs are version sensitive. AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v, - [version \([egcygnustpi-]*[0-9.]*\)], - [*gcc-2.9[5-9].*|*2.8.[1-9]*|*2.9|*2.9.[0-9]*|2.9[5-9]*|3.[0-9]*|cygnus-2.9[1-9]*|gcc-2.9[5-9]|gcc-2.1[0-9][0-9]|sgicc-*], - critic_missing=gcc) + [version \([egcygnustpi-]*[0-9.]*\)], [3.[2-9]*], + critic_missing="$critic_missing gcc") AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version, [GNU Make[^0-9]*\([0-9][0-9.]*\)], [3.79* | 3.[89]*], critic_missing="$critic_missing make") @@ -606,7 +610,7 @@ AC_CHECK_PROG_VER(MAKEINFO, makeinfo, -- [GNU texinfo.* \([0-9][0-9.]*\)], [4.*], MAKEINFO=: aux_missing="$aux_missing makeinfo") -AC_CHECK_PROG_VER(SED, gsed sed, --version, +AC_CHECK_PROG_VER(SED, sed, --version, [GNU sed version \([0-9]*\.[0-9.]*\)], [3.0[2-9]*|3.[1-9]*|[4-9]*], SED=: aux_missing="$aux_missing sed") @@ -619,7 +623,7 @@ fi AC_SUBST(cross_compiling) AC_PROG_CPP LIBC_PROG_BINUTILS -AC_CHECK_TOOL(MIG, mig) +AC_CHECK_TOOL(MIG, mig, MISSING) # Accept binutils 2.10.1 or newer (and also any ia64 2.9 version) # XXX Commented out because it filters out too many good versions. @@ -654,7 +658,7 @@ char b; void c(void) {} EOF $CC $CFLAGS -c conftest.c -$AR cr conftest.a conftest.c +$AR cr conftest.a conftest.o cp conftest.a conftest2.a $RANLIB conftest.a if cmp -s conftest.a conftest2.a; then @@ -877,9 +881,32 @@ if test $libc_cv_asm_set_directive = yes AC_DEFINE(HAVE_ASM_SET_DIRECTIVE) fi +AC_CACHE_CHECK(for assembler .type directive prefix, + libc_cv_asm_type_prefix, [dnl +libc_cv_asm_type_prefix=no +for ac_try_prefix in '@' '%' '#'; do + cat > conftest.s </dev/null; then + libc_cv_asm_type_prefix=${ac_try_prefix} + fi + rm -f conftest* + test "x$libc_cv_asm_type_prefix" != xno && break +done]) +if test "x$libc_cv_asm_type_prefix" != xno; then + AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix}) +fi + # The Aix ld uses global .symbol_names instead of symbol_names. -case "$os" in -aix4.3*) +# Unfortunately also used in the PPC64 ELF ABI. +case "${os}${machine}" in +aix4.3* | linux*powerpc/powerpc64*) AC_DEFINE(HAVE_ASM_GLOBAL_DOT_NAME) esac @@ -993,6 +1020,117 @@ EOF fi rm -f conftest*]) AC_SUBST(libc_cv_asm_protected_directive) + AC_DEFINE(HAVE_PROTECTED) + AC_DEFINE(HAVE_HIDDEN) + + if test $libc_cv_asm_protected_directive = yes; then + AC_CACHE_CHECK(whether __attribute__((visibility())) is supported, + libc_cv_visibility_attribute, + [cat > conftest.c </dev/null 2>&1; then + if grep '\.hidden.*foo' conftest.s >/dev/null; then + if grep '\.protected.*bar' conftest.s >/dev/null; then + libc_cv_visibility_attribute=yes + fi + fi + fi + rm -f conftest.[cs] + ]) + if test $libc_cv_visibility_attribute = yes; then + AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE) + fi + fi + + if test $libc_cv_visibility_attribute = yes; then + AC_CACHE_CHECK(for broken __attribute__((visibility())), + libc_cv_broken_visibility_attribute, + [cat > conftest.c </dev/null 2>&1; then +changequote(,)dnl + if grep '\.hidden[ _]foo' conftest.s >/dev/null; then +changequote([,])dnl + libc_cv_broken_visibility_attribute=no + fi + fi + rm -f conftest.c conftest.s + ]) + if test $libc_cv_broken_visibility_attribute = yes; then + AC_DEFINE(HAVE_BROKEN_VISIBILITY_ATTRIBUTE) + fi + fi + + AC_CACHE_CHECK(for broken __attribute__((alias())), + libc_cv_broken_alias_attribute, + [cat > conftest.c </dev/null 2>&1; then + if grep 'xyzzy' conftest.s >/dev/null && + grep 'abccb' conftest.s >/dev/null; then + libc_cv_broken_alias_attribute=no + fi + fi + rm -f conftest.c conftest.s + ]) + if test $libc_cv_broken_alias_attribute = yes; then + AC_DEFINE(HAVE_BROKEN_ALIAS_ATTRIBUTE) + fi + + if test $libc_cv_visibility_attribute = yes -a $gnu_ld = yes; then + AC_CACHE_CHECK(whether to put _rtld_local into .sdata section, + libc_cv_have_sdata_section, + [echo "int i;" > conftest.c + libc_cv_have_sdata_section=no + if ${CC-cc} -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \ + | grep '\.sdata' >/dev/null; then + libc_cv_have_sdata_section=yes + fi + rm -f conftest.c conftest.so + ]) + if test $libc_cv_have_sdata_section = yes; then + AC_DEFINE(HAVE_SDATA_SECTION) + fi + fi + + AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support, + libc_cv_initfinit_array, [dnl + cat > conftest.c <&AC_FD_CC]) + then + if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then + libc_cv_initfinit_array=yes + else + libc_cv_initfinit_array=no + fi + else + libc_cv_initfinit_array=no + fi + rm -f conftest*]) + AC_SUBST(libc_cv_initfinit_array) + if test $libc_cv_initfinit_array = yes; then + AC_DEFINE(HAVE_INITFINI_ARRAY) + fi AC_CACHE_CHECK(for -z nodelete option, libc_cv_z_nodelete, [dnl @@ -1059,8 +1197,9 @@ EOF AC_CACHE_CHECK(for -z combreloc, libc_cv_z_combreloc, [dnl cat > conftest.c < conftest.c <&AC_FD_CC]); then + if ${CC-cc} $CFLAGS -DCHECK__register_frame_info -nostdlib -nostartfiles \ + -o conftest conftest.c -lgcc -lgcc_eh -v 2>&1 >/dev/null \ + | grep -q -- --eh-frame-hdr; then + libc_cv_gcc_dwarf2_unwind_info=no_registry_needed + else + libc_cv_gcc_dwarf2_unwind_info=static + fi +else + libc_cv_gcc_dwarf2_unwind_info=no +fi if test $libc_cv_gcc_dwarf2_unwind_info = no; then if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame -nostdlib -nostartfiles @@ -1392,6 +1545,25 @@ if test "$libc_cv_gcc_builtin_expect" = AC_DEFINE(HAVE_BUILTIN_EXPECT) fi +AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl +cat > conftest.c <<\EOF +void zero (void *x) +{ + __builtin_memset (x, 0, 1000); +} +EOF +dnl +if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]); +then + libc_cv_gcc_builtin_memset=no +else + libc_cv_gcc_builtin_memset=yes +fi +rm -f conftest* ]) +if test "$libc_cv_gcc_builtin_memset" = yes ; then + AC_DEFINE(HAVE_BUILTIN_MEMSET) +fi + dnl Check whether the compiler supports subtraction of local labels. AC_CACHE_CHECK(for local label subtraction, libc_cv_gcc_subtract_local_labels, [cat > conftest.c < conftest.c <<\EOF +__thread int a = 42; +EOF +if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AC_FD_CC]); then + libc_cv_gcc___thread=yes +else + libc_cv_gcc___thread=no +fi +rm -f conftest*]) +if test "$libc_cv_gcc___thread" = yes; then + AC_DEFINE(HAVE___THREAD) +fi + + dnl Check whether we have the gd library available. AC_MSG_CHECKING(for libgd) if test "$with_gd" != "no"; then @@ -1547,13 +1735,8 @@ else config_uname= fi -AC_MSG_CHECKING(stdio selection) -AC_SUBST(stdio) -case $stdio in -libio) AC_DEFINE(USE_IN_LIBIO) ;; -default) stdio=stdio ;; -esac -AC_MSG_RESULT($stdio) +dnl This is tested by existing code and it's simpler to avoid changing it. +AC_DEFINE(USE_IN_LIBIO) # Test for old glibc 2.0.x headers so that they can be removed properly # Search only in includedir. @@ -1632,6 +1815,9 @@ case "$add_ons" in esac AC_SUBST(linux_doors) +dnl See sysdeps/mach/configure.in for this variable. +AC_SUBST(mach_interface_list) + if test "`(cd $srcdir; pwd)`" = "`pwd`"; then config_makefile= else diff -durpN glibc-2.2.5/conform/data/string.h-data glibc-2.3/conform/data/string.h-data --- glibc-2.2.5/conform/data/string.h-data 2000-02-27 15:25:05.000000000 -0800 +++ glibc-2.3/conform/data/string.h-data 2002-04-23 10:37:04.000000000 -0700 @@ -16,6 +16,9 @@ function {char*} strcpy (char*, const ch function size_t strcspn (const char*, const char*) function {char*} strdup (const char*) function {char*} strerror (int) +#ifdef XOPEN2K +function {char*} strerror_r (int, char*, size_t) +#endif function size_t strlen (const char*) function {char*} strncat (char*, const char*, size_t) function int strncmp (const char*, const char*, size_t) diff -durpN glibc-2.2.5/COPYING.LIB glibc-2.3/COPYING.LIB --- glibc-2.2.5/COPYING.LIB 2001-07-05 22:13:57.000000000 -0700 +++ glibc-2.3/COPYING.LIB 2002-08-26 21:52:29.000000000 -0700 @@ -90,9 +90,8 @@ special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it -becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. @@ -140,8 +139,7 @@ included without limitation in the term making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control -compilation -and installation of the library. +compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of @@ -307,10 +305,10 @@ of these things: the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above @@ -477,14 +475,13 @@ have at least the "copyright" line and a notice is found. - + Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -495,17 +492,15 @@ does.> License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -Also add information on how to contact you by electronic and paper -mail. +Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or -your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James -Random Hacker. + Random Hacker. , 1 April 1990 Ty Coon, President of Vice diff -durpN glibc-2.2.5/cppflags-iterator.mk glibc-2.3/cppflags-iterator.mk --- glibc-2.2.5/cppflags-iterator.mk 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/cppflags-iterator.mk 2002-09-23 16:59:54.000000000 -0700 @@ -0,0 +1,7 @@ +# This file is included several times in a row, once +# for each element of $(lib)-routines and $(lib)-sysdeps_routines. + +cpp-src := $(firstword $(cpp-srcs-left)) +cpp-srcs-left := $(filter-out $(cpp-src),$(cpp-srcs-left)) + +CPPFLAGS-$(cpp-src) += -DNOT_IN_libc -DIS_IN_$(lib) diff -durpN glibc-2.2.5/crypt/crypt.c glibc-2.3/crypt/crypt.c --- glibc-2.2.5/crypt/crypt.c 2000-03-03 16:47:30.000000000 -0800 +++ glibc-2.3/crypt/crypt.c 2002-08-26 21:52:34.000000000 -0700 @@ -4,16 +4,16 @@ * Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. diff -durpN glibc-2.2.5/crypt/crypt_util.c glibc-2.3/crypt/crypt_util.c --- glibc-2.2.5/crypt/crypt_util.c 2000-03-03 16:47:30.000000000 -0800 +++ glibc-2.3/crypt/crypt_util.c 2002-08-26 21:52:34.000000000 -0700 @@ -4,16 +4,16 @@ * Copyright (C) 1991, 92, 93, 96, 97, 98, 2000 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. diff -durpN glibc-2.2.5/crypt/md5-crypt.c glibc-2.3/crypt/md5-crypt.c --- glibc-2.2.5/crypt/md5-crypt.c 2001-08-30 18:45:02.000000000 -0700 +++ glibc-2.3/crypt/md5-crypt.c 2001-12-29 07:09:15.000000000 -0800 @@ -247,9 +247,15 @@ __md5_crypt (const char *key, const char if (buflen < needed) { + char *new_buffer; + buflen = needed; - if ((buffer = realloc (buffer, buflen)) == NULL) + + new_buffer = (char *) realloc (buffer, buflen); + if (new_buffer == NULL) return NULL; + + buffer = new_buffer; } return __md5_crypt_r (key, salt, buffer, buflen); diff -durpN glibc-2.2.5/crypt/md5test.c glibc-2.3/crypt/md5test.c --- glibc-2.2.5/crypt/md5test.c 2000-03-03 16:47:30.000000000 -0800 +++ glibc-2.3/crypt/md5test.c 2001-12-31 21:55:15.000000000 -0800 @@ -35,10 +35,18 @@ main (int argc, char *argv[]) for (cnt = 0; cnt < (int) (sizeof (tests) / sizeof (tests[0])); ++cnt) { + int i; + __md5_init_ctx (&ctx); __md5_process_bytes (tests[cnt].input, strlen (tests[cnt].input), &ctx); __md5_finish_ctx (&ctx, sum); result |= memcmp (tests[cnt].result, sum, 16); + + __md5_init_ctx (&ctx); + for (i = 0; tests[cnt].input[i] != '\0'; ++i) + __md5_process_bytes (&tests[cnt].input[i], 1, &ctx); + __md5_finish_ctx (&ctx, sum); + result |= memcmp (tests[cnt].result, sum, 16); } return result; diff -durpN glibc-2.2.5/crypt/ufc.c glibc-2.3/crypt/ufc.c --- glibc-2.2.5/crypt/ufc.c 2001-07-05 22:18:49.000000000 -0700 +++ glibc-2.3/crypt/ufc.c 2002-08-26 21:52:34.000000000 -0700 @@ -4,16 +4,16 @@ * Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with the GNU C Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. diff -durpN glibc-2.2.5/csu/gmon-start.c glibc-2.3/csu/gmon-start.c --- glibc-2.2.5/csu/gmon-start.c 2001-07-25 15:13:41.000000000 -0700 +++ glibc-2.3/csu/gmon-start.c 2002-09-14 19:18:52.000000000 -0700 @@ -1,5 +1,5 @@ /* Code to enable profiling at program startup. - Copyright (C) 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995,1996,1997,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -35,6 +35,14 @@ extern void ENTRY_POINT; #endif extern void etext; +#ifndef TEXT_START +#ifdef ENTRY_POINT_DECL +#define TEXT_START ENTRY_POINT +#else +#define TEXT_START &ENTRY_POINT +#endif +#endif + #ifndef HAVE_INITFINI /* This function gets called at startup by the normal constructor mechanism. We link this file together with start.o to produce gcrt1.o, @@ -63,7 +71,11 @@ __gmon_start__ (void) #endif /* Start keeping profiling records. */ - __monstartup ((u_long) &ENTRY_POINT, (u_long) &etext); +#ifdef ENTRY_POINT_DECL + __monstartup ((u_long) ENTRY_POINT, (u_long) &etext); +#else + __monstartup ((u_long) TEXT_START, (u_long) &etext); +#endif /* Call _mcleanup before exiting; it will write out gmon.out from the collected data. */ diff -durpN glibc-2.2.5/csu/Makefile glibc-2.3/csu/Makefile --- glibc-2.2.5/csu/Makefile 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/csu/Makefile 2002-08-15 00:54:11.000000000 -0700 @@ -1,5 +1,5 @@ # Makefile for csu code for GNU C library. -# Copyright (C) 1995,96,97,98,99,2000,01 Free Software Foundation, Inc. +# Copyright (C) 1995,96,97,98,99,2000,01,2002 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -26,7 +26,9 @@ subdir := csu -routines = init-first libc-start $(libc-init) sysdep version check_fds +routines = init-first libc-start $(libc-init) sysdep version check_fds \ + libc-tls +elide-routines.os = libc-tls csu-dummies = $(filter-out $(start-installed-name),crt1.o Mcrt1.o) extra-objs = start.o gmon-start.o \ $(start-installed-name) g$(start-installed-name) $(csu-dummies) @@ -59,9 +61,7 @@ before-compile += $(objpfx)abi-tag.h generated += abi-tag.h endif -ifeq (yes,$(gnu-ld)) -libc-init = set-init -else +ifneq (yes,$(gnu-ld)) libc-init = munch-init $(objpfx)munch-init.c: munch.awk munch-tmpl.c $(+subdir_inits) $(AWK) -f $< subdirs='$(+init_subdirs)' $(word 2,$^) > $@-t diff -durpN glibc-2.2.5/csu/set-init.c glibc-2.3/csu/set-init.c --- glibc-2.2.5/csu/set-init.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/csu/set-init.c 1969-12-31 16:00:00.000000000 -0800 @@ -1,23 +0,0 @@ -/* Copyright (C) 1991, 1992, 1994, 1995, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include - -DEFINE_HOOK_RUNNER (__libc_subinit, __libc_init, - (int argc, char **argv, char **envp), (argc, argv, envp)) diff -durpN glibc-2.2.5/csu/version.c glibc-2.3/csu/version.c --- glibc-2.2.5/csu/version.c 2002-01-20 19:20:34.000000000 -0800 +++ glibc-2.3/csu/version.c 2002-02-08 17:28:00.000000000 -0800 @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,6 +17,7 @@ 02111-1307 USA. */ #include "version.h" +#include #include static const char __libc_release[] = RELEASE; @@ -33,6 +34,9 @@ Compiled by GNU CC version "__VERSION__" #ifdef GLIBC_OLDEST_ABI "The oldest ABI supported: " GLIBC_OLDEST_ABI ".\n" #endif +#ifdef USE_TLS +"Thread-local storage support included.\n" +#endif "Report bugs using the `glibcbug' script to .\n"; #include diff -durpN glibc-2.2.5/csu/Versions glibc-2.3/csu/Versions --- glibc-2.2.5/csu/Versions 2000-06-14 23:58:03.000000000 -0700 +++ glibc-2.3/csu/Versions 2002-09-24 22:28:36.000000000 -0700 @@ -1,16 +1,26 @@ +%include + libc { GLIBC_2.0 { - # global variables - _errno; - # helper functions __libc_init_first; __libc_start_main; +%if !(USE_TLS && HAVE___THREAD) + # global variables + _errno; + # variables in normal name space errno; +%endif } GLIBC_2.1 { # New special glibc functions. gnu_get_libc_release; gnu_get_libc_version; } + GLIBC_2.3 { +%if USE_TLS && HAVE___THREAD + # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol. + errno; +%endif + } } diff -durpN glibc-2.2.5/ctype/ctype.c glibc-2.3/ctype/ctype.c --- glibc-2.2.5/ctype/ctype.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/ctype/ctype.c 2002-09-23 22:11:42.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,97,99,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -36,6 +36,11 @@ func (isspace, _ISspace) func (isupper, _ISupper) func (isxdigit, _ISxdigit) +#define __ctype_tolower \ + ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128) +#define __ctype_toupper \ + ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128) + int tolower (int c) { diff -durpN glibc-2.2.5/ctype/ctype-extn.c glibc-2.3/ctype/ctype-extn.c --- glibc-2.2.5/ctype/ctype-extn.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/ctype/ctype-extn.c 2002-09-01 11:01:55.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1997, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,6 +19,11 @@ #define __NO_CTYPE #include +#define __ctype_tolower \ + ((uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128) +#define __ctype_toupper \ + ((uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128) + /* Real function versions of the non-ANSI ctype functions. isblank is now in ISO C99 but we leave it here. */ @@ -59,3 +64,4 @@ __isblank_l (int c, __locale_t l) { return __isctype_l (c, _ISblank, l); } +weak_alias (__isblank_l, isblank_l) diff -durpN glibc-2.2.5/ctype/ctype.h glibc-2.3/ctype/ctype.h --- glibc-2.2.5/ctype/ctype.h 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/ctype/ctype.h 2002-09-02 11:48:00.000000000 -0700 @@ -1,4 +1,5 @@ -/* Copyright (C) 1991,92,93,95,96,97,98,99,2001 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,02 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -64,6 +65,11 @@ enum /* These are defined in ctype-info.c. The declarations here must match those in localeinfo.h. + In the thread-specific locale model (see `uselocale' in ) + we cannot use global variables for these as was done in the past. + Instead, the following accessor functions return the address of + each variable, which is local to the current thread if multithreaded. + These point into arrays of 384, so they can be indexed by any `unsigned char' value [0,255]; by EOF (-1); or by any `signed char' value [-128,-1). ISO C requires that the ctype functions work for `unsigned @@ -72,18 +78,23 @@ enum rather than `unsigned char's because tolower (EOF) must be EOF, which doesn't fit into an `unsigned char'. But today more important is that the arrays are also used for multi-byte character sets. */ -extern __const unsigned short int *__ctype_b; /* Characteristics. */ -extern __const __int32_t *__ctype_tolower; /* Case conversions. */ -extern __const __int32_t *__ctype_toupper; /* Case conversions. */ +extern __const unsigned short int **__ctype_b_loc (void) + __attribute__ ((__const)); +extern __const __int32_t **__ctype_tolower_loc (void) + __attribute__ ((__const)); +extern __const __int32_t **__ctype_toupper_loc (void) + __attribute__ ((__const)); -#define __isctype(c, type) \ - (__ctype_b[(int) (c)] & (unsigned short int) type) +#define __isctype(c, type) \ + ((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type) #define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */ #define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */ #define __exctype(name) extern int name (int) __THROW +__BEGIN_NAMESPACE_STD + /* The following names are all functions: int isCHARACTERISTIC(int c); which return nonzero iff C has CHARACTERISTIC. @@ -100,10 +111,6 @@ __exctype (isspace); __exctype (isupper); __exctype (isxdigit); -#ifdef __USE_ISOC99 -__exctype (isblank); -#endif - /* Return the lowercase version of C. */ extern int tolower (int __c) __THROW; @@ -111,6 +118,22 @@ extern int tolower (int __c) __THROW; /* Return the uppercase version of C. */ extern int toupper (int __c) __THROW; +__END_NAMESPACE_STD + + +/* ISO C99 introduced one new function. */ +#ifdef __USE_ISOC99 +__BEGIN_NAMESPACE_C99 + +__exctype (isblank); + +__END_NAMESPACE_C99 +#endif + +#ifdef __USE_GNU +/* Test C for a set of character classes according to MASK. */ +extern int isctype (int __c, int __mask) __THROW; +#endif #if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN @@ -137,16 +160,16 @@ __exctype (_tolower); if (__builtin_constant_p (c)) \ { \ int __c = (c); \ - __res = __c < -128 || __c > 255 ? __c : a[__c]; \ + __res = __c < -128 || __c > 255 ? __c : (a)[__c]; \ } \ else \ __res = f args; \ } \ else \ - __res = a[(int) (c)]; \ + __res = (a)[(int) (c)]; \ __res; })) -#ifndef __NO_CTYPE +#if !defined __NO_CTYPE && !defined __cplusplus # define isalnum(c) __isctype((c), _ISalnum) # define isalpha(c) __isctype((c), _ISalpha) # define iscntrl(c) __isctype((c), _IScntrl) @@ -159,7 +182,7 @@ __exctype (_tolower); # define isupper(c) __isctype((c), _ISupper) # define isxdigit(c) __isctype((c), _ISxdigit) -# ifdef __USE_ISOC99 +# ifdef __USE_ISOC99 # define isblank(c) __isctype((c), _ISblank) # endif @@ -167,27 +190,27 @@ __exctype (_tolower); extern __inline int tolower (int __c) __THROW { - return __c >= -128 && __c < 256 ? __ctype_tolower[__c] : __c; + return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; } extern __inline int toupper (int __c) __THROW { - return __c >= -128 && __c < 256 ? __ctype_toupper[__c] : __c; + return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; } # endif # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus -# define tolower(c) __tobody (c, tolower, __ctype_tolower, (c)) -# define toupper(c) __tobody (c, toupper, __ctype_toupper, (c)) -# endif /* Optimizing gcc */ +# define tolower(c) __tobody (c, tolower, *__ctype_tolower_loc (), (c)) +# define toupper(c) __tobody (c, toupper, *__ctype_toupper_loc (), (c)) +# endif /* Optimizing gcc */ # if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN # define isascii(c) __isascii (c) # define toascii(c) __toascii (c) -# define _tolower(c) ((int) __ctype_tolower[(int) (c)]) -# define _toupper(c) ((int) __ctype_toupper[(int) (c)]) +# define _tolower(c) ((int) (*__ctype_tolower_loc ())[(int) (c)]) +# define _toupper(c) ((int) (*__ctype_toupper_loc ())[(int) (c)]) # endif #endif /* Not __NO_CTYPE. */ @@ -214,38 +237,43 @@ toupper (int __c) __THROW # define __isctype_l(c, type, locale) \ ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type) -# define __exctype_l(name) extern int name (int, __locale_t) __THROW +# define __exctype_l(name) \ + extern int name (int, __locale_t) __THROW /* The following names are all functions: int isCHARACTERISTIC(int c, locale_t *locale); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ -__exctype_l (__isalnum_l); -__exctype_l (__isalpha_l); -__exctype_l (__iscntrl_l); -__exctype_l (__isdigit_l); -__exctype_l (__islower_l); -__exctype_l (__isgraph_l); -__exctype_l (__isprint_l); -__exctype_l (__ispunct_l); -__exctype_l (__isspace_l); -__exctype_l (__isupper_l); -__exctype_l (__isxdigit_l); +__exctype_l (isalnum_l); +__exctype_l (isalpha_l); +__exctype_l (iscntrl_l); +__exctype_l (isdigit_l); +__exctype_l (islower_l); +__exctype_l (isgraph_l); +__exctype_l (isprint_l); +__exctype_l (ispunct_l); +__exctype_l (isspace_l); +__exctype_l (isupper_l); +__exctype_l (isxdigit_l); -__exctype_l (__isblank_l); +__exctype_l (isblank_l); /* Return the lowercase version of C in locale L. */ extern int __tolower_l (int __c, __locale_t __l) __THROW; +extern int tolower_l (int __c, __locale_t __l) __THROW; /* Return the uppercase version of C. */ extern int __toupper_l (int __c, __locale_t __l) __THROW; +extern int toupper_l (int __c, __locale_t __l) __THROW; # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define __tolower_l(c, locale) \ __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale)) # define __toupper_l(c, locale) \ __tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale)) +# define tolower_l(c, locale) __tolower_l ((c), (locale)) +# define toupper_l(c, locale) __toupper_l ((c), (locale)) # endif /* Optimizing gcc */ @@ -265,8 +293,27 @@ extern int __toupper_l (int __c, __local # define __isblank_l(c,l) __isctype_l((c), _ISblank, (l)) # if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN -# define __isascii_l(c,l) __isascii(c) -# define __toascii_l(c,l) __toascii(c) +# define __isascii_l(c,l) ((l), __isascii (c)) +# define __toascii_l(c,l) ((l), __toascii (c)) +# endif + +# define isalnum_l(c,l) __isalnum_l ((c), (l)) +# define isalpha_l(c,l) __isalpha_l ((c), (l)) +# define iscntrl_l(c,l) __iscntrl_l ((c), (l)) +# define isdigit_l(c,l) __isdigit_l ((c), (l)) +# define islower_l(c,l) __islower_l ((c), (l)) +# define isgraph_l(c,l) __isgraph_l ((c), (l)) +# define isprint_l(c,l) __isprint_l ((c), (l)) +# define ispunct_l(c,l) __ispunct_l ((c), (l)) +# define isspace_l(c,l) __isspace_l ((c), (l)) +# define isupper_l(c,l) __isupper_l ((c), (l)) +# define isxdigit_l(c,l) __isxdigit_l ((c), (l)) + +# define isblank_l(c,l) __isblank_l ((c), (l)) + +# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN +# define isascii_l(c,l) __isascii_l ((c), (l)) +# define toascii_l(c,l) __toascii_l ((c), (l)) # endif # endif /* Not __NO_CTYPE. */ diff -durpN glibc-2.2.5/ctype/ctype-info.c glibc-2.3/ctype/ctype-info.c --- glibc-2.2.5/ctype/ctype-info.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/ctype/ctype-info.c 2002-09-05 14:45:14.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 95, 96, 97, 99, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,95,96,97,99,2000,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,29 +16,35 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define CTYPE_EXTERN_INLINE /* Define real functions for accessors. */ #include #include +__libc_tsd_define (, CTYPE_B) +__libc_tsd_define (, CTYPE_TOLOWER) +__libc_tsd_define (, CTYPE_TOUPPER) + + +#include +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3) + /* Defined in locale/C-ctype.c. */ -extern const char _nl_C_LC_CTYPE_class[]; -extern const char _nl_C_LC_CTYPE_class32[]; -extern const char _nl_C_LC_CTYPE_toupper[]; -extern const char _nl_C_LC_CTYPE_tolower[]; -extern const char _nl_C_LC_CTYPE_class_upper[]; -extern const char _nl_C_LC_CTYPE_class_lower[]; -extern const char _nl_C_LC_CTYPE_class_alpha[]; -extern const char _nl_C_LC_CTYPE_class_digit[]; -extern const char _nl_C_LC_CTYPE_class_xdigit[]; -extern const char _nl_C_LC_CTYPE_class_space[]; -extern const char _nl_C_LC_CTYPE_class_print[]; -extern const char _nl_C_LC_CTYPE_class_graph[]; -extern const char _nl_C_LC_CTYPE_class_blank[]; -extern const char _nl_C_LC_CTYPE_class_cntrl[]; -extern const char _nl_C_LC_CTYPE_class_punct[]; -extern const char _nl_C_LC_CTYPE_class_alnum[]; -extern const char _nl_C_LC_CTYPE_map_toupper[]; -extern const char _nl_C_LC_CTYPE_map_tolower[]; -extern const char _nl_C_LC_CTYPE_width[]; +extern const char _nl_C_LC_CTYPE_class[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class32[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_toupper[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_tolower[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_upper[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_lower[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_alpha[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_digit[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_xdigit[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_space[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_print[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_graph[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_blank[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_cntrl[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_punct[] attribute_hidden; +extern const char _nl_C_LC_CTYPE_class_alnum[] attribute_hidden; #define b(t,x,o) (((const t *) _nl_C_LC_CTYPE_##x) + o) @@ -48,24 +54,12 @@ const __int32_t *__ctype_tolower = b (__ const __int32_t *__ctype_toupper = b (__int32_t, toupper, 128); const __uint32_t *__ctype32_tolower = b (__uint32_t, tolower, 128); const __uint32_t *__ctype32_toupper = b (__uint32_t, toupper, 128); -const char *__ctype32_wctype[12] = -{ - b(char, class_upper, 32), - b(char, class_lower, 32), - b(char, class_alpha, 32), - b(char, class_digit, 32), - b(char, class_xdigit, 32), - b(char, class_space, 32), - b(char, class_print, 32), - b(char, class_graph, 32), - b(char, class_blank, 32), - b(char, class_cntrl, 32), - b(char, class_punct, 32), - b(char, class_alnum, 32) -}; -const char *__ctype32_wctrans[2] = -{ - b(char, map_toupper, 0), - b(char, map_tolower, 0) -}; -const char *__ctype32_width = b (char, width, 0); + +compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0); +compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0); +compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0); +compat_symbol (libc, __ctype32_b, __ctype32_b, GLIBC_2_0); +compat_symbol (libc, __ctype32_tolower, __ctype32_tolower, GLIBC_2_2); +compat_symbol (libc, __ctype32_toupper, __ctype32_toupper, GLIBC_2_2); + +#endif diff -durpN glibc-2.2.5/ctype/ctype_l.c glibc-2.3/ctype/ctype_l.c --- glibc-2.2.5/ctype/ctype_l.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/ctype/ctype_l.c 2002-08-07 19:08:11.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1997, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,97,2001,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,28 +22,31 @@ /* Provide real-function versions of all the ctype macros. */ #define func(name, type) \ - int name (int c, __locale_t l) { return __isctype_l (c, type, l); } + int __##name (int c, __locale_t l) { return __isctype_l (c, type, l); } \ + weak_alias (__##name, name) -func (__isalnum_l, _ISalnum) -func (__isalpha_l, _ISalpha) -func (__iscntrl_l, _IScntrl) -func (__isdigit_l, _ISdigit) -func (__islower_l, _ISlower) -func (__isgraph_l, _ISgraph) -func (__isprint_l, _ISprint) -func (__ispunct_l, _ISpunct) -func (__isspace_l, _ISspace) -func (__isupper_l, _ISupper) -func (__isxdigit_l, _ISxdigit) +func (isalnum_l, _ISalnum) +func (isalpha_l, _ISalpha) +func (iscntrl_l, _IScntrl) +func (isdigit_l, _ISdigit) +func (islower_l, _ISlower) +func (isgraph_l, _ISgraph) +func (isprint_l, _ISprint) +func (ispunct_l, _ISpunct) +func (isspace_l, _ISspace) +func (isupper_l, _ISupper) +func (isxdigit_l, _ISxdigit) int (__tolower_l) (int c, __locale_t l) { return l->__ctype_tolower[c]; } +weak_alias (__tolower_l, tolower_l) int (__toupper_l) (int c, __locale_t l) { return l->__ctype_toupper[c]; } +weak_alias (__toupper_l, toupper_l) diff -durpN glibc-2.2.5/ctype/isctype.c glibc-2.3/ctype/isctype.c --- glibc-2.2.5/ctype/isctype.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/ctype/isctype.c 2002-09-01 11:09:48.000000000 -0700 @@ -0,0 +1,31 @@ +/* Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +#undef __isctype + +int +__isctype (ch, mask) + int ch; + int mask; +{ + return (((uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128) + [(int) (ch)] & mask); +} +weak_alias (__isctype, isctype) diff -durpN glibc-2.2.5/ctype/Makefile glibc-2.3/ctype/Makefile --- glibc-2.2.5/ctype/Makefile 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/ctype/Makefile 2002-09-01 11:09:04.000000000 -0700 @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 1992, 1993, 1997 Free Software Foundation, Inc. +# Copyright (C) 1991, 1992, 1993, 1997, 2002 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -22,7 +22,7 @@ subdir := ctype headers := ctype.h -routines := ctype ctype-extn ctype_l +routines := ctype ctype-extn ctype_l isctype aux := ctype-info tests := test_ctype diff -durpN glibc-2.2.5/ctype/Versions glibc-2.3/ctype/Versions --- glibc-2.2.5/ctype/Versions 1999-12-08 11:45:24.000000000 -0800 +++ glibc-2.3/ctype/Versions 2002-09-02 11:48:00.000000000 -0700 @@ -15,4 +15,10 @@ libc { # global variables __ctype32_tolower; __ctype32_toupper; } + GLIBC_2.3 { + isctype; __isctype; + + # functions used by optimized macros in ctype.h + __ctype_b_loc; __ctype_tolower_loc; __ctype_toupper_loc; + } } diff -durpN glibc-2.2.5/debug/catchsegv.sh glibc-2.3/debug/catchsegv.sh --- glibc-2.2.5/debug/catchsegv.sh 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/debug/catchsegv.sh 2002-04-03 16:06:25.000000000 -0800 @@ -38,7 +38,7 @@ if test $# -eq 0; then ;; --v | --ve | --ver | --vers | --versi | --versio | --version) echo 'catchsegv (GNU libc) @VERSION@' - echo 'Copyright (C) 2001 Free Software Foundation, Inc. + echo 'Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Ulrich Drepper.' @@ -87,17 +87,18 @@ if test -f "$segv_output"; then sed '/Backtrace/q' "$segv_output" sed '1,/Backtrace/d' "$segv_output" | (while read line; do + line=`echo $line | sed "s@^$prog\\(\\[.*\\)@\1@"` case "$line" in - [*) addr=`echo "$line" | sed 's/^\[\(.*\)\]$/\1/'` - complete=`addr2line -f -e "$prog" $addr 2>/dev/null` - if test $? -eq 0; then - echo "`echo "$complete"|sed 'N;s/\(.*\)\n\(.*\)/\2(\1)/;'`$line" - else - echo "$line" - fi - ;; - *) echo "$line" - ;; + \[*) addr=`echo "$line" | sed 's/^\[\(.*\)\]$/\1/'` + complete=`addr2line -f -e "$prog" $addr 2>/dev/null` + if test $? -eq 0; then + echo "`echo "$complete"|sed 'N;s/\(.*\)\n\(.*\)/\2(\1)/;'`$line" + else + echo "$line" + fi + ;; + *) echo "$line" + ;; esac done) rm -f "$segv_output" diff -durpN glibc-2.2.5/debug/pcprofiledump.c glibc-2.3/debug/pcprofiledump.c --- glibc-2.2.5/debug/pcprofiledump.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/debug/pcprofiledump.c 2002-05-14 18:02:14.000000000 -0700 @@ -1,5 +1,5 @@ /* Dump information generated by PC profiling. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -18,7 +18,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -/* This is mainly and example. It shows how programs which want to use +/* This is mainly an example. It shows how programs which want to use the information should read the file. */ #ifdef HAVE_CONFIG_H # include @@ -49,6 +49,7 @@ /* Definitions of arguments for argp functions. */ static const struct argp_option options[] = { + { "unbuffered", 'u', NULL, 0, N_("Don't buffer output") }, { NULL, 0, NULL, 0, NULL } }; @@ -61,10 +62,13 @@ static const char args_doc[] = N_("[FILE /* Function to print some extra text in the help message. */ static char *more_help (int key, const char *text, void *input); +/* Prototype for option handler. */ +static error_t parse_opt (int key, char *arg, struct argp_state *state); + /* Data structure to communicate with argp functions. */ static struct argp argp = { - options, NULL, args_doc, doc, NULL, more_help + options, parse_opt, args_doc, doc, NULL, more_help }; @@ -171,6 +175,20 @@ main (int argc, char *argv[]) return 0; } +static error_t +parse_opt (int key, char *arg, struct argp_state *state) +{ + switch (key) + { + case 'u': + setbuf (stdout, NULL); + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + static char * more_help (int key, const char *text, void *input) { diff -durpN glibc-2.2.5/debug/xtrace.sh glibc-2.3/debug/xtrace.sh --- glibc-2.2.5/debug/xtrace.sh 2002-01-20 19:20:44.000000000 -0800 +++ glibc-2.3/debug/xtrace.sh 2002-05-14 19:29:59.000000000 -0700 @@ -23,20 +23,26 @@ pcprofiledump=@BINDIR@/pcprofiledump # Print usage message. do_usage() { - echo >&2 $"Try \`xtrace --help' for more information." + printf $"Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\n" + exit 0 +} + +# Refer to --help option. +help_info() { + printf >&2 $"Try \`xtrace --help' for more information.\n" exit 1 } # Message for missing argument. do_missing_arg() { - echo >&2 $"xtrace: option \`$1' requires an argument" - do_usage + printf >&2 $"xtrace: option \`$1' requires an argument.\n" + help_info } # Print help message do_help() { - echo $"Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]... -Trace execution of program by printing currently executed function. + printf $"Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\n" + printf $"Trace execution of program by printing currently executed function. --data=FILE Don't run the program, just print the data from FILE. @@ -47,7 +53,7 @@ Trace execution of program by printing c Mandatory arguments to long options are also mandatory for any corresponding short options. -Report bugs using the \`glibcbug' script to ." +Report bugs using the \`glibcbug' script to .\n" exit 0 } @@ -60,7 +66,7 @@ Written by Ulrich Drepper." exit 0 } -# Print out function name, file, and line number is a nice formatted way. +# Print out function name, file, and line number in a nicely formatted way. format_line() { fct=$1 file=${2%%:*} @@ -100,23 +106,20 @@ while test $# -gt 0; do -? | --h | --he | --hel | --help) do_help ;; - --v | --ve | --ver | --vers | --versi | --versio | --version) + -V | --v | --ve | --ver | --vers | --versi | --versio | --version) do_version ;; + --u | --us | --usa | --usag | --usage) + do_usage + ;; --) # Stop processing arguments. shift break ;; - --help) - do_help - ;; - --version) - do_version - ;; --*) - echo >&2 $"memprof: unrecognized option \`$1'" - do_usage + printf >&2 $"xtrace: unrecognized option \`$1'\n" + help_info ;; *) # Unknown option. This means the rest is the program name and parameters. @@ -128,25 +131,25 @@ done # See whether any arguments are left. if test $# -eq 0; then - echo >&2 $"No program name given" - do_usage + printf >&2 $"No program name given\n" + help_info fi # Determine the program name and check whether it exists. program=$1 shift if test ! -f "$program"; then - echo >2& $"executable \`$program' not found" - do_usage + printf >2& $"executable \`$program' not found\n" + help_info fi if test ! -x "$program"; then - echo >&2 $"\`$program' is no executable" - do_usage + printf >&2 $"\`$program' is no executable\n" + help_info fi # We have two modes. If a data file is given simply print the included data. printf "%-20s %-*s %6s\n" Function $(expr $COLUMNS - 30) File Line -for i in $(seq 1 $COLUMNS); do echo -n -; done; echo +for i in $(seq 1 $COLUMNS); do printf -; done; printf '\n' if test -n "$data"; then $pcprofiledump "$data" | sed 's/this = \([^,]*\).*/\1/' | @@ -158,21 +161,26 @@ if test -n "$data"; then fi done else - fifo=$(mktemp -u ${TMPDIR:-/tmp}/xprof.XXXXXX) + fifo=$(mktemp -u ${TMPDIR:-/tmp}/xtrace.XXXXXX) mkfifo -m 0600 $fifo || exit 1 + trap 'rm $fifo; exit 1' SIGINT SIGTERM SIGPIPE + # Now start the program and let it write to the FIFO. - $TERMINAL_PROG -T "xtrace - $program $*" -e /bin/sh -c "LD_PRELOAD=$pcprofileso PCPROFILE_OUTPUT=$fifo $program $*; read $fifo" & + $TERMINAL_PROG -T "xtrace - $program $*" -e /bin/sh -c "LD_PRELOAD=$pcprofileso PCPROFILE_OUTPUT=$fifo $program $*; read < $fifo" & termpid=$! - $pcprofiledump $fifo | - sed 's/this = \([^,]*\).*/\1/' | - addr2line -fC -e $program | + $pcprofiledump -u $fifo | + while read line; do + echo $line | + sed 's/this = \([^,]*\).*/\1/' | + addr2line -fC -e $program + done | while read fct; do read file if test "$fct" != '??' -a "$file" != '??:0'; then format_line $fct $file fi done - read -p "Press return to end the program." + read -p "Press return here to close $TERMINAL_PROG($program)." echo > $fifo rm $fifo fi diff -durpN glibc-2.2.5/dirent/bug-readdir1.c glibc-2.3/dirent/bug-readdir1.c --- glibc-2.2.5/dirent/bug-readdir1.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/dirent/bug-readdir1.c 2002-06-21 22:47:06.000000000 -0700 @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include +#include + + +int +main (void) +{ + DIR *dirp; + struct dirent* ent; + + /* open a dir stream */ + dirp = opendir ("/tmp"); + if (dirp == NULL) + { + if (errno == ENOENT) + exit (0); + + perror ("opendir"); + exit (1); + } + + /* close the dir stream, making it invalid */ + if (closedir (dirp)) + { + perror ("closedir"); + exit (1); + } + + ent = readdir (dirp); + + return ent != NULL || errno != EBADF; +} diff -durpN glibc-2.2.5/dirent/Makefile glibc-2.3/dirent/Makefile --- glibc-2.2.5/dirent/Makefile 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/dirent/Makefile 2002-06-21 22:46:07.000000000 -0700 @@ -1,4 +1,4 @@ -# Copyright (C) 1991,92,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc. +# Copyright (C) 1991-2000, 2002 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -28,7 +28,7 @@ routines := opendir closedir readdir rea alphasort64 versionsort64 distribute := dirstream.h -tests := list tst-seekdir opendir-tst1 +tests := list tst-seekdir opendir-tst1 bug-readdir1 include ../Rules diff -durpN glibc-2.2.5/dlfcn/bug-dlopen1.c glibc-2.3/dlfcn/bug-dlopen1.c --- glibc-2.2.5/dlfcn/bug-dlopen1.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/dlfcn/bug-dlopen1.c 2002-02-05 16:25:41.000000000 -0800 @@ -0,0 +1,12 @@ +/* Test case by Bruno Haible. It test whether the dynamic string + token expansion can handle $ signs which do not start one of the + recognized keywords. */ + +#include + +int main (void) +{ + dlopen ("gnu-gettext-GetURL$1", RTLD_GLOBAL | RTLD_LAZY); + dlopen ("gnu-gettext-GetURL${1", RTLD_GLOBAL | RTLD_LAZY); + return 0; +} diff -durpN glibc-2.2.5/dlfcn/bug-dlsym1.c glibc-2.3/dlfcn/bug-dlsym1.c --- glibc-2.2.5/dlfcn/bug-dlsym1.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/dlfcn/bug-dlsym1.c 2002-08-21 16:03:46.000000000 -0700 @@ -0,0 +1,30 @@ +/* Test case for bug in dlsym accessing dependency objects' symbols. */ + +#include +#include +#include +#include + +int main(void) +{ + void *handle; + char *c; + + setenv ("LD_LIBRARY_PATH", "/home/roland/build/tls-libc/dlfcn", 1); + + /* open lib1.so, which has the unresolved test symbol and a DT_NEEDED + on lib2.so, which provides the symbol */ + if ((handle = dlopen("bug-dlsym1-lib1.so", RTLD_NOW)) == NULL) { + printf("dlopen(\"bug-dlsym1-lib1.so\"): %s\n", dlerror()); + abort(); + } + + if ((c = dlsym(handle, "dlopen_test_variable")) == NULL) { + printf("dlsym(handle, \"dlopen_test_variable\"): %s\n", dlerror()); + abort(); + } + + (void) dlclose(handle); + + return 0; +} diff -durpN glibc-2.2.5/dlfcn/bug-dlsym1-lib1.c glibc-2.3/dlfcn/bug-dlsym1-lib1.c --- glibc-2.2.5/dlfcn/bug-dlsym1-lib1.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/dlfcn/bug-dlsym1-lib1.c 2002-08-23 01:52:49.000000000 -0700 @@ -0,0 +1,11 @@ +/* Test module for bug-dlsym1.c test case. */ + +extern int dlopen_test_variable; + +extern char foo (void); + +/* here to get the unresolved symbol in our .so */ +char foo(void) +{ + return dlopen_test_variable; +} diff -durpN glibc-2.2.5/dlfcn/bug-dlsym1-lib2.c glibc-2.3/dlfcn/bug-dlsym1-lib2.c --- glibc-2.2.5/dlfcn/bug-dlsym1-lib2.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/dlfcn/bug-dlsym1-lib2.c 2002-08-21 16:03:46.000000000 -0700 @@ -0,0 +1,3 @@ +/* Test module for bug-dlsym1.c test case. */ + +char dlopen_test_variable; diff -durpN glibc-2.2.5/dlfcn/Makefile glibc-2.3/dlfcn/Makefile --- glibc-2.2.5/dlfcn/Makefile 2001-08-09 17:13:11.000000000 -0700 +++ glibc-2.3/dlfcn/Makefile 2002-08-23 12:46:30.000000000 -0700 @@ -1,4 +1,4 @@ -# Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -22,7 +22,8 @@ extra-libs := libdl libdl-routines := dlopen dlclose dlsym dlvsym dlerror dladdr eval distribute := dlopenold.c glreflib1.c glreflib2.c failtestmod.c eval.c \ defaultmod1.c defaultmod2.c errmsg1mod.c modatexit.c \ - modcxaatexit.c modstatic.c + modcxaatexit.c modstatic.c \ + bug-dlsym1-lib1.c bug-dlsym1-lib2.c extra-libs-others := libdl @@ -35,13 +36,15 @@ endif libdl-shared-only-routines += eval ifeq (yes,$(build-shared)) -tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit +tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \ + bug-dlopen1 bug-dlsym1 ifeq (yes,$(have-protected)) tests += tstatexit endif endif modules-names = glreflib1 glreflib2 failtestmod defaultmod1 defaultmod2 \ - errmsg1mod modatexit modcxaatexit + errmsg1mod modatexit modcxaatexit \ + bug-dlsym1-lib1 bug-dlsym1-lib2 ifeq (yesyesyes,$(build-static)$(build-shared)$(elf)) tests += tststatic @@ -83,6 +86,7 @@ $(objpfx)errmsg1.out: $(objpfx)errmsg1 $ $(objpfx)tstatexit: $(libdl) $(objpfx)tstatexit.out: $(objpfx)tstatexit $(objpfx)modatexit.so +CPPFLAGS-modcxaatexit.c = -DNOT_IN_libc $(objpfx)tstcxaatexit: $(libdl) $(objpfx)tstcxaatexit.out: $(objpfx)tstcxaatexit $(objpfx)modcxaatexit.so @@ -93,6 +97,19 @@ $(objpfx)tststatic.out: $(objpfx)tststat $(objpfx)modstatic.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a +$(objpfx)bug-dlopen1: $(libdl) + +$(objpfx)bug-dlsym1: $(libdl) $(objpfx)bug-dlsym1-lib2.so +$(objpfx)bug-dlsym1.out: $(objpfx)bug-dlsym1-lib1.so \ + $(objpfx)bug-dlsym1-lib2.so +$(objpfx)bug-dlsym1-lib1.so: $(objpfx)bug-dlsym1-lib2.so \ + $(common-objpfx)libc.so \ + $(common-objpfx)libc_nonshared.a +$(objpfx)bug-dlsym1-lib2.so: $(common-objpfx)libc.so \ + $(common-objpfx)libc_nonshared.a + + + # Depend on libc.so so a DT_NEEDED is generated in the shared objects. # This ensures they will load libc.so for needed symbols if loaded by # a statically-linked program that hasn't already loaded it. diff -durpN glibc-2.2.5/dlfcn/modstatic.c glibc-2.3/dlfcn/modstatic.c --- glibc-2.2.5/dlfcn/modstatic.c 2001-08-04 11:59:22.000000000 -0700 +++ glibc-2.3/dlfcn/modstatic.c 2001-12-31 21:55:22.000000000 -0800 @@ -1,3 +1,5 @@ +extern int test (int); + int test (int a) { diff -durpN glibc-2.2.5/elf/cache.c glibc-2.3/elf/cache.c --- glibc-2.2.5/elf/cache.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/elf/cache.c 2002-09-20 17:28:19.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1999. @@ -71,18 +71,21 @@ print_entry (const char *lib, int flag, } switch (flag & FLAG_REQUIRED_MASK) { -#ifdef __sparc__ case FLAG_SPARC_LIB64: fputs (",64bit", stdout); -#endif -#if defined __ia64__ || defined __i386__ + break; case FLAG_IA64_LIB64: fputs (",IA-64", stdout); -#endif -#if defined __s390__ || defined __s390x__ + break; + case FLAG_X8664_LIB64: + fputs (",x86-64", stdout); + break; case FLAG_S390_LIB64: fputs(",64bit", stdout); -#endif + break; + case FLAG_POWERPC_LIB64: + fputs(",64bit", stdout); + break; case 0: break; default: @@ -98,12 +101,14 @@ print_entry (const char *lib, int flag, [0] = "Linux", [1] = "Hurd", [2] = "Solaris", - [3] = N_("Unknown OS") + [3] = "FreeBSD", + [4] = N_("Unknown OS") }; +#define MAXTAG (sizeof abi_tag_os / sizeof abi_tag_os[0] - 1) unsigned int os = osversion >> 24; printf (_(", OS ABI: %s %d.%d.%d"), - _(abi_tag_os[os > 3 ? 3 : os]), + _(abi_tag_os[os > MAXTAG ? MAXTAG : os]), (osversion >> 16) & 0xff, (osversion >> 8) & 0xff, osversion & 0xff); diff -durpN glibc-2.2.5/elf/chroot_canon.c glibc-2.3/elf/chroot_canon.c --- glibc-2.2.5/elf/chroot_canon.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/elf/chroot_canon.c 2001-12-29 07:11:43.000000000 -0800 @@ -1,5 +1,5 @@ /* Return the canonical absolute name of a given file inside chroot. - Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -42,8 +42,13 @@ char * chroot_canon (const char *chroot, const char *name) { - char *rpath, *dest, *extra_buf = NULL, *rpath_root; - const char *start, *end, *rpath_limit; + char *rpath; + char *dest; + char *extra_buf = NULL; + char *rpath_root; + const char *start; + const char *end; + const char *rpath_limit; int num_links = 0; size_t chroot_len = strlen (chroot); @@ -94,16 +99,18 @@ chroot_canon (const char *chroot, const if (dest + (end - start) >= rpath_limit) { ptrdiff_t dest_offset = dest - rpath; + char *new_rpath; new_size = rpath_limit - rpath; if (end - start + 1 > PATH_MAX) new_size += end - start + 1; else new_size += PATH_MAX; - rpath = realloc (rpath, new_size); - rpath_limit = rpath + new_size; - if (rpath == NULL) + new_rpath = (char *) realloc (rpath, new_size); + if (new_rpath == NULL) return NULL; + rpath = new_rpath; + rpath_limit = rpath + new_size; dest = rpath + dest_offset; } diff -durpN glibc-2.2.5/elf/circleload1.c glibc-2.3/elf/circleload1.c --- glibc-2.2.5/elf/circleload1.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/circleload1.c 2002-07-16 16:18:39.000000000 -0700 @@ -0,0 +1,164 @@ +#include +#include +#include +#include +#include +#include + +static int +check_loaded_objects (const char **loaded) +{ + struct link_map *lm; + int n; + int *found = NULL; + int errors = 0; + + for (n = 0; loaded[n]; n++) + /* NOTHING */; + + if (n) + { + found = (int *) alloca (sizeof (int) * n); + memset (found, 0, sizeof (int) * n); + } + + printf(" Name\n"); + printf(" --------------------------------------------------------\n"); + for (lm = _r_debug.r_map; lm; lm = lm->l_next) + { + if (lm->l_name && lm->l_name[0]) + printf(" %s, count = %d\n", lm->l_name, (int) lm->l_opencount); + if (lm->l_type == lt_loaded && lm->l_name) + { + int match = 0; + for (n = 0; loaded[n] != NULL; n++) + { + if (strcmp (basename (loaded[n]), basename (lm->l_name)) == 0) + { + found[n] = 1; + match = 1; + break; + } + } + + if (match == 0) + { + ++errors; + printf ("ERRORS: %s is not unloaded\n", lm->l_name); + } + } + } + + for (n = 0; loaded[n] != NULL; n++) + { + if (found[n] == 0) + { + ++errors; + printf ("ERRORS: %s is not loaded\n", loaded[n]); + } + } + + return errors; +} + +static int +load_dso (const char **loading, int undef, int flag) +{ + void *obj; + const char *loaded[] = { NULL, NULL, NULL, NULL }; + int errors = 0; + const char *errstring; + + printf ("\nThis is what is in memory now:\n"); + errors += check_loaded_objects (loaded); + + printf ("Loading shared object %s: %s\n", loading [0], + flag == RTLD_LAZY ? "RTLD_LAZY" : "RTLD_NOW"); + obj = dlopen (loading [0], flag); + if (obj == NULL) + { + if (flag == RTLD_LAZY) + { + ++errors; + printf ("ERRORS: dlopen shouldn't fail for RTLD_LAZY\n"); + } + + errstring = dlerror (); + if (strstr (errstring, "undefined symbol") == 0 + || strstr (errstring, "circlemod2_undefined") == 0) + { + ++errors; + printf ("ERRORS: dlopen: `%s': Invalid error string\n", + errstring); + } + else + printf ("dlopen: %s\n", errstring); + } + else + { + if (undef && flag == RTLD_NOW) + { + ++errors; + printf ("ERRORS: dlopen shouldn't work for RTLD_NOW\n"); + } + + if (!undef) + { + int (*func) (void); + + func = dlsym (obj, "circlemod1"); + if (func == NULL) + { + ++errors; + printf ("ERRORS: cannot get address of \"circlemod1\": %s\n", + dlerror ()); + } + else if (func () != 3) + { + ++errors; + printf ("ERRORS: function \"circlemod1\" returned wrong result\n"); + } + } + + loaded[0] = loading [0]; + loaded[1] = loading [1]; + loaded[2] = loading [2]; + } + errors += check_loaded_objects (loaded); + + if (obj) + { + printf ("UnLoading shared object %s\n", loading [0]); + dlclose (obj); + loaded[0] = NULL; + loaded[1] = NULL; + loaded[2] = NULL; + errors += check_loaded_objects (loaded); + } + + return errors; +} + +int +main (void) +{ + int errors = 0; + const char *loading[3]; + + loading [0] = "circlemod1a.so"; + loading [1] = "circlemod2a.so"; + loading [2] = "circlemod3a.so"; + errors += load_dso (loading, 0, RTLD_LAZY); + errors += load_dso (loading, 0, RTLD_NOW); + + loading [0] = "circlemod1.so"; + loading [1] = "circlemod2.so"; + loading [2] = "circlemod3.so"; + errors += load_dso (loading, 1, RTLD_LAZY); + errors += load_dso (loading, 1, RTLD_NOW); + + if (errors != 0) + printf ("%d errors found\n", errors); + + return errors; +} diff -durpN glibc-2.2.5/elf/circlemod1a.c glibc-2.3/elf/circlemod1a.c --- glibc-2.2.5/elf/circlemod1a.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/circlemod1a.c 2002-06-29 23:07:59.000000000 -0700 @@ -0,0 +1 @@ +#include "circlemod1.c" diff -durpN glibc-2.2.5/elf/circlemod1.c glibc-2.3/elf/circlemod1.c --- glibc-2.2.5/elf/circlemod1.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/circlemod1.c 2002-07-16 16:18:39.000000000 -0700 @@ -0,0 +1,7 @@ +extern int circlemod2 (void); + +int +circlemod1 (void) +{ + return circlemod2 (); +} diff -durpN glibc-2.2.5/elf/circlemod2a.c glibc-2.3/elf/circlemod2a.c --- glibc-2.2.5/elf/circlemod2a.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/circlemod2a.c 2002-07-16 16:18:39.000000000 -0700 @@ -0,0 +1,7 @@ +extern int circlemod3 (void); + +int +circlemod2 (void) +{ + return circlemod3 (); +} diff -durpN glibc-2.2.5/elf/circlemod2.c glibc-2.3/elf/circlemod2.c --- glibc-2.2.5/elf/circlemod2.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/circlemod2.c 2002-07-16 16:18:39.000000000 -0700 @@ -0,0 +1,9 @@ +extern void circlemod2_undefined (void); +extern int circlemod3 (void); + +int +circlemod2 (void) +{ + circlemod2_undefined (); + return circlemod3 (); +} diff -durpN glibc-2.2.5/elf/circlemod3a.c glibc-2.3/elf/circlemod3a.c --- glibc-2.2.5/elf/circlemod3a.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/circlemod3a.c 2002-06-29 23:07:59.000000000 -0700 @@ -0,0 +1 @@ +#include "circlemod3.c" diff -durpN glibc-2.2.5/elf/circlemod3.c glibc-2.3/elf/circlemod3.c --- glibc-2.2.5/elf/circlemod3.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/circlemod3.c 2002-07-16 16:18:39.000000000 -0700 @@ -0,0 +1,14 @@ +extern int circlemod1 (void); +extern int circlemod2 (void); + +int +circlemod3 (void) +{ + return 3; +} + +int +circlemod3a (void) +{ + return circlemod1 () + circlemod2 (); +} diff -durpN glibc-2.2.5/elf/dblloadmod1.c glibc-2.3/elf/dblloadmod1.c --- glibc-2.2.5/elf/dblloadmod1.c 2001-09-05 18:01:32.000000000 -0700 +++ glibc-2.3/elf/dblloadmod1.c 2001-12-24 01:09:23.000000000 -0800 @@ -1,4 +1,5 @@ extern int bar (void); +extern int foo (void); int foo (void) diff -durpN glibc-2.2.5/elf/dblloadmod2.c glibc-2.3/elf/dblloadmod2.c --- glibc-2.2.5/elf/dblloadmod2.c 2001-09-05 18:01:32.000000000 -0700 +++ glibc-2.3/elf/dblloadmod2.c 2001-12-24 01:09:23.000000000 -0800 @@ -1,4 +1,6 @@ extern int bar (void); +extern int baz (void); +extern int xyzzy (void); int baz (void) diff -durpN glibc-2.2.5/elf/dblloadmod3.c glibc-2.3/elf/dblloadmod3.c --- glibc-2.2.5/elf/dblloadmod3.c 2001-09-05 18:01:33.000000000 -0700 +++ glibc-2.3/elf/dblloadmod3.c 2001-12-24 01:09:23.000000000 -0800 @@ -1,3 +1,4 @@ +extern int bar (void); extern int baz (void); int diff -durpN glibc-2.2.5/elf/dl-addr.c glibc-2.3/elf/dl-addr.c --- glibc-2.2.5/elf/dl-addr.c 2001-08-22 19:45:31.000000000 -0700 +++ glibc-2.3/elf/dl-addr.c 2002-09-27 20:35:22.000000000 -0700 @@ -1,5 +1,5 @@ /* Locate the shared object symbol nearest a given address. - Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1996-2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,13 +28,13 @@ _dl_addr (const void *address, Dl_info * { const ElfW(Addr) addr = DL_LOOKUP_ADDRESS (address); struct link_map *l, *match; - const ElfW(Sym) *symtab, *matchsym; + const ElfW(Sym) *symtab, *matchsym, *symtabend; const char *strtab; ElfW(Word) strtabsize; /* Find the highest-addressed object that ADDRESS is not below. */ match = NULL; - for (l = _dl_loaded; l; l = l->l_next) + for (l = GL(dl_loaded); l; l = l->l_next) if (addr >= l->l_map_start && addr < l->l_map_end) { /* We know ADDRESS lies within L if in any shared object. @@ -60,22 +60,30 @@ _dl_addr (const void *address, Dl_info * /* Now we know what object the address lies in. */ info->dli_fname = match->l_name; - info->dli_fbase = (void *) match->l_addr; + info->dli_fbase = (void *) match->l_map_start; /* If this is the main program the information is incomplete. */ - if (__builtin_expect (info->dli_fbase == NULL, 0)) - { - info->dli_fname = _dl_argv[0]; - info->dli_fbase = (void *) match->l_map_start; - } + if (__builtin_expect (l->l_name[0], 'a') == '\0' + && l->l_type == lt_executable) + info->dli_fname = _dl_argv[0]; symtab = (const void *) D_PTR (match, l_info[DT_SYMTAB]); strtab = (const void *) D_PTR (match, l_info[DT_STRTAB]); + strtabsize = match->l_info[DT_STRSZ]->d_un.d_val; + if (match->l_info[DT_HASH] != NULL) + symtabend = symtab + ((Elf_Symndx *) D_PTR (match, l_info[DT_HASH]))[1]; + else + /* There is no direct way to determine the number of symbols in the + dynamic symbol table and no hash table is present. The ELF + binary is ill-formed but what shall we do? Use the beginning of + the string table which generally follows the symbol table. */ + symtabend = (const ElfW(Sym) *) strtab; + /* We assume that the string table follows the symbol table, because there is no way in ELF to know the size of the dynamic symbol table!! */ - for (matchsym = NULL; (void *) symtab < (void *) strtab; ++symtab) + for (matchsym = NULL; (void *) symtab < (void *) symtabend; ++symtab) if (addr >= match->l_addr + symtab->st_value && ((symtab->st_size == 0 && addr == match->l_addr + symtab->st_value) || addr < match->l_addr + symtab->st_value + symtab->st_size) @@ -83,7 +91,7 @@ _dl_addr (const void *address, Dl_info * && (matchsym == NULL || matchsym->st_value < symtab->st_value) && (ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)) - matchsym = symtab; + matchsym = (ElfW(Sym) *) symtab; if (matchsym) { @@ -100,3 +108,4 @@ _dl_addr (const void *address, Dl_info * return 1; } +libc_hidden_def (_dl_addr) diff -durpN glibc-2.2.5/elf/dl-close.c glibc-2.3/elf/dl-close.c --- glibc-2.2.5/elf/dl-close.c 2001-09-08 13:02:49.000000000 -0700 +++ glibc-2.3/elf/dl-close.c 2002-08-07 19:08:12.000000000 -0700 @@ -1,5 +1,5 @@ /* Close a shared object opened by `_dl_open'. - Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,58 @@ typedef void (*fini_t) (void); +#ifdef USE_TLS +/* Returns true we an non-empty was found. */ +static bool +remove_slotinfo (size_t idx, struct dtv_slotinfo_list *listp, size_t disp) +{ + if (idx - disp >= listp->len) + { + /* There must be a next entry. Otherwise would the index be wrong. */ + assert (listp->next != NULL); + + if (remove_slotinfo (idx, listp->next, disp + listp->len)) + return true; + + /* No non-empty entry. Search from the end of this elements + slotinfo array. */ + idx = disp + listp->len; + } + else + { + struct link_map *old_map = listp->slotinfo[idx - disp].map; + assert (old_map != NULL); + + /* Mark the entry as unused. */ + listp->slotinfo[idx - disp].gen = GL(dl_tls_generation) + 1; + listp->slotinfo[idx - disp].map = NULL; + + /* If this is not the last currently used entry no need to look + further. */ + if (old_map->l_tls_modid != GL(dl_tls_max_dtv_idx)) + return true; + + assert (old_map->l_tls_modid == GL(dl_tls_max_dtv_idx)); + } + + while (idx - disp > disp == 0 ? 1 + GL(dl_tls_static_nelem) : 0) + { + --idx; + + if (listp->slotinfo[idx - disp].map != NULL) + { + /* Found a new last used index. */ + GL(dl_tls_max_dtv_idx) = idx; + return true; + } + } + + /* No non-entry in this list element. */ + return false; +} +#endif + + void internal_function _dl_close (void *_map) @@ -46,6 +99,9 @@ _dl_close (void *_map) struct link_map *map = _map; unsigned int i; unsigned int *new_opencount; +#ifdef USE_TLS + bool any_tls = false; +#endif /* First see whether we can remove the object at all. */ if (__builtin_expect (map->l_flags_1 & DF_1_NODELETE, 0) @@ -57,20 +113,20 @@ _dl_close (void *_map) _dl_signal_error (0, map->l_name, NULL, N_("shared object not open")); /* Acquire the lock. */ - __libc_lock_lock_recursive (_dl_load_lock); + __libc_lock_lock_recursive (GL(dl_load_lock)); /* Decrement the reference count. */ if (map->l_opencount > 1 || map->l_type != lt_loaded) { /* There are still references to this object. Do nothing more. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0)) _dl_debug_printf ("\nclosing file=%s; opencount == %u\n", map->l_name, map->l_opencount); /* One decrement the object itself, not the dependencies. */ --map->l_opencount; - __libc_lock_unlock_recursive (_dl_load_lock); + __libc_lock_unlock_recursive (GL(dl_load_lock)); return; } @@ -125,7 +181,7 @@ _dl_close (void *_map) && imap->l_init_called) { /* When debugging print a message first. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) _dl_debug_printf ("\ncalling fini: %s\n\n", imap->l_name); /* Call its termination function. */ @@ -192,20 +248,34 @@ _dl_close (void *_map) if (__builtin_expect (imap->l_global, 0)) { /* This object is in the global scope list. Remove it. */ - unsigned int cnt = _dl_main_searchlist->r_nlist; + unsigned int cnt = GL(dl_main_searchlist)->r_nlist; do --cnt; - while (_dl_main_searchlist->r_list[cnt] != imap); + while (GL(dl_main_searchlist)->r_list[cnt] != imap); /* The object was already correctly registered. */ - while (++cnt < _dl_main_searchlist->r_nlist) - _dl_main_searchlist->r_list[cnt - 1] - = _dl_main_searchlist->r_list[cnt]; + while (++cnt < GL(dl_main_searchlist)->r_nlist) + GL(dl_main_searchlist)->r_list[cnt - 1] + = GL(dl_main_searchlist)->r_list[cnt]; - --_dl_main_searchlist->r_nlist; + --GL(dl_main_searchlist)->r_nlist; } +#ifdef USE_TLS + /* Remove the object from the dtv slotinfo array if it uses + TLS. */ + if (__builtin_expect (imap->l_tls_blocksize > 0, 0)) + { + any_tls = true; + + if (! remove_slotinfo (imap->l_tls_modid, + GL(dl_tls_dtv_slotinfo_list), 0)) + /* All dynamically loaded modules with TLS are unloaded. */ + GL(dl_tls_max_dtv_idx) = GL(dl_tls_static_nelem); + } +#endif + /* We can unmap all the maps at once. We determined the start address and length when we loaded the object and the `munmap' call does the rest. */ @@ -221,9 +291,9 @@ _dl_close (void *_map) if (imap->l_prev != NULL) imap->l_prev->l_next = imap->l_next; else - _dl_loaded = imap->l_next; + GL(dl_loaded) = imap->l_next; #endif - --_dl_nloaded; + --GL(dl_nloaded); if (imap->l_next) imap->l_next->l_prev = imap->l_prev; @@ -279,6 +349,14 @@ _dl_close (void *_map) } } +#ifdef USE_TLS + /* If we removed any object which uses TLS bumnp the generation + counter. */ + if (any_tls) + if (__builtin_expect (++GL(dl_tls_generation) == 0, 0)) + __libc_fatal (_("TLS generation counter wrapped! Please send report with the 'glibcbug' script.")); +#endif + /* Notify the debugger those objects are finalized and gone. */ _r_debug.r_state = RT_CONSISTENT; _dl_debug_state (); @@ -298,27 +376,68 @@ _dl_close (void *_map) free (list); /* Release the lock. */ - __libc_lock_unlock_recursive (_dl_load_lock); + __libc_lock_unlock_recursive (GL(dl_load_lock)); +} +libc_hidden_def (_dl_close) + + +#ifdef USE_TLS +static bool +free_slotinfo (struct dtv_slotinfo_list *elemp) +{ + size_t cnt; + + if (elemp == NULL) + /* Nothing here, all is removed (or there never was anything). */ + return true; + + if (!free_slotinfo (elemp->next)) + /* We cannot free the entry. */ + return false; + + /* The least we could do is remove next element (if there was any). */ + elemp->next = NULL; + + for (cnt = 0; cnt < elemp->len; ++cnt) + if (elemp->slotinfo[cnt].map != NULL) + /* Still used. */ + return false; + + /* We can remove the list element. */ + free (elemp); + + return true; } +#endif static void free_mem (void) { - if (__builtin_expect (_dl_global_scope_alloc, 0) != 0 - && _dl_main_searchlist->r_nlist == _dl_initial_searchlist.r_nlist) + if (__builtin_expect (GL(dl_global_scope_alloc), 0) != 0 + && GL(dl_main_searchlist)->r_nlist == GL(dl_initial_searchlist).r_nlist) { /* All object dynamically loaded by the program are unloaded. Free the memory allocated for the global scope variable. */ - struct link_map **old = _dl_main_searchlist->r_list; + struct link_map **old = GL(dl_main_searchlist)->r_list; /* Put the old map in. */ - _dl_main_searchlist->r_list = _dl_initial_searchlist.r_list; + GL(dl_main_searchlist)->r_list = GL(dl_initial_searchlist).r_list; /* Signal that the original map is used. */ - _dl_global_scope_alloc = 0; + GL(dl_global_scope_alloc) = 0; /* Now free the old map. */ free (old); } + +#ifdef USE_TLS + /* Free the memory allocated for the dtv slotinfo array. We can do + this only if all modules which used this memory are unloaded. + Also, the first element of the list does not have to be + deallocated. It was allocated in the dynamic linker (i.e., with + a different malloc). */ + if (free_slotinfo (GL(dl_tls_dtv_slotinfo_list)->next)) + GL(dl_tls_dtv_slotinfo_list)->next = NULL; +#endif } text_set_element (__libc_subfreeres, free_mem); diff -durpN glibc-2.2.5/elf/dl-conflict.c glibc-2.3/elf/dl-conflict.c --- glibc-2.2.5/elf/dl-conflict.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/dl-conflict.c 2002-08-26 21:52:34.000000000 -0700 @@ -0,0 +1,66 @@ +/* Resolve conflicts against already prelinked libraries. + Copyright (C) 2001, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2001. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "dynamic-link.h" + + +void +_dl_resolve_conflicts (struct link_map *l, ElfW(Rela) *conflict, + ElfW(Rela) *conflictend) +{ + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_RELOC, 0)) + _dl_printf ("\nconflict processing: %s\n", + l->l_name[0] ? l->l_name : rtld_progname); + + { + /* Do the conflict relocation of the object and library GOT and other + data. */ + + /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */ +#define RESOLVE_MAP(ref, version, flags) (*ref = NULL, NULL) +#define RESOLVE(ref, version, flags) (*ref = NULL, 0) +#define RESOLVE_CONFLICT_FIND_MAP(map, r_offset) \ + do { \ + while ((resolve_conflict_map->l_map_end < (ElfW(Addr)) (r_offset)) \ + || (resolve_conflict_map->l_map_start > (ElfW(Addr)) (r_offset))) \ + resolve_conflict_map = resolve_conflict_map->l_next; \ + \ + (map) = resolve_conflict_map; \ + } while (0) + + struct link_map *resolve_conflict_map __attribute__ ((__unused__)) + = GL(dl_loaded); + +#include "dynamic-link.h" + + GL(dl_num_cache_relocations) += conflictend - conflict; + + for (; conflict < conflictend; ++conflict) + elf_machine_rela (l, conflict, NULL, NULL, (void *) conflict->r_offset); + } +} diff -durpN glibc-2.2.5/elf/dl-debug.c glibc-2.3/elf/dl-debug.c --- glibc-2.2.5/elf/dl-debug.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/elf/dl-debug.c 2002-02-28 21:44:26.000000000 -0800 @@ -1,5 +1,5 @@ /* Communicate dynamic linker state to the debugger at runtime. - Copyright (C) 1996, 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -39,8 +39,8 @@ _dl_debug_initialize (ElfW(Addr) ldbase) /* Tell the debugger where to find the map of loaded objects. */ _r_debug.r_version = 1 /* R_DEBUG_VERSION XXX */; _r_debug.r_ldbase = ldbase; - _r_debug.r_map = _dl_loaded; - _r_debug.r_brk = (ElfW(Addr)) &_dl_debug_state; + _r_debug.r_map = GL(dl_loaded); + _r_debug.r_brk = (ElfW(Addr)) &INTUSE(_dl_debug_state); } return &_r_debug; @@ -55,3 +55,4 @@ void _dl_debug_state (void) { } +INTDEF (_dl_debug_state) diff -durpN glibc-2.2.5/elf/dl-deps.c glibc-2.3/elf/dl-deps.c --- glibc-2.2.5/elf/dl-deps.c 2001-09-13 21:23:07.000000000 -0700 +++ glibc-2.3/elf/dl-deps.c 2002-08-21 15:35:39.000000000 -0700 @@ -1,5 +1,5 @@ /* Load the dependencies of a mapped object. - Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -38,12 +39,6 @@ #define FILTERTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \ + DT_EXTRATAGIDX (DT_FILTER)) -/* This is zero at program start to signal that the global scope map is - allocated by rtld. Later it keeps the size of the map. It might be - reset if in _dl_close if the last global object is removed. */ -size_t _dl_global_scope_alloc; - -extern size_t _dl_platformlen; /* When loading auxiliary objects we must ignore errors. It's ok if an object is missing. */ @@ -52,6 +47,7 @@ struct openaux_args /* The arguments to openaux. */ struct link_map *map; int trace_mode; + int open_mode; const char *strtab; const char *name; @@ -64,12 +60,27 @@ openaux (void *a) { struct openaux_args *args = (struct openaux_args *) a; - args->aux = _dl_map_object (args->map, args->name, 0, - (args->map->l_type == lt_executable - ? lt_library : args->map->l_type), - args->trace_mode, 0); + args->aux = INTUSE(_dl_map_object) (args->map, args->name, 0, + (args->map->l_type == lt_executable + ? lt_library : args->map->l_type), + args->trace_mode, args->open_mode); } +static ptrdiff_t +internal_function +_dl_build_local_scope (struct link_map **list, struct link_map *map) +{ + struct link_map **p = list; + struct link_map **q; + + *p++ = map; + map->l_reserved = 1; + if (map->l_initfini) + for (q = map->l_initfini + 1; *q; ++q) + if (! (*q)->l_reserved) + p += _dl_build_local_scope (p, *q); + return p - list; +} /* We use a very special kind of list to track the path @@ -96,29 +107,29 @@ struct list char *__newp; \ \ /* DST must not appear in SUID/SGID programs. */ \ - if (__libc_enable_secure) \ - _dl_signal_error (0, __str, NULL, \ - N_("DST not allowed in SUID/SGID programs")); \ + if (INTUSE(__libc_enable_secure)) \ + INTUSE(_dl_signal_error) (0, __str, NULL, N_("\ +DST not allowed in SUID/SGID programs")); \ \ __newp = (char *) alloca (DL_DST_REQUIRED (l, __str, strlen (__str), \ __cnt)); \ \ - __result = DL_DST_SUBSTITUTE (l, __str, __newp, 0); \ + __result = INTUSE(_dl_dst_substitute) (l, __str, __newp, 0); \ \ if (*__result == '\0') \ { \ /* The replacement for the DST is not known. We can't \ processed. */ \ if (fatal) \ - _dl_signal_error (0, __str, NULL, N_("\ + INTUSE(_dl_signal_error) (0, __str, NULL, N_("\ empty dynamics string token substitution")); \ else \ { \ /* This is for DT_AUXILIARY. */ \ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)) \ - _dl_debug_printf ("cannot load auxiliary `%s' because of" \ - "empty dynamic string token " \ - "substitution\n", __str); \ + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) \ + INTUSE(_dl_debug_printf) (N_("\ +cannot load auxiliary `%s' because of empty dynamic string token " \ + "substitution\n"), __str); \ continue; \ } \ } \ @@ -131,7 +142,7 @@ void internal_function _dl_map_object_deps (struct link_map *map, struct link_map **preloads, unsigned int npreloads, - int trace_mode) + int trace_mode, int open_mode) { struct list known[1 + npreloads + 1]; struct list *runp, *tail; @@ -215,6 +226,7 @@ _dl_map_object_deps (struct link_map *ma args.strtab = strtab; args.map = l; args.trace_mode = trace_mode; + args.open_mode = open_mode; orig = runp; for (d = l->l_ld; d->d_tag != DT_NULL; ++d) @@ -229,7 +241,8 @@ _dl_map_object_deps (struct link_map *ma /* Store the tag in the argument structure. */ args.name = name; - err = _dl_catch_error (&objname, &errstring, openaux, &args); + err = INTUSE(_dl_catch_error) (&objname, &errstring, openaux, + &args); if (__builtin_expect (errstring != NULL, 0)) { if (err) @@ -278,21 +291,23 @@ _dl_map_object_deps (struct link_map *ma int err; /* Say that we are about to load an auxiliary library. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)) - _dl_debug_printf ("load auxiliary object=%s" - " requested by file=%s\n", name, - l->l_name[0] - ? l->l_name : _dl_argv[0]); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, + 0)) + INTUSE(_dl_debug_printf) ("load auxiliary object=%s" + " requested by file=%s\n", + name, + l->l_name[0] + ? l->l_name : rtld_progname); /* We must be prepared that the addressed shared object is not available. */ - err = _dl_catch_error (&objname, &errstring, openaux, - &args); + err = INTUSE(_dl_catch_error) (&objname, &errstring, + openaux, &args); if (__builtin_expect (errstring != NULL, 0)) { /* We are not interested in the error message. */ assert (errstring != NULL); - if (errstring != _dl_out_of_memory) + if (errstring != INTUSE(_dl_out_of_memory)) free ((char *) errstring); /* Simply ignore this error and continue the work. */ @@ -304,15 +319,17 @@ _dl_map_object_deps (struct link_map *ma int err; /* Say that we are about to load an auxiliary library. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)) - _dl_debug_printf ("load filtered object=%s" - " requested by file=%s\n", name, - l->l_name[0] - ? l->l_name : _dl_argv[0]); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, + 0)) + INTUSE(_dl_debug_printf) ("load filtered object=%s" + " requested by file=%s\n", + name, + l->l_name[0] + ? l->l_name : rtld_progname); /* For filter objects the dependency must be available. */ - err = _dl_catch_error (&objname, &errstring, openaux, - &args); + err = INTUSE(_dl_catch_error) (&objname, &errstring, + openaux, &args); if (__builtin_expect (errstring != NULL, 0)) { if (err) @@ -440,8 +457,8 @@ _dl_map_object_deps (struct link_map *ma l->l_initfini = (struct link_map **) malloc ((nneeded + 1) * sizeof needed[0]); if (l->l_initfini == NULL) - _dl_signal_error (ENOMEM, map->l_name, NULL, - N_("cannot allocate dependency list")); + INTUSE(_dl_signal_error) (ENOMEM, map->l_name, NULL, + N_("cannot allocate dependency list")); l->l_initfini[0] = l; memcpy (&l->l_initfini[1], needed, nneeded * sizeof needed[0]); } @@ -471,8 +488,8 @@ _dl_map_object_deps (struct link_map *ma (struct link_map **) malloc ((2 * nlist + 1) * sizeof (struct link_map *)); if (map->l_initfini == NULL) - _dl_signal_error (ENOMEM, map->l_name, NULL, - N_("cannot allocate symbol search list")); + INTUSE(_dl_signal_error) (ENOMEM, map->l_name, NULL, + N_("cannot allocate symbol search list")); map->l_searchlist.r_list = &map->l_initfini[nlist + 1]; @@ -491,6 +508,51 @@ _dl_map_object_deps (struct link_map *ma runp->map->l_reserved = 0; } + if (__builtin_expect(GL(dl_debug_mask) & DL_DEBUG_PRELINK, 0) != 0 + && map == GL(dl_loaded)) + { + /* If we are to compute conflicts, we have to build local scope + for each library, not just the ultimate loader. */ + for (i = 0; i < nlist; ++i) + { + struct link_map *l = map->l_searchlist.r_list[i]; + unsigned int j, cnt; + + /* The local scope has been already computed. */ + if (l == map + || (l->l_local_scope[0] + && l->l_local_scope[0]->r_nlist) != 0) + continue; + + if (l->l_info[AUXTAG] || l->l_info[FILTERTAG]) + { + /* As current DT_AUXILIARY/DT_FILTER implementation needs to be + rewritten, no need to bother with prelinking the old + implementation. */ + INTUSE(_dl_signal_error) (EINVAL, l->l_name, NULL, N_("\ +Filters not supported with LD_TRACE_PRELINKING")); + } + + cnt = _dl_build_local_scope (map->l_initfini, l); + assert (cnt <= nlist); + for (j = 0; j < cnt; j++) + map->l_initfini[j]->l_reserved = 0; + + l->l_local_scope[0] = + (struct r_scope_elem *) malloc (sizeof (struct r_scope_elem) + + (cnt + * sizeof (struct link_map *))); + if (l->l_local_scope[0] == NULL) + INTUSE(_dl_signal_error) (ENOMEM, map->l_name, NULL, + N_("cannot allocate symbol search list")); + l->l_local_scope[0]->r_nlist = cnt; + l->l_local_scope[0]->r_list = + (struct link_map **) (l->l_local_scope[0] + 1); + memcpy (l->l_local_scope[0]->r_list, map->l_initfini, + cnt * sizeof (struct link_map *)); + } + } + /* Maybe we can remove some relocation dependencies now. */ assert (map->l_searchlist.r_list[0] == map); for (i = 0; i < map->l_reldepsact; ++i) @@ -552,6 +614,10 @@ _dl_map_object_deps (struct link_map *ma (k - j) * sizeof (struct link_map *)); map->l_initfini[j] = here; + /* Don't insert further matches before the last + entry moved to the front. */ + ++j; + break; } } @@ -561,6 +627,7 @@ _dl_map_object_deps (struct link_map *ma map->l_initfini[nlist] = NULL; if (errno_reason) - _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, - objname, NULL, errstring); + INTUSE(_dl_signal_error) (errno_reason == -1 ? 0 : errno_reason, objname, + NULL, errstring); } +INTDEF (_dl_map_object_deps) diff -durpN glibc-2.2.5/elf/dl-dst.h glibc-2.3/elf/dl-dst.h --- glibc-2.2.5/elf/dl-dst.h 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/elf/dl-dst.h 2002-04-08 11:37:21.000000000 -0700 @@ -1,5 +1,5 @@ /* Handling of dynamic sring tokens. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,12 +25,13 @@ const char *__sf = strchr (name, '$'); \ \ if (__builtin_expect (__sf != NULL, 0)) \ - __cnt = _dl_dst_count (__sf, is_path); \ + __cnt = INTUSE(_dl_dst_count) (__sf, is_path); \ \ __cnt; }) /* Prototype for used function. */ extern size_t _dl_dst_count (const char *name, int is_path); +extern size_t _dl_dst_count_internal (const char *name, int is_path); /* Guess from the number of DSTs the length of the result string. */ @@ -57,16 +58,18 @@ extern size_t _dl_dst_count (const char else \ origin_len = (l)->l_origin == (char *) -1 ? 0 : strlen ((l)->l_origin); \ \ - __len + cnt * (MAX (origin_len, _dl_platformlen) - 7); }) + __len + cnt * (MAX (origin_len, GL(dl_platformlen)) - 7); }) /* Find origin of the executable. */ extern const char *_dl_get_origin (void); +extern const char *_dl_get_origin_internal (void); - -/* Perform the DST substitution. */ -#define DL_DST_SUBSTITUTE(l, name, res, is_path) \ - _dl_dst_substitute (l, name, res, is_path) +#ifdef IS_IN_rtld +# define _dl_get_origin INTUSE(_dl_get_origin) +#endif /* Prototype for used function. */ extern char *_dl_dst_substitute (struct link_map *l, const char *name, char *result, int is_path); +extern char *_dl_dst_substitute_internal (struct link_map *l, const char *name, + char *result, int is_path); diff -durpN glibc-2.2.5/elf/dl-error.c glibc-2.3/elf/dl-error.c --- glibc-2.2.5/elf/dl-error.c 2001-09-04 20:40:02.000000000 -0700 +++ glibc-2.3/elf/dl-error.c 2002-09-09 17:31:00.000000000 -0700 @@ -1,5 +1,5 @@ /* Error handling for runtime dynamic linker. - Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -49,6 +49,7 @@ __libc_tsd_define (static, DL_ERROR) variable since we have to avoid freeing it and so have to enable a pointer comparison. See below and in dlfcn/dlerror.c. */ const char _dl_out_of_memory[] = "out of memory"; +INTVARDEF(_dl_out_of_memory) /* This points to a function which is called when an continuable error is @@ -92,7 +93,7 @@ _dl_signal_error (int errcode, const cha { /* This is better than nothing. */ lcatch->objname = ""; - lcatch->errstring = _dl_out_of_memory; + lcatch->errstring = INTUSE(_dl_out_of_memory); } longjmp (lcatch->env, errcode ?: -1); } @@ -101,7 +102,7 @@ _dl_signal_error (int errcode, const cha /* Lossage while resolving the program's own symbols is always fatal. */ char buffer[1024]; _dl_fatal_printf ("%s: %s: %s%s%s%s%s\n", - _dl_argv[0] ?: "", + rtld_progname ?: "", occation ?: N_("error while loading shared libraries"), objname, *objname ? ": " : "", errstring, errcode ? ": " : "", @@ -110,6 +111,7 @@ _dl_signal_error (int errcode, const cha : "")); } } +INTDEF (_dl_signal_error) void @@ -117,6 +119,11 @@ internal_function _dl_signal_cerror (int errcode, const char *objname, const char *occation, const char *errstring) { + if (__builtin_expect (GL(dl_debug_mask) + & ~(DL_DEBUG_STATISTICS|DL_DEBUG_PRELINK), 0)) + INTUSE(_dl_debug_printf) ("%s: error: %s: %s (%s)\n", objname, occation, + errstring, receiver ? "continued" : "fatal"); + if (receiver) { /* We are inside _dl_receive_error. Call the user supplied @@ -125,7 +132,7 @@ _dl_signal_cerror (int errcode, const ch (*receiver) (errcode, objname, errstring); } else - _dl_signal_error (errcode, objname, occation, errstring); + INTUSE(_dl_signal_error) (errcode, objname, occation, errstring); } @@ -162,6 +169,8 @@ _dl_catch_error (const char **objname, c *errstring = c.errstring; return errcode == -1 ? 0 : errcode; } +INTDEF (_dl_catch_error) + void internal_function diff -durpN glibc-2.2.5/elf/dl-fini.c glibc-2.3/elf/dl-fini.c --- glibc-2.2.5/elf/dl-fini.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/elf/dl-fini.c 2002-03-11 00:31:59.000000000 -0800 @@ -1,5 +1,5 @@ /* Call the termination functions of loaded shared objects. - Copyright (C) 1995,96,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -47,15 +47,15 @@ _dl_fini (void) struct link_map **maps; /* XXX Could it be (in static binaries) that there is no object loaded? */ - assert (_dl_nloaded > 0); + assert (GL(dl_nloaded) > 0); /* Now we can allocate an array to hold all the pointers and copy the pointers in. */ - maps = (struct link_map **) alloca (_dl_nloaded + maps = (struct link_map **) alloca (GL(dl_nloaded) * sizeof (struct link_map *)); - for (l = _dl_loaded, i = 0; l != NULL; l = l->l_next) + for (l = GL(dl_loaded), i = 0; l != NULL; l = l->l_next) { - assert (i < _dl_nloaded); + assert (i < GL(dl_nloaded)); maps[i++] = l; @@ -63,10 +63,10 @@ _dl_fini (void) from underneath us. */ ++l->l_opencount; } - assert (i == _dl_nloaded); + assert (i == GL(dl_nloaded)); /* Now we have to do the sorting. */ - for (l = _dl_loaded->l_next; l != NULL; l = l->l_next) + for (l = GL(dl_loaded)->l_next; l != NULL; l = l->l_next) { unsigned int j; unsigned int k; @@ -77,7 +77,7 @@ _dl_fini (void) /* Find all object for which the current one is a dependency and move the found object (if necessary) in front. */ - for (k = j + 1; k < _dl_nloaded; ++k) + for (k = j + 1; k < GL(dl_nloaded); ++k) { struct link_map **runp; @@ -128,7 +128,7 @@ _dl_fini (void) /* `maps' now contains the objects in the right order. Now call the destructors. We have to process this array from the front. */ - for (i = 0; i < _dl_nloaded; ++i) + for (i = 0; i < GL(dl_nloaded); ++i) { l = maps[i]; @@ -146,9 +146,10 @@ _dl_fini (void) continue; /* When debugging print a message first. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) - _dl_debug_printf ("\ncalling fini: %s\n\n", - l->l_name[0] ? l->l_name : _dl_argv[0]); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) + INTUSE(_dl_debug_printf) ("\ncalling fini: %s\n\n", + l->l_name[0] + ? l->l_name : rtld_progname); /* First see whether an array is given. */ if (l->l_info[DT_FINI_ARRAY] != NULL) @@ -169,4 +170,15 @@ _dl_fini (void) ((fini_t) DL_DT_FINI_ADDRESS (l, l->l_addr + l->l_info[DT_FINI]->d_un.d_ptr)) (); } } + + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_STATISTICS, 0)) + { + INTUSE(_dl_debug_printf) ("\nruntime linker statistics:\n"); + INTUSE(_dl_debug_printf) ("\ + final number of relocations: %lu\n", + GL(dl_num_relocations)); + INTUSE(_dl_debug_printf) ("\ +final number of relocations from cache: %lu\n", + GL(dl_num_cache_relocations)); + } } diff -durpN glibc-2.2.5/elf/dl-fxstat64.c glibc-2.3/elf/dl-fxstat64.c --- glibc-2.2.5/elf/dl-fxstat64.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/dl-fxstat64.c 2002-02-01 13:16:41.000000000 -0800 @@ -0,0 +1,25 @@ +/* Dynamic linker's private version of __fxstat64. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* This special file is needed because some fxstat64.c implementations + use versioning for __fxstat64 and we need to keep it local to + the dynamic linker. */ + +#define RTLD_STAT64 +#include diff -durpN glibc-2.2.5/elf/dl-init.c glibc-2.3/elf/dl-init.c --- glibc-2.2.5/elf/dl-init.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/elf/dl-init.c 2002-09-20 16:48:17.000000000 -0700 @@ -1,5 +1,5 @@ /* Return the next shared object initializer function not yet run. - Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1998-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,9 +26,7 @@ typedef void (*init_t) (int, char **, ch /* Flag, nonzero during startup phase. */ extern int _dl_starting_up; - -/* The object to be initialized first. */ -extern struct link_map *_dl_initfirst; +extern int _dl_starting_up_internal attribute_hidden; static void @@ -53,9 +51,9 @@ call_init (struct link_map *l, int argc, return; /* Print a debug message if wanted. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) - _dl_debug_printf ("\ncalling init: %s\n\n", - l->l_name[0] ? l->l_name : _dl_argv[0]); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) + INTUSE(_dl_debug_printf) ("\ncalling init: %s\n\n", + l->l_name[0] ? l->l_name : rtld_progname); /* Now run the local constructors. There are two forms of them: - the one named by DT_INIT @@ -71,7 +69,8 @@ call_init (struct link_map *l, int argc, } /* Next see whether there is an array with initialization functions. */ - if (l->l_info[DT_INIT_ARRAY] != NULL) + ElfW(Dyn) *init_array = l->l_info[DT_INIT_ARRAY]; + if (init_array != NULL) { unsigned int j; unsigned int jm; @@ -79,8 +78,7 @@ call_init (struct link_map *l, int argc, jm = l->l_info[DT_INIT_ARRAYSZ]->d_un.d_val / sizeof (ElfW(Addr)); - addrs = (ElfW(Addr) *) (l->l_info[DT_INIT_ARRAY]->d_un.d_ptr - + l->l_addr); + addrs = (ElfW(Addr) *) (init_array->d_un.d_ptr + l->l_addr); for (j = 0; j < jm; ++j) ((init_t) addrs[j]) (argc, argv, env); } @@ -92,29 +90,30 @@ internal_function _dl_init (struct link_map *main_map, int argc, char **argv, char **env) { ElfW(Dyn) *preinit_array = main_map->l_info[DT_PREINIT_ARRAY]; + ElfW(Dyn) *preinit_array_size = main_map->l_info[DT_PREINIT_ARRAYSZ]; struct r_debug *r; unsigned int i; - if (__builtin_expect (_dl_initfirst != NULL, 0)) + if (__builtin_expect (GL(dl_initfirst) != NULL, 0)) { - call_init (_dl_initfirst, argc, argv, env); - _dl_initfirst = NULL; + call_init (GL(dl_initfirst), argc, argv, env); + GL(dl_initfirst) = NULL; } /* Don't do anything if there is no preinit array. */ if (__builtin_expect (preinit_array != NULL, 0) - && (i = preinit_array->d_un.d_val / sizeof (ElfW(Addr))) > 0) + && preinit_array_size != NULL + && (i = preinit_array_size->d_un.d_val / sizeof (ElfW(Addr))) > 0) { ElfW(Addr) *addrs; unsigned int cnt; - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) - _dl_debug_printf ("\ncalling preinit: %s\n\n", - main_map->l_name[0] - ? main_map->l_name : _dl_argv[0]); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) + INTUSE(_dl_debug_printf) ("\ncalling preinit: %s\n\n", + main_map->l_name[0] + ? main_map->l_name : rtld_progname); - addrs = (ElfW(Addr) *) (main_map->l_info[DT_PREINIT_ARRAY]->d_un.d_ptr - + main_map->l_addr); + addrs = (ElfW(Addr) *) (preinit_array->d_un.d_ptr + main_map->l_addr); for (cnt = 0; cnt < i; ++cnt) ((init_t) addrs[cnt]) (argc, argv, env); } @@ -124,7 +123,7 @@ _dl_init (struct link_map *main_map, int not been used before. */ r = _dl_debug_initialize (0); r->r_state = RT_ADD; - _dl_debug_state (); + INTUSE(_dl_debug_state) (); /* Stupid users forced the ELF specification to be changed. It now says that the dynamic loader is responsible for determining the @@ -142,8 +141,9 @@ _dl_init (struct link_map *main_map, int /* Notify the debugger all new objects are now ready to go. */ r->r_state = RT_CONSISTENT; - _dl_debug_state (); + INTUSE(_dl_debug_state) (); /* Finished starting up. */ - _dl_starting_up = 0; + INTUSE(_dl_starting_up) = 0; } +INTDEF (_dl_init) diff -durpN glibc-2.2.5/elf/dl-iteratephdr.c glibc-2.3/elf/dl-iteratephdr.c --- glibc-2.2.5/elf/dl-iteratephdr.c 2001-08-22 23:02:45.000000000 -0700 +++ glibc-2.3/elf/dl-iteratephdr.c 2002-08-26 21:52:34.000000000 -0700 @@ -1,19 +1,19 @@ /* Get loaded objects program headers. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 2001. The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -32,9 +32,9 @@ __dl_iterate_phdr (int (*callback) (stru int ret = 0; /* Make sure we are alone. */ - __libc_lock_lock_recursive (_dl_load_lock); + __libc_lock_lock_recursive (GL(dl_load_lock)); - for (l = _dl_loaded; l != NULL; l = l->l_next) + for (l = GL(dl_loaded); l != NULL; l = l->l_next) { /* Skip the dynamic linker. */ if (l->l_phdr == NULL) @@ -49,7 +49,7 @@ __dl_iterate_phdr (int (*callback) (stru } /* Release the lock. */ - __libc_lock_unlock_recursive (_dl_load_lock); + __libc_lock_unlock_recursive (GL(dl_load_lock)); return ret; } diff -durpN glibc-2.2.5/elf/dl-libc.c glibc-2.3/elf/dl-libc.c --- glibc-2.2.5/elf/dl-libc.c 2001-07-05 21:54:45.000000000 -0700 +++ glibc-2.3/elf/dl-libc.c 2002-04-13 00:34:56.000000000 -0700 @@ -1,5 +1,5 @@ /* Handle loading and unloading shared objects for internal libc purposes. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Zack Weinberg , 1999. @@ -84,7 +84,8 @@ do_dlsym (void *ptr) struct do_dlsym_args *args = (struct do_dlsym_args *) ptr; args->ref = NULL; args->loadbase = _dl_lookup_symbol (args->name, args->map, &args->ref, - args->map->l_local_scope, 0, 1); + args->map->l_local_scope, 0, + DL_LOOKUP_RETURN_NEWEST); } static void @@ -129,8 +130,8 @@ free_mem (void) struct r_search_path_elem *d; /* Remove all search directories. */ - d = _dl_all_dirs; - while (d != _dl_init_all_dirs) + d = GL(dl_all_dirs); + while (d != GL(dl_init_all_dirs)) { struct r_search_path_elem *old = d; d = d->next; @@ -138,7 +139,7 @@ free_mem (void) } /* Remove all additional names added to the objects. */ - for (l = _dl_loaded; l != NULL; l = l->l_next) + for (l = GL(dl_loaded); l != NULL; l = l->l_next) { struct libname_list *lnp = l->l_libname->next; diff -durpN glibc-2.2.5/elf/dl-load.c glibc-2.3/elf/dl-load.c --- glibc-2.2.5/elf/dl-load.c 2001-11-10 14:43:10.000000000 -0800 +++ glibc-2.3/elf/dl-load.c 2002-09-12 15:08:11.000000000 -0700 @@ -1,5 +1,5 @@ /* Map in a shared object's segments from the file. - Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -111,18 +112,6 @@ struct filebuf char buf[1024]; }; -size_t _dl_pagesize; - -unsigned int _dl_osversion; - -int _dl_clktck; - -extern const char *_dl_platform; -extern size_t _dl_platformlen; - -/* The object to be initialized first. */ -struct link_map *_dl_initfirst; - /* This is the decomposed LD_LIBRARY_PATH search path. */ static struct r_search_path_struct env_path_list; @@ -159,22 +148,38 @@ local_strdup (const char *s) static size_t -is_dst (const char *start, const char *name, const char *str, size_t cmplen, +is_dst (const char *start, const char *name, const char *str, int is_path, int secure) { size_t len; + bool is_curly = false; - if (strncmp (name, str, cmplen) == 0) - len = cmplen + 1; - else if (strncmp (name, str + 1, cmplen - 2) == 0 - && (name[cmplen - 2] == '\0' || name[cmplen - 2] == '/' - || (is_path && name[cmplen - 2] == ':'))) - len = cmplen - 1; - else + if (name[0] == '{') + { + is_curly = true; + ++name; + } + + len = 0; + while (name[len] == str[len] && name[len] != '\0') + ++len; + + if (is_curly) + { + if (name[len] != '}') + return 0; + + /* Point again at the beginning of the name. */ + --name; + /* Skip over closing curly brace and adjust for the --name. */ + len += 2; + } + else if (name[len] != '\0' && name[len] != '/' + && (!is_path || name[len] != ':')) return 0; if (__builtin_expect (secure, 0) - && ((name[len - 1] != '\0' && (!is_path || name[len - 1] != ':')) + && ((name[len] != '\0' && (!is_path || name[len] != ':')) || (name != start + 1 && (!is_path || name[-2] != ':')))) return 0; @@ -190,17 +195,14 @@ _dl_dst_count (const char *name, int is_ do { - size_t len = 1; + size_t len; /* $ORIGIN is not expanded for SUID/GUID programs (except if it - is $ORIGIN alone) and it must always appear first in path. - - Note that it is no bug that the string in the second and - fourth `strncmp' call is longer than the sequence which is - actually tested. */ - if ((len = is_dst (start, name + 1, "{ORIGIN}", 8, is_path, - __libc_enable_secure)) != 0 - || ((len = is_dst (start, name + 1, "{PLATFORM}", 10, is_path, 0)) + is $ORIGIN alone) and it must always appear first in path. */ + ++name; + if ((len = is_dst (start, name, "ORIGIN", is_path, + INTUSE(__libc_enable_secure))) != 0 + || ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0)) ++cnt; @@ -210,6 +212,7 @@ _dl_dst_count (const char *name, int is_ return cnt; } +INTDEF (_dl_dst_count) char * @@ -230,17 +233,15 @@ _dl_dst_substitute (struct link_map *l, if (__builtin_expect (*name == '$', 0)) { const char *repl = NULL; - size_t len = 1; + size_t len; - /* Note that it is no bug that the string in the second and - fourth `strncmp' call is longer than the sequence which - is actually tested. */ - if ((len = is_dst (start, name + 1, "{ORIGIN}", 8, is_path, - __libc_enable_secure)) != 0) + ++name; + if ((len = is_dst (start, name, "ORIGIN", is_path, + INTUSE(__libc_enable_secure))) != 0) repl = l->l_origin; - else if ((len = is_dst (start, name + 1, "{PLATFORM}", 10, is_path, + else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0) - repl = _dl_platform; + repl = GL(dl_platform); if (repl != NULL && repl != (const char *) -1) { @@ -258,7 +259,7 @@ _dl_dst_substitute (struct link_map *l, } else /* No DST we recognize. */ - *wp++ = *name++; + *wp++ = '$'; } else { @@ -273,6 +274,7 @@ _dl_dst_substitute (struct link_map *l, return result; } +INTDEF (_dl_dst_substitute) /* Return copy of argument with all recognized dynamic string tokens @@ -306,7 +308,7 @@ expand_dynamic_string_token (struct link if (result == NULL) return NULL; - return DL_DST_SUBSTITUTE (l, s, result, 1); + return INTUSE(_dl_dst_substitute) (l, s, result, 1); } @@ -332,7 +334,8 @@ add_name_to_object (struct link_map *l, if (newname == NULL) { /* No more memory. */ - _dl_signal_error (ENOMEM, name, NULL, N_("cannot allocate name record")); + INTUSE(_dl_signal_error) (ENOMEM, name, NULL, + N_("cannot allocate name record")); return; } /* The object should have a libname set from _dl_new_object. */ @@ -344,12 +347,6 @@ add_name_to_object (struct link_map *l, lastp->next = newname; } -/* All known directories in sorted order. */ -struct r_search_path_elem *_dl_all_dirs; - -/* All directories after startup. */ -struct r_search_path_elem *_dl_init_all_dirs; - /* Standard search directories. */ static struct r_search_path_struct rtld_search_dirs; @@ -413,7 +410,7 @@ fillin_rpath (char *rpath, struct r_sear } /* See if this directory is already known. */ - for (dirp = _dl_all_dirs; dirp != NULL; dirp = dirp->next) + for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next) if (dirp->dirnamelen == len && memcmp (cp, dirp->dirname, len) == 0) break; @@ -439,8 +436,8 @@ fillin_rpath (char *rpath, struct r_sear malloc (sizeof (*dirp) + ncapstr * sizeof (enum r_dir_status) + where_len + len + 1); if (dirp == NULL) - _dl_signal_error (ENOMEM, NULL, NULL, - N_("cannot create cache for search path")); + INTUSE(_dl_signal_error) (ENOMEM, NULL, NULL, + N_("cannot create cache for search path")); dirp->dirname = ((char *) dirp + sizeof (*dirp) + ncapstr * sizeof (enum r_dir_status)); @@ -460,13 +457,13 @@ fillin_rpath (char *rpath, struct r_sear dirp->what = what; if (__builtin_expect (where != NULL, 1)) dirp->where = memcpy ((char *) dirp + sizeof (*dirp) + len + 1 - + ncapstr * sizeof (enum r_dir_status), + + (ncapstr * sizeof (enum r_dir_status)), where, where_len); else dirp->where = NULL; - dirp->next = _dl_all_dirs; - _dl_all_dirs = dirp; + dirp->next = GL(dl_all_dirs); + GL(dl_all_dirs) = dirp; /* Put it in the result array. */ result[nelems++] = dirp; @@ -496,14 +493,22 @@ decompose_rpath (struct r_search_path_st /* First see whether we must forget the RUNPATH and RPATH from this object. */ - if (__builtin_expect (_dl_inhibit_rpath != NULL, 0) && !__libc_enable_secure) + if (__builtin_expect (GL(dl_inhibit_rpath) != NULL, 0) + && !INTUSE(__libc_enable_secure)) { - const char *found = strstr (_dl_inhibit_rpath, where); - if (found != NULL) + const char *inhp = GL(dl_inhibit_rpath); + + do { - size_t len = strlen (where); - if ((found == _dl_inhibit_rpath || found[-1] == ':') - && (found[len] == '\0' || found[len] == ':')) + const char *wp = where; + + while (*inhp == *wp && *wp != '\0') + { + ++inhp; + ++wp; + } + + if (*wp == '\0' && (*inhp == '\0' || *inhp == ':')) { /* This object is on the list of objects for which the RUNPATH and RPATH must not be used. */ @@ -514,7 +519,7 @@ decompose_rpath (struct r_search_path_st signal_error_cache: errstring = N_("cannot create cache for search path"); signal_error: - _dl_signal_error (ENOMEM, NULL, NULL, errstring); + INTUSE(_dl_signal_error) (ENOMEM, NULL, NULL, errstring); } result[0] = NULL; @@ -524,7 +529,12 @@ decompose_rpath (struct r_search_path_st return; } + + while (*inhp != '\0') + if (*inhp++ == ':') + break; } + while (*inhp != '\0'); } /* Make a writable copy. At the same time expand possible dynamic @@ -579,7 +589,7 @@ _dl_init_paths (const char *llp) directories addressed by the LD_LIBRARY_PATH environment variable. */ /* Get the capabilities. */ - capstr = _dl_important_hwcaps (_dl_platform, _dl_platformlen, + capstr = _dl_important_hwcaps (GL(dl_platform), GL(dl_platformlen), &ncapstr, &max_capstrlen); /* First set up the rest of the default search directory entries. */ @@ -589,7 +599,7 @@ _dl_init_paths (const char *llp) { errstring = N_("cannot create search path array"); signal_error: - _dl_signal_error (ENOMEM, NULL, NULL, errstring); + INTUSE(_dl_signal_error) (ENOMEM, NULL, NULL, errstring); } round_size = ((2 * sizeof (struct r_search_path_elem) - 1 @@ -606,7 +616,7 @@ _dl_init_paths (const char *llp) } rtld_search_dirs.malloced = 0; - pelem = _dl_all_dirs = rtld_search_dirs.dirs[0]; + pelem = GL(dl_all_dirs) = rtld_search_dirs.dirs[0]; strp = system_dirs; idx = 0; @@ -639,7 +649,7 @@ _dl_init_paths (const char *llp) #ifdef SHARED /* This points to the map of the main object. */ - l = _dl_loaded; + l = GL(dl_loaded); if (l != NULL) { assert (l->l_type != lt_loaded); @@ -701,7 +711,8 @@ _dl_init_paths (const char *llp) } (void) fillin_rpath (llp_tmp, env_path_list.dirs, ":;", - __libc_enable_secure, "LD_LIBRARY_PATH", NULL); + INTUSE(__libc_enable_secure), "LD_LIBRARY_PATH", + NULL); if (env_path_list.dirs[0] == NULL) { @@ -715,7 +726,7 @@ _dl_init_paths (const char *llp) env_path_list.dirs = (void *) -1; /* Remember the last search directory added at startup. */ - _dl_init_all_dirs = _dl_all_dirs; + GL(dl_init_all_dirs) = GL(dl_all_dirs); } @@ -743,18 +754,17 @@ lose (int code, int fd, const char *name { /* Remove the stillborn object from the list and free it. */ assert (l->l_next == NULL); -#ifndef SHARED if (l->l_prev == NULL) - /* No other module loaded. */ - _dl_loaded = NULL; + /* No other module loaded. This happens only in the static library, + or in rtld under --verify. */ + GL(dl_loaded) = NULL; else -#endif l->l_prev->l_next = NULL; - --_dl_nloaded; + --GL(dl_nloaded); free (l); } free (realname); - _dl_signal_error (code, name, NULL, msg); + INTUSE(_dl_signal_error) (code, name, NULL, msg); } @@ -791,7 +801,7 @@ _dl_map_object_from_fd (const char *name } /* Look again to see if the real name matched another already loaded. */ - for (l = _dl_loaded; l; l = l->l_next) + for (l = GL(dl_loaded); l; l = l->l_next) if (l->l_ino == st.st_ino && l->l_dev == st.st_dev) { /* The object is already loaded. @@ -812,8 +822,8 @@ _dl_map_object_from_fd (const char *name return NULL; /* Print debugging message. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) - _dl_debug_printf ("file=%s; generating link map\n", name); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0)) + INTUSE(_dl_debug_printf) ("file=%s; generating link map\n", name); /* This is the ELF header. We read it in `open_verify'. */ header = (void *) fbp->buf; @@ -826,8 +836,8 @@ _dl_map_object_from_fd (const char *name if (_dl_zerofd == -1) { __close (fd); - _dl_signal_error (errno, NULL, NULL, - N_("cannot open zero fill device")); + INTUSE(_dl_signal_error) (errno, NULL, NULL, + N_("cannot open zero fill device")); } } #endif @@ -847,13 +857,13 @@ _dl_map_object_from_fd (const char *name l->l_phnum = header->e_phnum; maplength = header->e_phnum * sizeof (ElfW(Phdr)); - if (header->e_phoff + maplength <= fbp->len) + if (header->e_phoff + maplength <= (size_t) fbp->len) phdr = (void *) (fbp->buf + header->e_phoff); else { phdr = alloca (maplength); - __lseek (fd, SEEK_SET, header->e_phoff); - if (__libc_read (fd, (void *) phdr, maplength) != maplength) + __lseek (fd, header->e_phoff, SEEK_SET); + if ((size_t) __libc_read (fd, (void *) phdr, maplength) != maplength) { errstring = N_("cannot read file data"); goto call_lose_errno; @@ -892,12 +902,14 @@ _dl_map_object_from_fd (const char *name case PT_LOAD: /* A load command tells us to map in part of the file. We record the load commands and process them all later. */ - if ((ph->p_align & (_dl_pagesize - 1)) != 0) + if (__builtin_expect ((ph->p_align & (GL(dl_pagesize) - 1)) != 0, + 0)) { errstring = N_("ELF load command alignment not page-aligned"); goto call_lose; } - if (((ph->p_vaddr - ph->p_offset) & (ph->p_align - 1)) != 0) + if (__builtin_expect (((ph->p_vaddr - ph->p_offset) + & (ph->p_align - 1)) != 0, 0)) { errstring = N_("ELF load command address/offset not properly aligned"); @@ -907,8 +919,8 @@ _dl_map_object_from_fd (const char *name { struct loadcmd *c = &loadcmds[nloadcmds++]; c->mapstart = ph->p_vaddr & ~(ph->p_align - 1); - c->mapend = ((ph->p_vaddr + ph->p_filesz + _dl_pagesize - 1) - & ~(_dl_pagesize - 1)); + c->mapend = ((ph->p_vaddr + ph->p_filesz + GL(dl_pagesize) - 1) + & ~(GL(dl_pagesize) - 1)); c->dataend = ph->p_vaddr + ph->p_filesz; c->allocend = ph->p_vaddr + ph->p_memsz; c->mapoff = ph->p_offset & ~(ph->p_align - 1); @@ -928,6 +940,27 @@ _dl_map_object_from_fd (const char *name #endif } break; + + case PT_TLS: +#ifdef USE_TLS + if (ph->p_memsz > 0) + { + l->l_tls_blocksize = ph->p_memsz; + l->l_tls_align = ph->p_align; + l->l_tls_initimage_size = ph->p_filesz; + /* Since we don't know the load address yet only store the + offset. We will adjust it later. */ + l->l_tls_initimage = (void *) ph->p_vaddr; + + /* Assign the next available module ID. */ + l->l_tls_modid = _dl_next_tls_modid (); + } +#else + /* Uh-oh, the binary expects TLS support but we cannot + provide it. */ + _dl_fatal_printf ("cannot handle file '%s' with TLS data\n", name); +#endif + break; } /* Now process the load commands and map segments into memory. */ @@ -957,7 +990,7 @@ _dl_map_object_from_fd (const char *name l->l_map_start = (ElfW(Addr)) __mmap ((void *) mappref, maplength, c->prot, MAP_COPY | MAP_FILE, fd, c->mapoff); - if ((void *) l->l_map_start == MAP_FAILED) + if (__builtin_expect ((void *) l->l_map_start == MAP_FAILED, 0)) { map_error: errstring = N_("failed to map segment from shared object"); @@ -1009,8 +1042,8 @@ _dl_map_object_from_fd (const char *name postmap: if (l->l_phdr == 0 - && c->mapoff <= header->e_phoff - && (c->mapend - c->mapstart + c->mapoff + && (ElfW(Off)) c->mapoff <= header->e_phoff + && ((size_t) (c->mapend - c->mapstart + c->mapoff) >= header->e_phoff + header->e_phnum * sizeof (ElfW(Phdr)))) /* Found the program header in this segment. */ l->l_phdr = (void *) (c->mapstart + header->e_phoff - c->mapoff); @@ -1023,7 +1056,8 @@ _dl_map_object_from_fd (const char *name zero = l->l_addr + c->dataend; zeroend = l->l_addr + c->allocend; - zeropage = (zero + _dl_pagesize - 1) & ~(_dl_pagesize - 1); + zeropage = ((zero + GL(dl_pagesize) - 1) + & ~(GL(dl_pagesize) - 1)); if (zeroend < zeropage) /* All the extra data is in the last page of the segment. @@ -1036,8 +1070,13 @@ _dl_map_object_from_fd (const char *name if ((c->prot & PROT_WRITE) == 0) { /* Dag nab it. */ - if (__mprotect ((caddr_t) (zero & ~(_dl_pagesize - 1)), - _dl_pagesize, c->prot|PROT_WRITE) < 0) + if (__builtin_expect (__mprotect ((caddr_t) + (zero + & ~(GL(dl_pagesize) + - 1)), + GL(dl_pagesize), + c->prot|PROT_WRITE) < 0, + 0)) { errstring = N_("cannot change memory protections"); goto call_lose_errno; @@ -1045,8 +1084,8 @@ _dl_map_object_from_fd (const char *name } memset ((void *) zero, '\0', zeropage - zero); if ((c->prot & PROT_WRITE) == 0) - __mprotect ((caddr_t) (zero & ~(_dl_pagesize - 1)), - _dl_pagesize, c->prot); + __mprotect ((caddr_t) (zero & ~(GL(dl_pagesize) - 1)), + GL(dl_pagesize), c->prot); } if (zeroend > zeropage) @@ -1056,7 +1095,7 @@ _dl_map_object_from_fd (const char *name mapat = __mmap ((caddr_t) zeropage, zeroend - zeropage, c->prot, MAP_ANON|MAP_PRIVATE|MAP_FIXED, ANONFD, 0); - if (mapat == MAP_FAILED) + if (__builtin_expect (mapat == MAP_FAILED, 0)) { errstring = N_("cannot map zero-fill pages"); goto call_lose_errno; @@ -1089,6 +1128,12 @@ _dl_map_object_from_fd (const char *name (ElfW(Addr)) l->l_phdr += l->l_addr; } +#ifdef USE_TLS + /* Adjust the address of the TLS initialization image. */ + if (l->l_tls_initimage != NULL) + l->l_tls_initimage = (char *) l->l_tls_initimage + l->l_addr; +#endif + /* We are done mapping in the file. We no longer need the descriptor. */ __close (fd); /* Signal that we closed the file. */ @@ -1099,7 +1144,7 @@ _dl_map_object_from_fd (const char *name if (l->l_ld == 0) { - if (type == ET_DYN) + if (__builtin_expect (type == ET_DYN, 0)) { errstring = N_("object file has no dynamic section"); goto call_lose; @@ -1110,21 +1155,30 @@ _dl_map_object_from_fd (const char *name l->l_entry += l->l_addr; - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) - _dl_debug_printf (" dynamic: 0x%0*lx base: 0x%0*lx size: 0x%0*Zx\n" - " entry: 0x%0*lx phdr: 0x%0*lx phnum: %*u\n\n", - (int) sizeof (void *) * 2, (unsigned long int) l->l_ld, - (int) sizeof (void *) * 2, (unsigned long int) l->l_addr, - (int) sizeof (void *) * 2, maplength, - (int) sizeof (void *) * 2, (unsigned long int) l->l_entry, - (int) sizeof (void *) * 2, (unsigned long int) l->l_phdr, - (int) sizeof (void *) * 2, l->l_phnum); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0)) + INTUSE(_dl_debug_printf) ("\ + dynamic: 0x%0*lx base: 0x%0*lx size: 0x%0*Zx\n\ + entry: 0x%0*lx phdr: 0x%0*lx phnum: %*u\n\n", + (int) sizeof (void *) * 2, + (unsigned long int) l->l_ld, + (int) sizeof (void *) * 2, + (unsigned long int) l->l_addr, + (int) sizeof (void *) * 2, maplength, + (int) sizeof (void *) * 2, + (unsigned long int) l->l_entry, + (int) sizeof (void *) * 2, + (unsigned long int) l->l_phdr, + (int) sizeof (void *) * 2, l->l_phnum); elf_get_dynamic_info (l); - /* Make sure we are dlopen()ing an object which has the DF_1_NOOPEN - flag set. */ - if (__builtin_expect (l->l_flags_1 & DF_1_NOOPEN, 0) + /* Make sure we are not dlopen'ing an object + that has the DF_1_NOOPEN flag set. */ + if ((__builtin_expect (l->l_flags_1 & DF_1_NOOPEN, 0) +#ifdef USE_TLS + || __builtin_expect (l->l_flags & DF_STATIC_TLS, 0) +#endif + ) && (mode & __RTLD_DLOPEN)) { /* We are not supposed to load this object. Free all resources. */ @@ -1176,12 +1230,19 @@ _dl_map_object_from_fd (const char *name /* Remember whether this object must be initialized first. */ if (l->l_flags_1 & DF_1_INITFIRST) - _dl_initfirst = l; + GL(dl_initfirst) = l; /* Finally the file information. */ l->l_dev = st.st_dev; l->l_ino = st.st_ino; + /* When we profile the SONAME might be needed for something else but + loading. Add it right away. */ + if (__builtin_expect (GL(dl_profile) != NULL, 0) + && l->l_info[DT_SONAME] != NULL) + add_name_to_object (l, ((const char *) D_PTR (l, l_info[DT_STRTAB]) + + l->l_info[DT_SONAME]->d_un.d_val)); + return l; } @@ -1193,7 +1254,7 @@ print_search_path (struct r_search_path_ char buf[max_dirnamelen + max_capstrlen]; int first = 1; - _dl_debug_printf (" search path="); + INTUSE(_dl_debug_printf) (" search path="); while (*list != NULL && (*list)->what == what) /* Yes, ==. */ { @@ -1218,7 +1279,7 @@ print_search_path (struct r_search_path_ if (name != NULL) _dl_debug_printf_c ("\t\t(%s from file %s)\n", what, - name[0] ? name : _dl_argv[0]); + name[0] ? name : rtld_progname); else _dl_debug_printf_c ("\t\t(%s)\n", what); } @@ -1360,13 +1421,13 @@ open_verify (const char *name, struct fi } maplength = ehdr->e_phnum * sizeof (ElfW(Phdr)); - if (ehdr->e_phoff + maplength <= fbp->len) + if (ehdr->e_phoff + maplength <= (size_t) fbp->len) phdr = (void *) (fbp->buf + ehdr->e_phoff); else { phdr = alloca (maplength); - __lseek (fd, SEEK_SET, ehdr->e_phoff); - if (__libc_read (fd, (void *) phdr, maplength) != maplength) + __lseek (fd, ehdr->e_phoff, SEEK_SET); + if ((size_t) __libc_read (fd, (void *) phdr, maplength) != maplength) { read_error: errval = errno; @@ -1379,11 +1440,11 @@ open_verify (const char *name, struct fi for (ph = phdr; ph < &phdr[ehdr->e_phnum]; ++ph) if (ph->p_type == PT_NOTE && ph->p_filesz == 32 && ph->p_align >= 4) { - if (ph->p_offset + 32 <= fbp->len) + if (ph->p_offset + 32 <= (size_t) fbp->len) abi_note = (void *) (fbp->buf + ph->p_offset); else { - __lseek (fd, SEEK_SET, ph->p_offset); + __lseek (fd, ph->p_offset, SEEK_SET); if (__libc_read (fd, (void *) abi_note_buf, 32) != 32) goto read_error; @@ -1397,7 +1458,7 @@ open_verify (const char *name, struct fi + (abi_note[6] & 0xff) * 256 + (abi_note[7] & 0xff); if (abi_note[4] != __ABI_TAG_OS - || (_dl_osversion && _dl_osversion < osversion)) + || (GL(dl_osversion) && GL(dl_osversion) < osversion)) { close_and_out: __close (fd); @@ -1442,7 +1503,7 @@ open_path (const char *name, size_t name /* If we are debugging the search for libraries print the path now if it hasn't happened now. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0) + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0) && current_what != this_dir->what) { current_what = this_dir->what; @@ -1457,14 +1518,14 @@ open_path (const char *name, size_t name continue; buflen = - ((char *) __mempcpy (__mempcpy (edp, - capstr[cnt].str, capstr[cnt].len), + ((char *) __mempcpy (__mempcpy (edp, capstr[cnt].str, + capstr[cnt].len), name, namelen) - buf); /* Print name we try if this is wanted. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)) - _dl_debug_printf (" trying file=%s\n", buf); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) + INTUSE(_dl_debug_printf) (" trying file=%s\n", buf); fd = open_verify (buf, fbp); if (this_dir->status[cnt] == unknown) @@ -1492,7 +1553,7 @@ open_path (const char *name, size_t name here_any |= this_dir->status[cnt] == existing; if (fd != -1 && __builtin_expect (preloaded, 0) - && __libc_enable_secure) + && INTUSE(__libc_enable_secure)) { /* This is an extra security effort to make sure nobody can preload broken shared objects which are in the trusted @@ -1566,7 +1627,7 @@ _dl_map_object (struct link_map *loader, struct filebuf fb; /* Look for this name among those already loaded. */ - for (l = _dl_loaded; l; l = l->l_next) + for (l = GL(dl_loaded); l; l = l->l_next) { /* If the requested name matches the soname of a loaded object, use that object. Elide this check for names that have not @@ -1596,9 +1657,11 @@ _dl_map_object (struct link_map *loader, } /* Display information if we are debugging. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0) && loader != NULL) - _dl_debug_printf ("\nfile=%s; needed by %s\n", name, - loader->l_name[0] ? loader->l_name : _dl_argv[0]); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0) + && loader != NULL) + INTUSE(_dl_debug_printf) ("\nfile=%s; needed by %s\n", name, + loader->l_name[0] + ? loader->l_name : rtld_progname); if (strchr (name, '/') == NULL) { @@ -1606,8 +1669,8 @@ _dl_map_object (struct link_map *loader, size_t namelen = strlen (name) + 1; - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)) - _dl_debug_printf ("find library=%s; searching\n", name); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) + INTUSE(_dl_debug_printf) ("find library=%s; searching\n", name); fd = -1; @@ -1644,7 +1707,7 @@ _dl_map_object (struct link_map *loader, /* If dynamically linked, try the DT_RPATH of the executable itself. */ - l = _dl_loaded; + l = GL(dl_loaded); if (fd == -1 && l && l->l_type != lt_loaded && l != loader && l->l_rpath_dirs.dirs != (void *) -1) fd = open_path (name, namelen, preloaded, &l->l_rpath_dirs, @@ -1689,7 +1752,8 @@ _dl_map_object (struct link_map *loader, } if (fd == -1 - && (__builtin_expect (! preloaded, 1) || ! __libc_enable_secure)) + && (__builtin_expect (! preloaded, 1) + || ! INTUSE(__libc_enable_secure))) { /* Check the list of libraries in the file /etc/ld.so.cache, for compatibility with Linux's ldconfig program. */ @@ -1698,7 +1762,7 @@ _dl_map_object (struct link_map *loader, if (cached != NULL) { #ifdef SHARED - l = loader ?: _dl_loaded; + l = loader ?: GL(dl_loaded); #else l = loader; #endif @@ -1748,21 +1812,15 @@ _dl_map_object (struct link_map *loader, /* Finally, try the default path. */ if (fd == -1 - && ((l = loader ?: _dl_loaded) - /* 'l' is always != NULL for dynamically linked objects. */ -#ifdef SHARED - , -#else - == NULL || -#endif - __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) + && ((l = loader ?: GL(dl_loaded)) == NULL + || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) && rtld_search_dirs.dirs != (void *) -1) fd = open_path (name, namelen, preloaded, &rtld_search_dirs, &realname, &fb); - /* Add another newline when we a tracing the library loading. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)) - _dl_debug_printf ("\n"); + /* Add another newline when we are tracing the library loading. */ + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) + INTUSE(_dl_debug_printf) ("\n"); } else { @@ -1782,7 +1840,8 @@ _dl_map_object (struct link_map *loader, if (__builtin_expect (fd, 0) == -1) { - if (trace_mode) + if (trace_mode + && __builtin_expect (GL(dl_debug_mask) & DL_DEBUG_PRELINK, 0) == 0) { /* We haven't found an appropriate library. But since we are only interested in the list of libraries this isn't @@ -1793,8 +1852,8 @@ _dl_map_object (struct link_map *loader, /* Enter the new object in the list of loaded objects. */ if ((name_copy = local_strdup (name)) == NULL || (l = _dl_new_object (name_copy, name, type, loader)) == NULL) - _dl_signal_error (ENOMEM, name, NULL, - N_("cannot create shared object descriptor")); + INTUSE(_dl_signal_error) (ENOMEM, name, NULL, N_("\ +cannot create shared object descriptor")); /* Signal that this is a faked entry. */ l->l_faked = 1; /* Since the descriptor is initialized with zero we do not @@ -1807,9 +1866,10 @@ _dl_map_object (struct link_map *loader, return l; } else - _dl_signal_error (errno, name, NULL, - N_("cannot open shared object file")); + INTUSE(_dl_signal_error) (errno, name, NULL, + N_("cannot open shared object file")); } return _dl_map_object_from_fd (name, fd, &fb, realname, loader, type, mode); } +INTDEF (_dl_map_object) diff -durpN glibc-2.2.5/elf/dl-lookup.c glibc-2.3/elf/dl-lookup.c --- glibc-2.2.5/elf/dl-lookup.c 2001-09-08 10:11:36.000000000 -0700 +++ glibc-2.3/elf/dl-lookup.c 2002-09-26 19:47:09.000000000 -0700 @@ -1,5 +1,5 @@ /* Look up a symbol in the loaded objects. - Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,6 +26,7 @@ #include "dl-hash.h" #include #include +#include #include @@ -60,7 +61,12 @@ struct sym_val }) /* Statistics function. */ -unsigned long int _dl_num_relocations; +#ifdef SHARED +# define bump_num_relocations() ++GL(dl_num_relocations) +#else +# define bump_num_relocations() ((void) 0) +#endif + /* We have two different situations when looking up a simple: with or @@ -88,8 +94,13 @@ add_dependency (struct link_map *undef_m if (undef_map == map) return 0; + /* Don't create cross-reference between modules which are + dynamically loaded by the same dlopen() call. */ + if (undef_map->l_opencount == 0 && map->l_opencount == 0) + return 0; + /* Make sure nobody can unload the object while we are at it. */ - __libc_lock_lock_recursive (_dl_load_lock); + __libc_lock_lock_recursive (GL(dl_load_lock)); /* Determine whether UNDEF_MAP already has a reference to MAP. First look in the normal dependencies. */ @@ -116,7 +127,7 @@ add_dependency (struct link_map *undef_m reference is still available. There is a brief period in which the object could have been removed since we found the definition. */ - runp = _dl_loaded; + runp = GL(dl_loaded); while (runp != NULL && runp != map) runp = runp->l_next; @@ -147,7 +158,7 @@ add_dependency (struct link_map *undef_m referenced object and don't record the dependencies. This means this increment can never be reverted and the object will never be unloaded. This is semantically the correct - behaviour. */ + behavior. */ if (__builtin_expect (act < undef_map->l_reldepsmax, 1)) undef_map->l_reldeps[undef_map->l_reldepsact++] = map; @@ -162,12 +173,12 @@ add_dependency (struct link_map *undef_m ++(*list)->l_opencount; /* Display information if we are debugging. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) - _dl_debug_printf ("\ + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0)) + INTUSE(_dl_debug_printf) ("\ \nfile=%s; needed by %s (relocation dependency)\n\n", - map->l_name[0] ? map->l_name : _dl_argv[0], - undef_map->l_name[0] - ? undef_map->l_name : _dl_argv[0]); + map->l_name[0] ? map->l_name : rtld_progname, + undef_map->l_name[0] + ? undef_map->l_name : rtld_progname); } else /* Whoa, that was bad luck. We have to search again. */ @@ -175,7 +186,7 @@ add_dependency (struct link_map *undef_m out: /* Release the lock. */ - __libc_lock_unlock_recursive (_dl_load_lock); + __libc_lock_unlock_recursive (GL(dl_load_lock)); return result; } @@ -184,7 +195,7 @@ static int internal_function _dl_do_lookup (const char *undef_name, unsigned long int hash, const ElfW(Sym) *ref, struct sym_val *result, - struct r_scope_elem *scope, size_t i, + struct r_scope_elem *scope, size_t i, int flags, struct link_map *skip, int type_class); static int internal_function @@ -194,6 +205,13 @@ _dl_do_lookup_versioned (const char *und const struct r_found_version *const version, struct link_map *skip, int type_class); +static void +internal_function +_dl_debug_bindings (const char *undef_name, struct link_map *undef_map, + const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[], + struct sym_val *value, + const struct r_found_version *version, int type_class, + int protected); /* Search loaded objects' symbol tables for a definition of the symbol UNDEF_NAME. */ @@ -202,37 +220,20 @@ lookup_t internal_function _dl_lookup_symbol (const char *undef_name, struct link_map *undef_map, const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[], - int type_class, int explicit) + int type_class, int flags) { - unsigned long int hash = _dl_elf_hash (undef_name); + const unsigned long int hash = _dl_elf_hash (undef_name); struct sym_val current_value = { NULL, NULL }; struct r_scope_elem **scope; int protected; - ++_dl_num_relocations; + bump_num_relocations (); /* Search the relevant loaded objects for a definition. */ for (scope = symbol_scope; *scope; ++scope) - if (do_lookup (undef_name, hash, *ref, ¤t_value, *scope, 0, NULL, - type_class)) - { - /* We have to check whether this would bind UNDEF_MAP to an object - in the global scope which was dynamically loaded. In this case - we have to prevent the latter from being unloaded unless the - UNDEF_MAP object is also unloaded. */ - if (__builtin_expect (current_value.m->l_type == lt_loaded, 0) - /* Don't do this for explicit lookups as opposed to implicit - runtime lookups. */ - && ! explicit - /* Add UNDEF_MAP to the dependencies. */ - && add_dependency (undef_map, current_value.m) < 0) - /* Something went wrong. Perhaps the object we tried to reference - was just removed. Try finding another definition. */ - return _dl_lookup_symbol (undef_name, undef_map, ref, symbol_scope, - type_class, 0); - - break; - } + if (do_lookup (undef_name, hash, *ref, ¤t_value, *scope, 0, flags, + NULL, type_class)) + break; if (__builtin_expect (current_value.s == NULL, 0)) { @@ -241,9 +242,9 @@ _dl_lookup_symbol (const char *undef_nam if (*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK) /* We could find no value for a strong reference. */ /* XXX We cannot translate the messages. */ - _dl_signal_cerror (0, (reference_name && reference_name[0] + _dl_signal_cerror (0, (reference_name[0] ? reference_name - : (_dl_argv[0] ?: "
")), + : (rtld_progname ?: "
")), N_("relocation error"), make_string (undefined_msg, undef_name)); *ref = NULL; @@ -251,44 +252,48 @@ _dl_lookup_symbol (const char *undef_nam } protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; - - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) - { - const char *reference_name = undef_map ? undef_map->l_name : NULL; - - _dl_debug_printf ("binding file %s to %s: %s symbol `%s'\n", - (reference_name && reference_name[0] - ? reference_name : (_dl_argv[0] ?: "
")), - current_value.m->l_name[0] - ? current_value.m->l_name : _dl_argv[0], - protected ? "protected" : "normal", undef_name); - } - - if (__builtin_expect (protected == 0, 1)) - { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); - } - else + if (__builtin_expect (protected != 0, 0)) { - /* It is very tricky. We need to figure out what value to - return for the protected symbol */ + /* It is very tricky. We need to figure out what value to + return for the protected symbol. */ struct sym_val protected_value = { NULL, NULL }; for (scope = symbol_scope; *scope; ++scope) if (_dl_do_lookup (undef_name, hash, *ref, &protected_value, *scope, - 0, NULL, ELF_RTYPE_CLASS_PLT)) + 0, flags, NULL, ELF_RTYPE_CLASS_PLT)) break; - if (protected_value.s == NULL || protected_value.m == undef_map) + if (protected_value.s != NULL && protected_value.m != undef_map) { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); + current_value.s = *ref; + current_value.m = undef_map; } - - return LOOKUP_VALUE (undef_map); } + + /* We have to check whether this would bind UNDEF_MAP to an object + in the global scope which was dynamically loaded. In this case + we have to prevent the latter from being unloaded unless the + UNDEF_MAP object is also unloaded. */ + if (__builtin_expect (current_value.m->l_type == lt_loaded, 0) + /* Don't do this for explicit lookups as opposed to implicit + runtime lookups. */ + && (flags & DL_LOOKUP_ADD_DEPENDENCY) != 0 + /* Add UNDEF_MAP to the dependencies. */ + && add_dependency (undef_map, current_value.m) < 0) + /* Something went wrong. Perhaps the object we tried to reference + was just removed. Try finding another definition. */ + return INTUSE(_dl_lookup_symbol) (undef_name, undef_map, ref, + symbol_scope, type_class, flags); + + if (__builtin_expect (GL(dl_debug_mask) + & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) + _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope, + ¤t_value, NULL, type_class, protected); + + *ref = current_value.s; + return LOOKUP_VALUE (current_value.m); } +INTDEF (_dl_lookup_symbol) /* This function is nearly the same as `_dl_lookup_symbol' but it @@ -303,14 +308,13 @@ _dl_lookup_symbol_skip (const char *unde struct r_scope_elem *symbol_scope[], struct link_map *skip_map) { - const char *reference_name = undef_map ? undef_map->l_name : NULL; const unsigned long int hash = _dl_elf_hash (undef_name); struct sym_val current_value = { NULL, NULL }; struct r_scope_elem **scope; size_t i; int protected; - ++_dl_num_relocations; + bump_num_relocations (); /* Search the relevant loaded objects for a definition. */ scope = symbol_scope; @@ -318,10 +322,10 @@ _dl_lookup_symbol_skip (const char *unde assert (i < (*scope)->r_nlist); if (! _dl_do_lookup (undef_name, hash, *ref, ¤t_value, *scope, i, - skip_map, 0)) + DL_LOOKUP_RETURN_NEWEST, skip_map, 0)) while (*++scope) if (_dl_do_lookup (undef_name, hash, *ref, ¤t_value, *scope, 0, - skip_map, 0)) + DL_LOOKUP_RETURN_NEWEST, skip_map, 0)) break; if (__builtin_expect (current_value.s == NULL, 0)) @@ -332,20 +336,7 @@ _dl_lookup_symbol_skip (const char *unde protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) - _dl_debug_printf ("binding file %s to %s: %s symbol `%s'\n", - (reference_name && reference_name[0] - ? reference_name : (_dl_argv[0] ?: "
")), - current_value.m->l_name[0] - ? current_value.m->l_name : _dl_argv[0], - protected ? "protected" : "normal", undef_name); - - if (__builtin_expect (protected == 0, 1)) - { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); - } - else + if (__builtin_expect (protected != 0, 0)) { /* It is very tricky. We need to figure out what value to return for the protected symbol. */ @@ -353,20 +344,28 @@ _dl_lookup_symbol_skip (const char *unde if (i >= (*scope)->r_nlist || !_dl_do_lookup (undef_name, hash, *ref, &protected_value, *scope, - i, skip_map, ELF_RTYPE_CLASS_PLT)) + i, DL_LOOKUP_RETURN_NEWEST, skip_map, + ELF_RTYPE_CLASS_PLT)) while (*++scope) if (_dl_do_lookup (undef_name, hash, *ref, &protected_value, *scope, - 0, skip_map, ELF_RTYPE_CLASS_PLT)) + 0, DL_LOOKUP_RETURN_NEWEST, skip_map, + ELF_RTYPE_CLASS_PLT)) break; - if (protected_value.s == NULL || protected_value.m == undef_map) + if (protected_value.s != NULL && protected_value.m != undef_map) { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); + current_value.s = *ref; + current_value.m = undef_map; } - - return LOOKUP_VALUE (undef_map); } + + if (__builtin_expect (GL(dl_debug_mask) + & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) + _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope, + ¤t_value, NULL, 0, protected); + + *ref = current_value.s; + return LOOKUP_VALUE (current_value.m); } @@ -381,14 +380,17 @@ _dl_lookup_versioned_symbol (const char struct link_map *undef_map, const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[], const struct r_found_version *version, - int type_class, int explicit) + int type_class, int flags) { - unsigned long int hash = _dl_elf_hash (undef_name); + const unsigned long int hash = _dl_elf_hash (undef_name); struct sym_val current_value = { NULL, NULL }; struct r_scope_elem **scope; int protected; - ++_dl_num_relocations; + bump_num_relocations (); + + /* No other flag than DL_LOOKUP_ADD_DEPENDENCY is allowed. */ + assert (flags == 0 || flags == DL_LOOKUP_ADD_DEPENDENCY); /* Search the relevant loaded objects for a definition. */ for (scope = symbol_scope; *scope; ++scope) @@ -396,25 +398,7 @@ _dl_lookup_versioned_symbol (const char int res = do_lookup_versioned (undef_name, hash, *ref, ¤t_value, *scope, 0, version, NULL, type_class); if (res > 0) - { - /* We have to check whether this would bind UNDEF_MAP to an object - in the global scope which was dynamically loaded. In this case - we have to prevent the latter from being unloaded unless the - UNDEF_MAP object is also unloaded. */ - if (__builtin_expect (current_value.m->l_type == lt_loaded, 0) - /* Don't do this for explicit lookups as opposed to implicit - runtime lookups. */ - && ! explicit - /* Add UNDEF_MAP to the dependencies. */ - && add_dependency (undef_map, current_value.m) < 0) - /* Something went wrong. Perhaps the object we tried to reference - was just removed. Try finding another definition. */ - return _dl_lookup_versioned_symbol (undef_name, undef_map, ref, - symbol_scope, version, - type_class, 0); - - break; - } + break; if (__builtin_expect (res, 0) < 0) { @@ -423,9 +407,9 @@ _dl_lookup_versioned_symbol (const char const char *reference_name = undef_map ? undef_map->l_name : NULL; /* XXX We cannot translate the message. */ - _dl_signal_cerror (0, (reference_name && reference_name[0] + _dl_signal_cerror (0, (reference_name[0] ? reference_name - : (_dl_argv[0] ?: "
")), + : (rtld_progname ?: "
")), N_("relocation error"), make_string ("symbol ", undef_name, ", version ", version->name, @@ -447,9 +431,9 @@ _dl_lookup_versioned_symbol (const char const char *reference_name = undef_map ? undef_map->l_name : NULL; /* XXX We cannot translate the message. */ - _dl_signal_cerror (0, (reference_name && reference_name[0] + _dl_signal_cerror (0, (reference_name[0] ? reference_name - : (_dl_argv[0] ?: "
")), NULL, + : (rtld_progname ?: "
")), NULL, make_string (undefined_msg, undef_name, ", version ", version->name ?: NULL)); @@ -460,28 +444,10 @@ _dl_lookup_versioned_symbol (const char protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) - { - const char *reference_name = undef_map ? undef_map->l_name : NULL; - - _dl_debug_printf ("binding file %s to %s: %s symbol `%s' [%s]\n", - (reference_name && reference_name[0] - ? reference_name : (_dl_argv[0] ?: "
")), - current_value.m->l_name[0] - ? current_value.m->l_name : _dl_argv[0], - protected ? "protected" : "normal", - undef_name, version->name); - } - - if (__builtin_expect (protected == 0, 1)) - { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); - } - else + if (__builtin_expect (protected != 0, 0)) { - /* It is very tricky. We need to figure out what value to - return for the protected symbol */ + /* It is very tricky. We need to figure out what value to + return for the protected symbol. */ struct sym_val protected_value = { NULL, NULL }; for (scope = symbol_scope; *scope; ++scope) @@ -490,15 +456,38 @@ _dl_lookup_versioned_symbol (const char ELF_RTYPE_CLASS_PLT)) break; - if (protected_value.s == NULL || protected_value.m == undef_map) + if (protected_value.s != NULL && protected_value.m != undef_map) { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); + current_value.s = *ref; + current_value.m = undef_map; } - - return LOOKUP_VALUE (undef_map); } + + /* We have to check whether this would bind UNDEF_MAP to an object + in the global scope which was dynamically loaded. In this case + we have to prevent the latter from being unloaded unless the + UNDEF_MAP object is also unloaded. */ + if (__builtin_expect (current_value.m->l_type == lt_loaded, 0) + /* Don't do this for explicit lookups as opposed to implicit + runtime lookups. */ + && flags != 0 + /* Add UNDEF_MAP to the dependencies. */ + && add_dependency (undef_map, current_value.m) < 0) + /* Something went wrong. Perhaps the object we tried to reference + was just removed. Try finding another definition. */ + return INTUSE(_dl_lookup_versioned_symbol) (undef_name, undef_map, + ref, symbol_scope, + version, type_class, flags); + + if (__builtin_expect (GL(dl_debug_mask) + & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) + _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope, + ¤t_value, version, type_class, protected); + + *ref = current_value.s; + return LOOKUP_VALUE (current_value.m); } +INTDEF (_dl_lookup_versioned_symbol) /* Similar to _dl_lookup_symbol_skip but takes an additional argument @@ -512,14 +501,14 @@ _dl_lookup_versioned_symbol_skip (const const struct r_found_version *version, struct link_map *skip_map) { - const char *reference_name = undef_map ? undef_map->l_name : NULL; + const char *reference_name = undef_map->l_name; const unsigned long int hash = _dl_elf_hash (undef_name); struct sym_val current_value = { NULL, NULL }; struct r_scope_elem **scope; size_t i; int protected; - ++_dl_num_relocations; + bump_num_relocations (); /* Search the relevant loaded objects for a definition. */ scope = symbol_scope; @@ -543,9 +532,9 @@ _dl_lookup_versioned_symbol_skip (const __mempcpy (__mempcpy (buf, undefined_msg, sizeof undefined_msg - 1), undef_name, len + 1); /* XXX We cannot translate the messages. */ - _dl_signal_cerror (0, (reference_name && reference_name[0] + _dl_signal_cerror (0, (reference_name[0] ? reference_name - : (_dl_argv[0] ?: "
")), + : (rtld_progname ?: "
")), NULL, buf); } *ref = NULL; @@ -554,24 +543,10 @@ _dl_lookup_versioned_symbol_skip (const protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) - _dl_debug_printf ("binding file %s to %s: %s symbol `%s' [%s]\n", - (reference_name && reference_name[0] - ? reference_name : (_dl_argv[0] ?: "
")), - current_value.m->l_name[0] - ? current_value.m->l_name : _dl_argv[0], - protected ? "protected" : "normal", - undef_name, version->name); - - if (__builtin_expect (protected == 0, 1)) - { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); - } - else + if (__builtin_expect (protected != 0, 0)) { - /* It is very tricky. We need to figure out what value to - return for the protected symbol */ + /* It is very tricky. We need to figure out what value to + return for the protected symbol. */ struct sym_val protected_value = { NULL, NULL }; if (i >= (*scope)->r_nlist @@ -584,14 +559,20 @@ _dl_lookup_versioned_symbol_skip (const skip_map, ELF_RTYPE_CLASS_PLT)) break; - if (protected_value.s == NULL || protected_value.m == undef_map) + if (protected_value.s != NULL && protected_value.m != undef_map) { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); + current_value.s = *ref; + current_value.m = undef_map; } - - return LOOKUP_VALUE (undef_map); } + + if (__builtin_expect (GL(dl_debug_mask) + & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) + _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope, + ¤t_value, version, 0, protected); + + *ref = current_value.s; + return LOOKUP_VALUE (current_value.m); } @@ -606,7 +587,7 @@ _dl_setup_hash (struct link_map *map) if (!map->l_info[DT_HASH]) return; - hash = (void *)(map->l_addr + map->l_info[DT_HASH]->d_un.d_ptr); + hash = (void *) D_PTR (map, l_info[DT_HASH]); map->l_nbuckets = *hash++; nchain = *hash++; @@ -615,20 +596,106 @@ _dl_setup_hash (struct link_map *map) map->l_chain = hash; } + +static void +internal_function +_dl_debug_bindings (const char *undef_name, struct link_map *undef_map, + const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[], + struct sym_val *value, + const struct r_found_version *version, int type_class, + int protected) +{ + const char *reference_name = undef_map->l_name; + + if (GL(dl_debug_mask) & DL_DEBUG_BINDINGS) + { + INTUSE(_dl_debug_printf) ("binding file %s to %s: %s symbol `%s'", + (reference_name[0] + ? reference_name + : (rtld_progname ?: "
")), + value->m->l_name[0] + ? value->m->l_name : rtld_progname, + protected ? "protected" : "normal", + undef_name); + if (version) + _dl_debug_printf_c (" [%s]\n", version->name); + else + _dl_debug_printf_c ("\n"); + } +#ifdef SHARED + if (GL(dl_debug_mask) & DL_DEBUG_PRELINK) + { + int conflict = 0; + struct sym_val val = { NULL, NULL }; + + if ((GL(dl_trace_prelink_map) == NULL + || GL(dl_trace_prelink_map) == GL(dl_loaded)) + && undef_map != GL(dl_loaded)) + { + const unsigned long int hash = _dl_elf_hash (undef_name); + + if (version == 0) + _dl_do_lookup (undef_name, hash, *ref, &val, + undef_map->l_local_scope[0], 0, 0, NULL, + type_class); + else + _dl_do_lookup_versioned (undef_name, hash, *ref, &val, + undef_map->l_local_scope[0], 0, version, + NULL, type_class); + + if (val.s != value->s || val.m != value->m) + conflict = 1; + } + +#ifdef USE_TLS + if (value->s + && (__builtin_expect (ELFW(ST_TYPE) (value->s->st_info) + == STT_TLS, 0))) + type_class = 4; +#endif + + if (conflict + || GL(dl_trace_prelink_map) == undef_map + || GL(dl_trace_prelink_map) == NULL + || type_class == 4) + { + _dl_printf ("%s 0x%0*Zx 0x%0*Zx -> 0x%0*Zx 0x%0*Zx ", + conflict ? "conflict" : "lookup", + (int) sizeof (ElfW(Addr)) * 2, undef_map->l_map_start, + (int) sizeof (ElfW(Addr)) * 2, + ((ElfW(Addr)) *ref) - undef_map->l_map_start, + (int) sizeof (ElfW(Addr)) * 2, + (ElfW(Addr)) (value->s ? value->m->l_map_start : 0), + (int) sizeof (ElfW(Addr)) * 2, + (ElfW(Addr)) (value->s ? value->s->st_value : 0)); + + if (conflict) + _dl_printf ("x 0x%0*Zx 0x%0*Zx ", + (int) sizeof (ElfW(Addr)) * 2, + (ElfW(Addr)) (val.s ? val.m->l_map_start : 0), + (int) sizeof (ElfW(Addr)) * 2, + (ElfW(Addr)) (val.s ? val.s->st_value : 0)); + + _dl_printf ("/%x %s\n", type_class, undef_name); + } + } +#endif +} + /* These are here so that we only inline do_lookup{,_versioned} in the common case, not everywhere. */ -static int +static int __attribute_noinline__ internal_function _dl_do_lookup (const char *undef_name, unsigned long int hash, const ElfW(Sym) *ref, struct sym_val *result, - struct r_scope_elem *scope, size_t i, + struct r_scope_elem *scope, size_t i, int flags, struct link_map *skip, int type_class) { - return do_lookup (undef_name, hash, ref, result, scope, i, skip, + return do_lookup (undef_name, hash, ref, result, scope, i, flags, skip, type_class); } -static int +static int __attribute_noinline__ internal_function _dl_do_lookup_versioned (const char *undef_name, unsigned long int hash, const ElfW(Sym) *ref, struct sym_val *result, diff -durpN glibc-2.2.5/elf/dl-minimal.c glibc-2.3/elf/dl-minimal.c --- glibc-2.2.5/elf/dl-minimal.c 2001-11-09 19:23:20.000000000 -0800 +++ glibc-2.3/elf/dl-minimal.c 2002-08-29 22:20:36.000000000 -0700 @@ -1,5 +1,5 @@ /* Minimal replacements for basic facilities used in the dynamic linker. - Copyright (C) 1995,96,97,98,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,9 +20,11 @@ #include #include #include +#include #include -#include #include +#include +#include #include #include @@ -36,14 +38,17 @@ static void *alloc_ptr, *alloc_end, *all /* Declarations of global functions. */ extern void weak_function free (void *ptr); extern void * weak_function realloc (void *ptr, size_t n); -extern unsigned long int weak_function __strtoul_internal -(const char *nptr, char **endptr, int base, int group); +extern unsigned long int weak_function __strtoul_internal (const char *nptr, + char **endptr, + int base, + int group); extern unsigned long int weak_function strtoul (const char *nptr, char **endptr, int base); +/* Allocate an aligned memory block. */ void * weak_function -malloc (size_t n) +__libc_memalign (size_t align, size_t n) { #ifdef MAP_ANON #define _dl_zerofd (-1) @@ -58,21 +63,22 @@ malloc (size_t n) if (alloc_end == 0) { /* Consume any unused space in the last page of our data segment. */ - extern int _end; + extern int _end attribute_hidden; alloc_ptr = &_end; - alloc_end = (void *) 0 + (((alloc_ptr - (void *) 0) + _dl_pagesize - 1) - & ~(_dl_pagesize - 1)); + alloc_end = (void *) 0 + (((alloc_ptr - (void *) 0) + + GL(dl_pagesize) - 1) + & ~(GL(dl_pagesize) - 1)); } /* Make sure the allocation pointer is ideally aligned. */ - alloc_ptr = (void *) 0 + (((alloc_ptr - (void *) 0) + sizeof (double) - 1) - & ~(sizeof (double) - 1)); + alloc_ptr = (void *) 0 + (((alloc_ptr - (void *) 0) + align - 1) + & ~(align - 1)); if (alloc_ptr + n >= alloc_end) { /* Insufficient space left; allocate another page. */ caddr_t page; - size_t nup = (n + _dl_pagesize - 1) & ~(_dl_pagesize - 1); + size_t nup = (n + GL(dl_pagesize) - 1) & ~(GL(dl_pagesize) - 1); page = __mmap (0, nup, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, _dl_zerofd, 0); assert (page != MAP_FAILED); @@ -86,6 +92,12 @@ malloc (size_t n) return alloc_last_block; } +void * weak_function +malloc (size_t n) +{ + return __libc_memalign (sizeof (double), n); +} + /* We use this function occasionally since the real implementation may be optimized when it can assume the memory it returns already is set to NUL. */ @@ -170,7 +182,7 @@ __strerror_r (int errnum, char *buf, siz /* No need to check buffer size, all calls in the dynamic linker provide enough space. */ buf[buflen - 1] = '\0'; - msg = _itoa_word (errnum, buf + buflen - 1, 10, 0); + msg = _itoa (errnum, buf + buflen - 1, 10, 0); msg = memcpy (msg - (sizeof ("Error ") - 1), "Error ", sizeof ("Error ") - 1); break; @@ -195,19 +207,21 @@ Inconsistency detected by ld.so: %s: %u: assertion); } +rtld_hidden_weak(__assert_fail) void weak_function __assert_perror_fail (int errnum, const char *file, unsigned int line, const char *function) { - char errbuf[64]; + char errbuf[400]; _dl_fatal_printf ("\ -Inconsistency detected by ld.so: %s: %u: %s%sUnexpected error: %s\n", +Inconsistency detected by ld.so: %s: %u: %s%sUnexpected error: %s.\n", file, line, function ?: "", function ? ": " : "", - __strerror_r (errnum, errbuf, sizeof (errbuf))); -} + __strerror_r (errnum, errbuf, sizeof errbuf)); +} +rtld_hidden_weak (__assert_perror_fail) #endif unsigned long int weak_function @@ -267,3 +281,91 @@ __strtoul_internal (const char *nptr, ch *endptr = (char *) nptr; return result * sign; } + + +/* We always use _itoa instead of _itoa_word in ld.so since the former + also has to be present and it is never about speed when these + functions are used. */ +char * +_itoa (value, buflim, base, upper_case) + unsigned long long int value; + char *buflim; + unsigned int base; + int upper_case; +{ + extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden; + + assert (! upper_case); + + do + *--buflim = INTUSE(_itoa_lower_digits)[value % base]; + while ((value /= base) != 0); + + return buflim; +} + + +/* The following is not a complete strsep implementation. It cannot + handle empty delimiter strings. But this isn't necessary for the + execution of ld.so. */ +#undef strsep +#undef __strsep +char * +__strsep (char **stringp, const char *delim) +{ + char *begin; + + assert (delim[0] != '\0'); + + begin = *stringp; + if (begin != NULL) + { + char *end = begin; + + while (*end != '\0' || (end = NULL)) + { + const char *dp = delim; + + do + if (*dp == *end) + break; + while (*++dp != '\0'); + + if (*dp != '\0') + { + *end++ = '\0'; + break; + } + + ++end; + } + + *stringp = end; + } + + return begin; +} +weak_alias (__strsep, strsep) +strong_alias (__strsep, __strsep_g) + + +/* The '_itoa_lower_digits' variable in libc.so is able to handle bases + up to 36. We don't need this here. */ +const char INTUSE(_itoa_lower_digits)[16] attribute_hidden + = "0123456789abcdef"; + + + +#undef errno +/* The 'errno' in ld.so is not exported. */ +#if USE_TLS && HAVE___THREAD +extern __thread int errno attribute_hidden; +#else +extern int errno attribute_hidden; + +int * +__errno_location (void) +{ + return &errno; +} +#endif diff -durpN glibc-2.2.5/elf/dl-misc.c glibc-2.3/elf/dl-misc.c --- glibc-2.2.5/elf/dl-misc.c 2001-11-07 15:57:09.000000000 -0800 +++ glibc-2.3/elf/dl-misc.c 2002-08-24 21:09:35.000000000 -0700 @@ -1,5 +1,5 @@ /* Miscellaneous support functions for dynamic linker - Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -80,10 +80,6 @@ _dl_sysdep_read_whole_file (const char * } -/* Descriptor to write debug messages to. */ -int _dl_debug_fd = 2; - - /* Bare-bone printf implementation. This function only knows about the formats and flags needed and can handle only up to 64 stripes in the output. */ @@ -109,7 +105,7 @@ _dl_debug_vdprintf (int fd, int tag_p, c char *p; pid = __getpid (); assert (pid >= 0 && pid < 100000); - p = _itoa_word (pid, &pidbuf[5], 10, 0); + p = _itoa (pid, &pidbuf[5], 10, 0); while (p > pidbuf) *--p = '0'; pidbuf[5] = ':'; @@ -139,6 +135,7 @@ _dl_debug_vdprintf (int fd, int tag_p, c /* It is a format specifier. */ char fill = ' '; int width = -1; + int prec = -1; #if LONG_MAX != INT_MAX int long_mod = 0; #endif @@ -158,6 +155,13 @@ _dl_debug_vdprintf (int fd, int tag_p, c ++fmt; } + /* Handle precision. */ + if (*fmt == '.' && fmt[1] == '*') + { + prec = va_arg (arg, int); + fmt += 2; + } + /* Recognize the l modifier. It is only important on some platforms where long and int have a different size. We can use the same code for size_t. */ @@ -189,7 +193,7 @@ _dl_debug_vdprintf (int fd, int tag_p, c having more than one integer formatting in a call. */ char *buf = (char *) alloca (3 * sizeof (unsigned long int)); char *endp = &buf[3 * sizeof (unsigned long int)]; - char *cp = _itoa_word (num, endp, *fmt == 'x' ? 16 : 10, 0); + char *cp = _itoa (num, endp, *fmt == 'x' ? 16 : 10, 0); /* Pad to the width the user specified. */ if (width != -1) @@ -206,6 +210,8 @@ _dl_debug_vdprintf (int fd, int tag_p, c /* Get the string argument. */ iov[niov].iov_base = va_arg (arg, char *); iov[niov].iov_len = strlen (iov[niov].iov_base); + if (prec != -1) + iov[niov].iov_len = MIN ((size_t) prec, iov[niov].iov_len); ++niov; break; @@ -250,9 +256,10 @@ _dl_debug_printf (const char *fmt, ...) va_list arg; va_start (arg, fmt); - _dl_debug_vdprintf (_dl_debug_fd, 1, fmt, arg); + _dl_debug_vdprintf (GL(dl_debug_fd), 1, fmt, arg); va_end (arg); } +INTDEF(_dl_debug_printf) /* Write to debug file but don't start with a tag. */ @@ -262,7 +269,7 @@ _dl_debug_printf_c (const char *fmt, ... va_list arg; va_start (arg, fmt); - _dl_debug_vdprintf (_dl_debug_fd, -1, fmt, arg); + _dl_debug_vdprintf (GL(dl_debug_fd), -1, fmt, arg); va_end (arg); } diff -durpN glibc-2.2.5/elf/dl-object.c glibc-2.3/elf/dl-object.c --- glibc-2.2.5/elf/dl-object.c 2001-11-08 14:31:53.000000000 -0800 +++ glibc-2.3/elf/dl-object.c 2002-02-03 00:54:32.000000000 -0800 @@ -1,5 +1,5 @@ /* Storage management for the chain of loaded shared objects. - Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -64,9 +64,9 @@ _dl_new_object (char *realname, const ch /* Counter for the scopes we have to handle. */ idx = 0; - if (_dl_loaded != NULL) + if (GL(dl_loaded) != NULL) { - l = _dl_loaded; + l = GL(dl_loaded); while (l->l_next != NULL) l = l->l_next; new->l_prev = l; @@ -74,11 +74,11 @@ _dl_new_object (char *realname, const ch l->l_next = new; /* Add the global scope. */ - new->l_scope[idx++] = &_dl_loaded->l_searchlist; + new->l_scope[idx++] = &GL(dl_loaded)->l_searchlist; } else - _dl_loaded = new; - ++_dl_nloaded; + GL(dl_loaded) = new; + ++GL(dl_nloaded); /* If we have no loader the new object acts as it. */ if (loader == NULL) @@ -121,11 +121,16 @@ _dl_new_object (char *realname, const ch origin = NULL; do { + char *new_origin; + len += 128; - origin = (char *) realloc (origin, len); + new_origin = (char *) realloc (origin, len); + if (new_origin == NULL) + /* We exit the loop. Note that result == NULL. */ + break; + origin = new_origin; } - while (origin != NULL - && (result = __getcwd (origin, len - realname_len)) == NULL + while ((result = __getcwd (origin, len - realname_len)) == NULL && errno == ERANGE); if (result == NULL) @@ -137,23 +142,27 @@ _dl_new_object (char *realname, const ch goto out; } - /* Find the end of the path and see whether we have to add - a slash. */ - cp = __rawmemchr (origin, '\0'); + /* Find the end of the path and see whether we have to add a + slash. We could use rawmemchr but this need not be + fast. */ + cp = (strchr) (origin, '\0'); if (cp[-1] != '/') *cp++ = '/'; } /* Add the real file name. */ - memcpy (cp, realname, realname_len); + cp = __mempcpy (cp, realname, realname_len); - /* Now remove the filename and the slash. Leave the slash if it + /* Now remove the filename and the slash. Leave the slash if the name is something like "/foo". */ - cp = strrchr (origin, '/'); + do + --cp; + while (*cp != '/'); + if (cp == origin) - origin[1] = '\0'; - else - *cp = '\0'; + /* Keep the only slash which is the first character. */ + ++cp; + *cp = '\0'; out: new->l_origin = origin; diff -durpN glibc-2.2.5/elf/dl-open.c glibc-2.3/elf/dl-open.c --- glibc-2.2.5/elf/dl-open.c 2001-09-30 15:57:52.000000000 -0700 +++ glibc-2.3/elf/dl-open.c 2002-08-07 19:08:12.000000000 -0700 @@ -1,5 +1,5 @@ /* Load a shared object at runtime, relocate it, and run its initializer. - Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include -#include extern ElfW(Addr) _dl_sysdep_start (void **start_argptr, @@ -40,26 +40,19 @@ extern ElfW(Addr) _dl_sysdep_start (void ElfW(Addr) *user_entry)); weak_extern (BP_SYM (_dl_sysdep_start)) -/* This function is used to unload the cache file if necessary. */ -extern void _dl_unload_cache (void); - extern int __libc_multiple_libcs; /* Defined in init-first.c. */ -extern int __libc_argc; -extern char **__libc_argv; +extern int __libc_argc attribute_hidden; +extern char **__libc_argv attribute_hidden; extern char **__environ; -extern int _dl_lazy; /* Do we do lazy relocations? */ - /* Undefine the following for debugging. */ /* #define SCOPE_DEBUG 1 */ #ifdef SCOPE_DEBUG static void show_scope (struct link_map *new); #endif -extern size_t _dl_platformlen; - /* We must be carefull not to leave us in an inconsistent state. Thus we catch any error and re-raise it after cleaning up. */ @@ -98,15 +91,15 @@ add_to_global (struct link_map *new) in an realloc() call. Therefore we allocate a completely new array the first time we have to add something to the locale scope. */ - if (_dl_global_scope_alloc == 0) + if (GL(dl_global_scope_alloc) == 0) { /* This is the first dynamic object given global scope. */ - _dl_global_scope_alloc = _dl_main_searchlist->r_nlist + to_add + 8; + GL(dl_global_scope_alloc) = GL(dl_main_searchlist)->r_nlist + to_add + 8; new_global = (struct link_map **) - malloc (_dl_global_scope_alloc * sizeof (struct link_map *)); + malloc (GL(dl_global_scope_alloc) * sizeof (struct link_map *)); if (new_global == NULL) { - _dl_global_scope_alloc = 0; + GL(dl_global_scope_alloc) = 0; nomem: _dl_signal_error (ENOMEM, new->l_libname->name, NULL, N_("cannot extend global scope")); @@ -114,24 +107,25 @@ add_to_global (struct link_map *new) } /* Copy over the old entries. */ - memcpy (new_global, _dl_main_searchlist->r_list, - (_dl_main_searchlist->r_nlist * sizeof (struct link_map *))); + memcpy (new_global, GL(dl_main_searchlist)->r_list, + (GL(dl_main_searchlist)->r_nlist * sizeof (struct link_map *))); - _dl_main_searchlist->r_list = new_global; + GL(dl_main_searchlist)->r_list = new_global; } - else if (_dl_main_searchlist->r_nlist + to_add > _dl_global_scope_alloc) + else if (GL(dl_main_searchlist)->r_nlist + to_add + > GL(dl_global_scope_alloc)) { /* We have to extend the existing array of link maps in the main map. */ new_global = (struct link_map **) - realloc (_dl_main_searchlist->r_list, - ((_dl_global_scope_alloc + to_add + 8) + realloc (GL(dl_main_searchlist)->r_list, + ((GL(dl_global_scope_alloc) + to_add + 8) * sizeof (struct link_map *))); if (new_global == NULL) goto nomem; - _dl_global_scope_alloc += to_add + 8; - _dl_main_searchlist->r_list = new_global; + GL(dl_global_scope_alloc) += to_add + 8; + GL(dl_main_searchlist)->r_list = new_global; } /* Now add the new entries. */ @@ -142,8 +136,9 @@ add_to_global (struct link_map *new) if (map->l_global == 0) { map->l_global = 1; - _dl_main_searchlist->r_list[_dl_main_searchlist->r_nlist] = map; - ++_dl_main_searchlist->r_nlist; + GL(dl_main_searchlist)->r_list[GL(dl_main_searchlist)->r_nlist] + = map; + ++GL(dl_main_searchlist)->r_nlist; } } @@ -161,10 +156,13 @@ dl_open_worker (void *a) const char *dst; int lazy; unsigned int i; +#ifdef USE_TLS + bool any_tls; +#endif /* Maybe we have to expand a DST. */ dst = strchr (file, '$'); - if (dst != NULL) + if (__builtin_expect (dst != NULL, 0)) { const void *caller = args->caller; size_t len = strlen (file); @@ -180,7 +178,7 @@ dl_open_worker (void *a) /* We have to find out from which object the caller is calling. */ call_map = NULL; - for (l = _dl_loaded; l; l = l->l_next) + for (l = GL(dl_loaded); l; l = l->l_next) if (caller >= (const void *) l->l_map_start && caller < (const void *) l->l_map_end) { @@ -192,7 +190,7 @@ dl_open_worker (void *a) if (call_map == NULL) /* In this case we assume this is the main application. */ - call_map = _dl_loaded; + call_map = GL(dl_loaded); /* Determine how much space we need. We have to allocate the memory locally. */ @@ -202,7 +200,7 @@ dl_open_worker (void *a) new_file = (char *) alloca (required + 1); /* Generate the new file name. */ - DL_DST_SUBSTITUTE (call_map, file, new_file, 0); + _dl_dst_substitute (call_map, file, new_file, 0); /* If the substitution failed don't try to load. */ if (*new_file == '\0') @@ -214,8 +212,7 @@ dl_open_worker (void *a) } /* Load the named object. */ - args->map = new = _dl_map_object (NULL, file, 0, lt_loaded, 0, - mode); + args->map = new = _dl_map_object (NULL, file, 0, lt_loaded, 0, mode); /* If the pointer returned is NULL this means the RTLD_NOLOAD flag is set and the object is not already loaded. */ @@ -233,7 +230,7 @@ dl_open_worker (void *a) if (new->l_searchlist.r_list != NULL) { /* Let the user know about the opencount. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0)) _dl_debug_printf ("opening file=%s; opencount == %u\n\n", new->l_name, new->l_opencount); @@ -249,7 +246,7 @@ dl_open_worker (void *a) } /* Load that object's dependencies. */ - _dl_map_object_deps (new, NULL, 0, 0); + _dl_map_object_deps (new, NULL, 0, 0, mode & __RTLD_DLOPEN); /* So far, so good. Now check the versions. */ for (i = 0; i < new->l_searchlist.r_nlist; ++i) @@ -261,7 +258,7 @@ dl_open_worker (void *a) #endif /* Only do lazy relocation if `LD_BIND_NOW' is not set. */ - lazy = (mode & RTLD_BINDING_MASK) == RTLD_LAZY && _dl_lazy; + lazy = (mode & RTLD_BINDING_MASK) == RTLD_LAZY && GL(dl_lazy); /* Relocate the objects loaded. We do this in reverse order so that copy relocs of earlier objects overwrite the data written by later objects. */ @@ -274,20 +271,20 @@ dl_open_worker (void *a) if (! l->l_relocated) { #ifdef SHARED - if (_dl_profile != NULL) + if (GL(dl_profile) != NULL) { /* If this here is the shared object which we want to profile make sure the profile is started. We can find out whether this is necessary or not by observing the `_dl_profile_map' variable. If was NULL but is not NULL afterwars we must start the profiling. */ - struct link_map *old_profile_map = _dl_profile_map; + struct link_map *old_profile_map = GL(dl_profile_map); _dl_relocate_object (l, l->l_scope, 1, 1); - if (old_profile_map == NULL && _dl_profile_map != NULL) + if (old_profile_map == NULL && GL(dl_profile_map) != NULL) /* We must prepare the profiling. */ - _dl_start_profile (_dl_profile_map, _dl_profile_output); + _dl_start_profile (GL(dl_profile_map), GL(dl_profile_output)); } else #endif @@ -299,6 +296,12 @@ dl_open_worker (void *a) l = l->l_prev; } +#ifdef USE_TLS + /* We normally don't bump the TLS generation counter. There must be + actually a need to do this. */ + any_tls = false; +#endif + /* Increment the open count for all dependencies. If the file is not loaded as a dependency here add the search list of the newly loaded object to the scope. */ @@ -360,6 +363,78 @@ dl_open_worker (void *a) imap->l_scope[cnt++] = &new->l_searchlist; imap->l_scope[cnt] = NULL; } +#if USE_TLS + else if (new->l_searchlist.r_list[i]->l_opencount == 1 + /* Only if the module defines thread local data. */ + && __builtin_expect (new->l_searchlist.r_list[i]->l_tls_blocksize + > 0, 0)) + { + /* Now that we know the object is loaded successfully add + modules containing TLS data to the dtv info table. We + might have to increase its size. */ + struct dtv_slotinfo_list *listp; + struct dtv_slotinfo_list *prevp; + size_t idx = new->l_searchlist.r_list[i]->l_tls_modid; + + assert (new->l_searchlist.r_list[i]->l_type == lt_loaded); + + /* Find the place in the stv slotinfo list. */ + listp = GL(dl_tls_dtv_slotinfo_list); + prevp = NULL; /* Needed to shut up gcc. */ + do + { + /* Does it fit in the array of this list element? */ + if (idx <= listp->len) + break; + prevp = listp; + } + while ((listp = listp->next) != NULL); + + if (listp == NULL) + { + /* When we come here it means we have to add a new element + to the slotinfo list. And the new module must be in + the first slot. */ + assert (idx == 0); + + listp = prevp->next = (struct dtv_slotinfo_list *) + malloc (sizeof (struct dtv_slotinfo_list) + + TLS_SLOTINFO_SURPLUS * sizeof (struct dtv_slotinfo)); + if (listp == NULL) + { + /* We ran out of memory. We will simply fail this + call but don't undo anything we did so far. The + application will crash or be terminated anyway very + soon. */ + + /* We have to do this since some entries in the dtv + slotinfo array might already point to this + generation. */ + ++GL(dl_tls_generation); + + _dl_signal_error (ENOMEM, "dlopen", NULL, + N_("cannot create TLS data structures")); + } + + listp->len = TLS_SLOTINFO_SURPLUS; + listp->next = NULL; + memset (listp->slotinfo, '\0', + TLS_SLOTINFO_SURPLUS * sizeof (struct dtv_slotinfo)); + } + + /* Add the information into the slotinfo data structure. */ + listp->slotinfo[idx].map = new->l_searchlist.r_list[i]; + listp->slotinfo[idx].gen = GL(dl_tls_generation) + 1; + + /* We have to bump the generation counter. */ + any_tls = true; + } + + /* Bump the generation number if necessary. */ + if (any_tls) + if (__builtin_expect (++GL(dl_tls_generation) == 0, 0)) + __libc_fatal (_("TLS generation counter wrapped! Please send report with the 'glibcbug' script.")); +#endif /* Run the initializer functions of new objects. */ _dl_init (new, __libc_argc, __libc_argv, __environ); @@ -376,13 +451,14 @@ dl_open_worker (void *a) if (__builtin_expect (mode & RTLD_NODELETE, 0)) new->l_flags_1 |= DF_1_NODELETE; - if (_dl_sysdep_start == NULL) - /* We must be the static _dl_open in libc.a. A static program that - has loaded a dynamic object now has competition. */ - __libc_multiple_libcs = 1; +#ifndef SHARED + /* We must be the static _dl_open in libc.a. A static program that + has loaded a dynamic object now has competition. */ + __libc_multiple_libcs = 1; +#endif /* Let the user know about the opencount. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0)) _dl_debug_printf ("opening file=%s; opencount == %u\n\n", new->l_name, new->l_opencount); } @@ -402,7 +478,7 @@ _dl_open (const char *file, int mode, co _dl_signal_error (EINVAL, file, NULL, N_("invalid mode for dlopen()")); /* Make sure we are alone. */ - __libc_lock_lock_recursive (_dl_load_lock); + __libc_lock_lock_recursive (GL(dl_load_lock)); args.file = file; args.mode = mode; @@ -416,9 +492,9 @@ _dl_open (const char *file, int mode, co #endif /* Release the lock. */ - __libc_lock_unlock_recursive (_dl_load_lock); + __libc_lock_unlock_recursive (GL(dl_load_lock)); - if (errstring) + if (__builtin_expect (errstring != NULL, 0)) { /* Some error occurred during loading. */ char *local_errstring; @@ -430,10 +506,20 @@ _dl_open (const char *file, int mode, co { unsigned int i; - /* Increment open counters for all objects since this has - not happened yet. */ - for (i = 0; i < args.map->l_searchlist.r_nlist; ++i) - ++args.map->l_searchlist.r_list[i]->l_opencount; + /* Increment open counters for all objects since this + sometimes has not happened yet. */ + if (args.map->l_searchlist.r_list[0]->l_opencount == 0) + for (i = 0; i < args.map->l_searchlist.r_nlist; ++i) + ++args.map->l_searchlist.r_list[i]->l_opencount; + +#ifdef USE_TLS + /* Maybe some of the modules which were loaded uses TLS. + Since it will be removed in the folowing _dl_close call + we have to mark the dtv array as having gaps to fill + the holes. This is a pessimistic assumption which won't + hurt if not true. */ + GL(dl_tls_dtv_gaps) = true; +#endif _dl_close (args.map); } @@ -467,6 +553,7 @@ _dl_open (const char *file, int mode, co return args.map; } +libc_hidden_def (_dl_open) #ifdef SCOPE_DEBUG diff -durpN glibc-2.2.5/elf/dl-profile.c glibc-2.3/elf/dl-profile.c --- glibc-2.2.5/elf/dl-profile.c 2001-11-06 22:26:02.000000000 -0800 +++ glibc-2.3/elf/dl-profile.c 2002-08-02 14:46:57.000000000 -0700 @@ -1,5 +1,5 @@ /* Profiling of shared libraries. - Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. Based on the BSD mcount implementation. @@ -19,6 +19,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include #include #include @@ -121,6 +122,7 @@ entries in the call graph table and add it to the appropriate list. */ extern int __profile_frequency (void); +libc_hidden_proto (__profile_frequency) /* We define a special type to address the elements of the arc table. This is basically the `gmon_cg_arc_record' format but it includes @@ -196,9 +198,9 @@ _dl_start_profile (struct link_map *map, for (ph = map->l_phdr; ph < &map->l_phdr[map->l_phnum]; ++ph) if (ph->p_type == PT_LOAD && (ph->p_flags & PF_X)) { - ElfW(Addr) start = (ph->p_vaddr & ~(_dl_pagesize - 1)); - ElfW(Addr) end = ((ph->p_vaddr + ph->p_memsz + _dl_pagesize - 1) - & ~(_dl_pagesize - 1)); + ElfW(Addr) start = (ph->p_vaddr & ~(GL(dl_pagesize) - 1)); + ElfW(Addr) end = ((ph->p_vaddr + ph->p_memsz + GL(dl_pagesize) - 1) + & ~(GL(dl_pagesize) - 1)); if (start < mapstart) mapstart = start; @@ -217,9 +219,23 @@ _dl_start_profile (struct link_map *map, kcountsize = textsize / HISTFRACTION; hashfraction = HASHFRACTION; if ((HASHFRACTION & (HASHFRACTION - 1)) == 0) - /* If HASHFRACTION is a power of two, mcount can use shifting - instead of integer division. Precompute shift amount. */ - log_hashfraction = __ffs (hashfraction * sizeof (*froms)) - 1; + { + /* If HASHFRACTION is a power of two, mcount can use shifting + instead of integer division. Precompute shift amount. + + This is a constant but the compiler cannot compile the + expression away since the __ffs implementation is not known + to the compiler. Help the compiler by precomputing the + usual cases. */ + assert (hashfraction == 2); + + if (sizeof (*froms) == 8) + log_hashfraction = 4; + else if (sizeof (*froms) == 16) + log_hashfraction = 5; + else + log_hashfraction = __ffs (hashfraction * sizeof (*froms)) - 1; + } else log_hashfraction = -1; tossize = textsize / HASHFRACTION; @@ -244,17 +260,24 @@ _dl_start_profile (struct link_map *map, *(char **) hist_hdr.high_pc = (char *) mapend; *(int32_t *) hist_hdr.hist_size = kcountsize / sizeof (HISTCOUNTER); *(int32_t *) hist_hdr.prof_rate = __profile_frequency (); - strncpy (hist_hdr.dimen, "seconds", sizeof (hist_hdr.dimen)); + if (sizeof (hist_hdr.dimen) >= sizeof ("seconds")) + { + memcpy (hist_hdr.dimen, "seconds", sizeof ("seconds")); + memset (hist_hdr.dimen + sizeof ("seconds"), '\0', + sizeof (hist_hdr.dimen) - sizeof ("seconds")); + } + else + strncpy (hist_hdr.dimen, "seconds", sizeof (hist_hdr.dimen)); hist_hdr.dimen_abbrev = 's'; /* First determine the output name. We write in the directory OUTPUT_DIR and the name is composed from the shared objects soname (or the file name) and the ending ".profile". */ - filename = (char *) alloca (strlen (output_dir) + 1 + strlen (_dl_profile) + filename = (char *) alloca (strlen (output_dir) + 1 + strlen (GL(dl_profile)) + sizeof ".profile"); cp = __stpcpy (filename, output_dir); *cp++ = '/'; - __stpcpy (__stpcpy (cp, _dl_profile), ".profile"); + __stpcpy (__stpcpy (cp, GL(dl_profile)), ".profile"); #ifdef O_NOFOLLOW # define EXTRA_FLAGS | O_NOFOLLOW @@ -287,11 +310,11 @@ _dl_start_profile (struct link_map *map, if (st.st_size == 0) { /* We have to create the file. */ - char buf[_dl_pagesize]; + char buf[GL(dl_pagesize)]; - memset (buf, '\0', _dl_pagesize); + memset (buf, '\0', GL(dl_pagesize)); - if (__lseek (fd, expected_size & ~(_dl_pagesize - 1), SEEK_SET) == -1) + if (__lseek (fd, expected_size & ~(GL(dl_pagesize) - 1), SEEK_SET) == -1) { char buf[400]; int errnum; @@ -304,7 +327,8 @@ _dl_start_profile (struct link_map *map, } if (TEMP_FAILURE_RETRY (__libc_write (fd, buf, (expected_size - & (_dl_pagesize - 1)))) + & (GL(dl_pagesize) + - 1)))) < 0) goto cannot_create; } @@ -317,7 +341,7 @@ _dl_start_profile (struct link_map *map, __munmap ((void *) addr, expected_size); _dl_error_printf ("%s: file is no correct profile data file for `%s'\n", - filename, _dl_profile); + filename, GL(dl_profile)); return; } @@ -426,6 +450,7 @@ _dl_start_profile (struct link_map *map, /* Turn on profiling. */ running = 1; } +INTDEF (_dl_start_profile) void @@ -534,3 +559,4 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr done: ; } +INTDEF(_dl_mcount) diff -durpN glibc-2.2.5/elf/dl-profstub.c glibc-2.3/elf/dl-profstub.c --- glibc-2.2.5/elf/dl-profstub.c 2001-07-05 21:54:46.000000000 -0700 +++ glibc-2.3/elf/dl-profstub.c 2002-08-10 11:08:27.000000000 -0700 @@ -1,5 +1,5 @@ /* Helper definitions for profiling of shared libraries. - Copyright (C) 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -24,7 +24,7 @@ /* This is the map for the shared object we profile. It is defined here only because we test for this value being NULL or not. */ -extern struct link_map *_dl_profile_map; +//Xextern struct link_map *_dl_profile_map; void @@ -37,6 +37,7 @@ _dl_mcount_wrapper (void *selfpc) void _dl_mcount_wrapper_check (void *selfpc) { - if (_dl_profile_map != NULL) + if (GL(dl_profile_map) != NULL) _dl_mcount ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc); } +libc_hidden_def (_dl_mcount_wrapper_check) diff -durpN glibc-2.2.5/elf/dl-reloc.c glibc-2.3/elf/dl-reloc.c --- glibc-2.2.5/elf/dl-reloc.c 2001-11-12 13:02:22.000000000 -0800 +++ glibc-2.3/elf/dl-reloc.c 2002-08-25 14:52:29.000000000 -0700 @@ -1,5 +1,5 @@ /* Relocate a shared object and resolve its references to other loaded objects. - Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,7 +28,11 @@ #include "dynamic-link.h" /* Statistics function. */ -unsigned long int _dl_num_cache_relocations; +#ifdef SHARED +# define bump_num_cache_relocations() ++GL(dl_num_cache_relocations) +#else +# define bump_num_cache_relocations() ((void) 0) +#endif void @@ -54,9 +58,10 @@ _dl_relocate_object (struct link_map *l, && __builtin_expect (l->l_info[DT_BIND_NOW] != NULL, 0)) lazy = 0; - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_RELOC, 0)) - _dl_printf ("\nrelocation processing: %s%s\n", - l->l_name[0] ? l->l_name : _dl_argv[0], lazy ? " (lazy)" : ""); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_RELOC, 0)) + INTUSE(_dl_debug_printf) ("\nrelocation processing: %s%s\n", + l->l_name[0] ? l->l_name : rtld_progname, + lazy ? " (lazy)" : ""); /* DT_TEXTREL is now in level 2 and might phase out at some time. But we rewrite the DT_FLAGS entry to a DT_TEXTREL entry to make @@ -72,17 +77,17 @@ _dl_relocate_object (struct link_map *l, struct textrels *newp; newp = (struct textrels *) alloca (sizeof (*newp)); - newp->len = (((ph->p_vaddr + ph->p_memsz + _dl_pagesize - 1) - & ~(_dl_pagesize - 1)) - - (ph->p_vaddr & ~(_dl_pagesize - 1))); - newp->start = ((ph->p_vaddr & ~(_dl_pagesize - 1)) + newp->len = (((ph->p_vaddr + ph->p_memsz + GL(dl_pagesize) - 1) + & ~(GL(dl_pagesize) - 1)) + - (ph->p_vaddr & ~(GL(dl_pagesize) - 1))); + newp->start = ((ph->p_vaddr & ~(GL(dl_pagesize) - 1)) + (caddr_t) l->l_addr); if (__mprotect (newp->start, newp->len, PROT_READ|PROT_WRITE) < 0) { errstring = N_("cannot make segment writable for relocation"); call_error: - _dl_signal_error (errno, l->l_name, NULL, errstring); + INTUSE(_dl_signal_error) (errno, l->l_name, NULL, errstring); } #if (PF_R | PF_W | PF_X) == 7 && (PROT_READ | PROT_WRITE | PROT_EXEC) == 7 @@ -113,7 +118,7 @@ _dl_relocate_object (struct link_map *l, (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \ ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \ && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \ - ? (++_dl_num_cache_relocations, \ + ? (bump_num_cache_relocations (), \ (*ref) = l->l_lookup_cache.ret, \ l->l_lookup_cache.value) \ : ({ lookup_t _lr; \ @@ -121,11 +126,13 @@ _dl_relocate_object (struct link_map *l, l->l_lookup_cache.type_class = _tc; \ l->l_lookup_cache.sym = (*ref); \ _lr = ((version) != NULL && (version)->hash != 0 \ - ? _dl_lookup_versioned_symbol (strtab + (*ref)->st_name, \ - l, (ref), scope, \ - (version), _tc, 0) \ - : _dl_lookup_symbol (strtab + (*ref)->st_name, l, (ref), \ - scope, _tc, 0)); \ + ? INTUSE(_dl_lookup_versioned_symbol) (strtab \ + + (*ref)->st_name, \ + l, (ref), scope, \ + (version), _tc, 0) \ + : INTUSE(_dl_lookup_symbol) (strtab + (*ref)->st_name, l, \ + (ref), scope, _tc, \ + DL_LOOKUP_ADD_DEPENDENCY)); \ l->l_lookup_cache.ret = (*ref); \ l->l_lookup_cache.value = _lr; })) \ : l) @@ -133,7 +140,7 @@ _dl_relocate_object (struct link_map *l, (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \ ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \ && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \ - ? (++_dl_num_cache_relocations, \ + ? (bump_num_cache_relocations (), \ (*ref) = l->l_lookup_cache.ret, \ l->l_lookup_cache.value) \ : ({ lookup_t _lr; \ @@ -141,11 +148,13 @@ _dl_relocate_object (struct link_map *l, l->l_lookup_cache.type_class = _tc; \ l->l_lookup_cache.sym = (*ref); \ _lr = ((version) != NULL && (version)->hash != 0 \ - ? _dl_lookup_versioned_symbol (strtab + (*ref)->st_name, \ - l, (ref), scope, \ - (version), _tc, 0) \ - : _dl_lookup_symbol (strtab + (*ref)->st_name, l, (ref), \ - scope, _tc, 0)); \ + ? INTUSE(_dl_lookup_versioned_symbol) (strtab \ + + (*ref)->st_name, \ + l, (ref), scope, \ + (version), _tc, 0) \ + : INTUSE(_dl_lookup_symbol) (strtab + (*ref)->st_name, l, \ + (ref), scope, _tc, \ + DL_LOOKUP_ADD_DEPENDENCY)); \ l->l_lookup_cache.ret = (*ref); \ l->l_lookup_cache.value = _lr; })) \ : l->l_addr) @@ -165,7 +174,7 @@ _dl_relocate_object (struct link_map *l, errstring = N_("%s: profiler found no PLTREL in object %s\n"); fatal: _dl_fatal_printf (errstring, - _dl_argv[0] ?: "", + rtld_progname ?: "", l->l_name); } @@ -196,14 +205,15 @@ _dl_relocate_object (struct link_map *l, textrels = textrels->next; } } +INTDEF (_dl_relocate_object) void internal_function _dl_reloc_bad_type (struct link_map *map, unsigned int type, int plt) { - extern const char _itoa_lower_digits[]; -#define DIGIT(b) _itoa_lower_digits[(b) & 0xf]; + extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden; +#define DIGIT(b) INTUSE(_itoa_lower_digits)[(b) & 0xf]; /* XXX We cannot translate these messages. */ static const char msg[2][32] = { "unexpected reloc type 0x", @@ -213,7 +223,8 @@ _dl_reloc_bad_type (struct link_map *map cp = __stpcpy (msgbuf, msg[plt]); *cp++ = DIGIT (type >> 4); - *cp = DIGIT (type); + *cp++ = DIGIT (type); + *cp = '\0'; - _dl_signal_error (0, map->l_name, NULL, msgbuf); + INTUSE(_dl_signal_error) (0, map->l_name, NULL, msgbuf); } diff -durpN glibc-2.2.5/elf/dl-runtime.c glibc-2.3/elf/dl-runtime.c --- glibc-2.2.5/elf/dl-runtime.c 2001-11-07 13:18:43.000000000 -0800 +++ glibc-2.3/elf/dl-runtime.c 2002-09-18 11:49:18.000000000 -0700 @@ -1,5 +1,5 @@ /* On-demand PLT fixup for shared objects. - Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,13 +17,16 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define IN_DL_RUNTIME 1 /* This can be tested in dl-machine.h. */ + #include #include #include #include #include "dynamic-link.h" -#if !defined ELF_MACHINE_NO_RELA || ELF_MACHINE_NO_REL +#if (!defined ELF_MACHINE_NO_RELA && !defined ELF_MACHINE_PLT_REL) \ + || ELF_MACHINE_NO_REL # define PLTREL ElfW(Rela) #else # define PLTREL ElfW(Rel) @@ -81,21 +84,24 @@ fixup ( { const ElfW(Half) *vernum = (const void *) D_PTR (l, l_info[VERSYMIDX (DT_VERSYM)]); - ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)]; + ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info) & 0x7fff]; const struct r_found_version *version = &l->l_versions[ndx]; if (version->hash != 0) { - result = _dl_lookup_versioned_symbol (strtab + sym->st_name, - l, &sym, l->l_scope, - version, - ELF_RTYPE_CLASS_PLT, 0); + result = INTUSE(_dl_lookup_versioned_symbol) (strtab + + sym->st_name, + l, &sym, l->l_scope, + version, + ELF_RTYPE_CLASS_PLT, + 0); break; } } case 0: - result = _dl_lookup_symbol (strtab + sym->st_name, l, &sym, - l->l_scope, ELF_RTYPE_CLASS_PLT, 0); + result = INTUSE(_dl_lookup_symbol) (strtab + sym->st_name, l, &sym, + l->l_scope, ELF_RTYPE_CLASS_PLT, + DL_LOOKUP_ADD_DEPENDENCY); } /* Currently result contains the base load address (or link map) @@ -117,7 +123,7 @@ fixup ( value = elf_machine_plt_value (l, reloc, value); /* Finally, fix up the plt itself. */ - if (__builtin_expect (_dl_bind_not, 0)) + if (__builtin_expect (GL(dl_bind_not), 0)) return value; return elf_machine_fixup_plt (l, result, reloc, rel_addr, value); @@ -133,7 +139,7 @@ profile_fixup ( #endif struct link_map *l, ElfW(Word) reloc_offset, ElfW(Addr) retaddr) { - void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = _dl_mcount; + void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = INTUSE(_dl_mcount); ElfW(Addr) *resultp; lookup_t result; ElfW(Addr) value; @@ -173,22 +179,26 @@ profile_fixup ( { const ElfW(Half) *vernum = (const void *) D_PTR (l,l_info[VERSYMIDX (DT_VERSYM)]); - ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)]; + ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info) & 0x7fff]; const struct r_found_version *version = &l->l_versions[ndx]; if (version->hash != 0) { - result = _dl_lookup_versioned_symbol(strtab + sym->st_name, - l, &sym, l->l_scope, - version, - ELF_RTYPE_CLASS_PLT, - 0); + result = INTUSE(_dl_lookup_versioned_symbol) (strtab + + sym->st_name, + l, &sym, + l->l_scope, + version, + ELF_RTYPE_CLASS_PLT, + 0); break; } } case 0: - result = _dl_lookup_symbol (strtab + sym->st_name, l, &sym, - l->l_scope, ELF_RTYPE_CLASS_PLT, 0); + result = INTUSE(_dl_lookup_symbol) (strtab + sym->st_name, l, + &sym, l->l_scope, + ELF_RTYPE_CLASS_PLT, + DL_LOOKUP_ADD_DEPENDENCY); } /* Currently result contains the base load address (or link map) @@ -209,7 +219,7 @@ profile_fixup ( value = elf_machine_plt_value (l, reloc, value); /* Store the result for later runs. */ - if (__builtin_expect (! _dl_bind_not, 1)) + if (__builtin_expect (! GL(dl_bind_not), 1)) *resultp = value; } diff -durpN glibc-2.2.5/elf/dl-support.c glibc-2.3/elf/dl-support.c --- glibc-2.2.5/elf/dl-support.c 2001-08-31 23:09:31.000000000 -0700 +++ glibc-2.3/elf/dl-support.c 2002-09-15 11:55:26.000000000 -0700 @@ -1,5 +1,5 @@ /* Support for dynamic linking code in static libc. - Copyright (C) 1996, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -52,9 +53,6 @@ int _dl_dynamic_weak = 1; /* If nonzero print warnings about problematic situations. */ int _dl_verbose; -/* Structure to store information about search paths. */ -struct r_search_path *_dl_search_paths; - /* We never do profiling. */ const char *_dl_profile; @@ -93,6 +91,9 @@ struct r_scope_elem *_dl_main_searchlist /* Nonzero during startup. */ int _dl_starting_up = 1; +/* Get architecture specific initializer. */ +#include + /* We expect less than a second for relocation. */ #ifdef HP_SMALL_TIMING_AVAIL # undef HP_TIMING_AVAIL @@ -104,6 +105,32 @@ int _dl_starting_up = 1; hp_timing_t _dl_cpuclock_offset; #endif +/* This is zero at program start to signal that the global scope map is + allocated by rtld. Later it keeps the size of the map. It might be + reset if in _dl_close if the last global object is removed. */ +size_t _dl_global_scope_alloc; + +size_t _dl_pagesize; + +unsigned int _dl_osversion; + +/* All known directories in sorted order. */ +struct r_search_path_elem *_dl_all_dirs; + +/* All directories after startup. */ +struct r_search_path_elem *_dl_init_all_dirs; + +/* The object to be initialized first. */ +struct link_map *_dl_initfirst; + +/* Descriptor to write debug messages to. */ +int _dl_debug_fd = STDERR_FILENO; + +int _dl_correct_cache_id = _DL_CACHE_DEFAULT_ID; + +struct ElfW(Phdr) *_dl_phdr; +size_t _dl_phnum; + /* During the program run we must not modify the global data of loaded shared object simultanously in two threads. Therefore we protect `_dl_open' and `_dl_close' in dl-close.c. @@ -113,9 +140,28 @@ hp_timing_t _dl_cpuclock_offset; At this time it is not anymore a problem to modify the tables. */ __libc_lock_define_initialized_recursive (, _dl_load_lock) +#ifdef USE_TLS + +/* Highest dtv index currently needed. */ +size_t _dl_tls_max_dtv_idx; +/* Flag signalling whether there are gaps in the module ID allocation. */ +bool _dl_tls_dtv_gaps; +/* Information about the dtv slots. */ +struct dtv_slotinfo_list *_dl_tls_dtv_slotinfo_list; +/* Number of modules in the static TLS block. */ +size_t _dl_tls_static_nelem; +/* Size of the static TLS block. */ +size_t _dl_tls_static_size; +/* Alignment requirement of the static TLS block. */ +size_t _dl_tls_static_align; + +/* Generation counter for the dtv. */ +size_t _dl_tls_generation; +#endif + #ifdef HAVE_AUX_VECTOR -extern int _dl_clktck; +int _dl_clktck; void internal_function @@ -125,19 +171,25 @@ _dl_aux_init (ElfW(auxv_t) *av) switch (av->a_type) { case AT_PAGESZ: - _dl_pagesize = av->a_un.a_val; + GL(dl_pagesize) = av->a_un.a_val; break; case AT_CLKTCK: - _dl_clktck = av->a_un.a_val; + GL(dl_clktck) = av->a_un.a_val; + break; + case AT_PHDR: + GL(dl_phdr) = av->a_un.a_ptr; + break; + case AT_PHNUM: + GL(dl_phnum) = av->a_un.a_val; break; } } #endif -static void non_dynamic_init (void) __attribute__ ((unused)); -static void -non_dynamic_init (void) +void +internal_function +_dl_non_dynamic_init (void) { if (HP_TIMING_AVAIL) HP_TIMING_NOW (_dl_cpuclock_offset); @@ -185,7 +237,7 @@ non_dynamic_init (void) if (_dl_platform != NULL) _dl_platformlen = strlen (_dl_platform); } -text_set_element (__libc_subinit, non_dynamic_init); + const struct r_strlenpair * internal_function diff -durpN glibc-2.2.5/elf/dl-sym.c glibc-2.3/elf/dl-sym.c --- glibc-2.2.5/elf/dl-sym.c 2001-09-04 20:41:19.000000000 -0700 +++ glibc-2.3/elf/dl-sym.c 2002-04-13 00:27:11.000000000 -0700 @@ -1,5 +1,5 @@ /* Look up a symbol in a shared object loaded by `dlopen'. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,10 +37,10 @@ _dl_sym (void *handle, const char *name, /* If the address is not recognized the call comes from the main program (we hope). */ - match = _dl_loaded; + match = GL(dl_loaded); /* Find the highest-addressed object that CALLER is not below. */ - for (l = _dl_loaded; l != NULL; l = l->l_next) + for (l = GL(dl_loaded); l != NULL; l = l->l_next) if (caller >= l->l_map_start && caller < l->l_map_end) { /* There must be exactly one DSO for the range of the virtual @@ -51,7 +51,9 @@ _dl_sym (void *handle, const char *name, if (handle == RTLD_DEFAULT) /* Search the global scope as seen in the caller object. */ - result = _dl_lookup_symbol (name, match, &ref, match->l_scope, 0, 0); + result = _dl_lookup_symbol (name, match, &ref, match->l_scope, 0, + DL_LOOKUP_RETURN_NEWEST + | DL_LOOKUP_ADD_DEPENDENCY); else { if (handle != RTLD_NEXT) @@ -60,15 +62,15 @@ _dl_sym (void *handle, const char *name, struct link_map *map = handle; result = _dl_lookup_symbol (name, match, &ref, map->l_local_scope, - 0, 1); + 0, DL_LOOKUP_RETURN_NEWEST); } else { - if (__builtin_expect (match == _dl_loaded, 0)) + if (__builtin_expect (match == GL(dl_loaded), 0)) { - if (! _dl_loaded - || caller < _dl_loaded->l_map_start - || caller >= _dl_loaded->l_map_end) + if (! GL(dl_loaded) + || caller < GL(dl_loaded)->l_map_start + || caller >= GL(dl_loaded)->l_map_end) _dl_signal_error (0, NULL, NULL, N_("\ RTLD_NEXT used in code not dynamically loaded")); } @@ -83,7 +85,16 @@ RTLD_NEXT used in code not dynamically l } if (ref != NULL) - return DL_SYMBOL_ADDRESS (result, ref); + { +#if defined USE_TLS && defined SHARED + if (ELFW(ST_TYPE) (ref->st_info) == STT_TLS) + /* The found symbol is a thread-local storage variable. + Return the address for to the current thread. */ + return _dl_tls_symaddr (result, ref); +#endif + + return DL_SYMBOL_ADDRESS (result, ref); + } return NULL; } @@ -108,10 +119,10 @@ _dl_vsym (void *handle, const char *name /* If the address is not recognized the call comes from the main program (we hope). */ - match = _dl_loaded; + match = GL(dl_loaded); /* Find the highest-addressed object that CALLER is not below. */ - for (l = _dl_loaded; l != NULL; l = l->l_next) + for (l = GL(dl_loaded); l != NULL; l = l->l_next) if (caller >= l->l_map_start && caller < l->l_map_end) { /* There must be exactly one DSO for the range of the virtual @@ -123,14 +134,14 @@ _dl_vsym (void *handle, const char *name if (handle == RTLD_DEFAULT) /* Search the global scope. */ result = _dl_lookup_versioned_symbol (name, match, &ref, match->l_scope, - &vers, 0, 0); + &vers, 0, DL_LOOKUP_ADD_DEPENDENCY); else if (handle == RTLD_NEXT) { - if (__builtin_expect (match == _dl_loaded, 0)) + if (__builtin_expect (match == GL(dl_loaded), 0)) { - if (! _dl_loaded - || caller < _dl_loaded->l_map_start - || caller >= _dl_loaded->l_map_end) + if (! GL(dl_loaded) + || caller < GL(dl_loaded)->l_map_start + || caller >= GL(dl_loaded)->l_map_end) _dl_signal_error (0, NULL, NULL, N_("\ RTLD_NEXT used in code not dynamically loaded")); } @@ -148,11 +159,20 @@ RTLD_NEXT used in code not dynamically l /* Search the scope of the given object. */ struct link_map *map = handle; result = _dl_lookup_versioned_symbol (name, map, &ref, - map->l_local_scope, &vers, 0, 1); + map->l_local_scope, &vers, 0, 0); } if (ref != NULL) - return DL_SYMBOL_ADDRESS (result, ref); + { +#if defined USE_TLS && defined SHARED + if (ELFW(ST_TYPE) (ref->st_info) == STT_TLS) + /* The found symbol is a thread-local storage variable. + Return the address for to the current thread. */ + return _dl_tls_symaddr (result, ref); +#endif + + return DL_SYMBOL_ADDRESS (result, ref); + } return NULL; } diff -durpN glibc-2.2.5/elf/dl-version.c glibc-2.3/elf/dl-version.c --- glibc-2.2.5/elf/dl-version.c 2001-11-07 15:19:14.000000000 -0800 +++ glibc-2.3/elf/dl-version.c 2002-03-11 00:31:59.000000000 -0800 @@ -1,5 +1,5 @@ /* Handle symbol and library versioning. - Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -58,7 +58,7 @@ find_needed (const char *name, struct li struct link_map *tmap; unsigned int n; - for (tmap = _dl_loaded; tmap != NULL; tmap = tmap->l_next) + for (tmap = GL(dl_loaded); tmap != NULL; tmap = tmap->l_next) if (_dl_name_match_p (name, tmap)) return tmap; @@ -86,11 +86,11 @@ match_symbol (const char *name, ElfW(Wor int result = 0; /* Display information about what we are doing while debugging. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_VERSIONS, 0)) - _dl_debug_printf ("\ + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_VERSIONS, 0)) + INTUSE(_dl_debug_printf) ("\ checking for version `%s' in file %s required by file %s\n", - string, map->l_name[0] ? map->l_name : _dl_argv[0], - name); + string, map->l_name[0] + ? map->l_name : rtld_progname, name); if (__builtin_expect (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL, 0)) { @@ -121,8 +121,8 @@ no version information available (requir buf[sizeof (buf) - 1] = '\0'; /* XXX We cannot translate the message. */ errstring = make_string ("unsupported version ", - _itoa_word (def->vd_version, - &buf[sizeof (buf) - 1], 10, 0), + _itoa (def->vd_version, + &buf[sizeof (buf) - 1], 10, 0), " of Verdef record"); result = 1; goto call_cerror; @@ -166,8 +166,8 @@ no version information available (requir name, ")"); result = 1; call_cerror: - _dl_signal_cerror (0, map->l_name[0] ? map->l_name : _dl_argv[0], NULL, - errstring); + _dl_signal_cerror (0, map->l_name[0] ? map->l_name : rtld_progname, + NULL, errstring); return result; } @@ -210,12 +210,13 @@ _dl_check_map_versions (struct link_map buf[sizeof (buf) - 1] = '\0'; /* XXX We cannot translate the message. */ errstring = make_string ("unsupported version ", - _itoa_word (ent->vn_version, - &buf[sizeof (buf) - 1], 10, 0), + _itoa (ent->vn_version, + &buf[sizeof (buf) - 1], 10, 0), " of Verneed record\n"); call_error: - _dl_signal_error (errval, (*map->l_name ? map->l_name : _dl_argv[0]), - NULL, errstring); + INTUSE(_dl_signal_error) (errval, (*map->l_name + ? map->l_name : rtld_progname), + NULL, errstring); } while (1) @@ -239,7 +240,7 @@ _dl_check_map_versions (struct link_map { /* Match the symbol. */ result |= match_symbol ((*map->l_name - ? map->l_name : _dl_argv[0]), + ? map->l_name : rtld_progname), aux->vna_hash, strtab + aux->vna_name, needed, verbose, @@ -373,6 +374,7 @@ _dl_check_map_versions (struct link_map return result; } +INTDEF (_dl_check_map_versions) int @@ -383,7 +385,8 @@ _dl_check_all_versions (struct link_map int result = 0; for (l = map; l != NULL; l = l->l_next) - result |= ! l->l_faked && _dl_check_map_versions (l, verbose, trace_mode); + result |= (! l->l_faked + && INTUSE(_dl_check_map_versions) (l, verbose, trace_mode)); return result; } diff -durpN glibc-2.2.5/elf/dl-xstat64.c glibc-2.3/elf/dl-xstat64.c --- glibc-2.2.5/elf/dl-xstat64.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/dl-xstat64.c 2002-02-01 13:16:41.000000000 -0800 @@ -0,0 +1,25 @@ +/* Dynamic linker's private version of __xstat64. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* This special file is needed because some xstat64.c implementations + use versioning for __xstat64 and we need to keep it local to + the dynamic linker. */ + +#define RTLD_STAT64 +#include diff -durpN glibc-2.2.5/elf/do-lookup.h glibc-2.3/elf/do-lookup.h --- glibc-2.2.5/elf/do-lookup.h 2001-08-26 15:24:08.000000000 -0700 +++ glibc-2.3/elf/do-lookup.h 2002-04-13 00:32:17.000000000 -0700 @@ -1,5 +1,5 @@ /* Look up a symbol in the loaded objects. - Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,10 +19,10 @@ #if VERSIONED # define FCT do_lookup_versioned -# define ARG const struct r_found_version *const version, +# define ARG const struct r_found_version *const version #else # define FCT do_lookup -# define ARG +# define ARG int flags #endif /* Inner part of the lookup functions. We return a value > 0 if we @@ -30,7 +30,7 @@ something bad happened. */ static inline int FCT (const char *undef_name, unsigned long int hash, const ElfW(Sym) *ref, - struct sym_val *result, struct r_scope_elem *scope, size_t i, ARG + struct sym_val *result, struct r_scope_elem *scope, size_t i, ARG, struct link_map *skip, int type_class) { struct link_map **list = scope->r_list; @@ -60,9 +60,10 @@ FCT (const char *undef_name, unsigned lo continue; /* Print some debugging info if wanted. */ - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_SYMBOLS, 0)) - _dl_debug_printf ("symbol=%s; lookup in file=%s\n", undef_name, - map->l_name[0] ? map->l_name : _dl_argv[0]); + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0)) + INTUSE(_dl_debug_printf) ("symbol=%s; lookup in file=%s\n", + undef_name, (map->l_name[0] + ? map->l_name : rtld_progname)); symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]); strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); @@ -77,15 +78,22 @@ FCT (const char *undef_name, unsigned lo sym = &symtab[symidx]; assert (ELF_RTYPE_CLASS_PLT == 1); - if (sym->st_value == 0 || /* No value. */ - /* ((type_class & ELF_RTYPE_CLASS_PLT) - && (sym->st_shndx == SHN_UNDEF)) */ - (type_class & (sym->st_shndx == SHN_UNDEF))) + if ((sym->st_value == 0 /* No value. */ +#ifdef USE_TLS + && ELFW(ST_TYPE) (sym->st_info) != STT_TLS +#endif + ) + || (type_class & (sym->st_shndx == SHN_UNDEF))) continue; - if (ELFW(ST_TYPE) (sym->st_info) > STT_FUNC) - /* Ignore all but STT_NOTYPE, STT_OBJECT and STT_FUNC entries - since these are no code/data definitions. */ + if (ELFW(ST_TYPE) (sym->st_info) > STT_FUNC +#ifdef USE_TLS + && ELFW(ST_TYPE) (sym->st_info) != STT_TLS +#endif + ) + /* Ignore all but STT_NOTYPE, STT_OBJECT and STT_FUNC + entries (and STT_TLS if TLS is supported) since these + are no code/data definitions. */ continue; if (sym != ref && strcmp (strtab + sym->st_name, undef_name)) @@ -121,19 +129,34 @@ FCT (const char *undef_name, unsigned lo continue; } #else - /* No specific version is selected. When the object file - also does not define a version we have a match. - Otherwise we accept the default version, or in case there - is only one version defined, this one version. */ + /* No specific version is selected. There are two ways we + can got here: + + - a binary which does not include versioning information + is loaded + + - dlsym() instead of dlvsym() is used to get a symbol which + might exist in more than one form + + If the library does not provide symbol version + information there is no problem at at: we simply use the + symbol if it is defined. + + These two lookups need to be handled differently if the + library defines versions. In the case of the old + unversioned application the oldest (default) version + should be used. In case of a dlsym() call the latest and + public interface should be returned. */ if (verstab != NULL) { - ElfW(Half) ndx = verstab[symidx] & 0x7fff; - if (ndx > 2) /* map->l_versions[ndx].hash != 0) */ + if ((verstab[symidx] & 0x7fff) + >= ((flags & DL_LOOKUP_RETURN_NEWEST) ? 2 : 3)) { /* Don't accept hidden symbols. */ if ((verstab[symidx] & 0x8000) == 0 && num_versions++ == 0) /* No version so far. */ versioned_sym = sym; + continue; } } @@ -160,7 +183,7 @@ FCT (const char *undef_name, unsigned lo { case STB_WEAK: /* Weak definition. Use this value if we don't find another. */ - if (__builtin_expect (_dl_dynamic_weak, 0)) + if (__builtin_expect (GL(dl_dynamic_weak), 0)) { if (! result->s) { diff -durpN glibc-2.2.5/elf/do-rel.h glibc-2.3/elf/do-rel.h --- glibc-2.2.5/elf/do-rel.h 2001-08-24 11:45:23.000000000 -0700 +++ glibc-2.3/elf/do-rel.h 2002-09-27 21:15:03.000000000 -0700 @@ -1,5 +1,5 @@ /* Do relocations for ELF dynamic linking. - Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -30,9 +30,19 @@ # define RELCOUNT_IDX VERSYMIDX (DT_RELCOUNT) #endif +#ifndef DO_ELF_MACHINE_REL_RELATIVE +# define DO_ELF_MACHINE_REL_RELATIVE(map, l_addr, relative) \ + elf_machine_rel_relative (l_addr, relative, \ + (void *) (l_addr + relative->r_offset)) +#endif + #ifndef VERSYMIDX # define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym)) #endif +#ifndef VALIDX +# define VALIDX(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \ + + DT_EXTRANUM + DT_VALTAGIDX (tag)) +#endif /* Perform the relocations in MAP on the running program image as specified by RELTAG, SZTAG. If LAZY is nonzero, this is the first pass on PLT @@ -48,7 +58,7 @@ elf_dynamic_do_rel (struct link_map *map const ElfW(Rel) *end = (const void *) (reladdr + relsize); ElfW(Addr) l_addr = map->l_addr; -#ifndef RTLD_BOOTSTRAP +#if (!defined DO_RELA || !defined ELF_MACHINE_PLT_REL) && !defined RTLD_BOOTSTRAP /* We never bind lazily during ld.so bootstrap. Unfortunately gcc is not clever enough to see through all the function calls to realize that. */ @@ -66,7 +76,7 @@ elf_dynamic_do_rel (struct link_map *map ElfW(Word) nrelative = (map->l_info[RELCOUNT_IDX] == NULL ? 0 : map->l_info[RELCOUNT_IDX]->d_un.d_val); const ElfW(Rel) *relative = r; - r = MIN (r + nrelative, end); + r = r + MIN (nrelative, relsize / sizeof (ElfW(Rel))); #ifndef RTLD_BOOTSTRAP /* This is defined in rtld.c, but nowhere in the static libc.a; make @@ -75,37 +85,49 @@ elf_dynamic_do_rel (struct link_map *map RTLD_BOOTSTRAP) because rtld.c contains the common defn for _dl_rtld_map, which is incompatible with a weak decl in the same file. */ - weak_extern (_dl_rtld_map); - if (map != &_dl_rtld_map) /* Already done in rtld itself. */ -# ifndef DO_RELA +# ifndef SHARED + weak_extern (GL(dl_rtld_map)); +# endif + if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */ +# if !defined DO_RELA || defined ELF_MACHINE_REL_RELATIVE /* Rela platforms get the offset from r_addend and this must be copied in the relocation address. Therefore we can skip the relative relocations only if this is for rel - relocations. */ + relocations or rela relocations if they are computed as + memory_loc += l_addr... */ if (l_addr != 0) +# else + /* ...or we know the object has been prelinked. */ + if (l_addr != 0 || ! map->l_info[VALIDX(DT_GNU_PRELINKED)]) # endif #endif for (; relative < r; ++relative) - elf_machine_rel_relative (l_addr, relative, - (void *) (l_addr + relative->r_offset)); + DO_ELF_MACHINE_REL_RELATIVE (map, l_addr, relative); +#ifdef RTLD_BOOTSTRAP + /* The dynamic linker always uses versioning. */ + assert (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL); +#else if (map->l_info[VERSYMIDX (DT_VERSYM)]) +#endif { const ElfW(Half) *const version = (const void *) D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]); for (; r < end; ++r) { - ElfW(Half) ndx = version[ELFW(R_SYM) (r->r_info)]; + ElfW(Half) ndx = version[ELFW(R_SYM) (r->r_info)] & 0x7fff; elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], &map->l_versions[ndx], (void *) (l_addr + r->r_offset)); } } +#ifndef RTLD_BOOTSTRAP else for (; r < end; ++r) elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL, (void *) (l_addr + r->r_offset)); +#endif } } @@ -113,4 +135,5 @@ elf_dynamic_do_rel (struct link_map *map #undef Rel #undef elf_machine_rel #undef elf_machine_rel_relative +#undef DO_ELF_MACHINE_REL_RELATIVE #undef RELCOUNT_IDX diff -durpN glibc-2.2.5/elf/dynamic-link.h glibc-2.3/elf/dynamic-link.h --- glibc-2.2.5/elf/dynamic-link.h 2001-07-05 21:54:46.000000000 -0700 +++ glibc-2.3/elf/dynamic-link.h 2002-09-26 19:46:27.000000000 -0700 @@ -1,5 +1,5 @@ /* Inline functions for dynamic linking. - Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,24 +26,19 @@ #endif -/* Global read-only variable defined in rtld.c which is nonzero if we - shall give more warning messages. */ -extern int _dl_verbose __attribute__ ((unused)); - - /* Read the dynamic section at DYN and fill in INFO with indices DT_*. */ -static inline void __attribute__ ((unused)) +static inline void __attribute__ ((unused, always_inline)) elf_get_dynamic_info (struct link_map *l) { ElfW(Dyn) *dyn = l->l_ld; - ElfW(Addr) l_addr; ElfW(Dyn) **info; - if (! dyn) +#ifndef RTLD_BOOTSTRAP + if (dyn == NULL) return; +#endif - l_addr = l->l_addr; info = l->l_info; while (dyn->d_tag != DT_NULL) @@ -58,71 +53,100 @@ elf_get_dynamic_info (struct link_map *l else if ((Elf32_Word) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM) info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM] = dyn; - else - assert (! "bad dynamic tag"); + else if ((Elf32_Word) DT_VALTAGIDX (dyn->d_tag) < DT_VALNUM) + info[DT_VALTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM + + DT_VERSIONTAGNUM + DT_EXTRANUM] = dyn; + else if ((Elf32_Word) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM) + info[DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM + + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] = dyn; ++dyn; } #ifndef DL_RO_DYN_SECTION - if (info[DT_PLTGOT] != NULL) - info[DT_PLTGOT]->d_un.d_ptr += l_addr; - if (info[DT_STRTAB] != NULL) - info[DT_STRTAB]->d_un.d_ptr += l_addr; - if (info[DT_SYMTAB] != NULL) - info[DT_SYMTAB]->d_un.d_ptr += l_addr; -# if ! ELF_MACHINE_NO_RELA - if (info[DT_RELA] != NULL) + /* Don't adjust .dynamic unnecessarily. */ + if (l->l_addr != 0) { - assert (info[DT_RELAENT]->d_un.d_val == sizeof (ElfW(Rela))); - info[DT_RELA]->d_un.d_ptr += l_addr; - } + ElfW(Addr) l_addr = l->l_addr; + + if (info[DT_HASH] != NULL) + info[DT_HASH]->d_un.d_ptr += l_addr; + if (info[DT_PLTGOT] != NULL) + info[DT_PLTGOT]->d_un.d_ptr += l_addr; + if (info[DT_STRTAB] != NULL) + info[DT_STRTAB]->d_un.d_ptr += l_addr; + if (info[DT_SYMTAB] != NULL) + info[DT_SYMTAB]->d_un.d_ptr += l_addr; +# if ! ELF_MACHINE_NO_RELA + if (info[DT_RELA] != NULL) + info[DT_RELA]->d_un.d_ptr += l_addr; # endif # if ! ELF_MACHINE_NO_REL - if (info[DT_REL] != NULL) - { - assert (info[DT_RELENT]->d_un.d_val == sizeof (ElfW(Rel))); - info[DT_REL]->d_un.d_ptr += l_addr; - } + if (info[DT_REL] != NULL) + info[DT_REL]->d_un.d_ptr += l_addr; # endif + if (info[DT_JMPREL] != NULL) + info[DT_JMPREL]->d_un.d_ptr += l_addr; + if (info[VERSYMIDX (DT_VERSYM)] != NULL) + info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr += l_addr; + } #endif if (info[DT_PLTREL] != NULL) { -# if ELF_MACHINE_NO_RELA +#if ELF_MACHINE_NO_RELA assert (info[DT_PLTREL]->d_un.d_val == DT_REL); -# elif ELF_MACHINE_NO_REL +#elif ELF_MACHINE_NO_REL assert (info[DT_PLTREL]->d_un.d_val == DT_RELA); -# else +#else assert (info[DT_PLTREL]->d_un.d_val == DT_REL || info[DT_PLTREL]->d_un.d_val == DT_RELA); -# endif +#endif } -#ifndef DL_RO_DYN_SECTION - if (info[DT_JMPREL] != NULL) - info[DT_JMPREL]->d_un.d_ptr += l_addr; - if (info[VERSYMIDX (DT_VERSYM)] != NULL) - info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr += l_addr; +#if ! ELF_MACHINE_NO_RELA + if (info[DT_RELA] != NULL) + assert (info[DT_RELAENT]->d_un.d_val == sizeof (ElfW(Rela))); +# endif +# if ! ELF_MACHINE_NO_REL + if (info[DT_REL] != NULL) + assert (info[DT_RELENT]->d_un.d_val == sizeof (ElfW(Rel))); #endif if (info[DT_FLAGS] != NULL) { /* Flags are used. Translate to the old form where available. Since these l_info entries are only tested for NULL pointers it is ok if they point to the DT_FLAGS entry. */ - ElfW(Word) flags = info[DT_FLAGS]->d_un.d_val; - if (flags & DF_SYMBOLIC) + l->l_flags = info[DT_FLAGS]->d_un.d_val; +#ifdef RTLD_BOOTSTRAP + /* These three flags must not be set for ld.so. */ + assert ((l->l_flags & (DF_SYMBOLIC | DF_TEXTREL | DF_BIND_NOW)) == 0); +#else + if (l->l_flags & DF_SYMBOLIC) info[DT_SYMBOLIC] = info[DT_FLAGS]; - if (flags & DF_TEXTREL) + if (l->l_flags & DF_TEXTREL) info[DT_TEXTREL] = info[DT_FLAGS]; - if (flags & DF_BIND_NOW) + if (l->l_flags & DF_BIND_NOW) info[DT_BIND_NOW] = info[DT_FLAGS]; +#endif } if (info[VERSYMIDX (DT_FLAGS_1)] != NULL) l->l_flags_1 = info[VERSYMIDX (DT_FLAGS_1)]->d_un.d_val; +#ifdef RTLD_BOOTSTRAP + /* The dynamic linker should have none of these set. */ + assert (info[DT_RUNPATH] == NULL); + assert (info[DT_RPATH] == NULL); +#else if (info[DT_RUNPATH] != NULL) /* If both RUNPATH and RPATH are given, the latter is ignored. */ info[DT_RPATH] = NULL; +#endif } #ifdef RESOLVE +# ifdef RTLD_BOOTSTRAP +# define ELF_DURING_STARTUP (1) +# else +# define ELF_DURING_STARTUP (0) +# endif + /* Get the definitions of `elf_dynamic_do_rel' and `elf_dynamic_do_rela'. These functions are almost identical, so we use cpp magic to avoid duplicating their code. It cannot be done in a more general function @@ -149,7 +173,7 @@ elf_get_dynamic_info (struct link_map *l ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \ } \ \ - if ((do_lazy) \ + if ((do_lazy) \ && (map)->l_info[DT_PLTREL] \ && (!test_rel || (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC)) \ { \ @@ -170,41 +194,50 @@ elf_get_dynamic_info (struct link_map *l # define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, test_rel) \ do { \ struct { ElfW(Addr) start, size; int lazy; } ranges[2]; \ - int ranges_index; \ ranges[0].lazy = 0; \ ranges[0].size = ranges[1].size = 0; \ ranges[0].start = 0; \ \ if ((map)->l_info[DT_##RELOC]) \ { \ - ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]); \ - ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \ + ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]); \ + ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \ } \ if ((map)->l_info[DT_PLTREL] \ && (!test_rel || (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC)) \ { \ ElfW(Addr) start = D_PTR ((map), l_info[DT_JMPREL]); \ \ - if ((do_lazy) \ - /* This test does not only detect whether the relocation \ - sections are in the right order, it also checks whether \ - there is a DT_REL/DT_RELA section. */ \ - || ranges[0].start + ranges[0].size != start) \ + if (! ELF_DURING_STARTUP \ + && ((do_lazy) \ + /* This test does not only detect whether the relocation \ + sections are in the right order, it also checks whether \ + there is a DT_REL/DT_RELA section. */ \ + || ranges[0].start + ranges[0].size != start)) \ { \ ranges[1].start = start; \ ranges[1].size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val; \ ranges[1].lazy = (do_lazy); \ } \ else \ - /* Combine processing the sections. */ \ - ranges[0].size += (map)->l_info[DT_PLTRELSZ]->d_un.d_val; \ + { \ + /* Combine processing the sections. */ \ + assert (ranges[0].start + ranges[0].size == start); \ + ranges[0].size += (map)->l_info[DT_PLTRELSZ]->d_un.d_val; \ + } \ } \ \ - for (ranges_index = 0; ranges_index < 2; ++ranges_index) \ - elf_dynamic_do_##reloc ((map), \ - ranges[ranges_index].start, \ - ranges[ranges_index].size, \ - ranges[ranges_index].lazy); \ + if (ELF_DURING_STARTUP) \ + elf_dynamic_do_##reloc ((map), ranges[0].start, ranges[0].size, 0); \ + else \ + { \ + int ranges_index; \ + for (ranges_index = 0; ranges_index < 2; ++ranges_index) \ + elf_dynamic_do_##reloc ((map), \ + ranges[ranges_index].start, \ + ranges[ranges_index].size, \ + ranges[ranges_index].lazy); \ + } \ } while (0) # endif diff -durpN glibc-2.2.5/elf/elf.h glibc-2.3/elf/elf.h --- glibc-2.2.5/elf/elf.h 2002-01-07 22:28:21.000000000 -0800 +++ glibc-2.3/elf/elf.h 2002-10-01 23:15:56.000000000 -0700 @@ -1,5 +1,5 @@ /* This file defines standard ELF types, structures, and macros. - Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -415,10 +415,6 @@ typedef struct #define SYMINFO_NUM 2 -/* Special section index. */ - -#define SHN_UNDEF 0 /* No section, undefined symbol. */ - /* How to extract and insert information held in the st_info field. */ #define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4) @@ -449,7 +445,8 @@ typedef struct #define STT_SECTION 3 /* Symbol associated with a section */ #define STT_FILE 4 /* Symbol's name is file name */ #define STT_COMMON 5 /* Symbol is a common data object */ -#define STT_NUM 6 /* Number of defined types. */ +#define STT_TLS 6 /* Symbol is thread-local data object*/ +#define STT_NUM 7 /* Number of defined types. */ #define STT_LOOS 10 /* Start of OS-specific */ #define STT_HIOS 12 /* End of OS-specific */ #define STT_LOPROC 13 /* Start of processor-specific */ @@ -560,7 +557,11 @@ typedef struct #define PT_TLS 7 /* Thread-local storage segment */ #define PT_NUM 8 /* Number of defined types */ #define PT_LOOS 0x60000000 /* Start of OS-specific */ -#define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ +#define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ +#define PT_LOSUNW 0x6ffffffa +#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ +#define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ +#define PT_HISUNW 0x6fffffff #define PT_HIOS 0x6fffffff /* End of OS-specific */ #define PT_LOPROC 0x70000000 /* Start of processor-specific */ #define PT_HIPROC 0x7fffffff /* End of processor-specific */ @@ -582,6 +583,7 @@ typedef struct #define NT_PLATFORM 5 /* String from sysinfo(SI_PLATFORM) */ #define NT_AUXV 6 /* Contains copy of auxv array */ #define NT_GWINDOWS 7 /* Contains copy of gwindows struct */ +#define NT_ASRS 8 /* Contains copy of asrset struct */ #define NT_PSTATUS 10 /* Contains copy of pstatus struct */ #define NT_PSINFO 13 /* Contains copy of psinfo struct */ #define NT_PRCRED 14 /* Contains copy of prcred struct */ @@ -654,8 +656,8 @@ typedef struct #define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/ #define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */ #define DT_NUM 34 /* Number used */ -#define DT_LOOS 0x60000000 /* Start of OS-specific */ -#define DT_HIOS 0x6fffffff /* End of OS-specific */ +#define DT_LOOS 0x6000000d /* Start of OS-specific */ +#define DT_HIOS 0x6ffff000 /* End of OS-specific */ #define DT_LOPROC 0x70000000 /* Start of processor-specific */ #define DT_HIPROC 0x7fffffff /* End of processor-specific */ #define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */ @@ -677,6 +679,8 @@ typedef struct #define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */ #define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */ #define DT_VALRNGHI 0x6ffffdff +#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */ +#define DT_VALNUM 12 /* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the Dyn.d_un.d_ptr field of the Elf*_Dyn structure. @@ -693,6 +697,8 @@ typedef struct #define DT_MOVETAB 0x6ffffefe /* Move table. */ #define DT_SYMINFO 0x6ffffeff /* Syminfo table. */ #define DT_ADDRRNGHI 0x6ffffeff +#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */ +#define DT_ADDRNUM 10 /* The versioning entry types. The next are defined as part of the GNU extension. */ @@ -724,6 +730,7 @@ typedef struct #define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */ #define DF_TEXTREL 0x00000004 /* Object contains text relocations */ #define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */ +#define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model */ /* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1 entry in the dynamic section. */ @@ -1054,19 +1061,56 @@ typedef struct /* i386 relocs. */ -#define R_386_NONE 0 /* No reloc */ -#define R_386_32 1 /* Direct 32 bit */ -#define R_386_PC32 2 /* PC relative 32 bit */ -#define R_386_GOT32 3 /* 32 bit GOT entry */ -#define R_386_PLT32 4 /* 32 bit PLT address */ -#define R_386_COPY 5 /* Copy symbol at runtime */ -#define R_386_GLOB_DAT 6 /* Create GOT entry */ -#define R_386_JMP_SLOT 7 /* Create PLT entry */ -#define R_386_RELATIVE 8 /* Adjust by program base */ -#define R_386_GOTOFF 9 /* 32 bit offset to GOT */ -#define R_386_GOTPC 10 /* 32 bit PC relative offset to GOT */ +#define R_386_NONE 0 /* No reloc */ +#define R_386_32 1 /* Direct 32 bit */ +#define R_386_PC32 2 /* PC relative 32 bit */ +#define R_386_GOT32 3 /* 32 bit GOT entry */ +#define R_386_PLT32 4 /* 32 bit PLT address */ +#define R_386_COPY 5 /* Copy symbol at runtime */ +#define R_386_GLOB_DAT 6 /* Create GOT entry */ +#define R_386_JMP_SLOT 7 /* Create PLT entry */ +#define R_386_RELATIVE 8 /* Adjust by program base */ +#define R_386_GOTOFF 9 /* 32 bit offset to GOT */ +#define R_386_GOTPC 10 /* 32 bit PC relative offset to GOT */ +#define R_386_32PLT 11 +#define R_386_TLS_TPOFF 14 /* Offset in static TLS block */ +#define R_386_TLS_IE 15 /* Address of GOT entry for static TLS + block offset */ +#define R_386_TLS_GOTIE 16 /* GOT entry for static TLS block + offset */ +#define R_386_TLS_LE 17 /* Offset relative to static TLS + block */ +#define R_386_TLS_GD 18 /* Direct 32 bit for GNU version of + general dynamic thread local data */ +#define R_386_TLS_LDM 19 /* Direct 32 bit for GNU version of + local dynamic thread local data + in LE code */ +#define R_386_16 20 +#define R_386_PC16 21 +#define R_386_8 22 +#define R_386_PC8 23 +#define R_386_TLS_GD_32 24 /* Direct 32 bit for general dynamic + thread local data */ +#define R_386_TLS_GD_PUSH 25 /* Tag for pushl in GD TLS code */ +#define R_386_TLS_GD_CALL 26 /* Relocation for call to + __tls_get_addr() */ +#define R_386_TLS_GD_POP 27 /* Tag for popl in GD TLS code */ +#define R_386_TLS_LDM_32 28 /* Direct 32 bit for local dynamic + thread local data in LE code */ +#define R_386_TLS_LDM_PUSH 29 /* Tag for pushl in LDM TLS code */ +#define R_386_TLS_LDM_CALL 30 /* Relocation for call to + __tls_get_addr() in LDM code */ +#define R_386_TLS_LDM_POP 31 /* Tag for popl in LDM TLS code */ +#define R_386_TLS_LDO_32 32 /* Offset relative to TLS block */ +#define R_386_TLS_IE_32 33 /* GOT entry for negated static TLS + block offset */ +#define R_386_TLS_LE_32 34 /* Negated offset relative to static + TLS block */ +#define R_386_TLS_DTPMOD32 35 /* ID of module containing symbol */ +#define R_386_TLS_DTPOFF32 36 /* Offset in TLS block */ +#define R_386_TLS_TPOFF32 37 /* Negated offset in static TLS block */ /* Keep this the last entry. */ -#define R_386_NUM 11 +#define R_386_NUM 38 /* SUN SPARC specific definitions. */ @@ -1089,66 +1133,90 @@ typedef struct /* SPARC relocs. */ -#define R_SPARC_NONE 0 /* No reloc */ -#define R_SPARC_8 1 /* Direct 8 bit */ -#define R_SPARC_16 2 /* Direct 16 bit */ -#define R_SPARC_32 3 /* Direct 32 bit */ -#define R_SPARC_DISP8 4 /* PC relative 8 bit */ -#define R_SPARC_DISP16 5 /* PC relative 16 bit */ -#define R_SPARC_DISP32 6 /* PC relative 32 bit */ -#define R_SPARC_WDISP30 7 /* PC relative 30 bit shifted */ -#define R_SPARC_WDISP22 8 /* PC relative 22 bit shifted */ -#define R_SPARC_HI22 9 /* High 22 bit */ -#define R_SPARC_22 10 /* Direct 22 bit */ -#define R_SPARC_13 11 /* Direct 13 bit */ -#define R_SPARC_LO10 12 /* Truncated 10 bit */ -#define R_SPARC_GOT10 13 /* Truncated 10 bit GOT entry */ -#define R_SPARC_GOT13 14 /* 13 bit GOT entry */ -#define R_SPARC_GOT22 15 /* 22 bit GOT entry shifted */ -#define R_SPARC_PC10 16 /* PC relative 10 bit truncated */ -#define R_SPARC_PC22 17 /* PC relative 22 bit shifted */ -#define R_SPARC_WPLT30 18 /* 30 bit PC relative PLT address */ -#define R_SPARC_COPY 19 /* Copy symbol at runtime */ -#define R_SPARC_GLOB_DAT 20 /* Create GOT entry */ -#define R_SPARC_JMP_SLOT 21 /* Create PLT entry */ -#define R_SPARC_RELATIVE 22 /* Adjust by program base */ -#define R_SPARC_UA32 23 /* Direct 32 bit unaligned */ +#define R_SPARC_NONE 0 /* No reloc */ +#define R_SPARC_8 1 /* Direct 8 bit */ +#define R_SPARC_16 2 /* Direct 16 bit */ +#define R_SPARC_32 3 /* Direct 32 bit */ +#define R_SPARC_DISP8 4 /* PC relative 8 bit */ +#define R_SPARC_DISP16 5 /* PC relative 16 bit */ +#define R_SPARC_DISP32 6 /* PC relative 32 bit */ +#define R_SPARC_WDISP30 7 /* PC relative 30 bit shifted */ +#define R_SPARC_WDISP22 8 /* PC relative 22 bit shifted */ +#define R_SPARC_HI22 9 /* High 22 bit */ +#define R_SPARC_22 10 /* Direct 22 bit */ +#define R_SPARC_13 11 /* Direct 13 bit */ +#define R_SPARC_LO10 12 /* Truncated 10 bit */ +#define R_SPARC_GOT10 13 /* Truncated 10 bit GOT entry */ +#define R_SPARC_GOT13 14 /* 13 bit GOT entry */ +#define R_SPARC_GOT22 15 /* 22 bit GOT entry shifted */ +#define R_SPARC_PC10 16 /* PC relative 10 bit truncated */ +#define R_SPARC_PC22 17 /* PC relative 22 bit shifted */ +#define R_SPARC_WPLT30 18 /* 30 bit PC relative PLT address */ +#define R_SPARC_COPY 19 /* Copy symbol at runtime */ +#define R_SPARC_GLOB_DAT 20 /* Create GOT entry */ +#define R_SPARC_JMP_SLOT 21 /* Create PLT entry */ +#define R_SPARC_RELATIVE 22 /* Adjust by program base */ +#define R_SPARC_UA32 23 /* Direct 32 bit unaligned */ /* Additional Sparc64 relocs. */ -#define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */ -#define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */ -#define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */ -#define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */ -#define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */ -#define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */ -#define R_SPARC_10 30 /* Direct 10 bit */ -#define R_SPARC_11 31 /* Direct 11 bit */ -#define R_SPARC_64 32 /* Direct 64 bit */ -#define R_SPARC_OLO10 33 /* 10bit with secondary 13bit addend */ -#define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */ -#define R_SPARC_HM10 35 /* High middle 10 bits of ... */ -#define R_SPARC_LM22 36 /* Low middle 22 bits of ... */ -#define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */ -#define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */ -#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */ -#define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */ -#define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */ -#define R_SPARC_7 43 /* Direct 7 bit */ -#define R_SPARC_5 44 /* Direct 5 bit */ -#define R_SPARC_6 45 /* Direct 6 bit */ -#define R_SPARC_DISP64 46 /* PC relative 64 bit */ -#define R_SPARC_PLT64 47 /* Direct 64 bit ref to PLT entry */ -#define R_SPARC_HIX22 48 /* High 22 bit complemented */ -#define R_SPARC_LOX10 49 /* Truncated 11 bit complemented */ -#define R_SPARC_H44 50 /* Direct high 12 of 44 bit */ -#define R_SPARC_M44 51 /* Direct mid 22 of 44 bit */ -#define R_SPARC_L44 52 /* Direct low 10 of 44 bit */ -#define R_SPARC_REGISTER 53 /* Global register usage */ -#define R_SPARC_UA64 54 /* Direct 64 bit unaligned */ -#define R_SPARC_UA16 55 /* Direct 16 bit unaligned */ +#define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */ +#define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */ +#define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */ +#define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */ +#define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */ +#define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */ +#define R_SPARC_10 30 /* Direct 10 bit */ +#define R_SPARC_11 31 /* Direct 11 bit */ +#define R_SPARC_64 32 /* Direct 64 bit */ +#define R_SPARC_OLO10 33 /* 10bit with secondary 13bit addend */ +#define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */ +#define R_SPARC_HM10 35 /* High middle 10 bits of ... */ +#define R_SPARC_LM22 36 /* Low middle 22 bits of ... */ +#define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */ +#define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */ +#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */ +#define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */ +#define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */ +#define R_SPARC_7 43 /* Direct 7 bit */ +#define R_SPARC_5 44 /* Direct 5 bit */ +#define R_SPARC_6 45 /* Direct 6 bit */ +#define R_SPARC_DISP64 46 /* PC relative 64 bit */ +#define R_SPARC_PLT64 47 /* Direct 64 bit ref to PLT entry */ +#define R_SPARC_HIX22 48 /* High 22 bit complemented */ +#define R_SPARC_LOX10 49 /* Truncated 11 bit complemented */ +#define R_SPARC_H44 50 /* Direct high 12 of 44 bit */ +#define R_SPARC_M44 51 /* Direct mid 22 of 44 bit */ +#define R_SPARC_L44 52 /* Direct low 10 of 44 bit */ +#define R_SPARC_REGISTER 53 /* Global register usage */ +#define R_SPARC_UA64 54 /* Direct 64 bit unaligned */ +#define R_SPARC_UA16 55 /* Direct 16 bit unaligned */ +#define R_SPARC_TLS_GD_HI22 56 +#define R_SPARC_TLS_GD_LO10 57 +#define R_SPARC_TLS_GD_ADD 58 +#define R_SPARC_TLS_GD_CALL 59 +#define R_SPARC_TLS_LDM_HI22 60 +#define R_SPARC_TLS_LDM_LO10 61 +#define R_SPARC_TLS_LDM_ADD 62 +#define R_SPARC_TLS_LDM_CALL 63 +#define R_SPARC_TLS_LDO_HIX22 64 +#define R_SPARC_TLS_LDO_LOX10 65 +#define R_SPARC_TLS_LDO_ADD 66 +#define R_SPARC_TLS_IE_HI22 67 +#define R_SPARC_TLS_IE_LO10 68 +#define R_SPARC_TLS_IE_LD 69 +#define R_SPARC_TLS_IE_LDX 70 +#define R_SPARC_TLS_IE_ADD 71 +#define R_SPARC_TLS_LE_HIX22 72 +#define R_SPARC_TLS_LE_LOX10 73 +#define R_SPARC_TLS_DTPMOD32 74 +#define R_SPARC_TLS_DTPMOD64 75 +#define R_SPARC_TLS_DTPOFF32 76 +#define R_SPARC_TLS_DTPOFF64 77 +#define R_SPARC_TLS_TPOFF32 78 +#define R_SPARC_TLS_TPOFF64 79 /* Keep this the last entry. */ -#define R_SPARC_NUM 56 +#define R_SPARC_NUM 80 /* For Sparc64, legal values for d_tag of Elf64_Dyn. */ @@ -1733,8 +1801,30 @@ typedef Elf32_Addr Elf32_Conflict; #define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */ #define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */ #define R_ALPHA_RELATIVE 27 /* Adjust by program base */ +#define R_ALPHA_TLS_GD_HI 28 +#define R_ALPHA_TLSGD 29 +#define R_ALPHA_TLS_LDM 30 +#define R_ALPHA_DTPMOD64 31 +#define R_ALPHA_GOTDTPREL 32 +#define R_ALPHA_DTPREL64 33 +#define R_ALPHA_DTPRELHI 34 +#define R_ALPHA_DTPRELLO 35 +#define R_ALPHA_DTPREL16 36 +#define R_ALPHA_GOTTPREL 37 +#define R_ALPHA_TPREL64 38 +#define R_ALPHA_TPRELHI 39 +#define R_ALPHA_TPRELLO 40 +#define R_ALPHA_TPREL16 41 /* Keep this the last entry. */ -#define R_ALPHA_NUM 28 +#define R_ALPHA_NUM 46 + +/* Magic values of the LITUSE relocation addend. */ +#define LITUSE_ALPHA_ADDR 0 +#define LITUSE_ALPHA_BASE 1 +#define LITUSE_ALPHA_BYTOFF 2 +#define LITUSE_ALPHA_JSR 3 +#define LITUSE_ALPHA_TLS_GD 4 +#define LITUSE_ALPHA_TLS_LDM 5 /* PowerPC specific declarations */ @@ -1788,6 +1878,78 @@ typedef Elf32_Addr Elf32_Conflict; /* Keep this the last entry. */ #define R_PPC_NUM 37 +/* PowerPC64 relocations defined by the ABIs */ +#define R_PPC64_NONE R_PPC_NONE +#define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address. */ +#define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned. */ +#define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address. */ +#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of abs. address. */ +#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of abs. address. */ +#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */ +#define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned. */ +#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN +#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN +#define R_PPC64_REL24 R_PPC_REL24 /* PC relative 26 bit, word aligned. */ +#define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit. */ +#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN +#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN +#define R_PPC64_GOT16 R_PPC_GOT16 +#define R_PPC64_GOT16_LO R_PPC_GOT16_LO +#define R_PPC64_GOT16_HI R_PPC_GOT16_HI +#define R_PPC64_GOT16_HA R_PPC_GOT16_HA + +#define R_PPC64_COPY R_PPC_COPY +#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT +#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT +#define R_PPC64_RELATIVE R_PPC_RELATIVE + +#define R_PPC64_UADDR32 R_PPC_UADDR32 +#define R_PPC64_UADDR16 R_PPC_UADDR16 +#define R_PPC64_REL32 R_PPC_REL32 +#define R_PPC64_PLT32 R_PPC_PLT32 +#define R_PPC64_PLTREL32 R_PPC_PLTREL32 +#define R_PPC64_PLT16_LO R_PPC_PLT16_LO +#define R_PPC64_PLT16_HI R_PPC_PLT16_HI +#define R_PPC64_PLT16_HA R_PPC_PLT16_HA + +#define R_PPC64_SECTOFF R_PPC_SECTOFF +#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO +#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI +#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA +#define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2. */ +#define R_PPC64_ADDR64 38 /* doubleword64 S + A. */ +#define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A). */ +#define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A). */ +#define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A). */ +#define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A). */ +#define R_PPC64_UADDR64 43 /* doubleword64 S + A. */ +#define R_PPC64_REL64 44 /* doubleword64 S + A - P. */ +#define R_PPC64_PLT64 45 /* doubleword64 L + A. */ +#define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P. */ +#define R_PPC64_TOC16 47 /* half16* S + A - .TOC. */ +#define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.). */ +#define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.). */ +#define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.). */ +#define R_PPC64_TOC 51 /* doubleword64 .TOC. */ +#define R_PPC64_PLTGOT16 52 /* half16* M + A. */ +#define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A). */ +#define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A). */ +#define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A). */ + +#define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2. */ +#define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2. */ +#define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2. */ +#define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2. */ +#define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2. */ +#define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2. */ +#define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2. */ +#define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2. */ +#define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2. */ +#define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2. */ +#define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2. */ +/* Keep this the last entry. */ +#define R_PPC64_NUM 67 + /* The remaining relocs are from the Embedded ELF ABI, and are not in the SVR4 ELF ABI. */ #define R_PPC_EMB_NADDR32 101 @@ -1819,6 +1981,9 @@ typedef Elf32_Addr Elf32_Conflict; that may still be in object files. */ #define R_PPC_TOC16 255 +/* PowerPC64 specific values for the Dyn d_tag field. */ +#define DT_PPC64_GLINK (DT_LOPROC + 0) +#define DT_PPC64_NUM 1 /* ARM specific declarations */ @@ -2036,6 +2201,19 @@ typedef Elf32_Addr Elf32_Conflict; #define R_SH_SWITCH8 33 #define R_SH_GNU_VTINHERIT 34 #define R_SH_GNU_VTENTRY 35 +#define R_SH_TLS_GD_32 144 +#define R_SH_TLS_LD_32 145 +#define R_SH_TLS_LDO_32 146 +#define R_SH_TLS_IE_32 147 +#define R_SH_TLS_LE_32 148 +#define R_SH_TLS_DTPMOD32 149 +#define R_SH_TLS_DTPOFF32 150 +#define R_SH_TLS_TPOFF32 151 +#define R_SH_TLS_GD_MOV 152 +#define R_SH_TLS_LDM_MOV 153 +#define R_SH_TLS_LDO_MOV 154 +#define R_SH_TLS_IE_MOV 155 +#define R_SH_TLS_LE_MOV 156 #define R_SH_GOT32 160 #define R_SH_PLT32 161 #define R_SH_COPY 162 @@ -2114,7 +2292,7 @@ typedef Elf32_Addr Elf32_Conflict; #define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ #define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ #define R_X86_64_RELATIVE 8 /* Adjust by program base */ -#define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative +#define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative offset to GOT */ #define R_X86_64_32 10 /* Direct 32 bit zero extended */ #define R_X86_64_32S 11 /* Direct 32 bit sign extended */ @@ -2122,8 +2300,19 @@ typedef Elf32_Addr Elf32_Conflict; #define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ #define R_X86_64_8 14 /* Direct 8 bit sign extended */ #define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ +#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ +#define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */ +#define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */ +#define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset + to two GOT entries for GD symbol */ +#define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset + to two GOT entries for LD symbol */ +#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ +#define r_x86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset + to GOT entry for IE symbol */ +#define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */ -#define R_X86_64_NUM 16 +#define R_X86_64_NUM 24 __END_DECLS diff -durpN glibc-2.2.5/elf/Makefile glibc-2.3/elf/Makefile --- glibc-2.2.5/elf/Makefile 2002-01-08 13:38:17.000000000 -0800 +++ glibc-2.3/elf/Makefile 2002-10-02 00:28:04.000000000 -0700 @@ -29,15 +29,16 @@ routines = $(dl-routines) dl-open dl-clo # profiled libraries. dl-routines = $(addprefix dl-,load cache lookup object reloc deps \ runtime error init fini debug misc \ - version profile) + version profile conflict tls origin) all-dl-routines = $(dl-routines) $(sysdep-dl-routines) # But they are absent from the shared libc, because that code is in ld.so. elide-routines.os = $(all-dl-routines) dl-support enbl-secure \ - dl-iteratephdr-static + dl-iteratephdr-static dl-origin # ld.so uses those routines, plus some special stuff for being the program # interpreter and operating independent of libc. -rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal +rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal \ + dl-xstat64 dl-fxstat64 all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines) distribute := $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \ @@ -64,9 +65,13 @@ distribute := $(rtld-routines:=.c) dynam testobj.h vismod.h globalmod1.c \ dblloadmod1.c dblloadmod2.c dblloadmod3.c \ reldep6mod4.c reldep6mod3.c reldep6mod2.c reldep6mod1.c \ - reldep6mod0.c \ + reldep6mod0.c reldep7mod1.c reldep7mod2.c \ unwind-dw2.c unwind-dw2-fde.c unwind.h unwind-pe.h \ - unwind-dw2-fde.h dwarf2.h + unwind-dw2-fde.h dwarf2.h dl-procinfo.c tls.h dl-tls.h \ + tst-tlsmod1.c tst-tlsmod2.c tst-tlsmod3.c tst-tlsmod4.c \ + circlemod1.c circlemod1a.c circlemod2.c circlemod2a.c \ + circlemod3.c circlemod3a.c nodlopenmod2.c \ + tls-macros.h include ../Makeconfig @@ -110,17 +115,23 @@ vpath %.c ../locale/programs endif endif +tests = tst-tls1 tst-tls2 +ifeq (yes,$(build-static)) +tests-static = tst-tls1-static tst-tls2-static +tests += $(tests-static) +endif ifeq (yes,$(build-shared)) -tests = loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ - constload1 order $(tests-vis-$(have-protected)) noload filter unload \ - reldep reldep2 reldep3 reldep4 $(tests-nodelete-$(have-z-nodelete)) \ - $(tests-nodlopen-$(have-z-nodlopen)) neededtest neededtest2 \ - neededtest3 neededtest4 unload2 lateglobal initfirst global \ - restest2 next dblload dblunload reldep5 reldep6 +tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ + constload1 order $(tests-vis-$(have-protected)) noload filter unload \ + reldep reldep2 reldep3 reldep4 $(tests-nodelete-$(have-z-nodelete)) \ + $(tests-nodlopen-$(have-z-nodlopen)) neededtest neededtest2 \ + neededtest3 neededtest4 unload2 lateglobal initfirst global \ + restest2 next dblload dblunload reldep5 reldep6 reldep7 circleload1 \ + tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 test-srcs = tst-pathopt tests-vis-yes = vismain tests-nodelete-yes = nodelete -tests-nodlopen-yes = nodlopen +tests-nodlopen-yes = nodlopen nodlopen2 endif modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ testobj1_1 failobj constload2 constload3 unloadmod \ @@ -133,11 +144,17 @@ modules-names = testobj1 testobj2 testob neededobj5 neededobj6 firstobj globalmod1 \ unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \ dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \ - reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 + reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \ + reldep7mod1 reldep7mod2 \ + tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \ + circlemod1 circlemod1a circlemod2 circlemod2a \ + circlemod3 circlemod3a modules-vis-yes = vismod1 vismod2 vismod3 modules-nodelete-yes = nodelmod1 nodelmod2 nodelmod3 nodelmod4 -modules-nodlopen-yes = nodlopenmod +modules-nodlopen-yes = nodlopenmod nodlopenmod2 extra-objs += $(addsuffix .os,$(strip $(modules-names))) +# We need this variable to be sure the test modules get the right CPPFLAGS. +test-extras += $(modules-names) include ../Rules @@ -158,33 +175,21 @@ $(objpfx)dl-allobjs.os: $(all-rtld-routi $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a $(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)' -# Do we need a linker script? -rtld-ldscript-in := $(firstword $(wildcard $(+sysdep_dirs:%=%/rtld-ldscript.in))) - -ifneq (,$(rtld-ldscript-in)) -rtld-ldscript = $(objpfx)rtld-ldscript -generated += rtld-ldscript - -LDFLAGS-rtld = -T $(rtld-ldscript) -before-compile += $(rtld-ldscript) - -rtld-parms = $(wildcard $(+sysdep_dirs:%=%/rtld-parms)) -include $(rtld-parms) - -$(rtld-ldscript): $(rtld-ldscript-in) $(rtld-parms) - sed -e 's#@@rtld-oformat@@#$(rtld-oformat)#' \ - -e 's#@@rtld-arch@@#$(rtld-arch)#' \ - -e 's#@@rtld-entry@@#$(rtld-entry)#' \ - -e 's#@@rtld-base@@#$(rtld-base)#' $< >$@ -endif - -$(objpfx)ld.so: $(objpfx)librtld.os $(rtld-ldscript) $(ld-map) - $(LINK.o) -nostdlib -nostartfiles -shared -o $@ $(LDFLAGS-rtld) \ - $(filter-out $(rtld-ldscript) $(map-file),$^) \ - $(load-map-file) -Wl,-soname=$(rtld-installed-name) +$(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) + @rm -f $@.lds + $(LINK.o) -nostdlib -nostartfiles -shared \ + $(LDFLAGS-rtld) -Wl,--verbose 2>&1 | \ + sed -e '/^=========/,/^=========/!d;/^=========/d' \ + -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \ + > $@.lds + $(LINK.o) -nostdlib -nostartfiles -shared -o $@ $(LDFLAGS-rtld) \ + $(filter-out $(map-file),$^) $(load-map-file) \ + -Wl,-soname=$(rtld-installed-name) -T $@.lds + rm -f $@.lds # interp.c exists just to get this string into the libraries. CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' +$(objpfx)interp.os: $(common-objpfx)config.make ifneq (ld.so,$(rtld-installed-name)) # Make sure ld.so.1 exists in the build directory so we can link @@ -260,6 +265,8 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D' CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) CFLAGS-cache.c = $(SYSCONF-FLAGS) +CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc -DIS_IN_rtld) + test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) generated += $(addsuffix .so,$(strip $(modules-names))) @@ -302,6 +309,7 @@ $(objpfx)reldep6mod1.so: $(objpfx)reldep $(objpfx)reldep6mod2.so: $(objpfx)reldep6mod1.so $(objpfx)reldep6mod3.so: $(objpfx)reldep6mod2.so $(objpfx)reldep6mod4.so: $(objpfx)reldep6mod1.so +$(objpfx)tst-tlsmod3.so: $(objpfx)tst-tlsmod2.so # filtmod1.so has a special rule $(filter-out $(objpfx)filtmod1.so, $(test-modules)): $(objpfx)%.so: $(objpfx)%.os @@ -367,6 +375,15 @@ endif $(objpfx)constload1: $(libdl) $(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so +$(objpfx)circleload1: $(libdl) +$(objpfx)circleload1.out: $(objpfx)circlemod1.so \ + $(objpfx)circlemod1a.so + +$(objpfx)circlemod1.so: $(objpfx)circlemod2.so +$(objpfx)circlemod2.so: $(objpfx)circlemod3.so +$(objpfx)circlemod1a.so: $(objpfx)circlemod2a.so +$(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so + $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so) $(objpfx)order.out: $(objpfx)order @@ -394,6 +411,10 @@ LDFLAGS-nodlopenmod.so = -Wl,--enable-ne $(objpfx)nodlopen: $(libdl) $(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so +$(objpfx)nodlopenmod2.so: $(objpfx)nodlopenmod.so +$(objpfx)nodlopen2: $(libdl) +$(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so + $(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \ -L$(subst :, -L,$(rpath-link)) \ @@ -446,3 +467,23 @@ $(objpfx)reldep5.out: $(objpfx)reldepmod $(objpfx)reldep6: $(libdl) $(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so + +$(objpfx)reldep7: $(libdl) +$(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so + +$(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so + +$(objpfx)tst-tls4: $(libdl) +$(objpfx)tst-tls4.out: $(objpfx)tst-tlsmod2.so + +$(objpfx)tst-tls5: $(libdl) +$(objpfx)tst-tls5.out: $(objpfx)tst-tlsmod2.so + +$(objpfx)tst-tls6: $(libdl) +$(objpfx)tst-tls6.out: $(objpfx)tst-tlsmod2.so + +$(objpfx)tst-tls7: $(libdl) +$(objpfx)tst-tls7.out: $(objpfx)tst-tlsmod3.so + +$(objpfx)tst-tls8: $(libdl) +$(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so diff -durpN glibc-2.2.5/elf/nodlopen2.c glibc-2.3/elf/nodlopen2.c --- glibc-2.2.5/elf/nodlopen2.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/nodlopen2.c 2002-02-10 11:24:49.000000000 -0800 @@ -0,0 +1,15 @@ +#include +#include + +int +main (void) +{ + if (dlopen ("nodlopenmod2.so", RTLD_LAZY) != NULL) + { + puts ("opening \"nodlopenmod2.so\" succeeded, FAIL"); + return 1; + } + + puts ("opening \"nodlopenmod2.so\" failed, OK"); + return 0; +} diff -durpN glibc-2.2.5/elf/nodlopenmod2.c glibc-2.3/elf/nodlopenmod2.c --- glibc-2.2.5/elf/nodlopenmod2.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/nodlopenmod2.c 2002-03-11 13:06:25.000000000 -0800 @@ -0,0 +1,9 @@ +extern int a; + +extern int foo (void); + +int +foo (void) +{ + return a; +} diff -durpN glibc-2.2.5/elf/readlib.c glibc-2.3/elf/readlib.c --- glibc-2.2.5/elf/readlib.c 2001-07-05 21:54:46.000000000 -0700 +++ glibc-2.3/elf/readlib.c 2002-09-05 11:56:48.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1999 and Jakub Jelinek , 1999. @@ -103,8 +103,8 @@ process_file (const char *real_file_name /* Check that the file is large enough so that we can access the information. We're only checking the size of the headers here. */ - if (statbuf.st_size < sizeof (struct exec) - || statbuf.st_size < sizeof (ElfW(Ehdr))) + if ((size_t) statbuf.st_size < sizeof (struct exec) + || (size_t) statbuf.st_size < sizeof (ElfW(Ehdr))) { error (0, 0, _("File %s is too small, not checked."), file_name); fclose (file); @@ -123,7 +123,10 @@ process_file (const char *real_file_name /* First check if this is an aout file. */ aout_header = (struct exec *) file_contents; if (N_MAGIC (*aout_header) == ZMAGIC - || N_MAGIC (*aout_header) == QMAGIC) +#ifdef QMAGIC /* Linuxism. */ + || N_MAGIC (*aout_header) == QMAGIC +#endif + ) { /* Aout files don't have a soname, just return the name including the major number. */ diff -durpN glibc-2.2.5/elf/reldep7.c glibc-2.3/elf/reldep7.c --- glibc-2.2.5/elf/reldep7.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/reldep7.c 2002-04-15 10:03:17.000000000 -0700 @@ -0,0 +1,58 @@ +#include +#include +#include + +int +main (void) +{ + void *h1; + void *h2; + void *mod1_bar, *mod2_bar; + + h1 = dlopen ("reldep7mod1.so", RTLD_GLOBAL | RTLD_LAZY); + if (h1 == NULL) + { + printf ("cannot open reldep7mod1.so: %s\n", dlerror ()); + exit (1); + } + + h2 = dlopen ("reldep7mod2.so", RTLD_GLOBAL | RTLD_LAZY); + if (h2 == NULL) + { + printf ("cannot open reldep7mod1.so: %s\n", dlerror ()); + exit (1); + } + + mod1_bar = dlsym (h1, "mod1_bar"); + if (mod1_bar == NULL) + { + printf ("cannot get address of \"mod1_bar\": %s\n", dlerror ()); + exit (1); + } + + mod2_bar = dlsym (h2, "mod2_bar"); + if (mod2_bar == NULL) + { + printf ("cannot get address of \"mod2_bar\": %s\n", dlerror ()); + exit (1); + } + + printf ("%d\n", ((int (*) (void)) mod1_bar) ()); + printf ("%d\n", ((int (*) (void)) mod2_bar) ()); + + if (dlclose (h1) != 0) + { + printf ("closing h1 failed: %s\n", dlerror ()); + exit (1); + } + + printf ("%d\n", ((int (*) (void)) mod2_bar) ()); + + if (dlclose (h2) != 0) + { + printf ("closing h2 failed: %s\n", dlerror ()); + exit (1); + } + + return 0; +} diff -durpN glibc-2.2.5/elf/reldep7mod1.c glibc-2.3/elf/reldep7mod1.c --- glibc-2.2.5/elf/reldep7mod1.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/reldep7mod1.c 2002-04-15 10:03:46.000000000 -0700 @@ -0,0 +1,12 @@ +int foo (void) __attribute__ ((weak)); +int +foo (void) +{ + return 1; +} + +int +mod1_bar (void) +{ + return foo (); +} diff -durpN glibc-2.2.5/elf/reldep7mod2.c glibc-2.3/elf/reldep7mod2.c --- glibc-2.2.5/elf/reldep7mod2.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/reldep7mod2.c 2002-04-15 10:04:02.000000000 -0700 @@ -0,0 +1,12 @@ +int foo (void) __attribute__ ((weak)); +int +foo (void) +{ + return 2; +} + +int +mod2_bar (void) +{ + return foo (); +} diff -durpN glibc-2.2.5/elf/reldepmod5.c glibc-2.3/elf/reldepmod5.c --- glibc-2.2.5/elf/reldepmod5.c 2001-09-08 09:25:56.000000000 -0700 +++ glibc-2.3/elf/reldepmod5.c 2001-12-24 01:09:23.000000000 -0800 @@ -1,3 +1,5 @@ +extern int foo (void); + int foo (void) { diff -durpN glibc-2.2.5/elf/reldepmod6.c glibc-2.3/elf/reldepmod6.c --- glibc-2.2.5/elf/reldepmod6.c 2001-09-08 09:25:56.000000000 -0700 +++ glibc-2.3/elf/reldepmod6.c 2001-12-24 01:09:24.000000000 -0800 @@ -1,4 +1,5 @@ extern int call_me (void); +extern int bar (void); int bar (void) diff -durpN glibc-2.2.5/elf/rtld.c glibc-2.3/elf/rtld.c --- glibc-2.2.5/elf/rtld.c 2001-11-07 15:58:50.000000000 -0800 +++ glibc-2.3/elf/rtld.c 2002-09-29 10:45:45.000000000 -0700 @@ -1,5 +1,5 @@ /* Run time dynamic linker. - Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,7 +17,9 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include +#include #include #include #include @@ -33,9 +35,18 @@ #include "dynamic-link.h" #include "dl-librecon.h" #include +#include +#include #include +/* Avoid PLT use for our local calls at startup. */ +extern __typeof (__mempcpy) __mempcpy attribute_hidden; + +/* GCC has mental blocks about _exit. */ +extern __typeof (_exit) exit_internal asm ("_exit") attribute_hidden; +#define _exit exit_internal + /* Helper function to handle errors while resolving symbols. */ static void print_unresolved (int errcode, const char *objname, const char *errsting); @@ -55,53 +66,12 @@ enum mode { normal, list, verify, trace all the entries. */ static void process_envvars (enum mode *modep); -int _dl_argc; -char **_dl_argv; -unsigned int _dl_skip_args; /* Nonzero if we were run directly. */ -int _dl_verbose; -const char *_dl_platform; -size_t _dl_platformlen; -unsigned long _dl_hwcap; -fpu_control_t _dl_fpu_control = _FPU_DEFAULT; -struct r_search_path *_dl_search_paths; -const char *_dl_profile; -const char *_dl_profile_output; -struct link_map *_dl_profile_map; -int _dl_lazy = 1; -/* XXX I know about at least one case where we depend on the old weak - behavior (it has to do with librt). Until we get DSO groups implemented - we have to make this the default. Bummer. --drepper */ -#if 0 -int _dl_dynamic_weak; -#else -int _dl_dynamic_weak = 1; -#endif -int _dl_debug_mask; -const char *_dl_inhibit_rpath; /* RPATH values which should be - ignored. */ -const char *_dl_origin_path; -int _dl_bind_not; - -/* This is a pointer to the map for the main object and through it to - all loaded objects. */ -struct link_map *_dl_loaded; -/* Number of object in the _dl_loaded list. */ -unsigned int _dl_nloaded; -/* Pointer to the l_searchlist element of the link map of the main object. */ -struct r_scope_elem *_dl_main_searchlist; -/* Copy of the content of `_dl_main_searchlist'. */ -struct r_scope_elem _dl_initial_searchlist; -/* Array which is used when looking up in the global scope. */ -struct r_scope_elem *_dl_global_scope[2]; - -/* During the program run we must not modify the global data of - loaded shared object simultanously in two threads. Therefore we - protect `_dl_open' and `_dl_close' in dl-close.c. +int _dl_argc attribute_hidden; +char **_dl_argv = NULL; +INTDEF(_dl_argv) - This must be a recursive lock since the initializer function of - the loaded object might as well require a call to this function. - At this time it is not anymore a problem to modify the tables. */ -__libc_lock_define_initialized_recursive (, _dl_load_lock) +/* Nonzero if we were run directly. */ +unsigned int _dl_skip_args attribute_hidden; /* Set nonzero during loading and initialization of executable and libraries, cleared before the executable's entry point runs. This @@ -110,16 +80,38 @@ __libc_lock_define_initialized_recursive definition seen by libc.so's initializer; that value must be zero, and will be since that dynamic linker's _dl_start and dl_main will never be called. */ -int _dl_starting_up; +int _dl_starting_up = 0; +INTVARDEF(_dl_starting_up) +/* This is the structure which defines all variables global to ld.so + (except those which cannot be added for some reason). */ +struct rtld_global _rtld_global = + { + /* Get architecture specific initializer. */ +#include + ._dl_debug_fd = STDERR_FILENO, +#if 1 + /* XXX I know about at least one case where we depend on the old + weak behavior (it has to do with librt). Until we get DSO + groups implemented we have to make this the default. + Bummer. --drepper */ + ._dl_dynamic_weak = 1, +#endif + ._dl_lazy = 1, + ._dl_fpu_control = _FPU_DEFAULT, + ._dl_correct_cache_id = _DL_CACHE_DEFAULT_ID, + ._dl_hwcap_mask = HWCAP_IMPORTANT, +#ifdef _LIBC_REENTRANT + ._dl_load_lock = _LIBC_LOCK_RECURSIVE_INITIALIZER +#endif + }; +strong_alias (_rtld_global, _rtld_local); -static void dl_main (const ElfW(Phdr) *phdr, - ElfW(Word) phnum, +static void dl_main (const ElfW(Phdr) *phdr, ElfW(Word) phnum, ElfW(Addr) *user_entry); -struct link_map _dl_rtld_map; -struct libname_list _dl_rtld_libname; -struct libname_list _dl_rtld_libname2; +static struct libname_list _dl_rtld_libname; +static struct libname_list _dl_rtld_libname2; /* We expect less than a second for relocation. */ #ifdef HP_SMALL_TIMING_AVAIL @@ -132,12 +124,43 @@ struct libname_list _dl_rtld_libname2; static hp_timing_t rtld_total_time; static hp_timing_t relocate_time; static hp_timing_t load_time; +static hp_timing_t start_time; #endif -extern unsigned long int _dl_num_relocations; /* in dl-lookup.c */ -extern unsigned long int _dl_num_cache_relocations; /* in dl-reloc.c */ -static ElfW(Addr) _dl_start_final (void *arg, struct link_map *bootstrap_map_p, - hp_timing_t start_time); +/* Additional definitions needed by TLS initialization. */ +#ifdef TLS_INIT_HELPER +TLS_INIT_HELPER +#endif + +/* Before ld.so is relocated we must not access variables which need + relocations. This means variables which are exported. Variables + declared as static are fine. If we can mark a variable hidden this + is fine, too. The latter is impotant here. We can avoid setting + up a temporary link map for ld.so if we can mark _rtld_global as + hidden. */ +#if defined PI_STATIC_AND_HIDDEN && defined HAVE_HIDDEN \ + && defined HAVE_VISIBILITY_ATTRIBUTE +# define DONT_USE_BOOTSTRAP_MAP 1 +#endif + +#ifdef DONT_USE_BOOTSTRAP_MAP +static ElfW(Addr) _dl_start_final (void *arg); +#else +struct dl_start_final_info +{ + struct link_map l; +#if !defined HP_TIMING_NONAVAIL && HP_TIMING_INLINE + hp_timing_t start_time; +#endif +}; +static ElfW(Addr) _dl_start_final (void *arg, + struct dl_start_final_info *info); +#endif + +/* These defined magically in the linker script. */ +extern char _begin[] attribute_hidden; +extern char _end[] attribute_hidden; + #ifdef RTLD_START RTLD_START @@ -145,12 +168,122 @@ RTLD_START # error "sysdeps/MACHINE/dl-machine.h fails to define RTLD_START" #endif -static ElfW(Addr) __attribute_used__ +#ifndef VALIDX +# define VALIDX(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \ + + DT_EXTRANUM + DT_VALTAGIDX (tag)) +#endif +#ifndef ADDRIDX +# define ADDRIDX(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \ + + DT_EXTRANUM + DT_VALNUM + DT_ADDRTAGIDX (tag)) +#endif + +/* This is the second half of _dl_start (below). It can be inlined safely + under DONT_USE_BOOTSTRAP_MAP, where it is careful not to make any GOT + references. When the tools don't permit us to avoid using a GOT entry + for _dl_rtld_global (no attribute_hidden support), we must make sure + this function is not inlined (see below). */ + +#ifdef DONT_USE_BOOTSTRAP_MAP +static inline ElfW(Addr) __attribute__ ((always_inline)) +_dl_start_final (void *arg) +#else +static ElfW(Addr) __attribute__ ((noinline)) +_dl_start_final (void *arg, struct dl_start_final_info *info) +#endif +{ + ElfW(Addr) start_addr; + + if (HP_TIMING_AVAIL) + { + /* If it hasn't happen yet record the startup time. */ + if (! HP_TIMING_INLINE) + HP_TIMING_NOW (start_time); +#if !defined DONT_USE_BOOTSTRAP_MAP && !defined HP_TIMING_NONAVAIL + else + start_time = info->start_time; +#endif + + /* Initialize the timing functions. */ + HP_TIMING_DIFF_INIT (); + } + + /* Transfer data about ourselves to the permanent link_map structure. */ +#ifndef DONT_USE_BOOTSTRAP_MAP + GL(dl_rtld_map).l_addr = info->l.l_addr; + GL(dl_rtld_map).l_ld = info->l.l_ld; + memcpy (GL(dl_rtld_map).l_info, info->l.l_info, + sizeof GL(dl_rtld_map).l_info); + GL(dl_rtld_map).l_mach = info->l.l_mach; +#endif + _dl_setup_hash (&GL(dl_rtld_map)); + GL(dl_rtld_map).l_opencount = 1; + GL(dl_rtld_map).l_map_start = (ElfW(Addr)) _begin; + GL(dl_rtld_map).l_map_end = (ElfW(Addr)) _end; + /* Copy the TLS related data if necessary. */ +#if USE_TLS && !defined DONT_USE_BOOTSTRAP_MAP +# ifdef HAVE___THREAD + assert (info->l.l_tls_modid != 0); +# else + if (info->l.l_tls_modid != 0) +# endif + { + GL(dl_rtld_map).l_tls_blocksize = info->l.l_tls_blocksize; + GL(dl_rtld_map).l_tls_align = info->l.l_tls_align; + GL(dl_rtld_map).l_tls_initimage_size = info->l.l_tls_initimage_size; + GL(dl_rtld_map).l_tls_initimage = info->l.l_tls_initimage; + GL(dl_rtld_map).l_tls_offset = info->l.l_tls_offset; + GL(dl_rtld_map).l_tls_modid = 1; + GL(dl_rtld_map).l_tls_tp_initialized + = info->l.l_tls_tp_initialized; + } +#endif + +#if HP_TIMING_AVAIL + HP_TIMING_NOW (GL(dl_cpuclock_offset)); +#endif + + /* Call the OS-dependent function to set up life so we can do things like + file access. It will call `dl_main' (below) to do all the real work + of the dynamic linker, and then unwind our frame and run the user + entry point on the same stack we entered on. */ + start_addr = _dl_sysdep_start (arg, &dl_main); + +#ifndef HP_TIMING_NONAVAIL + if (HP_TIMING_AVAIL) + { + hp_timing_t end_time; + + /* Get the current time. */ + HP_TIMING_NOW (end_time); + + /* Compute the difference. */ + HP_TIMING_DIFF (rtld_total_time, start_time, end_time); + } +#endif + + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_STATISTICS, 0)) + print_statistics (); + + return start_addr; +} + +static ElfW(Addr) __attribute_used__ internal_function _dl_start (void *arg) { - struct link_map bootstrap_map; - hp_timing_t start_time; +#ifdef DONT_USE_BOOTSTRAP_MAP +# define bootstrap_map GL(dl_rtld_map) +#else + struct dl_start_final_info info; +# define bootstrap_map info.l +#endif +#if USE_TLS || (!DONT_USE_BOOTSTRAP_MAP && !HAVE_BUILTIN_MEMSET) size_t cnt; +#endif +#ifdef USE_TLS + ElfW(Ehdr) *ehdr; + ElfW(Phdr) *phdr; + dtv_t initdtv[3]; +#endif /* This #define produces dynamic linking inline functions for bootstrap relocation instead of general-purpose relocation. */ @@ -162,15 +295,28 @@ _dl_start (void *arg) #include "dynamic-link.h" if (HP_TIMING_INLINE && HP_TIMING_AVAIL) +#ifdef DONT_USE_BOOTSTRAP_MAP HP_TIMING_NOW (start_time); +#else + HP_TIMING_NOW (info.start_time); +#endif - /* Partly clean the `bootstrap_map' structure up. Don't use `memset' - since it might not be built in or inlined and we cannot make function - calls at this point. */ + /* Partly clean the `bootstrap_map' structure up. Don't use + `memset' since it might not be built in or inlined and we cannot + make function calls at this point. Use '__builtin_memset' if we + know it is available. We do not have to clear the memory if we + do not have to use the temporary bootstrap_map. Global variables + are initialized to zero by default. */ +#ifndef DONT_USE_BOOTSTRAP_MAP +# ifdef HAVE_BUILTIN_MEMSET + __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info)); +# else for (cnt = 0; cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]); ++cnt) bootstrap_map.l_info[cnt] = 0; +# endif +#endif /* Figure out the run-time load address of the dynamic linker itself. */ bootstrap_map.l_addr = elf_machine_load_address (); @@ -179,14 +325,132 @@ _dl_start (void *arg) bootstrap_map.l_ld = (void *) bootstrap_map.l_addr + elf_machine_dynamic (); elf_get_dynamic_info (&bootstrap_map); +#if USE_TLS +# if !defined HAVE___THREAD && !defined DONT_USE_BOOTSTRAP_MAP + /* Signal that we have not found TLS data so far. */ + bootstrap_map.l_tls_modid = 0; +# endif + + /* Get the dynamic linker's own program header. First we need the ELF + file header. The `_begin' symbol created by the linker script points + to it. When we have something like GOTOFF relocs, we can use a plain + reference to find the runtime address. Without that, we have to rely + on the `l_addr' value, which is not the value we want when prelinked. */ +#ifdef DONT_USE_BOOTSTRAP_MAP + ehdr = (ElfW(Ehdr) *) &_begin; +#else + ehdr = (ElfW(Ehdr) *) bootstrap_map.l_addr; +#endif + phdr = (ElfW(Phdr) *) ((ElfW(Addr)) ehdr + ehdr->e_phoff); + for (cnt = 0; cnt < ehdr->e_phnum; ++cnt) + if (phdr[cnt].p_type == PT_TLS) + { + void *tlsblock; + size_t max_align = MAX (TLS_INIT_TCB_ALIGN, phdr[cnt].p_align); + char *p; + + bootstrap_map.l_tls_blocksize = phdr[cnt].p_memsz; + bootstrap_map.l_tls_align = phdr[cnt].p_align; + assert (bootstrap_map.l_tls_blocksize != 0); + bootstrap_map.l_tls_initimage_size = phdr[cnt].p_filesz; + bootstrap_map.l_tls_initimage = (void *) (bootstrap_map.l_addr + + phdr[cnt].p_vaddr); + + /* We can now allocate the initial TLS block. This can happen + on the stack. We'll get the final memory later when we + know all about the various objects loaded at startup + time. */ +# if TLS_TCB_AT_TP + tlsblock = alloca (roundup (bootstrap_map.l_tls_blocksize, + TLS_INIT_TCB_ALIGN) + + TLS_INIT_TCB_SIZE + + max_align); +# elif TLS_DTV_AT_TP + tlsblock = alloca (roundup (TLS_INIT_TCB_SIZE, + bootstrap_map.l_tls_align) + + bootstrap_map.l_tls_blocksize + + max_align); +# else + /* In case a model with a different layout for the TCB and DTV + is defined add another #elif here and in the following #ifs. */ +# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" +# endif + /* Align the TLS block. */ + tlsblock = (void *) (((uintptr_t) tlsblock + max_align - 1) + & ~(max_align - 1)); + + /* Initialize the dtv. [0] is the length, [1] the generation + counter. */ + initdtv[0].counter = 1; + initdtv[1].counter = 0; + + /* Initialize the TLS block. */ +# if TLS_TCB_AT_TP + initdtv[2].pointer = tlsblock; +# elif TLS_DTV_AT_TP + bootstrap_map.l_tls_offset = roundup (TLS_INIT_TCB_SIZE, + bootstrap_map.l_tls_align); + initdtv[2].pointer = (char *) tlsblock + bootstrap_map.l_tls_offset; +# else +# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" +# endif + p = __mempcpy (initdtv[2].pointer, bootstrap_map.l_tls_initimage, + bootstrap_map.l_tls_initimage_size); +# ifdef HAVE_BUILTIN_MEMSET + __builtin_memset (p, '\0', (bootstrap_map.l_tls_blocksize + - bootstrap_map.l_tls_initimage_size)); +# else + { + size_t remaining = (bootstrap_map.l_tls_blocksize + - bootstrap_map.l_tls_initimage_size); + while (remaining-- > 0) + *p++ = '\0'; + } +#endif + + /* Install the pointer to the dtv. */ + + /* Initialize the thread pointer. */ +# if TLS_TCB_AT_TP + bootstrap_map.l_tls_offset + = roundup (bootstrap_map.l_tls_blocksize, TLS_INIT_TCB_ALIGN); + + INSTALL_DTV ((char *) tlsblock + bootstrap_map.l_tls_offset, + initdtv); + + if (TLS_INIT_TP ((char *) tlsblock + bootstrap_map.l_tls_offset, 0) + != 0) + _dl_fatal_printf ("cannot setup thread-local storage\n"); +# elif TLS_DTV_AT_TP + INSTALL_DTV (tlsblock, initdtv); + if (TLS_INIT_TP (tlsblock, 0) != 0) + _dl_fatal_printf ("cannot setup thread-local storage\n"); +# else +# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" +# endif + + /* So far this is module number one. */ + bootstrap_map.l_tls_modid = 1; + /* The TP got initialized. */ + bootstrap_map.l_tls_tp_initialized = 1; + + /* There can only be one PT_TLS entry. */ + break; + } +#endif /* use TLS */ + #ifdef ELF_MACHINE_BEFORE_RTLD_RELOC ELF_MACHINE_BEFORE_RTLD_RELOC (bootstrap_map.l_info); #endif - /* Relocate ourselves so we can do normal function calls and - data access using the global offset table. */ + if (bootstrap_map.l_addr || ! bootstrap_map.l_info[VALIDX(DT_GNU_PRELINKED)]) + { + /* Relocate ourselves so we can do normal function calls and + data access using the global offset table. */ + + ELF_DYNAMIC_RELOCATE (&bootstrap_map, 0, 0); + } - ELF_DYNAMIC_RELOCATE (&bootstrap_map, 0, 0); /* Please note that we don't allow profiling of this object and therefore need not test whether we have to allocate the array for the relocation results (as done in dl-reloc.c). */ @@ -198,73 +462,21 @@ _dl_start (void *arg) function, that way the compiler cannot put accesses to the GOT before ELF_DYNAMIC_RELOCATE. */ { - ElfW(Addr) entry = _dl_start_final (arg, &bootstrap_map, start_time); +#ifdef DONT_USE_BOOTSTRAP_MAP + ElfW(Addr) entry = _dl_start_final (arg); +#else + ElfW(Addr) entry = _dl_start_final (arg, &info); +#endif #ifndef ELF_MACHINE_START_ADDRESS # define ELF_MACHINE_START_ADDRESS(map, start) (start) #endif - return ELF_MACHINE_START_ADDRESS (_dl_loaded, entry); + return ELF_MACHINE_START_ADDRESS (GL(dl_loaded), entry); } } -static ElfW(Addr) -_dl_start_final (void *arg, struct link_map *bootstrap_map_p, - hp_timing_t start_time) -{ - /* The use of `alloca' here looks ridiculous but it helps. The goal - is to avoid the function from being inlined. There is no official - way to do this so we use this trick. gcc never inlines functions - which use `alloca'. */ - ElfW(Addr) *start_addr = alloca (sizeof (ElfW(Addr))); - - if (HP_TIMING_AVAIL) - { - /* If it hasn't happen yet record the startup time. */ - if (! HP_TIMING_INLINE) - HP_TIMING_NOW (start_time); - - /* Initialize the timing functions. */ - HP_TIMING_DIFF_INIT (); - } - - /* Transfer data about ourselves to the permanent link_map structure. */ - _dl_rtld_map.l_addr = bootstrap_map_p->l_addr; - _dl_rtld_map.l_ld = bootstrap_map_p->l_ld; - _dl_rtld_map.l_opencount = 1; - memcpy (_dl_rtld_map.l_info, bootstrap_map_p->l_info, - sizeof _dl_rtld_map.l_info); - _dl_setup_hash (&_dl_rtld_map); - _dl_rtld_map.l_mach = bootstrap_map_p->l_mach; - -/* Don't bother trying to work out how ld.so is mapped in memory. */ - _dl_rtld_map.l_map_start = ~0; - _dl_rtld_map.l_map_end = ~0; - - /* Call the OS-dependent function to set up life so we can do things like - file access. It will call `dl_main' (below) to do all the real work - of the dynamic linker, and then unwind our frame and run the user - entry point on the same stack we entered on. */ - *start_addr = _dl_sysdep_start (arg, &dl_main); -#ifndef HP_TIMING_NONAVAIL - if (HP_TIMING_AVAIL) - { - hp_timing_t end_time; - - /* Get the current time. */ - HP_TIMING_NOW (end_time); - - /* Compute the difference. */ - HP_TIMING_DIFF (rtld_total_time, start_time, end_time); - } -#endif - - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_STATISTICS, 0)) - print_statistics (); - - return *start_addr; -} /* Now life is peachy; we can do all normal operations. On to the real work. */ @@ -298,22 +510,21 @@ relocate_doit (void *a) { struct relocate_args *args = (struct relocate_args *) a; - _dl_relocate_object (args->l, args->l->l_scope, - args->lazy, 0); + INTUSE(_dl_relocate_object) (args->l, args->l->l_scope, args->lazy, 0); } static void map_doit (void *a) { struct map_args *args = (struct map_args *) a; - args->main_map = _dl_map_object (NULL, args->str, 0, lt_library, 0, 0); + args->main_map = INTUSE(_dl_map_object) (NULL, args->str, 0, lt_library, 0, 0); } static void version_check_doit (void *a) { struct version_check_args *args = (struct version_check_args *) a; - if (_dl_check_all_versions (_dl_loaded, 1, args->dotrace) && args->doexit) + if (_dl_check_all_versions (GL(dl_loaded), 1, args->dotrace) && args->doexit) /* We cannot start the application. Abort now. */ _exit (1); } @@ -322,11 +533,11 @@ version_check_doit (void *a) static inline struct link_map * find_needed (const char *name) { - unsigned int n = _dl_loaded->l_searchlist.r_nlist; + unsigned int n = GL(dl_loaded)->l_searchlist.r_nlist; while (n-- > 0) - if (_dl_name_match_p (name, _dl_loaded->l_searchlist.r_list[n])) - return _dl_loaded->l_searchlist.r_list[n]; + if (_dl_name_match_p (name, GL(dl_loaded)->l_searchlist.r_list[n])) + return GL(dl_loaded)->l_searchlist.r_list[n]; /* Should never happen. */ return NULL; @@ -381,20 +592,24 @@ dl_main (const ElfW(Phdr) *phdr, unsigned int npreloads; size_t file_size; char *file; - int has_interp = 0; + bool has_interp = false; unsigned int i; - int rtld_is_main = 0; + bool prelinked = false; + bool rtld_is_main = false; #ifndef HP_TIMING_NONAVAIL hp_timing_t start; hp_timing_t stop; hp_timing_t diff; #endif +#ifdef USE_TLS + void *tcbp; +#endif /* Process the environment variable which control the behaviour. */ process_envvars (&mode); /* Set up a flag which tells we are just starting. */ - _dl_starting_up = 1; + INTUSE(_dl_starting_up) = 1; if (*user_entry == (ElfW(Addr)) ENTRY_POINT) { @@ -413,44 +628,46 @@ dl_main (const ElfW(Phdr) *phdr, pay attention to its PT_INTERP command (we are the interpreter ourselves). This is an easy way to test a new ld.so before installing it. */ - rtld_is_main = 1; + rtld_is_main = true; /* Note the place where the dynamic linker actually came from. */ - _dl_rtld_map.l_name = _dl_argv[0]; + GL(dl_rtld_map).l_name = rtld_progname; while (_dl_argc > 1) - if (! strcmp (_dl_argv[1], "--list")) + if (! strcmp (INTUSE(_dl_argv)[1], "--list")) { mode = list; - _dl_lazy = -1; /* This means do no dependency analysis. */ + GL(dl_lazy) = -1; /* This means do no dependency analysis. */ ++_dl_skip_args; --_dl_argc; - ++_dl_argv; + ++INTUSE(_dl_argv); } - else if (! strcmp (_dl_argv[1], "--verify")) + else if (! strcmp (INTUSE(_dl_argv)[1], "--verify")) { mode = verify; ++_dl_skip_args; --_dl_argc; - ++_dl_argv; + ++INTUSE(_dl_argv); } - else if (! strcmp (_dl_argv[1], "--library-path") && _dl_argc > 2) + else if (! strcmp (INTUSE(_dl_argv)[1], "--library-path") + && _dl_argc > 2) { - library_path = _dl_argv[2]; + library_path = INTUSE(_dl_argv)[2]; _dl_skip_args += 2; _dl_argc -= 2; - _dl_argv += 2; + INTUSE(_dl_argv) += 2; } - else if (! strcmp (_dl_argv[1], "--inhibit-rpath") && _dl_argc > 2) + else if (! strcmp (INTUSE(_dl_argv)[1], "--inhibit-rpath") + && _dl_argc > 2) { - _dl_inhibit_rpath = _dl_argv[2]; + GL(dl_inhibit_rpath) = INTUSE(_dl_argv)[2]; _dl_skip_args += 2; _dl_argc -= 2; - _dl_argv += 2; + INTUSE(_dl_argv) += 2; } else break; @@ -482,7 +699,7 @@ of this helper program; chances are you ++_dl_skip_args; --_dl_argc; - ++_dl_argv; + ++INTUSE(_dl_argv); /* Initialize the data structures for the search paths for shared objects. */ @@ -494,43 +711,41 @@ of this helper program; chances are you const char *err_str = NULL; struct map_args args; - args.str = _dl_argv[0]; - (void) _dl_catch_error (&objname, &err_str, map_doit, &args); + args.str = rtld_progname; + (void) INTUSE(_dl_catch_error) (&objname, &err_str, map_doit, &args); if (__builtin_expect (err_str != NULL, 0)) - { - if (err_str != _dl_out_of_memory) - free ((char *) err_str); - _exit (EXIT_FAILURE); - } + /* We don't free the returned string, the programs stops + anyway. */ + _exit (EXIT_FAILURE); } else { HP_TIMING_NOW (start); - _dl_map_object (NULL, _dl_argv[0], 0, lt_library, 0, 0); + INTUSE(_dl_map_object) (NULL, rtld_progname, 0, lt_library, 0, 0); HP_TIMING_NOW (stop); HP_TIMING_DIFF (load_time, start, stop); } - phdr = _dl_loaded->l_phdr; - phnum = _dl_loaded->l_phnum; + phdr = GL(dl_loaded)->l_phdr; + phnum = GL(dl_loaded)->l_phnum; /* We overwrite here a pointer to a malloc()ed string. But since the malloc() implementation used at this point is the dummy implementations which has no real free() function it does not makes sense to free the old string first. */ - _dl_loaded->l_name = (char *) ""; - *user_entry = _dl_loaded->l_entry; + GL(dl_loaded)->l_name = (char *) ""; + *user_entry = GL(dl_loaded)->l_entry; } else { /* Create a link_map for the executable itself. This will be what dlopen on "" returns. */ _dl_new_object ((char *) "", "", lt_executable, NULL); - if (_dl_loaded == NULL) + if (GL(dl_loaded) == NULL) _dl_fatal_printf ("cannot allocate memory for link map\n"); - _dl_loaded->l_phdr = phdr; - _dl_loaded->l_phnum = phnum; - _dl_loaded->l_entry = *user_entry; + GL(dl_loaded)->l_phdr = phdr; + GL(dl_loaded)->l_phnum = phnum; + GL(dl_loaded)->l_entry = *user_entry; /* At this point we are in a bit of trouble. We would have to fill in the values for l_dev and l_ino. But in general we @@ -551,11 +766,11 @@ of this helper program; chances are you information for the program. */ } - _dl_loaded->l_map_end = 0; + GL(dl_loaded)->l_map_end = 0; /* Perhaps the executable has no PT_LOAD header entries at all. */ - _dl_loaded->l_map_start = ~0; + GL(dl_loaded)->l_map_start = ~0; /* We opened the file, account for it. */ - ++_dl_loaded->l_opencount; + ++GL(dl_loaded)->l_opencount; /* Scan the program header table for the dynamic section. */ for (ph = phdr; ph < &phdr[phnum]; ++ph) @@ -563,12 +778,12 @@ of this helper program; chances are you { case PT_PHDR: /* Find out the load address. */ - _dl_loaded->l_addr = (ElfW(Addr)) phdr - ph->p_vaddr; + GL(dl_loaded)->l_addr = (ElfW(Addr)) phdr - ph->p_vaddr; break; case PT_DYNAMIC: /* This tells us where to find the dynamic section, which tells us everything we need to do. */ - _dl_loaded->l_ld = (void *) _dl_loaded->l_addr + ph->p_vaddr; + GL(dl_loaded)->l_ld = (void *) GL(dl_loaded)->l_addr + ph->p_vaddr; break; case PT_INTERP: /* This "interpreter segment" was used by the program loader to @@ -577,28 +792,35 @@ of this helper program; chances are you dlopen call or DT_NEEDED entry, for something that wants to link against the dynamic linker as a shared library, will know that the shared object is already loaded. */ - _dl_rtld_libname.name = ((const char *) _dl_loaded->l_addr + _dl_rtld_libname.name = ((const char *) GL(dl_loaded)->l_addr + ph->p_vaddr); /* _dl_rtld_libname.next = NULL; Already zero. */ - _dl_rtld_map.l_libname = &_dl_rtld_libname; + GL(dl_rtld_map).l_libname = &_dl_rtld_libname; /* Ordinarilly, we would get additional names for the loader from our DT_SONAME. This can't happen if we were actually linked as a static executable (detect this case when we have no DYNAMIC). If so, assume the filename component of the interpreter path to be our SONAME, and add it to our name list. */ - if (_dl_rtld_map.l_ld == NULL) + if (GL(dl_rtld_map).l_ld == NULL) { - char *p = strrchr (_dl_rtld_libname.name, '/'); - if (p) + const char *p = NULL; + const char *cp = _dl_rtld_libname.name; + + /* Find the filename part of the path. */ + while (*cp != '\0') + if (*cp++ == '/') + p = cp; + + if (p != NULL) { - _dl_rtld_libname2.name = p+1; + _dl_rtld_libname2.name = p; /* _dl_rtld_libname2.next = NULL; Already zero. */ _dl_rtld_libname.next = &_dl_rtld_libname2; } } - has_interp = 1; + has_interp = true; break; case PT_LOAD: { @@ -606,37 +828,63 @@ of this helper program; chances are you ElfW(Addr) allocend; /* Remember where the main program starts in memory. */ - mapstart = _dl_loaded->l_addr + (ph->p_vaddr & ~(ph->p_align - 1)); - if (_dl_loaded->l_map_start > mapstart) - _dl_loaded->l_map_start = mapstart; + mapstart = (GL(dl_loaded)->l_addr + + (ph->p_vaddr & ~(ph->p_align - 1))); + if (GL(dl_loaded)->l_map_start > mapstart) + GL(dl_loaded)->l_map_start = mapstart; /* Also where it ends. */ - allocend = _dl_loaded->l_addr + ph->p_vaddr + ph->p_memsz; - if (_dl_loaded->l_map_end < allocend) - _dl_loaded->l_map_end = allocend; + allocend = GL(dl_loaded)->l_addr + ph->p_vaddr + ph->p_memsz; + if (GL(dl_loaded)->l_map_end < allocend) + GL(dl_loaded)->l_map_end = allocend; } break; +#ifdef USE_TLS + case PT_TLS: + if (ph->p_memsz > 0) + { + /* Note that in the case the dynamic linker we duplicate work + here since we read the PT_TLS entry already in + _dl_start_final. But the result is repeatable so do not + check for this special but unimportant case. */ + GL(dl_loaded)->l_tls_blocksize = ph->p_memsz; + GL(dl_loaded)->l_tls_align = ph->p_align; + GL(dl_loaded)->l_tls_initimage_size = ph->p_filesz; + GL(dl_loaded)->l_tls_initimage = (void *) ph->p_vaddr; + + /* This image gets the ID one. */ + GL(dl_tls_max_dtv_idx) = GL(dl_loaded)->l_tls_modid = 1; + } + break; +#endif } - if (! _dl_loaded->l_map_end) - _dl_loaded->l_map_end = ~0; - if (! _dl_rtld_map.l_libname && _dl_rtld_map.l_name) +#ifdef USE_TLS + /* Adjust the address of the TLS initialization image in case + the executable is actually an ET_DYN object. */ + if (GL(dl_loaded)->l_tls_initimage != NULL) + GL(dl_loaded)->l_tls_initimage + = (char *) GL(dl_loaded)->l_tls_initimage + GL(dl_loaded)->l_addr; +#endif + if (! GL(dl_loaded)->l_map_end) + GL(dl_loaded)->l_map_end = ~0; + if (! GL(dl_rtld_map).l_libname && GL(dl_rtld_map).l_name) { /* We were invoked directly, so the program might not have a PT_INTERP. */ - _dl_rtld_libname.name = _dl_rtld_map.l_name; - /* _dl_rtld_libname.next = NULL; Alread zero. */ - _dl_rtld_map.l_libname = &_dl_rtld_libname; + _dl_rtld_libname.name = GL(dl_rtld_map).l_name; + /* _dl_rtld_libname.next = NULL; Already zero. */ + GL(dl_rtld_map).l_libname = &_dl_rtld_libname; } else - assert (_dl_rtld_map.l_libname); /* How else did we get here? */ + assert (GL(dl_rtld_map).l_libname); /* How else did we get here? */ if (! rtld_is_main) { /* Extract the contents of the dynamic section for easy access. */ - elf_get_dynamic_info (_dl_loaded); - if (_dl_loaded->l_info[DT_HASH]) + elf_get_dynamic_info (GL(dl_loaded)); + if (GL(dl_loaded)->l_info[DT_HASH]) /* Set up our cache of pointers into the hash table. */ - _dl_setup_hash (_dl_loaded); + _dl_setup_hash (GL(dl_loaded)); } if (__builtin_expect (mode, normal) == verify) @@ -645,7 +893,7 @@ of this helper program; chances are you executable using us as the program interpreter. Exit with an error if we were not able to load the binary or no interpreter is specified (i.e., this is no dynamically linked binary. */ - if (_dl_loaded->l_ld == NULL) + if (GL(dl_loaded)->l_ld == NULL) _exit (1); /* We allow here some platform specific code. */ @@ -662,15 +910,15 @@ of this helper program; chances are you /* Put the link_map for ourselves on the chain so it can be found by name. Note that at this point the global chain of link maps contains - exactly one element, which is pointed to by _dl_loaded. */ - if (! _dl_rtld_map.l_name) + exactly one element, which is pointed to by dl_loaded. */ + if (! GL(dl_rtld_map).l_name) /* If not invoked directly, the dynamic linker shared object file was found by the PT_INTERP name. */ - _dl_rtld_map.l_name = (char *) _dl_rtld_map.l_libname->name; - _dl_rtld_map.l_type = lt_library; - _dl_loaded->l_next = &_dl_rtld_map; - _dl_rtld_map.l_prev = _dl_loaded; - ++_dl_nloaded; + GL(dl_rtld_map).l_name = (char *) GL(dl_rtld_map).l_libname->name; + GL(dl_rtld_map).l_type = lt_library; + GL(dl_loaded)->l_next = &GL(dl_rtld_map); + GL(dl_rtld_map).l_prev = GL(dl_loaded); + ++GL(dl_nloaded); /* We have two ways to specify objects to preload: via environment variable and via the file /etc/ld.so.preload. The latter can also @@ -690,13 +938,16 @@ of this helper program; chances are you HP_TIMING_NOW (start); - while ((p = strsep (&list, " :")) != NULL) + /* Prevent optimizing strsep. Speed is not important here. */ + while ((p = (strsep) (&list, " :")) != NULL) if (p[0] != '\0' - && (__builtin_expect (! __libc_enable_secure, 1) + && (__builtin_expect (! INTUSE(__libc_enable_secure), 1) || strchr (p, '/') == NULL)) { - struct link_map *new_map = _dl_map_object (_dl_loaded, p, 1, - lt_library, 0, 0); + struct link_map *new_map = INTUSE(_dl_map_object) (GL(dl_loaded), + p, 1, + lt_library, + 0, 0); if (++new_map->l_opencount == 1) /* It is no duplicate. */ ++npreloads; @@ -763,8 +1014,10 @@ of this helper program; chances are you while ((p = strsep (&runp, ": \t\n")) != NULL) if (p[0] != '\0') { - struct link_map *new_map = _dl_map_object (_dl_loaded, p, 1, - lt_library, 0, 0); + struct link_map *new_map = INTUSE(_dl_map_object) (GL(dl_loaded), + p, 1, + lt_library, + 0, 0); if (++new_map->l_opencount == 1) /* It is no duplicate. */ ++npreloads; @@ -774,8 +1027,9 @@ of this helper program; chances are you if (problem != NULL) { char *p = strndupa (problem, file_size - (problem - file)); - struct link_map *new_map = _dl_map_object (_dl_loaded, p, 1, - lt_library, 0, 0); + struct link_map *new_map = INTUSE(_dl_map_object) (GL(dl_loaded), p, + 1, lt_library, + 0, 0); if (++new_map->l_opencount == 1) /* It is no duplicate. */ ++npreloads; @@ -794,7 +1048,7 @@ of this helper program; chances are you /* Set up PRELOADS with a vector of the preloaded libraries. */ struct link_map *l; preloads = __alloca (npreloads * sizeof preloads[0]); - l = _dl_rtld_map.l_next; /* End of the chain before preloads. */ + l = GL(dl_rtld_map).l_next; /* End of the chain before preloads. */ i = 0; do { @@ -808,18 +1062,19 @@ of this helper program; chances are you specified some libraries to load, these are inserted before the actual dependencies in the executable's searchlist for symbol resolution. */ HP_TIMING_NOW (start); - _dl_map_object_deps (_dl_loaded, preloads, npreloads, mode == trace); + INTUSE(_dl_map_object_deps) (GL(dl_loaded), preloads, npreloads, + mode == trace, 0); HP_TIMING_NOW (stop); HP_TIMING_DIFF (diff, start, stop); HP_TIMING_ACCUM_NT (load_time, diff); /* Mark all objects as being in the global scope and set the open counter. */ - for (i = _dl_loaded->l_searchlist.r_nlist; i > 0; ) + for (i = GL(dl_loaded)->l_searchlist.r_nlist; i > 0; ) { --i; - _dl_loaded->l_searchlist.r_list[i]->l_global = 1; - ++_dl_loaded->l_searchlist.r_list[i]->l_opencount; + GL(dl_loaded)->l_searchlist.r_list[i]->l_global = 1; + ++GL(dl_loaded)->l_searchlist.r_list[i]->l_opencount; } #ifndef MAP_ANON @@ -829,38 +1084,38 @@ of this helper program; chances are you #endif /* Remove _dl_rtld_map from the chain. */ - _dl_rtld_map.l_prev->l_next = _dl_rtld_map.l_next; - if (_dl_rtld_map.l_next) - _dl_rtld_map.l_next->l_prev = _dl_rtld_map.l_prev; + GL(dl_rtld_map).l_prev->l_next = GL(dl_rtld_map).l_next; + if (GL(dl_rtld_map).l_next) + GL(dl_rtld_map).l_next->l_prev = GL(dl_rtld_map).l_prev; - if (__builtin_expect (_dl_rtld_map.l_opencount > 1, 1)) + if (__builtin_expect (GL(dl_rtld_map).l_opencount > 1, 1)) { /* Some DT_NEEDED entry referred to the interpreter object itself, so put it back in the list of visible objects. We insert it into the chain in symbol search order because gdb uses the chain's order as its symbol search order. */ i = 1; - while (_dl_loaded->l_searchlist.r_list[i] != &_dl_rtld_map) + while (GL(dl_loaded)->l_searchlist.r_list[i] != &GL(dl_rtld_map)) ++i; - _dl_rtld_map.l_prev = _dl_loaded->l_searchlist.r_list[i - 1]; + GL(dl_rtld_map).l_prev = GL(dl_loaded)->l_searchlist.r_list[i - 1]; if (__builtin_expect (mode, normal) == normal) - _dl_rtld_map.l_next = (i + 1 < _dl_loaded->l_searchlist.r_nlist - ? _dl_loaded->l_searchlist.r_list[i + 1] - : NULL); + GL(dl_rtld_map).l_next = (i + 1 < GL(dl_loaded)->l_searchlist.r_nlist + ? GL(dl_loaded)->l_searchlist.r_list[i + 1] + : NULL); else /* In trace mode there might be an invisible object (which we could not find) after the previous one in the search list. In this case it doesn't matter much where we put the interpreter object, so we just initialize the list pointer so that the assertion below holds. */ - _dl_rtld_map.l_next = _dl_rtld_map.l_prev->l_next; + GL(dl_rtld_map).l_next = GL(dl_rtld_map).l_prev->l_next; - assert (_dl_rtld_map.l_prev->l_next == _dl_rtld_map.l_next); - _dl_rtld_map.l_prev->l_next = &_dl_rtld_map; - if (_dl_rtld_map.l_next) + assert (GL(dl_rtld_map).l_prev->l_next == GL(dl_rtld_map).l_next); + GL(dl_rtld_map).l_prev->l_next = &GL(dl_rtld_map); + if (GL(dl_rtld_map).l_next != NULL) { - assert (_dl_rtld_map.l_next->l_prev == _dl_rtld_map.l_prev); - _dl_rtld_map.l_next->l_prev = &_dl_rtld_map; + assert (GL(dl_rtld_map).l_next->l_prev == GL(dl_rtld_map).l_prev); + GL(dl_rtld_map).l_next->l_prev = &GL(dl_rtld_map); } } @@ -873,62 +1128,171 @@ of this helper program; chances are you _dl_receive_error (print_missing_version, version_check_doit, &args); } +#ifdef USE_TLS + /* Now it is time to determine the layout of the static TLS block + and allocate it for the initial thread. Note that we always + allocate the static block, we never defer it even if no + DF_STATIC_TLS bit is set. The reason is that we know glibc will + use the static model. First add the dynamic linker to the list + if it also uses TLS. */ + if (GL(dl_rtld_map).l_tls_blocksize != 0) + /* Assign a module ID. */ + GL(dl_rtld_map).l_tls_modid = _dl_next_tls_modid (); + +# ifndef SHARED + /* If dynamic loading of modules with TLS is impossible we do not + have to initialize any of the TLS functionality unless any of the + initial modules uses TLS. */ + if (GL(dl_tls_max_dtv_idx) > 0) +# endif + { + struct link_map *l; + size_t nelem; + struct dtv_slotinfo *slotinfo; + + /* Number of elements in the static TLS block. */ + GL(dl_tls_static_nelem) = GL(dl_tls_max_dtv_idx); + + /* Allocate the array which contains the information about the + dtv slots. We allocate a few entries more than needed to + avoid the need for reallocation. */ + nelem = GL(dl_tls_max_dtv_idx) + 1 + TLS_SLOTINFO_SURPLUS; + + /* Allocate. */ + GL(dl_tls_dtv_slotinfo_list) = (struct dtv_slotinfo_list *) + malloc (sizeof (struct dtv_slotinfo_list) + + nelem * sizeof (struct dtv_slotinfo)); + /* No need to check the return value. If memory allocation failed + the program would have been terminated. */ + + slotinfo = memset (GL(dl_tls_dtv_slotinfo_list)->slotinfo, '\0', + nelem * sizeof (struct dtv_slotinfo)); + GL(dl_tls_dtv_slotinfo_list)->len = nelem; + GL(dl_tls_dtv_slotinfo_list)->next = NULL; + + /* Fill in the information from the loaded modules. */ + for (l = GL(dl_loaded), i = 0; l != NULL; l = l->l_next) + if (l->l_tls_blocksize != 0) + /* This is a module with TLS data. Store the map reference. + The generation counter is zero. */ + slotinfo[++i].map = l; + assert (i == GL(dl_tls_max_dtv_idx)); + + /* Compute the TLS offsets for the various blocks. We call this + function even if none of the modules available at startup time + uses TLS to initialize some variables. */ + _dl_determine_tlsoffset (); + + /* Construct the static TLS block and the dtv for the initial + thread. For some platforms this will include allocating memory + for the thread descriptor. The memory for the TLS block will + never be freed. It should be allocated accordingly. The dtv + array can be changed if dynamic loading requires it. */ + tcbp = _dl_allocate_tls_storage (); + if (tcbp == NULL) + _dl_fatal_printf ("\ +cannot allocate TLS data structures for initial thread"); + + /* Store for detection of the special case by __tls_get_addr + so it knows not to pass this dtv to the normal realloc. */ + GL(dl_initial_dtv) = GET_DTV (tcbp); + } +#endif + if (__builtin_expect (mode, normal) != normal) { /* We were run just to list the shared libraries. It is important that we do this before real relocation, because the functions we call below for output may no longer work properly after relocation. */ - if (! _dl_loaded->l_info[DT_NEEDED]) + if (! GL(dl_loaded)->l_info[DT_NEEDED]) _dl_printf ("\tstatically linked\n"); else { struct link_map *l; - for (l = _dl_loaded->l_next; l; l = l->l_next) - if (l->l_faked) - /* The library was not found. */ - _dl_printf ("\t%s => not found\n", l->l_libname->name); - else - _dl_printf ("\t%s => %s (0x%0*Zx)\n", l->l_libname->name, - l->l_name, (int) sizeof l->l_addr * 2, l->l_addr); + if (GL(dl_debug_mask) & DL_DEBUG_PRELINK) + { + struct r_scope_elem *scope = &GL(dl_loaded)->l_searchlist; + + for (i = 0; i < scope->r_nlist; i++) + { + l = scope->r_list [i]; + if (l->l_faked) + { + _dl_printf ("\t%s => not found\n", l->l_libname->name); + continue; + } + if (_dl_name_match_p (GL(dl_trace_prelink), l)) + GL(dl_trace_prelink_map) = l; + _dl_printf ("\t%s => %s (0x%0*Zx, 0x%0*Zx)", + l->l_libname->name[0] ? l->l_libname->name + : rtld_progname ?: "
", + l->l_name[0] ? l->l_name + : rtld_progname ?: "
", + (int) sizeof l->l_map_start * 2, + l->l_map_start, + (int) sizeof l->l_addr * 2, + l->l_addr); +#ifdef USE_TLS + if (l->l_tls_modid) + _dl_printf (" TLS(0x%Zx, 0x%0*Zx)\n", l->l_tls_modid, + (int) sizeof l->l_tls_offset * 2, + l->l_tls_offset); + else +#endif + _dl_printf ("\n"); + } + } + else + { + for (l = GL(dl_loaded)->l_next; l; l = l->l_next) + if (l->l_faked) + /* The library was not found. */ + _dl_printf ("\t%s => not found\n", l->l_libname->name); + else + _dl_printf ("\t%s => %s (0x%0*Zx)\n", l->l_libname->name, + l->l_name, (int) sizeof l->l_map_start * 2, + l->l_map_start); + } } if (__builtin_expect (mode, trace) != trace) - for (i = 1; i < _dl_argc; ++i) + for (i = 1; i < (unsigned int) _dl_argc; ++i) { const ElfW(Sym) *ref = NULL; ElfW(Addr) loadbase; lookup_t result; - result = _dl_lookup_symbol (_dl_argv[i], _dl_loaded, - &ref, _dl_loaded->l_scope, - ELF_RTYPE_CLASS_PLT, 1); + result = INTUSE(_dl_lookup_symbol) (INTUSE(_dl_argv)[i], + GL(dl_loaded), + &ref, GL(dl_loaded)->l_scope, + ELF_RTYPE_CLASS_PLT, 1); loadbase = LOOKUP_VALUE_ADDRESS (result); _dl_printf ("%s found at 0x%0*Zd in object at 0x%0*Zd\n", - _dl_argv[i], + INTUSE(_dl_argv)[i], (int) sizeof ref->st_value * 2, ref->st_value, (int) sizeof loadbase * 2, loadbase); } else { /* If LD_WARN is set warn about undefined symbols. */ - if (_dl_lazy >= 0 && _dl_verbose) + if (GL(dl_lazy) >= 0 && GL(dl_verbose)) { /* We have to do symbol dependency testing. */ struct relocate_args args; struct link_map *l; - args.lazy = _dl_lazy; + args.lazy = GL(dl_lazy); - l = _dl_loaded; + l = GL(dl_loaded); while (l->l_next) l = l->l_next; do { - if (l != &_dl_rtld_map && ! l->l_faked) + if (l != &GL(dl_rtld_map) && ! l->l_faked) { args.l = l; _dl_receive_error (print_unresolved, relocate_doit, @@ -936,6 +1300,11 @@ of this helper program; chances are you } l = l->l_prev; } while (l); + + if ((GL(dl_debug_mask) & DL_DEBUG_PRELINK) + && GL(dl_rtld_map).l_opencount > 1) + INTUSE(_dl_relocate_object) (&GL(dl_rtld_map), + GL(dl_loaded)->l_scope, 0, 0); } #define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED)) @@ -944,9 +1313,9 @@ of this helper program; chances are you /* Print more information. This means here, print information about the versions needed. */ int first = 1; - struct link_map *map = _dl_loaded; + struct link_map *map = GL(dl_loaded); - for (map = _dl_loaded; map != NULL; map = map->l_next) + for (map = GL(dl_loaded); map != NULL; map = map->l_next) { const char *strtab; ElfW(Dyn) *dyn = map->l_info[VERNEEDTAG]; @@ -965,7 +1334,7 @@ of this helper program; chances are you } _dl_printf ("\t%s:\n", - map->l_name[0] ? map->l_name : _dl_argv[0]); + map->l_name[0] ? map->l_name : rtld_progname); while (1) { @@ -1014,126 +1383,236 @@ of this helper program; chances are you _exit (0); } - { - /* Now we have all the objects loaded. Relocate them all except for - the dynamic linker itself. We do this in reverse order so that copy - relocs of earlier objects overwrite the data written by later - objects. We do not re-relocate the dynamic linker itself in this - loop because that could result in the GOT entries for functions we - call being changed, and that would break us. It is safe to relocate - the dynamic linker out of order because it has no copy relocs (we - know that because it is self-contained). */ + if (GL(dl_loaded)->l_info [ADDRIDX (DT_GNU_LIBLIST)] + && ! __builtin_expect (GL(dl_profile) != NULL, 0)) + { + ElfW(Lib) *liblist, *liblistend; + struct link_map **r_list, **r_listend, *l; + const char *strtab = (const void *) D_PTR (GL(dl_loaded), + l_info[DT_STRTAB]); - struct link_map *l; - int consider_profiling = _dl_profile != NULL; + assert (GL(dl_loaded)->l_info [VALIDX (DT_GNU_LIBLISTSZ)] != NULL); + liblist = (ElfW(Lib) *) + GL(dl_loaded)->l_info [ADDRIDX (DT_GNU_LIBLIST)]->d_un.d_ptr; + liblistend = (ElfW(Lib) *) + ((char *) liblist + + GL(dl_loaded)->l_info [VALIDX (DT_GNU_LIBLISTSZ)]->d_un.d_val); + r_list = GL(dl_loaded)->l_searchlist.r_list; + r_listend = r_list + GL(dl_loaded)->l_searchlist.r_nlist; + + for (; r_list < r_listend && liblist < liblistend; r_list++) + { + l = *r_list; + + if (l == GL(dl_loaded)) + continue; + + /* If the library is not mapped where it should, fail. */ + if (l->l_addr) + break; + + /* Next, check if checksum matches. */ + if (l->l_info [VALIDX(DT_CHECKSUM)] == NULL + || l->l_info [VALIDX(DT_CHECKSUM)]->d_un.d_val + != liblist->l_checksum) + break; + + if (l->l_info [VALIDX(DT_GNU_PRELINKED)] == NULL + || l->l_info [VALIDX(DT_GNU_PRELINKED)]->d_un.d_val + != liblist->l_time_stamp) + break; + + if (! _dl_name_match_p (strtab + liblist->l_name, l)) + break; + + ++liblist; + } + + + if (r_list == r_listend && liblist == liblistend) + prelinked = true; + + if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) + _dl_printf ("\nprelink checking: %s\n", prelinked ? "ok" : "failed"); + } + + if (prelinked) + { + struct link_map *l; + + if (GL(dl_loaded)->l_info [ADDRIDX (DT_GNU_CONFLICT)] != NULL) + { + ElfW(Rela) *conflict, *conflictend; #ifndef HP_TIMING_NONAVAIL - hp_timing_t start; - hp_timing_t stop; - hp_timing_t add; + hp_timing_t start; + hp_timing_t stop; #endif - /* If we are profiling we also must do lazy reloaction. */ - _dl_lazy |= consider_profiling; + HP_TIMING_NOW (start); + assert (GL(dl_loaded)->l_info [VALIDX (DT_GNU_CONFLICTSZ)] != NULL); + conflict = (ElfW(Rela) *) + GL(dl_loaded)->l_info [ADDRIDX (DT_GNU_CONFLICT)]->d_un.d_ptr; + conflictend = (ElfW(Rela) *) + ((char *) conflict + + GL(dl_loaded)->l_info [VALIDX (DT_GNU_CONFLICTSZ)]->d_un.d_val); + _dl_resolve_conflicts (GL(dl_loaded), conflict, conflictend); + HP_TIMING_NOW (stop); + HP_TIMING_DIFF (relocate_time, start, stop); + } - l = _dl_loaded; - while (l->l_next) - l = l->l_next; - HP_TIMING_NOW (start); - do - { - /* While we are at it, help the memory handling a bit. We have to - mark some data structures as allocated with the fake malloc() - implementation in ld.so. */ - struct libname_list *lnp = l->l_libname->next; + /* Mark all the objects so we know they have been already relocated. */ + for (l = GL(dl_loaded); l != NULL; l = l->l_next) + l->l_relocated = 1; - while (__builtin_expect (lnp != NULL, 0)) - { - lnp->dont_free = 1; - lnp = lnp->next; - } + _dl_sysdep_start_cleanup (); + } + else + { + /* Now we have all the objects loaded. Relocate them all except for + the dynamic linker itself. We do this in reverse order so that copy + relocs of earlier objects overwrite the data written by later + objects. We do not re-relocate the dynamic linker itself in this + loop because that could result in the GOT entries for functions we + call being changed, and that would break us. It is safe to relocate + the dynamic linker out of order because it has no copy relocs (we + know that because it is self-contained). */ - if (l != &_dl_rtld_map) - _dl_relocate_object (l, l->l_scope, _dl_lazy, consider_profiling); + struct link_map *l; + int consider_profiling = GL(dl_profile) != NULL; +#ifndef HP_TIMING_NONAVAIL + hp_timing_t start; + hp_timing_t stop; + hp_timing_t add; +#endif - l = l->l_prev; - } - while (l); - HP_TIMING_NOW (stop); + /* If we are profiling we also must do lazy reloaction. */ + GL(dl_lazy) |= consider_profiling; - HP_TIMING_DIFF (relocate_time, start, stop); + l = GL(dl_loaded); + while (l->l_next) + l = l->l_next; - /* Do any necessary cleanups for the startup OS interface code. - We do these now so that no calls are made after rtld re-relocation - which might be resolved to different functions than we expect. - We cannot do this before relocating the other objects because - _dl_relocate_object might need to call `mprotect' for DT_TEXTREL. */ - _dl_sysdep_start_cleanup (); + HP_TIMING_NOW (start); + do + { + /* While we are at it, help the memory handling a bit. We have to + mark some data structures as allocated with the fake malloc() + implementation in ld.so. */ + struct libname_list *lnp = l->l_libname->next; - /* Now enable profiling if needed. Like the previous call, - this has to go here because the calls it makes should use the - rtld versions of the functions (particularly calloc()), but it - needs to have _dl_profile_map set up by the relocator. */ - if (__builtin_expect (_dl_profile_map != NULL, 0)) - /* We must prepare the profiling. */ - _dl_start_profile (_dl_profile_map, _dl_profile_output); + while (__builtin_expect (lnp != NULL, 0)) + { + lnp->dont_free = 1; + lnp = lnp->next; + } - if (_dl_rtld_map.l_opencount > 1) - { - /* There was an explicit ref to the dynamic linker as a shared lib. - Re-relocate ourselves with user-controlled symbol definitions. */ - HP_TIMING_NOW (start); - _dl_relocate_object (&_dl_rtld_map, _dl_loaded->l_scope, 0, 0); - HP_TIMING_NOW (stop); - HP_TIMING_DIFF (add, start, stop); - HP_TIMING_ACCUM_NT (relocate_time, add); - } - } + if (l != &GL(dl_rtld_map)) + INTUSE(_dl_relocate_object) (l, l->l_scope, GL(dl_lazy), + consider_profiling); + + l = l->l_prev; + } + while (l); + HP_TIMING_NOW (stop); + + HP_TIMING_DIFF (relocate_time, start, stop); + + /* Do any necessary cleanups for the startup OS interface code. + We do these now so that no calls are made after rtld re-relocation + which might be resolved to different functions than we expect. + We cannot do this before relocating the other objects because + _dl_relocate_object might need to call `mprotect' for DT_TEXTREL. */ + _dl_sysdep_start_cleanup (); + + /* Now enable profiling if needed. Like the previous call, + this has to go here because the calls it makes should use the + rtld versions of the functions (particularly calloc()), but it + needs to have _dl_profile_map set up by the relocator. */ + if (__builtin_expect (GL(dl_profile_map) != NULL, 0)) + /* We must prepare the profiling. */ + INTUSE(_dl_start_profile) (GL(dl_profile_map), GL(dl_profile_output)); + + if (GL(dl_rtld_map).l_opencount > 1) + { + /* There was an explicit ref to the dynamic linker as a shared lib. + Re-relocate ourselves with user-controlled symbol definitions. */ + HP_TIMING_NOW (start); + INTUSE(_dl_relocate_object) (&GL(dl_rtld_map), GL(dl_loaded)->l_scope, + 0, 0); + HP_TIMING_NOW (stop); + HP_TIMING_DIFF (add, start, stop); + HP_TIMING_ACCUM_NT (relocate_time, add); + } + } /* Now set up the variable which helps the assembler startup code. */ - _dl_main_searchlist = &_dl_loaded->l_searchlist; - _dl_global_scope[0] = &_dl_loaded->l_searchlist; + GL(dl_main_searchlist) = &GL(dl_loaded)->l_searchlist; + GL(dl_global_scope)[0] = &GL(dl_loaded)->l_searchlist; - /* Safe the information about the original global scope list since + /* Save the information about the original global scope list since we need it in the memory handling later. */ - _dl_initial_searchlist = *_dl_main_searchlist; + GL(dl_initial_searchlist) = *GL(dl_main_searchlist); + +#ifdef USE_TLS +# ifndef SHARED + if (GL(dl_tls_max_dtv_idx) > 0) +# endif + { + /* Now that we have completed relocation, the initializer data + for the TLS blocks has its final values and we can copy them + into the main thread's TLS area, which we allocated above. */ + _dl_allocate_tls_init (tcbp); + + /* And finally install it for the main thread. */ +# ifndef HAVE___THREAD + TLS_INIT_TP (tcbp, GL(dl_rtld_map).l_tls_tp_initialized); +# else + /* If the compiler supports the __thread keyword we know that + at least ld.so itself uses TLS and therefore the thread + pointer was initialized earlier. */ + assert (GL(dl_rtld_map).l_tls_tp_initialized != 0); + TLS_INIT_TP (tcbp, 1); +# endif + } +#endif { /* Initialize _r_debug. */ - struct r_debug *r = _dl_debug_initialize (_dl_rtld_map.l_addr); + struct r_debug *r = _dl_debug_initialize (GL(dl_rtld_map).l_addr); struct link_map *l; - l = _dl_loaded; + l = GL(dl_loaded); #ifdef ELF_MACHINE_DEBUG_SETUP /* Some machines (e.g. MIPS) don't use DT_DEBUG in this way. */ ELF_MACHINE_DEBUG_SETUP (l, r); - ELF_MACHINE_DEBUG_SETUP (&_dl_rtld_map, r); + ELF_MACHINE_DEBUG_SETUP (&GL(dl_rtld_map), r); #else - if (l->l_info[DT_DEBUG]) + if (l->l_info[DT_DEBUG] != NULL) /* There is a DT_DEBUG entry in the dynamic section. Fill it in with the run-time address of the r_debug structure */ l->l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r; /* Fill in the pointer in the dynamic linker's own dynamic section, in case you run gdb on the dynamic linker directly. */ - if (_dl_rtld_map.l_info[DT_DEBUG]) - _dl_rtld_map.l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r; + if (GL(dl_rtld_map).l_info[DT_DEBUG] != NULL) + GL(dl_rtld_map).l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r; #endif /* Notify the debugger that all objects are now mapped in. */ r->r_state = RT_ADD; - _dl_debug_state (); + INTUSE(_dl_debug_state) (); } #ifndef MAP_COPY /* We must munmap() the cache file. */ - _dl_unload_cache (); + INTUSE(_dl_unload_cache) (); #endif /* Once we return, _dl_sysdep_start will invoke @@ -1147,7 +1626,7 @@ print_unresolved (int errcode __attribut const char *errstring) { if (objname[0] == '\0') - objname = _dl_argv[0] ?: "
"; + objname = rtld_progname ?: "
"; _dl_error_printf ("%s (%s)\n", errstring, objname); } @@ -1157,7 +1636,7 @@ static void print_missing_version (int errcode __attribute__ ((unused)), const char *objname, const char *errstring) { - _dl_error_printf ("%s: %s: %s\n", _dl_argv[0] ?: "", + _dl_error_printf ("%s: %s: %s\n", rtld_progname ?: "", objname, errstring); } @@ -1173,51 +1652,53 @@ process_dl_debug (const char *dl_debug) is correctly handled in the LD_DEBUG_HELP code below. */ static const struct { - const char name[11]; + unsigned char len; + const char name[10]; const char helptext[41]; unsigned short int mask; } debopts[] = { - { "libs", "display library search paths", +#define LEN_AND_STR(str) sizeof (str) - 1, str + { LEN_AND_STR ("libs"), "display library search paths", DL_DEBUG_LIBS | DL_DEBUG_IMPCALLS }, - { "reloc", "display relocation processing", + { LEN_AND_STR ("reloc"), "display relocation processing", DL_DEBUG_RELOC | DL_DEBUG_IMPCALLS }, - { "files", "display progress for input file", + { LEN_AND_STR ("files"), "display progress for input file", DL_DEBUG_FILES | DL_DEBUG_IMPCALLS }, - { "symbols", "display symbol table processing", + { LEN_AND_STR ("symbols"), "display symbol table processing", DL_DEBUG_SYMBOLS | DL_DEBUG_IMPCALLS }, - { "bindings", "display information about symbol binding", + { LEN_AND_STR ("bindings"), "display information about symbol binding", DL_DEBUG_BINDINGS | DL_DEBUG_IMPCALLS }, - { "versions", "display version dependencies", + { LEN_AND_STR ("versions"), "display version dependencies", DL_DEBUG_VERSIONS | DL_DEBUG_IMPCALLS }, - { "all", "all previous options combined", + { LEN_AND_STR ("all"), "all previous options combined", DL_DEBUG_LIBS | DL_DEBUG_RELOC | DL_DEBUG_FILES | DL_DEBUG_SYMBOLS | DL_DEBUG_BINDINGS | DL_DEBUG_VERSIONS | DL_DEBUG_IMPCALLS }, - { "statistics", "display relocation statistics", + { LEN_AND_STR ("statistics"), "display relocation statistics", DL_DEBUG_STATISTICS }, - { "help", "display this help message and exit", + { LEN_AND_STR ("help"), "display this help message and exit", DL_DEBUG_HELP }, }; #define ndebopts (sizeof (debopts) / sizeof (debopts[0])) - size_t len; -#define separators " ,:" - do + /* Skip separating white spaces and commas. */ + while (*dl_debug != '\0') { - len = 0; - /* Skip separating white spaces and commas. */ - dl_debug += strspn (dl_debug, separators); - if (*dl_debug != '\0') + if (*dl_debug != ' ' && *dl_debug != ',' && *dl_debug != ':') { size_t cnt; + size_t len = 1; - len = strcspn (dl_debug, separators); + while (dl_debug[len] != '\0' && dl_debug[len] != ' ' + && dl_debug[len] != ',' && dl_debug[len] != ':') + ++len; for (cnt = 0; cnt < ndebopts; ++cnt) - if (strncmp (dl_debug, debopts[cnt].name, len) == 0 - && debopts[cnt].name[len] == '\0') + if (debopts[cnt].len == len + && memcmp (dl_debug, debopts[cnt].name, len) == 0) { - _dl_debug_mask |= debopts[cnt].mask; + GL(dl_debug_mask) |= debopts[cnt].mask; + any_debug = 1; break; } @@ -1228,13 +1709,16 @@ process_dl_debug (const char *dl_debug) char *copy = strndupa (dl_debug, len); _dl_error_printf ("\ warning: debug option `%s' unknown; try LD_DEBUG=help\n", copy); - break; - } + } + + dl_debug += len; + continue; } + + ++dl_debug; } - while (*(dl_debug += len) != '\0'); - if (_dl_debug_mask & DL_DEBUG_HELP) + if (GL(dl_debug_mask) & DL_DEBUG_HELP) { size_t cnt; @@ -1242,8 +1726,8 @@ warning: debug option `%s' unknown; try Valid options for the LD_DEBUG environment variable are:\n\n"); for (cnt = 0; cnt < ndebopts; ++cnt) - _dl_printf (" %s%s %s\n", debopts[cnt].name, - " " + strlen (debopts[cnt].name) - 3, + _dl_printf (" %.*s%s%s\n", debopts[cnt].len, debopts[cnt].name, + " " + debopts[cnt].len - 3, debopts[cnt].helptext); _dl_printf ("\n\ @@ -1256,7 +1740,8 @@ a filename can be specified using the LD /* Process all environments variables the dynamic linker must recognize. Since all of them start with `LD_' we are a bit smarter while finding all the entries. */ -extern char **_environ; +extern char **_environ attribute_hidden; + static void process_envvars (enum mode *modep) @@ -1267,11 +1752,15 @@ process_envvars (enum mode *modep) char *debug_output = NULL; /* This is the default place for profiling data file. */ - _dl_profile_output = &"/var/tmp\0/var/profile"[__libc_enable_secure ? 9 : 0]; + GL(dl_profile_output) + = &"/var/tmp\0/var/profile"[INTUSE(__libc_enable_secure) ? 9 : 0]; while ((envline = _dl_next_ld_env_entry (&runp)) != NULL) { - size_t len = strcspn (envline, "="); + size_t len = 0; + + while (envline[len] != '\0' && envline[len] != '=') + ++len; if (envline[len] != '=') /* This is a "LD_" variable at the end of the string without @@ -1284,7 +1773,7 @@ process_envvars (enum mode *modep) case 4: /* Warning level, verbose or not. */ if (memcmp (envline, "WARN", 4) == 0) - _dl_verbose = envline[5] != '\0'; + GL(dl_verbose) = envline[5] != '\0'; break; case 5: @@ -1310,18 +1799,18 @@ process_envvars (enum mode *modep) /* Which shared object shall be profiled. */ if (memcmp (envline, "PROFILE", 7) == 0 && envline[8] != '\0') - _dl_profile = &envline[8]; + GL(dl_profile) = &envline[8]; break; case 8: /* Do we bind early? */ if (memcmp (envline, "BIND_NOW", 8) == 0) { - _dl_lazy = envline[9] == '\0'; + GL(dl_lazy) = envline[9] == '\0'; break; } if (memcmp (envline, "BIND_NOT", 8) == 0) - _dl_bind_not = envline[9] != '\0'; + GL(dl_bind_not) = envline[9] != '\0'; break; case 9: @@ -1334,14 +1823,14 @@ process_envvars (enum mode *modep) case 10: /* Mask for the important hardware capabilities. */ if (memcmp (envline, "HWCAP_MASK", 10) == 0) - _dl_hwcap_mask = __strtoul_internal (&envline[11], NULL, 0, 0); + GL(dl_hwcap_mask) = __strtoul_internal (&envline[11], NULL, 0, 0); break; case 11: /* Path where the binary is found. */ - if (!__libc_enable_secure + if (!INTUSE(__libc_enable_secure) && memcmp (envline, "ORIGIN_PATH", 11) == 0) - _dl_origin_path = &envline[12]; + GL(dl_origin_path) = &envline[12]; break; case 12: @@ -1360,15 +1849,26 @@ process_envvars (enum mode *modep) } if (memcmp (envline, "DYNAMIC_WEAK", 12) == 0) - _dl_dynamic_weak = 1; + GL(dl_dynamic_weak) = 1; break; case 14: /* Where to place the profiling data file. */ - if (!__libc_enable_secure + if (!INTUSE(__libc_enable_secure) && memcmp (envline, "PROFILE_OUTPUT", 14) == 0 && envline[15] != '\0') - _dl_profile_output = &envline[15]; + GL(dl_profile_output) = &envline[15]; + break; + + case 16: + /* The mode of the dynamic linker can be set. */ + if (memcmp (envline, "TRACE_PRELINKING", 16) == 0) + { + mode = trace; + GL(dl_verbose) = 1; + GL(dl_debug_mask) |= DL_DEBUG_PRELINK; + GL(dl_trace_prelink) = &envline[17]; + } break; case 20: @@ -1392,7 +1892,7 @@ process_envvars (enum mode *modep) /* Extra security for SUID binaries. Remove all dangerous environment variables. */ - if (__builtin_expect (__libc_enable_secure, 0)) + if (__builtin_expect (INTUSE(__libc_enable_secure), 0)) { static const char unsecure_envvars[] = #ifdef EXTRA_UNSECURE_ENVVARS @@ -1405,7 +1905,8 @@ process_envvars (enum mode *modep) do { unsetenv (nextp); - nextp = (char *) rawmemchr (nextp, '\0') + 1; + /* We could use rawmemchr but this need not be fast. */ + nextp = (char *) (strchr) (nextp, '\0') + 1; } while (*nextp != '\0'); @@ -1427,14 +1928,14 @@ process_envvars (enum mode *modep) char *startp; buf[name_len + 11] = '\0'; - startp = _itoa_word (__getpid (), &buf[name_len + 11], 10, 0); + startp = _itoa (__getpid (), &buf[name_len + 11], 10, 0); *--startp = '.'; startp = memcpy (startp - name_len, debug_output, name_len); - _dl_debug_fd = __open (startp, flags, DEFFILEMODE); - if (_dl_debug_fd == -1) + GL(dl_debug_fd) = __open (startp, flags, DEFFILEMODE); + if (GL(dl_debug_fd) == -1) /* We use standard output if opening the file failed. */ - _dl_debug_fd = STDOUT_FILENO; + GL(dl_debug_fd) = STDOUT_FILENO; } } @@ -1452,8 +1953,9 @@ print_statistics (void) if (HP_TIMING_AVAIL) { HP_TIMING_PRINT (buf, sizeof (buf), rtld_total_time); - _dl_debug_printf ("\nruntime linker statistics:\n" - " total startup time in dynamic loader: %s\n", buf); + INTUSE(_dl_debug_printf) ("\nruntime linker statistics:\n" + " total startup time in dynamic loader: %s\n", + buf); } /* Print relocation statistics. */ @@ -1461,8 +1963,8 @@ print_statistics (void) { char pbuf[30]; HP_TIMING_PRINT (buf, sizeof (buf), relocate_time); - cp = _itoa_word ((1000ULL * relocate_time) / rtld_total_time, - pbuf + sizeof (pbuf), 10, 0); + cp = _itoa ((1000ULL * relocate_time) / rtld_total_time, + pbuf + sizeof (pbuf), 10, 0); wp = pbuf; switch (pbuf + sizeof (pbuf) - cp) { @@ -1475,14 +1977,15 @@ print_statistics (void) *wp++ = *cp++; } *wp = '\0'; - _dl_debug_printf (" time needed for relocation: %s (%s%%)\n", - buf, pbuf); + INTUSE(_dl_debug_printf) ("\ + time needed for relocation: %s (%s%%)\n", + buf, pbuf); } #endif - _dl_debug_printf (" number of relocations: %lu\n", - _dl_num_relocations); - _dl_debug_printf (" number of relocations from cache: %lu\n", - _dl_num_cache_relocations); + INTUSE(_dl_debug_printf) (" number of relocations: %lu\n", + GL(dl_num_relocations)); + INTUSE(_dl_debug_printf) (" number of relocations from cache: %lu\n", + GL(dl_num_cache_relocations)); #ifndef HP_TIMING_NONAVAIL /* Time spend while loading the object and the dependencies. */ @@ -1490,8 +1993,8 @@ print_statistics (void) { char pbuf[30]; HP_TIMING_PRINT (buf, sizeof (buf), load_time); - cp = _itoa_word ((1000ULL * load_time) / rtld_total_time, - pbuf + sizeof (pbuf), 10, 0); + cp = _itoa ((1000ULL * load_time) / rtld_total_time, + pbuf + sizeof (pbuf), 10, 0); wp = pbuf; switch (pbuf + sizeof (pbuf) - cp) { @@ -1504,8 +2007,9 @@ print_statistics (void) *wp++ = *cp++; } *wp = '\0'; - _dl_debug_printf (" time needed to load objects: %s (%s%%)\n", - buf, pbuf); + INTUSE(_dl_debug_printf) ("\ + time needed to load objects: %s (%s%%)\n", + buf, pbuf); } #endif } diff -durpN glibc-2.2.5/elf/sprof.c glibc-2.3/elf/sprof.c --- glibc-2.2.5/elf/sprof.c 2002-01-20 19:20:47.000000000 -0800 +++ glibc-2.3/elf/sprof.c 2002-08-24 21:12:24.000000000 -0700 @@ -675,7 +675,7 @@ load_profdata (const char *name, struct return NULL; } - if (st.st_size != shobj->expected_size) + if ((size_t) st.st_size != shobj->expected_size) { error (0, 0, _("profiling data file `%s' does not match shared object `%s'"), @@ -752,9 +752,21 @@ load_profdata (const char *name, struct sizeof (struct gmon_hist_hdr)) != 0 || narcsp[-1] != GMON_TAG_CG_ARC) { - free (result); error (0, 0, _("`%s' is no correct profile data file for `%s'"), name, shobj->name); + if (do_test) + { + if (memcmp (addr, &gmon_hdr, sizeof (struct gmon_hdr)) != 0) + puts ("gmon_hdr differs"); + if (*(uint32_t *) result->hist != GMON_TAG_TIME_HIST) + puts ("result->hist differs"); + if (memcmp (result->hist_hdr, &hist_hdr, + sizeof (struct gmon_hist_hdr)) != 0) + puts ("hist_hdr differs"); + if (narcsp[-1] != GMON_TAG_CG_ARC) + puts ("narcsp[-1] differs"); + } + free (result); munmap (addr, st.st_size); return NULL; } diff -durpN glibc-2.2.5/elf/tls-macros.h glibc-2.3/elf/tls-macros.h --- glibc-2.2.5/elf/tls-macros.h 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tls-macros.h 2002-10-01 23:15:56.000000000 -0700 @@ -0,0 +1,211 @@ +/* Macros to support TLS testing in times of missing compiler support. */ + +#define COMMON_INT_DEF(x) \ + asm (".tls_common " #x ",4,4") +/* XXX Until we get compiler support we don't need declarations. */ +#define COMMON_INT_DECL(x) + +/* XXX This definition will probably be machine specific, too. */ +#define VAR_INT_DEF(x) \ + asm (".section .tdata\n\t" \ + ".globl " #x "\n" \ + #x ":\t.long 0\n\t" \ + ".size " #x ",4\n\t" \ + ".previous") +/* XXX Until we get compiler support we don't need declarations. */ +#define VAR_INT_DECL(x) + + + /* XXX Each architecture must have its own asm for now. */ +#ifdef __i386__ +# define TLS_LE(x) \ + ({ int *__l; \ + asm ("movl %%gs:0,%0\n\t" \ + "subl $" #x "@tpoff,%0" \ + : "=r" (__l)); \ + __l; }) + +# ifdef PIC +# define TLS_IE(x) \ + ({ int *__l; \ + asm ("movl %%gs:0,%0\n\t" \ + "subl " #x "@gottpoff(%%ebx),%0" \ + : "=r" (__l)); \ + __l; }) +# else +# define TLS_IE(x) \ + ({ int *__l, __b; \ + asm ("call 1f\n\t" \ + ".subsection 1\n" \ + "1:\tmovl (%%esp), %%ebx\n\t" \ + "ret\n\t" \ + ".previous\n\t" \ + "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \ + "movl %%gs:0,%0\n\t" \ + "subl " #x "@gottpoff(%%ebx),%0" \ + : "=r" (__l), "=&b" (__b)); \ + __l; }) +# endif + +# ifdef PIC +# define TLS_LD(x) \ + ({ int *__l, __c, __d; \ + asm ("leal " #x "@tlsldm(%%ebx),%%eax\n\t" \ + "call ___tls_get_addr@plt\n\t" \ + "leal " #x "@dtpoff(%%eax), %%eax" \ + : "=a" (__l), "=&c" (__c), "=&d" (__d)); \ + __l; }) +# else +# define TLS_LD(x) \ + ({ int *__l, __b, __c, __d; \ + asm ("call 1f\n\t" \ + ".subsection 1\n" \ + "1:\tmovl (%%esp), %%ebx\n\t" \ + "ret\n\t" \ + ".previous\n\t" \ + "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \ + "leal " #x "@tlsldm(%%ebx),%%eax\n\t" \ + "call ___tls_get_addr@plt\n\t" \ + "leal " #x "@dtpoff(%%eax), %%eax" \ + : "=a" (__l), "=&b" (__b), "=&c" (__c), "=&d" (__d)); \ + __l; }) +# endif + +# ifdef PIC +# define TLS_GD(x) \ + ({ int *__l, __c, __d; \ + asm ("leal " #x "@tlsgd(%%ebx),%%eax\n\t" \ + "call ___tls_get_addr@plt\n\t" \ + "nop" \ + : "=a" (__l), "=&c" (__c), "=&d" (__d)); \ + __l; }) +# else +# define TLS_GD(x) \ + ({ int *__l, __b, __c, __d; \ + asm ("call 1f\n\t" \ + ".subsection 1\n" \ + "1:\tmovl (%%esp), %%ebx\n\t" \ + "ret\n\t" \ + ".previous\n\t" \ + "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \ + "leal " #x "@tlsgd(%%ebx),%%eax\n\t" \ + "call ___tls_get_addr@plt\n\t" \ + "nop" \ + : "=a" (__l), "=&b" (__b), "=&c" (__c), "=&d" (__d)); \ + __l; }) +# endif + +#elif defined __x86_64__ + +# define TLS_LE(x) \ + ({ int *__l; \ + asm ("movq %%fs:0,%0\n\t" \ + "leaq " #x "@tpoff(%0), %0" \ + : "=r" (__l)); \ + __l; }) + +# define TLS_IE(x) \ + ({ int *__l; \ + asm ("movq %%fs:0,%0\n\t" \ + "addq " #x "@gottpoff(%%rip),%0" \ + : "=r" (__l)); \ + __l; }) + +# define TLS_LD(x) \ + ({ int *__l, __c, __d; \ + asm ("leaq " #x "@tlsld(%%rip),%%rdi\n\t" \ + "call __tls_get_addr@plt\n\t" \ + "leaq " #x "@dtpoff(%%rax), %%rax" \ + : "=a" (__l), "=&c" (__c), "=&d" (__d) \ + : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \ + __l; }) + +# define TLS_GD(x) \ + ({ int *__l, __c, __d; \ + asm (".long 0x66666666\n\t" \ + "leaq " #x "@tlsgd(%%rip),%%rdi\n\t" \ + "call __tls_get_addr@plt" \ + : "=a" (__l), "=&c" (__c), "=&d" (__d) \ + : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \ + __l; }) + +#elif defined __sh__ + +# define TLS_LE(x) \ + ({ int *__l; void *__tp; \ + asm ("stc gbr,%1\n\t" \ + "mov.l 1f,%0\n\t" \ + "bra 2f\n\t" \ + " add %1,%0\n\t" \ + ".align 2\n\t" \ + "1: .long " #x "@tpoff\n\t" \ + "2:" \ + : "=r" (__l), "=r" (__tp)); \ + __l; }) + +# define TLS_IE(x) \ + ({ int *__l; void *__tp; \ + asm ("mova 0f,r0\n\t" \ + "mov.l 0f,r12\n\t" \ + "add r0,r12\n\t" \ + "mov.l 1f,r0\n\t" \ + "stc gbr,%1\n\t" \ + "mov.l @(r0,r12),%0\n\t" \ + "bra 2f\n\t" \ + " add %1,%0\n\t" \ + ".align 2\n\t" \ + "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \ + "1: .long " #x "@gottpoff\n\t" \ + "2:" \ + : "=r" (__l), "=r" (__tp) : : "r0", "r12"); \ + __l; }) + +# define TLS_LD(x) \ + ({ int *__l; \ + asm ("mova 0f,r0\n\t" \ + "mov.l 0f,r12\n\t" \ + "add r0,r12\n\t" \ + "mov.l 1f,r4\n\t" \ + "mova 2f,r0\n\t" \ + "mov.l 2f,r1\n\t" \ + "add r0,r1\n\t" \ + "jsr @r1\n\t" \ + " add r12,r4\n\t" \ + "mov.l 3f,%0\n\t" \ + "bra 4f\n\t" \ + " add r0,%0\n\t" \ + ".align 2\n\t" \ + "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \ + "1: .long " #x "@tlsldm\n\t" \ + "2: .long __tls_get_addr@plt\n\t" \ + "3: .long " #x "@dtpoff\n\t" \ + "4:" \ + : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ + "r12", "pr", "t"); \ + __l; }) + +# define TLS_GD(x) \ + ({ int *__l; \ + asm ("mova 0f,r0\n\t" \ + "mov.l 0f,r12\n\t" \ + "add r0,r12\n\t" \ + "mov.l 1f,r4\n\t" \ + "mova 2f,r0\n\t" \ + "mov.l 2f,r1\n\t" \ + "add r0,r1\n\t" \ + "jsr @r1\n\t" \ + " add r12,r4\n\t" \ + "bra 3f\n\t" \ + " mov r0,%0\n\t" \ + ".align 2\n\t" \ + "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \ + "1: .long " #x "@tlsgd\n\t" \ + "2: .long __tls_get_addr@plt\n\t" \ + "3:" \ + : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ + "r12", "pr", "t"); \ + __l; }) + +#else +# error "No support for this architecture so far." +#endif diff -durpN glibc-2.2.5/elf/tst-tls1.c glibc-2.3/elf/tst-tls1.c --- glibc-2.2.5/elf/tst-tls1.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tls1.c 2002-02-13 09:43:47.000000000 -0800 @@ -0,0 +1,91 @@ +/* glibc test for TLS in ld.so. */ +#include + +#include + +#ifdef USE_TLS +# include "tls-macros.h" + + +/* Two common 'int' variables in TLS. */ +COMMON_INT_DEF(foo); +COMMON_INT_DEF(bar); +#endif + + +#define TEST_FUNCTION do_test () +static int +do_test (void) +{ +#ifdef USE_TLS + int result = 0; + int *ap, *bp; + + + /* Set the variable using the local exec model. */ + puts ("set bar to 1 (LE)"); + ap = TLS_LE (bar); + *ap = 1; + + + /* Get variables using initial exec model. */ + fputs ("get sum of foo and bar (IE)", stdout); + ap = TLS_IE (foo); + bp = TLS_IE (bar); + printf (" = %d\n", *ap + *bp); + result |= *ap + *bp != 1; + if (*ap != 0) + { + printf ("foo = %d\n", *ap); + result = 1; + } + if (*bp != 1) + { + printf ("bar = %d\n", *bp); + result = 1; + } + + + /* Get variables using local dynamic model. */ + fputs ("get sum of foo and bar (LD)", stdout); + ap = TLS_LD (foo); + bp = TLS_LD (bar); + printf (" = %d\n", *ap + *bp); + result |= *ap + *bp != 1; + if (*ap != 0) + { + printf ("foo = %d\n", *ap); + result = 1; + } + if (*bp != 1) + { + printf ("bar = %d\n", *bp); + result = 1; + } + + + /* Get variables using generic dynamic model. */ + fputs ("get sum of foo and bar (GD)", stdout); + ap = TLS_GD (foo); + bp = TLS_GD (bar); + printf (" = %d\n", *ap + *bp); + result |= *ap + *bp != 1; + if (*ap != 0) + { + printf ("foo = %d\n", *ap); + result = 1; + } + if (*bp != 1) + { + printf ("bar = %d\n", *bp); + result = 1; + } + + return result; +#else + return 0; +#endif +} + + +#include "../test-skeleton.c" diff -durpN glibc-2.2.5/elf/tst-tls1-static.c glibc-2.3/elf/tst-tls1-static.c --- glibc-2.2.5/elf/tst-tls1-static.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tls1-static.c 2002-08-28 03:42:40.000000000 -0700 @@ -0,0 +1 @@ +#include "tst-tls1.c" diff -durpN glibc-2.2.5/elf/tst-tls2.c glibc-2.3/elf/tst-tls2.c --- glibc-2.2.5/elf/tst-tls2.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tls2.c 2002-02-13 09:43:37.000000000 -0800 @@ -0,0 +1,91 @@ +/* glibc test for TLS in ld.so. */ +#include + +#include + +#ifdef USE_TLS +# include "tls-macros.h" + + +/* Two 'int' variables in TLS. */ +VAR_INT_DEF(foo); +VAR_INT_DEF(bar); +#endif + + +#define TEST_FUNCTION do_test () +static int +do_test (void) +{ +#ifdef USE_TLS + int result = 0; + int *ap, *bp; + + + /* Set the variable using the local exec model. */ + puts ("set bar to 1 (LE)"); + ap = TLS_LE (bar); + *ap = 1; + + + /* Get variables using initial exec model. */ + fputs ("get sum of foo and bar (IE)", stdout); + ap = TLS_IE (foo); + bp = TLS_IE (bar); + printf (" = %d\n", *ap + *bp); + result |= *ap + *bp != 1; + if (*ap != 0) + { + printf ("foo = %d\n", *ap); + result = 1; + } + if (*bp != 1) + { + printf ("bar = %d\n", *bp); + result = 1; + } + + + /* Get variables using local dynamic model. */ + fputs ("get sum of foo and bar (LD)", stdout); + ap = TLS_LD (foo); + bp = TLS_LD (bar); + printf (" = %d\n", *ap + *bp); + result |= *ap + *bp != 1; + if (*ap != 0) + { + printf ("foo = %d\n", *ap); + result = 1; + } + if (*bp != 1) + { + printf ("bar = %d\n", *bp); + result = 1; + } + + + /* Get variables using generic dynamic model. */ + fputs ("get sum of foo and bar (GD)", stdout); + ap = TLS_GD (foo); + bp = TLS_GD (bar); + printf (" = %d\n", *ap + *bp); + result |= *ap + *bp != 1; + if (*ap != 0) + { + printf ("foo = %d\n", *ap); + result = 1; + } + if (*bp != 1) + { + printf ("bar = %d\n", *bp); + result = 1; + } + + return result; +#else + return 0; +#endif +} + + +#include "../test-skeleton.c" diff -durpN glibc-2.2.5/elf/tst-tls2-static.c glibc-2.3/elf/tst-tls2-static.c --- glibc-2.2.5/elf/tst-tls2-static.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tls2-static.c 2002-08-28 03:42:40.000000000 -0700 @@ -0,0 +1 @@ +#include "tst-tls2.c" diff -durpN glibc-2.2.5/elf/tst-tls3.c glibc-2.3/elf/tst-tls3.c --- glibc-2.2.5/elf/tst-tls3.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tls3.c 2002-02-13 09:43:34.000000000 -0800 @@ -0,0 +1,76 @@ +/* glibc test for TLS in ld.so. */ +#include + +#include + +#ifdef USE_TLS +# include "tls-macros.h" + + +/* One define int variable, two externs. */ +COMMON_INT_DECL(foo); +VAR_INT_DECL(bar); +VAR_INT_DEF(baz); +#endif + + +extern int in_dso (void); + + +#define TEST_FUNCTION do_test () +static int +do_test (void) +{ +#ifdef USE_TLS + int result = 0; + int *ap, *bp, *cp; + + + /* Set the variable using the local exec model. */ + puts ("set baz to 3 (LE)"); + ap = TLS_LE (baz); + *ap = 3; + + + /* Get variables using initial exec model. */ + puts ("set variables foo and bar (IE)"); + ap = TLS_IE (foo); + *ap = 1; + bp = TLS_IE (bar); + *bp = 2; + + + /* Get variables using local dynamic model. */ + fputs ("get sum of foo, bar (GD) and baz (LD)", stdout); + ap = TLS_GD (foo); + bp = TLS_GD (bar); + cp = TLS_LD (baz); + printf (" = %d\n", *ap + *bp + *cp); + result |= *ap + *bp + *cp != 6; + if (*ap != 1) + { + printf ("foo = %d\n", *ap); + result = 1; + } + if (*bp != 2) + { + printf ("bar = %d\n", *bp); + result = 1; + } + if (*cp != 3) + { + printf ("baz = %d\n", *cp); + result = 1; + } + + + result |= in_dso (); + + return result; +#else + return 0; +#endif +} + + +#include "../test-skeleton.c" diff -durpN glibc-2.2.5/elf/tst-tls4.c glibc-2.3/elf/tst-tls4.c --- glibc-2.2.5/elf/tst-tls4.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tls4.c 2002-02-12 23:31:26.000000000 -0800 @@ -0,0 +1,56 @@ +#include +#include +#include + +#include + + +#define TEST_FUNCTION do_test () +static int +do_test (void) +{ +#ifdef USE_TLS + static const char modname[] = "tst-tlsmod2.so"; + int result = 0; + int *foop; + int (*fp) (int, int *); + void *h; + + h = dlopen (modname, RTLD_LAZY); + if (h == NULL) + { + printf ("cannot open '%s': %s\n", modname, dlerror ()); + exit (1); + } + + fp = dlsym (h, "in_dso"); + if (fp == NULL) + { + printf ("cannot get symbol 'in_dso': %s\n", dlerror ()); + exit (1); + } + + result |= fp (0, NULL); + + foop = dlsym (h, "foo"); + if (foop == NULL) + { + printf ("cannot get symbol 'foo' the second time: %s\n", dlerror ()); + exit (1); + } + if (*foop != 16) + { + puts ("foo != 16"); + result = 1; + } + + dlclose (h); + + return result; +#else + return 0; +#endif +} + + +#include "../test-skeleton.c" diff -durpN glibc-2.2.5/elf/tst-tls5.c glibc-2.3/elf/tst-tls5.c --- glibc-2.2.5/elf/tst-tls5.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tls5.c 2002-02-12 23:31:40.000000000 -0800 @@ -0,0 +1,72 @@ +#include +#include +#include + +#include + + +#define TEST_FUNCTION do_test () +static int +do_test (void) +{ +#ifdef USE_TLS + static const char modname[] = "tst-tlsmod2.so"; + int result = 0; + int *foop; + int *foop2; + int (*fp) (int, int *); + void *h; + + h = dlopen (modname, RTLD_LAZY); + if (h == NULL) + { + printf ("cannot open '%s': %s\n", modname, dlerror ()); + exit (1); + } + + foop = dlsym (h, "foo"); + if (foop == NULL) + { + printf ("cannot get symbol 'foo': %s\n", dlerror ()); + exit (1); + } + + *foop = 42; + + fp = dlsym (h, "in_dso"); + if (fp == NULL) + { + printf ("cannot get symbol 'in_dso': %s\n", dlerror ()); + exit (1); + } + + result |= fp (42, foop); + + foop2 = dlsym (h, "foo"); + if (foop2 == NULL) + { + printf ("cannot get symbol 'foo' the second time: %s\n", dlerror ()); + exit (1); + } + + if (foop != foop2) + { + puts ("address of 'foo' different the second time"); + result = 1; + } + else if (*foop != 16) + { + puts ("foo != 16"); + result = 1; + } + + dlclose (h); + + return result; +#else + return 0; +#endif +} + + +#include "../test-skeleton.c" diff -durpN glibc-2.2.5/elf/tst-tls6.c glibc-2.3/elf/tst-tls6.c --- glibc-2.2.5/elf/tst-tls6.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tls6.c 2002-02-13 19:48:24.000000000 -0800 @@ -0,0 +1,90 @@ +#include +#include +#include + +#include +#include + + +#define TEST_FUNCTION do_test () +static int +do_test (void) +{ +#ifdef USE_TLS + static const char modname[] = "tst-tlsmod2.so"; + int result = 0; + int *foop; + int *foop2; + int (*fp) (int, int *); + void *h; + int i; + int modid = -1; + + for (i = 0; i < 10; ++i) + { + h = dlopen (modname, RTLD_LAZY); + if (h == NULL) + { + printf ("cannot open '%s': %s\n", modname, dlerror ()); + exit (1); + } + + /* Dirty test code here: we peek into a private data structure. + We make sure that the module gets assigned the same ID every + time. The value of the first round is used. */ + if (modid == -1) + modid = ((struct link_map *) h)->l_tls_modid; + else if (((struct link_map *) h)->l_tls_modid != modid) + { + printf ("round %d: modid now %d, initially %d\n", + i, ((struct link_map *) h)->l_tls_modid, modid); + result = 1; + } + + foop = dlsym (h, "foo"); + if (foop == NULL) + { + printf ("cannot get symbol 'foo': %s\n", dlerror ()); + exit (1); + } + + *foop = 42 + i; + + fp = dlsym (h, "in_dso"); + if (fp == NULL) + { + printf ("cannot get symbol 'in_dso': %s\n", dlerror ()); + exit (1); + } + + result |= fp (42 + i, foop); + + foop2 = dlsym (h, "foo"); + if (foop2 == NULL) + { + printf ("cannot get symbol 'foo' the second time: %s\n", dlerror ()); + exit (1); + } + + if (foop != foop2) + { + puts ("address of 'foo' different the second time"); + result = 1; + } + else if (*foop != 16) + { + puts ("foo != 16"); + result = 1; + } + + dlclose (h); + } + + return result; +#else + return 0; +#endif +} + + +#include "../test-skeleton.c" diff -durpN glibc-2.2.5/elf/tst-tls7.c glibc-2.3/elf/tst-tls7.c --- glibc-2.2.5/elf/tst-tls7.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tls7.c 2002-02-13 21:10:20.000000000 -0800 @@ -0,0 +1,61 @@ +#include +#include +#include + +#include +#include + + +#define TEST_FUNCTION do_test () +static int +do_test (void) +{ +#ifdef USE_TLS + static const char modname[] = "tst-tlsmod3.so"; + int result = 0; + int (*fp) (void); + void *h; + int i; + int modid = -1; + + for (i = 0; i < 10; ++i) + { + h = dlopen (modname, RTLD_LAZY); + if (h == NULL) + { + printf ("cannot open '%s': %s\n", modname, dlerror ()); + exit (1); + } + + /* Dirty test code here: we peek into a private data structure. + We make sure that the module gets assigned the same ID every + time. The value of the first round is used. */ + if (modid == -1) + modid = ((struct link_map *) h)->l_tls_modid; + else if (((struct link_map *) h)->l_tls_modid != modid) + { + printf ("round %d: modid now %d, initially %d\n", + i, ((struct link_map *) h)->l_tls_modid, modid); + result = 1; + } + + fp = dlsym (h, "in_dso2"); + if (fp == NULL) + { + printf ("cannot get symbol 'in_dso2': %s\n", dlerror ()); + exit (1); + } + + result |= fp (); + + dlclose (h); + } + + return result; +#else + return 0; +#endif +} + + +#include "../test-skeleton.c" diff -durpN glibc-2.2.5/elf/tst-tls8.c glibc-2.3/elf/tst-tls8.c --- glibc-2.2.5/elf/tst-tls8.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tls8.c 2002-02-14 02:31:04.000000000 -0800 @@ -0,0 +1,174 @@ +#include +#include +#include + +#include +#include + + +#define TEST_FUNCTION do_test () +static int +do_test (void) +{ +#ifdef USE_TLS + static const char modname1[] = "tst-tlsmod3.so"; + static const char modname2[] = "tst-tlsmod4.so"; + int result = 0; + int (*fp1) (void); + int (*fp2) (int, int *); + void *h1; + void *h2; + int i; + int modid1 = -1; + int modid2 = -1; + int *bazp; + + for (i = 0; i < 10; ++i) + { + h1 = dlopen (modname1, RTLD_LAZY); + if (h1 == NULL) + { + printf ("cannot open '%s': %s\n", modname1, dlerror ()); + exit (1); + } + + /* Dirty test code here: we peek into a private data structure. + We make sure that the module gets assigned the same ID every + time. The value of the first round is used. */ + if (modid1 == -1) + modid1 = ((struct link_map *) h1)->l_tls_modid; + else if (((struct link_map *) h1)->l_tls_modid != modid1) + { + printf ("round %d: modid now %d, initially %d\n", + i, ((struct link_map *) h1)->l_tls_modid, modid1); + result = 1; + } + + fp1 = dlsym (h1, "in_dso2"); + if (fp1 == NULL) + { + printf ("cannot get symbol 'in_dso2' in %s\n", modname1); + exit (1); + } + + result |= fp1 (); + + + + h2 = dlopen (modname2, RTLD_LAZY); + if (h2 == NULL) + { + printf ("cannot open '%s': %s\n", modname2, dlerror ()); + exit (1); + } + + /* Dirty test code here: we peek into a private data structure. + We make sure that the module gets assigned the same ID every + time. The value of the first round is used. */ + if (modid2 == -1) + modid2 = ((struct link_map *) h1)->l_tls_modid; + else if (((struct link_map *) h1)->l_tls_modid != modid2) + { + printf ("round %d: modid now %d, initially %d\n", + i, ((struct link_map *) h1)->l_tls_modid, modid2); + result = 1; + } + + bazp = dlsym (h2, "baz"); + if (bazp == NULL) + { + printf ("cannot get symbol 'baz' in %s\n", modname2); + exit (1); + } + + *bazp = 42 + i; + + fp2 = dlsym (h2, "in_dso"); + if (fp2 == NULL) + { + printf ("cannot get symbol 'in_dso' in %s\n", modname2); + exit (1); + } + + result |= fp2 (42 + i, bazp); + + dlclose (h1); + dlclose (h2); + + + h1 = dlopen (modname1, RTLD_LAZY); + if (h1 == NULL) + { + printf ("cannot open '%s': %s\n", modname1, dlerror ()); + exit (1); + } + + /* Dirty test code here: we peek into a private data structure. + We make sure that the module gets assigned the same ID every + time. The value of the first round is used. */ + if (((struct link_map *) h1)->l_tls_modid != modid1) + { + printf ("round %d: modid now %d, initially %d\n", + i, ((struct link_map *) h1)->l_tls_modid, modid1); + result = 1; + } + + fp1 = dlsym (h1, "in_dso2"); + if (fp1 == NULL) + { + printf ("cannot get symbol 'in_dso2' in %s\n", modname1); + exit (1); + } + + result |= fp1 (); + + + + h2 = dlopen (modname2, RTLD_LAZY); + if (h2 == NULL) + { + printf ("cannot open '%s': %s\n", modname2, dlerror ()); + exit (1); + } + + /* Dirty test code here: we peek into a private data structure. + We make sure that the module gets assigned the same ID every + time. The value of the first round is used. */ + if (((struct link_map *) h1)->l_tls_modid != modid2) + { + printf ("round %d: modid now %d, initially %d\n", + i, ((struct link_map *) h1)->l_tls_modid, modid2); + result = 1; + } + + bazp = dlsym (h2, "baz"); + if (bazp == NULL) + { + printf ("cannot get symbol 'baz' in %s\n", modname2); + exit (1); + } + + *bazp = 62 + i; + + fp2 = dlsym (h2, "in_dso"); + if (fp2 == NULL) + { + printf ("cannot get symbol 'in_dso' in %s\n", modname2); + exit (1); + } + + result |= fp2 (62 + i, bazp); + + /* This time the dlclose calls are in reverse order. */ + dlclose (h2); + dlclose (h1); + } + + return result; +#else + return 0; +#endif +} + + +#include "../test-skeleton.c" diff -durpN glibc-2.2.5/elf/tst-tlsmod1.c glibc-2.3/elf/tst-tlsmod1.c --- glibc-2.2.5/elf/tst-tlsmod1.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tlsmod1.c 2002-08-25 15:26:48.000000000 -0700 @@ -0,0 +1,68 @@ +#include + +#include + +#ifdef USE_TLS +#include "tls-macros.h" + + +/* One define int variable, two externs. */ +COMMON_INT_DEF(foo); +VAR_INT_DEF(bar); +VAR_INT_DECL(baz); +#endif + +extern int in_dso (void); + +int +in_dso (void) +{ + int result = 0; +#ifdef USE_TLS + int *ap, *bp, *cp; + + /* Get variables using initial exec model. */ + fputs ("get sum of foo and bar (IE)", stdout); + asm ("" ::: "memory"); + ap = TLS_IE (foo); + bp = TLS_IE (bar); + printf (" = %d\n", *ap + *bp); + result |= *ap + *bp != 3; + if (*ap != 1) + { + printf ("foo = %d\n", *ap); + result = 1; + } + if (*bp != 2) + { + printf ("bar = %d\n", *bp); + result = 1; + } + + + /* Get variables using generic dynamic model. */ + fputs ("get sum of foo and bar and baz (GD)", stdout); + ap = TLS_GD (foo); + bp = TLS_GD (bar); + cp = TLS_GD (baz); + printf (" = %d\n", *ap + *bp + *cp); + result |= *ap + *bp + *cp != 6; + if (*ap != 1) + { + printf ("foo = %d\n", *ap); + result = 1; + } + if (*bp != 2) + { + printf ("bar = %d\n", *bp); + result = 1; + } + if (*cp != 3) + { + printf ("baz = %d\n", *cp); + result = 1; + } +#endif + + return result; +} diff -durpN glibc-2.2.5/elf/tst-tlsmod2.c glibc-2.3/elf/tst-tlsmod2.c --- glibc-2.2.5/elf/tst-tlsmod2.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tlsmod2.c 2002-08-25 15:28:31.000000000 -0700 @@ -0,0 +1,38 @@ +#include + +#include + +#ifdef USE_TLS +#include "tls-macros.h" + + +COMMON_INT_DEF(foo); + + +int +in_dso (int n, int *caller_foop) +{ + int *foop; + int result = 0; + + puts ("foo"); /* Make sure PLT is used before macros. */ + asm ("" ::: "memory"); + + foop = TLS_GD (foo); + + if (caller_foop != NULL && foop != caller_foop) + { + printf ("callers address of foo differs: %p vs %p\n", caller_foop, foop); + result = 1; + } + else if (*foop != n) + { + printf ("foo != %d\n", n); + result = 1; + } + + *foop = 16; + + return result; +} +#endif diff -durpN glibc-2.2.5/elf/tst-tlsmod3.c glibc-2.3/elf/tst-tlsmod3.c --- glibc-2.2.5/elf/tst-tlsmod3.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tlsmod3.c 2002-08-25 15:29:13.000000000 -0700 @@ -0,0 +1,41 @@ +#include + +#include + +#ifdef USE_TLS +# include "tls-macros.h" + +extern int in_dso (int n, int *caller_foop); + +COMMON_INT_DEF(comm_n); + + + + +int +in_dso2 (void) +{ + int *foop; + int result = 0; + static int n; + int *np; + + puts ("foo"); /* Make sure PLT is used before macros. */ + asm ("" ::: "memory"); + + foop = TLS_GD (foo); + np = TLS_GD (comm_n); + + if (n != *np) + { + printf ("n = %d != comm_n = %d\n", n, *np); + result = 1; + } + + result |= in_dso (*foop = 42 + n++, foop); + + *foop = 16; + + return result; +} +#endif diff -durpN glibc-2.2.5/elf/tst-tlsmod4.c glibc-2.3/elf/tst-tlsmod4.c --- glibc-2.2.5/elf/tst-tlsmod4.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/elf/tst-tlsmod4.c 2002-08-25 15:30:01.000000000 -0700 @@ -0,0 +1,38 @@ +#include + +#include + +#ifdef USE_TLS +# include "tls-macros.h" + + +COMMON_INT_DEF(baz); + + +int +in_dso (int n, int *caller_bazp) +{ + int *bazp; + int result = 0; + + puts ("foo"); /* Make sure PLT is used before macros. */ + asm ("" ::: "memory"); + + bazp = TLS_GD (baz); + + if (caller_bazp != NULL && bazp != caller_bazp) + { + printf ("callers address of baz differs: %p vs %p\n", caller_bazp, bazp); + result = 1; + } + else if (*bazp != n) + { + printf ("baz != %d\n", n); + result = 1; + } + + *bazp = 16; + + return result; +} +#endif diff -durpN glibc-2.2.5/elf/Versions glibc-2.3/elf/Versions --- glibc-2.2.5/elf/Versions 2001-12-06 00:10:06.000000000 -0800 +++ glibc-2.3/elf/Versions 2002-08-19 21:08:04.000000000 -0700 @@ -1,7 +1,5 @@ libc { GLIBC_2.0 { - # functions used in other libraries - _dl_open; _dl_close; _dl_addr; %ifdef EXPORT_UNWIND_FIND_FDE __register_frame_info; __deregister_frame_info; %endif @@ -10,13 +8,6 @@ libc { # functions used in other libraries _dl_mcount_wrapper; _dl_mcount_wrapper_check; } - GLIBC_2.2 { - # this is defined in ld.so and overridden by libc - _dl_init_first; - - # functions used in other libraries - _dl_sym; _dl_vsym; - } GLIBC_2.2.4 { dl_iterate_phdr; } @@ -26,53 +17,40 @@ libc { __register_frame_info_table_bases; _Unwind_Find_FDE; } %endif + GLIBC_PRIVATE { + # functions used in other libraries + _dl_open; _dl_close; _dl_addr; + _dl_sym; _dl_vsym; + } } ld { GLIBC_2.0 { - # global variables - _dl_debug_fd; - - # Those are in the dynamic linker, but used by libc.so. - __libc_enable_secure; _dl_catch_error; _dl_check_all_versions; - _dl_debug_initialize; _dl_debug_state; _dl_default_scope; - _dl_global_scope_end; _dl_lookup_symbol; - _dl_map_object; _dl_map_object_deps; _dl_object_relocation_scope; - _dl_relocate_object; _dl_signal_error; _dl_starting_up; - _dl_sysdep_start; _r_debug; - _dl_global_scope; _dl_lookup_symbol_skip; - _dl_lookup_versioned_symbol; _dl_lookup_versioned_symbol_skip; - # Function from libc.so which must be shared with libc. - calloc; free; malloc; realloc; - } - GLIBC_2.1 { - # global variables - _dl_profile; _dl_profile_map; _dl_profile_output; _dl_start_profile; - _dl_loaded; _dl_main_searchlist; _dl_fpu_control; _dl_initial_searchlist; - _dl_global_scope_alloc; __libc_stack_end; + calloc; free; malloc; realloc; __libc_memalign; - # functions used in other libraries - _dl_mcount; _dl_unload_cache; + _r_debug; } - GLIBC_2.1.1 { - # global variables - _dl_lazy; _dl_origin_path; _dl_platformlen; - + GLIBC_2.1 { # functions used in other libraries - _dl_dst_count; _dl_dst_substitute; + _dl_mcount; } - GLIBC_2.2 { - _dl_init; _dl_load_lock; _dl_argv; _dl_nloaded; _dl_check_map_versions; - - # this is defined in ld.so and overridden by libc - _dl_init_first; - - # variables used elsewhere - _dl_out_of_memory; _dl_all_dirs; _dl_init_all_dirs; - _dl_clktck; _dl_pagesize; + GLIBC_2.3 { + # runtime interface to TLS + __tls_get_addr; } - GLIBC_2.2.3 { - _dl_debug_mask; _dl_debug_printf; + GLIBC_PRIVATE { + # Those are in the dynamic linker, but used by libc.so. + __libc_enable_secure; __libc_stack_end; + _dl_argv; _dl_catch_error; _dl_check_map_versions; + _dl_debug_printf; _dl_debug_state; _dl_dst_count; + _dl_dst_substitute; _dl_init; _dl_lookup_symbol; _dl_lookup_symbol_skip; + _dl_lookup_versioned_symbol; _dl_lookup_versioned_symbol_skip; + _dl_map_object; _dl_map_object_deps; _dl_out_of_memory; + _dl_relocate_object; _dl_signal_error; _dl_start_profile; _dl_starting_up; + _dl_unload_cache; + _rtld_global; _dl_tls_symaddr; _dl_allocate_tls; _dl_deallocate_tls; + _dl_get_tls_static_info; + _dl_get_origin; } } diff -durpN glibc-2.2.5/extra-lib.mk glibc-2.3/extra-lib.mk --- glibc-2.2.5/extra-lib.mk 1999-07-20 01:14:55.000000000 -0700 +++ glibc-2.3/extra-lib.mk 2002-04-09 00:59:14.000000000 -0700 @@ -6,7 +6,7 @@ # to be included in that library. A sysdep Makefile can add to # $(lib)-sysdep_routines to include additional modules. -lib := $(firstword $(extra-libs-left)) +override lib := $(firstword $(extra-libs-left)) extra-libs-left := $(filter-out $(lib),$(extra-libs-left)) object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes)) @@ -78,3 +78,13 @@ $(objpfx)$(lib).so: $(firstword $($(lib) endif endif + +cpp-srcs-left = $(lib)-routines +ifneq (,$($(lib)-routines)) +cpp-srcs-left = $($(lib)-routines) +include $(patsubst %,$(..)cppflags-iterator.mk,$($(lib)-routines)) +endif +ifneq (,$($(lib)-sysdep_routines)) +cpp-srcs-left = $($(lib)-sysdep_routines) +include $(patsubst %,$(..)cppflags-iterator.mk,$($(lib)-sysdep_routines)) +endif diff -durpN glibc-2.2.5/FAQ glibc-2.3/FAQ --- glibc-2.2.5/FAQ 2001-05-11 06:09:38.000000000 -0700 +++ glibc-2.3/FAQ 2002-10-02 17:58:40.000000000 -0700 @@ -12,7 +12,7 @@ understand what you are undertaking befo If you have any questions you think should be answered in this document, please let me know. - --drepper@cygnus.com + --drepper@redhat.com ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ @@ -47,6 +47,7 @@ please let me know. 1.19. `make' complains about a missing dlfcn/libdl.so when building malloc/libmemprof.so. How can I fix this? 1.20. Which tools should I use for MIPS? +1.21. Which compiler should I use for powerpc64? 2. Installation and configuration issues @@ -116,6 +117,9 @@ please let me know. 2.33. The makefiles want to do a CVS commit. 2.34. When compiling C++ programs, I get a compilation error in streambuf.h. 2.35. When recompiling GCC, I get compilation errors in libio. +2.36. Why shall glibc never get installed on GNU/Linux systems in +/usr/local? +2.37. When recompiling GCC, I get compilation errors in libstdc++. 3. Source and binary incompatibilities, and what to do about them @@ -206,6 +210,7 @@ in the future, are: m68k-*-linux-gnu Linux-2.x on Motorola 680x0 alpha*-*-linux-gnu Linux-2.x on DEC Alpha powerpc-*-linux-gnu Linux and MkLinux on PowerPC systems + powerpc64-*-linux-gnu Linux-2.4+ on 64-bit PowerPC systems sparc-*-linux-gnu Linux-2.x on SPARC sparc64-*-linux-gnu Linux-2.x on UltraSPARC arm-*-none ARM standalone systems @@ -242,8 +247,7 @@ a local mirror first. You should always try to use the latest official release. Older versions may not have all the features GNU libc requires. The current releases of -gcc (2.95 or newer) should work with the GNU C library (for powerpc see -question 1.5; for ARM see question 1.6; for MIPS see question 1.20). +gcc (3.2 or newer) should work with the GNU C library (for MIPS see question 1.20). Please note that gcc 2.95 and 2.95.x cannot compile glibc on Alpha due to problems in the complex float support. @@ -277,19 +281,12 @@ them. 1.5. Which compiler should I use for powerpc? -{GK} You want to use at least gcc 2.95 (together with the right versions -of all the other tools, of course). See also question 2.8. +{} Removed. Does not apply anymore. 1.6. Which tools should I use for ARM? -{PB} You should use egcs 1.1 or a later version. For ELF systems some -changes are needed to the compiler; a patch against egcs-1.1.x can be found -at: - - - -Binutils 2.10.1 or later is also required. +{} Removed. Does not apply anymore. 1.7. Do I need some more things to compile the GNU C Library? @@ -495,9 +492,7 @@ test in the sources. There are some failures which are not directly related to the GNU libc: - Some compilers produce buggy code. No compiler gets single precision - complex numbers correct on Alpha. Otherwise, the egcs 1.1 release should be - ok; gcc 2.8.1 might cause some failures; gcc 2.7.2.x is so buggy that - explicit checks have been used so that you can't build with it. + complex numbers correct on Alpha. Otherwise, gcc-3.2 should be ok. - The kernel might have bugs. For example on Linux/Alpha 2.0.34 the floating point handling has quite a number of bugs and therefore most of the test cases in the math subdirectory will fail. Linux 2.2 has @@ -560,8 +555,8 @@ newer. 1.20. Which tools should I use for MIPS? -{AJ} You should use the current development version of gcc 3.0 or newer from -CVS. gcc 2.95.x does not work correctly on mips-linux. +{AJ} You should use the current development version of gcc 3.2 or newer from +CVS. You need also recent binutils, anything before and including 2.11 will not work correctly. Either try the Linux binutils 2.11.90.0.5 from HJ Lu or the @@ -573,6 +568,12 @@ doesn't handle all cases and needs help For details check also my page . + +1.21. Which compiler should I use for powerpc64? + +{SM} You want to use at least gcc 3.2 (together with the right versions +of all the other tools, of course). + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @@ -833,7 +834,7 @@ you got with your distribution. glibc 2.x? {AJ} There's only correct support for glibc 2.0.x in gcc 2.7.2.3 or later. -But you should get at least gcc 2.95.2.1 (or later versions) instead. +But you should get at least gcc 2.95.3 (or later versions) anyway 2.10. The `gencat' utility cannot process the catalog sources which @@ -854,7 +855,7 @@ files to the XPG4 form: ----------------------------------------------------------------------- # Change catalog source in Linux specific format to standard XPG format. -# Ulrich Drepper , 1996. +# Ulrich Drepper , 1996. # /^\$ #/ { h @@ -1246,7 +1247,8 @@ repository. {BH} You are using g++ 2.95.2? After upgrading to glibc 2.2, you need to apply a patch to the include files in /usr/include/g++, because the fpos_t type has changed in glibc 2.2. The patch is at -http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff + + http://www.haible.de/bruno/gccinclude-glibc-2.2-compat.diff 2.35. When recompiling GCC, I get compilation errors in libio. @@ -1255,6 +1257,29 @@ http://clisp.cons.org/~haible/gccinclude This version is needed because the fpos_t type and a few libio internals have changed in glibc 2.2, and gcc 2.95.3 contains a corresponding patch. + +2.36. Why shall glibc never get installed on GNU/Linux systems in +/usr/local? + +{AJ} The GNU C compiler treats /usr/local/include and /usr/local/lib in a +special way, these directories will be searched before the system +directories. Since on GNU/Linux the system directories /usr/include and +/usr/lib contain a --- possibly different --- version of glibc and mixing +certain files from different glibc installations is not supported and will +break, you risk breaking your complete system. If you want to test a glibc +installation, use another directory as argument to --prefix. If you like to +install this glibc version as default version, overriding the existing one, +use --prefix=/usr and everything will go in the right places. + + +2.37. When recompiling GCC, I get compilation errors in libstdc++. + +{BH} You are trying to recompile gcc 3.2? You need to patch gcc 3.2, +because some last minute changes were made in glibc 2.3 which were not +known when gcc 3.2 was released. The patch is at + + http://www.haible.de/bruno/gcc-3.2-glibc-2.3-compat.diff + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @@ -1916,6 +1941,7 @@ Answers were given by: {CG} Cristian Gafton, {AO} Alexandre Oliva, {BH} Bruno Haible, +{SM} Steven Munroe, Local Variables: mode:outline diff -durpN glibc-2.2.5/FAQ.in glibc-2.3/FAQ.in --- glibc-2.2.5/FAQ.in 2001-05-11 06:08:56.000000000 -0700 +++ glibc-2.3/FAQ.in 2002-10-02 16:27:50.000000000 -0700 @@ -12,7 +12,7 @@ understand what you are undertaking befo If you have any questions you think should be answered in this document, please let me know. - --drepper@cygnus.com + --drepper@redhat.com ? Compiling glibc @@ -30,6 +30,7 @@ in the future, are: m68k-*-linux-gnu Linux-2.x on Motorola 680x0 alpha*-*-linux-gnu Linux-2.x on DEC Alpha powerpc-*-linux-gnu Linux and MkLinux on PowerPC systems + powerpc64-*-linux-gnu Linux-2.4+ on 64-bit PowerPC systems sparc-*-linux-gnu Linux-2.x on SPARC sparc64-*-linux-gnu Linux-2.x on UltraSPARC arm-*-none ARM standalone systems @@ -65,8 +66,7 @@ a local mirror first. You should always try to use the latest official release. Older versions may not have all the features GNU libc requires. The current releases of -gcc (2.95 or newer) should work with the GNU C library (for powerpc see -?powerpc; for ARM see ?arm; for MIPS see ?mips). +gcc (3.2 or newer) should work with the GNU C library (for MIPS see ?mips). Please note that gcc 2.95 and 2.95.x cannot compile glibc on Alpha due to problems in the complex float support. @@ -97,18 +97,11 @@ them. ??powerpc Which compiler should I use for powerpc? -{GK} You want to use at least gcc 2.95 (together with the right versions -of all the other tools, of course). See also ?excpt. +{} Removed. Does not apply anymore. ??arm Which tools should I use for ARM? -{PB} You should use egcs 1.1 or a later version. For ELF systems some -changes are needed to the compiler; a patch against egcs-1.1.x can be found -at: - - - -Binutils 2.10.1 or later is also required. +{} Removed. Does not apply anymore. ?? Do I need some more things to compile the GNU C Library? @@ -304,9 +297,7 @@ test in the sources. There are some failures which are not directly related to the GNU libc: - Some compilers produce buggy code. No compiler gets single precision - complex numbers correct on Alpha. Otherwise, the egcs 1.1 release should be - ok; gcc 2.8.1 might cause some failures; gcc 2.7.2.x is so buggy that - explicit checks have been used so that you can't build with it. + complex numbers correct on Alpha. Otherwise, gcc-3.2 should be ok. - The kernel might have bugs. For example on Linux/Alpha 2.0.34 the floating point handling has quite a number of bugs and therefore most of the test cases in the math subdirectory will fail. Linux 2.2 has @@ -366,8 +357,8 @@ newer. ??mips Which tools should I use for MIPS? -{AJ} You should use the current development version of gcc 3.0 or newer from -CVS. gcc 2.95.x does not work correctly on mips-linux. +{AJ} You should use the current development version of gcc 3.2 or newer from +CVS. You need also recent binutils, anything before and including 2.11 will not work correctly. Either try the Linux binutils 2.11.90.0.5 from HJ Lu or the @@ -379,6 +370,11 @@ doesn't handle all cases and needs help For details check also my page . +??powerpc64 Which compiler should I use for powerpc64? + +{SM} You want to use at least gcc 3.2 (together with the right versions +of all the other tools, of course). + ? Installation and configuration issues ?? Can I replace the libc on my Linux system with GNU libc? @@ -629,7 +625,7 @@ you got with your distribution. glibc 2.x? {AJ} There's only correct support for glibc 2.0.x in gcc 2.7.2.3 or later. -But you should get at least gcc 2.95.2.1 (or later versions) instead. +But you should get at least gcc 2.95.3 (or later versions) anyway ?? The `gencat' utility cannot process the catalog sources which were used on my Linux libc5 based system. Why? @@ -649,7 +645,7 @@ files to the XPG4 form: ----------------------------------------------------------------------- # Change catalog source in Linux specific format to standard XPG format. -# Ulrich Drepper , 1996. +# Ulrich Drepper , 1996. # /^\$ #/ { h @@ -1019,7 +1015,8 @@ repository. {BH} You are using g++ 2.95.2? After upgrading to glibc 2.2, you need to apply a patch to the include files in /usr/include/g++, because the fpos_t type has changed in glibc 2.2. The patch is at -http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff + + http://www.haible.de/bruno/gccinclude-glibc-2.2-compat.diff ?? When recompiling GCC, I get compilation errors in libio. @@ -1027,6 +1024,26 @@ http://clisp.cons.org/~haible/gccinclude This version is needed because the fpos_t type and a few libio internals have changed in glibc 2.2, and gcc 2.95.3 contains a corresponding patch. +?? Why shall glibc never get installed on GNU/Linux systems in +/usr/local? + +{AJ} The GNU C compiler treats /usr/local/include and /usr/local/lib in a +special way, these directories will be searched before the system +directories. Since on GNU/Linux the system directories /usr/include and +/usr/lib contain a --- possibly different --- version of glibc and mixing +certain files from different glibc installations is not supported and will +break, you risk breaking your complete system. If you want to test a glibc +installation, use another directory as argument to --prefix. If you like to +install this glibc version as default version, overriding the existing one, +use --prefix=/usr and everything will go in the right places. + +?? When recompiling GCC, I get compilation errors in libstdc++. + +{BH} You are trying to recompile gcc 3.2? You need to patch gcc 3.2, +because some last minute changes were made in glibc 2.3 which were not +known when gcc 3.2 was released. The patch is at + + http://www.haible.de/bruno/gcc-3.2-glibc-2.3-compat.diff ? Source and binary incompatibilities, and what to do about them @@ -1655,6 +1672,7 @@ Answers were given by: {CG} Cristian Gafton, {AO} Alexandre Oliva, {BH} Bruno Haible, +{SM} Steven Munroe, Local Variables: mode:outline diff -durpN glibc-2.2.5/glibcbug.in glibc-2.3/glibcbug.in --- glibc-2.2.5/glibcbug.in 2001-04-18 13:03:28.000000000 -0700 +++ glibc-2.3/glibcbug.in 2002-07-16 11:13:13.000000000 -0700 @@ -21,17 +21,16 @@ BUILD_PROFILE="@profile@" BUILD_OMITFP="@omitfp@" BUILD_BOUNDED="@bounded@" BUILD_STATIC_NSS="@static_nss@" -STDIO="@stdio@" -TEMP=`mktemp -q /tmp/glibcbugXXXXXX 2>/dev/null` +TEMP=`mktemp -q ${TMPDIR-/tmp}/glibcbugXXXXXX 2>/dev/null` if test $? -ne 0; then - TEMP=/tmp/glibcbug.$$ + TEMP=${TMPDIR-/tmp}/glibcbug.$$ echo > $TEMP chmod 600 $TEMP fi -TEMPx=`mktemp -q /tmp/glibcbugXXXXXX 2>/dev/null` +TEMPx=`mktemp -q ${TMPDIR-/tmp}/glibcbugXXXXXX 2>/dev/null` if test $? -ne 0; then - TEMPx=/tmp/glibcbug.$$.x + TEMPx=${TMPDIR-/tmp}/glibcbug.$$.x echo > $TEMPx chmod 600 $TEMPx fi @@ -163,7 +162,6 @@ ${ORGANIZATION- $ORGANIZATION_C} `[ -n "$BUILD_OMITFP" ] && echo Build omitfp: $BUILD_OMITFP` `[ -n "$BUILD_BOUNDED" ] && echo Build bounded: $BUILD_BOUNDED` `[ -n "$BUILD_STATIC_NSS" ] && echo Build static-nss: $BUILD_STATIC_NSS` -`[ -n "$STDIO" ] && echo Stdio: $STDIO` >Description: $DESCRIPTION_C diff -durpN glibc-2.2.5/gmon/bb_exit_func.c glibc-2.3/gmon/bb_exit_func.c --- glibc-2.2.5/gmon/bb_exit_func.c 2001-07-17 01:18:41.000000000 -0700 +++ glibc-2.3/gmon/bb_exit_func.c 2002-03-12 16:58:55.000000000 -0800 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1996,1997,1998,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger (davidm@cs.arizona.edu). @@ -31,6 +31,9 @@ #define OUT_NAME "gmon.out" +extern struct __bb *__bb_head attribute_hidden; + + void __bb_exit_func (void) { diff -durpN glibc-2.2.5/gmon/gmon.c glibc-2.3/gmon/gmon.c --- glibc-2.2.5/gmon/gmon.c 2001-08-17 00:57:23.000000000 -0700 +++ glibc-2.3/gmon/gmon.c 2002-08-29 02:16:19.000000000 -0700 @@ -47,9 +47,10 @@ # include #endif -struct __bb *__bb_head; /* Head of basic-block list or NULL. */ +/* Head of basic-block list or NULL. */ +struct __bb *__bb_head attribute_hidden; -struct gmonparam _gmonparam = { GMON_PROF_OFF }; +struct gmonparam _gmonparam attribute_hidden = { GMON_PROF_OFF }; /* * See profil(2) where this is described: @@ -140,9 +141,9 @@ __monstartup (lowpc, highpc) } p->tos = (struct tostruct *)cp; cp += p->tossize; - p->kcount = (u_short *)cp; + p->kcount = (HISTCOUNTER *)cp; cp += p->kcountsize; - p->froms = (u_short *)cp; + p->froms = (ARCINDEX *)cp; p->tos[0].link = 0; @@ -211,7 +212,8 @@ write_call_graph (fd) u_char tag = GMON_TAG_CG_ARC; struct gmon_cg_arc_record raw_arc[NARCS_PER_WRITEV] __attribute__ ((aligned (__alignof__ (char*)))); - int from_index, to_index, from_len; + ARCINDEX from_index, to_index; + int from_len; u_long frompc; struct iovec iov[2 * NARCS_PER_WRITEV]; int nfilled; @@ -319,18 +321,22 @@ write_gmon (void) int fd = -1; char *env; +#ifndef O_NOFOLLOW +# define O_NOFOLLOW 0 +#endif + env = getenv ("GMON_OUT_PREFIX"); if (env != NULL && !__libc_enable_secure) { size_t len = strlen (env); char buf[len + 20]; sprintf (buf, "%s.%u", env, __getpid ()); - fd = __open (buf, O_CREAT|O_TRUNC|O_WRONLY, 0666); + fd = __open (buf, O_CREAT|O_TRUNC|O_WRONLY|O_NOFOLLOW, 0666); } if (fd == -1) { - fd = __open ("gmon.out", O_CREAT|O_TRUNC|O_WRONLY, 0666); + fd = __open ("gmon.out", O_CREAT|O_TRUNC|O_WRONLY|O_NOFOLLOW, 0666); if (fd < 0) { char buf[300]; diff -durpN glibc-2.2.5/gmon/Makefile glibc-2.3/gmon/Makefile --- glibc-2.2.5/gmon/Makefile 2001-07-05 21:54:46.000000000 -0700 +++ glibc-2.3/gmon/Makefile 2002-03-11 02:15:35.000000000 -0800 @@ -1,4 +1,4 @@ -# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc. +# Copyright (C) 1995, 1996, 1997, 2001, 2002 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -25,6 +25,8 @@ headers := sys/gmon.h sys/gmon_out.h sys distribute := machine-gmon.h profil-counter.h routines := gmon mcount profil sprofil bb_init_func bb_exit_func prof-freq +elide-routines.os = bb_init_func bb_exit_func + tests := tst-sprofil include ../Rules diff -durpN glibc-2.2.5/gmon/mcount.c glibc-2.3/gmon/mcount.c --- glibc-2.2.5/gmon/mcount.c 1999-06-08 13:46:21.000000000 -0700 +++ glibc-2.3/gmon/mcount.c 2002-08-29 02:25:51.000000000 -0700 @@ -31,6 +31,7 @@ static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93"; #endif +#include #include #include @@ -57,10 +58,10 @@ static char sccsid[] = "@(#)mcount.c 8.1 */ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */ { - register u_short *frompcindex; + register ARCINDEX *frompcindex; register struct tostruct *top, *prevtop; register struct gmonparam *p; - register long toindex; + register ARCINDEX toindex; int i; p = &_gmonparam; diff -durpN glibc-2.2.5/gmon/sys/gmon.h glibc-2.3/gmon/sys/gmon.h --- glibc-2.2.5/gmon/sys/gmon.h 1999-10-09 14:18:35.000000000 -0700 +++ glibc-2.3/gmon/sys/gmon.h 2002-08-29 02:16:19.000000000 -0700 @@ -96,17 +96,43 @@ extern struct __bb *__bb_head; #define HASHFRACTION 2 /* - * percent of text space to allocate for tostructs with a minimum. + * Percent of text space to allocate for tostructs. + * This is a heuristic; we will fail with a warning when profiling programs + * with a very large number of very small functions, but that's + * normally OK. + * 2 is probably still a good value for normal programs. + * Profiling a test case with 64000 small functions will work if + * you raise this value to 3 and link statically (which bloats the + * text size, thus raising the number of arcs expected by the heuristic). + */ +#define ARCDENSITY 3 + +/* + * Always allocate at least this many tostructs. This + * hides the inadequacy of the ARCDENSITY heuristic, at least + * for small programs. */ -#define ARCDENSITY 2 #define MINARCS 50 -#define MAXARCS ((1 << (8 * sizeof(HISTCOUNTER))) - 2) + +/* + * The type used to represent indices into gmonparam.tos[]. + */ +#define ARCINDEX u_long + +/* + * Maximum number of arcs we want to allow. + * Used to be max representable value of ARCINDEX minus 2, but now + * that ARCINDEX is a long, that's too large; we don't really want + * to allow a 48 gigabyte table. + * The old value of 1<<16 wasn't high enough in practice for large C++ + * programs; will 1<<20 be adequate for long? FIXME + */ +#define MAXARCS (1 << 20) struct tostruct { - u_long selfpc; - long count; - u_short link; - u_short pad; + u_long selfpc; + long count; + ARCINDEX link; }; /* @@ -132,7 +158,7 @@ struct gmonparam { long int state; u_short *kcount; u_long kcountsize; - u_short *froms; + ARCINDEX *froms; u_long fromssize; struct tostruct *tos; u_long tossize; @@ -143,7 +169,6 @@ struct gmonparam { u_long hashfraction; long log_hashfraction; }; -extern struct gmonparam _gmonparam; /* * Possible states of profiling. diff -durpN glibc-2.2.5/grp/initgroups.c glibc-2.3/grp/initgroups.c --- glibc-2.2.5/grp/initgroups.c 2001-07-05 21:54:46.000000000 -0700 +++ glibc-2.3/grp/initgroups.c 2002-03-13 09:49:14.000000000 -0800 @@ -1,4 +1,4 @@ -/* Copyright (C) 1989,91,93,1996-1999,2000,01 Free Software Foundation, Inc. +/* Copyright (C) 1989,91,93,1996-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -45,7 +45,7 @@ extern int __nss_group_lookup (service_u void **fctp); extern void *__nss_lookup_function (service_user *ni, const char *fct_name); -extern service_user *__nss_group_database; +extern service_user *__nss_group_database attribute_hidden; static enum nss_status compat_call (service_user *nip, const char *user, gid_t group, long int *start, @@ -176,7 +176,7 @@ internal_getgrouplist (const char *user, /* This is really only for debugging. */ if (NSS_STATUS_TRYAGAIN > status || status > NSS_STATUS_RETURN) - __libc_fatal ("illegal status in " __FUNCTION__); + __libc_fatal ("illegal status in internal_getgrouplist"); if (status != NSS_STATUS_SUCCESS && nss_next_action (nip, status) == NSS_ACTION_RETURN) @@ -214,7 +214,7 @@ getgrouplist (const char *user, gid_t gr } else *ngroups = result; - + memcpy (groups, newgroups, *ngroups * sizeof (gid_t)); free (newgroups); diff -durpN glibc-2.2.5/hesiod/nss_hesiod/hesiod-grp.c glibc-2.3/hesiod/nss_hesiod/hesiod-grp.c --- glibc-2.2.5/hesiod/nss_hesiod/hesiod-grp.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hesiod/nss_hesiod/hesiod-grp.c 2002-08-25 23:23:22.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Mark Kettenis , 1997. @@ -57,6 +57,7 @@ lookup (const char *name, const char *ty char **list; int parse_res; size_t len; + int olderr = errno; context = _nss_hesiod_init (); if (context == NULL) @@ -65,8 +66,10 @@ lookup (const char *name, const char *ty list = hesiod_resolve (context, name, type); if (list == NULL) { + int err = errno; hesiod_end (context); - return errno == ENOENT ? NSS_STATUS_NOTFOUND : NSS_STATUS_UNAVAIL; + __set_errno (olderr); + return err == ENOENT ? NSS_STATUS_NOTFOUND : NSS_STATUS_UNAVAIL; } linebuflen = buffer + buflen - data->linebuffer; @@ -85,7 +88,10 @@ lookup (const char *name, const char *ty parse_res = _nss_files_parse_grent (buffer, grp, data, buflen, errnop); if (parse_res < 1) - return parse_res == -1 ? NSS_STATUS_TRYAGAIN : NSS_STATUS_NOTFOUND; + { + __set_errno (olderr); + return parse_res == -1 ? NSS_STATUS_TRYAGAIN : NSS_STATUS_NOTFOUND; + } return NSS_STATUS_SUCCESS; } diff -durpN glibc-2.2.5/hesiod/nss_hesiod/hesiod-proto.c glibc-2.3/hesiod/nss_hesiod/hesiod-proto.c --- glibc-2.2.5/hesiod/nss_hesiod/hesiod-proto.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hesiod/nss_hesiod/hesiod-proto.c 2002-08-25 23:26:10.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Mark Kettenis , 1997. @@ -67,6 +67,7 @@ lookup (const char *name, const char *ty char **list, **item; int parse_res; int found; + int olderr = errno; context = _nss_hesiod_init (); if (context == NULL) @@ -75,8 +76,10 @@ lookup (const char *name, const char *ty list = hesiod_resolve (context, name, type); if (list == NULL) { + int err = errno; hesiod_end (context); - return errno == ENOENT ? NSS_STATUS_NOTFOUND : NSS_STATUS_UNAVAIL; + __set_errno (olderr); + return err == ENOENT ? NSS_STATUS_NOTFOUND : NSS_STATUS_UNAVAIL; } linebuflen = buffer + buflen - data->linebuffer; @@ -115,7 +118,13 @@ lookup (const char *name, const char *ty hesiod_free_list (context, list); hesiod_end (context); - return found ? NSS_STATUS_SUCCESS : NSS_STATUS_NOTFOUND; + if (found == 0) + { + __set_errno (olderr); + return NSS_STATUS_NOTFOUND; + } + + return NSS_STATUS_SUCCESS; } enum nss_status diff -durpN glibc-2.2.5/hesiod/nss_hesiod/hesiod-pwd.c glibc-2.3/hesiod/nss_hesiod/hesiod-pwd.c --- glibc-2.2.5/hesiod/nss_hesiod/hesiod-pwd.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hesiod/nss_hesiod/hesiod-pwd.c 2002-08-25 23:27:25.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Mark Kettenis , 1997. @@ -55,6 +55,7 @@ lookup (const char *name, const char *ty char **list; int parse_res; size_t len; + int olderr = errno; context = _nss_hesiod_init (); if (context == NULL) @@ -63,8 +64,10 @@ lookup (const char *name, const char *ty list = hesiod_resolve (context, name, type); if (list == NULL) { + int err = errno; hesiod_end (context); - return errno == ENOENT ? NSS_STATUS_NOTFOUND : NSS_STATUS_UNAVAIL; + __set_errno (olderr); + return err == ENOENT ? NSS_STATUS_NOTFOUND : NSS_STATUS_UNAVAIL; } linebuflen = buffer + buflen - data->linebuffer; @@ -83,7 +86,10 @@ lookup (const char *name, const char *ty parse_res = _nss_files_parse_pwent (buffer, pwd, data, buflen, errnop); if (parse_res < 1) - return parse_res == -1 ? NSS_STATUS_TRYAGAIN : NSS_STATUS_NOTFOUND; + { + __set_errno (olderr); + return parse_res == -1 ? NSS_STATUS_TRYAGAIN : NSS_STATUS_NOTFOUND; + } return NSS_STATUS_SUCCESS; } diff -durpN glibc-2.2.5/hesiod/nss_hesiod/hesiod-service.c glibc-2.3/hesiod/nss_hesiod/hesiod-service.c --- glibc-2.2.5/hesiod/nss_hesiod/hesiod-service.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hesiod/nss_hesiod/hesiod-service.c 2002-08-25 23:28:51.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Mark Kettenis , 1997. @@ -68,6 +68,7 @@ lookup (const char *name, const char *ty char **list, **item; int parse_res; int found; + int olderr = errno; context = _nss_hesiod_init (); if (context == NULL) @@ -76,8 +77,10 @@ lookup (const char *name, const char *ty list = hesiod_resolve (context, name, type); if (list == NULL) { + int err = errno; hesiod_end (context); - return errno == ENOENT ? NSS_STATUS_NOTFOUND : NSS_STATUS_UNAVAIL; + __set_errno (olderr); + return err == ENOENT ? NSS_STATUS_NOTFOUND : NSS_STATUS_UNAVAIL; } linebuflen = buffer + buflen - data->linebuffer; @@ -116,7 +119,13 @@ lookup (const char *name, const char *ty hesiod_free_list (context, list); hesiod_end (context); - return found ? NSS_STATUS_SUCCESS : NSS_STATUS_NOTFOUND; + if (found == 0) + { + __set_errno (olderr); + return NSS_STATUS_NOTFOUND; + } + + return NSS_STATUS_SUCCESS; } enum nss_status diff -durpN glibc-2.2.5/hesiod/Versions glibc-2.3/hesiod/Versions --- glibc-2.2.5/hesiod/Versions 2000-07-23 18:23:33.000000000 -0700 +++ glibc-2.3/hesiod/Versions 2002-02-01 13:16:41.000000000 -0800 @@ -1,13 +1,11 @@ libnss_hesiod { - GLIBC_2.1 { + GLIBC_PRIVATE { _nss_hesiod_setpwent; _nss_hesiod_endpwent; _nss_hesiod_getpwnam_r; _nss_hesiod_getpwuid_r; _nss_hesiod_setgrent; _nss_hesiod_endgrent; _nss_hesiod_getgrnam_r; _nss_hesiod_getgrgid_r; _nss_hesiod_setservent; _nss_hesiod_endservent; _nss_hesiod_getservbyname_r; - } - GLIBC_2.2 { _nss_hesiod_initgroups_dyn; _nss_hesiod_getservbyport_r; _nss_hesiod_setprotoent; _nss_hesiod_endprotoent; diff -durpN glibc-2.2.5/hurd/catch-exc.c glibc-2.3/hurd/catch-exc.c --- glibc-2.2.5/hurd/catch-exc.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/catch-exc.c 2002-04-07 23:54:18.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1994,95,96,97,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,6 +18,7 @@ #include #include +#include /* Called by the microkernel when a thread gets an exception. */ @@ -25,9 +26,15 @@ kern_return_t _S_catch_exception_raise (mach_port_t port, thread_t thread, task_t task, - int exception, - int code, - int subcode) +#ifdef EXC_MASK_ALL /* New interface flavor. */ + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t codeCnt +#else /* Vanilla Mach 3.0 interface. */ + integer_t exception, + integer_t code, integer_t subcode +#endif + ) { struct hurd_sigstate *ss; int signo; @@ -38,8 +45,14 @@ _S_catch_exception_raise (mach_port_t po return EPERM; d.exc = exception; +#ifdef EXC_MASK_ALL + assert (codeCnt >= 2); + d.exc_code = code[0]; + d.exc_subcode = code[1]; +#else d.exc_code = code; d.exc_subcode = subcode; +#endif /* Call the machine-dependent function to translate the Mach exception codes into a signal number and subcode. */ @@ -79,3 +92,41 @@ _S_catch_exception_raise (mach_port_t po return KERN_SUCCESS; } + +#ifdef EXC_MASK_ALL +/* XXX New interface flavor has additional RPCs that we could be using + instead. These RPCs roll a thread_get_state/thread_set_state into + the message, so the signal thread ought to use these to save some calls. + */ +kern_return_t +_S_catch_exception_raise_state (mach_port_t port, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t codeCnt, + int *flavor, + thread_state_t old_state, + mach_msg_type_number_t old_stateCnt, + thread_state_t new_state, + mach_msg_type_number_t *new_stateCnt) +{ + abort (); + return KERN_FAILURE; +} + +kern_return_t +_S_catch_exception_raise_state_identity (mach_port_t exception_port, + thread_t thread, + task_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t codeCnt, + int *flavor, + thread_state_t old_state, + mach_msg_type_number_t old_stateCnt, + thread_state_t new_state, + mach_msg_type_number_t *new_stateCnt) +{ + abort (); + return KERN_FAILURE; +} +#endif diff -durpN glibc-2.2.5/hurd/errno.c glibc-2.3/hurd/errno.c --- glibc-2.2.5/hurd/errno.c 1969-12-31 16:00:00.000000000 -0800 +++ glibc-2.3/hurd/errno.c 2002-03-11 13:28:21.000000000 -0800 @@ -0,0 +1,28 @@ +/* __errno_location -- helper function for locating per-thread errno value + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + +int * +__errno_location (void) +{ + return (int *) __hurd_threadvar_location (_HURD_THREADVAR_ERRNO); +} +strong_alias (__errno_location, __hurd_errno_location) diff -durpN glibc-2.2.5/hurd/fd-read.c glibc-2.3/hurd/fd-read.c --- glibc-2.2.5/hurd/fd-read.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/fd-read.c 2002-06-12 13:57:22.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,94,95,97,99 Free Software Foundation, Inc. +/* Copyright (C) 1993,94,95,97,99,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,7 +23,7 @@ #include error_t -_hurd_fd_read (struct hurd_fd *fd, void *buf, size_t *nbytes, off_t offset) +_hurd_fd_read (struct hurd_fd *fd, void *buf, size_t *nbytes, loff_t offset) { error_t err; char *data; diff -durpN glibc-2.2.5/hurd/fd-write.c glibc-2.3/hurd/fd-write.c --- glibc-2.2.5/hurd/fd-write.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/fd-write.c 2002-06-12 13:57:22.000000000 -0700 @@ -1,5 +1,5 @@ /* _hurd_fd_write -- write to a file descriptor; handles job control et al. - Copyright (C) 1993,94,95,97,99 Free Software Foundation, Inc. + Copyright (C) 1993,94,95,97,99,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,7 +24,7 @@ error_t _hurd_fd_write (struct hurd_fd *fd, - const void *buf, size_t *nbytes, off_t offset) + const void *buf, size_t *nbytes, loff_t offset) { error_t err; mach_msg_type_number_t wrote; diff -durpN glibc-2.2.5/hurd/fopenport.c glibc-2.3/hurd/fopenport.c --- glibc-2.2.5/hurd/fopenport.c 2001-11-13 02:06:41.000000000 -0800 +++ glibc-2.3/hurd/fopenport.c 2002-06-12 13:57:22.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1994,95,97,2000,01 Free Software Foundation, Inc. +/* Copyright (C) 1994,95,97,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -70,23 +70,8 @@ seekio (void *cookie, #endif int whence) { - off_t res; - error_t error; - - /* XXX We don't really support large files on the Hurd. So if POS - doesn't fit in an `off_t', we'll return `-1' and set errno. EOVERFLOW - probably isn't the right error value, but seems appropriate here. */ - if ((off_t) *pos != *pos) - { - __set_errno (EOVERFLOW); - return -1; - } - - error = __io_seek ((file_t) cookie, *pos, whence, &res); - if (error) - return __hurd_fail (error); - *pos = res; - return 0; + error_t err = __io_seek ((file_t) cookie, *pos, whence, pos); + return err ? __hurd_fail (err) : 0; } /* Close the file associated with COOKIE. diff -durpN glibc-2.2.5/hurd/hurd/fd.h glibc-2.3/hurd/hurd/fd.h --- glibc-2.2.5/hurd/hurd/fd.h 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurd/fd.h 2002-06-12 13:57:23.000000000 -0700 @@ -1,5 +1,6 @@ /* File descriptors. - Copyright (C) 1993,94,95,96,97,98,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1993,94,95,96,97,98,99,2000,01,02 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -214,9 +215,9 @@ extern error_t _hurd_fd_close (struct hu If successful, stores the amount actually read or written in *NBYTES. */ extern error_t _hurd_fd_read (struct hurd_fd *fd, - void *buf, size_t *nbytes, off_t offset); + void *buf, size_t *nbytes, loff_t offset); extern error_t _hurd_fd_write (struct hurd_fd *fd, - const void *buf, size_t *nbytes, off_t offset); + const void *buf, size_t *nbytes, loff_t offset); /* Call *RPC on PORT and/or CTTY; if a call on CTTY returns EBACKGROUND, diff -durpN glibc-2.2.5/hurd/hurd/signal.h glibc-2.3/hurd/hurd/signal.h --- glibc-2.2.5/hurd/hurd/signal.h 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurd/signal.h 2002-02-18 23:34:26.000000000 -0800 @@ -1,5 +1,5 @@ /* Implementing POSIX.1 signals under the Hurd. - Copyright (C) 1993, 94, 95, 96, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1993,94,95,96,98,99,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,6 +38,7 @@ #include #include /* For `struct mutex'. */ +#include /* For `jmp_buf'. */ #include #include /* We cache sigstate in a threadvar. */ struct hurd_signal_preemptor; /* */ @@ -204,7 +205,7 @@ _hurd_critical_section_unlock (void *our __spin_unlock (&ss->critical_section_lock); pending = ss->pending & ~ss->blocked; __spin_unlock (&ss->lock); - if (pending) + if (! __sigisemptyset (&pending)) /* There are unblocked signals pending, which weren't delivered because we were in the critical section. Tell the signal thread to deliver them now. */ diff -durpN glibc-2.2.5/hurd/hurd/threadvar.h glibc-2.3/hurd/hurd/threadvar.h --- glibc-2.2.5/hurd/hurd/threadvar.h 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurd/threadvar.h 2002-09-02 11:48:03.000000000 -0700 @@ -1,5 +1,5 @@ /* Internal per-thread variables for the Hurd. - Copyright (C) 1994,95,97,98,99,2001 Free Software Foundation, Inc. + Copyright (C) 1994,95,97,98,99,2001,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,6 +20,8 @@ #ifndef _HURD_THREADVAR_H #define _HURD_THREADVAR_H +#include + /* The per-thread variables are found by ANDing this mask with the value of the stack pointer and then adding this offset. @@ -63,6 +65,10 @@ enum __hurd_threadvar_index _HURD_THREADVAR_MALLOC, /* For use of malloc. */ _HURD_THREADVAR_DL_ERROR, /* For use of -ldl and dynamic linker. */ _HURD_THREADVAR_RPC_VARS, /* For state of RPC functions. */ + _HURD_THREADVAR_LOCALE, /* For thread-local locale setting. */ + _HURD_THREADVAR_CTYPE_B, /* Cache of thread-local locale data. */ + _HURD_THREADVAR_CTYPE_TOLOWER, /* Cache of thread-local locale data. */ + _HURD_THREADVAR_CTYPE_TOUPPER, /* Cache of thread-local locale data. */ _HURD_THREADVAR_MAX /* Default value for __hurd_threadvar_max. */ }; @@ -94,7 +100,7 @@ __hurd_threadvar_location_from_sp (enum per-thread variable with index INDEX. */ extern unsigned long int * -__hurd_threadvar_location (enum __hurd_threadvar_index __index) +__hurd_threadvar_location (enum __hurd_threadvar_index __index) __THROW /* This declaration tells the compiler that the value is constant given the same argument. We assume this won't be called twice from the same stack frame by different threads. */ @@ -107,14 +113,5 @@ __hurd_threadvar_location (enum __hurd_t __thread_stack_pointer ()); } -/* Return the current thread's location for `errno'. - The syntax of this function allows redeclarations like `int errno'. */ -extern int *__hurd_errno_location (void); - -_HURD_THREADVAR_H_EXTERN_INLINE int * -__hurd_errno_location (void) -{ - return (int *) __hurd_threadvar_location (_HURD_THREADVAR_ERRNO); -} #endif /* hurd/threadvar.h */ diff -durpN glibc-2.2.5/hurd/hurdchdir.c glibc-2.3/hurd/hurdchdir.c --- glibc-2.2.5/hurd/hurdchdir.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurdchdir.c 2002-05-14 13:46:02.000000000 -0700 @@ -1,5 +1,5 @@ /* Change a port cell to a directory by looking up a name. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999,2001,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -36,11 +36,11 @@ _hurd_change_directory_port_from_name (s /* Append trailing "/." to directory name to force ENOTDIR if it's not a directory and EACCES if we don't have search permission. */ len = strlen (name); - if (name[len - 2] == '/' && name[len - 1] == '.') + if (len >= 2 && name[len - 2] == '/' && name[len - 1] == '.') lookup = name; else { - char *n = alloca (len + 2); + char *n = alloca (len + 3); memcpy (n, name, len); n[len] = '/'; n[len + 1] = '.'; diff -durpN glibc-2.2.5/hurd/hurdexec.c glibc-2.3/hurd/hurdexec.c --- glibc-2.2.5/hurd/hurdexec.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurdexec.c 2002-05-14 13:46:02.000000000 -0700 @@ -1,4 +1,5 @@ -/* Copyright (C) 1991,92,93,94,95,96,97,99,2001 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,93,94,95,96,97,99,2001,02 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,6 +26,7 @@ #include #include #include +#include #include #include @@ -41,12 +43,17 @@ _hurd_exec (task_t task, file_t file, int ints[INIT_INT_MAX]; mach_port_t ports[_hurd_nports]; struct hurd_userlink ulink_ports[_hurd_nports]; + inline void free_port (unsigned int i) + { + _hurd_port_free (&_hurd_ports[i], &ulink_ports[i], ports[i]); + } file_t *dtable; unsigned int dtablesize, i; struct hurd_port **dtable_cells; struct hurd_userlink *ulink_dtable; struct hurd_sigstate *ss; mach_port_t *please_dealloc, *pdp; + int reauth = 0; /* XXX needs to be hurdmalloc XXX */ if (argv == NULL) @@ -67,7 +74,7 @@ _hurd_exec (task_t task, file_t file, if (err = __USEPORT (PROC, __proc_task2proc (port, task, &ports[i]))) { while (--i > 0) - _hurd_port_free (&_hurd_ports[i], &ulink_ports[i], ports[i]); + free_port (i); goto outenv; } } @@ -132,7 +139,7 @@ _hurd_exec (task_t task, file_t file, them, the new program would have duplicate user references for them. But we cannot deallocate them ourselves, because we must still have them after a failed exec call. */ - please_dealloc = __alloca ((_hurd_nports + (2 * dtablesize)) + please_dealloc = __alloca ((_hurd_nports + 3 + (3 * dtablesize)) * sizeof (mach_port_t)); else please_dealloc = NULL; @@ -190,55 +197,199 @@ _hurd_exec (task_t task, file_t file, while (dtablesize > 0 && dtable[dtablesize - 1] == MACH_PORT_NULL) --dtablesize; - /* The information is all set up now. Try to exec the file. */ + /* See if we need to diddle the auth port of the new program. + The purpose of this is to get the effect setting the saved-set UID and + GID to the respective effective IDs after the exec, as POSIX.1 requires. + Note that we don't reauthenticate with the proc server; that would be a + no-op since it only keeps track of the effective UIDs, and if it did + keep track of the available IDs we would have the problem that we'd be + changing the IDs before the exec and have to change them back after a + failure. Arguably we could skip all the reauthentications because the + available IDs have no bearing on any filesystem. But the conservative + approach is to reauthenticate all the io ports so that no state anywhere + reflects that our whole ID set differs from what we've set it to. */ + __mutex_lock (&_hurd_id.lock); + err = _hurd_check_ids (); + if (err == 0 && ((_hurd_id.aux.nuids >= 2 && _hurd_id.gen.nuids >= 1 + && _hurd_id.aux.uids[1] != _hurd_id.gen.uids[0]) + || (_hurd_id.aux.ngids >= 2 && _hurd_id.gen.ngids >= 1 + && _hurd_id.aux.gids[1] != _hurd_id.gen.gids[0]))) + { + /* We have euid != svuid or egid != svgid. POSIX.1 says that exec + sets svuid = euid and svgid = egid. So we must get a new auth + port and reauthenticate everything with it. We'll pass the new + ports in file_exec instead of our own ports. */ - { - int flags; + auth_t newauth; - if (pdp) - { - /* Request the exec server to deallocate some ports from us if the exec - succeeds. The init ports and descriptor ports will arrive in the - new program's exec_startup message. If we failed to deallocate - them, the new program would have duplicate user references for them. - But we cannot deallocate them ourselves, because we must still have - them after a failed exec call. */ + _hurd_id.aux.uids[1] = _hurd_id.gen.uids[0]; + _hurd_id.aux.gids[1] = _hurd_id.gen.gids[0]; + _hurd_id.valid = 0; + if (_hurd_id.rid_auth != MACH_PORT_NULL) + { + __mach_port_deallocate (__mach_task_self (), _hurd_id.rid_auth); + _hurd_id.rid_auth = MACH_PORT_NULL; + } - for (i = 0; i < _hurd_nports; ++i) - *pdp++ = ports[i]; - for (i = 0; i < dtablesize; ++i) - *pdp++ = dtable[i]; - } + err = __auth_makeauth (ports[INIT_PORT_AUTH], + NULL, MACH_MSG_TYPE_COPY_SEND, 0, + _hurd_id.gen.uids, _hurd_id.gen.nuids, + _hurd_id.aux.uids, _hurd_id.aux.nuids, + _hurd_id.gen.gids, _hurd_id.gen.ngids, + _hurd_id.aux.gids, _hurd_id.aux.ngids, + &newauth); + if (err == 0) + { + /* Now we have to reauthenticate the ports with this new ID. + */ - flags = 0; + inline error_t reauth_io (io_t port, io_t *newport) + { + mach_port_t ref = __mach_reply_port (); + *newport = MACH_PORT_NULL; + error_t err = __io_reauthenticate (port, + ref, MACH_MSG_TYPE_MAKE_SEND); + if (!err) + err = __auth_user_authenticate (newauth, + ref, MACH_MSG_TYPE_MAKE_SEND, + newport); + __mach_port_destroy (__mach_task_self (), ref); + return err; + } + inline void reauth_port (unsigned int idx) + { + io_t newport; + err = reauth_io (ports[idx], &newport) ?: err; + if (pdp) + *pdp++ = ports[idx]; /* XXX presumed still in _hurd_ports */ + free_port (idx); + ports[idx] = newport; + } + + if (pdp) + *pdp++ = ports[INIT_PORT_AUTH]; + free_port (INIT_PORT_AUTH); + ports[INIT_PORT_AUTH] = newauth; + + reauth_port (INIT_PORT_CRDIR); + reauth_port (INIT_PORT_CWDIR); + + if (!err) + { + /* Now we'll reauthenticate each file descriptor. */ + if (ulink_dtable == NULL) + { + assert (dtable == _hurd_init_dtable); + dtable = __alloca (dtablesize * sizeof (dtable[0])); + for (i = 0; i < dtablesize; ++i) + if (_hurd_init_dtable[i] != MACH_PORT_NULL) + { + if (pdp) + *pdp++ = _hurd_init_dtable[i]; + err = reauth_io (_hurd_init_dtable[i], &dtable[i]); + if (err) + { + while (++i < dtablesize) + dtable[i] = MACH_PORT_NULL; + break; + } + } + else + dtable[i] = MACH_PORT_NULL; + } + else + { + if (pdp) + { + /* Ask to deallocate all the old fd ports, + since we will have new ones in DTABLE. */ + memcpy (pdp, dtable, dtablesize * sizeof pdp[0]); + pdp += dtablesize; + } + for (i = 0; i < dtablesize; ++i) + if (dtable[i] != MACH_PORT_NULL) + { + io_t newport; + err = reauth_io (dtable[i], &newport); + _hurd_port_free (dtable_cells[i], &ulink_dtable[i], + dtable[i]); + dtable[i] = newport; + if (err) + { + while (++i < dtablesize) + _hurd_port_free (dtable_cells[i], + &ulink_dtable[i], dtable[i]); + break; + } + } + ulink_dtable = NULL; + dtable_cells = NULL; + } + } + } + + reauth = 1; + } + __mutex_unlock (&_hurd_id.lock); + + /* The information is all set up now. Try to exec the file. */ + if (!err) + { + int flags; + + if (pdp) + { + /* Request the exec server to deallocate some ports from us if + the exec succeeds. The init ports and descriptor ports will + arrive in the new program's exec_startup message. If we + failed to deallocate them, the new program would have + duplicate user references for them. But we cannot deallocate + them ourselves, because we must still have them after a failed + exec call. */ + + for (i = 0; i < _hurd_nports; ++i) + *pdp++ = ports[i]; + for (i = 0; i < dtablesize; ++i) + *pdp++ = dtable[i]; + } + + flags = 0; #ifdef EXEC_SIGTRAP - /* PTRACE_TRACEME sets all bits in _hurdsig_traced, which is propagated - through exec by INIT_TRACEMASK, so this checks if PTRACE_TRACEME has - been called in this process in any of its current or prior lives. */ - if (__sigismember (&_hurdsig_traced, SIGKILL)) - flags |= EXEC_SIGTRAP; + /* PTRACE_TRACEME sets all bits in _hurdsig_traced, which is + propagated through exec by INIT_TRACEMASK, so this checks if + PTRACE_TRACEME has been called in this process in any of its + current or prior lives. */ + if (__sigismember (&_hurdsig_traced, SIGKILL)) + flags |= EXEC_SIGTRAP; #endif - err = __file_exec (file, task, flags, - args, argslen, env, envlen, - dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize, - ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports, - ints, INIT_INT_MAX, - please_dealloc, pdp - please_dealloc, - &_hurd_msgport, task == __mach_task_self () ? 1 : 0); - } + err = __file_exec (file, task, flags, + args, argslen, env, envlen, + dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize, + ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports, + ints, INIT_INT_MAX, + please_dealloc, pdp - please_dealloc, + &_hurd_msgport, task == __mach_task_self () ? 1 : 0); + } /* Release references to the standard ports. */ for (i = 0; i < _hurd_nports; ++i) - if (i == INIT_PORT_PROC && task != __mach_task_self ()) + if ((i == INIT_PORT_PROC && task != __mach_task_self ()) + || (reauth && (i == INIT_PORT_AUTH + || i == INIT_PORT_CRDIR || i == INIT_PORT_CWDIR))) __mach_port_deallocate (__mach_task_self (), ports[i]); else - _hurd_port_free (&_hurd_ports[i], &ulink_ports[i], ports[i]); + free_port (i); + /* Release references to the file descriptor ports. */ if (ulink_dtable != NULL) - /* Release references to the file descriptor ports. */ + { + for (i = 0; i < dtablesize; ++i) + if (dtable[i] != MACH_PORT_NULL) + _hurd_port_free (dtable_cells[i], &ulink_dtable[i], dtable[i]); + } + else if (dtable && dtable != _hurd_init_dtable) for (i = 0; i < dtablesize; ++i) - if (dtable[i] != MACH_PORT_NULL) - _hurd_port_free (dtable_cells[i], &ulink_dtable[i], dtable[i]); + __mach_port_deallocate (__mach_task_self (), dtable[i]); /* Release lock on the file descriptor table. */ __mutex_unlock (&_hurd_dtable_lock); diff -durpN glibc-2.2.5/hurd/hurdfault.c glibc-2.3/hurd/hurdfault.c --- glibc-2.2.5/hurd/hurdfault.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurdfault.c 2002-04-07 23:54:18.000000000 -0700 @@ -1,5 +1,5 @@ /* Handle faults in the signal thread. - Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1994,95,96,97,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,9 +40,15 @@ kern_return_t _hurdsig_fault_catch_exception_raise (mach_port_t port, thread_t thread, task_t task, - int exception, - int code, - int subcode) +#ifdef EXC_MASK_ALL /* New interface flavor. */ + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t codeCnt +#else /* Vanilla Mach 3.0 interface. */ + integer_t exception, + integer_t code, integer_t subcode +#endif + ) { int signo; struct hurd_signal_detail d; @@ -52,8 +58,14 @@ _hurdsig_fault_catch_exception_raise (ma return EPERM; /* Strange bogosity. */ d.exc = exception; +#ifdef EXC_MASK_ALL + assert (codeCnt >= 2); + d.exc_code = code[0]; + d.exc_subcode = code[1]; +#else d.exc_code = code; d.exc_subcode = subcode; +#endif /* Call the machine-dependent function to translate the Mach exception codes into a signal number and subcode. */ @@ -63,6 +75,51 @@ _hurdsig_fault_catch_exception_raise (ma ? 0 : EGREGIOUS; } +#ifdef EXC_MASK_ALL +/* XXX New interface flavor has additional RPCs that we could be using + instead. These RPCs roll a thread_get_state/thread_set_state into + the message, so the signal thread ought to use these to save some calls. + */ +kern_return_t +_hurdsig_fault_catch_exception_raise_state +(mach_port_t port, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t codeCnt, + int *flavor, + thread_state_t old_state, + mach_msg_type_number_t old_stateCnt, + thread_state_t new_state, + mach_msg_type_number_t *new_stateCnt) +{ + abort (); + return KERN_FAILURE; +} + +kern_return_t +_hurdsig_fault_catch_exception_raise_state_identity +(mach_port_t exception_port, + thread_t thread, + task_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t codeCnt, + int *flavor, + thread_state_t old_state, + mach_msg_type_number_t old_stateCnt, + thread_state_t new_state, + mach_msg_type_number_t *new_stateCnt) +{ + abort (); + return KERN_FAILURE; +} +#endif + + +#ifdef NDR_CHAR_ASCII /* OSF Mach flavors have different names. */ +# define mig_reply_header_t mig_reply_error_t +#endif + static void faulted (void) { @@ -71,12 +128,7 @@ faulted (void) mach_msg_header_t head; char buf[64]; } request; - struct - { - mach_msg_header_t head; - mach_msg_type_t type; - int result; - } reply; + mig_reply_header_t reply; extern int _hurdsig_fault_exc_server (mach_msg_header_t *, mach_msg_header_t *); @@ -90,14 +142,14 @@ faulted (void) /* Run the exc demuxer which should call the server function above. That function returns 0 if the exception was expected. */ - _hurdsig_fault_exc_server (&request.head, &reply.head); - if (reply.head.msgh_remote_port != MACH_PORT_NULL) - __mach_msg (&reply.head, MACH_SEND_MSG, reply.head.msgh_size, + _hurdsig_fault_exc_server (&request.head, &reply.Head); + if (reply.Head.msgh_remote_port != MACH_PORT_NULL) + __mach_msg (&reply.Head, MACH_SEND_MSG, reply.Head.msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - if (reply.result == MIG_BAD_ID) + if (reply.RetCode == MIG_BAD_ID) __mach_msg_destroy (&request.head); - if (reply.result) + if (reply.RetCode) __libc_fatal ("BUG: unexpected fault in signal thread\n"); _hurdsig_fault_preemptor.signals = 0; @@ -136,7 +188,18 @@ _hurdsig_fault_init (void) /* Set the queue limit for this port to just one. The proc server will notice if we ever get a second exception while one remains queued and unreceived, and decide we are hopelessly buggy. */ +#ifdef MACH_PORT_RECEIVE_STATUS_COUNT + { + const mach_port_limits_t lim = { mpl_qlimit: 1 }; + assert (MACH_PORT_RECEIVE_STATUS_COUNT == sizeof lim / sizeof (natural_t)); + err = __mach_port_set_attributes (__mach_task_self (), forward_sigexc, + MACH_PORT_RECEIVE_STATUS, + (mach_port_info_t) &lim, + MACH_PORT_RECEIVE_STATUS_COUNT); + } +#else err = __mach_port_set_qlimit (__mach_task_self (), forward_sigexc, 1); +#endif assert_perror (err); /* This state will be restored when we fault. @@ -156,8 +219,20 @@ _hurdsig_fault_init (void) assert_perror (err); /* Direct signal thread exceptions to the proc server. */ +#ifdef THREAD_EXCEPTION_PORT err = __thread_set_special_port (_hurd_msgport_thread, THREAD_EXCEPTION_PORT, sigexc); +#elif defined (EXC_MASK_ALL) + __thread_set_exception_ports (_hurd_msgport_thread, + EXC_MASK_ALL & ~(EXC_MASK_SYSCALL + | EXC_MASK_MACH_SYSCALL + | EXC_MASK_RPC_ALERT), + sigexc, + EXCEPTION_STATE_IDENTITY, + MACHINE_THREAD_STATE); +#else +# error thread_set_exception_ports? +#endif __mach_port_deallocate (__mach_task_self (), sigexc); assert_perror (err); } diff -durpN glibc-2.2.5/hurd/hurdfchdir.c glibc-2.3/hurd/hurdfchdir.c --- glibc-2.2.5/hurd/hurdfchdir.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurdfchdir.c 2002-05-14 13:46:02.000000000 -0700 @@ -1,5 +1,5 @@ /* Change a port cell to a directory in an open file descriptor. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,8 +38,11 @@ _hurd_change_directory_port_from_fd (str ret = HURD_PORT_USE (&d->port, ({ int ret; + /* We look up "." to force ENOTDIR if it's not a + directory and EACCES if we don't have search + permission. */ file_t dir = __file_name_lookup_under (port, ".", - 0, 0); + O_NOTRANS, 0); if (dir == MACH_PORT_NULL) ret = -1; else diff -durpN glibc-2.2.5/hurd/hurd.h glibc-2.3/hurd/hurd.h --- glibc-2.2.5/hurd/hurd.h 2002-01-20 19:20:51.000000000 -0800 +++ glibc-2.3/hurd/hurd.h 2002-01-02 14:22:46.000000000 -0800 @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,94,95,96,97,98,99,2001 Free Software Foundation, Inc. +/* Copyright (C) 1993,94,95,96,97,98,99,2001,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -299,9 +299,9 @@ extern error_t hurd_sig_post (pid_t pid, other than the proc server (such as a bootstrap filesystem) can set these variables to install the ports. */ -extern kern_return_t __get_privileged_ports (host_priv_t *host_priv_ptr, +extern kern_return_t __get_privileged_ports (mach_port_t *host_priv_ptr, device_t *device_master_ptr); -extern kern_return_t get_privileged_ports (host_priv_t *host_priv_ptr, +extern kern_return_t get_privileged_ports (mach_port_t *host_priv_ptr, device_t *device_master_ptr); extern mach_port_t _hurd_host_priv, _hurd_device_master; diff -durpN glibc-2.2.5/hurd/hurdinit.c glibc-2.3/hurd/hurdinit.c --- glibc-2.2.5/hurd/hurdinit.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurdinit.c 2002-05-14 13:46:02.000000000 -0700 @@ -1,4 +1,5 @@ -/* Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc. +/* Copyright (C) 1992,93,94,95,96,97,98,99,2000,01 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -39,11 +40,19 @@ int __libc_argc; error_t _hurd_ports_use (int which, error_t (*operate) (mach_port_t)) { + if (__builtin_expect (_hurd_ports == NULL, 0)) + /* This means that _hurd_init has not been called yet, which is + normally only the case in the bootstrap filesystem, and there + only in the early phases of booting. */ + return EGRATUITOUS; + return HURD_PORT_USE (&_hurd_ports[which], (*operate) (port)); } DEFINE_HOOK (_hurd_subinit, (void)); +__typeof (_hurd_proc_init) _hurd_new_proc_init; /* below */ + /* Initialize the library data structures from the ints and ports passed to us by the exec server. @@ -82,7 +91,7 @@ _hurd_init (int flags, char **argv, /* Tell the proc server we exist, if it does. */ if (portarray[INIT_PORT_PROC] != MACH_PORT_NULL) - _hurd_proc_init (argv, intarray, intarraysize); + _hurd_new_proc_init (argv, intarray, intarraysize); /* All done with init ints and ports. */ __vm_deallocate (__mach_task_self (), @@ -159,7 +168,7 @@ _hurd_new_proc_init (char **argv, while. Eventually it probably makes most sense for the exec server to mask out EXEC_SIGTRAP so the debugged program is closer to not being able to tell it's being debugged. */ - if (_hurdsig_traced + if (!__sigisemptyset (&_hurdsig_traced) #ifdef EXEC_SIGTRAP && !(_hurd_exec_flags & EXEC_SIGTRAP) #endif diff -durpN glibc-2.2.5/hurd/hurdioctl.c glibc-2.3/hurd/hurdioctl.c --- glibc-2.2.5/hurd/hurdioctl.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurdioctl.c 2002-04-24 13:09:44.000000000 -0700 @@ -1,5 +1,5 @@ /* ioctl commands which must be done in the C library. - Copyright (C) 1994,95,96,97,99,2001 Free Software Foundation, Inc. + Copyright (C) 1994,95,96,97,99,2001,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -311,7 +311,7 @@ static int siocgifconf (int fd, int request, struct ifconf *ifc) { error_t err; - int data_len = ifc->ifc_len; + size_t data_len = ifc->ifc_len; char *data = ifc->ifc_buf; if (data_len <= 0) diff -durpN glibc-2.2.5/hurd/hurdselect.c glibc-2.3/hurd/hurdselect.c --- glibc-2.2.5/hurd/hurdselect.c 2001-10-28 14:10:26.000000000 -0800 +++ glibc-2.3/hurd/hurdselect.c 2002-04-02 14:20:19.000000000 -0800 @@ -64,6 +64,14 @@ _hurd_select (int nfds, } d[nfds]; sigset_t oset; + union typeword /* Use this to avoid unkosher casts. */ + { + mach_msg_type_t type; + uint32_t word; + }; + assert (sizeof (union typeword) == sizeof (mach_msg_type_t)); + assert (sizeof (uint32_t) == sizeof (mach_msg_type_t)); + if (sigmask && __sigprocmask (SIG_SETMASK, sigmask, &oset)) return -1; @@ -279,20 +287,37 @@ _hurd_select (int nfds, union { mach_msg_header_t head; +#ifdef MACH_MSG_TRAILER_MINIMUM_SIZE struct { mach_msg_header_t head; - mach_msg_type_t err_type; + NDR_record_t ndr; error_t err; } error; struct { mach_msg_header_t head; - mach_msg_type_t err_type; + NDR_record_t ndr; error_t err; - mach_msg_type_t result_type; int result; + mach_msg_trailer_t trailer; } success; +#else + struct + { + mach_msg_header_t head; + union typeword err_type; + error_t err; + } error; + struct + { + mach_msg_header_t head; + union typeword err_type; + error_t err; + union typeword result_type; + int result; + } success; +#endif } msg; mach_msg_option_t options = (timeout == NULL ? 0 : MACH_RCV_TIMEOUT); error_t msgerr; @@ -303,13 +328,19 @@ _hurd_select (int nfds, { /* We got a message. Decode it. */ #define IO_SELECT_REPLY_MSGID (21012 + 100) /* XXX */ - const mach_msg_type_t inttype = - { MACH_MSG_TYPE_INTEGER_T, sizeof (MACH_MSG_TYPE_INTEGER_T) * 8, - 1, 1, 0, 0 }; +#ifdef MACH_MSG_TYPE_BIT + const union typeword inttype = + { type: + { MACH_MSG_TYPE_INTEGER_T, sizeof (integer_t) * 8, 1, 1, 0, 0 } + }; +#endif if (msg.head.msgh_id == IO_SELECT_REPLY_MSGID && msg.head.msgh_size >= sizeof msg.error && !(msg.head.msgh_bits & MACH_MSGH_BITS_COMPLEX) && - *(int *) &msg.error.err_type == *(int *) &inttype) +#ifdef MACH_MSG_TYPE_BIT + msg.error.err_type.word == inttype.word +#endif + ) { /* This is a properly formatted message so far. See if it is a success or a failure. */ @@ -323,7 +354,9 @@ _hurd_select (int nfds, } if (msg.error.err || msg.head.msgh_size != sizeof msg.success || - *(int *) &msg.success.result_type != *(int *) &inttype || +#ifdef MACH_MSG_TYPE_BIT + msg.success.result_type.word != inttype.word || +#endif (msg.success.result & SELECT_ALL) == 0) { /* Error or bogus reply. Simulate readiness. */ diff -durpN glibc-2.2.5/hurd/hurdsig.c glibc-2.3/hurd/hurdsig.c --- glibc-2.2.5/hurd/hurdsig.c 2001-07-27 01:50:55.000000000 -0700 +++ glibc-2.3/hurd/hurdsig.c 2002-08-29 22:20:37.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,01 +/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,01,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -31,6 +31,7 @@ #include "hurdfault.h" #include "hurdmalloc.h" /* XXX */ +#include "../locale/localeinfo.h" const char *_hurdsig_getenv (const char *); @@ -198,7 +199,7 @@ write_corefile (int signo, const struct if (! err && file != MACH_PORT_NULL) /* The core dump into FILE succeeded, so now link it into the directory. */ - err = __dir_link (file, coredir, name, 1); + err = __dir_link (coredir, file, name, 1); __mach_port_deallocate (__mach_task_self (), file); __mach_port_deallocate (__mach_task_self (), coredir); return !err && file != MACH_PORT_NULL; @@ -588,7 +589,7 @@ _hurd_internal_post_signal (struct hurd_ handler = ss->preemptors ? try_preemptor (ss->preemptors) : SIG_ERR; /* If no thread-specific preemptor, check for a global one. */ - if (handler == SIG_ERR && (__sigmask (signo) & _hurdsig_preempted_set)) + if (handler == SIG_ERR && __sigismember (&_hurdsig_preempted_set, signo)) { __mutex_lock (&_hurd_siglock); handler = try_preemptor (_hurdsig_preemptors); @@ -689,7 +690,7 @@ _hurd_internal_post_signal (struct hurd_ if (__sigmask (signo) & STOPSIGS) /* Stop signals clear a pending SIGCONT even if they are handled or ignored (but not if preempted). */ - ss->pending &= ~sigmask (SIGCONT); + __sigdelset (&ss->pending, SIGCONT); else { if (signo == SIGCONT) @@ -928,11 +929,11 @@ _hurd_internal_post_signal (struct hurd_ /* Block requested signals while running the handler. */ scp->sc_mask = ss->blocked; - ss->blocked |= ss->actions[signo].sa_mask; + __sigorset (&ss->blocked, &ss->blocked, &ss->actions[signo].sa_mask); /* Also block SIGNO unless we're asked not to. */ if (! (ss->actions[signo].sa_flags & (SA_RESETHAND | SA_NODEFER))) - ss->blocked |= __sigmask (signo); + __sigaddset (&ss->blocked, signo); /* Reset to SIG_DFL if requested. SIGILL and SIGTRAP cannot be automatically reset when delivered; the system silently @@ -1030,7 +1031,6 @@ _hurd_internal_post_signal (struct hurd_ msg.msgh_local_port = MACH_PORT_NULL; /* These values do not matter. */ msg.msgh_id = 8675309; /* Jenny, Jenny. */ - msg.msgh_seqno = 17; /* Random. */ ss->suspended = MACH_PORT_NULL; err = __mach_msg (&msg, MACH_SEND_MSG, sizeof msg, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, @@ -1266,6 +1266,10 @@ _hurdsig_init (const int *intarray, size malloc (__hurd_threadvar_max * sizeof (unsigned long int)); if (__hurd_sigthread_variables == NULL) __libc_fatal ("hurd: Can't allocate threadvars for signal thread\n"); + memset (__hurd_sigthread_variables, 0, + __hurd_threadvar_max * sizeof (unsigned long int)); + __hurd_sigthread_variables[_HURD_THREADVAR_LOCALE] + = (unsigned long int) &_nl_global_locale; /* Reinitialize the MiG support routines so they will use a per-thread variable for the cached reply port. */ @@ -1300,8 +1304,19 @@ _hurdsig_init (const int *intarray, size } /* Receive exceptions on the signal port. */ +#ifdef TASK_EXCEPTION_PORT __task_set_special_port (__mach_task_self (), TASK_EXCEPTION_PORT, _hurd_msgport); +#elif defined (EXC_MASK_ALL) + __task_set_exception_ports (__mach_task_self (), + EXC_MASK_ALL & ~(EXC_MASK_SYSCALL + | EXC_MASK_MACH_SYSCALL + | EXC_MASK_RPC_ALERT), + _hurd_msgport, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); +#else +# error task_set_exception_port? +#endif /* Sanity check. Any pending, unblocked signals should have been taken by our predecessor incarnation (i.e. parent or pre-exec state) @@ -1348,6 +1363,9 @@ text_set_element (_hurd_reauth_hook, rea const char * _hurdsig_getenv (const char *variable) { + if (__libc_enable_secure) + return NULL; + if (_hurdsig_catch_memory_fault (__environ)) /* We bombed in getenv. */ return NULL; diff -durpN glibc-2.2.5/hurd/hurdstartup.c glibc-2.3/hurd/hurdstartup.c --- glibc-2.2.5/hurd/hurdstartup.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurdstartup.c 2002-06-18 14:12:24.000000000 -0700 @@ -1,5 +1,5 @@ /* Initial program startup for running under the GNU Hurd. - Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc. + Copyright (C) 1991,92,93,94,95,96,97,98,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -55,7 +55,7 @@ extern void __mach_init (void); void -_hurd_startup (void **argptr, void (*main) (int *data)) +_hurd_startup (void **argptr, void (*main) (intptr_t *data)) { error_t err; mach_port_t in_bootstrap; @@ -64,7 +64,7 @@ _hurd_startup (void **argptr, void (*mai struct hurd_startup_data data; char **argv, **envp; int argc, envc; - int *argcptr; + intptr_t *argcptr; vm_address_t addr; /* Attempt to map page zero redzoned before we receive any RPC @@ -107,7 +107,7 @@ _hurd_startup (void **argptr, void (*mai Hopefully either they will be on the stack as expected, or the stack will be zeros so we don't crash. */ - argcptr = (int *) argptr; + argcptr = (intptr_t *) argptr; argc = argcptr[0]; argv = (char **) &argcptr[1]; envp = &argv[argc + 1]; @@ -129,7 +129,7 @@ _hurd_startup (void **argptr, void (*mai pointers and fill them in. We allocate the space for the environment pointers immediately after the argv pointers because the ELF ABI will expect it. */ - argcptr = __alloca (sizeof (int) + + argcptr = __alloca (sizeof (intptr_t) + (argc + 1 + envc + 1) * sizeof (char *) + sizeof (struct hurd_startup_data)); *argcptr = argc; @@ -163,7 +163,7 @@ _hurd_startup (void **argptr, void (*mai hurd_startup_data'. Move them. */ struct { - int count; + intptr_t count; char *argv[argc + 1]; char *envp[envc + 1]; struct hurd_startup_data data; diff -durpN glibc-2.2.5/hurd/hurdstartup.h glibc-2.3/hurd/hurdstartup.h --- glibc-2.2.5/hurd/hurdstartup.h 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/hurdstartup.h 2002-06-18 14:12:24.000000000 -0700 @@ -1,5 +1,5 @@ /* Data from initial program startup for running under the GNU Hurd. - Copyright (C) 1995, 1997 Free Software Foundation, Inc. + Copyright (C) 1995,97,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,6 +20,7 @@ #ifndef _HURDSTARTUP_H #define _HURDSTARTUP_H 1 +# include /* Interesting data saved from the exec_startup reply. The DATA argument to *MAIN (see below) points to: @@ -57,7 +58,7 @@ struct hurd_startup_data of the entry point function that is called with the stack exactly as the exec server or kernel sets it. */ -extern void _hurd_startup (void **argptr, void (*main) (int *data)); +extern void _hurd_startup (void **argptr, void (*main) (intptr_t *data)); #endif /* hurdstartup.h */ diff -durpN glibc-2.2.5/hurd/intr-msg.c glibc-2.3/hurd/intr-msg.c --- glibc-2.2.5/hurd/intr-msg.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/intr-msg.c 2002-02-18 23:34:25.000000000 -0800 @@ -1,5 +1,5 @@ /* Replacement for mach_msg used in interruptible Hurd RPCs. - Copyright (C) 95,96,97,98,99,2000 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,6 +25,9 @@ #include "intr-msg.h" +#ifdef NDR_CHAR_ASCII /* OSF Mach flavors have different names. */ +# define mig_reply_header_t mig_reply_error_t +#endif error_t _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, @@ -40,7 +43,15 @@ _hurd_intr_rpc_mach_msg (mach_msg_header const mach_msg_option_t user_option = option; const mach_msg_timeout_t user_timeout = timeout; - struct clobber { int i[2]; }; + struct clobber + { +#ifdef NDR_CHAR_ASCII + NDR_record_t ndr; +#else + mach_msg_type_t type; +#endif + error_t err; + }; union msg { mach_msg_header_t header; @@ -48,7 +59,11 @@ _hurd_intr_rpc_mach_msg (mach_msg_header struct { mach_msg_header_t header; +#ifdef NDR_CHAR_ASCII + NDR_record_t ndr; +#else int type; +#endif int code; } check; struct @@ -147,8 +162,12 @@ _hurd_intr_rpc_mach_msg (mach_msg_header the message buffer and we might need to clean up the port rights. */ case MACH_SEND_TIMED_OUT: case MACH_SEND_INVALID_NOTIFY: +#ifdef MACH_SEND_NO_NOTIFY case MACH_SEND_NO_NOTIFY: +#endif +#ifdef MACH_SEND_NOTIFY_IN_PROGRESS case MACH_SEND_NOTIFY_IN_PROGRESS: +#endif if (MACH_MSGH_BITS_REMOTE (msg->msgh_bits) == MACH_MSG_TYPE_MOVE_SEND) { __mach_port_deallocate (__mach_task_self (), msg->msgh_remote_port); @@ -159,6 +178,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header } if (msg->msgh_bits & MACH_MSGH_BITS_COMPLEX) { +#ifndef MACH_MSG_PORT_DESCRIPTOR /* Check for MOVE_SEND rights in the message. These hold refs that we need to release in case the message is in fact never re-sent later. Since it might in fact be re-sent, we turn @@ -222,9 +242,68 @@ _hurd_intr_rpc_mach_msg (mach_msg_header &~ (sizeof (mach_msg_type_t) - 1)); } else - clean_ports (*((void **) ty)++, - ty->msgtl_header.msgt_deallocate); + { + clean_ports (*(void **) ty, + ty->msgtl_header.msgt_deallocate); + ++(void **) ty; + } } +#else /* Untyped Mach IPC flavor. */ + mach_msg_body_t *body = (void *) (msg + 1); + mach_msg_descriptor_t *desc = (void *) (body + 1); + mach_msg_descriptor_t *desc_end = desc + body->msgh_descriptor_count; + for (; desc < desc_end; ++desc) + switch (desc->type.type) + { + case MACH_MSG_PORT_DESCRIPTOR: + switch (desc->port.disposition) + { + case MACH_MSG_TYPE_MOVE_SEND: + __mach_port_deallocate (mach_task_self (), + desc->port.name); + desc->port.disposition = MACH_MSG_TYPE_COPY_SEND; + break; + case MACH_MSG_TYPE_COPY_SEND: + case MACH_MSG_TYPE_MOVE_RECEIVE: + break; + default: + assert (! "unexpected port type in interruptible RPC"); + } + break; + case MACH_MSG_OOL_DESCRIPTOR: + if (desc->out_of_line.deallocate) + __vm_deallocate (__mach_task_self (), + (vm_address_t) desc->out_of_line.address, + desc->out_of_line.size); + break; + case MACH_MSG_OOL_PORTS_DESCRIPTOR: + switch (desc->ool_ports.disposition) + { + case MACH_MSG_TYPE_MOVE_SEND: + { + mach_msg_size_t i; + const mach_port_t *ports = desc->ool_ports.address; + for (i = 0; i < desc->ool_ports.count; ++i) + __mach_port_deallocate (__mach_task_self (), ports[i]); + desc->ool_ports.disposition = MACH_MSG_TYPE_COPY_SEND; + break; + } + case MACH_MSG_TYPE_COPY_SEND: + case MACH_MSG_TYPE_MOVE_RECEIVE: + break; + default: + assert (! "unexpected port type in interruptible RPC"); + } + if (desc->ool_ports.deallocate) + __vm_deallocate (__mach_task_self (), + (vm_address_t) desc->ool_ports.address, + desc->ool_ports.count + * sizeof (mach_port_t)); + break; + default: + assert (! "unexpected descriptor type in interruptible RPC"); + } +#endif } break; @@ -282,6 +361,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header case MACH_MSG_SUCCESS: { /* We got a reply. Was it EINTR? */ +#ifdef MACH_MSG_TYPE_BIT const union { mach_msg_type_t t; @@ -289,10 +369,13 @@ _hurd_intr_rpc_mach_msg (mach_msg_header } check = { t: { MACH_MSG_TYPE_INTEGER_T, sizeof (integer_t) * 8, 1, TRUE, FALSE, FALSE, 0 } }; +#endif if (m->reply.RetCode == EINTR && m->header.msgh_size == sizeof m->reply && +#ifdef MACH_MSG_TYPE_BIT m->check.type == check.i && +#endif !(m->header.msgh_bits & MACH_MSGH_BITS_COMPLEX)) { /* It is indeed EINTR. Is the interrupt for us? */ @@ -332,6 +415,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header break; default: /* Quiet -Wswitch-enum. */ + break; } ss->intr_port = MACH_PORT_NULL; diff -durpN glibc-2.2.5/hurd/lookup-retry.c glibc-2.3/hurd/lookup-retry.c --- glibc-2.2.5/hurd/lookup-retry.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/lookup-retry.c 2002-06-12 13:57:22.000000000 -0700 @@ -1,5 +1,5 @@ /* hairy bits of Hurd file name lookup - Copyright (C) 1992,93,94,95,96,97,99,2001 Free Software Foundation, Inc. + Copyright (C) 1992,93,94,95,96,97,99,2001,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -136,7 +136,7 @@ __hurd_file_name_lookup_retry (error_t ( we follow root-owned symlinks; if that is deemed undesireable, we can add a final check for that one exception to our general translator-based rule. */ - struct stat st; + struct stat64 st; err = __io_stat (*result, &st); if (!err && (st.st_mode & (S_IPTRANS|S_IATRANS))) diff -durpN glibc-2.2.5/hurd/Makefile glibc-2.3/hurd/Makefile --- glibc-2.2.5/hurd/Makefile 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/Makefile 2002-03-11 15:37:11.000000000 -0800 @@ -59,6 +59,7 @@ routines = hurdstartup hurdinit \ fopenport \ vpprintf \ ports-get ports-set hurdports hurdmsg \ + errno \ $(sig) $(dtable) $(inlines) port-cleanup report-wait sig = hurdsig hurdfault siginfo hurd-raise preempt-sig \ trampoline longjmp-ts catch-exc exc2signal hurdkill sigunwind \ diff -durpN glibc-2.2.5/hurd/privports.c glibc-2.3/hurd/privports.c --- glibc-2.2.5/hurd/privports.c 2001-11-09 16:11:33.000000000 -0800 +++ glibc-2.3/hurd/privports.c 2002-01-02 14:22:47.000000000 -0800 @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,94,97,2001 Free Software Foundation, Inc. +/* Copyright (C) 1993,94,97,2001,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,7 +25,7 @@ mach_port_t _hurd_host_priv, _hurd_devic kern_return_t -__get_privileged_ports (host_priv_t *host_priv_ptr, +__get_privileged_ports (mach_port_t *host_priv_ptr, device_t *device_master_ptr) { if ((host_priv_ptr && _hurd_host_priv == MACH_PORT_NULL) diff -durpN glibc-2.2.5/hurd/report-wait.c glibc-2.3/hurd/report-wait.c --- glibc-2.2.5/hurd/report-wait.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/hurd/report-wait.c 2002-05-30 15:40:50.000000000 -0700 @@ -1,5 +1,5 @@ /* Report on what a thread in our task is waiting for. - Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1996,97,99,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -105,7 +105,7 @@ weak_alias (default_hurd_itimer_thread, kern_return_t _S_msg_report_wait (mach_port_t msgport, thread_t thread, - string_t description, int *msgid) + string_t description, mach_msg_id_t *msgid) { *msgid = 0; diff -durpN glibc-2.2.5/hurd/Versions glibc-2.3/hurd/Versions --- glibc-2.2.5/hurd/Versions 2001-12-22 12:51:27.000000000 -0800 +++ glibc-2.3/hurd/Versions 2002-03-11 15:37:11.000000000 -0800 @@ -22,6 +22,9 @@ libc { # cthreads functions with stubs in libc cthread_keycreate; cthread_getspecific; cthread_setspecific; __libc_getspecific; + + # weak refs to libthreads functions that libc calls iff libthreads in use + cthread_fork; cthread_detach; %endif # necessary for the Hurd brk implementation @@ -38,6 +41,8 @@ libc { # functions used in libmachuser and libhurduser _S_catch_exception_raise; + _S_catch_exception_raise_state; + _S_catch_exception_raise_state_identity; _S_msg_add_auth; _S_msg_del_auth; _S_msg_describe_ports; _S_msg_get_dtable; _S_msg_set_dtable; @@ -50,7 +55,10 @@ libc { _S_msg_get_init_ports; _S_msg_set_init_ports; _S_msg_proc_newids; _S_msg_report_wait; _S_msg_sig_post; _S_msg_sig_post_untraced; - _hurd_intr_rpc_mach_msg; _hurdsig_fault_catch_exception_raise; + _hurd_intr_rpc_mach_msg; + _hurdsig_fault_catch_exception_raise; + _hurdsig_fault_catch_exception_raise_state; + _hurdsig_fault_catch_exception_raise_state_identity; # "quasi-internal" variables _hurd_device_master; @@ -124,11 +132,6 @@ libc { seteuids; } GLIBC_2.1.3 { -%if SHLIB_COMPAT (libc, GLIBC_2_1_3, HURD_CTHREADS_0_3) - # c* - cthread_fork; cthread_detach; -%endif - # d* directory_name_split; @@ -149,6 +152,10 @@ libc { _hurdsig_interrupt_timeout; _hurdsig_fault_preemptor; _hurdsig_fault_env; } + GLIBC_2.2.6 { + # functions used in macros & inline functions + __errno_location; + } %if !SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2) HURD_CTHREADS_0.3 { diff -durpN glibc-2.2.5/iconv/gconv_cache.c glibc-2.3/iconv/gconv_cache.c --- glibc-2.2.5/iconv/gconv_cache.c 2001-09-01 12:01:07.000000000 -0700 +++ glibc-2.3/iconv/gconv_cache.c 2002-08-24 17:37:10.000000000 -0700 @@ -1,5 +1,5 @@ /* Cache handling for iconv modules. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2001. @@ -31,11 +31,18 @@ #include "../intl/hash-string.h" -void *__gconv_cache; +static void *gconv_cache; static size_t cache_size; static int cache_malloced; +void * +__gconv_get_cache (void) +{ + return gconv_cache; +} + + int internal_function __gconv_load_cache (void) @@ -60,7 +67,7 @@ __gconv_load_cache (void) if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0 /* We do not have to start looking at the file if it cannot contain at least the cache header. */ - || st.st_size < sizeof (struct gconvcache_header)) + || (size_t) st.st_size < sizeof (struct gconvcache_header)) { close_and_exit: __close (fd); @@ -70,25 +77,25 @@ __gconv_load_cache (void) /* Make the file content available. */ cache_size = st.st_size; #ifdef _POSIX_MAPPED_FILES - __gconv_cache = __mmap (NULL, cache_size, PROT_READ, MAP_SHARED, fd, 0); - if (__builtin_expect (__gconv_cache == MAP_FAILED, 0)) + gconv_cache = __mmap (NULL, cache_size, PROT_READ, MAP_SHARED, fd, 0); + if (__builtin_expect (gconv_cache == MAP_FAILED, 0)) #endif { size_t already_read; - __gconv_cache = malloc (cache_size); - if (__gconv_cache == NULL) + gconv_cache = malloc (cache_size); + if (gconv_cache == NULL) goto close_and_exit; already_read = 0; do { - ssize_t n = __read (fd, (char *) __gconv_cache + already_read, + ssize_t n = __read (fd, (char *) gconv_cache + already_read, cache_size - already_read); if (__builtin_expect (n, 0) == -1) { - free (__gconv_cache); - __gconv_cache = NULL; + free (gconv_cache); + gconv_cache = NULL; goto close_and_exit; } @@ -103,7 +110,7 @@ __gconv_load_cache (void) __close (fd); /* Check the consistency. */ - header = (struct gconvcache_header *) __gconv_cache; + header = (struct gconvcache_header *) gconv_cache; if (__builtin_expect (header->magic, GCONVCACHE_MAGIC) != GCONVCACHE_MAGIC || __builtin_expect (header->string_offset >= cache_size, 0) || __builtin_expect (header->hash_offset >= cache_size, 0) @@ -116,14 +123,14 @@ __gconv_load_cache (void) { if (cache_malloced) { - free (__gconv_cache); + free (gconv_cache); cache_malloced = 0; } #ifdef _POSIX_MAPPED_FILES else - __munmap (__gconv_cache, cache_size); + __munmap (gconv_cache, cache_size); #endif - __gconv_cache = NULL; + gconv_cache = NULL; return -1; } @@ -145,9 +152,9 @@ find_module_idx (const char *str, size_t const struct hash_entry *hashtab; unsigned int limit; - header = (const struct gconvcache_header *) __gconv_cache; - strtab = (char *) __gconv_cache + header->string_offset; - hashtab = (struct hash_entry *) ((char *) __gconv_cache + header = (const struct gconvcache_header *) gconv_cache; + strtab = (char *) gconv_cache + header->string_offset; + hashtab = (struct hash_entry *) ((char *) gconv_cache + header->hash_offset); hval = hash_string (str); @@ -211,7 +218,7 @@ __gconv_compare_alias_cache (const char size_t name1_idx; size_t name2_idx; - if (__gconv_cache == NULL) + if (gconv_cache == NULL) return -1; if (find_module_idx (name1, &name1_idx) != 0 @@ -238,13 +245,13 @@ __gconv_lookup_cache (const char *toset, const struct module_entry *to_module; struct __gconv_step *result; - if (__gconv_cache == NULL) + if (gconv_cache == NULL) /* We have no cache available. */ return __GCONV_NODB; - header = (const struct gconvcache_header *) __gconv_cache; - strtab = (char *) __gconv_cache + header->string_offset; - modtab = (const struct module_entry *) ((char *) __gconv_cache + header = (const struct gconvcache_header *) gconv_cache; + strtab = (char *) gconv_cache + header->string_offset; + modtab = (const struct module_entry *) ((char *) gconv_cache + header->module_offset); if (find_module_idx (fromset, &fromidx) != 0 @@ -273,7 +280,7 @@ __gconv_lookup_cache (const char *toset, /* Note the -1. This is due to the offset added in iconvconfig. See there for more explanations. */ - extra = (const struct extra_entry *) ((char *) __gconv_cache + extra = (const struct extra_entry *) ((char *) gconv_cache + header->otherconv_offset + from_module->extra_offset - 1); while (extra->module_cnt != 0 @@ -430,7 +437,7 @@ void internal_function __gconv_release_cache (struct __gconv_step *steps, size_t nsteps) { - if (__gconv_cache != NULL) + if (gconv_cache != NULL) /* The only thing we have to deallocate is the record with the steps. */ free (steps); @@ -442,10 +449,10 @@ static void __attribute__ ((unused)) free_mem (void) { if (cache_malloced) - free (__gconv_cache); + free (gconv_cache); #ifdef _POSIX_MAPPED_FILES else - __munmap (__gconv_cache, cache_size); + __munmap (gconv_cache, cache_size); #endif } diff -durpN glibc-2.2.5/iconv/gconv_charset.h glibc-2.3/iconv/gconv_charset.h --- glibc-2.2.5/iconv/gconv_charset.h 2001-08-14 15:40:51.000000000 -0700 +++ glibc-2.3/iconv/gconv_charset.h 2002-05-14 13:46:02.000000000 -0700 @@ -1,5 +1,5 @@ /* Charset name normalization. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001,02 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2001. @@ -48,7 +48,7 @@ strip (char *wp, const char *s) } -static char * __attribute__ ((unused)) +static inline char * __attribute__ ((unused)) upstr (char *dst, const char *str) { char *cp = dst; diff -durpN glibc-2.2.5/iconv/gconv_conf.c glibc-2.3/iconv/gconv_conf.c --- glibc-2.2.5/iconv/gconv_conf.c 2001-08-14 15:40:51.000000000 -0700 +++ glibc-2.3/iconv/gconv_conf.c 2002-07-27 01:07:07.000000000 -0700 @@ -1,5 +1,5 @@ /* Handle configuration data. - Copyright (C) 1997,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1997,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -416,6 +416,7 @@ read_conf_file (const char *filename, co /* Determine the directories we are looking for data in. */ void +internal_function __gconv_get_path (void) { struct path_elem *result; @@ -527,6 +528,7 @@ __gconv_get_path (void) /* Read all configuration files found in the user-specified and the default path. */ void +attribute_hidden __gconv_read_conf (void) { void *modules = NULL; diff -durpN glibc-2.2.5/iconv/gconv_db.c glibc-2.3/iconv/gconv_db.c --- glibc-2.2.5/iconv/gconv_db.c 2001-07-27 10:29:26.000000000 -0700 +++ glibc-2.3/iconv/gconv_db.c 2002-08-04 14:39:31.000000000 -0700 @@ -1,5 +1,5 @@ /* Provide access to the collection of available transformation modules. - Copyright (C) 1997,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1997,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -41,6 +41,20 @@ struct gconv_module *__gconv_modules_db; __libc_lock_define_initialized (static, lock) +/* Provide access to module database. */ +struct gconv_module * +__gconv_get_modules_db (void) +{ + return __gconv_modules_db; +} + +void * +__gconv_get_alias_db (void) +{ + return __gconv_alias_db; +} + + /* Function for searching alias. */ int __gconv_alias_compare (const void *p1, const void *p2) diff -durpN glibc-2.2.5/iconv/gconv_int.h glibc-2.3/iconv/gconv_int.h --- glibc-2.2.5/iconv/gconv_int.h 2001-08-14 15:40:51.000000000 -0700 +++ glibc-2.3/iconv/gconv_int.h 2002-08-29 22:20:37.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -21,6 +21,7 @@ #define _GCONV_INT_H 1 #include "gconv.h" +#include /* For alloca used in macro below. */ __BEGIN_DECLS @@ -33,9 +34,9 @@ struct path_elem }; /* Variable with search path for `gconv' implementation. */ -extern struct path_elem *__gconv_path_elem; +extern struct path_elem *__gconv_path_elem attribute_hidden; /* Maximum length of a single path element. */ -extern size_t __gconv_max_path_elem_len; +extern size_t __gconv_max_path_elem_len attribute_hidden; /* Structure for alias definition. Simply two strings. */ @@ -114,14 +115,14 @@ enum /* Global variables. */ /* Database of alias names. */ -extern void *__gconv_alias_db; +extern void *__gconv_alias_db attribute_hidden; /* Array with available modules. */ extern size_t __gconv_nmodules; -extern struct gconv_module *__gconv_modules_db; +extern struct gconv_module *__gconv_modules_db attribute_hidden; /* Value of the GCONV_PATH environment variable. */ -extern const char *__gconv_path_envvar; +extern const char *__gconv_path_envvar attribute_hidden; /* The gconv functions expects the name to be in upper case and complete, @@ -138,7 +139,7 @@ extern const char *__gconv_path_envvar; if (*cp++ == '/') \ ++cnt; \ \ - tmp = result = alloca (cp - (str) + 3 + suffix_len); \ + tmp = result = __alloca (cp - (str) + 3 + suffix_len); \ cp = (str); \ while (*cp != '\0') \ *tmp++ = __toupper_l (*cp++, &_nl_C_locobj); \ @@ -199,16 +200,26 @@ extern void __gconv_release_step (struct internal_function; /* Read all the configuration data and cache it. */ -extern void __gconv_read_conf (void); +extern void __gconv_read_conf (void) attribute_hidden; /* Try to read module cache file. */ extern int __gconv_load_cache (void) internal_function; +/* Retrieve pointer to internal cache. */ +extern void *__gconv_get_cache (void); + +/* Retrieve pointer to internal module database. */ +extern struct gconv_module *__gconv_get_modules_db (void); + +/* Retrieve pointer to internal alias database. */ +extern void *__gconv_get_alias_db (void); + /* Determine the directories we are looking in. */ -extern void __gconv_get_path (void); +extern void __gconv_get_path (void) internal_function; /* Comparison function to search alias. */ -extern int __gconv_alias_compare (const void *p1, const void *p2); +extern int __gconv_alias_compare (const void *p1, const void *p2) + attribute_hidden; /* Clear reference to transformation step implementations which might cause the code to be unloaded. */ @@ -248,7 +259,7 @@ extern int __gconv_transliterate (struct __const unsigned char **inbufp, __const unsigned char *inbufend, unsigned char **outbufstart, - size_t *irreversible); + size_t *irreversible) attribute_hidden; /* Builtin transformations. */ diff -durpN glibc-2.2.5/iconv/gconv_open.c glibc-2.3/iconv/gconv_open.c --- glibc-2.2.5/iconv/gconv_open.c 2001-08-14 15:40:51.000000000 -0700 +++ glibc-2.3/iconv/gconv_open.c 2001-11-28 20:45:24.000000000 -0800 @@ -20,6 +20,7 @@ #include #include +#include "../locale/localeinfo.h" #include #include @@ -149,6 +150,25 @@ __gconv_open (const char *toset, const c fromset = memcpy (newfromset, fromset, ignore - fromset); } + /* If the string is empty define this to mean the charset of the + currently selected locale. */ + if (strcmp (toset, "//") == 0) + { + const char *codeset = _NL_CURRENT (LC_CTYPE, CODESET); + size_t len = strlen (codeset); + char *dest; + toset = dest = (char *) alloca (len + 3); + memcpy (__mempcpy (dest, codeset, len), "//", 3); + } + if (strcmp (fromset, "//") == 0) + { + const char *codeset = _NL_CURRENT (LC_CTYPE, CODESET); + size_t len = strlen (codeset); + char *dest; + fromset = dest = (char *) alloca (len + 3); + memcpy (__mempcpy (dest, codeset, len), "//", 3); + } + res = __gconv_find_transform (toset, fromset, &steps, &nsteps, flags); if (res == __GCONV_OK) { diff -durpN glibc-2.2.5/iconv/gconv_simple.c glibc-2.3/iconv/gconv_simple.c --- glibc-2.2.5/iconv/gconv_simple.c 2001-08-03 15:06:46.000000000 -0700 +++ glibc-2.3/iconv/gconv_simple.c 2002-06-28 12:43:38.000000000 -0700 @@ -1,5 +1,5 @@ /* Simple transformations functions. - Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -305,7 +305,7 @@ ucs4_internal_loop_unaligned (struct __g *inptrp = inptr; *outptrp = outptr; - return __GCONV_ILLEGAL_INPUT; + return __GCONV_ILLEGAL_INPUT; } # if __BYTE_ORDER == __LITTLE_ENDIAN @@ -654,7 +654,7 @@ ucs4le_internal_loop_unaligned (struct _ *inptrp = inptr; *outptrp = outptr; - return __GCONV_ILLEGAL_INPUT; + return __GCONV_ILLEGAL_INPUT; } # if __BYTE_ORDER == __BIG_ENDIAN @@ -729,7 +729,7 @@ ucs4le_internal_loop_single (struct __gc (*outptrp)[1] = state->__value.__wchb[2]; (*outptrp)[2] = state->__value.__wchb[1]; (*outptrp)[3] = state->__value.__wchb[0]; -#elif __BYTE_ORDER == __BIG_ENDIAN +#else (*outptrp)[0] = state->__value.__wchb[0]; (*outptrp)[1] = state->__value.__wchb[1]; (*outptrp)[2] = state->__value.__wchb[2]; @@ -770,15 +770,7 @@ ucs4le_internal_loop_single (struct __gc this is not an error because of the lack of possibilities to \ represent the result. This is a genuine bug in the input since \ ASCII does not allow such values. */ \ - if (! ignore_errors_p ()) \ - { \ - /* This is no correct ANSI_X3.4-1968 character. */ \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ - } \ - \ - ++*irreversible; \ - ++inptr; \ + STANDARD_FROM_LOOP_ERR_HANDLER (1); \ } \ else \ /* It's an one byte sequence. */ \ @@ -808,7 +800,7 @@ ucs4le_internal_loop_single (struct __gc if (__builtin_expect (*((const uint32_t *) inptr) > 0x7f, 0)) \ { \ UNICODE_TAG_HANDLER (*((const uint32_t *) inptr), 4); \ - STANDARD_ERR_HANDLER (4); \ + STANDARD_TO_LOOP_ERR_HANDLER (4); \ } \ else \ /* It's an one byte sequence. */ \ @@ -872,7 +864,7 @@ ucs4le_internal_loop_single (struct __gc } \ else \ { \ - STANDARD_ERR_HANDLER (4); \ + STANDARD_TO_LOOP_ERR_HANDLER (4); \ } \ \ inptr += 4; \ @@ -915,11 +907,11 @@ ucs4le_internal_loop_single (struct __gc } \ else \ { \ - if (ch >= 0xc2 && ch < 0xe0) \ + if (ch >= 0xc2 && ch < 0xe0) \ { \ - /* We expect two bytes. The first byte cannot be 0xc0 or 0xc1, \ - otherwise the wide character could have been represented \ - using a single byte. */ \ + /* We expect two bytes. The first byte cannot be 0xc0 or 0xc1, \ + otherwise the wide character could have been represented \ + using a single byte. */ \ cnt = 2; \ ch &= 0x1f; \ } \ @@ -951,24 +943,16 @@ ucs4le_internal_loop_single (struct __gc { \ int skipped; \ \ - if (! ignore_errors_p ()) \ - { \ - /* This is an illegal encoding. */ \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ - } \ - \ /* Search the end of this ill-formed UTF-8 character. This \ is the next byte with (x & 0xc0) != 0x80. */ \ - skipped = 0; \ - do \ - { \ - ++inptr; \ - ++skipped; \ - } \ - while (inptr < inend && (*inptr & 0xc0) == 0x80 && skipped < 5); \ + skipped = 0; \ + do \ + ++skipped; \ + while (inptr + skipped < inend \ + && (*(inptr + skipped) & 0xc0) == 0x80 \ + && skipped < 5); \ \ - continue; \ + STANDARD_FROM_LOOP_ERR_HANDLER (skipped); \ } \ \ if (__builtin_expect (inptr + cnt > inend, 0)) \ @@ -985,16 +969,7 @@ ucs4le_internal_loop_single (struct __gc break; \ } \ \ - if (ignore_errors_p ()) \ - { \ - /* Ignore it. */ \ - inptr += i; \ - ++*irreversible; \ - continue; \ - } \ - \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ + STANDARD_FROM_LOOP_ERR_HANDLER (i); \ } \ \ /* Read the possible remaining bytes. */ \ @@ -1016,15 +991,7 @@ ucs4le_internal_loop_single (struct __gc if (i < cnt || (cnt > 2 && (ch >> (5 * cnt - 4)) == 0)) \ { \ /* This is an illegal encoding. */ \ - if (ignore_errors_p ()) \ - { \ - inptr += i; \ - ++*irreversible; \ - continue; \ - } \ - \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ + STANDARD_FROM_LOOP_ERR_HANDLER (i); \ } \ \ inptr += cnt; \ @@ -1164,14 +1131,7 @@ ucs4le_internal_loop_single (struct __gc { \ /* Surrogate characters in UCS-2 input are not valid. Reject \ them. (Catching this here is not security relevant.) */ \ - if (! ignore_errors_p ()) \ - { \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ - } \ - inptr += 2; \ - ++*irreversible; \ - continue; \ + STANDARD_FROM_LOOP_ERR_HANDLER (2); \ } \ \ *((uint32_t *) outptr)++ = u1; \ @@ -1203,7 +1163,7 @@ ucs4le_internal_loop_single (struct __gc if (__builtin_expect (val >= 0x10000, 0)) \ { \ UNICODE_TAG_HANDLER (val, 4); \ - STANDARD_ERR_HANDLER (4); \ + STANDARD_TO_LOOP_ERR_HANDLER (4); \ } \ else if (__builtin_expect (val >= 0xd800 && val < 0xe000, 0)) \ { \ @@ -1213,16 +1173,14 @@ ucs4le_internal_loop_single (struct __gc surrogates pass through, attackers could make a security \ hole exploit by synthesizing any desired plane 1-16 \ character. */ \ + result = __GCONV_ILLEGAL_INPUT; \ if (! ignore_errors_p ()) \ - { \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ - } \ + break; \ inptr += 4; \ ++*irreversible; \ continue; \ } \ - else \ + else \ { \ *((uint16_t *) outptr)++ = val; \ inptr += 4; \ @@ -1293,7 +1251,7 @@ ucs4le_internal_loop_single (struct __gc if (__builtin_expect (val >= 0x10000, 0)) \ { \ UNICODE_TAG_HANDLER (val, 4); \ - STANDARD_ERR_HANDLER (4); \ + STANDARD_TO_LOOP_ERR_HANDLER (4); \ } \ else if (__builtin_expect (val >= 0xd800 && val < 0xe000, 0)) \ { \ @@ -1312,7 +1270,7 @@ ucs4le_internal_loop_single (struct __gc ++*irreversible; \ continue; \ } \ - else \ + else \ { \ *((uint16_t *) outptr)++ = bswap_16 (val); \ inptr += 4; \ diff -durpN glibc-2.2.5/iconv/iconv_charmap.c glibc-2.3/iconv/iconv_charmap.c --- glibc-2.2.5/iconv/iconv_charmap.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/iconv/iconv_charmap.c 2001-12-29 07:20:51.000000000 -0800 @@ -483,7 +483,7 @@ incomplete character or shift sequence a static int process_fd (struct convtable *tbl, int fd, FILE *output) { - /* we have a problem with reading from a desriptor since we must not + /* We have a problem with reading from a descriptor since we must not provide the iconv() function an incomplete character or shift sequence at the end of the buffer. Since we have to deal with arbitrary encodings we must read the whole text in a buffer and @@ -516,12 +516,17 @@ process_fd (struct convtable *tbl, int f while (1) { ssize_t n; + char *new_inbuf; /* Increase the buffer. */ + new_inbuf = (char *) realloc (inbuf, maxlen + 32768); + if (new_inbuf == NULL) + { + error (0, errno, _("unable to allocate buffer for input")); + return -1; + } + inbuf = new_inbuf; maxlen += 32768; - inbuf = realloc (inbuf, maxlen); - if (inbuf == NULL) - error (0, errno, _("unable to allocate buffer for input")); inptr = inbuf + actlen; do diff -durpN glibc-2.2.5/iconv/iconvconfig.c glibc-2.3/iconv/iconvconfig.c --- glibc-2.2.5/iconv/iconvconfig.c 2002-01-20 19:20:53.000000000 -0800 +++ glibc-2.3/iconv/iconvconfig.c 2002-08-24 21:41:47.000000000 -0700 @@ -113,13 +113,25 @@ Create fastloading iconv module configur /* Strings for arguments in help texts. */ static const char args_doc[] = N_("[DIR...]"); +/* Prototype for option handler. */ +static error_t parse_opt (int key, char *arg, struct argp_state *state); + /* Function to print some extra text in the help message. */ static char *more_help (int key, const char *text, void *input); +/* Definitions of arguments for argp functions. */ +#define OPT_PREFIX 300 +static const struct argp_option options[] = +{ + { "prefix", OPT_PREFIX, "PATH", 0, N_("Prefix used for all file accesses") }, + { NULL, 0, NULL, 0, NULL } +}; + /* Data structure to communicate with argp functions. */ static struct argp argp = { - NULL, NULL, args_doc, doc, NULL, more_help + + options, parse_opt, args_doc, doc, NULL, more_help }; @@ -145,6 +157,11 @@ static void generate_name_info (void); static int write_output (void); +/* Prefix to be used for all file accesses. */ +static const char *prefix = ""; +/* Its length. */ +static size_t prefix_len; + /* Search tree of the modules we know. */ static void *modules; @@ -311,6 +328,23 @@ main (int argc, char *argv[]) } +/* Handle program arguments. */ +static error_t +parse_opt (int key, char *arg, struct argp_state *state) +{ + switch (key) + { + case OPT_PREFIX: + prefix = arg; + prefix_len = strlen (prefix); + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + + static char * more_help (int key, const char *text, void *input) { @@ -407,8 +441,8 @@ add_alias (char *rp) return; *wp++ = '\0'; - assert (strlen (from) + 1 == to - from); - assert (strlen (to) + 1 == wp - to); + assert (strlen (from) + 1 == (size_t) (to - from)); + assert (strlen (to) + 1 == (size_t) (wp - to)); new_alias (from, to - from, to, wp - to); } @@ -570,15 +604,15 @@ add_module (char *rp, const char *direct /* See whether we must add the ending. */ need_ext = 0; - if (wp - module < sizeof (gconv_module_ext) + if ((size_t) (wp - module) < sizeof (gconv_module_ext) || memcmp (wp - sizeof (gconv_module_ext), gconv_module_ext, sizeof (gconv_module_ext)) != 0) /* We must add the module extension. */ need_ext = sizeof (gconv_module_ext) - 1; - assert (strlen (from) + 1 == to - from); - assert (strlen (to) + 1 == module - to); - assert (strlen (module) + 1 == wp - module); + assert (strlen (from) + 1 == (size_t) (to - from)); + assert (strlen (to) + 1 == (size_t) (module - to)); + assert (strlen (module) + 1 == (size_t) (wp - module)); new_module (from, to - from, to, module - to, directory, module, wp - module, cost, need_ext); @@ -590,6 +624,7 @@ static int handle_dir (const char *dir) { char *infile; + char *cp; FILE *fp; char *line = NULL; size_t linelen = 0; @@ -603,8 +638,10 @@ handle_dir (const char *dir) newp[dirlen] = '\0'; } - infile = (char *) alloca (dirlen + sizeof "gconv-modules"); - strcpy (mempcpy (infile, dir, dirlen), "gconv-modules"); + cp = infile = (char *) alloca (prefix_len + dirlen + sizeof "gconv-modules"); + if (dir[0] == '/') + cp = mempcpy (cp, prefix, prefix_len); + strcpy (mempcpy (cp, dir, dirlen), "gconv-modules"); fp = fopen (infile, "r"); if (fp == NULL) @@ -966,7 +1003,9 @@ write_output (void) struct iovec iov[6]; static const gidx_t null_word; size_t total; - char tmpfname[sizeof (GCONV_MODULES_CACHE) + strlen (".XXXXXX")]; + char tmpfname[prefix_len + sizeof (GCONV_MODULES_CACHE) + + strlen (".XXXXXX")]; + char finalname[prefix_len + sizeof (GCONV_MODULES_CACHE)]; /* Function to insert the names. */ static void name_insert (const void *nodep, VISIT value, int level) @@ -993,11 +1032,15 @@ write_output (void) } /* Open the output file. */ - strcpy (stpcpy (tmpfname, GCONV_MODULES_CACHE), ".XXXXXX"); + assert (GCONV_MODULES_CACHE[0] == '/'); + strcpy (stpcpy (mempcpy (tmpfname, prefix, prefix_len), GCONV_MODULES_CACHE), + ".XXXXXX"); fd = mkstemp (tmpfname); if (fd == -1) return 1; + strcpy (mempcpy (finalname, prefix, prefix_len), GCONV_MODULES_CACHE); + /* Create the string table. */ string_table = strtabfinalize (strtab, &string_table_size); @@ -1136,7 +1179,7 @@ write_output (void) total += iov[idx].iov_len; ++idx; - assert (cur_extra_table - extra_table + assert ((size_t) (cur_extra_table - extra_table) <= ((sizeof (struct extra_entry) + sizeof (gidx_t) + sizeof (struct extra_entry_module)) * nextra_modules)); @@ -1146,11 +1189,11 @@ write_output (void) total += iov[idx].iov_len; ++idx; - if (TEMP_FAILURE_RETRY (writev (fd, iov, idx)) != total + if ((size_t) TEMP_FAILURE_RETRY (writev (fd, iov, idx)) != total /* The file was created with mode 0600. Make it world-readable. */ || fchmod (fd, 0644) != 0 /* Rename the file, possibly replacing an old one. */ - || rename (tmpfname, GCONV_MODULES_CACHE) != 0) + || rename (tmpfname, finalname) != 0) { int save_errno = errno; close (fd); diff -durpN glibc-2.2.5/iconv/iconvconfig.h glibc-2.3/iconv/iconvconfig.h --- glibc-2.2.5/iconv/iconvconfig.h 2001-07-22 10:44:23.000000000 -0700 +++ glibc-2.3/iconv/iconvconfig.h 2002-08-26 21:52:34.000000000 -0700 @@ -3,16 +3,16 @@ Contributed by Ulrich Drepper , 2000. The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff -durpN glibc-2.2.5/iconv/iconv_open.c glibc-2.3/iconv/iconv_open.c --- glibc-2.2.5/iconv/iconv_open.c 2001-07-05 21:54:47.000000000 -0700 +++ glibc-2.3/iconv/iconv_open.c 2001-11-28 20:55:34.000000000 -0800 @@ -40,14 +40,15 @@ iconv_open (const char *tocode, const ch /* Normalize the name. We remove all characters beside alpha-numeric, '_', '-', '/', and '.'. */ tocode_len = strlen (tocode); - tocode_conv = alloca (tocode_len + 3); + tocode_conv = (char *) alloca (tocode_len + 3); strip (tocode_conv, tocode); - tocode = tocode_conv[2] == '\0' ? upstr (tocode_conv, tocode) : tocode_conv; + tocode = (tocode_conv[2] == '\0' && tocode[0] != '\0' + ? upstr (tocode_conv, tocode) : tocode_conv); fromcode_len = strlen (fromcode); - fromcode_conv = alloca (fromcode_len + 3); + fromcode_conv = (char *) alloca (fromcode_len + 3); strip (fromcode_conv, fromcode); - fromcode = (fromcode_conv[2] == '\0' + fromcode = (fromcode_conv[2] == '\0' && fromcode[0] != '\0' ? upstr (fromcode_conv, fromcode) : fromcode_conv); res = __gconv_open (tocode, fromcode, &cd, 0); diff -durpN glibc-2.2.5/iconv/iconv_prog.c glibc-2.3/iconv/iconv_prog.c --- glibc-2.2.5/iconv/iconv_prog.c 2002-01-20 19:20:53.000000000 -0800 +++ glibc-2.3/iconv/iconv_prog.c 2002-09-23 20:46:09.000000000 -0700 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -47,9 +48,6 @@ #define PACKAGE _libc_intl_domainname -/* Defined in gconv_cache.c. */ -extern void *__gconv_cache; - /* Name and version of program. */ static void print_version (FILE *stream, struct argp_state *state); void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; @@ -92,9 +90,11 @@ static struct argp argp = options, parse_opt, args_doc, doc, NULL, more_help }; -/* Code sets to convert from and to respectively. */ -static const char *from_code; -static const char *to_code; +/* Code sets to convert from and to respectively. An empty string as the + default causes the 'iconv_open' function to look up the charset of the + currently selected locale and use it. */ +static const char *from_code = ""; +static const char *to_code = ""; /* File to write output to. If NULL write to stdout. */ static const char *output_file; @@ -141,20 +141,6 @@ main (int argc, char *argv[]) print_known_names (); exit (EXIT_SUCCESS); } - if (from_code == NULL) - { - /* The Unix standard says that in this case the charset of the current - locale is used. */ - from_code = nl_langinfo (CODESET); - assert (from_code != NULL); - } - if (to_code == NULL) - { - /* The Unix standard says that in this case the charset of the current - locale is used. */ - to_code = nl_langinfo (CODESET); - assert (to_code != NULL); - } /* If we have to ignore errors make sure we use the appropriate name for the to-character-set. */ @@ -231,9 +217,47 @@ main (int argc, char *argv[]) if (cd == (iconv_t) -1) { if (errno == EINVAL) - error (EXIT_FAILURE, 0, - _("conversion from `%s' to `%s' not supported"), - from_code, orig_to_code); + { + /* Try to be nice with the user and tell her which of the + two encoding names is wrong. This is possible because + all supported encodings can be converted from/to Unicode, + in other words, because the graph of encodings is + connected. */ + bool from_wrong = + (iconv_open ("UTF-8", from_code) == (iconv_t) -1 + && errno == EINVAL); + bool to_wrong = + (iconv_open (to_code, "UTF-8") == (iconv_t) -1 + && errno == EINVAL); + const char *from_pretty = + (from_code[0] ? from_code : nl_langinfo (CODESET)); + const char *to_pretty = + (orig_to_code[0] ? orig_to_code : nl_langinfo (CODESET)); + + if (from_wrong) + { + if (to_wrong) + error (EXIT_FAILURE, 0, + _("\ +conversions from `%s' and to `%s' are not supported"), + from_pretty, to_pretty); + else + error (EXIT_FAILURE, 0, + _("conversion from `%s' is not supported"), + from_pretty); + } + else + { + if (to_wrong) + error (EXIT_FAILURE, 0, + _("conversion to `%s' is not supported"), + to_pretty); + else + error (EXIT_FAILURE, 0, + _("conversion from `%s' to `%s' is not supported"), + from_pretty, to_pretty); + } + } else error (EXIT_FAILURE, errno, _("failed to start conversion processing")); @@ -424,7 +448,8 @@ process_block (iconv_t cd, char *addr,