From jakub@redhat.com Fri Feb 1 00:48:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 01 Feb 2002 00:48:00 -0000 Subject: [PATCH] Re: ld.so changes In-Reply-To: ; from Ulrich Drepper on Thu, Jan 31, 2002 at 05:37:28PM -0800 References: <20020131201334.I618@sunsite.ms.mff.cuni.cz> Message-ID: <20020201095216.J618@sunsite.ms.mff.cuni.cz> On Thu, Jan 31, 2002 at 05:37:28PM -0800, Ulrich Drepper wrote: > Jakub Jelinek writes: > > > I did all I found. > > Thanks, I've applied it. Although it conflicted with some of the > changes I've made. I applied it by hand. Which helped finding a few > bugs and also helped updating the copyright year. I see you added some new vars to _rtld_global, I forgot to mention it yesterday. IMHO all variables which were ld.so(GLIBC_PRIVATE) in my patch can fall there. Should I update the GLIBC_PRIVATE patch now? Jakub From drepper@redhat.com Fri Feb 1 01:00:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 01 Feb 2002 01:00:00 -0000 Subject: [PATCH] Re: ld.so changes In-Reply-To: <20020201095216.J618@sunsite.ms.mff.cuni.cz> References: <20020131201334.I618@sunsite.ms.mff.cuni.cz> <20020201095216.J618@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Should I update the GLIBC_PRIVATE patch now? Yes, please. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From schwab@suse.de Fri Feb 1 02:58:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Fri, 01 Feb 2002 02:58:00 -0000 Subject: sysdeps/generic/dl-procinfo.c missing Message-ID: sysdeps/generic/ldsodefs.h includes , but that only exists for some platforms. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N??rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From jakub@redhat.com Fri Feb 1 02:59:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 01 Feb 2002 02:59:00 -0000 Subject: sysdeps/generic/dl-procinfo.c missing In-Reply-To: ; from Andreas Schwab on Fri, Feb 01, 2002 at 11:55:03AM +0100 References: Message-ID: <20020201120306.L618@sunsite.ms.mff.cuni.cz> On Fri, Feb 01, 2002 at 11:55:03AM +0100, Andreas Schwab wrote: > sysdeps/generic/ldsodefs.h includes , but that only exists > for some platforms. See the patch I've just mailed. Jakub From jakub@redhat.com Fri Feb 1 02:59:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 01 Feb 2002 02:59:00 -0000 Subject: [PATCH] Further _rtld_global bugfixes Message-ID: <20020201120243.K618@sunsite.ms.mff.cuni.cz> Hi! This was found by grepping through the source and reading -Dyesterday -rHEAD CVS diff. GLIBC_PRIVATE patch will be next. 2002-02-01 Jakub Jelinek * sysdeps/generic/dl-procinfo.c: New file. * 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. --- libc/sysdeps/generic/dl-procinfo.c.jj Fri Feb 1 12:29:02 2002 +++ libc/sysdeps/generic/dl-procinfo.c Fri Feb 1 12:40:30 2002 @@ -0,0 +1,2 @@ +/* Empty. Not needed unless dl-procinfo.h uses it. */ +#undef PROCINFO_DECL --- libc/sysdeps/generic/ldsodefs.h.jj Fri Feb 1 11:01:18 2002 +++ libc/sysdeps/generic/ldsodefs.h Fri Feb 1 12:48:15 2002 @@ -347,16 +347,6 @@ extern const char _dl_out_of_memory[]; extern int _dl_sysdep_open_zero_fill (void); /* dl-sysdep.c */ -/* 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. - - 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_recursive (extern, _dl_load_lock) - - /* Write message on the debug file descriptor. The parameters are interpreted as for a `printf' call. All the lines start with a tag showing the PID. */ --- libc/sysdeps/ia64/hp-timing.h.jj Mon Aug 20 13:27:49 2001 +++ libc/sysdeps/ia64/hp-timing.h Fri Feb 1 12:56:45 2002 @@ -1,5 +1,5 @@ /* High precision, low overhead timing functions. IA-64 version. - 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. @@ -78,10 +78,6 @@ /* We use 64bit values for the times. */ typedef unsigned long int hp_timing_t; -/* Internal variable used to store the overhead of the measurement - opcodes. */ -extern hp_timing_t __libc_hp_timing_overhead; - /* Set timestamp value to zero. */ #define HP_TIMING_ZERO(Var) (Var) = (0) @@ -104,14 +100,14 @@ extern hp_timing_t __libc_hp_timing_over #define HP_TIMING_DIFF_INIT() \ do { \ int __cnt = 5; \ - __libc_hp_timing_overhead = ~0ul; \ + GL(dl_hp_timing_overhead) = ~0ul; \ do \ { \ hp_timing_t __t1, __t2; \ HP_TIMING_NOW (__t1); \ HP_TIMING_NOW (__t2); \ - if (__t2 - __t1 < __libc_hp_timing_overhead) \ - __libc_hp_timing_overhead = __t2 - __t1; \ + if (__t2 - __t1 < GL(dl_hp_timing_overhead)) \ + GL(dl_hp_timing_overhead) = __t2 - __t1; \ } \ while (--__cnt > 0); \ } while (0) @@ -123,7 +119,7 @@ extern hp_timing_t __libc_hp_timing_over #define HP_TIMING_ACCUM(Sum, Diff) \ do { \ hp_timing_t __oldval; \ - hp_timing_t __diff = (Diff) - __libc_hp_timing_overhead; \ + hp_timing_t __diff = (Diff) - GL(dl_hp_timing_overhead); \ hp_timing_t __newval; \ do \ { \ --- libc/sysdeps/sparc/sparc32/sparcv9/hp-timing.h.jj Thu Aug 23 18:50:21 2001 +++ libc/sysdeps/sparc/sparc32/sparcv9/hp-timing.h Fri Feb 1 13:01:17 2002 @@ -1,5 +1,5 @@ /* High precision, low overhead timing functions. sparcv9 version. - 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 David S. Miller , 2001. @@ -30,8 +30,6 @@ typedef unsigned long long int hp_timing_t; -extern hp_timing_t __libc_hp_timing_overhead; - #define HP_TIMING_ZERO(Var) (Var) = (0) #define HP_TIMING_NOW(Var) \ @@ -42,14 +40,14 @@ extern hp_timing_t __libc_hp_timing_over #define HP_TIMING_DIFF_INIT() \ do { \ int __cnt = 5; \ - __libc_hp_timing_overhead = ~0ull; \ + GL(dl_hp_timing_overhead) = ~0ull; \ do \ { \ hp_timing_t __t1, __t2; \ HP_TIMING_NOW (__t1); \ HP_TIMING_NOW (__t2); \ - if (__t2 - __t1 < __libc_hp_timing_overhead) \ - __libc_hp_timing_overhead = __t2 - __t1; \ + if (__t2 - __t1 < GL(dl_hp_timing_overhead)) \ + GL(dl_hp_timing_overhead) = __t2 - __t1; \ } \ while (--__cnt > 0); \ } while (0) @@ -58,7 +56,7 @@ extern hp_timing_t __libc_hp_timing_over #define HP_TIMING_ACCUM(Sum, Diff) \ do { \ - hp_timing_t __diff = (Diff) - __libc_hp_timing_overhead; \ + hp_timing_t __diff = (Diff) - GL(dl_hp_timing_overhead); \ __asm__ __volatile__("srl %L0, 0, %%g1\n\t" \ "sllx %H0, 32, %%g7\n\t" \ "or %%g1, %%g7, %%g1\n\t" \ --- libc/sysdeps/sparc/sparc64/hp-timing.c.jj Thu Aug 23 18:50:22 2001 +++ libc/sysdeps/sparc/sparc64/hp-timing.c Fri Feb 1 12:42:55 2002 @@ -1,5 +1,5 @@ /* Support for high precision, low overhead timing functions. sparc64 version. - 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 David S. Miller , 2001. @@ -21,4 +21,4 @@ #include /* We have to define the variable for the overhead. */ -hp_timing_t __libc_hp_timing_overhead; +hp_timing_t _dl_hp_timing_overhead; --- libc/sysdeps/sparc/sparc64/Makefile.jj Fri Apr 13 02:38:15 2001 +++ libc/sysdeps/sparc/sparc64/Makefile Fri Feb 1 12:43:21 2002 @@ -3,4 +3,5 @@ long-double-fcts = yes ifeq ($(subdir),csu) sysdep_routines += hp-timing +static-only-routines += hp-timing endif --- libc/sysdeps/sparc/sparc64/hp-timing.h.jj Thu Aug 23 18:50:22 2001 +++ libc/sysdeps/sparc/sparc64/hp-timing.h Fri Feb 1 13:01:43 2002 @@ -1,5 +1,5 @@ /* High precision, low overhead timing functions. sparc64 version. - 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 David S. Miller , 2001. @@ -30,8 +30,6 @@ typedef unsigned long int hp_timing_t; -extern hp_timing_t __libc_hp_timing_overhead; - #define HP_TIMING_ZERO(Var) (Var) = (0) #define HP_TIMING_NOW(Var) __asm__ __volatile__ ("rd %%tick, %0" : "=r" (Var)) @@ -39,14 +37,14 @@ extern hp_timing_t __libc_hp_timing_over #define HP_TIMING_DIFF_INIT() \ do { \ int __cnt = 5; \ - __libc_hp_timing_overhead = ~0ull; \ + GL(hp_timing_overhead) = ~0ull; \ do \ { \ hp_timing_t __t1, __t2; \ HP_TIMING_NOW (__t1); \ HP_TIMING_NOW (__t2); \ - if (__t2 - __t1 < __libc_hp_timing_overhead) \ - __libc_hp_timing_overhead = __t2 - __t1; \ + if (__t2 - __t1 < GL(hp_timing_overhead)) \ + GL(hp_timing_overhead) = __t2 - __t1; \ } \ while (--__cnt > 0); \ } while (0) @@ -55,7 +53,7 @@ extern hp_timing_t __libc_hp_timing_over #define HP_TIMING_ACCUM(Sum, Diff) \ do { \ - hp_timing_t __diff = (Diff) - __libc_hp_timing_overhead; \ + hp_timing_t __diff = (Diff) - GL(hp_timing_overhead); \ hp_timing_t tmp1, tmp2; \ __asm__ __volatile__("1: ldx [%3], %0\n\t" \ "add %0, %2, %1\n\t" \ --- libc/sysdeps/unix/sysv/aix/init-first.c.jj Thu Sep 27 23:22:27 2001 +++ libc/sysdeps/unix/sysv/aix/init-first.c Fri Feb 1 13:02:19 2002 @@ -1,5 +1,5 @@ /* Initialization code run first thing by the XCOFF startup code. AIX version. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 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 @@ -40,9 +40,6 @@ static void init (int, char **, char **) extern int _dl_starting_up; weak_extern (_dl_starting_up) -extern fpu_control_t _dl_fpu_control; -extern int _dl_fpu_control_set; - /* Set nonzero if we have to be prepared for more then one libc being used in the process. Safe assumption if initializer never runs. */ int __libc_multiple_libcs = 1; --- libc/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c.jj Fri Feb 1 12:31:30 2002 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c Fri Feb 1 12:35:59 2002 @@ -0,0 +1,62 @@ +/* Data for Linux/sparc32 version of processor capability information. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2002. + + 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 information must be kept in sync with the _DL_HWCAP_COUNT + definition in procinfo.h. + + If anything should be added here check whether the size of each string + is still ok with the given array size. + + All the #ifdefs in the definitions ar equite irritating but + necessary if we want to avoid duplicating the information. There + are three different modes: + + - PROCINFO_DECL is defined. This means we are only interested in + declarations. + + - PROCINFO_DECL is not defined: + + + if SHARED is defined the file is included in an array + initializer. The .element = { ... } syntax is needed. + + + if SHARED is not defined a normal array initialization is + needed. + */ + +#ifdef PROCINFO_DECL +EXTERN +#endif +#if !defined PROCINFO_DECL && defined SHARED + ._dl_sparc32_cap_flags +#else +const char _dl_sparc32_cap_flags[6][7] +#endif +#ifndef PROCINFO_DECL += { + "flush", "stbar", "swap", "muldiv", "v9", "ultra3" + } +#endif +#if !defined SHARED || defined PROCINFO_DECL +; +#else +, +#endif + +#undef PROCINFO_DECL --- libc/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h.jj Thu Aug 23 18:51:33 2001 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h Fri Feb 1 13:03:32 2002 @@ -1,5 +1,5 @@ /* Linux/sparc32 version of processor capability information handling macros. - 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 Jakub Jelinek , 1999. @@ -23,12 +23,6 @@ #include -/* If anything should be added here check whether the size of each string - is still ok with the given array size. */ -static const char sparc32_cap_flags[][7] = - { - "flush", "stbar", "swap", "muldiv", "v9", "ultra3" - }; #define _DL_HWCAP_COUNT 6 static inline int @@ -41,7 +35,7 @@ _dl_procinfo (int word) for (i = 0; i < _DL_HWCAP_COUNT; ++i) if (word & (1 << i)) - _dl_printf (" %s", sparc32_cap_flags[i]); + _dl_printf (" %s", GL(dl_sparc32_cap_flags)[i]); _dl_printf ("\n"); @@ -52,7 +46,7 @@ static inline const char * __attribute__ ((unused)) _dl_hwcap_string (int idx) { - return sparc32_cap_flags[idx]; + return GL(dl_sparc32_cap_flags)[idx]; }; static inline int @@ -62,7 +56,7 @@ _dl_string_hwcap (const char *str) int i; for (i = 0; i < _DL_HWCAP_COUNT; i++) { - if (strcmp (str, sparc32_cap_flags [i]) == 0) + if (strcmp (str, GL(dl_sparc32_cap_flags) [i]) == 0) return i; } return -1; --- libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c.jj Fri Feb 1 12:31:30 2002 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c Fri Feb 1 12:38:58 2002 @@ -0,0 +1,62 @@ +/* Data for Linux/sparc64 version of processor capability information. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2002. + + 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 information must be kept in sync with the _DL_HWCAP_COUNT + definition in procinfo.h. + + If anything should be added here check whether the size of each string + is still ok with the given array size. + + All the #ifdefs in the definitions ar equite irritating but + necessary if we want to avoid duplicating the information. There + are three different modes: + + - PROCINFO_DECL is defined. This means we are only interested in + declarations. + + - PROCINFO_DECL is not defined: + + + if SHARED is defined the file is included in an array + initializer. The .element = { ... } syntax is needed. + + + if SHARED is not defined a normal array initialization is + needed. + */ + +#ifdef PROCINFO_DECL +EXTERN +#endif +#if !defined PROCINFO_DECL && defined SHARED + ._dl_sparc64_cap_flags +#else +const char _dl_sparc64_cap_flags[6][7] +#endif +#ifndef PROCINFO_DECL += { + "flush", "stbar", "swap", "muldiv", "v9", "ultra3" + } +#endif +#if !defined SHARED || defined PROCINFO_DECL +; +#else +, +#endif + +#undef PROCINFO_DECL --- libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h.jj Thu Aug 23 18:51:33 2001 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h Fri Feb 1 13:03:42 2002 @@ -1,5 +1,5 @@ /* Linux/sparc64 version of processor capability information handling macros. - 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 Jakub Jelinek , 1999. @@ -23,12 +23,6 @@ #include -/* If anything should be added here check whether the size of each string - is still ok with the given array size. */ -static const char sparc64_cap_flags[][7] = - { - "flush", "stbar", "swap", "muldiv", "v9", "ultra3" - }; #define _DL_HWCAP_COUNT 6 static inline int @@ -41,7 +35,7 @@ _dl_procinfo (int word) for (i = 0; i < _DL_HWCAP_COUNT; ++i) if (word & (1 << i)) - _dl_printf (" %s", sparc64_cap_flags[i]); + _dl_printf (" %s", GL(dl_sparc64_cap_flags)[i]); _dl_printf ("\n"); @@ -52,7 +46,7 @@ static inline const char * __attribute__ ((unused)) _dl_hwcap_string (int idx) { - return sparc64_cap_flags[idx]; + return GL(dl_sparc64_cap_flags)[idx]; }; @@ -63,7 +57,7 @@ _dl_string_hwcap (const char *str) int i; for (i = 0; i < _DL_HWCAP_COUNT; i++) { - if (strcmp (str, sparc64_cap_flags [i]) == 0) + if (strcmp (str, GL(dl_sparc64_cap_flags) [i]) == 0) return i; } return -1; --- libc/sysdeps/unix/sysv/linux/init-first.c.jj Fri Feb 1 11:01:19 2002 +++ libc/sysdeps/unix/sysv/linux/init-first.c Fri Feb 1 12:52:52 2002 @@ -41,8 +41,6 @@ static void init (int, char **, char **) extern int _dl_starting_up; weak_extern (_dl_starting_up) -extern int _dl_fpu_control_set; - /* Set nonzero if we have to be prepared for more then one libc being used in the process. Safe assumption if initializer never runs. */ int __libc_multiple_libcs = 1; Jakub From jakub@redhat.com Fri Feb 1 04:54:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 01 Feb 2002 04:54:00 -0000 Subject: [PATCH] Updated GLIBC_PRIVATE Message-ID: <20020201135755.M618@sunsite.ms.mff.cuni.cz> Hi! Bootstrapped on i686, no make check failures. 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/Verions (__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/Verions (__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. linuxthreads/ * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set, __pthread_kill_other_threads_np): Move to GLIBC_PRIVATE. * sysdeps/i386/i586/Versions: Move all symbols to GLIBC_PRIVATE. * sysdeps/i386/i686/Versions: Move all symbols to GLIBC_PRIVATE. * sysdeps/sparc/sparc32/sparcv9/Versions: New. * sysdeps/sparc/sparc64/Versions: New. * sysdeps/ia64/Versions: Move all symbols to GLIBC_PRIVATE. --- libc/catgets/Versions.jj Fri Jul 3 00:31:04 1998 +++ libc/catgets/Versions Fri Feb 1 13:22:20 2002 @@ -1,9 +1,10 @@ libc { GLIBC_2.0 { - # functions with required interface outside normal name space - __open_catalog; - # c* catclose; catgets; catopen; } + GLIBC_PRIVATE { + # functions with required interface outside normal name space + __open_catalog; + } } --- libc/elf/Versions.jj Fri Feb 1 10:59:04 2002 +++ libc/elf/Versions Fri Feb 1 13:32:33 2002 @@ -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,44 +17,34 @@ 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; _dl_init_first; + } } ld { GLIBC_2.0 { - # 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_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_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 - __libc_stack_end; - # functions used in other libraries - _dl_start_profile; _dl_mcount; _dl_unload_cache; + _r_debug; } - GLIBC_2.1.1 { + GLIBC_2.1 { # functions used in other libraries - _dl_dst_count; _dl_dst_substitute; + _dl_mcount; } - GLIBC_2.2 { - _dl_init; _dl_argv; _dl_check_map_versions; - - # variables used elsewhere - _dl_out_of_memory; - } - GLIBC_2.2.3 { - _dl_debug_printf; - } - GLIBC_2.3 { + 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_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; } } --- libc/elf/dl-xstat64.c.jj Thu Jan 31 18:41:11 2002 +++ libc/elf/dl-xstat64.c Fri Feb 1 13:34:21 2002 @@ -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 --- libc/elf/dl-lookup.c.jj Fri Feb 1 10:59:04 2002 +++ libc/elf/dl-lookup.c Fri Feb 1 13:22:20 2002 @@ -661,7 +661,7 @@ _dl_debug_bindings (const char *undef_na /* 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, @@ -672,7 +672,7 @@ _dl_do_lookup (const char *undef_name, u 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, --- libc/elf/Makefile.jj Wed Jan 30 18:40:00 2002 +++ libc/elf/Makefile Fri Feb 1 13:34:21 2002 @@ -37,7 +37,8 @@ elide-routines.os = $(all-dl-routines) d # 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 \ --- libc/elf/dl-fxstat64.c.jj Thu Jan 31 18:41:11 2002 +++ libc/elf/dl-fxstat64.c Fri Feb 1 13:34:21 2002 @@ -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 --- libc/hesiod/Versions.jj Thu Jul 27 15:58:10 2000 +++ libc/hesiod/Versions Fri Feb 1 13:22:20 2002 @@ -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; --- libc/iconv/Versions.jj Wed Sep 12 09:56:44 2001 +++ libc/iconv/Versions Fri Feb 1 13:22:20 2002 @@ -1,13 +1,10 @@ libc { GLIBC_2.1 { - # global variables - __gconv_alias_db; __gconv_modules_db; - # i* iconv_open; iconv; iconv_close; } - GLIBC_2.2.5 { - # variable shared with iconv program - __gconv_cache; + GLIBC_PRIVATE { + # variables shared with iconv program + __gconv_alias_db; __gconv_modules_db; __gconv_cache; } } --- libc/inet/Versions.jj Wed Aug 2 21:36:17 2000 +++ libc/inet/Versions Fri Feb 1 13:22:20 2002 @@ -3,10 +3,6 @@ libc { # functions with required interface outside normal name space __ivaliduser; __check_rhosts_file; __rcmd_errstr; - # functions used in other libraries - __internal_endnetgrent; __internal_getnetgrent_r; - __internal_setnetgrent; - # variables in normal name space rexecoptions; @@ -68,4 +64,9 @@ libc { # r* rcmd_af; rexec_af; rresvport_af; ruserok_af; } + GLIBC_PRIVATE { + # functions used in other libraries + __internal_endnetgrent; __internal_getnetgrent_r; + __internal_setnetgrent; + } } --- libc/io/Versions.jj Mon Nov 13 23:01:21 2000 +++ libc/io/Versions Fri Feb 1 13:22:20 2002 @@ -1,10 +1,5 @@ libc { GLIBC_2.0 { - # functions which have an additional interface since they are - # are cancelable. - __libc_open; __libc_close; __libc_read; __libc_write; - __libc_lseek; __libc_fcntl; - # functions used in inline functions or macros __xstat; __fxstat; __lxstat; __xmknod; __write; __close; __fcntl; __lseek; __open; __read; @@ -83,14 +78,16 @@ libc { # s* statfs64; statvfs; statvfs64; } - GLIBC_2.1.3 { - # For the cancelation wrappers. - __libc_open64; __libc_lseek64; - } GLIBC_2.2 { # p* posix_fadvise; posix_fadvise64; posix_fallocate; posix_fallocate64; __open64; } + GLIBC_PRIVATE { + # functions which have an additional interface since they are + # cancelable. + __libc_open; __libc_close; __libc_read; __libc_write; + __libc_lseek; __libc_fcntl; __libc_open64; __libc_lseek64; + } } --- libc/linuxthreads/sysdeps/i386/i686/Versions.jj Thu Nov 15 23:10:54 2001 +++ libc/linuxthreads/sysdeps/i386/i686/Versions Fri Feb 1 13:22:20 2002 @@ -1,5 +1,5 @@ libpthread { - GLIBC_2.2.3 { + GLIBC_PRIVATE { __pthread_clock_gettime; __pthread_clock_settime; } } --- libc/linuxthreads/sysdeps/i386/i586/Versions.jj Sat Apr 21 09:52:39 2001 +++ libc/linuxthreads/sysdeps/i386/i586/Versions Fri Feb 1 13:22:20 2002 @@ -1,5 +1,5 @@ libpthread { - GLIBC_2.2.3 { + GLIBC_PRIVATE { __pthread_clock_gettime; __pthread_clock_settime; } } --- libc/linuxthreads/sysdeps/sparc/sparc32/sparcv9/Versions.jj Thu Jan 31 14:59:42 2002 +++ libc/linuxthreads/sysdeps/sparc/sparc32/sparcv9/Versions Fri Feb 1 13:22:20 2002 @@ -0,0 +1,5 @@ +libpthread { + GLIBC_PRIVATE { + __pthread_clock_gettime; __pthread_clock_settime; + } +} --- libc/linuxthreads/sysdeps/sparc/sparc64/Versions.jj Thu Jan 31 14:59:54 2002 +++ libc/linuxthreads/sysdeps/sparc/sparc64/Versions Fri Feb 1 13:22:20 2002 @@ -0,0 +1,5 @@ +libpthread { + GLIBC_PRIVATE { + __pthread_clock_gettime; __pthread_clock_settime; + } +} --- libc/linuxthreads/sysdeps/ia64/Versions.jj Tue Apr 24 06:43:34 2001 +++ libc/linuxthreads/sysdeps/ia64/Versions Fri Feb 1 13:22:20 2002 @@ -1,5 +1,5 @@ libpthread { - GLIBC_2.2.3 { + GLIBC_PRIVATE { __pthread_clock_gettime; __pthread_clock_settime; } } --- libc/linuxthreads/Versions.jj Fri Mar 16 09:48:44 2001 +++ libc/linuxthreads/Versions Fri Feb 1 13:22:20 2002 @@ -13,17 +13,18 @@ libc { pthread_mutexattr_getkind_np; pthread_mutexattr_setkind_np; pthread_self; pthread_setcancelstate; pthread_setcanceltype; pthread_setschedparam; - - # Internal libc interface to libpthread - __libc_internal_tsd_get; __libc_internal_tsd_set; } GLIBC_2.1 { pthread_attr_init; } + GLIBC_PRIVATE { + # Internal libc interface to libpthread + __libc_internal_tsd_get; __libc_internal_tsd_set; + } } ld { - GLIBC_2.0 { + GLIBC_PRIVATE { # Internal libc interface to libpthread __libc_internal_tsd_get; __libc_internal_tsd_set; } @@ -35,9 +36,6 @@ libpthread { _pthread_cleanup_pop; _pthread_cleanup_pop_restore; _pthread_cleanup_push; _pthread_cleanup_push_defer; - # Internal libc interface to libpthread - __libc_internal_tsd_get; __libc_internal_tsd_set; - # Overwritten libc functions. accept; close; connect; fcntl; fork; fsync; longjmp; lseek; msync; nanosleep; open; pause; raise; read; recv; recvfrom; recvmsg; send; @@ -118,7 +116,6 @@ libpthread { sem_close; sem_open; sem_unlink; } GLIBC_2.1.2 { - __pthread_kill_other_threads_np; __vfork; } GLIBC_2.2 { @@ -156,4 +153,9 @@ libpthread { # Extensions. pthread_getattr_np; } + GLIBC_PRIVATE { + # Internal libc interface to libpthread + __libc_internal_tsd_get; __libc_internal_tsd_set; + __pthread_kill_other_threads_np; + } } --- libc/locale/Versions.jj Tue Sep 26 09:22:43 2000 +++ libc/locale/Versions Fri Feb 1 13:22:20 2002 @@ -7,9 +7,7 @@ libBrokenLocale { libc { GLIBC_2.0 { # global variables - __collate_element_hash; __collate_element_strings; - __collate_symbol_classes; __collate_symbol_hash; __collate_symbol_strings; - _libc_intl_domainname; _nl_current_LC_COLLATE; _nl_current_LC_CTYPE; + _libc_intl_domainname; # functions used in inline functions or macros __ctype_get_mb_cur_max; @@ -48,4 +46,10 @@ libc { # missing function from the experimental locale implementation __nl_langinfo_l; } + GLIBC_PRIVATE { + # global variables + __collate_element_hash; __collate_element_strings; + __collate_symbol_classes; __collate_symbol_hash; __collate_symbol_strings; + _nl_current_LC_COLLATE; _nl_current_LC_CTYPE; + } } --- libc/misc/sys/cdefs.h.jj Wed Nov 21 13:32:30 2001 +++ libc/misc/sys/cdefs.h Fri Feb 1 13:22:20 2002 @@ -165,8 +165,10 @@ (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (3,1) # define __attribute_used__ __attribute__ ((__used__)) +# define __attribute_noinline__ __attribute__ ((__noinline__)) #else # define __attribute_used__ __attribute__ ((__unused__)) +# define __attribute_noinline__ /* Ignore */ #endif /* At some point during the gcc 2.8 development the `format_arg' attribute --- libc/misc/Versions.jj Fri Sep 29 12:56:59 2000 +++ libc/misc/Versions Fri Feb 1 13:22:20 2002 @@ -3,10 +3,6 @@ libc { # global variables ___brk_addr; __curbrk; __progname; __progname_full; - # functions which have an additional interface since they are - # are cancelable. - __libc_fsync; __libc_msync; - # interface of malloc functions __sbrk; __getpagesize; @@ -112,4 +108,9 @@ libc { # p* posix_madvise; } + GLIBC_PRIVATE { + # functions which have an additional interface since they are + # cancelable. + __libc_fsync; __libc_msync; + } } --- libc/nis/Versions.jj Wed Aug 2 21:36:30 2000 +++ libc/nis/Versions Fri Feb 1 13:22:20 2002 @@ -60,20 +60,18 @@ libnsl { } libnss_compat { - GLIBC_2.0 { + GLIBC_PRIVATE { _nss_compat_endgrent; _nss_compat_endpwent; _nss_compat_endspent; _nss_compat_getgrent_r; _nss_compat_getgrgid_r; _nss_compat_getgrnam_r; _nss_compat_getpwent_r; _nss_compat_getpwnam_r; _nss_compat_getpwuid_r; _nss_compat_getspent_r; _nss_compat_getspnam_r; _nss_compat_setgrent; _nss_compat_setpwent; _nss_compat_setspent; - } - GLIBC_2.2 { _nss_compat_initgroups_dyn; } } libnss_nis { - GLIBC_2.0 { + GLIBC_PRIVATE { _nss_nis_endaliasent; _nss_nis_endetherent; _nss_nis_endgrent; _nss_nis_endhostent; _nss_nis_endnetent; _nss_nis_endnetgrent; _nss_nis_endprotoent; _nss_nis_endpwent; _nss_nis_endrpcent; @@ -93,14 +91,12 @@ libnss_nis { _nss_nis_setgrent; _nss_nis_sethostent; _nss_nis_setnetent; _nss_nis_setnetgrent; _nss_nis_setprotoent; _nss_nis_setpwent; _nss_nis_setrpcent; _nss_nis_setservent; _nss_nis_setspent; - } - GLIBC_2.2 { _nss_nis_initgroups_dyn; } } libnss_nisplus { - GLIBC_2.1 { + GLIBC_PRIVATE { _nss_nisplus_endaliasent; _nss_nisplus_endetherent; _nss_nisplus_endgrent; _nss_nisplus_endhostent; _nss_nisplus_endnetent; _nss_nisplus_endnetgrent; _nss_nisplus_endprotoent; _nss_nisplus_endpwent; _nss_nisplus_endrpcent; --- libc/nss/Versions.jj Wed Jan 31 16:35:04 2001 +++ libc/nss/Versions Fri Feb 1 13:22:20 2002 @@ -2,16 +2,18 @@ libc { GLIBC_2.0 { # functions used in other libraries __nss_passwd_lookup; __nss_group_lookup; __nss_hosts_lookup; __nss_next; - _nss_files_parse_grent; _nss_files_parse_pwent; _nss_files_parse_spent; __nss_database_lookup; __nss_configure_lookup; } GLIBC_2.2.2 { __nss_hostname_digits_dots; } + GLIBC_PRIVATE { + _nss_files_parse_grent; _nss_files_parse_pwent; _nss_files_parse_spent; + } } libnss_files { - GLIBC_2.0 { + GLIBC_PRIVATE { _nss_files_setaliasent; _nss_files_endaliasent; _nss_files_getaliasbyname_r; @@ -81,8 +83,6 @@ libnss_files { _nss_files_getspnam_r; _nss_netgroup_parseline; - } - GLIBC_2.1 { _nss_files_getpublickey; _nss_files_getsecretkey; } --- libc/posix/Versions.jj Fri Mar 16 10:01:23 2001 +++ libc/posix/Versions Fri Feb 1 13:22:20 2002 @@ -3,10 +3,6 @@ libc { # functions with special/multiple interfaces __bsd_getpgrp; __setpgid; __getpgid; - # functions which have an additional interface since they are - # are cancelable. - __libc_wait; __libc_waitpid; __libc_pause; __libc_nanosleep; - # functions with required interface outside normal name space _exit; @@ -86,11 +82,7 @@ libc { } GLIBC_2.1.2 { # functions used in other libraries - __libc_fork; __vfork; - } - GLIBC_2.1.3 { - # For the cancelation wrappers. - __libc_pread; __libc_pread64; __libc_pwrite; __libc_pwrite64; + __vfork; } GLIBC_2.2 { # p* @@ -113,4 +105,10 @@ libc { # Extended Interface. fnmatch; } + GLIBC_PRIVATE { + # functions which have an additional interface since they are + # are cancelable. + __libc_wait; __libc_waitpid; __libc_pause; __libc_nanosleep; __libc_fork; + __libc_pread; __libc_pread64; __libc_pwrite; __libc_pwrite64; + } } --- libc/resolv/Versions.jj Mon Mar 5 11:58:07 2001 +++ libc/resolv/Versions Fri Feb 1 13:22:20 2002 @@ -22,7 +22,7 @@ libc { # r* __res_state; __res_init; __res_nclose; __res_ninit; _res_hconf; } - GLIBC_2.2.3 { + GLIBC_PRIVATE { __gai_sigqueue; } } @@ -49,21 +49,21 @@ libresolv { __res_send; __sym_ntop; __sym_ntos; __sym_ston; } - GLIBC_2.1 { - # Needed in libnss_dns. - __ns_name_unpack; __ns_name_ntop; - } GLIBC_2.2 { __dn_expand; - __ns_get16; __ns_samename; __res_hostalias; __res_mkquery; __res_nmkquery; __res_nquery; __res_nquerydomain; __res_nsearch; __res_nsend; __res_query; __res_querydomain; __res_search; } + GLIBC_PRIVATE { + # Needed in libnss_dns. + __ns_name_unpack; __ns_name_ntop; + __ns_get16; __ns_samename; + } } libnss_dns { - GLIBC_2.0 { + GLIBC_PRIVATE { _nss_dns_gethostbyaddr_r; _nss_dns_gethostbyname2_r; _nss_dns_gethostbyname_r; _nss_dns_getnetbyaddr_r; _nss_dns_getnetbyname_r; --- libc/setjmp/Versions.jj Fri Jul 3 00:32:40 1998 +++ libc/setjmp/Versions Fri Feb 1 13:22:20 2002 @@ -9,7 +9,7 @@ libc { # s* setjmp; } - GLIBC_2.1 { + GLIBC_PRIVATE { # helper functions __libc_longjmp; __libc_siglongjmp; } --- libc/socket/Versions.jj Mon Jun 25 10:34:46 2001 +++ libc/socket/Versions Fri Feb 1 13:22:20 2002 @@ -1,10 +1,5 @@ libc { GLIBC_2.0 { - # functions which have an additional interface since they are - # are cancelable. - __libc_accept; __libc_send; __libc_recvfrom; - __libc_recvmsg; __libc_sendmsg; __libc_recv; __libc_sendto; __libc_connect; - # functions used in other libraries __connect; __send; @@ -36,4 +31,10 @@ libc { # Addition from P1003.1-200x sockatmark; } + GLIBC_PRIVATE { + # functions which have an additional interface since they are + # cancelable. + __libc_accept; __libc_send; __libc_recvfrom; + __libc_recvmsg; __libc_sendmsg; __libc_recv; __libc_sendto; __libc_connect; + } } --- libc/stdio-common/Versions.jj Sat Aug 8 21:48:39 1998 +++ libc/stdio-common/Versions Fri Feb 1 13:22:20 2002 @@ -1,8 +1,7 @@ libc { GLIBC_2.0 { # global variables - _itoa_lower_digits; _itoa_upper_digits; _sys_errlist; _sys_nerr; - _sys_siglist; + _sys_errlist; _sys_nerr; _sys_siglist; # functions used in other libraries __printf_fp; __vfscanf; @@ -47,4 +46,7 @@ libc { # t* tmpfile; tmpfile64; } + GLIBC_PRIVATE { + # global variables + _itoa_lower_digits; _itoa_upper_digits; } --- libc/stdlib/Versions.jj Mon Mar 12 10:55:45 2001 +++ libc/stdlib/Versions Fri Feb 1 13:22:20 2002 @@ -1,9 +1,5 @@ libc { GLIBC_2.0 { - # functions which have an additional interface since they are - # are cancelable. - __libc_system; - # functions with required interface outside normal name space __xpg_basename; @@ -94,4 +90,9 @@ libc { # used by new G++ ABI __cxa_atexit; __cxa_finalize; } + GLIBC_PRIVATE { + # functions which have an additional interface since they are + # are cancelable. + __libc_system; + } } --- libc/sunrpc/Versions.jj Mon Mar 26 10:02:25 2001 +++ libc/sunrpc/Versions Fri Feb 1 13:22:20 2002 @@ -110,7 +110,11 @@ libc { svc_getreq_common; svc_getreq_poll; svc_max_pollfd; svc_pollfd; } GLIBC_2.2.3 { - __rpc_thread_destroy; __rpc_thread_svc_fdset; __rpc_thread_createerr; + __rpc_thread_svc_fdset; __rpc_thread_createerr; __rpc_thread_svc_pollfd; __rpc_thread_svc_max_pollfd; } + GLIBC_PRIVATE { + # needed by libpthread. + __rpc_thread_destroy; + } } --- libc/sysdeps/hppa/Versions.jj Wed Apr 25 12:39:50 2001 +++ libc/sysdeps/hppa/Versions Fri Feb 1 13:22:20 2002 @@ -1,5 +1,5 @@ ld { - GLIBC_2.2 { + GLIBC_PRIVATE { # hppa specific functions in the dynamic linker, but used by libc.so. _dl_symbol_address; _dl_unmap; _dl_lookup_address; _dl_function_address; --- libc/sysdeps/ia64/fpu/Versions.jj Mon Feb 19 09:40:36 2001 +++ libc/sysdeps/ia64/fpu/Versions Fri Feb 1 13:22:20 2002 @@ -1,5 +1,5 @@ libc { - GLIBC_2.2.3 { + GLIBC_PRIVATE { __libm_frexp_4; __libm_frexp_4f; __libm_frexp_4l; __libm_error_support; } } --- libc/sysdeps/ia64/Versions.jj Fri Feb 1 11:01:18 2002 +++ libc/sysdeps/ia64/Versions Fri Feb 1 13:22:47 2002 @@ -1,5 +1,5 @@ ld { - GLIBC_2.2 { + GLIBC_PRIVATE { # ia64 specific functions in the dynamic linker, but used by libc.so. _dl_symbol_address; _dl_unmap; _dl_lookup_address; _dl_function_address; --- libc/sysdeps/unix/sysv/linux/ia64/Versions.jj Wed Jan 31 16:35:23 2001 +++ libc/sysdeps/unix/sysv/linux/ia64/Versions Fri Feb 1 13:22:20 2002 @@ -1,9 +1,5 @@ ld { - GLIBC_2.2 { - # global variables needed in the libc. - _dl_pagesize; - } - GLIBC_2.2.1 { + GLIBC_PRIVATE { _dl_var_init; } } --- libc/sysdeps/unix/sysv/linux/i386/Versions.jj Wed Nov 21 13:32:59 2001 +++ libc/sysdeps/unix/sysv/linux/i386/Versions Fri Feb 1 13:22:20 2002 @@ -9,7 +9,7 @@ libc { vm86; } GLIBC_2.1 { - __modify_ldt; modify_ldt; + modify_ldt; } GLIBC_2.2 { # functions used in other libraries @@ -33,4 +33,7 @@ libc { # v* versionsort64; } + GLIBC_PRIVATE { + __modify_ldt; + } } --- libc/sysdeps/unix/sysv/linux/x86_64/Versions.jj Mon Dec 10 19:19:21 2001 +++ libc/sysdeps/unix/sysv/linux/x86_64/Versions Fri Feb 1 13:22:20 2002 @@ -4,6 +4,9 @@ libc { ioperm; iopl; - __modify_ldt; modify_ldt; + modify_ldt; + } + GLIBC_PRIVATE { + __modify_ldt; } } --- libc/sysdeps/unix/sysv/linux/Versions.jj Thu Nov 23 14:42:19 2000 +++ libc/sysdeps/unix/sysv/linux/Versions Fri Feb 1 13:22:20 2002 @@ -55,9 +55,6 @@ libc { # functions used in inline functions or macros __libc_sa_len; - # functions used in other libraries - __syscall_rt_sigqueueinfo; - # Since we have new signals this structure changed. _sys_siglist; sys_siglist; sys_sigabbrev; @@ -84,8 +81,7 @@ libc { } GLIBC_2.2 { # needed in other libraries. - __endmntent; __getmntent_r; __setmntent; __statfs; __libc_sigaction; - __sysctl; + __endmntent; __getmntent_r; __setmntent; __statfs; __sysctl; # ipc ctl interface change. semctl; shmctl; msgctl; @@ -94,4 +90,11 @@ libc { # p* pivot_root; } + GLIBC_PRIVATE { + # needed by libpthread. + __libc_sigaction; + + # functions used in other libraries + __syscall_rt_sigqueueinfo; + } } --- libc/sysdeps/unix/sysv/linux/lxstat64.c.jj Thu Aug 23 18:50:44 2001 +++ libc/sysdeps/unix/sysv/linux/lxstat64.c Fri Feb 1 13:34:21 2002 @@ -1,5 +1,5 @@ /* lxstat64 using old-style Unix lstat system call. - 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 @@ -87,11 +87,16 @@ ___lxstat64 (int vers, const char *name, #endif } -#include +#ifndef RTLD_STAT64 +# include versioned_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2); -#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) +# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) strong_alias (___lxstat64, __old__lxstat64) compat_symbol (libc, __old__lxstat64, __lxstat64, GLIBC_2_1); +# endif + +#else +strong_alias (___lxstat64, __lxstat64); #endif --- libc/sysdeps/unix/sysv/linux/xstat64.c.jj Thu Aug 23 18:50:47 2001 +++ libc/sysdeps/unix/sysv/linux/xstat64.c Fri Feb 1 13:34:21 2002 @@ -1,5 +1,5 @@ /* xstat64 using old-style Unix stat system call. - Copyright (C) 1991,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1991,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 @@ -91,11 +91,16 @@ ___xstat64 (int vers, const char *name, #endif } -#include +#ifndef RTLD_STAT64 +# include versioned_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2); -#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) +# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) strong_alias (___xstat64, __old__xstat64) compat_symbol (libc, __old__xstat64, __xstat64, GLIBC_2_1); +# endif + +#else +strong_alias (___xstat64, __xstat64); #endif --- libc/sysdeps/unix/sysv/linux/fxstat64.c.jj Thu Aug 23 18:50:44 2001 +++ libc/sysdeps/unix/sysv/linux/fxstat64.c Fri Feb 1 13:34:21 2002 @@ -1,5 +1,5 @@ /* fxstat64 using old-style Unix fstat system call. - 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 @@ -85,11 +85,16 @@ ___fxstat64 (int vers, int fd, struct st #endif } -#include +#ifndef RTLD_STAT64 +# include versioned_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2); -#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) +# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) strong_alias (___fxstat64, __old__fxstat64) compat_symbol (libc, __old__fxstat64, __fxstat64, GLIBC_2_1); +# endif + +#else +strong_alias (___fxstat64, __fxstat64); #endif --- libc/termios/Versions.jj Fri Jul 3 00:33:49 1998 +++ libc/termios/Versions Fri Feb 1 13:22:20 2002 @@ -1,9 +1,5 @@ libc { GLIBC_2.0 { - # functions which have an additional interface since they are - # are cancelable. - __libc_tcdrain; - # c* cfgetispeed; cfgetospeed; cfmakeraw; cfsetispeed; cfsetospeed; cfsetspeed; @@ -15,4 +11,9 @@ libc { # t* tcgetsid; } + GLIBC_PRIVATE { + # functions which have an additional interface since they are + # are cancelable. + __libc_tcdrain; + } } --- libc/Versions.def.jj Thu Jan 31 11:40:28 2002 +++ libc/Versions.def Fri Feb 1 13:41:16 2002 @@ -20,15 +20,11 @@ libc { %ifdef EXPORT_UNWIND_FIND_FDE GCC_3.0 %endif + GLIBC_PRIVATE } libcrypt { GLIBC_2.0 } -libdb { - GLIBC_2.0 - GLIBC_2.1 - GLIBC_2.2 -} libdl { GLIBC_2.0 GLIBC_2.1 @@ -45,27 +41,22 @@ libnsl { GLIBC_2.2 } libnss_compat { - GLIBC_2.0 -} -libnss_db { - GLIBC_2.0 + GLIBC_PRIVATE } libnss_dns { - GLIBC_2.0 + GLIBC_PRIVATE } libnss_files { - GLIBC_2.0 - GLIBC_2.1 + GLIBC_PRIVATE } libnss_hesiod { - GLIBC_2.1 - GLIBC_2.2 + GLIBC_PRIVATE } libnss_nis { - GLIBC_2.0 + GLIBC_PRIVATE } libnss_nisplus { - GLIBC_2.0 + GLIBC_PRIVATE } libpthread { GLIBC_2.0 @@ -74,11 +65,12 @@ libpthread { GLIBC_2.1.2 GLIBC_2.2 GLIBC_2.2.3 + GLIBC_PRIVATE } libresolv { GLIBC_2.0 - GLIBC_2.1 GLIBC_2.2 + GLIBC_PRIVATE } librt { GLIBC_2.1 @@ -87,17 +79,10 @@ librt { libutil { GLIBC_2.0 } -libdb1 { - GLIBC_2.0 -} ld { GLIBC_2.0 GLIBC_2.1 - GLIBC_2.1.1 - GLIBC_2.2 - GLIBC_2.2.1 - GLIBC_2.2.3 - GLIBC_2.3 + GLIBC_PRIVATE } libthread_db { GLIBC_2.1.3 Jakub From drepper@redhat.com Fri Feb 1 10:26:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 01 Feb 2002 10:26:00 -0000 Subject: sysdeps/generic/dl-procinfo.c missing In-Reply-To: References: Message-ID: Andreas Schwab writes: > sysdeps/generic/ldsodefs.h includes , but that only exists > for some platforms. Yep, sorry. Forgot to check it in. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Feb 1 11:06:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 01 Feb 2002 11:06:00 -0000 Subject: [PATCH] Further _rtld_global bugfixes In-Reply-To: <20020201120243.K618@sunsite.ms.mff.cuni.cz> References: <20020201120243.K618@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > This was found by grepping through the source and reading -Dyesterday -rHEAD > CVS diff. Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Feb 1 12:34:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 01 Feb 2002 12:34:00 -0000 Subject: locale file changes Message-ID: I've just checked in a bug fix for localedef. The bug resulted in incorrect locale files to be created for locales which define collation elements. There are not many and the programs hitting are very rare but it is still advised to regenerate all locale files. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Feb 1 15:27:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 01 Feb 2002 15:27:00 -0000 Subject: [PATCH] Updated GLIBC_PRIVATE In-Reply-To: <20020201135755.M618@sunsite.ms.mff.cuni.cz> References: <20020201135755.M618@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Bootstrapped on i686, no make check failures. Yep. And I've looked at some programs/libraries which could have caused problems and found none. Thanks. But we nevertheless means we need more testing. It would be really good if the distribution makers could run a script on a fully loaded machine which finds all executables and runs "ldd -v" on them. ldd will report unknown versions or symbols etc. I hope everybody here realizes how this change effects adding new entries to Versions files. Every interface which is not exported because it is meant to be used by users has to go in the GLIBC_PRIVATE version. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From rth@twiddle.net Fri Feb 1 18:19:00 2002 From: rth@twiddle.net (Richard Henderson) Date: Fri, 01 Feb 2002 18:19:00 -0000 Subject: ld.so changes In-Reply-To: ; from drepper@redhat.com on Wed, Jan 30, 2002 at 07:47:03PM -0800 References: Message-ID: <20020201181953.A12337@are.twiddle.net> On Wed, Jan 30, 2002 at 07:47:03PM -0800, Ulrich Drepper wrote: > Which reminds me. The IA64 startup code pokes into _dl_argv. I've got a rewrite hanging around somewhere. I'll try to dig it up and dust it off. r~ From schwab@suse.de Sat Feb 2 15:15:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Sat, 02 Feb 2002 15:15:00 -0000 Subject: TIMEOUT for tst-rndseek Message-ID: stdio-common/tst-rndseek takes nearly 4 seconds on m68k. Andreas. 2002-02-03 Andreas Schwab * stdio-common/tst-rndseek.c: Increase timeout. --- stdio-common/tst-rndseek.c.~1.2.~ Mon Jan 21 11:09:07 2002 +++ stdio-common/tst-rndseek.c Sun Feb 3 00:12:10 2002 @@ -10,6 +10,7 @@ static int do_test (void); #define TEST_FUNCTION do_test () +#define TIMEOUT 4 #include "../test-skeleton.c" -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Sat Feb 2 16:44:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 02 Feb 2002 16:44:00 -0000 Subject: INT() and INTDEF() Message-ID: I just committed a batch of changes which eliminates all unnecessary PLT entries from ld.so. Some functions were exported and also user internally. But these functions must never be interposed. The solution is to define aliases and use them instead. This is what the INT and INTDEF macros do. It is no big problem to miss adding these wrappers. The code will run just fine. It's just something which has to be cleaned up before a release. It is a problem to add the macro when it is not needed. E.g., the dl-open, dl-close, dl-sym files cannot use them because these files end up in libc.so. The linker will tell you if you've done something wrong. Besides using INT() I've also removed two symbols from the Versions file. I could find nor think of a place where those are used. Please look out in case you see some problem which could be explained by these symbols not being exported. The result of the whole exercised that we have 20 PLT entries less, saved about 600bytes of text and 60bytes of data, and the linker was able to convert PLT calls to cheaper relative calls. On my machine this meant another 5% reduction in startup time. Using INT in ld.so is only the first step. If you look at my 2.3 todo list you'll see it mentioned for the whole libc. But the job there will be not so easy. We'll have to decide which symbol can be interposed. There are some obvious candidates (malloc & friends) and some necessary one (all function which can cancellable in the thread library). IMO everything else should be private. If somebody, for instance, reliese on fopen() be implemented with a call to open() s/he makes an assumption which isn't necessarily true. open64() could be used instead, on micro-kernel systems some lower-level code could be used, or (as on the 2.3 list) the syscall could be used directly. The only sane way is to intercept all calls which go into the libc and regard the libc itself as a black box. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Feb 2 17:02:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 02 Feb 2002 17:02:00 -0000 Subject: TIMEOUT for tst-rndseek In-Reply-To: References: Message-ID: Andreas Schwab writes: > stdio-common/tst-rndseek takes nearly 4 seconds on m68k. Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kkojima@rr.iij4u.or.jp Sat Feb 2 17:06:00 2002 From: kkojima@rr.iij4u.or.jp (kaz Kojima) Date: Sat, 02 Feb 2002 17:06:00 -0000 Subject: Updated GLIBC_PRIVATE : SH port Message-ID: <200202030106.g13167A09485@r-rr.iij4u.or.jp> Hi, I've tested current cvs for SH. I found no problem except a typo in sysdeps/sh/dl-machine.h. kaz -- 2002-02-03 kaz Kojima * sysdeps/sh/dl-machine.h (elf_machine_rela): Fix a typo. Index: dl-machine.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/sh/dl-machine.h,v retrieving revision 1.16 diff -u -r1.16 dl-machine.h --- dl-machine.h 2002/02/01 01:32:02 1.16 +++ dl-machine.h 2002/02/02 09:22:11 @@ -513,7 +513,7 @@ found. */ break; if (sym->st_size > refsym->st_size - || (sym->st_size < erefsym->st_size && GL(dl_verbose))) + || (sym->st_size < refsym->st_size && GL(dl_verbose))) { const char *strtab; From drepper@redhat.com Sat Feb 2 18:22:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 02 Feb 2002 18:22:00 -0000 Subject: Updated GLIBC_PRIVATE : SH port In-Reply-To: <200202030106.g13167A09485@r-rr.iij4u.or.jp> References: <200202030106.g13167A09485@r-rr.iij4u.or.jp> Message-ID: kaz Kojima writes: > I've tested current cvs for SH. I found no problem except > a typo in sysdeps/sh/dl-machine.h. Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From schwab@suse.de Sun Feb 3 10:41:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Sun, 03 Feb 2002 10:41:00 -0000 Subject: readv update for POSIX.1-2001 In-Reply-To: <20020203191933.A2424@suse.de> (Thorsten Kukuk's message of "Sun, 3 Feb 2002 19:19:33 +0100") References: <20020203191933.A2424@suse.de> Message-ID: Thorsten Kukuk writes: |> On Thu, Jan 31, Ulrich Drepper wrote: |> |> > Andreas Schwab writes: |> > |> > > POSIX.1-2001 requires that readv fails with EINVAL if the total buffer |> > > length overflows the range of ssize_t. |> > |> > Thanks. I've also made the code a bit more robust. |> |> The same is necessary for writev, too. I append a patch for it. |> |> Thorsten Here is an additional patch to make them 64bit clean. 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. Index: sysdeps/posix/readv.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/posix/readv.c,v retrieving revision 1.9 diff -u -a -u -r1.9 sysdeps/posix/readv.c --- sysdeps/posix/readv.c 2002/01/31 19:24:14 1.9 +++ sysdeps/posix/readv.c 2002/02/03 18:36:25 @@ -38,7 +38,7 @@ char *buffer; char *buffer_start; size_t bytes; - int bytes_read; + ssize_t bytes_read; int i; bool use_malloc = false; --- sysdeps/posix/writev.c +++ sysdeps/posix/writev.c @@ -38,7 +38,7 @@ char *buffer; register char *bp; size_t bytes, to_copy; - int bytes_written; + ssize_t bytes_written; int i; bool use_malloc = false; @@ -65,7 +65,7 @@ { buffer = (char *) malloc (bytes); if (buffer == NULL) - /* XXX I don't know whether it is acceptable to try reading + /* XXX I don't know whether it is acceptable to try writing the data in chunks. Probably not so we just fail here. */ return -1; -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Sun Feb 3 22:52:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 03 Feb 2002 22:52:00 -0000 Subject: readv update for POSIX.1-2001 In-Reply-To: <20020203191933.A2424@suse.de> References: <20020203191933.A2424@suse.de> Message-ID: Thanks, I've applied this patch and Andreas'. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Sun Feb 3 23:15:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Sun, 03 Feb 2002 23:15:00 -0000 Subject: sysdeps/i386/elf/configure.in Message-ID: <20020204081930.W618@sunsite.ms.mff.cuni.cz> Hi! .section ".tbss", "awT", @nobits .comm bar,4,4 will not create bar as STT_TLS symbol in .tbss. Either .section ".tbss", "awT", @nobits .globl bar bar: .skip 4 or (but not yet implemented) the Sun way: .tls_common bar,4,4 Jakub From drepper@redhat.com Mon Feb 4 00:12:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 04 Feb 2002 00:12:00 -0000 Subject: sysdeps/i386/elf/configure.in In-Reply-To: <20020204081930.W618@sunsite.ms.mff.cuni.cz> References: <20020204081930.W618@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > .section ".tbss", "awT", @nobits > .globl bar > bar: .skip 4 I've used this now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Mon Feb 4 07:40:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 04 Feb 2002 07:40:00 -0000 Subject: INT() and INTDEF() In-Reply-To: ; from Ulrich Drepper on Sat, Feb 02, 2002 at 04:44:32PM -0800 References: Message-ID: <20020204164245.A532@sunsite.ms.mff.cuni.cz> On Sat, Feb 02, 2002 at 04:44:32PM -0800, Ulrich Drepper wrote: > I just committed a batch of changes which eliminates all unnecessary > PLT entries from ld.so. Some functions were exported and also user > internally. But these functions must never be interposed. > > The solution is to define aliases and use them instead. This is what > the INT and INTDEF macros do. > > It is no big problem to miss adding these wrappers. The code will run > just fine. It's just something which has to be cleaned up before a > release. It is a problem to add the macro when it is not needed. > E.g., the dl-open, dl-close, dl-sym files cannot use them because > these files end up in libc.so. The linker will tell you if you've > done something wrong. > > Besides using INT() I've also removed two symbols from the Versions > file. I could find nor think of a place where those are used. Please > look out in case you see some problem which could be explained by > these symbols not being exported. > > The result of the whole exercised that we have 20 PLT entries less, > saved about 600bytes of text and 60bytes of data, and the linker was > able to convert PLT calls to cheaper relative calls. On my machine > this meant another 5% reduction in startup time. I think we could use similar thing for _rtld_global (ie. have one .hidden _rtld_global_internal and _rtld_global for use in libc). This would require finally applying a patch to recognize __attribute__((visibility (hidden))) and similar and the compiler could use this information where appropriate (e.g. on IA-32 it could use @GOTOFF instead of @GOT for hidden variables). Instead of: movl _rtld_global@GOT(%ebx), %eax movl 8(%eax), %eax could use: movl 8+_rtld_global_internal@GOTOFF(%ebx), %eax glibc just would have to differentiate at compile time between objects which will go solely into ld.so and other objects. Richard, do you think __attribute__((visibility (hidden))) patch might be acceptable for 3.1 still? > Using INT in ld.so is only the first step. If you look at my 2.3 todo > list you'll see it mentioned for the whole libc. But the job there > will be not so easy. We'll have to decide which symbol can be > interposed. There are some obvious candidates (malloc & friends) and > some necessary one (all function which can cancellable in the thread > library). IMO everything else should be private. If somebody, for > instance, reliese on fopen() be implemented with a call to open() s/he > makes an assumption which isn't necessarily true. open64() could be > used instead, on micro-kernel systems some lower-level code could be > used, or (as on the 2.3 list) the syscall could be used directly. The > only sane way is to intercept all calls which go into the libc and > regard the libc itself as a black box. Jakub From schwab@suse.de Mon Feb 4 08:16:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Mon, 04 Feb 2002 08:16:00 -0000 Subject: dl-load.c in glibc-2.2 branch Message-ID: This fixes an off-by-one that causes crashes due to reading past EOS, triggered by the changes in _dl_dst_count and _dl_dst_substitute. Andreas. 2002-02-04 Andreas Schwab * elf/dl-load.c (is_dst): Fix return value as expected by caller. --- elf/dl-load.c.~1.184.2.2.~ Mon Feb 4 11:29:04 2002 +++ elf/dl-load.c Mon Feb 4 16:26:48 2002 @@ -165,16 +165,16 @@ size_t len; if (strncmp (name, str, cmplen) == 0) - len = cmplen + 1; + len = cmplen; else if (strncmp (name, str + 1, cmplen - 2) == 0 && (name[cmplen - 2] == '\0' || name[cmplen - 2] == '/' || (is_path && name[cmplen - 2] == ':'))) - len = cmplen - 1; + len = cmplen - 2; else 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; -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From aj@suse.de Mon Feb 4 08:36:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 04 Feb 2002 08:36:00 -0000 Subject: Versioning problem with __register_frame References: <20020130140242.E618@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > On Wed, Jan 30, 2002 at 01:45:35PM +0100, Andreas Schwab wrote: >> "Martin Schwidefsky" writes: >> >> |> Does this mean that we have to make them GLIBC_2.0 versioned symbols >> |> although the earliest symbol set for s390x is GLIBC_2.2 ? >> >> This will be automatically handled. Even many Versions files list symbols >> under the GLIBC_2.0 version the shared library will not contain versions >> prior to the earliest version as specified in shlib-versions. See the >> generated file Versions.all in the build directory to see how it works. > > Though in this case it will cause only problems. > GCC libgcc-glibc.ver uses: > > %inherit GCC_3.0 GLIBC_2.0 > GLIBC_2.0 { > ... > __register_frame_info > ... > } > > So, either gcc needs to be changed so that for selected targets it will use > different symbol for these symbols instead of GLIBC_2.0, or glibc needs to > export them as GLIBC_2.0 unconditionally. So, what should be done? Or what can be done easier? If we fix it in GCC we should do it asap so that the fix will be in 3.1. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Mon Feb 4 09:04:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 04 Feb 2002 09:04:00 -0000 Subject: dl-load.c in glibc-2.2 branch In-Reply-To: References: Message-ID: Andreas Schwab writes: > 2002-02-04 Andreas Schwab > > * elf/dl-load.c (is_dst): Fix return value as expected by caller. Test case? -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kukuk@suse.de Mon Feb 4 09:05:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Mon, 04 Feb 2002 09:05:00 -0000 Subject: dl-load.c in glibc-2.2 branch In-Reply-To: References: Message-ID: <20020204180530.A29772@suse.de> On Mon, Feb 04, Ulrich Drepper wrote: > Andreas Schwab writes: > > > 2002-02-04 Andreas Schwab > > > > * elf/dl-load.c (is_dst): Fix return value as expected by caller. > > Test case? cvs version of glibc-2.2-branch, run make check. All tests in iconvdata will abort with a seg.fault. Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE GmbH Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From schwidefsky@de.ibm.com Mon Feb 4 09:52:00 2002 From: schwidefsky@de.ibm.com (Martin Schwidefsky) Date: Mon, 04 Feb 2002 09:52:00 -0000 Subject: Versioning problem with __register_frame Message-ID: >> On Wed, Jan 30, 2002 at 01:45:35PM +0100, Andreas Schwab wrote: >>> "Martin Schwidefsky" writes: >>> >>> |> Does this mean that we have to make them GLIBC_2.0 versioned symbols >>> |> although the earliest symbol set for s390x is GLIBC_2.2 ? >>> >>> This will be automatically handled. Even many Versions files list symbols >>> under the GLIBC_2.0 version the shared library will not contain versions >>> prior to the earliest version as specified in shlib-versions. See the >>> generated file Versions.all in the build directory to see how it works. >> >> Though in this case it will cause only problems. >> GCC libgcc-glibc.ver uses: >> >> %inherit GCC_3.0 GLIBC_2.0 >> GLIBC_2.0 { >> ... >> __register_frame_info >> ... >> } >> >> So, either gcc needs to be changed so that for selected targets it will use >> different symbol for these symbols instead of GLIBC_2.0, or glibc needs to >> export them as GLIBC_2.0 unconditionally. > >So, what should be done? Or what can be done easier? If we fix it in >GCC we should do it asap so that the fix will be in 3.1. We have build a test driver with a glibc 2.2.5 and GLIBC_2.2 version for the missing symbols. That works with gcc 2.95.3. Uli tried to switch to gcc 3.1 but that failed because gcc 3.1 defines GLIBC_2.0 symbols on its own. So either we make these symbols gcc defines GLIBC_2.0 symbols (I really would hate to do that, if it is possible at all), or convince gcc 3.1 that these symbols are GLIBC_2.2 for s390x. blue skies, Martin Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch?naicherstr. 220, D-71032 B?blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com From drepper@redhat.com Mon Feb 4 09:56:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 04 Feb 2002 09:56:00 -0000 Subject: dl-load.c in glibc-2.2 branch In-Reply-To: References: Message-ID: Andreas Schwab writes: > 2002-02-04 Andreas Schwab > > * elf/dl-load.c (is_dst): Fix return value as expected by caller. I've applied his patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Feb 4 11:25:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 04 Feb 2002 11:25:00 -0000 Subject: Versioning problem with __register_frame In-Reply-To: References: Message-ID: "Martin Schwidefsky" writes: > or convince gcc 3.1 that these symbols are GLIBC_2.2 for s390x. I don't think there is much to convince. You determine the ABI. If gcc wants to define some symbols in the ABI they have to obey your rules. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From schwab@suse.de Mon Feb 4 13:23:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Mon, 04 Feb 2002 13:23:00 -0000 Subject: Unreadable localedef messages Message-ID: localedef does not correctly output error messages because LC_CTYPE has been reset to POSIX. We need to temporarily switch back to the inherited locale for output. Unfortunately we cannot just define wrapper functions around error and error_at_line, because there are no va_list variants for them, so the WITH_CUR_LOCALE macro needs to be rather mouthful. Andreas. 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. Index: locale/programs/charmap-dir.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/charmap-dir.c,v retrieving revision 1.3 diff -u -a -r1.3 locale/programs/charmap-dir.c --- locale/programs/charmap-dir.c 2001/07/06 04:55:33 1.3 +++ locale/programs/charmap-dir.c 2002/02/04 21:03:01 @@ -28,11 +28,9 @@ #include #include +#include "localedef.h" #include "charmap-dir.h" -extern void *xmalloc (size_t n); -extern void *xrealloc (void *p, size_t n); - /* The data type of a charmap directory being traversed. */ struct charmap_dir { @@ -58,8 +56,8 @@ dir = opendir (directory); if (dir == NULL) { - error (1, errno, gettext ("cannot read character map directory `%s'"), - directory); + WITH_CUR_LOCALE (error (1, errno, gettext ("\ +cannot read character map directory `%s'"), directory)); return NULL; } Index: locale/programs/charmap.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/charmap.c,v retrieving revision 1.37 diff -u -a -r1.37 locale/programs/charmap.c --- locale/programs/charmap.c 2002/01/11 06:46:13 1.37 +++ locale/programs/charmap.c 2002/02/04 21:03:01 @@ -29,8 +29,9 @@ #include #include #include +#include -#include "error.h" +#include "localedef.h" #include "linereader.h" #include "charmap.h" #include "charmap-dir.h" @@ -43,8 +44,6 @@ #include "charmap-kw.h" -extern void *xmalloc (size_t __n); - /* Prototypes for local functions. */ static struct charmap_t *parse_charmap (struct linereader *cmfile, int verbose, int be_quiet); @@ -133,7 +132,8 @@ result = parse_charmap (cmfile, verbose, be_quiet); if (result == NULL && !be_quiet) - error (0, errno, _("character map file `%s' not found"), filename); + WITH_CUR_LOCALE (error (0, errno, _("\ +character map file `%s' not found"), filename)); } } @@ -190,8 +190,8 @@ result = parse_charmap (cmfile, verbose, be_quiet); if (result == NULL) - error (4, errno, _("default character map file `%s' not found"), - DEFAULT_CHARMAP); + WITH_CUR_LOCALE (error (4, errno, _("\ +default character map file `%s' not found"), DEFAULT_CHARMAP)); } /* Test of ASCII compatibility of locale encoding. @@ -247,9 +247,9 @@ while (*p++ != '\0'); if (failed) - fprintf (stderr, _("\ + WITH_CUR_LOCALE (fprintf (stderr, _("\ character map `%s' is not ASCII compatible, locale not ISO C compliant\n"), - result->code_set_name); + result->code_set_name)); } return result; @@ -324,9 +324,9 @@ if (result->mb_cur_min > result->mb_cur_max) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: must be greater than \n"), - cmfile->fname); + cmfile->fname)); result->mb_cur_min = result->mb_cur_max; } @@ -829,14 +829,16 @@ continue; default: - error (5, 0, _("%s: error in state machine"), __FILE__); + WITH_CUR_LOCALE (error (5, 0, _("%s: error in state machine"), + __FILE__)); /* NOTREACHED */ } break; } if (state != 91 && !be_quiet) - error (0, 0, _("%s: premature end of file"), cmfile->fname); + WITH_CUR_LOCALE (error (0, 0, _("%s: premature end of file"), + cmfile->fname)); lr_close (cmfile); Index: locale/programs/ld-address.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-address.c,v retrieving revision 1.17 diff -u -a -r1.17 locale/programs/ld-address.c --- locale/programs/ld-address.c 2001/12/10 01:15:01 1.17 +++ locale/programs/ld-address.c 2002/02/04 21:03:01 @@ -29,6 +29,7 @@ #include +#include "localedef.h" #include "localeinfo.h" #include "locfile.h" @@ -128,8 +129,8 @@ if (address == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), - "LC_ADDRESS"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_ADDRESS")); address_startup (NULL, locale, 0); address = locale->categories[LC_ADDRESS].address; nothing = 1; @@ -139,8 +140,8 @@ if (address->postal_fmt == NULL) { if (! nothing) - error (0, 0, _("%s: field `%s' not defined"), - "LC_ADDRESS", "postal_fmt"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_ADDRESS", "postal_fmt")); /* Use as the default value the value of the i18n locale. */ address->postal_fmt = "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"; } @@ -151,8 +152,8 @@ const char *cp = address->postal_fmt; if (*cp == '\0') - error (0, 0, _("%s: field `%s' must not be empty"), - "LC_ADDRESS", "postal_fmt"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' must not be empty"), + "LC_ADDRESS", "postal_fmt")); else while (*cp != '\0') { @@ -163,9 +164,9 @@ ++cp; if (strchr ("afdbshNtreCzTSc%", *cp) == NULL) { - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: invalid escape `%%%c' sequence in field `%s'"), - "LC_ADDRESS", *cp, "postal_fmt"); + "LC_ADDRESS", *cp, "postal_fmt")); break; } } @@ -177,7 +178,8 @@ if (address->cat == NULL) \ { \ if (verbose && ! nothing) \ - error (0, 0, _("%s: field `%s' not defined"), "LC_ADDRESS", #cat); \ + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), \ + "LC_ADDRESS", #cat)); \ address->cat = ""; \ } @@ -194,16 +196,16 @@ if (address->lang_term == NULL) { if (verbose && ! nothing) - error (0, 0, _("%s: field `%s' not defined"), "LC_ADDRESS", - "lang_term"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_ADDRESS", "lang_term")); address->lang_term = ""; cnt = sizeof (iso639) / sizeof (iso639[0]); } else if (address->lang_term[0] == '\0') { if (verbose) - error (0, 0, _("%s: field `%s' must not be empty"), - "LC_ADDRESS", "lang_term"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' must not be empty"), + "LC_ADDRESS", "lang_term")); cnt = sizeof (iso639) / sizeof (iso639[0]); } else @@ -213,22 +215,23 @@ if (strcmp (address->lang_term, iso639[cnt].term) == 0) break; if (cnt == sizeof (iso639) / sizeof (iso639[0])) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: terminology language code `%s' not defined"), - "LC_ADDRESS", address->lang_term); + "LC_ADDRESS", address->lang_term)); } if (address->lang_ab == NULL) { if (verbose && ! nothing) - error (0, 0, _("%s: field `%s' not defined"), "LC_ADDRESS", "lang_ab"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_ADDRESS", "lang_ab")); address->lang_ab = ""; } else if (address->lang_ab[0] == '\0') { if (verbose) - error (0, 0, _("%s: field `%s' must not be empty"), - "LC_ADDRESS", "lang_ab"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' must not be empty"), + "LC_ADDRESS", "lang_ab")); } else { @@ -239,15 +242,15 @@ if (strcmp (address->lang_ab, iso639[cnt].ab) == 0) break; if (cnt == sizeof (iso639) / sizeof (iso639[0])) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: language abbreviation `%s' not defined"), - "LC_ADDRESS", address->lang_ab); + "LC_ADDRESS", address->lang_ab)); } else if (strcmp (iso639[cnt].ab, address->lang_ab) != 0) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: `%s' value does not match `%s' value"), - "LC_ADDRESS", "lang_ab", "lang_term"); + "LC_ADDRESS", "lang_ab", "lang_term")); } if (address->lang_lib == NULL) @@ -256,8 +259,8 @@ else if (address->lang_lib[0] == '\0') { if (verbose) - error (0, 0, _("%s: field `%s' must not be empty"), - "LC_ADDRESS", "lang_lib"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' must not be empty"), + "LC_ADDRESS", "lang_lib")); } else { @@ -267,22 +270,22 @@ if (strcmp (address->lang_lib, iso639[cnt].lib) == 0) break; if (cnt == sizeof (iso639) / sizeof (iso639[0])) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: language abbreviation `%s' not defined"), - "LC_ADDRESS", address->lang_lib); + "LC_ADDRESS", address->lang_lib)); } else if (strcmp (iso639[cnt].ab, address->lang_ab) != 0) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: `%s' value does not match `%s' value"), "LC_ADDRESS", "lang_lib", - helper == 1 ? "lang_term" : "lang_ab"); + helper == 1 ? "lang_term" : "lang_ab")); } if (address->country_num == 0) { if (verbose && ! nothing) - error (0, 0, _("%s: field `%s' not defined"), - "LC_ADDRESS", "country_num"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_ADDRESS", "country_num")); cnt = sizeof (iso3166) / sizeof (iso3166[0]); } else @@ -292,34 +295,36 @@ break; if (cnt == sizeof (iso3166) / sizeof (iso3166[0])) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: numeric country code `%d' not valid"), - "LC_ADDRESS", address->country_num); + "LC_ADDRESS", address->country_num)); } if (address->country_ab2 == NULL) { if (verbose && ! nothing) - error (0, 0, _("%s: field `%s' not defined"), - "LC_ADDRESS", "country_ab2"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_ADDRESS", "country_ab2")); address->country_ab2 = " "; } else if (cnt != sizeof (iso3166) / sizeof (iso3166[0]) && strcmp (address->country_ab2, iso3166[cnt].ab2) != 0) - error (0, 0, _("%s: `%s' value does not match `%s' value"), - "LC_ADDRESS", "country_ab2", "country_num"); + WITH_CUR_LOCALE (error (0, 0, + _("%s: `%s' value does not match `%s' value"), + "LC_ADDRESS", "country_ab2", "country_num")); if (address->country_ab3 == NULL) { if (verbose && ! nothing) - error (0, 0, _("%s: field `%s' not defined"), - "LC_ADDRESS", "country_ab3"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_ADDRESS", "country_ab3")); address->country_ab3 = " "; } else if (cnt != sizeof (iso3166) / sizeof (iso3166[0]) && strcmp (address->country_ab3, iso3166[cnt].ab3) != 0) - error (0, 0, _("%s: `%s' value does not match `%s' value"), - "LC_ADDRESS", "country_ab3", "country_num"); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: `%s' value does not match `%s' value"), + "LC_ADDRESS", "country_ab3", "country_num")); } Index: locale/programs/ld-collate.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-collate.c,v retrieving revision 1.100 diff -u -a -r1.100 locale/programs/ld-collate.c --- locale/programs/ld-collate.c 2002/02/01 20:24:32 1.100 +++ locale/programs/ld-collate.c 2002/02/04 21:03:01 @@ -27,11 +27,11 @@ #include #include +#include "localedef.h" #include "charmap.h" #include "localeinfo.h" #include "linereader.h" #include "locfile.h" -#include "localedef.h" #include "elem-hash.h" /* Uncomment the following line in the production version. */ @@ -1516,7 +1516,8 @@ { /* No data, no check. */ if (! be_quiet) - error (0, 0, _("No definition for %s category found"), "LC_COLLATE"); + WITH_CUR_LOCALE (error (0, 0, _("No definition for %s category found"), + "LC_COLLATE")); return; } @@ -1531,9 +1532,9 @@ && ((sect->rules[i] & sort_position) != (collate->sections->rules[i] & sort_position))) { - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: `position' must be used for a specific level in all sections or none"), - "LC_COLLATE"); + "LC_COLLATE")); break; } @@ -1554,9 +1555,10 @@ { if (runp->weights[i].w[j]->weights == NULL) { - error_at_line (0, 0, runp->file, runp->line, - _("symbol `%s' not defined"), - runp->weights[i].w[j]->name); + WITH_CUR_LOCALE (error_at_line (0, 0, runp->file, + runp->line, + _("symbol `%s' not defined"), + runp->weights[i].w[j]->name)); need_undefined = 1; runp->weights[i].w[j] = &collate->undefined; @@ -1629,11 +1631,14 @@ /* This should not happen. It means that we have to symbols with the same byte sequence. It is of course an error. */ - error_at_line (0, 0, (*eptr)->file, (*eptr)->line, - _("symbol `%s' has the same encoding as"), - (*eptr)->name); - error_at_line (0, 0, runp->file, runp->line, - _("symbol `%s'"), runp->name); + WITH_CUR_LOCALE (error_at_line (0, 0, (*eptr)->file, + (*eptr)->line, + _("\ +symbol `%s' has the same encoding as"), (*eptr)->name); + error_at_line (0, 0, runp->file, + runp->line, + _("symbol `%s'"), + runp->name)); goto dont_insert; } else if (c < 0) @@ -1732,11 +1737,14 @@ /* This should not happen. It means that we have two symbols with the same byte sequence. It is of course an error. */ - error_at_line (0, 0, (*eptr)->file, (*eptr)->line, - _("symbol `%s' has the same encoding as"), - (*eptr)->name); - error_at_line (0, 0, runp->file, runp->line, - _("symbol `%s'"), runp->name); + WITH_CUR_LOCALE (error_at_line (0, 0, (*eptr)->file, + (*eptr)->line, + _("\ +symbol `%s' has the same encoding as"), (*eptr)->name); + error_at_line (0, 0, runp->file, + runp->line, + _("symbol `%s'"), + runp->name)); goto dont_insertwc; } else if (c < 0) @@ -1777,7 +1785,7 @@ /* This seems not to be enforced by recent standards. Don't emit an error, simply append UNDEFINED at the end. */ if (0) - error (0, 0, _("no definition of `UNDEFINED'")); + WITH_CUR_LOCALE (error (0, 0, _("no definition of `UNDEFINED'"))); /* Add UNDEFINED at the end. */ collate->undefined.mborder = @@ -3389,8 +3397,8 @@ } else if (state == 3) { - error (0, 0, _("%s: missing `reorder-end' keyword"), - "LC_COLLATE"); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: missing `reorder-end' keyword"), "LC_COLLATE")); state = 4; } else if (state != 2 && state != 4) @@ -3739,11 +3747,11 @@ } } else if (state == 3) - error (0, 0, _("%s: missing `reorder-end' keyword"), - "LC_COLLATE"); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: missing `reorder-end' keyword"), "LC_COLLATE")); else if (state == 5) - error (0, 0, _("%s: missing `reorder-sections-end' keyword"), - "LC_COLLATE"); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: missing `reorder-sections-end' keyword"), "LC_COLLATE")); } arg = lr_token (ldfile, charmap, result, NULL, verbose); if (arg->tok == tok_eof) Index: locale/programs/ld-ctype.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-ctype.c,v retrieving revision 1.100 diff -u -a -r1.100 locale/programs/ld-ctype.c --- locale/programs/ld-ctype.c 2001/12/10 01:30:38 1.100 +++ locale/programs/ld-ctype.c 2002/02/04 21:03:02 @@ -33,13 +33,13 @@ #include #include +#include "localedef.h" #include "charmap.h" #include "localeinfo.h" #include "langinfo.h" #include "linereader.h" #include "locfile-token.h" #include "locfile.h" -#include "localedef.h" #include @@ -413,7 +413,8 @@ if (ctype == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), "LC_CTYPE"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_CTYPE")); ctype_startup (NULL, locale, charmap, NULL, 0); ctype = locale->categories[LC_CTYPE].ctype; } @@ -431,7 +432,8 @@ if (ctype->codeset_name == NULL) { if (! be_quiet) - error (0, 0, _("No character set name specified in charmap")); + WITH_CUR_LOCALE (error (0, 0, _("\ +No character set name specified in charmap"))); ctype->codeset_name = "//UNKNOWN//"; } @@ -459,11 +461,12 @@ uint32_t value = ctype->charnames[cnt]; if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ character L'\\u%0*x' in class `%s' must be in class `%s'"), - value > 0xffff ? 8 : 4, value, - valid_table[cls1].name, - valid_table[cls2].name); + value > 0xffff ? 8 : 4, + value, + valid_table[cls1].name, + valid_table[cls2].name)); } break; @@ -473,11 +476,12 @@ uint32_t value = ctype->charnames[cnt]; if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ character L'\\u%0*x' in class `%s' must not be in class `%s'"), - value > 0xffff ? 8 : 4, value, - valid_table[cls1].name, - valid_table[cls2].name); + value > 0xffff ? 8 : 4, + value, + valid_table[cls1].name, + valid_table[cls2].name)); } break; @@ -486,8 +490,8 @@ break; default: - error (5, 0, _("internal error in %s, line %u"), - __FUNCTION__, __LINE__); + WITH_CUR_LOCALE (error (5, 0, _("\ +internal error in %s, line %u"), __FUNCTION__, __LINE__)); } } } @@ -515,10 +519,11 @@ snprintf (buf, sizeof buf, "\\%Zo", cnt); if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ character '%s' in class `%s' must be in class `%s'"), - buf, valid_table[cls1].name, - valid_table[cls2].name); + buf, + valid_table[cls1].name, + valid_table[cls2].name)); } break; @@ -530,10 +535,11 @@ snprintf (buf, sizeof buf, "\\%Zo", cnt); if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ character '%s' in class `%s' must not be in class `%s'"), - buf, valid_table[cls1].name, - valid_table[cls2].name); + buf, + valid_table[cls1].name, + valid_table[cls2].name)); } break; @@ -542,8 +548,8 @@ break; default: - error (5, 0, _("internal error in %s, line %u"), - __FUNCTION__, __LINE__); + WITH_CUR_LOCALE (error (5, 0, _("\ +internal error in %s, line %u"), __FUNCTION__, __LINE__)); } } } @@ -559,8 +565,8 @@ & BITw (tok_blank)) == 0))) { if (!be_quiet) - error (0, 0, _(" character not in class `%s'"), - valid_table[cnt].name); + WITH_CUR_LOCALE (error (0, 0, _(" character not in class `%s'"), + valid_table[cnt].name)); } else if (((cnt = BITPOS (tok_punct), (ELEM (ctype, class_collection, , space_value) @@ -571,8 +577,9 @@ != 0))) { if (!be_quiet) - error (0, 0, _(" character must not be in class `%s'"), - valid_table[cnt].name); + WITH_CUR_LOCALE (error (0, 0, _("\ + character must not be in class `%s'"), + valid_table[cnt].name)); } else ELEM (ctype, class_collection, , space_value) |= BITw (tok_print); @@ -585,7 +592,8 @@ if (space_seq == NULL || space_seq->nbytes != 1) { if (!be_quiet) - error (0, 0, _("character not defined in character map")); + WITH_CUR_LOCALE (error (0, 0, _("\ +character not defined in character map"))); } else if (((cnt = BITPOS (tok_space), (ctype->class256_collection[space_seq->bytes[0]] @@ -595,8 +603,8 @@ & BIT (tok_blank)) == 0))) { if (!be_quiet) - error (0, 0, _(" character not in class `%s'"), - valid_table[cnt].name); + WITH_CUR_LOCALE (error (0, 0, _(" character not in class `%s'"), + valid_table[cnt].name)); } else if (((cnt = BITPOS (tok_punct), (ctype->class256_collection[space_seq->bytes[0]] @@ -606,8 +614,9 @@ & BIT (tok_graph)) != 0))) { if (!be_quiet) - error (0, 0, _(" character must not be in class `%s'"), - valid_table[cnt].name); + WITH_CUR_LOCALE (error (0, 0, _("\ + character must not be in class `%s'"), + valid_table[cnt].name)); } else ctype->class256_collection[space_seq->bytes[0]] |= BIT (tok_print); @@ -697,7 +706,8 @@ assert (ctype->mbdigits_act == ctype->wcdigits_act); ctype->wcdigits_act -= ctype->mbdigits_act % 10; ctype->mbdigits_act -= ctype->mbdigits_act % 10; - error (0, 0, _("`digit' category has not entries in groups of ten")); + WITH_CUR_LOCALE (error (0, 0, _("\ +`digit' category has not entries in groups of ten"))); } /* Check the input digits. There must be a multiple of ten available. @@ -745,8 +755,8 @@ if (ctype->mbdigits[cnt] == NULL) { /* Hum, this ain't good. */ - error (0, 0, _("\ -no input digits defined and none of the standard names in the charmap")); + WITH_CUR_LOCALE (error (0, 0, _("\ +no input digits defined and none of the standard names in the charmap"))); ctype->mbdigits[cnt] = obstack_alloc (&((struct charmap_t *) charmap)->mem_pool, sizeof (struct charseq) + 1); @@ -810,8 +820,8 @@ if (!warned) { - error (0, 0, _("\ -not all characters used in `outdigit' are available in the charmap")); + WITH_CUR_LOCALE (error (0, 0, _("\ +not all characters used in `outdigit' are available in the charmap"))); warned = 1; } @@ -827,8 +837,8 @@ { if (!warned) { - error (0, 0, _("\ -not all characters used in `outdigit' are available in the repertoire")); + WITH_CUR_LOCALE (error (0, 0, _("\ +not all characters used in `outdigit' are available in the repertoire"))); warned = 1; } @@ -1227,9 +1237,9 @@ if (ctype->nr_charclass == MAX_NR_CHARCLASS) /* Exit code 2 is prescribed in P1003.2b. */ - error (2, 0, _("\ + WITH_CUR_LOCALE (error (2, 0, _("\ implementation limit: no more than %Zd character classes allowed"), - MAX_NR_CHARCLASS); + MAX_NR_CHARCLASS)); ctype->classnames[ctype->nr_charclass++] = name; } @@ -1259,9 +1269,9 @@ if (ctype->map_collection_nr == MAX_NR_CHARMAP) /* Exit code 2 is prescribed in P1003.2b. */ - error (2, 0, _("\ + WITH_CUR_LOCALE (error (2, 0, _("\ implementation limit: no more than %d character maps allowed"), - MAX_NR_CHARMAP); + MAX_NR_CHARMAP)); ctype->mapnames[cnt] = name; @@ -2824,10 +2834,11 @@ { lr_error (ldfile, _("\ %s: duplicate `default_missing' definition"), "LC_CTYPE"); - error_at_line (0, 0, ctype->default_missing_file, - ctype->default_missing_lineno, - _("\ -previous definition was here")); + WITH_CUR_LOCALE (error_at_line (0, 0, + ctype->default_missing_file, + ctype->default_missing_lineno, + _("\ +previous definition was here"))); } else { @@ -3001,14 +3012,14 @@ if (seq == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined in charmap while needed as default value"), - "LC_CTYPE", tmp); + "LC_CTYPE", tmp)); } else if (seq->nbytes != 1) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' in charmap not representable with one byte"), - "LC_CTYPE", tmp); + "LC_CTYPE", tmp)); else ctype->class256_collection[seq->bytes[0]] |= bit; @@ -3085,14 +3096,14 @@ if (seq == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined while needed as default value"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); } else if (seq->nbytes != 1) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' in charmap not representable with one byte"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); else ctype->class256_collection[seq->bytes[0]] |= BIT (tok_space); @@ -3105,14 +3116,14 @@ if (seq == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined while needed as default value"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); } else if (seq->nbytes != 1) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' in charmap not representable with one byte"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); else ctype->class256_collection[seq->bytes[0]] |= BIT (tok_space); @@ -3126,14 +3137,14 @@ if (seq == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ character `%s' not defined while needed as default value"), - ""); + "")); } else if (seq->nbytes != 1) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' in charmap not representable with one byte"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); else ctype->class256_collection[seq->bytes[0]] |= BIT (tok_space); @@ -3147,14 +3158,14 @@ if (seq == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined while needed as default value"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); } else if (seq->nbytes != 1) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' in charmap not representable with one byte"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); else ctype->class256_collection[seq->bytes[0]] |= BIT (tok_space); @@ -3168,14 +3179,14 @@ if (seq == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined while needed as default value"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); } else if (seq->nbytes != 1) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' in charmap not representable with one byte"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); else ctype->class256_collection[seq->bytes[0]] |= BIT (tok_space); @@ -3189,14 +3200,14 @@ if (seq == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined while needed as default value"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); } else if (seq->nbytes != 1) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' in charmap not representable with one byte"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); else ctype->class256_collection[seq->bytes[0]] |= BIT (tok_space); @@ -3229,14 +3240,14 @@ if (seq == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined while needed as default value"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); } else if (seq->nbytes != 1) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' in charmap not representable with one byte"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); else ctype->class256_collection[seq->bytes[0]] |= BIT (tok_blank); @@ -3250,14 +3261,14 @@ if (seq == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined while needed as default value"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); } else if (seq->nbytes != 1) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' in charmap not representable with one byte"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); else ctype->class256_collection[seq->bytes[0]] |= BIT (tok_blank); @@ -3317,14 +3328,14 @@ if (seq == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined while needed as default value"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); } else if (seq->nbytes != 1) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' in charmap not representable with one byte"), - "LC_CTYPE", ""); + "LC_CTYPE", "")); else ctype->class256_collection[seq->bytes[0]] |= BIT (tok_print); @@ -3359,16 +3370,16 @@ if (seq_from == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined while needed as default value"), - "LC_CTYPE", tmp); + "LC_CTYPE", tmp)); } else if (seq_from->nbytes != 1) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' needed as default value not representable with one byte"), - "LC_CTYPE", tmp); + "LC_CTYPE", tmp)); } else { @@ -3384,16 +3395,16 @@ if (seq_to == NULL) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' not defined while needed as default value"), - "LC_CTYPE", tmp); + "LC_CTYPE", tmp)); } else if (seq_to->nbytes != 1) { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: character `%s' needed as default value not representable with one byte"), - "LC_CTYPE", tmp); + "LC_CTYPE", tmp)); } else /* The index [0] is determined by the order of the @@ -3425,8 +3436,9 @@ if (ctype->outdigits_act != 10) { if (ctype->outdigits_act != 0) - error (0,0, _("%s: field `%s' does not contain exactly ten entries"), - "LC_CTYPE", "outdigit"); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: field `%s' does not contain exactly ten entries"), + "LC_CTYPE", "outdigit")); for (cnt = ctype->outdigits_act; cnt < 10; ++cnt) { @@ -3445,8 +3457,8 @@ if (ctype->mboutdigits[cnt] == NULL) { /* Provide a replacement. */ - error (0, 0, _("\ -no output digits defined and none of the standard names in the charmap")); + WITH_CUR_LOCALE (error (0, 0, _("\ +no output digits defined and none of the standard names in the charmap"))); ctype->mboutdigits[cnt] = obstack_alloc (&((struct charmap_t *) charmap)->mem_pool, sizeof (struct charseq) @@ -3736,9 +3748,9 @@ if (other == NULL) { - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: transliteration data from locale `%s' not available"), - "LC_CTYPE", copy_locale); + "LC_CTYPE", copy_locale)); } else { @@ -3832,9 +3844,10 @@ wctype_table_finalize (&t); if (verbose) - fprintf (stderr, _("%s: table for class \"%s\": %lu bytes\n"), - "LC_CTYPE", ctype->classnames[nr], - (unsigned long int) t.result_size); + WITH_CUR_LOCALE (fprintf (stderr, _("\ +%s: table for class \"%s\": %lu bytes\n"), + "LC_CTYPE", ctype->classnames[nr], + (unsigned long int) t.result_size)); ctype->class_3level[nr].iov_base = t.result; ctype->class_3level[nr].iov_len = t.result_size; @@ -3900,9 +3913,10 @@ wctrans_table_finalize (&t); if (verbose) - fprintf (stderr, _("%s: table for map \"%s\": %lu bytes\n"), - "LC_CTYPE", ctype->mapnames[nr], - (unsigned long int) t.result_size); + WITH_CUR_LOCALE (fprintf (stderr, _("\ +%s: table for map \"%s\": %lu bytes\n"), + "LC_CTYPE", ctype->mapnames[nr], + (unsigned long int) t.result_size)); ctype->map_3level[nr].iov_base = t.result; ctype->map_3level[nr].iov_len = t.result_size; @@ -4032,8 +4046,8 @@ wcwidth_table_finalize (&t); if (verbose) - fprintf (stderr, _("%s: table for width: %lu bytes\n"), - "LC_CTYPE", (unsigned long int) t.result_size); + WITH_CUR_LOCALE (fprintf (stderr, _("%s: table for width: %lu bytes\n"), + "LC_CTYPE", (unsigned long int) t.result_size)); ctype->width.iov_base = t.result; ctype->width.iov_len = t.result_size; Index: locale/programs/ld-identification.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-identification.c,v retrieving revision 1.9 diff -u -a -r1.9 locale/programs/ld-identification.c --- locale/programs/ld-identification.c 2001/12/10 01:15:02 1.9 +++ locale/programs/ld-identification.c 2002/02/04 21:03:02 @@ -29,6 +29,7 @@ #include +#include "localedef.h" #include "localeinfo.h" #include "locfile.h" @@ -130,8 +131,8 @@ if (identification == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), - "LC_IDENTIFICATION"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_IDENTIFICATION")); identification_startup (NULL, locale, 0); identification = locale->categories[LC_IDENTIFICATION].identification; @@ -143,8 +144,8 @@ if (identification->cat == NULL) \ { \ if (verbose && ! nothing) \ - error (0, 0, _("%s: field `%s' not defined"), \ - "LC_IDENTIFICATION", #cat); \ + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), \ + "LC_IDENTIFICATION", #cat)); \ identification->cat = ""; \ } @@ -167,8 +168,9 @@ if (num != LC_ALL && identification->category[num] == NULL) { if (verbose && ! nothing) - error (0, 0, _("%s: no identification for category `%s'"), - "LC_IDENTIFICATION", category_name[num]); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: no identification for category `%s'"), + "LC_IDENTIFICATION", category_name[num])); identification->category[num] = ""; } } Index: locale/programs/ld-measurement.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-measurement.c,v retrieving revision 1.10 diff -u -a -r1.10 locale/programs/ld-measurement.c --- locale/programs/ld-measurement.c 2001/12/10 01:15:02 1.10 +++ locale/programs/ld-measurement.c 2002/02/04 21:03:02 @@ -28,6 +28,7 @@ #include +#include "localedef.h" #include "localeinfo.h" #include "locfile.h" @@ -91,8 +92,8 @@ if (measurement == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), - "LC_MEASUREMENT"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_MEASUREMENT")); measurement_startup (NULL, locale, 0); measurement = locale->categories[LC_MEASUREMENT].measurement; nothing = 1; @@ -102,16 +103,16 @@ if (measurement->measurement == 0) { if (! nothing) - error (0, 0, _("%s: field `%s' not defined"), - "LC_MEASUREMENT", "measurement"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_MEASUREMENT", "measurement")); /* Use as the default value the value of the i18n locale. */ measurement->measurement = 1; } else { if (measurement->measurement > 3) - error (0, 0, _("%s: invalid value for field `%s'"), - "LC_MEASUREMENT", "measurement"); + WITH_CUR_LOCALE (error (0, 0, _("%s: invalid value for field `%s'"), + "LC_MEASUREMENT", "measurement")); } } Index: locale/programs/ld-messages.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-messages.c,v retrieving revision 1.17 diff -u -a -r1.17 locale/programs/ld-messages.c --- locale/programs/ld-messages.c 2001/12/10 01:15:02 1.17 +++ locale/programs/ld-messages.c 2002/02/04 21:03:02 @@ -29,8 +29,8 @@ #include -#include "linereader.h" #include "localedef.h" +#include "linereader.h" #include "localeinfo.h" #include "locfile.h" @@ -95,8 +95,8 @@ if (messages == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), - "LC_MESSAGES"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_MESSAGES")); messages_startup (NULL, locale, 0); messages = locale->categories[LC_MESSAGES].messages; nothing = 1; @@ -112,15 +112,16 @@ if (messages->yesexpr == NULL) { if (! be_quiet && ! nothing) - error (0, 0, _("%s: field `%s' undefined"), "LC_MESSAGES", "yesexpr"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' undefined"), + "LC_MESSAGES", "yesexpr")); messages->yesexpr = "^[yY]"; } else if (messages->yesexpr[0] == '\0') { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: value for field `%s' must not be an empty string"), - "LC_MESSAGES", "yesexpr"); + "LC_MESSAGES", "yesexpr")); } else { @@ -134,9 +135,9 @@ char errbuf[BUFSIZ]; (void) regerror (result, &re, errbuf, BUFSIZ); - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: no correct regular expression for field `%s': %s"), - "LC_MESSAGES", "yesexpr", errbuf); + "LC_MESSAGES", "yesexpr", errbuf)); } else if (result != 0) regfree (&re); @@ -145,15 +146,16 @@ if (messages->noexpr == NULL) { if (! be_quiet && ! nothing) - error (0, 0, _("%s: field `%s' undefined"), "LC_MESSAGES", "noexpr"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' undefined"), + "LC_MESSAGES", "noexpr")); messages->noexpr = "^[nN]"; } else if (messages->noexpr[0] == '\0') { if (!be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: value for field `%s' must not be an empty string"), - "LC_MESSAGES", "noexpr"); + "LC_MESSAGES", "noexpr")); } else { @@ -167,9 +169,9 @@ char errbuf[BUFSIZ]; (void) regerror (result, &re, errbuf, BUFSIZ); - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: no correct regular expression for field `%s': %s"), - "LC_MESSAGES", "noexpr", errbuf); + "LC_MESSAGES", "noexpr", errbuf)); } else if (result != 0) regfree (&re); Index: locale/programs/ld-monetary.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-monetary.c,v retrieving revision 1.32 diff -u -a -r1.32 locale/programs/ld-monetary.c --- locale/programs/ld-monetary.c 2001/12/10 01:15:02 1.32 +++ locale/programs/ld-monetary.c 2002/02/04 21:03:02 @@ -30,8 +30,8 @@ #include -#include "linereader.h" #include "localedef.h" +#include "linereader.h" #include "localeinfo.h" #include "locfile.h" @@ -191,8 +191,8 @@ if (monetary == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), - "LC_MONETARY"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_MONETARY")); monetary_startup (NULL, locale, 0); monetary = locale->categories[LC_MONETARY].monetary; nothing = 1; @@ -203,8 +203,8 @@ if (monetary->cat == NULL) \ { \ if (! be_quiet && ! nothing) \ - error (0, 0, _("%s: field `%s' not defined"), \ - "LC_MONETARY", #cat); \ + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), \ + "LC_MONETARY", #cat)); \ monetary->cat = initval; \ } @@ -221,18 +221,18 @@ if (strlen (monetary->int_curr_symbol) != 4) { if (! be_quiet && ! nothing) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: value of field `int_curr_symbol' has wrong length"), - "LC_MONETARY"); + "LC_MONETARY")); } else if (bsearch (monetary->int_curr_symbol, valid_int_curr, NR_VALID_INT_CURR, sizeof (const char *), (comparison_fn_t) curr_strcmp) == NULL && !be_quiet) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: value of field `int_curr_symbol' does \ not correspond to a valid name in ISO 4217"), - "LC_MONETARY"); + "LC_MONETARY")); } /* The decimal point must not be empty. This is not said explicitly @@ -241,15 +241,15 @@ if (monetary->mon_decimal_point == NULL) { if (! be_quiet && ! nothing) - error (0, 0, _("%s: field `%s' not defined"), - "LC_MONETARY", "mon_decimal_point"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_MONETARY", "mon_decimal_point")); monetary->mon_decimal_point = "."; } else if (monetary->mon_decimal_point[0] == '\0' && ! be_quiet && ! nothing) { - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: value for field `%s' must not be the empty string"), - "LC_MONETARY", "mon_decimal_point"); + "LC_MONETARY", "mon_decimal_point")); } if (monetary->mon_decimal_point_wc == L'\0') monetary->mon_decimal_point_wc = L'.'; @@ -257,8 +257,8 @@ if (monetary->mon_grouping_len == 0) { if (! be_quiet && ! nothing) - error (0, 0, _("%s: field `%s' not defined"), - "LC_MONETARY", "mon_grouping"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_MONETARY", "mon_grouping")); monetary->mon_grouping = (char *) "\177"; monetary->mon_grouping_len = 1; @@ -269,15 +269,15 @@ if (monetary->cat == -2) \ { \ if (! be_quiet && ! nothing) \ - error (0, 0, _("%s: field `%s' not defined"), \ - "LC_MONETARY", #cat); \ + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), \ + "LC_MONETARY", #cat)); \ monetary->cat = initval; \ } \ else if ((monetary->cat < min || monetary->cat > max) \ && !be_quiet && !nothing) \ - error (0, 0, _(" \ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: value for field `%s' must be in range %d...%d"), \ - "LC_MONETARY", #cat, min, max) + "LC_MONETARY", #cat, min, max)) TEST_ELEM (int_frac_digits, -128, 127, -1); TEST_ELEM (frac_digits, -128, 127, -1); @@ -305,9 +305,9 @@ monetary->cat = monetary->alt; \ else if ((monetary->cat < min || monetary->cat > max) && !be_quiet \ && ! nothing) \ - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: value for field `%s' must be in range %d...%d"), \ - "LC_MONETARY", #cat, min, max) + "LC_MONETARY", #cat, min, max)) TEST_ELEM (int_p_cs_precedes, p_cs_precedes, -1, 1); TEST_ELEM (int_p_sep_by_space, p_sep_by_space, -1, 2); Index: locale/programs/ld-name.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-name.c,v retrieving revision 1.10 diff -u -a -r1.10 locale/programs/ld-name.c --- locale/programs/ld-name.c 2001/12/10 01:15:02 1.10 +++ locale/programs/ld-name.c 2002/02/04 21:03:02 @@ -27,6 +27,7 @@ #include +#include "localedef.h" #include "localeinfo.h" #include "locfile.h" @@ -91,7 +92,8 @@ if (name == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), "LC_NAME"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_NAME")); name_startup (NULL, locale, 0); name = locale->categories[LC_NAME].name; nothing = 1; @@ -101,7 +103,8 @@ if (name->name_fmt == NULL) { if (! nothing) - error (0, 0, _("%s: field `%s' not defined"), "LC_NAME", "name_fmt"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_NAME", "name_fmt")); /* Use as the default value the value of the i18n locale. */ name->name_fmt = "%p%t%g%t%m%t%f"; } @@ -112,8 +115,8 @@ const char *cp = name->name_fmt; if (*cp == '\0') - error (0, 0, _("%s: field `%s' must not be empty"), - "LC_NAME", "name_fmt"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' must not be empty"), + "LC_NAME", "name_fmt")); else while (*cp != '\0') { @@ -124,9 +127,8 @@ ++cp; if (strchr ("dfFgGlomMpsSt", *cp) == NULL) { - error (0, 0, _("\ -%s: invalid escape sequence in field `%s'"), - "LC_NAME", "name_fmt"); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: invalid escape sequence in field `%s'"), "LC_NAME", "name_fmt")); break; } } @@ -138,7 +140,8 @@ if (name->cat == NULL) \ { \ if (verbose && ! nothing) \ - error (0, 0, _("%s: field `%s' not defined"), "LC_NAME", #cat); \ + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), \ + "LC_NAME", #cat)); \ name->cat = ""; \ } Index: locale/programs/ld-numeric.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-numeric.c,v retrieving revision 1.25 diff -u -a -r1.25 locale/programs/ld-numeric.c --- locale/programs/ld-numeric.c 2001/12/10 01:15:02 1.25 +++ locale/programs/ld-numeric.c 2002/02/04 21:03:02 @@ -27,8 +27,8 @@ #include -#include "linereader.h" #include "localedef.h" +#include "linereader.h" #include "localeinfo.h" #include "locfile.h" @@ -96,8 +96,8 @@ if (numeric == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), - "LC_NUMERIC"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_NUMERIC")); numeric_startup (NULL, locale, 0); numeric = locale->categories[LC_NUMERIC].numeric; nothing = 1; @@ -110,21 +110,22 @@ if (numeric->decimal_point == NULL) { if (! be_quiet && ! nothing) - error (0, 0, _("%s: field `%s' not defined"), - "LC_NUMERIC", "decimal_point"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_NUMERIC", "decimal_point")); numeric->decimal_point = "."; } else if (numeric->decimal_point[0] == '\0' && ! be_quiet && ! nothing) { - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: value for field `%s' must not be the empty string"), - "LC_NUMERIC", "decimal_point"); + "LC_NUMERIC", "decimal_point")); } if (numeric->decimal_point_wc == L'\0') numeric->decimal_point_wc = L'.'; if (numeric->grouping_len == 0 && ! be_quiet && ! nothing) - error (0, 0, _("%s: field `%s' not defined"), "LC_NUMERIC", "grouping"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_NUMERIC", "grouping")); } Index: locale/programs/ld-paper.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-paper.c,v retrieving revision 1.12 diff -u -a -r1.12 locale/programs/ld-paper.c --- locale/programs/ld-paper.c 2001/12/10 01:15:02 1.12 +++ locale/programs/ld-paper.c 2002/02/04 21:03:02 @@ -28,6 +28,7 @@ #include +#include "localedef.h" #include "localeinfo.h" #include "locfile.h" @@ -88,7 +89,8 @@ if (paper == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), "LC_PAPER"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_PAPER")); paper_startup (NULL, locale, 0); paper = locale->categories[LC_PAPER].paper; nothing = 1; @@ -98,7 +100,8 @@ if (paper->height == 0) { if (! nothing) - error (0, 0, _("%s: field `%s' not defined"), "LC_PAPER", "height"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_PAPER", "height")); /* Use as default values the values from the i18n locale. */ paper->height = 297; } @@ -106,7 +109,8 @@ if (paper->width == 0) { if (! nothing) - error (0, 0, _("%s: field `%s' not defined"), "LC_PAPER", "width"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_PAPER", "width")); /* Use as default values the values from the i18n locale. */ paper->width = 210; } Index: locale/programs/ld-telephone.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-telephone.c,v retrieving revision 1.8 diff -u -a -r1.8 locale/programs/ld-telephone.c --- locale/programs/ld-telephone.c 2001/12/10 01:15:02 1.8 +++ locale/programs/ld-telephone.c 2002/02/04 21:03:02 @@ -28,6 +28,7 @@ #include +#include "localedef.h" #include "localeinfo.h" #include "locfile.h" @@ -91,8 +92,8 @@ if (telephone == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), - "LC_TELEPHONE"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_TELEPHONE")); telephone_startup (NULL, locale, 0); telephone = locale->categories[LC_TELEPHONE].telephone; nothing = 1; @@ -102,8 +103,8 @@ if (telephone->tel_int_fmt == NULL) { if (! nothing) - error (0, 0, _("%s: field `%s' not defined"), - "LC_TELEPHONE", "tel_int_fmt"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), + "LC_TELEPHONE", "tel_int_fmt")); /* Use as the default value the value of the i18n locale. */ telephone->tel_int_fmt = "+%c %a %l"; } @@ -114,8 +115,8 @@ const char *cp = telephone->tel_int_fmt; if (*cp == '\0') - error (0, 0, _("%s: field `%s' must not be empty"), - "LC_TELEPHONE", "tel_int_fmt"); + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' must not be empty"), + "LC_TELEPHONE", "tel_int_fmt")); else while (*cp != '\0') { @@ -123,9 +124,8 @@ { if (strchr ("aAlc", *++cp) == NULL) { - error (0, 0, _("\ -%s: invalid escape sequence in field `%s'"), - "LC_TELEPHONE", "tel_int_fmt"); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: invalid escape sequence in field `%s'"), "LC_TELEPHONE", "tel_int_fmt")); break; } } @@ -147,8 +147,8 @@ { if (strchr ("aAlc", *++cp) == NULL) { - error (0, 0, _("%s: invalid escape sequence in field `%s'"), - "LC_TELEPHONE", "tel_dom_fmt"); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: invalid escape sequence in field `%s'"), "LC_TELEPHONE", "tel_dom_fmt")); break; } } @@ -160,7 +160,8 @@ if (telephone->cat == NULL) \ { \ if (verbose && ! nothing) \ - error (0, 0, _("%s: field `%s' not defined"), "LC_TELEPHONE", #cat); \ + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), \ + "LC_TELEPHONE", #cat)); \ telephone->cat = ""; \ } Index: locale/programs/ld-time.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/ld-time.c,v retrieving revision 1.36 diff -u -a -r1.36 locale/programs/ld-time.c --- locale/programs/ld-time.c 2001/12/10 01:15:02 1.36 +++ locale/programs/ld-time.c 2002/02/04 21:03:02 @@ -30,8 +30,8 @@ #include -#include "linereader.h" #include "localedef.h" +#include "linereader.h" #include "localeinfo.h" #include "locfile.h" @@ -157,7 +157,8 @@ if (time == NULL) { if (! be_quiet) - error (0, 0, _("No definition for %s category found"), "LC_TIME"); + WITH_CUR_LOCALE (error (0, 0, _("\ +No definition for %s category found"), "LC_TIME")); time_startup (NULL, locale, 0); time = locale->categories[LC_TIME].time; nothing = 1; @@ -172,7 +173,8 @@ int i; \ \ if (! be_quiet && ! nothing) \ - error (0, 0, _("%s: field `%s' not defined"), "LC_TIME", #cat); \ + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), \ + "LC_TIME", #cat)); \ \ for (i = 0; i < sizeof (initval) / sizeof (initval[0]); ++i) \ time->cat[i] = initval[i]; \ @@ -192,7 +194,8 @@ if (time->cat == NULL) \ { \ if (! be_quiet && ! nothing) \ - error (0, 0, _("%s: field `%s' not defined"), "LC_TIME", #cat); \ + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), \ + "LC_TIME", #cat)); \ \ time->cat = initval; \ } @@ -242,10 +245,9 @@ if (*str != '+' && *str != '-') { if (!be_quiet) - error (0, 0, - _("%s: direction flag in string %Zd in `era' field" - " is not '+' nor '-'"), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: direction flag in string %Zd in `era' field is not '+' nor '-'"), + "LC_TIME", idx + 1)); /* Default arbitrarily to '+'. */ time->era_entries[idx].direction = '+'; } @@ -254,10 +256,9 @@ if (*++str != ':') { if (!be_quiet) - error (0, 0, - _("%s: direction flag in string %Zd in `era' field" - " is not a single character"), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: direction flag in string %Zd in `era' field is not a single character"), + "LC_TIME", idx + 1)); (void) strsep (&str, ":"); } else @@ -268,17 +269,17 @@ if (endp == str) { if (!be_quiet) - error (0, 0, _("%s: invalid number for offset in string %Zd in" - " `era' field"), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: invalid number for offset in string %Zd in `era' field"), + "LC_TIME", idx + 1)); (void) strsep (&str, ":"); } else if (*endp != ':') { if (!be_quiet) - error (0, 0, _("%s: garbage at end of offset value in" - " string %Zd in `era' field"), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: garbage at end of offset value in string %Zd in `era' field"), + "LC_TIME", idx + 1)); (void) strsep (&str, ":"); } else @@ -327,18 +328,18 @@ { invalid_start_date: if (!be_quiet) - error (0, 0, _("%s: invalid starting date in string %Zd in" - " `era' field"), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: invalid starting date in string %Zd in `era' field"), + "LC_TIME", idx + 1)); (void) strsep (&str, ":"); } else if (*endp != ':') { garbage_start_date: if (!be_quiet) - error (0, 0, _("%s: garbage at end of starting date " - "in string %Zd in `era' field "), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: garbage at end of starting date in string %Zd in `era' field "), + "LC_TIME", idx + 1)); (void) strsep (&str, ":"); } else @@ -355,9 +356,9 @@ && time->era_entries[idx].start_date[2] == 29 && !__isleap (time->era_entries[idx].start_date[0]))) && !be_quiet) - error (0, 0, _("%s: starting date is invalid in" - " string %Zd in `era' field"), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: starting date is invalid in string %Zd in `era' field"), + "LC_TIME", idx + 1)); } } @@ -404,18 +405,18 @@ { invalid_stop_date: if (!be_quiet) - error (0, 0, _("%s: invalid stopping date in string %Zd in" - " `era' field"), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: invalid stopping date in string %Zd in `era' field"), + "LC_TIME", idx + 1)); (void) strsep (&str, ":"); } else if (*endp != ':') { garbage_stop_date: if (!be_quiet) - error (0, 0, _("%s: garbage at end of stopping date " - "in string %Zd in `era' field"), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: garbage at end of stopping date in string %Zd in `era' field"), + "LC_TIME", idx + 1)); (void) strsep (&str, ":"); } else @@ -432,17 +433,17 @@ && time->era_entries[idx].stop_date[2] == 29 && !__isleap (time->era_entries[idx].stop_date[0]))) && !be_quiet) - error (0, 0, _("%s: stopping date is invalid in" - " string %Zd in `era' field"), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: stopping date is invalid in string %Zd in `era' field"), + "LC_TIME", idx + 1)); } } if (str == NULL || *str == '\0') { if (!be_quiet) - error (0, 0, _("%s: missing era name in string %Zd in `era'" - " field"), "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: missing era name in string %Zd in `era' field"), "LC_TIME", idx + 1)); time->era_entries[idx].name = time->era_entries[idx].format = ""; } @@ -453,9 +454,9 @@ if (str == NULL || *str == '\0') { if (!be_quiet) - error (0, 0, _("%s: missing era format in string %Zd" - " in `era' field"), - "LC_TIME", idx + 1); + WITH_CUR_LOCALE (error (0, 0, _("\ +%s: missing era format in string %Zd in `era' field"), + "LC_TIME", idx + 1)); time->era_entries[idx].name = time->era_entries[idx].format = ""; } @@ -482,33 +483,33 @@ time->week_1stday = 19971130; if (time->week_1stweek > time->week_ndays) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: third operand for value of field `%s' must not be larger than %d"), - "LC_TIME", "week", 7); + "LC_TIME", "week", 7)); if (time->first_weekday == '\0') /* The definition does not specify this so the default is used. */ time->first_weekday = 1; else if (time->first_weekday > time->week_ndays) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: values of field `%s' must not be larger than %d"), - "LC_TIME", "first_weekday", 7); + "LC_TIME", "first_weekday", 7)); if (time->first_workday == '\0') /* The definition does not specify this so the default is used. */ time->first_workday = 1; else if (time->first_workday > time->week_ndays) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: values of field `%s' must not be larger than %d"), - "LC_TIME", "first_workday", 7); + "LC_TIME", "first_workday", 7)); if (time->cal_direction == '\0') /* The definition does not specify this so the default is used. */ time->cal_direction = 1; else if (time->cal_direction > 3) - error (0, 0, _("\ + WITH_CUR_LOCALE (error (0, 0, _("\ %s: values for field `%s' must not be larger than %d"), - "LC_TIME", "cal_direction", 3); + "LC_TIME", "cal_direction", 3)); /* XXX We don't perform any tests on the timezone value since this is simply useless, stupid $&$!@... */ Index: locale/programs/linereader.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/linereader.c,v retrieving revision 1.24 diff -u -a -r1.24 locale/programs/linereader.c --- locale/programs/linereader.c 2001/12/10 01:26:21 1.24 +++ locale/programs/linereader.c 2002/02/04 21:03:02 @@ -29,17 +29,11 @@ #include #include +#include "localedef.h" #include "charmap.h" #include "error.h" #include "linereader.h" -#include "localedef.h" #include "locfile.h" - -/* Prototypes for a few program-wide used functions. */ -extern void *xmalloc (size_t __n); -extern void *xrealloc (void *__p, size_t __n); -extern char *xstrdup (const char *__str); - /* Prototypes for local functions. */ static struct token *get_toplvl_escape (struct linereader *lr); Index: locale/programs/linereader.h =================================================================== RCS file: /cvs/glibc/libc/locale/programs/linereader.h,v retrieving revision 1.9 diff -u -a -r1.9 locale/programs/linereader.h --- locale/programs/linereader.h 2001/12/10 01:27:38 1.9 +++ locale/programs/linereader.h 2002/02/04 21:03:02 @@ -98,7 +98,7 @@ #define lr_error(lr, fmt, args...) \ - error_at_line (0, 0, lr->fname, lr->lineno, fmt, ## args) + WITH_CUR_LOCALE (error_at_line (0, 0, lr->fname, lr->lineno, fmt, ## args)) Index: locale/programs/localedef.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/localedef.c,v retrieving revision 1.54 diff -u -a -r1.54 locale/programs/localedef.c --- locale/programs/localedef.c 2002/01/17 07:15:53 1.54 +++ locale/programs/localedef.c 2002/02/04 21:03:02 @@ -31,10 +31,11 @@ #include #include #include +#include #include #include -#include "error.h" +#include "localedef.h" #include "charmap.h" #include "locfile.h" @@ -189,7 +190,8 @@ defines error code 3 for this situation so I think it must be a fatal error (see P1003.2 4.35.8). */ if (sysconf (_SC_2_LOCALEDEF) < 0) - error (3, 0, _("FATAL: system does not define `_POSIX2_LOCALEDEF'")); + WITH_CUR_LOCALE (error (3, 0, _("\ +FATAL: system does not define `_POSIX2_LOCALEDEF'"))); /* Process charmap file. */ charmap = charmap_read (charmap_file, verbose, be_quiet, 1); @@ -202,7 +204,8 @@ /* Now read the locale file. */ if (locfile_read (&global, charmap) != 0) - error (4, errno, _("cannot open locale definition file `%s'"), input_file); + WITH_CUR_LOCALE (error (4, errno, _("\ +cannot open locale definition file `%s'"), input_file)); /* Perhaps we saw some `copy' instructions. */ while (1) @@ -217,8 +220,8 @@ break; if (locfile_read (runp, charmap) != 0) - error (4, errno, _("cannot open locale definition file `%s'"), - runp->name); + WITH_CUR_LOCALE (error (4, errno, _("\ +cannot open locale definition file `%s'"), runp->name)); } /* Check the categories we processed in source form. */ @@ -229,13 +232,14 @@ if (error_message_count == 0 || force_output != 0) { if (cannot_write_why != 0) - error (4, cannot_write_why, _("cannot write output files to `%s'"), - output_path); + WITH_CUR_LOCALE (error (4, cannot_write_why, _("\ +cannot write output files to `%s'"), output_path)); else write_all_categories (locales, charmap, output_path); } else - error (4, 0, _("no output file produced because warning were issued")); + WITH_CUR_LOCALE (error (4, 0, _("\ +no output file produced because warning were issued"))); /* This exit status is prescribed by POSIX.2 4.35.7. */ exit (error_message_count != 0); @@ -485,13 +489,14 @@ } if (generate && (runp->needed & (1 << locale)) != 0) - error (5, 0, _("circular dependencies between locale definitions")); + WITH_CUR_LOCALE (error (5, 0, _("\ +circular dependencies between locale definitions"))); if (copy_locale != NULL) { if (runp->categories[locale].generic != NULL) - error (5, 0, _("cannot add already read locale `%s' a second time"), - name); + WITH_CUR_LOCALE (error (5, 0, _("\ +cannot add already read locale `%s' a second time"), name)); else runp->categories[locale].generic = copy_locale->categories[locale].generic; @@ -516,8 +521,8 @@ if ((result->avail & (1 << locale)) == 0 && locfile_read (result, charmap) != 0) - error (4, errno, _("cannot open locale definition file `%s'"), - result->name); + WITH_CUR_LOCALE (error (4, errno, _("\ +cannot open locale definition file `%s'"), result->name)); return result; } @@ -536,8 +541,8 @@ if ((result->avail & (1 << locale)) == 0 && locfile_read (result, charmap) != 0) - error (4, errno, _("cannot open locale definition file `%s'"), - result->name); + WITH_CUR_LOCALE (error (4, errno, _("\ +cannot open locale definition file `%s'"), result->name)); return result; } Index: locale/programs/localedef.h =================================================================== RCS file: /cvs/glibc/libc/locale/programs/localedef.h,v retrieving revision 1.7 diff -u -a -r1.7 locale/programs/localedef.h --- locale/programs/localedef.h 2001/12/10 01:22:36 1.7 +++ locale/programs/localedef.h 2002/02/04 21:03:02 @@ -24,6 +24,7 @@ /* Get the basic locale definitions. */ #include #include +#include #include "repertoire.h" @@ -120,6 +121,19 @@ extern void *xcalloc (size_t __n, size_t __size); extern void *xrealloc (void *__p, size_t __n); extern char *xstrdup (const char *__str); + + +/* Wrapper to switch LC_CTYPE back to the locale specified in the + environment for output. */ +#define WITH_CUR_LOCALE(stmt) \ + do { \ + int saved_errno = errno; \ + const char *cur_locale_ = setlocale (LC_CTYPE, NULL); \ + setlocale (LC_CTYPE, ""); \ + errno = saved_errno; \ + stmt; \ + setlocale (LC_CTYPE, cur_locale_); \ + } while (0) /* Mark given locale as to be read. */ Index: locale/programs/locfile.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/locfile.c,v retrieving revision 1.30 diff -u -a -r1.30 locale/programs/locfile.c --- locale/programs/locfile.c 2001/12/10 01:20:35 1.30 +++ locale/programs/locfile.c 2002/02/04 21:03:02 @@ -568,9 +568,8 @@ if (fd == -1) { if (!be_quiet) - error (0, save_err, _("\ -cannot open output file `%s' for category `%s'"), - fname, category); + WITH_CUR_LOCALE (error (0, save_err, _("\ +cannot open output file `%s' for category `%s'"), fname, category)); free (fname); return; } @@ -593,8 +592,8 @@ if (writev (fd, &vec[cnt], step) < 0) { if (!be_quiet) - error (0, errno, _("failure while writing data for category `%s'"), - category); + WITH_CUR_LOCALE (error (0, errno, _("\ +failure while writing data for category `%s'"), category)); break; } } @@ -690,9 +689,8 @@ if (rename (tmp_fname, fname) < 0) { if (!be_quiet) - error (0, errno, _("\ -cannot create output file `%s' for category `%s'"), - fname, category); + WITH_CUR_LOCALE (error (0, errno, _("\ +cannot create output file `%s' for category `%s'"), fname, category)); } free (tmp_fname); free (other_fname); Index: locale/programs/locfile.h =================================================================== RCS file: /cvs/glibc/libc/locale/programs/locfile.h,v retrieving revision 1.13 diff -u -a -r1.13 locale/programs/locfile.h --- locale/programs/locfile.h 2001/12/10 01:24:11 1.13 +++ locale/programs/locfile.h 2002/02/04 21:03:02 @@ -22,8 +22,8 @@ #include -#include "linereader.h" #include "localedef.h" +#include "linereader.h" /* Header of the locale data files. */ Index: locale/programs/repertoire.c =================================================================== RCS file: /cvs/glibc/libc/locale/programs/repertoire.c,v retrieving revision 1.13 diff -u -a -r1.13 locale/programs/repertoire.c --- locale/programs/repertoire.c 2001/12/10 01:21:04 1.13 +++ locale/programs/repertoire.c 2002/02/04 21:03:02 @@ -30,11 +30,11 @@ #include #include +#include "localedef.h" #include "linereader.h" #include "charmap.h" #include "repertoire.h" #include "simple-hash.h" -#include "localedef.h" /* Simple keyword hashing for the repertoiremap. */ @@ -322,13 +322,14 @@ } if (state != 2 && state != 90 && !be_quiet) - error (0, 0, _("%s: premature end of file"), repfile->fname); + WITH_CUR_LOCALE (error (0, 0, _("%s: premature end of file"), + repfile->fname)); lr_close (repfile); if (tsearch (result, &known, &repertoire_compare) == NULL) /* Something went wrong. */ - error (0, errno, _("cannot safe new repertoire map")); + WITH_CUR_LOCALE (error (0, errno, _("cannot safe new repertoire map"))); return result; } @@ -339,7 +340,8 @@ { if (tfind (name, &unavailable, (__compar_fn_t) strcmp) == NULL) { - error (0, errno, _("repertoire map file `%s' not found"), name); + WITH_CUR_LOCALE (error (0, errno, _("\ +repertoire map file `%s' not found"), name)); /* Remember that we reported this map. */ tsearch (name, &unavailable, (__compar_fn_t) strcmp); -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Mon Feb 4 17:00:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 04 Feb 2002 17:00:00 -0000 Subject: TLS stuff Message-ID: I've checked i a first batch of thread-local storage related changes. Nothing works yet, it's just the beginning. But it is time to get the ABIs hammered out for anything but ia64, x86, and sparc. Those who are watching the todo list might have seen a new item for the tls integration. The description of it contains a reference of the TLS document I wrote. It's reasonable complete and usable though there will be changes. Give it a read and create the ABIs for your platform. It's really time now. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Feb 4 17:43:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 04 Feb 2002 17:43:00 -0000 Subject: more on TLS Message-ID: In case somebody is thinking about implementing the TLS stuff for anything but x86. I suggest to wait (read it as: I'll not integrate any changes for other archs yet). The design is still in flux. I know the differences between the ABIs for the different architectures and integrate appropriate configury. What I have to know ASAP is whether there is an architecture for which neither model I or II from my document is usable. I doubt that this is the case but in case I'm wrong it is critical to tell me about this now. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Tue Feb 5 02:55:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 05 Feb 2002 02:55:00 -0000 Subject: TLS stuff In-Reply-To: ; from Ulrich Drepper on Mon, Feb 04, 2002 at 05:00:41PM -0800 References: Message-ID: <20020205115807.B987@sunsite.ms.mff.cuni.cz> On Mon, Feb 04, 2002 at 05:00:41PM -0800, Ulrich Drepper wrote: > I've checked i a first batch of thread-local storage related changes. > Nothing works yet, it's just the beginning. But it is time to get the > ABIs hammered out for anything but ia64, x86, and sparc. > > Those who are watching the todo list might have seen a new item for > the tls integration. The description of it contains a reference of > the TLS document I wrote. It's reasonable complete and usable though > there will be changes. Give it a read and create the ABIs for your > platform. It's really time now. +#if USE_TLS + /* Get the dynamic linkers program header. */ + ehdr = (ElfW(Ehdr) *) bootstrap_map_p->l_addr; + phdr = (ElfW(Phdr) *) (bootstrap_map_p->l_addr + ehdr->e_phoff); The above 2 will not work with prelink. bootstrap_map_p->l_addr == 0 in that case. You should use GL(dl_rtld_map).l_map_start instead of bootstrap_map_p->l_addr (or, if you prefer, (ElfW(Addr)) _begin). + for (cnt = 0; cnt < ehdr->e_phnum; ++cnt) Jakub From schwab@suse.de Tue Feb 5 03:07:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Tue, 05 Feb 2002 03:07:00 -0000 Subject: more on TLS In-Reply-To: (Ulrich Drepper's message of "04 Feb 2002 17:43:44 -0800") References: Message-ID: Ulrich Drepper writes: |> What I have to know ASAP is whether there is an architecture for which |> neither model I or II from my document is usable. What are these models? Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From jakub@redhat.com Tue Feb 5 03:19:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 05 Feb 2002 03:19:00 -0000 Subject: LC_* number reduction Message-ID: <20020205122232.C987@sunsite.ms.mff.cuni.cz> Hi! > A call to setlocale opens currently 11 locale files. The needed file operations are expensive. The files > for one locale should be consolidated. > > One drawback is, though, that this will probably eliminate the size optimization currently implemented > which reduces entire locale files to hard links of existing files. The space savings can be large. > Therefore this scheme should be optional. I completely missed this todo item. Looking at how big and hardlinkable the files are, I'd say glibc should use 3 locale files, not 11 nor 1: LC_COLLATE LC_CTYPE LC_LOCALE (or however would be the rest of other LC_* files would be called together) This scheme IMHO doesn't have to be optional. The largest non-COLLATE non-CTYPE LC_* files on my box (with lots of .utf8 locales) are LC_TIME, where largest is a tad bit over 3KB, smallest tad bit over 2KB. The rest of LC_* files are < 470B. LC_TIME has at most 21 nlinks (arabic UTF8 locales) but on average 1-2, and at least ATM LC_LOCALE could fit under 4KB for all locales (and 4KB block filesystems are most common in these days IMHO). The WWW page lists this as started, though I cannot find any changes related to this. Jakub From aj@suse.de Tue Feb 5 05:02:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Tue, 05 Feb 2002 05:02:00 -0000 Subject: Remove warning Message-ID: Compiling glibc I get: _itowa.h:45:1: warning: "SPECIAL" redefined _itoa.h:41:1: warning: this is the location of the previous definition Ok to commit the appended patch? Andreas 2002-02-05 Andreas Jaeger * stdio-common/_itoa.h: Undefine SPECIAL to avoid duplicate definition. * stdio-common/_itowa.h: Likewise. Index: stdio-common/_itoa.h =================================================================== RCS file: /cvs/glibc/libc/stdio-common/_itoa.h,v retrieving revision 1.8 diff -u -p -r1.8 _itoa.h --- _itoa.h 2002/02/03 06:07:59 1.8 +++ _itoa.h 2002/02/05 13:02:09 @@ -55,6 +55,7 @@ _itoa_word (unsigned long value, char *b } return buflim; } +#undef SPECIAL static inline char * __attribute__ ((unused)) _fitoa_word (unsigned long value, char *buf, unsigned int base, int upper_case) Index: stdio-common/_itowa.h =================================================================== RCS file: /cvs/glibc/libc/stdio-common/_itowa.h,v retrieving revision 1.3 diff -u -p -r1.3 _itowa.h --- _itowa.h 2001/07/06 04:55:40 1.3 +++ _itowa.h 2002/02/05 13:02:09 @@ -1,5 +1,5 @@ /* Internal function for converting integers to ASCII. - Copyright (C) 1994, 95, 96, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1994, 95, 96, 97, 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 @@ -59,5 +59,6 @@ _itowa_word (unsigned long value, wchar_ } return bp; } +#undef SPECIAL #endif /* itowa.h */ -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Tue Feb 5 05:04:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Tue, 05 Feb 2002 05:04:00 -0000 Subject: New warnings: INT redefined Message-ID: Using INT in libc-symbols was not the best idea, we now get a lot of warnings since INT was used previously: ../sysdeps/generic/strtol.c:62:1: warning: "INT" redefined ../include/libc-symbols.h:355:1: warning: this is the location of the previous definition ../sysdeps/generic/strtol.c:64:1: warning: "INT" redefined ../include/libc-symbols.h:355:1: warning: this is the location of the previous definition tst-printf.c:77:1: warning: "INT" redefined ../include/libc-symbols.h:358:1: warning: this is the location of the previous definition How should we solve this issue? I would suggest to use INTNAME instead of INT in libc-symbols.h. What do you think? Shall I send a patch? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Tue Feb 5 05:12:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 05 Feb 2002 05:12:00 -0000 Subject: New warnings: INT redefined In-Reply-To: ; from Andreas Jaeger on Tue, Feb 05, 2002 at 02:04:28PM +0100 References: Message-ID: <20020205141459.D987@sunsite.ms.mff.cuni.cz> On Tue, Feb 05, 2002 at 02:04:28PM +0100, Andreas Jaeger wrote: > > Using INT in libc-symbols was not the best idea, we now get a lot of > warnings since INT was used previously: > > ../sysdeps/generic/strtol.c:62:1: warning: "INT" redefined > ../include/libc-symbols.h:355:1: warning: this is the location of the previous definition > ../sysdeps/generic/strtol.c:64:1: warning: "INT" redefined > ../include/libc-symbols.h:355:1: warning: this is the location of the previous definition > tst-printf.c:77:1: warning: "INT" redefined > ../include/libc-symbols.h:358:1: warning: this is the location of the previous definition > > How should we solve this issue? I would suggest to use INTNAME > instead of INT in libc-symbols.h. > > What do you think? Shall I send a patch? I'd say it would be much cleaner if elf/Makefile added -DRTLD_OBJECT to all ld.so only objects and if ldsodefs.h and maybe other headers used: extern void _dl_debug_printf (const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2))); extern void _dl_debug_printf_internal (const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2))); #ifdef RTLD_OBJECT _dl_debug_printf(...) _dl_debug_printf_internal(__VA_ARGS__) #endif Then, only INTDEF would be needed... Jakub From drepper@redhat.com Tue Feb 5 10:11:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 10:11:00 -0000 Subject: more on TLS In-Reply-To: References: Message-ID: Andreas Schwab writes: > What are these models? All described in the document I wrote and which is referenced in the todo list. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Feb 5 10:15:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 10:15:00 -0000 Subject: LC_* number reduction In-Reply-To: <20020205122232.C987@sunsite.ms.mff.cuni.cz> References: <20020205122232.C987@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > I completely missed this todo item. Looking at how big and hardlinkable the > files are, I'd say glibc should use 3 locale files, not 11 nor 1: I do have a different mechanism in mind. Even simpler than that. All can be put in a simple flat "database". I.e., one file which immitates a filesystem with hardlinks etc. It'll also include the locale.lias information. The advantage is that only one file has to be opened, one name lookup in the hash table, and then potentially only one single mmap() call if all the locale data is in consecutive addresses. > The WWW page lists this as started, though I cannot find any changes related > to this. I've stopped working on this before having something committed. I have to finish the TLS stuff first since it requires work on other architectures to follow. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Feb 5 10:16:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 10:16:00 -0000 Subject: Remove warning In-Reply-To: References: Message-ID: Andreas Jaeger writes: > Ok to commit the appended patch? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Feb 5 11:16:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 11:16:00 -0000 Subject: Unreadable localedef messages In-Reply-To: References: Message-ID: Andreas Schwab writes: > localedef does not correctly output error messages because LC_CTYPE has > been reset to POSIX. I've applied this patch to 2.1 now. I had to adjust all the copyright lines myself. Please don't forget this. Adding the code to 2.2 is a bit more complicated since I have lots of not committed local changes here. I'll get to it when I have the opportunity. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Feb 5 11:24:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 11:24:00 -0000 Subject: TLS stuff In-Reply-To: <20020205115807.B987@sunsite.ms.mff.cuni.cz> References: <20020205115807.B987@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > The above 2 will not work with prelink. bootstrap_map_p->l_addr == 0 in that > case. You should use GL(dl_rtld_map).l_map_start instead of > bootstrap_map_p->l_addr (or, if you prefer, (ElfW(Addr)) _begin). Done that now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From schwab@suse.de Tue Feb 5 11:26:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Tue, 05 Feb 2002 11:26:00 -0000 Subject: more on TLS In-Reply-To: (Ulrich Drepper's message of "05 Feb 2002 10:11:27 -0800") References: Message-ID: Ulrich Drepper writes: |> Andreas Schwab writes: |> |> > What are these models? |> |> All described in the document I wrote and which is referenced in the |> todo list. It does not contain any reference to "model I" or "model II". Where can I find more information? Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Tue Feb 5 11:28:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 11:28:00 -0000 Subject: New warnings: INT redefined In-Reply-To: <20020205141459.D987@sunsite.ms.mff.cuni.cz> References: <20020205141459.D987@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > I'd say it would be much cleaner if elf/Makefile added -DRTLD_OBJECT > to all ld.so only objects and if ldsodefs.h and maybe other headers used: > > extern void _dl_debug_printf (const char *fmt, ...) > __attribute__ ((__format__ (__printf__, 1, 2))); > extern void _dl_debug_printf_internal (const char *fmt, ...) > __attribute__ ((__format__ (__printf__, 1, 2))); > #ifdef RTLD_OBJECT > _dl_debug_printf(...) _dl_debug_printf_internal(__VA_ARGS__) > #endif This isn't the best solution. Note that all this must also later work for the libc.so itself. I just started with ld.so. So I guess INTNAME (or maybe better INTUSE, use <-> def) is better. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Feb 5 11:36:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 11:36:00 -0000 Subject: more on TLS In-Reply-To: References: Message-ID: Andreas Schwab writes: > It does not contain any reference to "model I" or "model II". Where can > I find more information? Well, it's called "variant I" and "variant II". The word "model" was used for something else in this context. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Tue Feb 5 11:57:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 05 Feb 2002 11:57:00 -0000 Subject: New warnings: INT redefined In-Reply-To: ; from Ulrich Drepper on Tue, Feb 05, 2002 at 11:28:17AM -0800 References: <20020205141459.D987@sunsite.ms.mff.cuni.cz> Message-ID: <20020205205948.B536@sunsite.ms.mff.cuni.cz> On Tue, Feb 05, 2002 at 11:28:17AM -0800, Ulrich Drepper wrote: > Jakub Jelinek writes: > > > I'd say it would be much cleaner if elf/Makefile added -DRTLD_OBJECT > > to all ld.so only objects and if ldsodefs.h and maybe other headers used: > > > > extern void _dl_debug_printf (const char *fmt, ...) > > __attribute__ ((__format__ (__printf__, 1, 2))); > > extern void _dl_debug_printf_internal (const char *fmt, ...) > > __attribute__ ((__format__ (__printf__, 1, 2))); > > #ifdef RTLD_OBJECT > > _dl_debug_printf(...) _dl_debug_printf_internal(__VA_ARGS__) > > #endif > > This isn't the best solution. Note that all this must also later work > for the libc.so itself. I just started with ld.so. > > So I guess INTNAME (or maybe better INTUSE, use <-> def) is better. But either a function is defined in ld.so, in which case only rtld only objects should use the _internal variant, or it is defined in libc.so, in which case only non-rtld objects should use it. Jakub From drepper@redhat.com Tue Feb 5 12:14:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 12:14:00 -0000 Subject: New warnings: INT redefined In-Reply-To: <20020205205948.B536@sunsite.ms.mff.cuni.cz> References: <20020205141459.D987@sunsite.ms.mff.cuni.cz> <20020205205948.B536@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > But either a function is defined in ld.so, in which case only rtld only > objects should use the _internal variant, or it is defined in libc.so, > in which case only non-rtld objects should use it. This is not what I was talking about. The INT/INTDEF stuff is meant to be used to call functions defined in libc.so from inside the libc.so. This means: - using macros is really not the scalable. Defining macros for each function will be a nightmare. We use function pointers occasionally which cannot be handled with macros. - making the mechamism dependent on some symbol related to rtld is wrong since the same mechanism must be used in libc.so as well. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Tue Feb 5 12:15:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 05 Feb 2002 12:15:00 -0000 Subject: LC_* number reduction In-Reply-To: ; from Ulrich Drepper on Tue, Feb 05, 2002 at 10:15:29AM -0800 References: <20020205122232.C987@sunsite.ms.mff.cuni.cz> Message-ID: <20020205211744.C536@sunsite.ms.mff.cuni.cz> On Tue, Feb 05, 2002 at 10:15:29AM -0800, Ulrich Drepper wrote: > > I completely missed this todo item. Looking at how big and hardlinkable the > > files are, I'd say glibc should use 3 locale files, not 11 nor 1: > > I do have a different mechanism in mind. Even simpler than that. All > can be put in a simple flat "database". I.e., one file which > immitates a filesystem with hardlinks etc. It'll also include the > locale.lias information. The advantage is that only one file has to > be opened, one name lookup in the hash table, and then potentially > only one single mmap() call if all the locale data is in consecutive > addresses. Well, this has obvious advantages, but some disadvantages too: a) if you have this 25M locale.db file installed and want to upgrade glibc which e.g. contains some locales fixes, you need to decide either that you replace this file with the new one (which means blowing away possible user's localedef additions/tweaks/whatever), or leave the old one there (thus the user won't upgrade the locales for which fixes exist). Of course, there could be some "merge" operation for them. I don't consider here rebuilding all locales from sources at glibc package install time, since that takes too long. b) it is no longer possible to install a subset of locales which users will only use (say at install time one chooses he will only be interested in english, french and german locales) - you end up with the 25M file all the time. Jakub From aj@suse.de Tue Feb 5 12:16:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Tue, 05 Feb 2002 12:16:00 -0000 Subject: TLS stuff In-Reply-To: (Ulrich Drepper's message of "04 Feb 2002 17:00:41 -0800") References: Message-ID: Ulrich Drepper writes: > I've checked i a first batch of thread-local storage related changes. > Nothing works yet, it's just the beginning. But it is time to get the > ABIs hammered out for anything but ia64, x86, and sparc. > > Those who are watching the todo list might have seen a new item for > the tls integration. The description of it contains a reference of > the TLS document I wrote. It's reasonable complete and usable though > there will be changes. Give it a read and create the ABIs for your > platform. It's really time now. Thanks for writing up this paper. I'll look at the x86-64 part soon. I've noticed that you mentioned a Sun document. Is Sun the only other OS implementing it this way? Can you point me to the document since I couldn't locate it myself? Thanks, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Tue Feb 5 12:23:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 12:23:00 -0000 Subject: LC_* number reduction In-Reply-To: <20020205211744.C536@sunsite.ms.mff.cuni.cz> References: <20020205122232.C987@sunsite.ms.mff.cuni.cz> <20020205211744.C536@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > a) if you have this 25M locale.db file installed and want to upgrade glibc > which e.g. contains some locales fixes, you need to decide either that > you replace this file with the new one (which means blowing away possible > user's localedef additions/tweaks/whatever), or leave the old one there > (thus the user won't upgrade the locales for which fixes exist). > Of course, there could be some "merge" operation for them. > I don't consider here rebuilding all locales from sources at glibc > package install time, since that takes too long. This isn't much of a problem. What I had in mind is providing some kind of 'ar' functionality. If you have to do major upgrades etc you extract all files from the database and create normal files. Then you update the separate files and finally create a brand new database. > b) it is no longer possible to install a subset of locales which users will > only use (say at install time one chooses he will only be interested in > english, french and german locales) - you end up with the 25M file all > the time. Again, no problem. I would not expect the database to be shipped (maybe as well). You install the single files as it is in the moment. Than run localedef to insert the file and remove the separate file then. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Feb 5 12:24:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 12:24:00 -0000 Subject: TLS stuff In-Reply-To: References: Message-ID: Andreas Jaeger writes: > I've noticed that you mentioned a Sun document. Is Sun the only other > OS implementing it this way? HP has support as well. Also mentioned. > Can you point me to the document since I couldn't locate it myself? No. This is a document marked Sun internal. It's a subset of what I wrote. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From roland@frob.com Tue Feb 5 12:40:00 2002 From: roland@frob.com (Roland McGrath) Date: Tue, 05 Feb 2002 12:40:00 -0000 Subject: New warnings: INT redefined In-Reply-To: Ulrich Drepper's message of , 5 February 2002 11:28:17 -0800 Message-ID: <20020205204010.374DF1BA14@perdition.linnaean.org> > So I guess INTNAME (or maybe better INTUSE, use <-> def) is better. It seems wisest to use a more distinctive name, e.g LIBC_INT and LIBC_INTDEF. From drepper@redhat.com Tue Feb 5 12:51:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 05 Feb 2002 12:51:00 -0000 Subject: New warnings: INT redefined In-Reply-To: <20020205204010.374DF1BA14@perdition.linnaean.org> References: <20020205204010.374DF1BA14@perdition.linnaean.org> Message-ID: Roland McGrath writes: > It seems wisest to use a more distinctive name, e.g LIBC_INT and LIBC_INTDEF. The problem is readability. Keep it short. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From rth@twiddle.net Tue Feb 5 18:51:00 2002 From: rth@twiddle.net (Richard Henderson) Date: Tue, 05 Feb 2002 18:51:00 -0000 Subject: more on TLS In-Reply-To: ; from drepper@redhat.com on Mon, Feb 04, 2002 at 05:43:44PM -0800 References: Message-ID: <20020205185114.A24193@are.twiddle.net> On Mon, Feb 04, 2002 at 05:43:44PM -0800, Ulrich Drepper wrote: > In case somebody is thinking about implementing the TLS stuff for > anything but x86. I suggest to wait (read it as: I'll not integrate > any changes for other archs yet). The design is still in flux. I > know the differences between the ABIs for the different architectures > and integrate appropriate configury. I noticed a few inconsistancies (perhaps just typos) in the existing document. I'll comment on them later. For now, here's what I've come up with for Alpha. Comments appreciated. r~ New relocs: #define R_ALPHA_TLS_GD_HI 28 #define R_ALPHA_TLS_GD_LO 29 #define R_ALPHA_TLS_GD_16 30 #define R_ALPHA_TLS_LDM_HI 31 #define R_ALPHA_TLS_LDM_LO 32 #define R_ALPHA_TLS_LDM_16 33 #define R_ALPHA_TLS_LDO_HI 34 #define R_ALPHA_TLS_LDO_LO 35 #define R_ALPHA_TLS_LDO_16 36 #define R_ALPHA_TLS_IE_HI 37 #define R_ALPHA_TLS_IE_LO 38 #define R_ALPHA_TLS_IE_16 39 #define R_ALPHA_TLS_LE_HI 40 #define R_ALPHA_TLS_LE_LO 41 #define R_ALPHA_TLS_LE_16 42 #define R_ALPHA_DTPMOD32 43 #define R_ALPHA_DTPOFF32 44 #define R_ALPHA_TPOFF32 45 #define LITUSE_TLS_GD 4 #define LITUSE_TLS_LDM 5 Sequences: GD32 ldah $16,x($gp) !tls_gd_hi lda $16,x($16) !tls_gd_lo ldq $27,__tls_get_addr($gp) !literal!1 jsr $26,($27),__tls_get_addr !lituse_tls_gd(x)!1 GD16 lda $16,x($16) !tls_gd_16 ldq $27,__tls_get_addr($gp) !literal!1 jsr $26,($27),__tls_get_addr !lituse_tls_gd(x)!1 LD32 ldah $16,0($gp) !tls_ldm_hi lda $16,0($16) !tls_ldm_lo ldq $27,__tls_get_addr($gp) !literal!1 jsr $26,($27),__tls_get_addr !lituse_tls_ldm!1 ... ldah $1,x($0) !tls_ldo_hi lda $1,x($1) !tls_ldo_lo LD16 lda $16,0($gp) !tls_ldm_16 ldq $27,__tls_get_addr($gp) !literal!1 jsr $26,($27),__tls_get_addr !lituse_tls_ldm!1 ... lda $1,x($0) !tls_ldo_16 IE32 ldah $1,x($gp) !tls_ie_hi ldl $1,x($1) !tls_ie_lo addq $tp,$1,$0 IE16 ldl $1,x($gp) !tls_ie_16 addq $tp,$1,$0 LE32 ldah $1,x($tp) !tls_le_hi lda $1,x($1) !tls_le_lo LE16 lda $1,x($tp) !tls_le_16 Relaxations: literal+lituse_tls_gd(x) -> no relocs ldq -> call_pal rduniq jsr -> addq $16,$0,$0 tls_gd_hi -> tls_ie_hi tls_gd_lo -> tls_ie_lo lda -> ldl tls_gd_16 -> tls_ie_16 lda -> ldl tls_gd_hi -> tls_le_hi tls_gd_lo -> tls_le_lo literal+lituse_tls_ldm -> no relocs ldq -> call_pal rduniq jsr -> addq $16,$0,$0 tls_ldm_hi -> tls_le_hi vs .tdata tls_ldm_lo -> tls_le_lo vs .tdata tls_ie_hi -> tls_le_hi tls_ie_lo -> tls_le_lo ldl -> lda Effects of Relaxations: GD32/IE32 ldah $16,x($gp) !tls_ie_hi ldl $16,x($16) !tls_ie_lo call_pal rduniq addq $16,$0,$0 GD16/IE16 ldl $16,x($gp) !tls_ie_16 call_pal rduniq addq $16,$0,$0 GD32/LE32 ldah $16,x !tls_le_hi lda $16,x($16) !tls_le_lo call_pal rduniq addq $16,$0,$0 IE32/LE32 ldah $1,x !tls_le_hi lda $1,x($1) !tls_le_lo addq $tp,$1,$0 LD32/LE32 ldah $16,.tdata !tls_le_hi ldah $16,.tdata($16) !tls_le_lo call_pal rduniq addq $16,$0,$0 ... ldah $1,x($0) !tls_ldo_hi lda $1,x($1) !tls_ldo_lo Special Notes: GD16, LD16, IE16 refer to 16-bit offsets from the GOT, such as one finds with -fpic vs -fPIC. LE16 refers to a 16-bit offset from the TP. Thus certain relaxations from GD/LD/IE16 to LE cannot occur unless the tls offset for the symbol is small enough. LE16 should be usable directly via a compiler option. The $tp register referred to in the IE and LE sequences is some register in which the compiler has saved the thread pointer that it acquired from "call_pal rduniq". The TLS_LDM relocs do not reference their symbol. The __tls_get_addr function preserves the $gp register. Literals with lituse_tls_gd or lituse_tls_ldm uses cannot be combined with other lituses. Unlike other lituses, the symbol associated with lituse_tls_gd is meaningful. Relaxations are done strictly via reloations, thus the above sequences can be arbitrarily re-ordered. With the exception that the literal for one of the lituse_tls relocs must be considered to set $0, not just $27. Threads are limited to 2GB local storage. This is due to the maximum displacement available in the ldah+lda insns for LE32. Note that the IE form takes advantage of this by storing the tlsoffset in a 32-bit slot, not a 64-bit slot. The tls_index struct should also have 32-bit components to save space. From aj@suse.de Wed Feb 6 06:15:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Wed, 06 Feb 2002 06:15:00 -0000 Subject: New warnings: INT redefined In-Reply-To: (Ulrich Drepper's message of "05 Feb 2002 11:28:17 -0800") References: <20020205141459.D987@sunsite.ms.mff.cuni.cz> Message-ID: Ulrich Drepper writes: > Jakub Jelinek writes: > >> I'd say it would be much cleaner if elf/Makefile added -DRTLD_OBJECT >> to all ld.so only objects and if ldsodefs.h and maybe other headers used: >> >> extern void _dl_debug_printf (const char *fmt, ...) >> __attribute__ ((__format__ (__printf__, 1, 2))); >> extern void _dl_debug_printf_internal (const char *fmt, ...) >> __attribute__ ((__format__ (__printf__, 1, 2))); >> #ifdef RTLD_OBJECT >> _dl_debug_printf(...) _dl_debug_printf_internal(__VA_ARGS__) >> #endif > > This isn't the best solution. Note that all this must also later work > for the libc.so itself. I just started with ld.so. > > So I guess INTNAME (or maybe better INTUSE, use <-> def) is better. I've used INTUSE and have committed the appended patch after testing it on i686, Andreas 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. ============================================================ Index: include/libc-symbols.h --- include/libc-symbols.h 2002/02/03 00:01:30 1.27 +++ include/libc-symbols.h 2002/02/06 13:18:22 @@ -352,10 +352,10 @@ /* Handling on non-exported internal names. We have to do this only for shared code. */ #ifdef SHARED -# define INT(name) name##_internal +# define INTUSE(name) name##_internal # define INTDEF(name) strong_alias (name, name##_internal); #else -# define INT(name) name +# define INTUSE(name) name # define INTDEF(name) #endif ============================================================ Index: elf/dl-deps.c --- elf/dl-deps.c 2002/02/03 00:25:06 1.65 +++ elf/dl-deps.c 2002/02/06 13:18:22 @@ -59,10 +59,10 @@ openaux (void *a) { struct openaux_args *args = (struct openaux_args *) a; - args->aux = INT(_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, 0); } static ptrdiff_t @@ -107,26 +107,26 @@ struct list \ /* DST must not appear in SUID/SGID programs. */ \ if (__libc_enable_secure) \ - INT(_dl_signal_error) (0, __str, NULL, \ - N_("DST not allowed in SUID/SGID programs"));\ + 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 = INT(_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) \ - INT(_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 (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) \ - INT(_dl_debug_printf) (N_("\ + INTUSE(_dl_debug_printf) (N_("\ cannot load auxiliary `%s' because of empty dynamic string token " \ "substitution\n"), __str); \ continue; \ @@ -239,8 +239,8 @@ _dl_map_object_deps (struct link_map *ma /* Store the tag in the argument structure. */ args.name = name; - err = INT(_dl_catch_error) (&objname, &errstring, openaux, - &args); + err = INTUSE(_dl_catch_error) (&objname, &errstring, openaux, + &args); if (__builtin_expect (errstring != NULL, 0)) { if (err) @@ -291,14 +291,14 @@ _dl_map_object_deps (struct link_map *ma /* Say that we are about to load an auxiliary library. */ if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) - INT(_dl_debug_printf) ("load auxiliary object=%s" - " requested by file=%s\n", name, - l->l_name[0] - ? l->l_name : _dl_argv[0]); + INTUSE(_dl_debug_printf) ("load auxiliary object=%s" + " requested by file=%s\n", name, + l->l_name[0] + ? l->l_name : _dl_argv[0]); /* We must be prepared that the addressed shared object is not available. */ - err = INT(_dl_catch_error) (&objname, &errstring, openaux, + err = INTUSE(_dl_catch_error) (&objname, &errstring, openaux, &args); if (__builtin_expect (errstring != NULL, 0)) { @@ -318,13 +318,13 @@ _dl_map_object_deps (struct link_map *ma /* Say that we are about to load an auxiliary library. */ if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) - INT(_dl_debug_printf) ("load filtered object=%s" - " requested by file=%s\n", name, - l->l_name[0] - ? l->l_name : _dl_argv[0]); + INTUSE(_dl_debug_printf) ("load filtered object=%s" + " requested by file=%s\n", name, + l->l_name[0] + ? l->l_name : _dl_argv[0]); /* For filter objects the dependency must be available. */ - err = INT(_dl_catch_error) (&objname, &errstring, openaux, + err = INTUSE(_dl_catch_error) (&objname, &errstring, openaux, &args); if (__builtin_expect (errstring != NULL, 0)) { @@ -453,8 +453,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) - INT(_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]); } @@ -484,8 +484,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) - INT(_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]; @@ -525,7 +525,7 @@ _dl_map_object_deps (struct link_map *ma /* As current DT_AUXILIARY/DT_FILTER implementation needs to be rewritten, no need to bother with prelinking the old implementation. */ - INT(_dl_signal_error) (EINVAL, l->l_name, NULL, N_("\ + INTUSE(_dl_signal_error) (EINVAL, l->l_name, NULL, N_("\ Filters not supported with LD_TRACE_PRELINKING")); } @@ -539,8 +539,8 @@ Filters not supported with LD_TRACE_PREL + (cnt * sizeof (struct link_map *))); if (l->l_local_scope[0] == NULL) - INT(_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")); l->l_local_scope[0]->r_nlist = cnt; l->l_local_scope[0]->r_list = (struct link_map **) (l->l_local_scope[0] + 1); @@ -619,7 +619,7 @@ Filters not supported with LD_TRACE_PREL map->l_initfini[nlist] = NULL; if (errno_reason) - INT(_dl_signal_error) (errno_reason == -1 ? 0 : errno_reason, objname, + INTUSE(_dl_signal_error) (errno_reason == -1 ? 0 : errno_reason, objname, NULL, errstring); } INTDEF (_dl_map_object_deps) ============================================================ Index: elf/dl-reloc.c --- elf/dl-reloc.c 2002/02/03 03:17:18 1.70 +++ elf/dl-reloc.c 2002/02/06 13:18:22 @@ -59,9 +59,9 @@ _dl_relocate_object (struct link_map *l, lazy = 0; if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_RELOC, 0)) - INT(_dl_debug_printf) ("\nrelocation processing: %s%s\n", - l->l_name[0] ? l->l_name : _dl_argv[0], - lazy ? " (lazy)" : ""); + INTUSE(_dl_debug_printf) ("\nrelocation processing: %s%s\n", + l->l_name[0] ? l->l_name : _dl_argv[0], + 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 @@ -87,7 +87,7 @@ _dl_relocate_object (struct link_map *l, { errstring = N_("cannot make segment writable for relocation"); call_error: - INT(_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 @@ -126,12 +126,12 @@ _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 \ - ? INT(_dl_lookup_versioned_symbol) (strtab \ - + (*ref)->st_name, \ - l, (ref), scope, \ - (version), _tc, 0) \ - : INT(_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, 0)); \ l->l_lookup_cache.ret = (*ref); \ l->l_lookup_cache.value = _lr; })) \ : l) @@ -147,12 +147,12 @@ _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 \ - ? INT(_dl_lookup_versioned_symbol) (strtab \ - + (*ref)->st_name, \ - l, (ref), scope, \ - (version), _tc, 0) \ - : INT(_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, 0)); \ l->l_lookup_cache.ret = (*ref); \ l->l_lookup_cache.value = _lr; })) \ : l->l_addr) @@ -223,5 +223,5 @@ _dl_reloc_bad_type (struct link_map *map *cp++ = DIGIT (type >> 4); *cp = DIGIT (type); - INT(_dl_signal_error) (0, map->l_name, NULL, msgbuf); + INTUSE(_dl_signal_error) (0, map->l_name, NULL, msgbuf); } ============================================================ Index: elf/rtld.c --- elf/rtld.c 2002/02/06 03:42:42 1.231 +++ elf/rtld.c 2002/02/06 13:18:23 @@ -383,14 +383,14 @@ relocate_doit (void *a) { struct relocate_args *args = (struct relocate_args *) a; - INT(_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 = INT(_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 @@ -580,7 +580,7 @@ of this helper program; chances are you struct map_args args; args.str = _dl_argv[0]; - (void) INT(_dl_catch_error) (&objname, &err_str, map_doit, &args); + (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) @@ -591,7 +591,7 @@ of this helper program; chances are you else { HP_TIMING_NOW (start); - INT(_dl_map_object) (NULL, _dl_argv[0], 0, lt_library, 0, 0); + INTUSE(_dl_map_object) (NULL, _dl_argv[0], 0, lt_library, 0, 0); HP_TIMING_NOW (stop); HP_TIMING_DIFF (load_time, start, stop); @@ -808,9 +808,9 @@ of this helper program; chances are you && (__builtin_expect (! __libc_enable_secure, 1) || strchr (p, '/') == NULL)) { - struct link_map *new_map = INT(_dl_map_object) (GL(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; @@ -877,10 +877,10 @@ of this helper program; chances are you while ((p = strsep (&runp, ": \t\n")) != NULL) if (p[0] != '\0') { - struct link_map *new_map = INT(_dl_map_object) (GL(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; @@ -890,8 +890,8 @@ of this helper program; chances are you if (problem != NULL) { char *p = strndupa (problem, file_size - (problem - file)); - struct link_map *new_map = INT(_dl_map_object) (GL(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; @@ -924,7 +924,7 @@ 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); - INT(_dl_map_object_deps) (GL(dl_loaded), preloads, npreloads, mode == trace); + INTUSE(_dl_map_object_deps) (GL(dl_loaded), preloads, npreloads, mode == trace); HP_TIMING_NOW (stop); HP_TIMING_DIFF (diff, start, stop); HP_TIMING_ACCUM_NT (load_time, diff); @@ -1046,9 +1046,9 @@ of this helper program; chances are you ElfW(Addr) loadbase; lookup_t result; - result = INT(_dl_lookup_symbol) (_dl_argv[i], GL(dl_loaded), - &ref, GL(dl_loaded)->l_scope, - ELF_RTYPE_CLASS_PLT, 1); + result = INTUSE(_dl_lookup_symbol) (_dl_argv[i], GL(dl_loaded), + &ref, GL(dl_loaded)->l_scope, + ELF_RTYPE_CLASS_PLT, 1); loadbase = LOOKUP_VALUE_ADDRESS (result); @@ -1084,8 +1084,8 @@ of this helper program; chances are you if ((GL(dl_debug_mask) & DL_DEBUG_PRELINK) && GL(dl_rtld_map).l_opencount > 1) - INT(_dl_relocate_object) (&GL(dl_rtld_map), - GL(dl_loaded)->l_scope, 0, 0); + 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)) @@ -1282,8 +1282,8 @@ of this helper program; chances are you } if (l != &GL(dl_rtld_map)) - INT(_dl_relocate_object) (l, l->l_scope, GL(dl_lazy), - consider_profiling); + INTUSE(_dl_relocate_object) (l, l->l_scope, GL(dl_lazy), + consider_profiling); l = l->l_prev; } @@ -1305,15 +1305,15 @@ of this helper program; chances are you 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. */ - INT(_dl_start_profile) (GL(dl_profile_map), GL(dl_profile_output)); + 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); - INT(_dl_relocate_object) (&GL(dl_rtld_map), GL(dl_loaded)->l_scope, - 0, 0); + 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); @@ -1358,12 +1358,12 @@ of this helper program; chances are you /* Notify the debugger that all objects are now mapped in. */ r->r_state = RT_ADD; - INT(_dl_debug_state) (); + INTUSE(_dl_debug_state) (); } #ifndef MAP_COPY /* We must munmap() the cache file. */ - INT(_dl_unload_cache) (); + INTUSE(_dl_unload_cache) (); #endif /* Once we return, _dl_sysdep_start will invoke @@ -1704,9 +1704,9 @@ print_statistics (void) if (HP_TIMING_AVAIL) { HP_TIMING_PRINT (buf, sizeof (buf), rtld_total_time); - INT(_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. */ @@ -1728,15 +1728,15 @@ print_statistics (void) *wp++ = *cp++; } *wp = '\0'; - INT(_dl_debug_printf) ("\ + INTUSE(_dl_debug_printf) ("\ time needed for relocation: %s (%s%%)\n", - buf, pbuf); + buf, pbuf); } #endif - INT(_dl_debug_printf) (" number of relocations: %lu\n", - GL(dl_num_relocations)); - INT(_dl_debug_printf) (" number of relocations from cache: %lu\n", - GL(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. */ @@ -1758,9 +1758,9 @@ print_statistics (void) *wp++ = *cp++; } *wp = '\0'; - INT(_dl_debug_printf) ("\ + INTUSE(_dl_debug_printf) ("\ time needed to load objects: %s (%s%%)\n", - buf, pbuf); + buf, pbuf); } #endif } ============================================================ Index: elf/dl-version.c --- elf/dl-version.c 2002/02/03 19:24:31 1.33 +++ elf/dl-version.c 2002/02/06 13:18:23 @@ -87,10 +87,10 @@ match_symbol (const char *name, ElfW(Wor /* Display information about what we are doing while debugging. */ if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_VERSIONS, 0)) - INT(_dl_debug_printf) ("\ + 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 : _dl_argv[0], name); if (__builtin_expect (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL, 0)) { @@ -214,9 +214,9 @@ _dl_check_map_versions (struct link_map &buf[sizeof (buf) - 1], 10, 0), " of Verneed record\n"); call_error: - INT(_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 : _dl_argv[0]), + NULL, errstring); } while (1) @@ -386,7 +386,7 @@ _dl_check_all_versions (struct link_map for (l = map; l != NULL; l = l->l_next) result |= (! l->l_faked - && INT(_dl_check_map_versions) (l, verbose, trace_mode)); + && INTUSE(_dl_check_map_versions) (l, verbose, trace_mode)); return result; } ============================================================ Index: elf/dl-load.c --- elf/dl-load.c 2002/02/06 00:54:40 1.192 +++ elf/dl-load.c 2002/02/06 13:18:23 @@ -308,7 +308,7 @@ expand_dynamic_string_token (struct link if (result == NULL) return NULL; - return INT(_dl_dst_substitute) (l, s, result, 1); + return INTUSE(_dl_dst_substitute) (l, s, result, 1); } @@ -334,7 +334,7 @@ add_name_to_object (struct link_map *l, if (newname == NULL) { /* No more memory. */ - INT(_dl_signal_error) (ENOMEM, name, NULL, + INTUSE(_dl_signal_error) (ENOMEM, name, NULL, N_("cannot allocate name record")); return; } @@ -436,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) - INT(_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)); @@ -519,7 +519,7 @@ decompose_rpath (struct r_search_path_st signal_error_cache: errstring = N_("cannot create cache for search path"); signal_error: - INT(_dl_signal_error) (ENOMEM, NULL, NULL, errstring); + INTUSE(_dl_signal_error) (ENOMEM, NULL, NULL, errstring); } result[0] = NULL; @@ -599,7 +599,7 @@ _dl_init_paths (const char *llp) { errstring = N_("cannot create search path array"); signal_error: - INT(_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 @@ -764,7 +764,7 @@ lose (int code, int fd, const char *name free (l); } free (realname); - INT(_dl_signal_error) (code, name, NULL, msg); + INTUSE(_dl_signal_error) (code, name, NULL, msg); } @@ -823,7 +823,7 @@ _dl_map_object_from_fd (const char *name /* Print debugging message. */ if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0)) - INT(_dl_debug_printf) ("file=%s; generating link map\n", name); + 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; @@ -836,7 +836,7 @@ _dl_map_object_from_fd (const char *name if (_dl_zerofd == -1) { __close (fd); - INT(_dl_signal_error) (errno, NULL, NULL, + INTUSE(_dl_signal_error) (errno, NULL, NULL, N_("cannot open zero fill device")); } } @@ -1152,7 +1152,7 @@ _dl_map_object_from_fd (const char *name l->l_entry += l->l_addr; if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0)) - INT(_dl_debug_printf) ("\ + 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, @@ -1243,7 +1243,7 @@ print_search_path (struct r_search_path_ char buf[max_dirnamelen + max_capstrlen]; int first = 1; - INT(_dl_debug_printf) (" search path="); + INTUSE(_dl_debug_printf) (" search path="); while (*list != NULL && (*list)->what == what) /* Yes, ==. */ { @@ -1514,7 +1514,7 @@ open_path (const char *name, size_t name /* Print name we try if this is wanted. */ if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) - INT(_dl_debug_printf) (" trying file=%s\n", buf); + INTUSE(_dl_debug_printf) (" trying file=%s\n", buf); fd = open_verify (buf, fbp); if (this_dir->status[cnt] == unknown) @@ -1648,8 +1648,8 @@ _dl_map_object (struct link_map *loader, /* Display information if we are debugging. */ if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0) && loader != NULL) - INT(_dl_debug_printf) ("\nfile=%s; needed by %s\n", name, - loader->l_name[0] ? loader->l_name : _dl_argv[0]); + INTUSE(_dl_debug_printf) ("\nfile=%s; needed by %s\n", name, + loader->l_name[0] ? loader->l_name : _dl_argv[0]); if (strchr (name, '/') == NULL) { @@ -1658,7 +1658,7 @@ _dl_map_object (struct link_map *loader, size_t namelen = strlen (name) + 1; if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) - INT(_dl_debug_printf) ("find library=%s; searching\n", name); + INTUSE(_dl_debug_printf) ("find library=%s; searching\n", name); fd = -1; @@ -1807,7 +1807,7 @@ _dl_map_object (struct link_map *loader, /* Add another newline when we a tracing the library loading. */ if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) - INT(_dl_debug_printf) ("\n"); + INTUSE(_dl_debug_printf) ("\n"); } else { @@ -1839,7 +1839,7 @@ _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) - INT(_dl_signal_error) (ENOMEM, name, NULL, N_("\ + INTUSE(_dl_signal_error) (ENOMEM, name, NULL, N_("\ cannot create shared object descriptor")); /* Signal that this is a faked entry. */ l->l_faked = 1; @@ -1853,7 +1853,7 @@ cannot create shared object descriptor") return l; } else - INT(_dl_signal_error) (errno, name, NULL, + INTUSE(_dl_signal_error) (errno, name, NULL, N_("cannot open shared object file")); } ============================================================ Index: elf/dl-dst.h --- elf/dl-dst.h 2002/02/03 00:25:07 1.6 +++ elf/dl-dst.h 2002/02/06 13:18:23 @@ -25,7 +25,7 @@ const char *__sf = strchr (name, '$'); \ \ if (__builtin_expect (__sf != NULL, 0)) \ - __cnt = INT(_dl_dst_count) (__sf, is_path); \ + __cnt = INTUSE(_dl_dst_count) (__sf, is_path); \ \ __cnt; }) ============================================================ Index: elf/dl-init.c --- elf/dl-init.c 2002/02/03 00:25:07 1.32 +++ elf/dl-init.c 2002/02/06 13:18:23 @@ -51,8 +51,8 @@ call_init (struct link_map *l, int argc, /* Print a debug message if wanted. */ if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) - INT(_dl_debug_printf) ("\ncalling init: %s\n\n", - l->l_name[0] ? l->l_name : _dl_argv[0]); + INTUSE(_dl_debug_printf) ("\ncalling init: %s\n\n", + l->l_name[0] ? l->l_name : _dl_argv[0]); /* Now run the local constructors. There are two forms of them: - the one named by DT_INIT @@ -106,9 +106,9 @@ _dl_init (struct link_map *main_map, int unsigned int cnt; if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) - INT(_dl_debug_printf) ("\ncalling preinit: %s\n\n", - main_map->l_name[0] - ? main_map->l_name : _dl_argv[0]); + INTUSE(_dl_debug_printf) ("\ncalling preinit: %s\n\n", + main_map->l_name[0] + ? main_map->l_name : _dl_argv[0]); addrs = (ElfW(Addr) *) (main_map->l_info[DT_PREINIT_ARRAY]->d_un.d_ptr + main_map->l_addr); @@ -121,7 +121,7 @@ _dl_init (struct link_map *main_map, int not been used before. */ r = _dl_debug_initialize (0); r->r_state = RT_ADD; - INT(_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 @@ -139,7 +139,7 @@ _dl_init (struct link_map *main_map, int /* Notify the debugger all new objects are now ready to go. */ r->r_state = RT_CONSISTENT; - INT(_dl_debug_state) (); + INTUSE(_dl_debug_state) (); /* Finished starting up. */ _dl_starting_up = 0; ============================================================ Index: sysdeps/generic/dl-sysdep.c --- sysdeps/generic/dl-sysdep.c 2002/02/04 08:37:01 1.76 +++ sysdeps/generic/dl-sysdep.c 2002/02/06 13:18:24 @@ -296,8 +296,8 @@ _dl_important_hwcaps (const char *platfo if (result == NULL) { no_memory: - INT(_dl_signal_error) (ENOMEM, NULL, NULL, - N_("cannot create capability list")); + INTUSE(_dl_signal_error) (ENOMEM, NULL, NULL, + N_("cannot create capability list")); } result[0].str = (char *) result; /* Does not really matter. */ ============================================================ Index: sysdeps/generic/dl-cache.c --- sysdeps/generic/dl-cache.c 2002/02/03 00:25:07 1.40 +++ sysdeps/generic/dl-cache.c 2002/02/06 13:18:24 @@ -149,7 +149,7 @@ _dl_load_cache_lookup (const char *name) /* Print a message if the loading of libs is traced. */ if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) - INT(_dl_debug_printf) (" search cache=%s\n", LD_SO_CACHE); + INTUSE(_dl_debug_printf) (" search cache=%s\n", LD_SO_CACHE); if (cache == NULL) { -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From schwidefsky@de.ibm.com Wed Feb 6 06:47:00 2002 From: schwidefsky@de.ibm.com (Martin Schwidefsky) Date: Wed, 06 Feb 2002 06:47:00 -0000 Subject: s390 patches for the trunk. Message-ID: Hi, I have another update for the s390/s390x backends. Most of them are self explaining. The versions problem is solved with the Versions file for 64 bit and a patch for gcc 3.1 that exports __register_frame and co as GLIBC_2.2 symbols for s390x. The cvs head of today with the attached patch compiles with gcc 2.95.3 and gcc 3.1 but "make tests" reports one problem with io/bug-ftw3 and after "make install" the assembler is doing strange things (but the system is basically working). I haven't tracked down why so far. 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. blue skies, Martin (See attached file: s390-fixes.diff)(See attached file: s390-fixes.ChangeLog) Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch?naicherstr. 220, D-71032 B?blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: s390-fixes.diff Type: application/octet-stream Size: 5742 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: s390-fixes.ChangeLog Type: application/octet-stream Size: 798 bytes Desc: not available URL: From jakub@redhat.com Wed Feb 6 07:19:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 06 Feb 2002 07:19:00 -0000 Subject: [PATCH] Fix ftw3 test (was Re: s390 patches for the trunk.) In-Reply-To: ; from Martin Schwidefsky on Wed, Feb 06, 2002 at 03:45:51PM +0100 References: Message-ID: <20020206162225.I536@sunsite.ms.mff.cuni.cz> On Wed, Feb 06, 2002 at 03:45:51PM +0100, Martin Schwidefsky wrote: > > Hi, > I have another update for the s390/s390x backends. Most of them are self > explaining. The versions problem is solved with the Versions file for > 64 bit and a patch for gcc 3.1 that exports __register_frame and co as > GLIBC_2.2 symbols for s390x. The cvs head of today with the attached > patch compiles with gcc 2.95.3 and gcc 3.1 but "make tests" reports one > problem with io/bug-ftw3. You were running make check as root, weren't you? I noticed it already too some weeks ago. That test relies on not beeing run as root, so it might as well just bail out in that case. 2002-02-06 Jakub Jelinek * io/bug-ftw3.c (main): Don't try the test if root. --- libc/io/bug-ftw3.c 2002/01/31 21:31:49 +++ libc/io/bug-ftw3.c 2002/01/08 11:46:46 @@ -25,6 +25,12 @@ main (void) int r; int e; + if (getuid () == 0) + { + puts ("this test needs to be run by ordinary user"); + exit (0); + } + dname = mkdtemp (tmp); if (dname == NULL) { Jakub From aj@suse.de Thu Feb 7 04:34:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Thu, 07 Feb 2002 04:34:00 -0000 Subject: attribute(packed) in struct stat is wrong Message-ID: With current CVS I get: GCONV_PATH=/builds/glibc/gcc-3.1/iconvdata LC_ALL=C /builds/glibc/gcc-3.1/elf/ld-linux.so.2 --library-path /builds/glibc/gcc-3.1:/builds/glibc/gcc-3.1/math:/builds/glibc/gcc-3.1/elf:/builds/glibc/gcc-3.1/dlfcn:/builds/glibc/gcc-3.1/nss:/builds/glibc/gcc-3.1/nis:/builds/glibc/gcc-3.1/rt:/builds/glibc/gcc-3.1/resolv:/builds/glibc/gcc-3.1/crypt:/builds/glibc/gcc-3.1/linuxthreads /builds/glibc/gcc-3.1/io/test-stat > /builds/glibc/gcc-3.1/io/test-stat.out test-stat: test-stat.c:35: main: Assertion `sizeof (struct stat) == sizeof (struct stat64)' failed. Removing the assertions gives: test-stat: test-stat.c:39: main: Assertion `((size_t) &((struct stat *)0)->st_ino) == ((size_t) &((struct stat64 *)0)->st_ino)' failed. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Thu Feb 7 04:38:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 07 Feb 2002 04:38:00 -0000 Subject: attribute(packed) in struct stat is wrong In-Reply-To: ; from Andreas Jaeger on Thu, Feb 07, 2002 at 01:34:57PM +0100 References: Message-ID: <20020207134051.B558@sunsite.ms.mff.cuni.cz> On Thu, Feb 07, 2002 at 01:34:57PM +0100, Andreas Jaeger wrote: > > With current CVS I get: > > GCONV_PATH=/builds/glibc/gcc-3.1/iconvdata LC_ALL=C /builds/glibc/gcc-3.1/elf/ld-linux.so.2 --library-path /builds/glibc/gcc-3.1:/builds/glibc/gcc-3.1/math:/builds/glibc/gcc-3.1/elf:/builds/glibc/gcc-3.1/dlfcn:/builds/glibc/gcc-3.1/nss:/builds/glibc/gcc-3.1/nis:/builds/glibc/gcc-3.1/rt:/builds/glibc/gcc-3.1/resolv:/builds/glibc/gcc-3.1/crypt:/builds/glibc/gcc-3.1/linuxthreads /builds/glibc/gcc-3.1/io/test-stat > /builds/glibc/gcc-3.1/io/test-stat.out > test-stat: test-stat.c:35: main: Assertion `sizeof (struct stat) == sizeof (struct stat64)' failed. > > Removing the assertions gives: > test-stat: test-stat.c:39: main: Assertion `((size_t) &((struct stat *)0)->st_ino) == ((size_t) &((struct stat64 *)0)->st_ino)' failed. Which arch? Jakub From aj@suse.de Thu Feb 7 04:41:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Thu, 07 Feb 2002 04:41:00 -0000 Subject: attribute(packed) in struct stat is wrong In-Reply-To: <20020207134051.B558@sunsite.ms.mff.cuni.cz> (Jakub Jelinek's message of "Thu, 7 Feb 2002 13:40:51 +0100") References: <20020207134051.B558@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > On Thu, Feb 07, 2002 at 01:34:57PM +0100, Andreas Jaeger wrote: >> >> With current CVS I get: >> >> GCONV_PATH=/builds/glibc/gcc-3.1/iconvdata LC_ALL=C /builds/glibc/gcc-3.1/elf/ld-linux.so.2 --library-path /builds/glibc/gcc-3.1:/builds/glibc/gcc-3.1/math:/builds/glibc/gcc-3.1/elf:/builds/glibc/gcc-3.1/dlfcn:/builds/glibc/gcc-3.1/nss:/builds/glibc/gcc-3.1/nis:/builds/glibc/gcc-3.1/rt:/builds/glibc/gcc-3.1/resolv:/builds/glibc/gcc-3.1/crypt:/builds/glibc/gcc-3.1/linuxthreads /builds/glibc/gcc-3.1/io/test-stat > /builds/glibc/gcc-3.1/io/test-stat.out >> test-stat: test-stat.c:35: main: Assertion `sizeof (struct stat) == sizeof (struct stat64)' failed. >> >> Removing the assertions gives: >> test-stat: test-stat.c:39: main: Assertion `((size_t) &((struct stat *)0)->st_ino) == ((size_t) &((struct stat64 *)0)->st_ino)' failed. > > Which arch? Sorry: i686-linux-gnu, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From schwab@suse.de Thu Feb 7 04:57:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Thu, 07 Feb 2002 04:57:00 -0000 Subject: glob must not call globfree Message-ID: glob must never call globfree by itself, it is the sole resposibility of the caller to do that. Andreas. 2002-02-07 Andreas Schwab * sysdeps/generic/glob.c: Don't call globfree on the passed glob structure. --- sysdeps/generic/glob.c.~1.40.~ Wed Jan 2 11:11:57 2002 +++ sysdeps/generic/glob.c Thu Feb 7 13:39:11 2002 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1991-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 @@ -417,11 +417,7 @@ #else char *onealt = (char *) malloc (strlen (pattern) - 1); if (onealt == NULL) - { - if (!(flags & GLOB_APPEND)) - globfree (pglob); - return GLOB_NOSPACE; - } + return GLOB_NOSPACE; #endif /* We know the prefix for all sub-patterns. */ @@ -500,8 +496,6 @@ #ifndef __GNUC__ free (onealt); #endif - if (!(flags & GLOB_APPEND)) - globfree (pglob); return result; } @@ -932,7 +926,6 @@ if (status != 0) { globfree (&dirs); - globfree (pglob); return status; } @@ -942,7 +935,6 @@ pglob->gl_pathc - old_pathc)) { globfree (&dirs); - globfree (pglob); return GLOB_NOSPACE; } } @@ -974,7 +966,6 @@ if (pglob->gl_pathv[newcount] == NULL) { globfree (&dirs); - globfree (pglob); return GLOB_NOSPACE; } @@ -1007,10 +998,7 @@ if (prefix_array (dirname, &pglob->gl_pathv[old_pathc + pglob->gl_offs], pglob->gl_pathc - old_pathc)) - { - globfree (pglob); - return GLOB_NOSPACE; - } + return GLOB_NOSPACE; } } @@ -1033,10 +1021,7 @@ size_t len = strlen (pglob->gl_pathv[i]) + 2; char *new = realloc (pglob->gl_pathv[i], len); if (new == NULL) - { - globfree (pglob); - return GLOB_NOSPACE; - } + return GLOB_NOSPACE; strcpy (&new[len - 2], "/"); pglob->gl_pathv[i] = new; } -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From schwab@suse.de Thu Feb 7 05:35:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Thu, 07 Feb 2002 05:35:00 -0000 Subject: glob must not call globfree In-Reply-To: (Andreas Schwab's message of "Thu, 07 Feb 2002 13:57:48 +0100") References: Message-ID: This was pointed out by Tim Waugh in private mail: wordexp does not always call globfree after glob. Andreas. 2002-02-07 Andreas Schwab * sysdeps/generic/wordexp.c (do_parse_glob): Always call globfree after glob. --- sysdeps/generic/wordexp.c.~1.6.~ Fri Aug 17 09:15:21 2001 +++ sysdeps/generic/wordexp.c Thu Feb 7 14:12:33 2002 @@ -1,5 +1,5 @@ /* POSIX.2 wordexp implementation. - 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 Tim Waugh . @@ -395,6 +395,7 @@ { /* We can only run into memory problems. */ assert (error == GLOB_NOSPACE); + globfree (&globbuf); return WRDE_NOSPACE; } -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From schwab@suse.de Thu Feb 7 05:53:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Thu, 07 Feb 2002 05:53:00 -0000 Subject: Cannot build without TLS Message-ID: The fact that TLS is unsupported should be preclude building. 2002-02-07 Andreas Schwab * sysdeps/generic/dl-tls.h: Do not error out if USE_TLS is not defined. --- sysdeps/generic/dl-tls.h.~1.1.~ Thu Feb 7 05:02:32 2002 +++ sysdeps/generic/dl-tls.h Thu Feb 7 14:50:02 2002 @@ -1,2 +1,4 @@ +#ifdef USE_TLS /* There has to be an architecture specific version of this file. */ #error "architecture-specific version of missing" +#endif -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From schwab@suse.de Thu Feb 7 06:10:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Thu, 07 Feb 2002 06:10:00 -0000 Subject: Configure check for -zcombreloc Message-ID: The configure check for -zcombreloc fails on ia64 because no .rela.dyn is needed with this tiny test. Adding a reference to a global variable fixes this. Andreas. 2002-02-07 Andreas Schwab * configure.in: Fix check for -zcombreloc. --- configure.in.~1.327.2.1.~ Fri Dec 14 11:23:42 2001 +++ configure.in Thu Feb 7 14:31:26 2002 @@ -1059,8 +1059,9 @@ AC_CACHE_CHECK(for -z combreloc, libc_cv_z_combreloc, [dnl cat > conftest.c <; from Andreas Jaeger on Thu, Feb 07, 2002 at 01:34:57PM +0100 References: Message-ID: <20020207152827.D558@sunsite.ms.mff.cuni.cz> Hi! On Thu, Feb 07, 2002 at 01:34:57PM +0100, Andreas Jaeger wrote: > > With current CVS I get: > > GCONV_PATH=/builds/glibc/gcc-3.1/iconvdata LC_ALL=C /builds/glibc/gcc-3.1/elf/ld-linux.so.2 --library-path /builds/glibc/gcc-3.1:/builds/glibc/gcc-3.1/math:/builds/glibc/gcc-3.1/elf:/builds/glibc/gcc-3.1/dlfcn:/builds/glibc/gcc-3.1/nss:/builds/glibc/gcc-3.1/nis:/builds/glibc/gcc-3.1/rt:/builds/glibc/gcc-3.1/resolv:/builds/glibc/gcc-3.1/crypt:/builds/glibc/gcc-3.1/linuxthreads /builds/glibc/gcc-3.1/io/test-stat > /builds/glibc/gcc-3.1/io/test-stat.out > test-stat: test-stat.c:35: main: Assertion `sizeof (struct stat) == sizeof (struct stat64)' failed. > > Removing the assertions gives: > test-stat: test-stat.c:39: main: Assertion `((size_t) &((struct stat *)0)->st_ino) == ((size_t) &((struct stat64 *)0)->st_ino)' failed. Here is a fix for this. I don't think we need to add attribute packed if the structures are already properly packed (which they were not on IA-32, fixed below). I've tested this with all combinations of nothing/-fpack-struct and nothing/-D_FILE_OFFSET_BITS=64 and in all cases the structures have 88 bytes resp. 96 bytes as they used to (unless -fpack-struct was given). arm/cris/hppa/sh maintainers should probably check whether the patch doesn't make any difference on their arches, but I think just m68k doesn't align 32-bit value to 32-bits. 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. --- libc/sysdeps/unix/sysv/linux/bits/stat.h.jj Thu Feb 7 15:10:47 2002 +++ libc/sysdeps/unix/sysv/linux/bits/stat.h Thu Feb 7 15:16:53 2002 @@ -36,7 +36,7 @@ struct stat { __dev_t st_dev; /* Device. */ - unsigned short int __pad1; + unsigned int __pad1; #ifndef __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ #else @@ -47,7 +47,7 @@ struct stat __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ - unsigned short int __pad2; + unsigned int __pad2; #ifndef __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ #else @@ -72,7 +72,7 @@ struct stat #else __ino64_t st_ino; /* File serial number. */ #endif - } __attribute__ ((__packed__)); + }; #ifdef __USE_LARGEFILE64 struct stat64 @@ -98,7 +98,7 @@ struct stat64 __time_t st_ctime; /* Time of last status change. */ unsigned long int __unused3; __ino64_t st_ino; /* File serial number. */ - } __attribute__ ((__packed__)); + }; #endif /* Tell code we have these members. */ Jakub From drepper@redhat.com Thu Feb 7 09:03:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 07 Feb 2002 09:03:00 -0000 Subject: attribute(packed) in struct stat is wrong In-Reply-To: References: <20020207134051.B558@sunsite.ms.mff.cuni.cz> Message-ID: Andreas Jaeger writes: > Sorry: i686-linux-gnu, Why should gcc 3.1 behave differently than 2.96? It definitely works here. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Thu Feb 7 09:30:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 07 Feb 2002 09:30:00 -0000 Subject: attribute(packed) in struct stat is wrong In-Reply-To: ; from Ulrich Drepper on Thu, Feb 07, 2002 at 09:03:01AM -0800 References: <20020207134051.B558@sunsite.ms.mff.cuni.cz> Message-ID: <20020207183302.F558@sunsite.ms.mff.cuni.cz> On Thu, Feb 07, 2002 at 09:03:01AM -0800, Ulrich Drepper wrote: > Andreas Jaeger writes: > > > Sorry: i686-linux-gnu, > > Why should gcc 3.1 behave differently than 2.96? It definitely works > here. 2.96-RH behaves the same way as 3.1 - packed struct stat has 84 bytes while non-packed 88. Jakub From drepper@redhat.com Thu Feb 7 09:36:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 07 Feb 2002 09:36:00 -0000 Subject: s390 patches for the trunk. In-Reply-To: References: Message-ID: "Martin Schwidefsky" writes: > I have another update for the s390/s390x backends. I've applied the patch, thanks. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Feb 7 09:37:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 07 Feb 2002 09:37:00 -0000 Subject: [PATCH] Fix ftw3 test (was Re: s390 patches for the trunk.) In-Reply-To: <20020206162225.I536@sunsite.ms.mff.cuni.cz> References: <20020206162225.I536@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > 2002-02-06 Jakub Jelinek > > * io/bug-ftw3.c (main): Don't try the test if root. Makes sense, I've applied it. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Feb 7 09:42:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 07 Feb 2002 09:42:00 -0000 Subject: Cannot build without TLS In-Reply-To: References: Message-ID: Andreas Schwab writes: > The fact that TLS is unsupported should be preclude building. Should be fixed (differently) now. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Feb 7 09:43:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 07 Feb 2002 09:43:00 -0000 Subject: Configure check for -zcombreloc In-Reply-To: References: Message-ID: Andreas Schwab writes: > 2002-02-07 Andreas Schwab > > * configure.in: Fix check for -zcombreloc. OK, I've applied it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From roland@frob.com Thu Feb 7 11:43:00 2002 From: roland@frob.com (Roland McGrath) Date: Thu, 07 Feb 2002 11:43:00 -0000 Subject: glob must not call globfree In-Reply-To: Andreas Schwab's message of Thu, 7 February 2002 13:57:48 +0100 Message-ID: <20020207194259.E8DD31BA14@perdition.linnaean.org> I don't have the spec handy but it seems unlikely to me that a caller getting GLOB_NOSPACE is expected to call globfree. Are you sure? From drepper@redhat.com Thu Feb 7 20:53:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 07 Feb 2002 20:53:00 -0000 Subject: [PATCH] Fix struct stat* (was Re: attribute(packed) in struct stat is wrong) In-Reply-To: <20020207152827.D558@sunsite.ms.mff.cuni.cz> References: <20020207152827.D558@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > 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. Well, this is better. I don't know why I haven't seen any problem yesterday but I've seen them today. And your patch fixes the test suite problems. Which is not handled is using stat64 with -malign-double. And I doubt it can be handled. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Feb 7 20:57:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 07 Feb 2002 20:57:00 -0000 Subject: glob must not call globfree In-Reply-To: References: Message-ID: Andreas Schwab writes: > 2002-02-07 Andreas Schwab > > * sysdeps/generic/glob.c: Don't call globfree on the passed glob > structure. I very much doubt this is correct. I've never seen any requirement like this. If somebody intercepts the globfree calls for whatever reasons and finds them handling memory which wasn't returned by a call to glob this is the problem of that code. Fortunately for whoever makes this assumption one of the optimizations on the table for 2.3 will eliminate this. If you send me a complete patch to use INTDEF/INTUSE you get the effect you want. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Feb 7 23:51:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 07 Feb 2002 23:51:00 -0000 Subject: bits/stat.h Message-ID: I had to undo Jakub's patch as well. We are back where we are started. The change was not correct as can be easily seen by the fact that the stat and stat64 structures if _FILE_OFFSET_BITS=64 had different padding. I also tried to compiel some code with such a patch applied to my system's include file and it failed miserably. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Fri Feb 8 00:23:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 08 Feb 2002 00:23:00 -0000 Subject: bits/stat.h In-Reply-To: ; from Ulrich Drepper on Thu, Feb 07, 2002 at 11:51:03PM -0800 References: Message-ID: <20020208092649.H558@sunsite.ms.mff.cuni.cz> On Thu, Feb 07, 2002 at 11:51:03PM -0800, Ulrich Drepper wrote: > I had to undo Jakub's patch as well. We are back where we are > started. The change was not correct as can be easily seen by the fact > that the stat and stat64 structures if _FILE_OFFSET_BITS=64 had > different padding. I also tried to compiel some code with such a > patch applied to my system's include file and it failed miserably. Can you show me what the problems were? I've just tried attached test, with both -D_FILE_OFFSET_BITS=64 and nothing, and for each of nothing and -fpack-struct the output was identical (minus __alignof__ for obvious reasons). With -DOLD the output was the same too, unless -fpack-struct was given, in which case it aborts with LFS and prints different results without. If struct stat64 uses unsigned int __pad*, then IMHO struct stat should do the same. -fpack-struct is not useful anyway, since unless the user is very careful, he'll misalign struct stat which is on several architectures SIGBUS. Jakub -------------- next part -------------- #define _GNU_SOURCE #include #include #include struct stat { __dev_t st_dev; /* Device. */ #ifdef OLD unsigned short int __pad1; #else unsigned int __pad1; #endif #ifndef __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ #else __ino_t __st_ino; /* 32bit file serial number. */ #endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ #ifdef OLD unsigned short int __pad2; #else unsigned int __pad2; #endif #ifndef __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ #else __off64_t st_size; /* Size of file, in bytes. */ #endif __blksize_t st_blksize; /* Optimal block size for I/O. */ #ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif __time_t st_atime; /* Time of last access. */ unsigned long int __unused1; __time_t st_mtime; /* Time of last modification. */ unsigned long int __unused2; __time_t st_ctime; /* Time of last status change. */ unsigned long int __unused3; #ifndef __USE_FILE_OFFSET64 unsigned long int __unused4; unsigned long int __unused5; #else __ino64_t st_ino; /* File serial number. */ #endif }; #ifdef __USE_LARGEFILE64 struct stat64 { __dev_t st_dev; /* Device. */ unsigned int __pad1; __ino_t __st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ unsigned int __pad2; __off64_t st_size; /* Size of file, in bytes. */ __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ __time_t st_atime; /* Time of last access. */ unsigned long int __unused1; __time_t st_mtime; /* Time of last modification. */ unsigned long int __unused2; __time_t st_ctime; /* Time of last status change. */ unsigned long int __unused3; __ino64_t st_ino; /* File serial number. */ }; #endif int main () { #ifdef __USE_FILE_OFFSET64 if (sizeof (struct stat) != sizeof (struct stat64)) abort (); if (__alignof__ (struct stat) != __alignof__ (struct stat64)) abort (); #endif printf ("size %d %d alignof %d %d\n", sizeof (struct stat), sizeof (struct stat64), __alignof__ (struct stat), __alignof__ (struct stat64)); #ifdef __USE_FILE_OFFSET64 #define C(x) \ if (offsetof (struct stat, x) != offsetof (struct stat64, x)) \ abort (); \ printf ("%s %d %d\n", #x, offsetof (struct stat, x), offsetof (struct stat64, x)); #else #define C(x) \ printf ("%s %d %d\n", #x, offsetof (struct stat, x), offsetof (struct stat64, x)); #endif C(st_dev) C(st_mode) C(st_nlink) C(st_uid) C(st_gid) C(st_rdev) C(st_size) C(st_blksize) C(st_blocks) C(st_atime) C(st_mtime) C(st_ctime) C(st_ino) } From drepper@redhat.com Fri Feb 8 00:34:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 08 Feb 2002 00:34:00 -0000 Subject: bits/stat.h In-Reply-To: <20020208092649.H558@sunsite.ms.mff.cuni.cz> References: <20020208092649.H558@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Can you show me what the problems were? Not easily. Try compiling mozilla with bits/stat.h patched this way. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From schwab@suse.de Fri Feb 8 01:48:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Fri, 08 Feb 2002 01:48:00 -0000 Subject: glob must not call globfree In-Reply-To: <20020207194259.E8DD31BA14@perdition.linnaean.org> (Roland McGrath's message of "Thu, 7 Feb 2002 14:42:59 -0500 (EST)") References: <20020207194259.E8DD31BA14@perdition.linnaean.org> Message-ID: Roland McGrath writes: |> I don't have the spec handy but it seems unlikely to me that a caller |> getting GLOB_NOSPACE is expected to call globfree. Are you sure? |> Here is the quote from the standard: RETURN VALUE Upon successful completion, glob() shall return 0. The argument pglob->gl_pathc shall return the number of matched pathnames and the argument pglob->gl_pathv shall contain a pointer to a null-terminated list of matched and sorted pathnames. However, if pglob->gl_pathc is 0, the content of pglob->gl_pathv is undefined. The globfree() function shall not return a value. If glob() terminates due to an error, it shall return one of the non-zero constants defined in . The arguments pglob->gl_pathc and pglob->gl_pathv are still set as defined above. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From schwab@suse.de Fri Feb 8 01:49:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Fri, 08 Feb 2002 01:49:00 -0000 Subject: glob must not call globfree In-Reply-To: (Ulrich Drepper's message of "07 Feb 2002 20:57:26 -0800") References: Message-ID: Ulrich Drepper writes: |> Andreas Schwab writes: |> |> > 2002-02-07 Andreas Schwab |> > |> > * sysdeps/generic/glob.c: Don't call globfree on the passed glob |> > structure. |> |> I very much doubt this is correct. I've never seen any requirement |> like this. If somebody intercepts the globfree calls for whatever |> reasons and finds them handling memory which wasn't returned by a call |> to glob this is the problem of that code. Fortunately for whoever |> makes this assumption one of the optimizations on the table for 2.3 |> will eliminate this. If you send me a complete patch to use |> INTDEF/INTUSE you get the effect you want. I don't understand what you are trying to say. Could you please clearify what this issue has to do with INTDEF/INTUSE? Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Fri Feb 8 09:34:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 08 Feb 2002 09:34:00 -0000 Subject: glob must not call globfree In-Reply-To: References: Message-ID: Andreas Schwab writes: > I don't understand what you are trying to say. Could you please clearify > what this issue has to do with INTDEF/INTUSE? If glob uses the globfree function via the INTUSE macro the call isn't visible from the outside. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Fri Feb 8 16:54:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 08 Feb 2002 16:54:00 -0000 Subject: [PATCH] Fix unsetenv breakage Message-ID: <20020209015647.E798@sunsite.ms.mff.cuni.cz> Hi! This is why all SUID programs currently coredump... 2002-02-09 Jakub Jelinek * sysdeps/generic/dl-environ.c (unsetenv): Clear cnt before use. --- libc/sysdeps/generic/dl-environ.c.jj Mon Feb 4 17:34:53 2002 +++ libc/sysdeps/generic/dl-environ.c Sat Feb 9 01:54:20 2002 @@ -58,7 +58,7 @@ unsetenv (const char *name) ep = __environ; while (*ep != NULL) { - size_t cnt; + size_t cnt = 0; while ((*ep)[cnt] == name[cnt] && name[cnt] != '\0') ++cnt; Jakub From rth@twiddle.net Fri Feb 8 17:15:00 2002 From: rth@twiddle.net (Richard Henderson) Date: Fri, 08 Feb 2002 17:15:00 -0000 Subject: [patch] DWARF2 unwind info check Message-ID: <20020208171520.A6669@are.twiddle.net> This test has been failing since Jakub broke the EH routines out into libgcc_eh.a. The following works against gcc 3.1 as of today; I don't know if you want to make this more complicated to cater to gcc 3.0.3... r~ * configure.in (check DWARF2 unwind info): Define dl_iterate_phdr. Add -lgcc_eh. Index: configure.in =================================================================== RCS file: /cvs/glibc/libc/configure.in,v retrieving revision 1.334 diff -c -p -d -r1.334 configure.in *** configure.in 2002/02/07 17:43:44 1.334 --- configure.in 2002/02/09 01:10:18 *************** memset () {} *** 1348,1358 **** free () {} abort () {} __bzero () {} EOF dnl No \ in command here because it ends up inside ''. if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame_info -nostdlib -nostartfiles ! -o conftest conftest.c -lgcc >&AC_FD_CC]); then libc_cv_gcc_dwarf2_unwind_info=static else libc_cv_gcc_dwarf2_unwind_info=no --- 1348,1359 ---- free () {} abort () {} __bzero () {} + dl_iterate_phdr () {} EOF dnl No \ in command here because it ends up inside ''. if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame_info -nostdlib -nostartfiles ! -o conftest conftest.c -lgcc -lgcc_eh >&AC_FD_CC]); then libc_cv_gcc_dwarf2_unwind_info=static else libc_cv_gcc_dwarf2_unwind_info=no *************** fi *** 1360,1366 **** if test $libc_cv_gcc_dwarf2_unwind_info = no; then if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame -nostdlib -nostartfiles ! -o conftest conftest.c -lgcc >&AC_FD_CC]); then libc_cv_gcc_dwarf2_unwind_info=yes else libc_cv_gcc_dwarf2_unwind_info=no --- 1361,1367 ---- if test $libc_cv_gcc_dwarf2_unwind_info = no; then if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame -nostdlib -nostartfiles ! -o conftest conftest.c -lgcc -lgcc_eh >&AC_FD_CC]); then libc_cv_gcc_dwarf2_unwind_info=yes else libc_cv_gcc_dwarf2_unwind_info=no From rth@twiddle.net Fri Feb 8 17:17:00 2002 From: rth@twiddle.net (Richard Henderson) Date: Fri, 08 Feb 2002 17:17:00 -0000 Subject: [patch] alpha multiline string warning Message-ID: <20020208171750.A6684@are.twiddle.net> * sysdeps/alpha/elf/initfini.c: Use \n\ for multiline string. linuxthreads/ * sysdeps/alpha/elf/pt-initfini.c: Use \n\ for multiline string. Index: linuxthreads/sysdeps/alpha/elf/pt-initfini.c =================================================================== RCS file: /cvs/glibc/libc/linuxthreads/sysdeps/alpha/elf/pt-initfini.c,v retrieving revision 1.1 diff -c -p -d -r1.1 pt-initfini.c *** pt-initfini.c 2002/01/07 23:00:52 1.1 --- pt-initfini.c 2002/02/09 01:10:19 *************** *** 37,96 **** files, all of which may have different GP values. So we must reload the GP value from crti.o in crtn.o. */ ! __asm__ (" ! ! #include \"defs.h\" ! ! /*@HEADER_ENDS*/ ! ! /*@_init_PROLOG_BEGINS*/ ! .section .init, \"ax\", @progbits ! .globl _init ! .ent _init ! _init: ! ldgp $29, 0($27) ! subq $30, 16, $30 ! lda $27, __pthread_initialize_minimal ! stq $26, 0($30) ! stq $29, 8($30) ! .prologue 1 ! jsr $26, ($27), __pthread_initialize_minimal ! ldq $29, 8($30) ! .align 3 ! .end _init ! .size _init, 0 ! /*@_init_PROLOG_ENDS*/ ! ! /*@_init_EPILOG_BEGINS*/ ! .section .init, \"ax\", @progbits ! ldq $26, 0($30) ! ldq $29, 8($30) ! addq $30, 16, $30 ! ret ! /*@_init_EPILOG_ENDS*/ ! ! /*@_fini_PROLOG_BEGINS*/ ! .section .fini, \"ax\", @progbits ! .globl _fini ! .ent _fini ! _fini: ! ldgp $29, 0($27) ! subq $30, 16, $30 ! stq $26, 0($30) ! stq $29, 8($30) ! .prologue 1 ! .align 3 ! .end _fini ! .size _fini, 0 ! /*@_fini_PROLOG_ENDS*/ ! ! /*@_fini_EPILOG_BEGINS*/ ! .section .fini, \"ax\", @progbits ! ldq $26, 0($30) ! ldq $29, 8($30) ! addq $30, 16, $30 ! ret ! /*@_fini_EPILOG_ENDS*/ ! ! /*@TRAILER_BEGINS*/ "); --- 37,94 ---- files, all of which may have different GP values. So we must reload the GP value from crti.o in crtn.o. */ ! __asm__ (" \n\ ! #include \"defs.h\" \n\ ! \n\ ! /*@HEADER_ENDS*/ \n\ ! \n\ ! /*@_init_PROLOG_BEGINS*/ \n\ ! .section .init, \"ax\", @progbits \n\ ! .globl _init \n\ ! .ent _init \n\ ! _init: \n\ ! ldgp $29, 0($27) \n\ ! subq $30, 16, $30 \n\ ! stq $26, 0($30) \n\ ! stq $29, 8($30) \n\ ! .prologue 1 \n\ ! jsr $26, __pthread_initialize_minimal \n\ ! ldq $29, 8($30) \n\ ! .align 3 \n\ ! .end _init \n\ ! .size _init, 0 \n\ ! /*@_init_PROLOG_ENDS*/ \n\ ! \n\ ! /*@_init_EPILOG_BEGINS*/ \n\ ! .section .init, \"ax\", @progbits \n\ ! ldq $26, 0($30) \n\ ! ldq $29, 8($30) \n\ ! addq $30, 16, $30 \n\ ! ret \n\ ! /*@_init_EPILOG_ENDS*/ \n\ ! \n\ ! /*@_fini_PROLOG_BEGINS*/ \n\ ! .section .fini, \"ax\", @progbits \n\ ! .globl _fini \n\ ! .ent _fini \n\ ! _fini: \n\ ! ldgp $29, 0($27) \n\ ! subq $30, 16, $30 \n\ ! stq $26, 0($30) \n\ ! stq $29, 8($30) \n\ ! .prologue 1 \n\ ! .align 3 \n\ ! .end _fini \n\ ! .size _fini, 0 \n\ ! /*@_fini_PROLOG_ENDS*/ \n\ ! \n\ ! /*@_fini_EPILOG_BEGINS*/ \n\ ! .section .fini, \"ax\", @progbits \n\ ! ldq $26, 0($30) \n\ ! ldq $29, 8($30) \n\ ! addq $30, 16, $30 \n\ ! ret \n\ ! /*@_fini_EPILOG_ENDS*/ \n\ ! \n\ ! /*@TRAILER_BEGINS*/ \n\ "); Index: sysdeps/alpha/elf/initfini.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/alpha/elf/initfini.c,v retrieving revision 1.1 diff -c -p -d -r1.1 initfini.c *** initfini.c 2001/09/01 19:24:46 1.1 --- initfini.c 2002/02/09 01:10:19 *************** *** 1,5 **** /* Special .init and .fini section support for Alpha. ! Copyright (C) 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 --- 1,5 ---- /* Special .init and .fini section support for Alpha. ! Copyright (C) 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 *************** *** 36,98 **** However, _init and _fini are constructed from pieces of many object files, all of which may have different GP values. So we must reload the GP value from crti.o in crtn.o. */ - - __asm__ (" - - #include \"defs.h\" - - /*@HEADER_ENDS*/ - - /*@_init_PROLOG_BEGINS*/ - .section .init, \"ax\", @progbits - .globl _init - .ent _init - _init: - ldgp $29, 0($27) - subq $30, 16, $30 - lda $27, __gmon_start__ - stq $26, 0($30) - stq $29, 8($30) - .prologue 1 - beq $27, 1f - jsr $26, ($27), __gmon_start__ - ldq $29, 8($30) - 1: - .align 3 - .end _init - .size _init, 0 - /*@_init_PROLOG_ENDS*/ - - /*@_init_EPILOG_BEGINS*/ - .section .init, \"ax\", @progbits - ldq $26, 0($30) - ldq $29, 8($30) - addq $30, 16, $30 - ret - /*@_init_EPILOG_ENDS*/ - - /*@_fini_PROLOG_BEGINS*/ - .section .fini, \"ax\", @progbits - .globl _fini - .ent _fini - _fini: - ldgp $29, 0($27) - subq $30, 16, $30 - stq $26, 0($30) - stq $29, 8($30) - .prologue 1 - .align 3 - .end _fini - .size _fini, 0 - /*@_fini_PROLOG_ENDS*/ - - /*@_fini_EPILOG_BEGINS*/ - .section .fini, \"ax\", @progbits - ldq $26, 0($30) - ldq $29, 8($30) - addq $30, 16, $30 - ret - /*@_fini_EPILOG_ENDS*/ ! /*@TRAILER_BEGINS*/ "); --- 36,97 ---- However, _init and _fini are constructed from pieces of many object files, all of which may have different GP values. So we must reload the GP value from crti.o in crtn.o. */ ! __asm__ (" \n\ ! #include \"defs.h\" \n\ ! \n\ ! /*@HEADER_ENDS*/ \n\ ! \n\ ! /*@_init_PROLOG_BEGINS*/ \n\ ! .section .init, \"ax\", @progbits \n\ ! .globl _init \n\ ! .ent _init \n\ ! _init: \n\ ! ldgp $29, 0($27) \n\ ! subq $30, 16, $30 \n\ ! lda $27, __gmon_start__ \n\ ! stq $26, 0($30) \n\ ! stq $29, 8($30) \n\ ! .prologue 1 \n\ ! beq $27, 1f \n\ ! jsr $26, ($27), __gmon_start__ \n\ ! ldq $29, 8($30) \n\ ! .align 3 \n\ ! 1: \n\ ! .end _init \n\ ! .size _init, 0 \n\ ! /*@_init_PROLOG_ENDS*/ \n\ ! \n\ ! /*@_init_EPILOG_BEGINS*/ \n\ ! .section .init, \"ax\", @progbits \n\ ! ldq $26, 0($30) \n\ ! ldq $29, 8($30) \n\ ! addq $30, 16, $30 \n\ ! ret \n\ ! /*@_init_EPILOG_ENDS*/ \n\ ! \n\ ! /*@_fini_PROLOG_BEGINS*/ \n\ ! .section .fini, \"ax\", @progbits \n\ ! .globl _fini \n\ ! .ent _fini \n\ ! _fini: \n\ ! ldgp $29, 0($27) \n\ ! subq $30, 16, $30 \n\ ! stq $26, 0($30) \n\ ! stq $29, 8($30) \n\ ! .prologue 1 \n\ ! .align 3 \n\ ! .end _fini \n\ ! .size _fini, 0 \n\ ! /*@_fini_PROLOG_ENDS*/ \n\ ! \n\ ! /*@_fini_EPILOG_BEGINS*/ \n\ ! .section .fini, \"ax\", @progbits \n\ ! ldq $26, 0($30) \n\ ! ldq $29, 8($30) \n\ ! addq $30, 16, $30 \n\ ! ret \n\ ! /*@_fini_EPILOG_ENDS*/ \n\ ! \n\ ! /*@TRAILER_BEGINS*/ \n\ "); From rth@twiddle.net Fri Feb 8 17:20:00 2002 From: rth@twiddle.net (Richard Henderson) Date: Fri, 08 Feb 2002 17:20:00 -0000 Subject: [patch] alpha GL() tweak Message-ID: <20020208171958.A6700@are.twiddle.net> I guess you cleaned up things yourself, since this was the only remaining error. r~ * sysdeps/generic/ldsodefs.h (struct rtld_global): Also include _dl_cpuclock_offset if HP_SMALL_TIMING_AVAIL. Index: sysdeps/generic/ldsodefs.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/ldsodefs.h,v retrieving revision 1.47 diff -c -p -d -r1.47 ldsodefs.h *** ldsodefs.h 2002/02/07 08:42:57 1.47 --- ldsodefs.h 2002/02/09 01:10:19 *************** struct rtld_global *** 280,286 **** /* The object to be initialized first. */ EXTERN struct link_map *_dl_initfirst; ! #if HP_TIMING_AVAIL /* Start time on CPU clock. */ EXTERN hp_timing_t _dl_cpuclock_offset; --- 280,286 ---- /* The object to be initialized first. */ EXTERN struct link_map *_dl_initfirst; ! #if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL /* Start time on CPU clock. */ EXTERN hp_timing_t _dl_cpuclock_offset; From rth@twiddle.net Fri Feb 8 17:29:00 2002 From: rth@twiddle.net (Richard Henderson) Date: Fri, 08 Feb 2002 17:29:00 -0000 Subject: __builtin_memset again Message-ID: <20020208172929.A6717@are.twiddle.net> Alpha is broken because of this too. GCC is happy to inline H.J.'s 4 byte configure case, but believes that the 600 byte example in rtld.c should be run through the external function. And since we only have a 4MB displacement on a pc-relative call, function calls outside the object file go through the GOT, which has yet to be relocated. r~ From drepper@redhat.com Fri Feb 8 17:35:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 08 Feb 2002 17:35:00 -0000 Subject: __builtin_memset again In-Reply-To: <20020208172929.A6717@are.twiddle.net> References: <20020208172929.A6717@are.twiddle.net> Message-ID: Richard Henderson writes: > Alpha is broken because of this too. GCC is happy to inline H.J.'s > 4 byte configure case, but believes that the 600 byte example in > rtld.c should be run through the external function. I changed configure. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Feb 8 17:50:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 08 Feb 2002 17:50:00 -0000 Subject: [PATCH] Fix unsetenv breakage In-Reply-To: <20020209015647.E798@sunsite.ms.mff.cuni.cz> References: <20020209015647.E798@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > 2002-02-09 Jakub Jelinek > > * sysdeps/generic/dl-environ.c (unsetenv): Clear cnt before use. Thanks, I've applied this patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Feb 8 17:55:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 08 Feb 2002 17:55:00 -0000 Subject: [patch] alpha GL() tweak In-Reply-To: <20020208171958.A6700@are.twiddle.net> References: <20020208171958.A6700@are.twiddle.net> Message-ID: Richard Henderson writes: > * sysdeps/generic/ldsodefs.h (struct rtld_global): Also include > _dl_cpuclock_offset if HP_SMALL_TIMING_AVAIL. I've applied this patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Feb 8 17:59:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 08 Feb 2002 17:59:00 -0000 Subject: [patch] alpha multiline string warning In-Reply-To: <20020208171750.A6684@are.twiddle.net> References: <20020208171750.A6684@are.twiddle.net> Message-ID: Richard Henderson writes: > * sysdeps/alpha/elf/initfini.c: Use \n\ for multiline string. > linuxthreads/ > * sysdeps/alpha/elf/pt-initfini.c: Use \n\ for multiline string. I've applied this one as well. Thanks. Please fix the next time the patch generated by cvs. I actually get to like the patchutils package and recommend installing it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From rth@twiddle.net Fri Feb 8 18:25:00 2002 From: rth@twiddle.net (Richard Henderson) Date: Fri, 08 Feb 2002 18:25:00 -0000 Subject: [patch] alpha multiline string warning In-Reply-To: ; from drepper@redhat.com on Fri, Feb 08, 2002 at 05:59:38PM -0800 References: <20020208171750.A6684@are.twiddle.net> Message-ID: <20020208182524.A6830@are.twiddle.net> On Fri, Feb 08, 2002 at 05:59:38PM -0800, Ulrich Drepper wrote: > Please fix the next time the patch generated by cvs. I actually get > to like the patchutils package and recommend installing it. I have a script to fix them, but forgot to run it. Sorry. r~ From jakub@redhat.com Sat Feb 9 02:26:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Sat, 09 Feb 2002 02:26:00 -0000 Subject: [patch] DWARF2 unwind info check In-Reply-To: <20020208171520.A6669@are.twiddle.net>; from Richard Henderson on Fri, Feb 08, 2002 at 05:15:20PM -0800 References: <20020208171520.A6669@are.twiddle.net> Message-ID: <20020209112856.F798@sunsite.ms.mff.cuni.cz> On Fri, Feb 08, 2002 at 05:15:20PM -0800, Richard Henderson wrote: > This test has been failing since Jakub broke the EH routines > out into libgcc_eh.a. The following works against gcc 3.1 > as of today; I don't know if you want to make this more > complicated to cater to gcc 3.0.3... Ouch, sorry. But IMHO we have to cater to gcc-2.95+. So, IMHO following would be better (note that I think it is not necessary to add -lgcc_eh to __register_frame check, since either they are both present in gcc 3.1+, or none. * configure.in (check DWARF2 unwind info): Define dl_iterate_phdr. Add -lgcc_eh. --- libc/configure.in.jj Sat Feb 9 11:22:37 2002 +++ libc/configure.in Sat Feb 9 11:25:51 2002 @@ -1348,12 +1348,17 @@ memset () {} free () {} abort () {} __bzero () {} +dl_iterate_phdr () {} EOF dnl No \ in command here because it ends up inside ''. if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame_info -nostdlib -nostartfiles -o conftest conftest.c -lgcc >&AC_FD_CC]); then libc_cv_gcc_dwarf2_unwind_info=static +elif AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame_info + -nostdlib -nostartfiles + -o conftest conftest.c -lgcc -lgcc_eh >&AC_FD_CC]); then + libc_cv_gcc_dwarf2_unwind_info=static else libc_cv_gcc_dwarf2_unwind_info=no fi Jakub From schwab@suse.de Sat Feb 9 09:04:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Sat, 09 Feb 2002 09:04:00 -0000 Subject: glob must not call globfree In-Reply-To: (Ulrich Drepper's message of "08 Feb 2002 09:34:41 -0800") References: Message-ID: Ulrich Drepper writes: |> Andreas Schwab writes: |> |> > I don't understand what you are trying to say. Could you please clearify |> > what this issue has to do with INTDEF/INTUSE? |> |> If glob uses the globfree function via the INTUSE macro the call isn't |> visible from the outside. You do not understand. glob must *not* call globfree. See POSIX. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From kukuk@suse.de Sat Feb 9 09:19:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Sat, 09 Feb 2002 09:19:00 -0000 Subject: glob must not call globfree In-Reply-To: ; from schwab@suse.de on Sat, Feb 09, 2002 at 06:04:23PM +0100 References: Message-ID: <20020209181955.A14320@suse.de> On Sat, Feb 09, Andreas Schwab wrote: > Ulrich Drepper writes: > > |> Andreas Schwab writes: > |> > |> > I don't understand what you are trying to say. Could you please clearify > |> > what this issue has to do with INTDEF/INTUSE? > |> > |> If glob uses the globfree function via the INTUSE macro the call isn't > |> visible from the outside. > > You do not understand. glob must *not* call globfree. See POSIX. I think at first we should clearify the problem: In error case, we return a struct, where gl_pathc is not zero and gl_pathv is undefined (because of the globfree before). According to POSIX, this is wrong, even in error case the struct must have defined values. In the moment our problem is, if a program calls correct globfree(), the program will seg.fault, because gl_pathc is not zero, but gl_pathv is undefined what is not allowed according to POSIX. If we apply Andreas Schwab patch, current, working programs will have a memory leak. I think the problem is our globfree: If called, it only checks if gl_pathv is not NULL. I think it should also check, that gl_pathc is not zero and set it to zero after freeing gl_pathv. This fixes all of our current problems with this. I suggest the following patch: 2002-02-09 Thorsten Kukuk * sysdeps/generic/glob.c (globfree): Only free memory if gl_pathc is not zero, set gl_pathc to zero afterwards. --- sysdeps/generic/glob.c +++ sysdeps/generic/glob.c 2002/02/09 15:00:04 @@ -1056,7 +1056,7 @@ globfree (pglob) register glob_t *pglob; { - if (pglob->gl_pathv != NULL) + if (pglob->gl_pathc && pglob->gl_pathv != NULL) { size_t i; for (i = 0; i < pglob->gl_pathc; ++i) @@ -1064,6 +1064,7 @@ free ((__ptr_t) pglob->gl_pathv[pglob->gl_offs + i]); free ((__ptr_t) pglob->gl_pathv); } + pglob->gl_pathc = 0; } -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE GmbH Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From drepper@redhat.com Sun Feb 10 14:40:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 10 Feb 2002 14:40:00 -0000 Subject: dynamic loading changes Message-ID: I just checked in some changes which cause dynamic loading to honor the DF_1_NOOPEN flag even in a dependency. So far the flag was only tested for the file which was loaded which obviously falls short of the intention. This change has the potential to break some application. Unlikely as it is since I've not seen many people use NOOPEN. But those programs which are broken couldn't have worked reliably anyway since the NOOPEN flag is set for a reason. I'll not add this patch to 2.2. It wasn't reported, I found it myself. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sun Feb 10 15:24:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 10 Feb 2002 15:24:00 -0000 Subject: glob must not call globfree In-Reply-To: <20020209181955.A14320@suse.de> References: <20020209181955.A14320@suse.de> Message-ID: Thorsten Kukuk writes: > I think the problem is our globfree: If called, it only checks if > gl_pathv is not NULL. I think it should also check, that gl_pathc > is not zero and set it to zero after freeing gl_pathv. This fixes > all of our current problems with this. gl_pathc != 0 for a globfree call is a requirement on the user. The implementation shouldn't check it. If anything has to be changed (I'm still not 100% sure but am willing to concede it) the glob() function must make sure that gl_pathc is set to zero if it called globfree(). I've checked in a patch for that. Give it a try with your tests and please consider adding the tests to the test suite. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kukuk@suse.de Mon Feb 11 00:02:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Mon, 11 Feb 2002 00:02:00 -0000 Subject: glob must not call globfree In-Reply-To: ; from drepper@redhat.com on Sun, Feb 10, 2002 at 03:23:53PM -0800 References: <20020209181955.A14320@suse.de> Message-ID: <20020211090247.A17803@suse.de> On Sun, Feb 10, Ulrich Drepper wrote: > Thorsten Kukuk writes: > > > I think the problem is our globfree: If called, it only checks if > > gl_pathv is not NULL. I think it should also check, that gl_pathc > > is not zero and set it to zero after freeing gl_pathv. This fixes > > all of our current problems with this. > > gl_pathc != 0 for a globfree call is a requirement on the user. The > implementation shouldn't check it. > > If anything has to be changed (I'm still not 100% sure but am willing > to concede it) the glob() function must make sure that gl_pathc is set > to zero if it called globfree(). I've checked in a patch for that. > Give it a try with your tests If globfree is not modified it cannot work: We can call globfree with a correct struct but it will seg.fault, since it inores gl_pathc. > and please consider adding the tests to the test suite. I will try to extract a small test case from it. Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE GmbH Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From schwab@suse.de Mon Feb 11 13:24:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Mon, 11 Feb 2002 13:24:00 -0000 Subject: CVS HEAD does not build Message-ID: Cannot build CVS HEAD on ia64: In file included from tst-tlsmod1.c:4: tls-macros.h:99:3: #error "No support for this architecture so far." Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N??rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From aj@suse.de Mon Feb 11 13:34:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 11 Feb 2002 13:34:00 -0000 Subject: CVS HEAD does not build In-Reply-To: (Andreas Schwab's message of "Mon, 11 Feb 2002 22:24:44 +0100") References: Message-ID: Andreas Schwab writes: > Cannot build CVS HEAD on ia64: > > In file included from tst-tlsmod1.c:4: > tls-macros.h:99:3: #error "No support for this architecture so far." Here's a patch - ok to commit? Andreas 2002-02-11 Andreas Jaeger * elf/tst-tlsmod1.c: Only use tls-macros when tls is available. * elf/tst-tls1.c: Likewise. ============================================================ Index: elf/tst-tlsmod1.c --- elf/tst-tlsmod1.c 2002/02/11 05:57:15 1.1 +++ elf/tst-tlsmod1.c 2002/02/11 21:32:34 @@ -1,6 +1,7 @@ #include #include +#ifdef USE_TLS #include "tls-macros.h" @@ -8,7 +9,7 @@ COMMON_INT_DEF(foo); VAR_INT_DEF(bar); VAR_INT_DECL(baz); - +#endif int in_dso (void) ============================================================ Index: elf/tst-tls1.c --- elf/tst-tls1.c 2002/02/10 18:57:19 1.3 +++ elf/tst-tls1.c 2002/02/11 21:33:25 @@ -2,13 +2,14 @@ #include #include +#ifdef USE_TLS #include "tls-macros.h" /* Two common 'int' variables in TLS. */ COMMON_INT_DEF(foo); COMMON_INT_DEF(bar); - +#endif int main (void) -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From schwab@suse.de Mon Feb 11 15:03:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Mon, 11 Feb 2002 15:03:00 -0000 Subject: Profiling on ia64 Message-ID: This fixes profiling on ia64 (where ENTRY_POINT is an expression, not a function symbol). Andreas. 2002-02-12 Andreas Schwab * csu/gmon-start.c (__gmon_start__): Remove '&' from ENTRY_POINT. --- csu/gmon-start.c.~1.12.~ Thu Jul 26 09:12:04 2001 +++ csu/gmon-start.c Mon Feb 11 23:56:56 2002 @@ -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 @@ -63,7 +63,7 @@ #endif /* Start keeping profiling records. */ - __monstartup ((u_long) &ENTRY_POINT, (u_long) &etext); + __monstartup ((u_long) ENTRY_POINT, (u_long) &etext); /* Call _mcleanup before exiting; it will write out gmon.out from the collected data. */ -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N??rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From jes@trained-monkey.org Mon Feb 11 18:00:00 2002 From: jes@trained-monkey.org (Jes Sorensen) Date: Mon, 11 Feb 2002 18:00:00 -0000 Subject: [patch] ia64/bits/sigcontext.h Message-ID: <15464.30529.845782.581521@trained-monkey.org> Hi Included is a patch to add definitions for the sc_flags bits in struct sigcontext on ia64. The patch was generated against libc-2.2, but should apply cleanly to 2.3 I assume (can't seem to be able to get a cvs update from sources.redhat.com right now ;-(). Jes 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. --- sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h~ Sat Sep 29 19:09:55 2001 +++ sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h Mon Feb 11 21:34:44 2002 @@ -57,4 +57,13 @@ unsigned long int sc_mask; /* signal mask to restore after handler returns */ }; +/* sc_flag bit definitions. */ +#define IA64_SC_FLAG_ONSTACK_BIT 0 /* is handler running on signal stack? */ +#define IA64_SC_FLAG_IN_SYSCALL_BIT 1 /* did signal interrupt a syscall? */ +#define IA64_SC_FLAG_FPH_VALID_BIT 2 /* is state in f[32]-f[127] valid? */ + +#define IA64_SC_FLAG_ONSTACK (1 << IA64_SC_FLAG_ONSTACK_BIT) +#define IA64_SC_FLAG_IN_SYSCALL (1 << IA64_SC_FLAG_IN_SYSCALL_BIT) +#define IA64_SC_FLAG_FPH_VALID (1 << IA64_SC_FLAG_FPH_VALID_BIT) + #endif /* _BITS_SIGCONTEXT_H */ From jes@trained-monkey.org Mon Feb 11 18:03:00 2002 From: jes@trained-monkey.org (Jes Sorensen) Date: Mon, 11 Feb 2002 18:03:00 -0000 Subject: [patch] ia64 compile fix Message-ID: <15464.30712.128629.594041@trained-monkey.org> Hi In order to compile 2.2-cvs under Linux/ia64 I need the following patch. Basically localdef.h relies on __LC_LAST being defined hence it seems reasonable for it to include "config.h" where it is defined. Or am I missing something? Jes 2002-02-11 Jes Sorensen * locale/programs/localedef.h: Include "config.h" to get definition of __LC_LAST. --- locale/programs/localedef.h~ Sun Feb 10 12:06:59 2002 +++ locale/programs/localedef.h Sun Feb 10 19:13:23 2002 @@ -26,6 +26,7 @@ #include #include +#include "config.h" #include "repertoire.h" From roland@frob.com Mon Feb 11 18:33:00 2002 From: roland@frob.com (Roland McGrath) Date: Mon, 11 Feb 2002 18:33:00 -0000 Subject: [patch] ia64 compile fix In-Reply-To: Jes Sorensen's message of Mon, 11 February 2002 21:03:36 -0500 <15464.30712.128629.594041@trained-monkey.org> Message-ID: <20020212023324.3F2241BA0B@perdition.linnaean.org> > In order to compile 2.2-cvs under Linux/ia64 I need the following > patch. Basically localdef.h relies on __LC_LAST being defined hence it > seems reasonable for it to include "config.h" where it is defined. > > Or am I missing something? There must be something wrong in your build. config.h is always implicitly included before the code via the -include .../libc-symsbols.h switch in CPPFLAGS. From drepper@redhat.com Mon Feb 11 18:42:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 11 Feb 2002 18:42:00 -0000 Subject: [patch] ia64 compile fix In-Reply-To: <20020212023324.3F2241BA0B@perdition.linnaean.org> References: <20020212023324.3F2241BA0B@perdition.linnaean.org> Message-ID: Roland McGrath writes: > There must be something wrong in your build. config.h is always implicitly > included before the code via the -include .../libc-symsbols.h switch in > CPPFLAGS. There is a separate "config.h" in the directory. Therefore the "" instead of <>. I don't say the patch is correct or needed, though. I'll look at it later. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Feb 11 23:39:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 11 Feb 2002 23:39:00 -0000 Subject: short delay Message-ID: I'm still working on some more TLS stuff. I'll get to applying patches etc once they are ready to be checked in. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From schwab@suse.de Tue Feb 12 01:55:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Tue, 12 Feb 2002 01:55:00 -0000 Subject: [patch] ia64 compile fix In-Reply-To: <15464.30712.128629.594041@trained-monkey.org> (Jes Sorensen's message of "Mon, 11 Feb 2002 21:03:36 -0500") References: <15464.30712.128629.594041@trained-monkey.org> Message-ID: Jes Sorensen writes: |> Hi |> |> In order to compile 2.2-cvs under Linux/ia64 I need the following |> patch. Basically localdef.h relies on __LC_LAST being defined hence it |> seems reasonable for it to include "config.h" where it is defined. |> |> Or am I missing something? __LC_LAST is defined in include/locale.h in the HEAD, which will work in the 2.2 branch, too. Andreas. 2001-12-09 Ulrich Drepper * locale/localeinfo.h: Don't define __LC_LAST here. Include instead. * include/locale.h: Define __LC_LAST. Index: include/locale.h =================================================================== RCS file: /cvs/glibc/libc/include/locale.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -a -u -r1.3 -r1.4 --- include/locale.h 2001/08/14 22:38:16 1.3 +++ include/locale.h 2001/12/10 01:34:55 1.4 @@ -1,6 +1,9 @@ #ifndef _LOCALE_H #include +/* This has to be changed whenever a new locale is defined. */ +#define __LC_LAST 13 + /* Locale object for C locale. */ extern struct __locale_struct _nl_C_locobj; Index: locale/localeinfo.h =================================================================== RCS file: /cvs/glibc/libc/locale/localeinfo.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -a -u -r1.39 -r1.40 --- locale/localeinfo.h 2001/08/10 02:02:39 1.39 +++ locale/localeinfo.h 2001/12/10 01:34:19 1.40 @@ -23,12 +23,10 @@ #include #include #include +#include #include #include #include - -/* This has to be changed whenever a new locale is defined. */ -#define __LC_LAST 13 #include /* For loaded_l10nfile definition. */ -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N??rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Wed Feb 13 00:11:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 13 Feb 2002 00:11:00 -0000 Subject: TLS & dynamic loading, part I Message-ID: TLS and dynamic loading now should also work. The tst-tls4 and tst-tls5 programs show what is working. Unloading is the next item on the list and then finally making all work with libpthread. This also means a lot more tests. On tests: if you port the TLS stuff to a new platform you should look at the tst-tls? tests in the order of their numbers. The coplexity increases with each test and all previous tests must work for the next to succeed. I'll keep it like this with all following tests. The code added in this set of patches is really hairy. The __tls_get_addr function obviously should be fast. This includes that no locking must be used. This in turns requires certain complications in the layout and allocation of the data structure which in good old tradition themselves must not impose any artificial limits on the program. I think I've documented the code sufficiently for those who want to understand the code. Now that Jakub has posted the binutils patch you might want to write the architecture support. If the model for the platform is that of x86 I see not many problems anymore. For IA-64-like models I'd wait. I'll have the IA-64 stuff working at some point. It's not difficult, it might require some changes in generic code, though. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Feb 13 00:48:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 13 Feb 2002 00:48:00 -0000 Subject: Profiling on ia64 In-Reply-To: References: Message-ID: Andreas Schwab writes: > This fixes profiling on ia64 (where ENTRY_POINT is an expression, not a > function symbol). I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Feb 13 00:52:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 13 Feb 2002 00:52:00 -0000 Subject: CVS HEAD does not build In-Reply-To: References: Message-ID: Andreas Schwab writes: > In file included from tst-tlsmod1.c:4: > tls-macros.h:99:3: #error "No support for this architecture so far." I just successfully compiled everything on x86 with old binutils. I cannot guarantee that it also works for other architectures but I wouldn't expect any problems. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Wed Feb 13 01:08:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Wed, 13 Feb 2002 01:08:00 -0000 Subject: build failure with current CVS Message-ID: I just got: gmon-start.c: In function `__gmon_start__': gmon-start.c:66: void value not ignored as it ought to be What has changed here? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Wed Feb 13 01:17:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 13 Feb 2002 01:17:00 -0000 Subject: build failure with current CVS In-Reply-To: References: Message-ID: Andreas Jaeger writes: > What has changed here? Andreas' patch did this. I haven't tested it before since it looked harmless. I have added a patch now which hopefully works in all cases. It's not pretty but the whole gmon code isn't. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Wed Feb 13 01:20:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Wed, 13 Feb 2002 01:20:00 -0000 Subject: build failure with current CVS In-Reply-To: (Ulrich Drepper's message of "13 Feb 2002 01:17:40 -0800") References: Message-ID: Ulrich Drepper writes: > Andreas Jaeger writes: > >> What has changed here? > > Andreas' patch did this. I haven't tested it before since it looked > harmless. I have added a patch now which hopefully works in all > cases. It's not pretty but the whole gmon code isn't. Thanks, that works for me on i686 now, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Wed Feb 13 01:50:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 13 Feb 2002 01:50:00 -0000 Subject: TLS limitations Message-ID: I forgot to point out the "limitations" of the implementation. The dtv includes a generation counter. This value must be compared with < not only !=. The type for this element is size_t. This means that the counter can "only" be increment 2^32 times before it leads to problems. And there will be problems if this should happen. The counter is incremented whenever an object (or any of its dependencies) uses TLS and is loaded or unloaded. I do think it is reasonable to assume that 2^32 load and unload operations are enough even if the process runs for years. Note, objects without TLS requirement have no influence. On 64-bit systems the situation is even less restrictive since we get problems only after 2^64 operations (or to be exact 15 minutes after the universe ends). The current implementation is already a compromise. Initially I though that I could encode the current length of the thread's dtv in the generation counter but this would really restrict the range of the counter. So the length got its own place. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From roland@frob.com Wed Feb 13 01:57:00 2002 From: roland@frob.com (Roland McGrath) Date: Wed, 13 Feb 2002 01:57:00 -0000 Subject: TLS limitations In-Reply-To: Ulrich Drepper's message of , 13 February 2002 01:50:34 -0800 Message-ID: <20020213095753.3614E1BA14@perdition.linnaean.org> > that the counter can "only" be increment 2^32 times before it leads to > problems. And there will be problems if this should happen. Well, put in an assert that crashes when it wraps to zero. If that ever happens, we can implement some ugly thing that stops the world and runs through all the threads eagerly updating them at the wraparound, or something like that. But having it definitely crash should it ever happen is the best way to convince anyone that it really never happens in reality. From aj@suse.de Wed Feb 13 04:11:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Wed, 13 Feb 2002 04:11:00 -0000 Subject: dl-close broken... Message-ID: I get on i686: dl-close.c: In function `free_slotinfo': dl-close.c:341: dereferencing pointer to incomplete type dl-close.c:341: dereferencing pointer to incomplete type dl-close.c:346: dereferencing pointer to incomplete type dl-close.c:348: dereferencing pointer to incomplete type dl-close.c:349: dereferencing pointer to incomplete type Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Wed Feb 13 04:26:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 13 Feb 2002 04:26:00 -0000 Subject: [PATCH] Re: dl-close broken... In-Reply-To: ; from Andreas Jaeger on Wed, Feb 13, 2002 at 01:11:43PM +0100 References: Message-ID: <20020213133036.V798@sunsite.ms.mff.cuni.cz> On Wed, Feb 13, 2002 at 01:11:43PM +0100, Andreas Jaeger wrote: > > I get on i686: > dl-close.c: In function `free_slotinfo': > dl-close.c:341: dereferencing pointer to incomplete type > dl-close.c:341: dereferencing pointer to incomplete type > dl-close.c:346: dereferencing pointer to incomplete type > dl-close.c:348: dereferencing pointer to incomplete type > dl-close.c:349: dereferencing pointer to incomplete type That's not too hard to fix: 2002-02-13 Jakub Jelinek * elf/dl-close.c (free_slotinfo): Only define if TLS supported. --- libc/elf/dl-close.c.jj Wed Feb 13 13:29:10 2002 +++ libc/elf/dl-close.c Wed Feb 13 13:29:58 2002 @@ -332,7 +332,7 @@ _dl_close (void *_map) __libc_lock_unlock_recursive (GL(dl_load_lock)); } - +#ifdef USE_TLS static bool free_slotinfo (struct dtv_slotinfo_list *elemp) { @@ -355,7 +355,7 @@ free_slotinfo (struct dtv_slotinfo_list return true; } - +#endif static void free_mem (void) Jakub From aj@suse.de Wed Feb 13 04:35:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Wed, 13 Feb 2002 04:35:00 -0000 Subject: [PATCH] Re: dl-close broken... In-Reply-To: <20020213133036.V798@sunsite.ms.mff.cuni.cz> (Jakub Jelinek's message of "Wed, 13 Feb 2002 13:30:36 +0100") References: <20020213133036.V798@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > On Wed, Feb 13, 2002 at 01:11:43PM +0100, Andreas Jaeger wrote: >> >> I get on i686: >> dl-close.c: In function `free_slotinfo': >> dl-close.c:341: dereferencing pointer to incomplete type >> dl-close.c:341: dereferencing pointer to incomplete type >> dl-close.c:346: dereferencing pointer to incomplete type >> dl-close.c:348: dereferencing pointer to incomplete type >> dl-close.c:349: dereferencing pointer to incomplete type > > That's not too hard to fix: Thanks - I just didn't had time to look myself ;-( Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Wed Feb 13 14:44:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 13 Feb 2002 14:44:00 -0000 Subject: TLS limitations In-Reply-To: ; from Ulrich Drepper on Wed, Feb 13, 2002 at 01:50:34AM -0800 References: Message-ID: <20020213234843.A798@sunsite.ms.mff.cuni.cz> On Wed, Feb 13, 2002 at 01:50:34AM -0800, Ulrich Drepper wrote: > I forgot to point out the "limitations" of the implementation. > > The dtv includes a generation counter. This value must be compared > with < not only !=. The type for this element is size_t. This means > that the counter can "only" be increment 2^32 times before it leads to > problems. And there will be problems if this should happen. > > The counter is incremented whenever an object (or any of its > dependencies) uses TLS and is loaded or unloaded. I do think it is > reasonable to assume that 2^32 load and unload operations are enough > even if the process runs for years. Note, objects without TLS > requirement have no influence. Well, a dlopen/dlclose in a cycle could trigger it in a day or so on current systems, but that's certainly not a reasonable program. Jakub From drepper@redhat.com Wed Feb 13 15:13:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 13 Feb 2002 15:13:00 -0000 Subject: TLS limitations In-Reply-To: <20020213234843.A798@sunsite.ms.mff.cuni.cz> References: <20020213234843.A798@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Well, a dlopen/dlclose in a cycle could trigger it in a day or so > on current systems, but that's certainly not a reasonable program. Everything breaks if you are out to do it. This is in any case one of the issues where I intend to wait and see. Adding the overflow detection Roland suggested certainly is OK and when somebody really complains and a simple "get a real (= 64-bit) machine" doesn't help we'll see what is reasonable to do. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Feb 14 00:27:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 14 Feb 2002 00:27:00 -0000 Subject: [patch] ia64/bits/sigcontext.h In-Reply-To: <15464.30529.845782.581521@trained-monkey.org> References: <15464.30529.845782.581521@trained-monkey.org> Message-ID: Jes Sorensen writes: > 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. I've added the patch now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kukuk@suse.de Sat Feb 16 12:01:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Sat, 16 Feb 2002 12:01:00 -0000 Subject: thread/exit problems with glibc 2.2.5 Message-ID: <20020216210128.A14445@suse.de> Hi, I have appended a short test program, which fails with glibc 2.2.5, but works fine with all prior versions. The program defines one thread as signal handler. With glibc 2.2.4 and prior, I could send this thread a TERM signal and the whole process exits: Hilbert:/suse/kukuk # ./thread_test Pid of sig_handler=2625 Signal (15) for quitting program arrived. But with glibc 2.2.5, the signal handler thread exits without printing the message. Another thread is in zombie state and the main thread still continues to run: kukuk@allen:~> ./thread_test Pid of sig_handler=4769 kukuk@allen:~> ps ax|grep thread_test 4766 pts/1 S 0:00 ./thread_test 4768 pts/1 S 0:00 ./thread_test 4769 pts/1 S 0:00 ./thread_test kukuk@allen:~> kill -TERM 4769 kukuk@allen:~> ps ax|grep thread_test 4766 pts/1 S 0:00 ./thread_test 4768 pts/1 Z 0:00 [thread_test ] 6125 pts/2 S 0:00 grep thread_test Any ideas what goes wrong now? Why does I not get the printf, and why does the exit(0) does not exit the program? Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B -------------- next part -------------- #define _GNU_SOURCE /* for GLIBC */ #define _POSIX_PTHREAD_SEMANTICS /* for Solaris threads */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static int pid_is_written = 0; static pthread_mutex_t mutex_pid = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cond_pid = PTHREAD_COND_INITIALIZER; /* Thread for handling signals */ static void * sig_handler (void *v_param) { struct flock lock; sigset_t sigs_to_catch; int caught; printf ("Pid of sig_handler=%d\n", getpid ()); /* Signal the main thread that we have the pid printed */ pthread_mutex_lock(&mutex_pid); pid_is_written = 1; pthread_cond_broadcast(&cond_pid); pthread_mutex_unlock(&mutex_pid); sigemptyset (&sigs_to_catch); sigaddset (&sigs_to_catch, SIGCHLD); sigaddset (&sigs_to_catch, SIGTERM); sigaddset (&sigs_to_catch, SIGINT); sigaddset (&sigs_to_catch, SIGQUIT); sigaddset (&sigs_to_catch, SIGSEGV); sigaddset (&sigs_to_catch, SIGHUP); while (1) { sigwait (&sigs_to_catch, &caught); switch (caught) { case SIGCHLD: printf ("SIGCHLD arrived, what should I do ?\n"); break; case SIGTERM: case SIGINT: case SIGQUIT: case SIGSEGV: /* Clean up if we quit the program. */ printf ("Signal (%d) for quitting program arrived.\n", caught); exit (0); break; case SIGHUP: /* Reload config file */ printf ("SIGHUP arrived, reloading config file.\n"); break; default: printf ("Unknown signal: %d\n", caught); break; } } } int main (int argc, char **argv) { sigset_t sigs_to_block; pthread_t sig_thread; sigemptyset (&sigs_to_block); sigaddset (&sigs_to_block, SIGCHLD); sigaddset (&sigs_to_block, SIGTERM); sigaddset (&sigs_to_block, SIGINT); sigaddset (&sigs_to_block, SIGQUIT); sigaddset (&sigs_to_block, SIGSEGV); sigaddset (&sigs_to_block, SIGHUP); if (pthread_sigmask (SIG_BLOCK, &sigs_to_block, NULL) != 0) { printf ("Could not block signals.\n"); exit (1); } pthread_create (&sig_thread, NULL, &sig_handler, NULL); /* wait until signal thread has created the pid file */ pthread_mutex_lock(&mutex_pid); while (pid_is_written < 1) { pthread_cond_wait(&cond_pid, &mutex_pid); } pthread_mutex_unlock(&mutex_pid); while (1) sleep (5); return 1; } From schwab@suse.de Sat Feb 16 15:56:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Sat, 16 Feb 2002 15:56:00 -0000 Subject: thread/exit problems with glibc 2.2.5 In-Reply-To: <20020216210128.A14445@suse.de> (Thorsten Kukuk's message of "Sat, 16 Feb 2002 21:01:28 +0100") References: <20020216210128.A14445@suse.de> Message-ID: Thorsten Kukuk writes: |> Hi, |> |> I have appended a short test program, which fails with glibc 2.2.5, |> but works fine with all prior versions. Please try this patch: 2002-02-17 Andreas Schwab * signals.c (sigwait): Check for old sighandler being SIG_ERR, not NULL. --- linuxthreads/signals.c.~1.23.~ Mon Jan 14 16:16:45 2002 +++ linuxthreads/signals.c Sun Feb 17 00:51:41 2002 @@ -198,7 +198,7 @@ s != __pthread_sig_cancel && s != __pthread_sig_debug) { sigdelset(&mask, s); - if (sighandler[s].old == NULL || + if (sighandler[s].old == (arch_sighandler_t) SIG_ERR || sighandler[s].old == (arch_sighandler_t) SIG_DFL || sighandler[s].old == (arch_sighandler_t) SIG_IGN) { sa.sa_handler = pthread_null_sighandler; Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From schwab@suse.de Sat Feb 16 16:05:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Sat, 16 Feb 2002 16:05:00 -0000 Subject: Bug in dependency checking Message-ID: When a dlopened module references a weak symbol from another dlopened module (loaded with RTLD_GLOBAL) no dependency was generated for this fact, so the second module was unloaded even if the first one was still around. I have included patches for both mainline and 2.2 branch. Andreas. 2002-02-17 Andreas Schwab * elf/dl-lookup.c (_dl_lookup_symbol): Check whether to call add_dependency even if only weak symbols symbols were found. (_dl_lookup_versioned_symbol): Likewise. * reldep7.c, reldep7mod1.c, reldep7mod2.c: New files. * Makefile: Add rules to build and run reldep7. Index: elf/Makefile =================================================================== RCS file: /cvs/glibc/libc/elf/Makefile,v retrieving revision 1.208.2.3 diff -u -a -r1.208.2.3 elf/Makefile --- elf/Makefile 2002/01/08 21:38:17 1.208.2.3 +++ elf/Makefile 2002/02/16 23:18:13 @@ -64,7 +64,7 @@ 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 @@ -116,7 +116,7 @@ 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 + restest2 next dblload dblunload reldep5 reldep6 reldep7 test-srcs = tst-pathopt tests-vis-yes = vismain tests-nodelete-yes = nodelete @@ -133,7 +133,8 @@ 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 modules-vis-yes = vismod1 vismod2 vismod3 modules-nodelete-yes = nodelmod1 nodelmod2 nodelmod3 nodelmod4 modules-nodlopen-yes = nodlopenmod @@ -446,3 +447,6 @@ $(objpfx)reldep6: $(libdl) $(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so + +$(objpfx)reldep7: $(libdl) +$(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so Index: elf/dl-lookup.c =================================================================== RCS file: /cvs/glibc/libc/elf/dl-lookup.c,v retrieving revision 1.87 diff -u -a -r1.87 elf/dl-lookup.c --- elf/dl-lookup.c 2001/09/08 17:11:36 1.87 +++ elf/dl-lookup.c 2002/02/16 23:18:13 @@ -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 @@ -215,25 +215,8 @@ 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; - break; - } - if (__builtin_expect (current_value.s == NULL, 0)) { const char *reference_name = undef_map ? undef_map->l_name : NULL; @@ -250,6 +233,21 @@ return 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_symbol (undef_name, undef_map, ref, symbol_scope, + type_class, 0); + protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) @@ -396,25 +394,7 @@ 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) { @@ -457,6 +437,22 @@ *ref = NULL; return 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); protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; Index: elf/reldep7.c =================================================================== RCS file: elf/reldep7.c diff -N elf/reldep7.c --- /dev/null Tue May 5 13:32:27 1998 +++ elf/reldep7.c Sat Feb 16 15:18:13 2002 @@ -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; +} Index: elf/reldep7mod1.c =================================================================== RCS file: elf/reldep7mod1.c diff -N elf/reldep7mod1.c --- /dev/null Tue May 5 13:32:27 1998 +++ elf/reldep7mod1.c Sat Feb 16 15:18:13 2002 @@ -0,0 +1,12 @@ +int foo (void) __attribute__ ((weak)); +int +foo (void) +{ + return 1; +} + +int +mod1_bar (void) +{ + return foo (); +} Index: elf/reldep7mod2.c =================================================================== RCS file: elf/reldep7mod2.c diff -N elf/reldep7mod2.c --- /dev/null Tue May 5 13:32:27 1998 +++ elf/reldep7mod2.c Sat Feb 16 15:18:13 2002 @@ -0,0 +1,12 @@ +int foo (void) __attribute__ ((weak)); +int +foo (void) +{ + return 2; +} + +int +mod2_bar (void) +{ + return foo (); +} ------------------------------------------------------------------------------- Index: elf/Makefile =================================================================== RCS file: /cvs/glibc/libc/elf/Makefile,v retrieving revision 1.223 diff -u -a -r1.223 elf/Makefile --- elf/Makefile 2002/02/14 10:33:21 1.223 +++ elf/Makefile 2002/02/16 23:20:42 @@ -65,7 +65,7 @@ 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 dl-procinfo.c tls.h dl-tls.h \ tls-macros.h @@ -118,8 +118,9 @@ 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 tst-tls1 tst-tls2 \ - tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 + restest2 next dblload dblunload reldep5 reldep6 reldep7 \ + tst-tls1 tst-tls2 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 \ + tst-tls8 test-srcs = tst-pathopt tests-vis-yes = vismain tests-nodelete-yes = nodelete @@ -137,6 +138,7 @@ unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \ dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \ reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \ + reldep7mod1 reldep7mod2 \ tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 modules-vis-yes = vismod1 vismod2 vismod3 modules-nodelete-yes = nodelmod1 nodelmod2 nodelmod3 nodelmod4 @@ -441,6 +443,9 @@ $(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 Index: elf/dl-lookup.c =================================================================== RCS file: /cvs/glibc/libc/elf/dl-lookup.c,v retrieving revision 1.97 diff -u -a -r1.97 elf/dl-lookup.c --- elf/dl-lookup.c 2002/02/11 01:27:01 1.97 +++ elf/dl-lookup.c 2002/02/16 23:20:42 @@ -228,25 +228,8 @@ 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 INTUSE(_dl_lookup_symbol) (undef_name, undef_map, ref, - symbol_scope, type_class, 0); + break; - break; - } - if (__builtin_expect (current_value.s == NULL, 0)) { const char *reference_name = undef_map ? undef_map->l_name : NULL; @@ -263,6 +246,21 @@ return 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 INTUSE(_dl_lookup_symbol) (undef_name, undef_map, ref, + symbol_scope, type_class, 0); + protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; if (__builtin_expect (protected != 0, 0)) { @@ -390,25 +388,7 @@ 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 INTUSE(_dl_lookup_versioned_symbol) (undef_name, undef_map, - ref, symbol_scope, - version, type_class, 0); - - break; - } + break; if (__builtin_expect (res, 0) < 0) { @@ -451,6 +431,22 @@ *ref = NULL; return 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 INTUSE(_dl_lookup_versioned_symbol) (undef_name, undef_map, + ref, symbol_scope, + version, type_class, 0); protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; Index: elf/reldep7.c =================================================================== RCS file: elf/reldep7.c diff -N elf/reldep7.c --- /dev/null Tue May 5 13:32:27 1998 +++ elf/reldep7.c Sat Feb 16 15:20:42 2002 @@ -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; +} Index: elf/reldep7mod1.c =================================================================== RCS file: elf/reldep7mod1.c diff -N elf/reldep7mod1.c --- /dev/null Tue May 5 13:32:27 1998 +++ elf/reldep7mod1.c Sat Feb 16 15:20:42 2002 @@ -0,0 +1,12 @@ +int foo (void) __attribute__ ((weak)); +int +foo (void) +{ + return 1; +} + +int +mod1_bar (void) +{ + return foo (); +} Index: elf/reldep7mod2.c =================================================================== RCS file: elf/reldep7mod2.c diff -N elf/reldep7mod2.c --- /dev/null Tue May 5 13:32:27 1998 +++ elf/reldep7mod2.c Sat Feb 16 15:20:42 2002 @@ -0,0 +1,12 @@ +int foo (void) __attribute__ ((weak)); +int +foo (void) +{ + return 2; +} + +int +mod2_bar (void) +{ + return foo (); +} -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From kukuk@suse.de Sun Feb 17 01:31:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Sun, 17 Feb 2002 01:31:00 -0000 Subject: thread/exit problems with glibc 2.2.5 In-Reply-To: References: <20020216210128.A14445@suse.de> Message-ID: <20020217103124.A18100@suse.de> On Sun, Feb 17, Andreas Schwab wrote: > Thorsten Kukuk writes: > > |> Hi, > |> > |> I have appended a short test program, which fails with glibc 2.2.5, > |> but works fine with all prior versions. > > Please try this patch: Yes, this fixed the problem. Thanks, Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE GmbH Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From jakub@redhat.com Mon Feb 18 03:16:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 18 Feb 2002 03:16:00 -0000 Subject: LD_LIBRARY_PATH foo: Message-ID: <20020218120622.E533@sunsite.ms.mff.cuni.cz> Hi! What's the reason why glibc ld.so handles empty paths in LD_LIBRARY_PATH and RPATH/RUNPATH as current directory instead of skipping? I've just checked what Solaris ld.so does and it looks like it is skipping empty paths both in LD_LIBRARY_PATH and RPATH/RUNPATH, and Sun shell scripts apparently cannot be bothered to check for null LD_LIBRARY_PATH before prepending something to it. Jakub From drepper@redhat.com Mon Feb 18 07:57:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 18 Feb 2002 07:57:00 -0000 Subject: LD_LIBRARY_PATH foo: In-Reply-To: <20020218120622.E533@sunsite.ms.mff.cuni.cz> References: <20020218120622.E533@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > What's the reason why glibc ld.so handles empty paths in LD_LIBRARY_PATH > and RPATH/RUNPATH as current directory instead of skipping? > I've just checked what Solaris ld.so does and it looks like it is skipping > empty paths both in LD_LIBRARY_PATH and RPATH/RUNPATH, and Sun shell scripts > apparently cannot be bothered to check for null LD_LIBRARY_PATH before > prepending something to it. I haven't checked Solaris but it seems unlikely that they do this since it violates the gabi. The section named Shared Object Dependencies contains: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * The dynamic array tag DT_RUNPATH gives a string that holds a list of directories, separated by colons (:). For example, the string /home/dir/lib:/home/dir2/lib: tells the dynamic linker to search first the directory /home/dir/lib, then /home/dir2/lib, and then the current directory to find dependencies. [...] * A variable called LD_LIBRARY_PATH in the process environment [see exec(BA_OS)] may hold a list of directories as above, optionally followed by a semicolon (;) and another directory list. The following values would be equivalent to the previous example: * LD_LIBRARY_PATH=/home/dir/usr/lib:/home/dir2/usr/lib: * LD_LIBRARY_PATH=/home/dir/usr/lib;/home/dir2/usr/lib: * LD_LIBRARY_PATH=/home/dir/usr/lib:/home/dir2/usr/lib:; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Mon Feb 18 16:43:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 18 Feb 2002 16:43:00 -0000 Subject: [PATCH] Fix mmap stdio bug Message-ID: <20020219013402.L533@sunsite.ms.mff.cuni.cz> Hi! I think the patch is self-explaining and I'm not sure how useful is to include a testcase for this into the testsuite (on ia64 ld could not link crti.o because it was trying to fseek to a location in the file which contained '\xff'). 2002-02-19 Jakub Jelinek * libio/fileops.c (_IO_file_underflow_mmap): Cast to unsigned char pointer before dereferencing. --- libc/libio/fileops.c.jj Wed Jan 30 18:01:24 2002 +++ libc/libio/fileops.c Tue Feb 19 01:42:56 2002 @@ -579,7 +579,7 @@ _IO_file_underflow_mmap (_IO_FILE *fp) fp->_offset = fp->_IO_buf_end - fp->_IO_buf_base; fp->_IO_read_end = fp->_IO_buf_end; - return *fp->_IO_read_ptr; + return *(unsigned char *) fp->_IO_read_ptr; } fp->_flags |= _IO_EOF_SEEN; Jakub From drepper@redhat.com Mon Feb 18 23:16:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 18 Feb 2002 23:16:00 -0000 Subject: thread/exit problems with glibc 2.2.5 In-Reply-To: References: <20020216210128.A14445@suse.de> Message-ID: Andreas Schwab writes: > 2002-02-17 Andreas Schwab > > * signals.c (sigwait): Check for old sighandler being SIG_ERR, > not NULL. I've applied this patch now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Feb 18 23:18:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 18 Feb 2002 23:18:00 -0000 Subject: [PATCH] Fix mmap stdio bug In-Reply-To: <20020219013402.L533@sunsite.ms.mff.cuni.cz> References: <20020219013402.L533@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > I think the patch is self-explaining and I'm not sure how useful is to > include a testcase for this into the testsuite (on ia64 ld could not link > crti.o because it was trying to fseek to a location in the file which > contained '\xff'). I think test cases are always useful. > 2002-02-19 Jakub Jelinek > > * libio/fileops.c (_IO_file_underflow_mmap): Cast to unsigned char > pointer before dereferencing. The patch is in now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Thu Feb 21 05:39:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 21 Feb 2002 05:39:00 -0000 Subject: [PATCH] Fix mmap stdio fseek SEEK_END bug Message-ID: <20020221143044.W533@sunsite.ms.mff.cuni.cz> Hi! Immediately after fopen, _IO_read_end == _IO_read_base == _IO_buf_base. So, fseek* (..., SEEK_END) was acting like SEEK_SET, not SEEK_END. 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. --- libc/libio/fileops.c.jj Thu Feb 21 12:42:10 2002 +++ libc/libio/fileops.c Thu Feb 21 14:41:22 2002 @@ -880,7 +880,7 @@ _IO_file_seekoff_mmap (fp, offset, dir, case _IO_seek_set: break; case _IO_seek_end: - offset = fp->_IO_read_end - fp->_IO_read_base + offset; + offset += fp->_IO_buf_end - fp->_IO_buf_base; break; } /* At this point, dir==_IO_seek_set. */ --- libc/stdio-common/tst-fseek.c.jj Thu Aug 23 18:49:10 2001 +++ libc/stdio-common/tst-fseek.c Thu Feb 21 13:42:48 2002 @@ -419,6 +419,35 @@ main (void) result = 1; } + fclose (fp); + +#ifdef USE_IN_LIBIO + fp = fopen (fname, "r"); + if (fp == NULL) + { + puts ("fopen() failed\n"); + result = 1; + } + else if (fstat64 (fileno (fp), &st1) < 0) + { + puts ("fstat64() before fseeko() failed\n"); + result = 1; + } + else if (fseeko (fp, 0, SEEK_END) != 0) + { + puts ("fseeko(fp, 0, SEEK_END) failed"); + result = 1; + } + else if (ftello (fp) != st1.st_size) + { + printf ("fstat64 st_size %zd ftello %zd\n", st1.st_size, + ftello (fp)); + result = 1; + } + if (fp != NULL) + fclose (fp); +#endif + out: unlink (fname); Jakub From drepper@redhat.com Thu Feb 21 21:11:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 21 Feb 2002 21:11:00 -0000 Subject: [PATCH] Fix mmap stdio fseek SEEK_END bug In-Reply-To: <20020221143044.W533@sunsite.ms.mff.cuni.cz> References: <20020221143044.W533@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Immediately after fopen, _IO_read_end == _IO_read_base == _IO_buf_base. > So, fseek* (..., SEEK_END) was acting like SEEK_SET, not SEEK_END. I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Feb 21 22:04:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 21 Feb 2002 22:04:00 -0000 Subject: unwind info for .init/.fini sections Message-ID: [I post this for David --drepper] David Mosberger Today I noticed that the .init and .fini sections are lacking the info needed for reliably unwinding on ia64. This turns out to be a somewhat nasty problem to solve, because the section is generated at linktime. It's easy to fix up the unwind info for the init/fini prologues, but it's less clear what to do about the body of these sections. I can think of two approaches: (1) Change the linker so it updates the unwind info once the final .init/.fini section has been created. This shouldn't be all that hard: it requires updating the unwind table entry and adjusting the unwind descriptors so that the final body region is long enough to cover the entire section. (2) Require that each code fragment that goes into the .init/.fini section is wrapped like this: .proc whatever .prologue .vframe r32 .save rp, r33 .save ar.pfs, r34 .body : ACTUAL INIT CODE : .endp (2) might be somewhat easier to do, but is less efficient (the same unwind info gets duplicated over and over again for no good reason) and finding all code sequences that go into .init/.fini would be hard (e.g., it would require gcc, for sure). (1) doesn't strike me as a great solution as it would require building more special-section knowledge into the linker, but the solution would probably be more reliable and more localized than (2). Anybody else have a better idea or other comments? --david From drepper@redhat.com Sat Feb 23 00:14:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 23 Feb 2002 00:14:00 -0000 Subject: TLS support Message-ID: I finally managed to get the last changes completed and tested. Well, at least the current tests succeed, I'll have to write new once. With this TLS on i386 is basically done. Jakub published the binutils changes and therefore there is no reason to not support any of the other platforms which already have thread registers. I have some preliminary but completely untested IA64 changes which I can send to somebody who wants to beat me working on this. Otherwise I'll look at it as soon as I have time. One more warning. The TLS support as implemented now cannot possibly work reliably on a current Linux kernel. The problem is that the LDT data structure must be allocated in physically contiguous memory and since for every process an LDT is allocated the memory is severely, maybe fatally, fragmented sooner or later. To solve this the kernel could avoid allocation the LDT for a process with only entry 0 of the LDT used. This was suggested to the kernel people but they didn't like it. Instead a mechanism which allows using a GDT segment for the initial thread will be implemented. This will require ld.so changes. I wait doing them until the kernel changes are done. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Feb 23 00:57:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 23 Feb 2002 00:57:00 -0000 Subject: __libc_subinit Message-ID: I've just removed the handling of __libc_subinit completely from the Linux setup. It really was only an expensive way to call a single function. This is now done directly instead. For Hurd the situation is slightly different. From what I've seen there are at least two more uses. They should be changed as well. One, the stdio initialization, will eventually go away. This leave the use in times.c. I didn't want to touch this code so I moved the libc_subinit handling in Hurd specific directories. Hopefully everything builds and runs just fine. Now it's up to you to get rid of it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From roland@frob.com Sat Feb 23 17:51:00 2002 From: roland@frob.com (Roland McGrath) Date: Sat, 23 Feb 2002 17:51:00 -0000 Subject: __libc_subinit In-Reply-To: Ulrich Drepper's message of , 23 February 2002 00:57:05 -0800 Message-ID: <20020224015140.06DCD1BA14@perdition.linnaean.org> > I've just removed the handling of __libc_subinit completely from the > Linux setup. It really was only an expensive way to call a single > function. This is now done directly instead. It's not that expensive. And it was a way to call either zero or one functions for static linking (i.e. if you didn't use __progname, zero). But I am not going to argue. How about you just rename __init_misc to __libc_init instead of diddling every init-first.c file (and you missed some)? > One, the stdio initialization, will eventually go away. Indeed it will. > This leave the use in times.c. I don't mind changing that one. From drepper@redhat.com Sat Feb 23 17:57:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 23 Feb 2002 17:57:00 -0000 Subject: __libc_subinit In-Reply-To: <20020224015140.06DCD1BA14@perdition.linnaean.org> References: <20020224015140.06DCD1BA14@perdition.linnaean.org> Message-ID: Roland McGrath writes: > How about you just rename __init_misc to __libc_init instead of diddling > every init-first.c file (and you missed some)? I'd find this rather irritating and it should be a mood point now anyway since most changes are already done. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Feb 25 18:05:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 25 Feb 2002 18:05:00 -0000 Subject: more optimizations Message-ID: I just checked in a rather large patch which removes a lot of relocations. This is before the patch: libc.so: 1609 relocations, 1317 relative, 502 PLT entries This is afterwards: libc.so: 1609 relocations, 1484 relative, 413 PLT entries Executing a null program with ld.so statistics enabled shows the following. Before: 18957: runtime linker statistics: 18957: total startup time in dynamic loader: 1215464 clock cycles 18957: time needed for relocation: 546656 clock cycles (44.9%) 18957: number of relocations: 200 18957: number of relocations from cache: 114 18957: time needed to load objects: 379052 clock cycles (31.1%) 18957: 18957: runtime linker statistics: 18957: final number of relocations: 206 18957: final number of relocations from cache: 114 Now: 18989: runtime linker statistics: 18989: total startup time in dynamic loader: 1178256 clock cycles 18989: time needed for relocation: 467668 clock cycles (39.6%) 18989: number of relocations: 140 18989: number of relocations from cache: 7 18989: time needed to load objects: 379492 clock cycles (32.2%) 18989: 18989: runtime linker statistics: 18989: final number of relocations: 146 18989: final number of relocations from cache: 7 This means: - 89 functions defined in libc were also called by names which are exported resulting in PLT entries. Avoiding this not only gets rid of the JUMP_SLOT relocations (transformating them to relative relocations), it also allows to generate better code. - 177 non-JUMP_SLOT relocations were converted to relative relocation (partly overlapping with the PLT optimization) The performance improvements in ld.so are measurable. Timing the null program shows before (these are the cycles reported by ld.so): minimum: total=1369336, relocs=536704, load=325680 average: total=1402050, relocs=544385, load=335134 Now; minimum: total=1259892, relocs=440732, load=314832 average: total=1292682, relocs=451006, load=326384 I.e., ld.so spends about 100000 cycles less on relocations. This is directly visible in startup time improvements. Before: minimum: 0.001447713 sec average: 0.001488027 sec Now: minimum: 0.001389521 sec average: 0.001425523 sec If you do the math you'll see that my machine runs at 1.7GHz. The time improvements are not that impressive but it's a fast machine and there is more to come and the percentage gains are impressive (about 8% overall, 12% if you exclude the time the kernel is loading some files). And we are not through yet. So so I've concentrated on libio and RPC, both fairly closed sets of code and the files are not used individually. There are still 413 PLTs in use. Only a few (e.g., for the thread functions) are really needed. I few others, like malloc, will be kept for interposition. All the rest can go. This means speedup and size reduction (which by the way was about 2k so far). -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From rth@twiddle.net Mon Feb 25 18:59:00 2002 From: rth@twiddle.net (Richard Henderson) Date: Mon, 25 Feb 2002 18:59:00 -0000 Subject: more optimizations In-Reply-To: ; from drepper@redhat.com on Mon, Feb 25, 2002 at 06:05:45PM -0800 References: Message-ID: <20020225185926.A25979@twiddle.net> On Mon, Feb 25, 2002 at 06:05:45PM -0800, Ulrich Drepper wrote: > I just checked in a rather large patch which removes a lot of > relocations. Incidentally, why does INTDEF not make use of STV_PROTECTED instead? Then we wouldn't need to clutter up the source with INTUSE. r~ From drepper@redhat.com Mon Feb 25 19:39:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 25 Feb 2002 19:39:00 -0000 Subject: more optimizations In-Reply-To: <20020225185926.A25979@twiddle.net> References: <20020225185926.A25979@twiddle.net> Message-ID: Richard Henderson writes: > Incidentally, why does INTDEF not make use of STV_PROTECTED instead? > Then we wouldn't need to clutter up the source with INTUSE. This isn't the same. The handling of STV_PROTECTED is actually more expensive than a normal symbol lookup because of the requirement of C that function pointers are unique. And function pointers in this case would be the address of the PLT entry. Look into elf/dl-lookup.c to see what hoops we have to jump through. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Feb 25 21:01:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 25 Feb 2002 21:01:00 -0000 Subject: unwind info for .init/.fini sections In-Reply-To: References: Message-ID: David Mosberger > (1) Change the linker so it updates the unwind info once the final > .init/.fini section has been created. This shouldn't be all > that hard: it requires updating the unwind table entry and > adjusting the unwind descriptors so that the final body region > is long enough to cover the entire section. > > (2) Require that each code fragment that goes into the .init/.fini > section is wrapped like this: > > .proc whatever > .prologue > .vframe r32 > .save rp, r33 > .save ar.pfs, r34 > .body > : > ACTUAL INIT CODE > : > .endp I definitely prefer (1). Putting this kind of strange requirements on the code is definitely causing problems. Let things be automated as much as possible. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Feb 25 21:21:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 25 Feb 2002 21:21:00 -0000 Subject: [PATCH] Fix mmap stdio ungetc bug In-Reply-To: <20020225124335.J2204@sunsite.ms.mff.cuni.cz> References: <20020225124335.J2204@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > 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. This patch looks correct, I've applied it. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Feb 25 21:22:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 25 Feb 2002 21:22:00 -0000 Subject: [PATCH] Fix fdopen with mmap stdio In-Reply-To: <20020225150121.K2204@sunsite.ms.mff.cuni.cz> References: <20020225150121.K2204@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > 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. This one looks fine, too. I've just modified it a bit to help the compiler optimizging. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Feb 26 11:09:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 26 Feb 2002 11:09:00 -0000 Subject: New regex Message-ID: As you might have seen, I've checked in a completely new regex implementation in the 2.3 branch. It was written by Isamu Hasegawa from IBM Japan. This implementaion is not only clean, it's actually conforming to the POSIX standard! What a change. There are still some problems reported in the PTESTS test suite but I believe those are actually bugs in the tests (and therefore in IEEE 2003.2). Thanks a lot to Isamu and IBM for contributing this code. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Wed Feb 27 02:47:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 27 Feb 2002 02:47:00 -0000 Subject: [PATCH] Make glibc build on Alpha Message-ID: <20020227114733.Y2204@sunsite.ms.mff.cuni.cz> Hi! I found a bug in Alpha gas which must have been there for quite some time - .text and .data directives were not visible for .previous handling, so we ended up in a different section that we wanted. Could this be installed so that glibc works even with gas which is not yet fixed? 2002-02-27 Jakub Jelinek * sysdeps/alpha/dl-machine.h (elf_machine_load_address, RTLD_START): Work around an Alpha gas bug. --- libc/sysdeps/alpha/dl-machine.h.jj Mon Feb 4 17:34:53 2002 +++ libc/sysdeps/alpha/dl-machine.h Wed Feb 27 11:39:02 2002 @@ -74,7 +74,7 @@ elf_machine_load_address (void) "0:\n\t" "br $0, 2f\n" "1:\n\t" - ".data\n" + ".section\t.data\n" "2:\n\t" ".quad 0b\n\t" ".previous" @@ -294,7 +294,7 @@ elf_machine_runtime_setup (struct link_m its return value is the user program's entry point. */ #define RTLD_START asm ("\ -.text \n\ + .section .text \n\ .set at \n\ .globl _start \n\ .ent _start \n\ Jakub From jakub@redhat.com Wed Feb 27 04:32:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 27 Feb 2002 04:32:00 -0000 Subject: R_*_NONE in ld.so on Alpha/IA-64 Message-ID: <20020227133238.Z2204@sunsite.ms.mff.cuni.cz> Hi! Another problem I've noticed: with binutils 2.12, there are a few R_*_NONE relocs both in Alpha and IA-64 ld.so (but not in IA-32 ld.so). I haven't yet investigate what is causing this, but if they cannot be killed easily for 2.12 release, I guess #ifndef RTLD_BOOTSTRAP around R_*_NONE handling in dl-machine.h would have to be at least conditionalized on binutils release. Jakub From drepper@redhat.com Wed Feb 27 10:11:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 27 Feb 2002 10:11:00 -0000 Subject: [PATCH] Make glibc build on Alpha In-Reply-To: <20020227114733.Y2204@sunsite.ms.mff.cuni.cz> References: <20020227114733.Y2204@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > 2002-02-27 Jakub Jelinek > > * sysdeps/alpha/dl-machine.h (elf_machine_load_address, RTLD_START): > Work around an Alpha gas bug. I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Feb 27 11:01:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 27 Feb 2002 11:01:00 -0000 Subject: Doh! Message-ID: I cannot believe nobody noticed it. The new regex.c file was yet checked in. It happened now. So, *now* you'll be able to see the new implementation. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Thu Feb 28 01:04:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Thu, 28 Feb 2002 01:04:00 -0000 Subject: wordsize.h for x86-64 Message-ID: I'd like to follow the example of Sparc in using __WORDSIZE in the glibc headers of x86-64 to allow compilation with both 32-bit and 64-bit compilers of the same headers. Since this first appended patch affects also i386, I'd like to get permission to commit this file to both branches. Andreas 2002-02-28 Andreas Jaeger * sysdeps/i386/bits/wordsize.h: New file to allow sharing with x86-64. * sysdeps/x86_64/bits/wordsize.h: Likewise. ============================================================ Index: sysdeps/i386/bits/wordsize.h --- sysdeps/i386/bits/wordsize.h created +++ sysdeps/i386/bits/wordsize.h Thu Feb 28 10:00:25 2002 1.1 @@ -0,0 +1,7 @@ +/* Determine the wordsize from the preprocessor defines. */ + +#if defined __x86_64__ +# define __WORDSIZE 64 +#else +# define __WORDSIZE 32 +#endif ============================================================ Index: sysdeps/x86_64/bits/wordsize.h --- sysdeps/x86_64/bits/wordsize.h created +++ sysdeps/x86_64/bits/wordsize.h Thu Feb 28 10:00:52 2002 1.1 @@ -0,0 +1,7 @@ +/* Determine the wordsize from the preprocessor defines. */ + +#if defined __x86_64__ +# define __WORDSIZE 64 +#else +# define __WORDSIZE 32 +#endif -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Thu Feb 28 01:09:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 28 Feb 2002 01:09:00 -0000 Subject: wordsize.h for x86-64 In-Reply-To: References: Message-ID: Andreas Jaeger writes: > Since this first appended patch affects also i386, I'd like to get > permission to commit this file to both branches. I don't see why the x86 file change is needed. Any x86_64 system will have the x86_64 libraries installed as the main libraries. There will be the binaries for the x86 library but it doesn't come with headers. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Thu Feb 28 01:37:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Thu, 28 Feb 2002 01:37:00 -0000 Subject: wordsize.h for x86-64 In-Reply-To: (Ulrich Drepper's message of "28 Feb 2002 01:09:08 -0800") References: Message-ID: Ulrich Drepper writes: > Andreas Jaeger writes: > >> Since this first appended patch affects also i386, I'd like to get >> permission to commit this file to both branches. > > I don't see why the x86 file change is needed. Any x86_64 system will > have the x86_64 libraries installed as the main libraries. There will > be the binaries for the x86 library but it doesn't come with headers. Ok, that makes sense. I'll add the file later with the other changes after testing it properly, Thanks, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Thu Feb 28 01:37:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 28 Feb 2002 01:37:00 -0000 Subject: no more ADP,ATS,BEF,DEM,ESP,FIM,FRF,GRD,IEP,ITL,LUF,NLG,PTE Message-ID: In commemoration of this day I've eliminated all traces of the now defunct currencies in Europe. For those who don't follow the issues at the other side of the pond, today the last countries must completely switch to EUR. Local currencies are not anymore accepted. At least this is the theory, I have no first hand experience. Note that the changes made to the 2.3 files is different from those for the 2.2 files. The latter cannot take advantage of the internal transliteration mechanisms of localedef and therefore the currency_name is explicitly set to EUR which requires different files for the @euro version. The @euro files cannot be eliminated anytime soon due to charset issues. The non-@euro files don't use ISO-8859-15 or -16 and therefore don't have the Euro sign. What is now in the CVS archive will remain with us for a long time. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From bmark@us.ibm.com Thu Feb 28 07:50:00 2002 From: bmark@us.ibm.com (Mark Brown) Date: Thu, 28 Feb 2002 07:50:00 -0000 Subject: no more ADP,ATS,BEF,DEM,ESP,FIM,FRF,GRD,IEP,ITL,LUF,NLG,PTE In-Reply-To: Message-ID: On Thursday, February 28, 2002, at 03:37 AM, Ulrich Drepper wrote: > In commemoration of this day I've eliminated all traces of the now > defunct currencies in Europe. The problem with this is that now users cannot process work from previous years, where they need to work with the older currencies. --- Mark S. Brown Senior Technical Staff Member, IBM Server Group 512.838.3926 fax 512.838.3882 bmark@us.ibm.com From drepper@redhat.com Thu Feb 28 10:01:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 28 Feb 2002 10:01:00 -0000 Subject: no more ADP,ATS,BEF,DEM,ESP,FIM,FRF,GRD,IEP,ITL,LUF,NLG,PTE In-Reply-To: References: Message-ID: Mark Brown writes: > The problem with this is that now users cannot process work > from previous years, where they need to work with the older > currencies. No reliable implementation would use the locale information. At least not before the new locale API is introduced which allows using locales in a way it makes sense. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Thu Feb 28 10:17:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 28 Feb 2002 10:17:00 -0000 Subject: [PATCH] Provide libc's own __divdi3 etc., since it is not possible to grab it from libgcc.a anymore Message-ID: <20020228191658.A2033@sunsite.ms.mff.cuni.cz> Hi! gcc 3.1 libgcc.a has all its routines .hidden, so they cannot be re-exported from glibc that way. The following patch adds the code to glibc (btw: it is smaller than what libgcc.a has, since I replaced __negdi2 with normal negation, so there is no need to run the values through memory too many times, plus there is just one __udivmoddi4 while libgcc2.c sucks it in 4 times). 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. --- libc/sysdeps/i386/Makefile.jj Fri Sep 17 18:59:13 1999 +++ libc/sysdeps/i386/Makefile Thu Feb 28 19:04:03 2002 @@ -9,6 +9,12 @@ ifeq ($(subdir),csu) # On i686 we must avoid generating the trampoline functions generated # to get the GOT pointer. CFLAGS-initfini.s += -march=i386 -mcpu=i386 + +ifeq (yes,$(build-shared)) +# Compatibility +sysdep_routines += divdi3 +shared-only-routines += divdi3 +endif endif ifeq ($(subdir),db2) --- libc/sysdeps/m68k/Makefile.jj Thu Aug 23 18:49:59 2001 +++ libc/sysdeps/m68k/Makefile Thu Feb 28 19:04:29 2002 @@ -33,6 +33,14 @@ CFLAGS-setjmp.c := -fno-omit-frame-point # The 68k `long double' is a distinct type we support. long-double-fcts = yes +ifeq ($(subdir),csu) +ifeq (yes,$(build-shared)) +# Compatibility +sysdep_routines += divdi3 +shared-only-routines += divdi3 +endif +endif + ifeq ($(subdir),elf) CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused endif --- libc/sysdeps/s390/s390-32/Makefile.jj Fri Mar 16 09:59:44 2001 +++ libc/sysdeps/s390/s390-32/Makefile Thu Feb 28 19:04:44 2002 @@ -1,5 +1,13 @@ pic-ccflag = -fpic +ifeq ($(subdir),csu) +ifeq (yes,$(build-shared)) +# Compatibility +sysdep_routines += divdi3 +shared-only-routines += divdi3 +endif +endif + ifeq ($(subdir),gmon) sysdep_routines += s390-mcount endif --- libc/sysdeps/wordsize-32/divdi3.c.jj Thu Feb 28 18:53:16 2002 +++ libc/sysdeps/wordsize-32/divdi3.c Thu Feb 28 19:02:18 2002 @@ -0,0 +1,327 @@ +/* 64-bit multiplication and division + Copyright (C) 1989, 1992-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 + 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 +#include + +#if __WORDSIZE != 32 +#error This is for 32-bit targets only +#endif + +typedef unsigned int UQItype __attribute__ ((mode (QI))); +typedef int SItype __attribute__ ((mode (SI))); +typedef unsigned int USItype __attribute__ ((mode (SI))); +typedef int DItype __attribute__ ((mode (DI))); +typedef unsigned int UDItype __attribute__ ((mode (DI))); +#define Wtype SItype +#define HWtype SItype +#define DWtype DItype +#define UWtype USItype +#define UHWtype USItype +#define UDWtype UDItype +#define W_TYPE_SIZE 32 + +#include + +#if __BYTE_ORDER == __BIG_ENDIAN +struct DWstruct { Wtype high, low;}; +#elif __BYTE_ORDER == __LITTLE_ENDIAN +struct DWstruct { Wtype low, high;}; +#else +#error Unhandled endianity +#endif +typedef union { struct DWstruct s; DWtype ll; } DWunion; + +static UDWtype +__udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp) +{ + DWunion ww; + DWunion nn, dd; + DWunion rr; + UWtype d0, d1, n0, n1, n2; + UWtype q0, q1; + UWtype b, bm; + + nn.ll = n; + dd.ll = d; + + d0 = dd.s.low; + d1 = dd.s.high; + n0 = nn.s.low; + n1 = nn.s.high; + +#if !UDIV_NEEDS_NORMALIZATION + if (d1 == 0) + { + if (d0 > n1) + { + /* 0q = nn / 0D */ + + udiv_qrnnd (q0, n0, n1, n0, d0); + q1 = 0; + + /* Remainder in n0. */ + } + else + { + /* qq = NN / 0d */ + + if (d0 == 0) + d0 = 1 / d0; /* Divide intentionally by zero. */ + + udiv_qrnnd (q1, n1, 0, n1, d0); + udiv_qrnnd (q0, n0, n1, n0, d0); + + /* Remainder in n0. */ + } + + if (rp != 0) + { + rr.s.low = n0; + rr.s.high = 0; + *rp = rr.ll; + } + } + +#else /* UDIV_NEEDS_NORMALIZATION */ + + if (d1 == 0) + { + if (d0 > n1) + { + /* 0q = nn / 0D */ + + count_leading_zeros (bm, d0); + + if (bm != 0) + { + /* Normalize, i.e. make the most significant bit of the + denominator set. */ + + d0 = d0 << bm; + n1 = (n1 << bm) | (n0 >> (W_TYPE_SIZE - bm)); + n0 = n0 << bm; + } + + udiv_qrnnd (q0, n0, n1, n0, d0); + q1 = 0; + + /* Remainder in n0 >> bm. */ + } + else + { + /* qq = NN / 0d */ + + if (d0 == 0) + d0 = 1 / d0; /* Divide intentionally by zero. */ + + count_leading_zeros (bm, d0); + + if (bm == 0) + { + /* From (n1 >= d0) /\ (the most significant bit of d0 is set), + conclude (the most significant bit of n1 is set) /\ (the + leading quotient digit q1 = 1). + + This special case is necessary, not an optimization. + (Shifts counts of W_TYPE_SIZE are undefined.) */ + + n1 -= d0; + q1 = 1; + } + else + { + /* Normalize. */ + + b = W_TYPE_SIZE - bm; + + d0 = d0 << bm; + n2 = n1 >> b; + n1 = (n1 << bm) | (n0 >> b); + n0 = n0 << bm; + + udiv_qrnnd (q1, n1, n2, n1, d0); + } + + /* n1 != d0... */ + + udiv_qrnnd (q0, n0, n1, n0, d0); + + /* Remainder in n0 >> bm. */ + } + + if (rp != 0) + { + rr.s.low = n0 >> bm; + rr.s.high = 0; + *rp = rr.ll; + } + } +#endif /* UDIV_NEEDS_NORMALIZATION */ + + else + { + if (d1 > n1) + { + /* 00 = nn / DD */ + + q0 = 0; + q1 = 0; + + /* Remainder in n1n0. */ + if (rp != 0) + { + rr.s.low = n0; + rr.s.high = n1; + *rp = rr.ll; + } + } + else + { + /* 0q = NN / dd */ + + count_leading_zeros (bm, d1); + if (bm == 0) + { + /* From (n1 >= d1) /\ (the most significant bit of d1 is set), + conclude (the most significant bit of n1 is set) /\ (the + quotient digit q0 = 0 or 1). + + This special case is necessary, not an optimization. */ + + /* The condition on the next line takes advantage of that + n1 >= d1 (true due to program flow). */ + if (n1 > d1 || n0 >= d0) + { + q0 = 1; + sub_ddmmss (n1, n0, n1, n0, d1, d0); + } + else + q0 = 0; + + q1 = 0; + + if (rp != 0) + { + rr.s.low = n0; + rr.s.high = n1; + *rp = rr.ll; + } + } + else + { + UWtype m1, m0; + /* Normalize. */ + + b = W_TYPE_SIZE - bm; + + d1 = (d1 << bm) | (d0 >> b); + d0 = d0 << bm; + n2 = n1 >> b; + n1 = (n1 << bm) | (n0 >> b); + n0 = n0 << bm; + + udiv_qrnnd (q0, n1, n2, n1, d1); + umul_ppmm (m1, m0, q0, d0); + + if (m1 > n1 || (m1 == n1 && m0 > n0)) + { + q0--; + sub_ddmmss (m1, m0, m1, m0, d1, d0); + } + + q1 = 0; + + /* Remainder in (n1n0 - m1m0) >> bm. */ + if (rp != 0) + { + sub_ddmmss (n1, n0, n1, n0, m1, m0); + rr.s.low = (n1 << b) | (n0 >> bm); + rr.s.high = n1 >> bm; + *rp = rr.ll; + } + } + } + } + + ww.s.low = q0; + ww.s.high = q1; + return ww.ll; +} + +DWtype +__divdi3 (DWtype u, DWtype v) +{ + Wtype c = 0; + DWtype w; + + if (u < 0) + { + c = ~c; + u = -u; + } + if (v < 0) + { + c = ~c; + v = -v; + } + w = __udivmoddi4 (u, v, NULL); + if (c) + w = -w; + return w; +} + +DWtype +__moddi3 (DWtype u, DWtype v) +{ + Wtype c = 0; + DWtype w; + + if (u < 0) + { + c = ~c; + u = -u; + } + if (v < 0) + { + c = ~c; + v = -v; + } + __udivmoddi4 (u, v, &w); + if (c) + w = -w; + return w; +} + +UDWtype +__udivdi3 (UDWtype u, UDWtype v) +{ + return __udivmoddi4 (u, v, NULL); +} + +UDWtype +__umoddi3 (UDWtype u, UDWtype v) +{ + UDWtype w; + + __udivmoddi4 (u, v, &w); + return w; +} Jakub From jakub@redhat.com Thu Feb 28 10:52:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 28 Feb 2002 10:52:00 -0000 Subject: no more ADP,ATS,BEF,DEM,ESP,FIM,FRF,GRD,IEP,ITL,LUF,NLG,PTE In-Reply-To: ; from drepper@redhat.com on Thu, Feb 28, 2002 at 10:01:00AM -0800 References: Message-ID: <20020228195232.D2204@sunsite.ms.mff.cuni.cz> On Thu, Feb 28, 2002 at 10:01:00AM -0800, Ulrich Drepper wrote: > Mark Brown writes: > > > The problem with this is that now users cannot process work > > from previous years, where they need to work with the older > > currencies. > > No reliable implementation would use the locale information. At least > not before the new locale API is introduced which allows using locales > in a way it makes sense. Well, it might use the currency as default value, but certainly should store the currency info into the document. Jakub From jakub@redhat.com Thu Feb 28 11:33:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 28 Feb 2002 11:33:00 -0000 Subject: [PATCH] __attribute__((visibility(...))) for ld.so Message-ID: <20020228203333.E2204@sunsite.ms.mff.cuni.cz> Hi! This patch makes ld.so on ia32 smaller by another 1KB and on ia64 by 1.5KB by killing some unnecessary memory dereferences. Bootstrapped on i386/i686/ia64/alpha/alphaev6. 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. --- libc/elf/rtld.c.jj Thu Feb 28 12:31:20 2002 +++ libc/elf/rtld.c Thu Feb 28 16:18:08 2002 @@ -91,11 +91,7 @@ struct rtld_global _rtld_global = ._dl_hwcap_mask = HWCAP_IMPORTANT, ._dl_load_lock = _LIBC_LOCK_RECURSIVE_INITIALIZER }; -/* There must only be the definition in ld.so itself. */ -#ifdef HAVE_PROTECTED -asm (".protected _rtld_global"); -#endif - +strong_alias (_rtld_global, _rtld_local); static void dl_main (const ElfW(Phdr) *phdr, ElfW(Word) phnum, ElfW(Addr) *user_entry); --- libc/elf/Makefile.jj Mon Feb 18 23:39:22 2002 +++ libc/elf/Makefile Thu Feb 28 16:02:19 2002 @@ -250,6 +250,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))),-D_RTLD_LOCAL) + test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) generated += $(addsuffix .so,$(strip $(modules-names))) --- libc/sysdeps/alpha/dl-machine.h.jj Thu Feb 28 12:33:15 2002 +++ libc/sysdeps/alpha/dl-machine.h Thu Feb 28 16:48:57 2002 @@ -328,7 +328,7 @@ $fixup_stack_ret: \n\ " RTLD_START_SPECIAL_INIT " \n\ /* Call _dl_init(_dl_loaded, argc, argv, envp) to run \n\ initializers. */ \n\ - ldq $16, _rtld_global \n\ + ldq $16, _rtld_local \n\ ldq $17, 0($sp) \n\ lda $18, 8($sp) \n\ s8addq $17, 8, $19 \n\ --- libc/sysdeps/arm/dl-machine.h.jj Mon Feb 4 17:34:53 2002 +++ libc/sysdeps/arm/dl-machine.h Thu Feb 28 16:48:57 2002 @@ -324,7 +324,7 @@ _dl_start_user: .L_STACK_END: .word __libc_stack_end(GOT) .L_LOADED: - .word _rtld_global(GOT) + .word _rtld_local(GOT) .previous\n\ "); --- libc/sysdeps/generic/ldsodefs.h.jj Thu Feb 28 12:33:16 2002 +++ libc/sysdeps/generic/ldsodefs.h Thu Feb 28 16:08:44 2002 @@ -199,7 +199,11 @@ typedef void (*receiver_fct) (int, const # define GL(name) _##name #else # define EXTERN -# define GL(name) _rtld_global._##name +# ifdef _RTLD_LOCAL +# define GL(name) _rtld_local._##name +# else +# define GL(name) _rtld_global._##name +# endif struct rtld_global { #endif @@ -371,6 +375,19 @@ struct rtld_global #ifdef SHARED }; extern struct rtld_global _rtld_global; +# ifdef _RTLD_LOCAL +# ifdef HAVE_VISIBILITY_ATTRIBUTE +# ifdef HAVE_SDATA_SECTION +# define __rtld_local_attribute__ \ + __attribute__ ((visibility ("hidden"), section (".sdata"))) +# else +# define __rtld_local_attribute__ __attribute__ ((visibility ("hidden"))) +# endif +# else +# define __rtld_local_attribute__ +# endif +extern struct rtld_global _rtld_local __rtld_local_attribute__; +# endif #endif #undef EXTERN --- libc/sysdeps/hppa/dl-machine.h.jj Mon Feb 4 17:35:18 2002 +++ libc/sysdeps/hppa/dl-machine.h Thu Feb 28 16:48:57 2002 @@ -362,8 +362,8 @@ asm ( \ " stw %r24,-44(%sp)\n" \ \ ".Lnofix:\n" \ -" addil LT'_rtld_global,%r19\n" \ -" ldw RT'_rtld_global(%r1),%r26\n" \ +" addil LT'_rtld_local,%r19\n" \ +" ldw RT'_rtld_local(%r1),%r26\n" \ " bl set_dp, %r2\n" \ " ldw 0(%r26),%r26\n" \ \ --- libc/sysdeps/cris/dl-machine.h.jj Mon Feb 4 17:34:53 2002 +++ libc/sysdeps/cris/dl-machine.h Thu Feb 28 16:48:57 2002 @@ -212,7 +212,7 @@ _dl_start_user: move.d $sp,$r12 addq 4,$r12 ; main_map: at _dl_loaded. - move.d [$r0+_rtld_global:GOT16],$r9 + move.d [$r0+_rtld_local:GOT16],$r9 move.d [$r9],$r10 move.d _dl_init_internal:PLTG,$r9 add.d $r0,$r9 --- libc/sysdeps/i386/dl-machine.h.jj Mon Feb 18 23:39:52 2002 +++ libc/sysdeps/i386/dl-machine.h Thu Feb 28 17:33:58 2002 @@ -239,11 +239,10 @@ _dl_start_user:\n\ " RTLD_START_SPECIAL_INIT "\n\ # Load the parameters again.\n\ # (eax, edx, ecx, *--esp) = (_dl_loaded, argc, argv, envp)\n\ - movl _rtld_global@GOT(%ebx), %esi\n\ - leal 8(%esp,%edx,4), %eax\n\ + movl _rtld_local@GOTOFF(%ebx), %eax\n\ + leal 8(%esp,%edx,4), %esi\n\ leal 4(%esp), %ecx\n\ - pushl %eax\n\ - movl (%esi), %eax\n\ + pushl %esi\n\ # Call the function to run the initializers.\n\ call _dl_init_internal@PLT\n\ # Pass our finalizer function to the user in %edx, as per ELF ABI.\n\ --- libc/sysdeps/ia64/dl-machine.h.jj Mon Feb 4 17:35:18 2002 +++ libc/sysdeps/ia64/dl-machine.h Thu Feb 28 17:15:46 2002 @@ -381,7 +381,7 @@ elf_machine_runtime_setup (struct link_m " { .mmi\n" \ " mov out3 = r11\n" \ " sub r17 = r17, r3 /* Substract _dl_skip_args. */\n" \ -" addl out0 = @ltoff(_rtld_global), gp\n" \ +" addl out0 = @gprel(_rtld_local), gp\n" \ " }\n" \ "1: /* Copy env. */\n" \ " { .mfi\n" \ @@ -396,11 +396,9 @@ elf_machine_runtime_setup (struct link_m " }\n" \ " { .mmb\n" \ " st8 [r10] = out1 /* Record the new argc. */\n" \ -" ld8 out0 = [out0]\n" \ -" ;;\n" \ +" ld8 out0 = [out0] /* get the linkmap */\n" \ " }\n" \ " { .mmb\n" \ -" ld8 out0 = [out0] /* get the linkmap */\n" \ " st8 [r2] = r17 /* Load the new _dl_argv. */\n" \ " br.call.sptk.many b0 = _dl_init_internal#\n" \ " ;;\n" \ --- libc/sysdeps/m68k/dl-machine.h.jj Mon Feb 4 17:35:19 2002 +++ libc/sysdeps/m68k/dl-machine.h Thu Feb 28 16:48:57 2002 @@ -176,7 +176,7 @@ _dl_start_user:\n\ pea 8(%sp, %d1*4)\n\ pea 8(%sp)\n\ move.l %d1, -(%sp)\n\ - move.l ([_rtld_global@GOT.w, %a5]), -(%sp)\n\ + move.l ([_rtld_local@GOT.w, %a5]), -(%sp)\n\ jbsr _dl_init_internal@PLTPC\n\ addq.l #8, %sp\n\ addq.l #8, %sp\n\ --- libc/sysdeps/mips/mips64/dl-machine.h.jj Mon Feb 4 17:35:19 2002 +++ libc/sysdeps/mips/mips64/dl-machine.h Thu Feb 28 16:48:57 2002 @@ -480,7 +480,7 @@ _dl_start_user:\n\ # Save back the modified argument count.\n\ sd $4, 0($29)\n\ 1: # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\ - ld $4, _rtld_global\n\ + ld $4, _rtld_local\n\ ld $5, 0($29)\n\ dla $6, 4($29)\n\ dla $7, 8($29)\n\ @@ -492,7 +492,7 @@ _dl_start_user:\n\ dla $31, _dl_fini\n\ # Jump to the user entry point.\n\ 1: # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\ - lw $4, _rtld_global\n\ + lw $4, _rtld_local\n\ lw $5, 0($29)\n\ la $6, 4($29)\n\ la $7, 8($29)\n\ --- libc/sysdeps/mips/dl-machine.h.jj Sat Feb 9 00:32:19 2002 +++ libc/sysdeps/mips/dl-machine.h Thu Feb 28 16:48:57 2002 @@ -441,7 +441,7 @@ _dl_start_user:\n\ # Save back the modified argument count.\n\ sw $4, 0($29)\n\ 1: # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\ - lw $4, _rtld_global\n\ + lw $4, _rtld_local\n\ lw $5, 0($29)\n\ la $6, 4($29)\n\ sll $7, $5, 2\n\ --- libc/sysdeps/sparc/sparc32/dl-machine.h.jj Mon Feb 4 17:35:19 2002 +++ libc/sysdeps/sparc/sparc32/dl-machine.h Thu Feb 28 16:48:58 2002 @@ -312,9 +312,9 @@ _dl_start_user: bne 23b add %i1, 8, %i1 /* %o0 = _dl_loaded, %o1 = argc, %o2 = argv, %o3 = envp. */ -3: sethi %hi(_rtld_global), %o0 +3: sethi %hi(_rtld_local), %o0 add %sp, 23*4, %o2 - orcc %o0, %lo(_rtld_global), %o0 + orcc %o0, %lo(_rtld_local), %o0 sll %i5, 2, %o3 ld [%l7+%o0], %o0 add %o3, 4, %o3 --- libc/sysdeps/sparc/sparc64/dl-machine.h.jj Mon Feb 4 17:35:20 2002 +++ libc/sysdeps/sparc/sparc64/dl-machine.h Thu Feb 28 16:48:58 2002 @@ -745,9 +745,9 @@ elf_machine_runtime_setup (struct link_m " add %i1, 16, %i1\n" \ " stx %l5, [%l4]\n" \ " /* %o0 = _dl_loaded, %o1 = argc, %o2 = argv, %o3 = envp. */\n" \ -"2: sethi %hi(_rtld_global), %o0\n" \ +"2: sethi %hi(_rtld_local), %o0\n" \ " add %sp, " __S(STACK_BIAS) " + 23*8, %o2\n" \ -" orcc %o0, %lo(_rtld_global), %o0\n" \ +" orcc %o0, %lo(_rtld_local), %o0\n" \ " sllx %i5, 3, %o3\n" \ " ldx [%l7 + %o0], %o0\n" \ " add %o3, 8, %o3\n" \ --- libc/sysdeps/sh/dl-machine.h.jj Mon Feb 4 17:35:19 2002 +++ libc/sysdeps/sh/dl-machine.h Thu Feb 28 16:48:58 2002 @@ -388,7 +388,7 @@ _dl_start_user:\n\ .L_dl_init:\n\ .long _dl_init_internal@PLT\n\ .L_dl_loaded:\n\ - .long _rtld_global@GOT\n\ + .long _rtld_local@GOT\n\ .L_dl_starting_up:\n\ .long _dl_starting_up@GOT\n\ .L_dl_fini:\n\ --- libc/sysdeps/s390/s390-32/dl-machine.h.jj Mon Feb 4 17:35:19 2002 +++ libc/sysdeps/s390/s390-32/dl-machine.h Thu Feb 28 16:48:58 2002 @@ -287,7 +287,7 @@ _dl_start_user:\n\ # Call the function to run the initializers.\n\ # Load the parameters:\n\ # (%r2, %r3, %r4, %r5) = (_dl_loaded, argc, argv, envp)\n\ - l %r2,_rtld_global@GOT(%r12)\n\ + l %r2,_rtld_local@GOT(%r12)\n\ l %r2,0(%r2)\n\ l %r3,96(%r15)\n\ la %r4,100(%r15)\n\ --- libc/sysdeps/s390/s390-64/dl-machine.h.jj Mon Feb 4 17:35:19 2002 +++ libc/sysdeps/s390/s390-64/dl-machine.h Thu Feb 28 16:48:58 2002 @@ -262,7 +262,7 @@ _dl_start_user:\n\ # Call the function to run the initializers.\n\ # Load the parameters:\n\ # (%r2, %r3, %r4, %r5) = (_dl_loaded, argc, argv, envp)\n\ - lghi %r2,_rtld_global@GOT + lghi %r2,_rtld_local@GOT lg %r2,0(%r2,%r12)\n\ lg %r2,0(%r2)\n\ lg %r3,160(%r15)\n\ --- libc/sysdeps/x86_64/dl-machine.h.jj Mon Feb 4 17:35:21 2002 +++ libc/sysdeps/x86_64/dl-machine.h Thu Feb 28 16:48:58 2002 @@ -250,7 +250,7 @@ _dl_start_user:\n\ # argc -> rsi\n\ movq %rdx, %rsi\n\ # _dl_loaded -> rdi\n\ - movq _rtld_global@GOTPCREL(%rip), %rdi\n\ + movq _rtld_local@GOTPCREL(%rip), %rdi\n\ movq (%rdi), %rdi\n\ # env -> rcx\n\ leaq 16(%rsp,%rdx,8), %rcx\n\ --- libc/configure.in.jj Thu Feb 28 12:31:19 2002 +++ libc/configure.in Thu Feb 28 13:23:13 2002 @@ -1001,6 +1001,44 @@ EOF AC_SUBST(libc_cv_asm_protected_directive) AC_DEFINE(HAVE_PROTECTED) + 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 -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 -z nodelete option, libc_cv_z_nodelete, [dnl cat > conftest.c <&6 +echo "configure:2812: 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 -a $gnu_ld = yes; then + echo $ac_n "checking whether to put _rtld_local into .sdata section""... $ac_c" 1>&6 +echo "configure:2842: 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 -z nodelete option""... $ac_c" 1>&6 echo "configure:2811: checking for -z nodelete option" >&5 if eval "test \"`echo '$''{'libc_cv_z_nodelete'+set}'`\" = set"; then --- libc/config.h.in.jj Mon Feb 18 23:39:07 2002 +++ libc/config.h.in Thu Feb 28 13:21:39 2002 @@ -102,6 +102,12 @@ /* Define if the assembler supported .protected. */ #undef HAVE_PROTECTED +/* Define if the compiler supports __attribute__ ((visibility (...))). */ +#undef HAVE_VISIBILITY_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 Jakub From drepper@redhat.com Thu Feb 28 11:40:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 28 Feb 2002 11:40:00 -0000 Subject: [PATCH] Provide libc's own __divdi3 etc., since it is not possible to grab it from libgcc.a anymore In-Reply-To: <20020228191658.A2033@sunsite.ms.mff.cuni.cz> References: <20020228191658.A2033@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > The following patch adds the code to glibc Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Thu Feb 28 14:15:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 28 Feb 2002 14:15:00 -0000 Subject: [PATCH] Fix nice Message-ID: <20020228231524.F2204@sunsite.ms.mff.cuni.cz> Hi! 2001-06-04 patch for nice apparently changed nothing at all on linux, since sysdeps/unix/nice.c which was patched is overridden in sysdeps/unix/sysv/syscalls.list (nice), thus nice still returns 0 on success, not the actual new priority. Fix below. I have briefly tested that it works as expected on ia32 linux. 2002-02-28 Jakub Jelinek * sysdeps/unix/sysv/linux/nice.c: New file. --- libc/sysdeps/unix/sysv/linux/nice.c.jj Thu Feb 28 23:12:51 2002 +++ libc/sysdeps/unix/sysv/linux/nice.c Thu Feb 28 23:15:06 2002 @@ -0,0 +1 @@ +#include Jakub From drepper@redhat.com Thu Feb 28 14:38:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 28 Feb 2002 14:38:00 -0000 Subject: [David Mosberger ] problem with unwind info for .init/.fini sections Message-ID: Another mail from David. He'll eventually manage to get the mailing list handler to accept his machine. -------------- next part -------------- An embedded message was scrubbed... From: David Mosberger Subject: Re: [Linux-ia64] problem with unwind info for .init/.fini sections Date: Thu, 28 Feb 2002 13:33:39 -0800 Size: 1477 URL: From drepper@redhat.com Thu Feb 28 14:43:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 28 Feb 2002 14:43:00 -0000 Subject: [PATCH] __attribute__((visibility(...))) for ld.so In-Reply-To: <20020228203333.E2204@sunsite.ms.mff.cuni.cz> References: <20020228203333.E2204@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > This patch makes ld.so on ia32 smaller by another 1KB and on ia64 by 1.5KB > by killing some unnecessary memory dereferences. Very cool. The gcc changes as well. It removes another 1-2% in startup time. The patch is in, thanks. Now we should do the same thing for non-static variables which are not exported from libc.so and the other DSOs. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Thu Feb 28 16:58:00 2002 From: hjl@lucon.org (H . J . Lu) Date: Thu, 28 Feb 2002 16:58:00 -0000 Subject: [David Mosberger ] problem with unwind info for .init/.fini sections In-Reply-To: ; from drepper@redhat.com on Thu, Feb 28, 2002 at 02:37:47PM -0800 References: Message-ID: <20020228165851.A26168@lucon.org> On Thu, Feb 28, 2002 at 02:37:47PM -0800, Ulrich Drepper wrote: > Another mail from David. He'll eventually manage to get the mailing > list handler to accept his machine. > > From: David Mosberger > Content-Type: text/plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > Message-ID: <15486.41523.514655.290242@napali.hpl.hp.com> > Date: Thu, 28 Feb 2002 13:33:39 -0800 > To: > Cc: "David Mosberger" , Cary Coutant , > , libc-hacker@sources.redhat.com > Subject: Re: [Linux-ia64] problem with unwind info for .init/.fini sections > In-Reply-To: <200202271920.LAA10765@adlmail.cup.hp.com> > References: <200202271920.LAA10765@adlmail.cup.hp.com> > X-Mailer: VM 7.01 under Emacs 21.1.1 > Reply-To: davidm@hpl.hp.com > X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ > MIME-Version: 1.0 > > >>>>> On Wed, 27 Feb 2002 11:19:30 -0800, Cary Coutant said: > > >> I can think of two approaches: > >> ... > >> Anybody else have a better idea or other comments? > > Cary> (3) Use the .init_array and .fini_array sections instead. > > This would be by far the cleanest solution. > > How well is this supported in binutils at the moment? I see some > references to it, but am not sure whether there are any holes in its > support. > > Are there any reasons *not* to switch to .init_array/.fini_array as > the primary init/fini mechanism? Besides fixing the unwind problem, > it seems to me it's generally just a much cleaner solution and should > allow us to get rid of some rather ugly hacks in glibc. > > --david I am not sure if .init_array/.fini_array are supported. It will be nice to add them to binutils. H.J. From davidm@napali.hpl.hp.com Thu Feb 28 17:19:00 2002 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Thu, 28 Feb 2002 17:19:00 -0000 Subject: [David Mosberger ] problem with unwind info for .init/.fini sections In-Reply-To: <20020228165851.A26168@lucon.org> References: <20020228165851.A26168@lucon.org> Message-ID: <15486.55079.333535.999190@napali.hpl.hp.com> >>>>> On Thu, 28 Feb 2002 16:58:52 -0800, "H . J . Lu" said: HJ> I am not sure if .init_array/.fini_array are supported. It will HJ> be nice to add them to binutils. >From my point of view, it's more worthwhile to spend time on getting .init_array/.fini_array supported than trying to fix up .init/.fini. I'm willing to help with such an effort, but I probably would need a fair amount of help (or at least support) from the glibc and binutils maintainers. Anyone else willing to help with this? --david From drepper@redhat.com Thu Feb 28 17:28:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 28 Feb 2002 17:28:00 -0000 Subject: [David Mosberger ] problem with unwind info for .init/.fini sections In-Reply-To: <15486.55079.333535.999190@napali.hpl.hp.com> References: <20020228165851.A26168@lucon.org> <15486.55079.333535.999190@napali.hpl.hp.com> Message-ID: David Mosberger writes: > but I probably would need a fair amount of help (or at least > support) from the glibc and binutils maintainers. Anyone else > willing to help with this? There should be nothing to be done in glibc. Support is included for ages. Not tested, of course, put it's there. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Thu Feb 28 17:33:00 2002 From: hjl@lucon.org (H . J . Lu) Date: Thu, 28 Feb 2002 17:33:00 -0000 Subject: [David Mosberger ] problem with unwind info for .init/.fini sections In-Reply-To: <15486.55079.333535.999190@napali.hpl.hp.com>; from davidm@napali.hpl.hp.com on Thu, Feb 28, 2002 at 05:19:35PM -0800 References: <20020228165851.A26168@lucon.org> <15486.55079.333535.999190@napali.hpl.hp.com> Message-ID: <20020228173311.A26728@lucon.org> On Thu, Feb 28, 2002 at 05:19:35PM -0800, David Mosberger wrote: > >>>>> On Thu, 28 Feb 2002 16:58:52 -0800, "H . J . Lu" said: > > HJ> I am not sure if .init_array/.fini_array are supported. It will > HJ> be nice to add them to binutils. > > >From my point of view, it's more worthwhile to spend time on getting > .init_array/.fini_array supported than trying to fix up .init/.fini. > I'm willing to help with such an effort, but I probably would need a > fair amount of help (or at least support) from the glibc and binutils > maintainers. Anyone else willing to help with this? > I believe glibc is ok. The problem is binutils. I didn't see any supports for DT_INIT_ARRAY, DT_FINI_ARRAY. DT_INIT_ARRAYSZ, DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY nor DT_PREINIT_ARRAYSZ. H.J. From davidm@napali.hpl.hp.com Thu Feb 28 17:43:00 2002 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Thu, 28 Feb 2002 17:43:00 -0000 Subject: [David Mosberger ] problem with unwind info for .init/.fini sections In-Reply-To: <20020228173311.A26728@lucon.org> References: <20020228165851.A26168@lucon.org> <15486.55079.333535.999190@napali.hpl.hp.com> <20020228173311.A26728@lucon.org> Message-ID: <15486.56491.696020.742674@napali.hpl.hp.com> >>>>> On Thu, 28 Feb 2002 17:33:11 -0800, "H . J . Lu" said: HJ> I believe glibc is ok. The problem is binutils. I didn't see any HJ> supports for DT_INIT_ARRAY, DT_FINI_ARRAY. DT_INIT_ARRAYSZ, HJ> DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY nor DT_PREINIT_ARRAYSZ. Shouldn't this be easy straight-forward to add? I guess the other component that needs updating is gcc (at least the ia64 versions of crtbegin.asm and crtend.asm would need that). I'd be happy to work on this. --david From davidm@napali.hpl.hp.com Thu Feb 28 18:01:00 2002 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Thu, 28 Feb 2002 18:01:00 -0000 Subject: [David Mosberger ] problem with unwind info for .init/.fini sections In-Reply-To: <20020228175426.A30756@redhat.com> References: <20020228165851.A26168@lucon.org> <15486.55079.333535.999190@napali.hpl.hp.com> <20020228173311.A26728@lucon.org> <15486.56491.696020.742674@napali.hpl.hp.com> <20020228175426.A30756@redhat.com> Message-ID: <15486.57594.352544.376331@napali.hpl.hp.com> >>>>> On Thu, 28 Feb 2002 17:54:26 -0800, Richard Henderson said: Rich> Yes, it should. I think there's even some code for this for Rich> ia64-hpux in the tree already. I only see code to print the DT*ARRAY* tags and to recognize the respective sections. Looks to me like elflink.h needs to be updated? >> I guess the other component that needs updating is gcc (at least >> the ia64 versions of crtbegin.asm and crtend.asm would need >> that). I'd be happy to work on this. Rich> Should be easy too, except for the bit to figure out whether Rich> or not support for this exists in ld.so. Right. --david From hjl@lucon.org Thu Feb 28 18:11:00 2002 From: hjl@lucon.org (H . J . Lu) Date: Thu, 28 Feb 2002 18:11:00 -0000 Subject: [David Mosberger ] problem with unwind info for .init/.fini sections In-Reply-To: <20020228175426.A30756@redhat.com>; from rth@redhat.com on Thu, Feb 28, 2002 at 05:54:26PM -0800 References: <20020228165851.A26168@lucon.org> <15486.55079.333535.999190@napali.hpl.hp.com> <20020228173311.A26728@lucon.org> <15486.56491.696020.742674@napali.hpl.hp.com> <20020228175426.A30756@redhat.com> Message-ID: <20020228181137.B27106@lucon.org> On Thu, Feb 28, 2002 at 05:54:26PM -0800, Richard Henderson wrote: > > > I guess the other component that needs updating is gcc (at least the > > ia64 versions of crtbegin.asm and crtend.asm would need that). I'd be > > happy to work on this. > > Should be easy too, except for the bit to figure out whether or > not support for this exists in ld.so. ld should only generate those DT_XXX_ARRAY entries from those .xxx_array sections. If ld.so doesn't support DT_XXX_ARRAY, there shouldn't be any .xxx_array sections in ld inputs. It it is not an ld problem. I think gcc should check it. H.J. From davidm@napali.hpl.hp.com Thu Feb 28 22:42:00 2002 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Thu, 28 Feb 2002 22:42:00 -0000 Subject: [David Mosberger ] problem with unwind info for .init/.fini sections In-Reply-To: <20020228175426.A30756@redhat.com> References: <20020228165851.A26168@lucon.org> <15486.55079.333535.999190@napali.hpl.hp.com> <20020228173311.A26728@lucon.org> <15486.56491.696020.742674@napali.hpl.hp.com> <20020228175426.A30756@redhat.com> Message-ID: <15487.8879.719511.86715@napali.hpl.hp.com> >>>>> On Thu, 28 Feb 2002 17:54:26 -0800, Richard Henderson said: Rich> On Thu, Feb 28, 2002 at 05:43:07PM -0800, David Mosberger Rich> wrote: HJ> I believe glibc is ok. The problem is binutils. I didn't see any HJ> supports for DT_INIT_ARRAY, DT_FINI_ARRAY. DT_INIT_ARRAYSZ, HJ> DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY nor DT_PREINIT_ARRAYSZ. David> Shouldn't this be easy straight-forward to add? Rich> Yes, it should. I think there's even some code for this for Rich> ia64-hpux in the tree already. OK, how is the attached for a start? I'm not sure it's 100% correct, so it needs some reviewing, but it does seem to do the right thing. There is one more problem in glibc however: each platform's startup code needs to be modified to handle these sections (since the dynamic loader doesn't call them; which makes sense given that we need to handle static binaries at any rate). But how can the startup code find to these sections? Perhaps we should define symbols in the linker script to mark the beginning and end of each section? (I don't know what the ${RELOCATING+${INIT_ARRAY_START}} stuff means in scripttempl/elf.sc; perhaps this does the right thing?) Thanks, --david ----------------------- bfd/ChangeLog: 2002-02-28 David Mosberger * elflink.h (size_dynamic_sections): If section named ".preinit_array" exists, create DT_PREINIT_ARRAY and DT_PREINIT_ARRAYSZ entries in dynamic table. Analogously for ".init_array" and ".fini_array". (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ, DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and DT_FINI_ARRAY. ld/ChangeLog: 2001-04-18 David Mosberger * emulparams/elf64_ia64.sh (EXECUTABLE_SYMBOLS): Provide default value for _FPU_STATUS (initial value of ar.fpsr). Index: bfd/elflink.h =================================================================== RCS file: /cvs/src/src/bfd/elflink.h,v retrieving revision 1.141 diff -u -r1.141 elflink.h --- bfd/elflink.h 2002/01/21 10:29:07 1.141 +++ bfd/elflink.h 2002/03/01 06:26:19 @@ -3200,6 +3200,33 @@ return false; } + /* yuck, more matching by name... */ + + if (bfd_get_section_by_name (output_bfd, ".preinit_array")) + { + if (!elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAY, + (bfd_vma) 0) + || !elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAYSZ, + (bfd_vma) 0)) + return false; + } + if (bfd_get_section_by_name (output_bfd, ".init_array")) + { + if (!elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAY, + (bfd_vma) 0) + || !elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAYSZ, + (bfd_vma) 0)) + return false; + } + if (bfd_get_section_by_name (output_bfd, ".fini_array")) + { + if (!elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAY, + (bfd_vma) 0) + || !elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAYSZ, + (bfd_vma) 0)) + return false; + } + dynstr = bfd_get_section_by_name (dynobj, ".dynstr"); /* If .dynstr is excluded from the link, we don't want any of these tags. Strictly, we should be checking each section @@ -5548,6 +5575,31 @@ } } break; + + case DT_PREINIT_ARRAYSZ: + name = ".preinit_array"; + goto get_size; + case DT_INIT_ARRAYSZ: + name = ".init_array"; + goto get_size; + case DT_FINI_ARRAYSZ: + name = ".fini_array"; + get_size: + o = bfd_get_section_by_name (abfd, name); + BFD_ASSERT (o != NULL); + dyn.d_un.d_val = o->_raw_size; + elf_swap_dyn_out (dynobj, &dyn, dyncon); + break; + + case DT_PREINIT_ARRAY: + name = ".preinit_array"; + goto get_vma; + case DT_INIT_ARRAY: + name = ".init_array"; + goto get_vma; + case DT_FINI_ARRAY: + name = ".fini_array"; + goto get_vma; case DT_HASH: name = ".hash"; Index: ld/scripttempl/elf.sc =================================================================== RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v retrieving revision 1.26 diff -u -r1.26 elf.sc --- ld/scripttempl/elf.sc 2002/02/12 14:50:08 1.26 +++ ld/scripttempl/elf.sc 2002/03/01 06:26:29 @@ -246,6 +246,27 @@ ${RELOCATING+${INIT_END}} } =${NOP-0} + .preinit_array ${RELOCATING-0} : + { + ${RELOCATING+${PREINIT_ARRAY_START}} + KEEP (*(.preinit_array)) + ${RELOCATING+${PREINIT_ARRAY_END}} + } + + .init_array ${RELOCATING-0} : + { + ${RELOCATING+${INIT_ARRAY_START}} + KEEP (*(.init_array)) + ${RELOCATING+${INIT_ARRAY_END}} + } + + .fini_array ${RELOCATING-0} : + { + ${RELOCATING+${FINI_ARRAY_START}} + KEEP (*(.fini_array)) + ${RELOCATING+${FINI_ARRAY_END}} + } + ${DATA_PLT-${BSS_PLT-${PLT}}} .text ${RELOCATING-0} : {