From jakub@redhat.com Mon Sep 2 05:06:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 02 Sep 2002 05:06:00 -0000 Subject: __libc_internal_tsd_* Message-ID: <20020902140602.G1013@sunsite.ms.mff.cuni.cz> Hi! Just wondering whether it wouldn't be better to reduce the number of __libc_internal_tsd_* variables out there for dynamic libraries (ATM we have 3 copies, ld.so, libc.so and libpthread.so) and instead just use one in ld.so (perhaps with rtld_hidden* aliases for ld.so, so it doesn't need the .got entries). __pthread_initialize_minimal needs to be called anyway and thus could fill it in... This would be IMHO especially good for prelink, since now __libc_internal_tsd_* are always conflicts (at least in ld.so, but in threaded programs in libc.so too). If you don't think this is a good idea, we should at least put __libc_internal_tsd_address in a separate source from the rest of no-tsd.c (no-tsda.c?), so that ld.so which doesn't use it at all doesn't export it. Well, if we do what I suggested above, it would make sense to split it too, since then __libc_internal_tsd_address can have its home in libc.so and thus loads from it can go through an hidden alias (which is bypassing one indirection (.got))... What do you think? Jakub From jakub@redhat.com Mon Sep 2 05:35:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 02 Sep 2002 05:35:00 -0000 Subject: [PATCH] locale_data->private.ctype Message-ID: <20020902143531.H1013@sunsite.ms.mff.cuni.cz> Hi! Following patch passed glibc bootstrap, make check and libstdc++-v3 build and make check against that library. 2002-09-02 Jakub Jelinek * locale/localeinfo.h (struct locale_data): Add private.ctype. * wcsmbs/wcsmbsload.h (__wcsmbs_gconv_fcts, __wcsmbs_last_locale, __wcsmbs_to_wc, update_conversion_ptrs): Removed. (__wcsmbs_gconv_fcts_c, _nl_C_LC_CTYPE): New externs. (__wcsmbs_load_conv): Remove const from argument. (_nl_cleanup_ctype): New proto. (get_gconv_fcts): New function. * wcsmbs/wcsmbsload.c (__wcsmbs_last_locale): Removed. (__wcsmbs_to_wc): Rename back to... (to_wc): ... this. (__wcsmbs_gconv_fcts): Rename to... (__wcsmbs_gconv_fcts_c): ... this. Make const. Use to_wc. (lock): Removed. (__libc_setlocale_lock): New extern. (__wcsmbs_load_conv): Remove const from argument. Initialize new_category->private.ctype instead of a global variable. (__wcsmbs_clone_conv): Use get_gconv_fcts instead of update_function_ptrs. No locking is necessary. (_nl_cleanup_ctype): New function. * wcsmbs/btowc.c (__btowc): Use get_gconv_fcts instead of update_function_ptrs and a global __wcsmbs_gconv_fcts variable. * wcsmbs/mbrtowc.c (__mbrtowc): Likewise. * wcsmbs/mbsnrtowcs.c (__mbsnrtowcs): Likewise. * wcsmbs/wcrtomb.c (__wcrtomb): Likewise. * wcsmbs/wcsnrtombs.c (__wcsnrtombs): Likewise. * wcsmbs/wcsrtombs.c (__wcsrtombs): Likewise. * wcsmbs/wctob.c (wctob): Likewise. * stdlib/mblen.c (mblen): Likewise. * stdlib/mbtowc.c (mbtowc): Likewise. * stdlib/wctomb.c (wctomb): Likewise. * wcsmbs/mbsrtowcs.c (__mbsrtowcs): Likewise. Remove calls to wcsmbs_get_towc_func and wcsmbs_free_funcs. * wcsmbs/mbsrtowcs_l.c (wcsmbs_get_towc_func, wcsmbs_free_funcs): Removed. --- libc/locale/localeinfo.h.jj 2002-09-01 09:34:28.000000000 +0200 +++ libc/locale/localeinfo.h 2002-09-02 12:16:18.000000000 +0200 @@ -64,6 +64,7 @@ struct locale_data { void *data; struct lc_time_data *time; + const struct gconv_fcts *ctype; }; } private; --- libc/stdlib/mblen.c.jj 2001-08-23 18:49:14.000000000 +0200 +++ libc/stdlib/mblen.c 2002-09-02 11:50:26.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1991,1997,1998,1999,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,13 +40,15 @@ mblen (const char *s, size_t n) not. */ if (s == NULL) { - /* Make sure we use the correct value. */ - update_conversion_ptrs (); + const struct gconv_fcts *fcts; + + /* Get the conversion functions. */ + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* Reset the state. */ memset (&state, '\0', sizeof state); - result = __wcsmbs_gconv_fcts.towc->__stateful; + result = fcts->towc->__stateful; } else if (*s == '\0') /* According to the ISO C 89 standard this is the expected behaviour. */ --- libc/stdlib/mbtowc.c.jj 2002-03-23 11:50:55.000000000 +0100 +++ libc/stdlib/mbtowc.c 2002-09-02 11:56:07.000000000 +0200 @@ -44,14 +44,16 @@ mbtowc (wchar_t *pwc, const char *s, siz not. */ if (s == NULL) { - /* Make sure we use the correct value. */ - update_conversion_ptrs (); + const struct gconv_fcts *fcts; + + /* Get the conversion functions. */ + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* This is an extension in the Unix standard which does not directly violate ISO C. */ memset (&__no_r_state, '\0', sizeof __no_r_state); - result = __wcsmbs_gconv_fcts.towc->__stateful; + result = fcts->towc->__stateful; } else if (*s == '\0') { --- libc/stdlib/wctomb.c.jj 2002-08-06 10:15:16.000000000 +0200 +++ libc/stdlib/wctomb.c 2002-09-02 11:57:09.000000000 +0200 @@ -40,14 +40,16 @@ wctomb (char *s, wchar_t wchar) not. */ if (s == NULL) { - /* Make sure we use the correct value. */ - update_conversion_ptrs (); + const struct gconv_fcts *fcts; + + /* Get the conversion functions. */ + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* This is an extension in the Unix standard which does not directly violate ISO C. */ memset (&__no_r_state, '\0', sizeof __no_r_state); - return __wcsmbs_gconv_fcts.tomb->__stateful; + return fcts->tomb->__stateful; } return __wcrtomb (s, wchar, &__no_r_state); --- libc/wcsmbs/wcsmbsload.h.jj 2002-08-29 17:10:08.000000000 +0200 +++ libc/wcsmbs/wcsmbsload.h 2002-09-02 12:19:37.000000000 +0200 @@ -35,15 +35,10 @@ struct gconv_fcts }; /* Set of currently active conversion functions. */ -extern struct gconv_fcts __wcsmbs_gconv_fcts attribute_hidden; - - -/* Last loaded locale for LC_CTYPE. */ -extern const struct locale_data *__wcsmbs_last_locale attribute_hidden; - +extern const struct gconv_fcts __wcsmbs_gconv_fcts_c attribute_hidden; /* Load conversion functions for the currently selected locale. */ -extern void __wcsmbs_load_conv (const struct locale_data *new_category) +extern void __wcsmbs_load_conv (struct locale_data *new_category) internal_function; /* Clone the current `__wcsmbs_load_conv' value. */ @@ -54,12 +49,12 @@ extern void __wcsmbs_clone_conv (struct extern int __wcsmbs_named_conv (struct gconv_fcts *copy, const char *name) internal_function; - -#include +/* Function used for the `private.cleanup' hook. */ +extern void _nl_cleanup_ctype (struct locale_data *) + internal_function attribute_hidden; -/* Variable for conversion from ASCII to wchar_t. */ -extern struct __gconv_step __wcsmbs_to_wc attribute_hidden; +#include /* Load the function implementation if necessary. */ @@ -67,14 +62,20 @@ extern struct __gconv_step *__wcsmbs_get size_t *nstepsp) attribute_hidden; +extern const struct locale_data _nl_C_LC_CTYPE attribute_hidden; /* Check whether the LC_CTYPE locale changed since the last call. Update the pointers appropriately. */ -static inline void -update_conversion_ptrs (void) +static inline const struct gconv_fcts * +get_gconv_fcts (struct locale_data *data) { - if (__wcsmbs_last_locale != _NL_CURRENT_DATA (LC_CTYPE)) - __wcsmbs_load_conv (_NL_CURRENT_DATA (LC_CTYPE)); + if (__builtin_expect (data->private.ctype == NULL, 0)) + { + if (__builtin_expect (data == &_nl_C_LC_CTYPE, 0)) + return &__wcsmbs_gconv_fcts_c; + __wcsmbs_load_conv (data); + } + return data->private.ctype; } #endif /* wcsmbsload.h */ --- libc/wcsmbs/wcsmbsload.c.jj 2002-08-29 17:10:08.000000000 +0200 +++ libc/wcsmbs/wcsmbsload.c 2002-09-02 12:58:14.000000000 +0200 @@ -28,14 +28,8 @@ #include -/* Last loaded locale for LC_CTYPE. We initialize for the C locale - which is enabled at startup. */ -extern const struct locale_data _nl_C_LC_CTYPE; -const struct locale_data *__wcsmbs_last_locale = &_nl_C_LC_CTYPE; - - /* These are the descriptions for the default conversion functions. */ -struct __gconv_step __wcsmbs_to_wc attribute_hidden = +static struct __gconv_step to_wc = { .__shlib_handle = NULL, .__modname = NULL, @@ -73,9 +67,9 @@ static struct __gconv_step to_mb = /* For the default locale we only have to handle ANSI_X3.4-1968. */ -struct gconv_fcts __wcsmbs_gconv_fcts = +const struct gconv_fcts __wcsmbs_gconv_fcts_c = { - .towc = &__wcsmbs_to_wc, + .towc = &to_wc, .towc_nsteps = 1, .tomb = &to_mb, .tomb_nsteps = 1 @@ -148,90 +142,73 @@ __wcsmbs_getfct (const char *to, const c }) -/* We must modify global data. */ -__libc_lock_define_initialized (static, lock) - +/* Some of the functions here must not be used while setlocale is called. */ +__libc_lock_define (extern, __libc_setlocale_lock attribute_hidden) /* Load conversion functions for the currently selected locale. */ void internal_function -__wcsmbs_load_conv (const struct locale_data *new_category) +__wcsmbs_load_conv (struct locale_data *new_category) { /* Acquire the lock. */ - __libc_lock_lock (lock); + __libc_lock_lock (__libc_setlocale_lock); /* We should repeat the test since while we waited some other thread might have run this function. */ - if (__builtin_expect (__wcsmbs_last_locale != new_category, 1)) + if (__builtin_expect (new_category->private.ctype == NULL, 1)) { - if (new_category->name == _nl_C_name) /* Yes, pointer comparison. */ + /* We must find the real functions. */ + const char *charset_name; + const char *complete_name; + struct gconv_fcts *new_fcts; + int use_translit; + + /* Allocate the gconv_fcts structure. */ + new_fcts = malloc (sizeof *new_fcts); + if (new_fcts == NULL) { failed: - __wcsmbs_gconv_fcts.towc = &__wcsmbs_to_wc; - __wcsmbs_gconv_fcts.tomb = &to_mb; + new_category->private.ctype = &__wcsmbs_gconv_fcts_c; } - else + + /* Get name of charset of the locale. */ + charset_name = new_category->values[_NL_ITEM_INDEX(CODESET)].string; + + /* Does the user want transliteration? */ + use_translit = new_category->use_translit; + + /* Normalize the name and add the slashes necessary for a + complete lookup. */ + complete_name = norm_add_slashes (charset_name, + use_translit ? "TRANSLIT" : NULL); + + /* It is not necessary to use transliteration in this direction + since the internal character set is supposed to be able to + represent all others. */ + new_fcts->towc = __wcsmbs_getfct ("INTERNAL", complete_name, + &new_fcts->towc_nsteps); + new_fcts->tomb = (new_fcts->towc != NULL + ? __wcsmbs_getfct (complete_name, "INTERNAL", + &new_fcts->tomb_nsteps) + : NULL); + + /* If any of the conversion functions is not available we don't + use any since this would mean we cannot convert back and + forth.*/ + if (new_fcts->tomb == NULL) { - /* We must find the real functions. */ - const char *charset_name; - const char *complete_name; - struct __gconv_step *new_towc; - size_t new_towc_nsteps; - struct __gconv_step *new_tomb; - size_t new_tomb_nsteps; - int use_translit; - - /* Free the old conversions. */ - if (__wcsmbs_gconv_fcts.tomb != &to_mb) - __gconv_close_transform (__wcsmbs_gconv_fcts.tomb, - __wcsmbs_gconv_fcts.tomb_nsteps); - if (__wcsmbs_gconv_fcts.towc != &__wcsmbs_to_wc) - __gconv_close_transform (__wcsmbs_gconv_fcts.towc, - __wcsmbs_gconv_fcts.towc_nsteps); - - /* Get name of charset of the locale. */ - charset_name = new_category->values[_NL_ITEM_INDEX(CODESET)].string; - - /* Does the user want transliteration? */ - use_translit = new_category->use_translit; - - /* Normalize the name and add the slashes necessary for a - complete lookup. */ - complete_name = norm_add_slashes (charset_name, - use_translit ? "TRANSLIT" : NULL); - - /* It is not necessary to use transliteration in this direction - since the internal character set is supposed to be able to - represent all others. */ - new_towc = __wcsmbs_getfct ("INTERNAL", complete_name, - &new_towc_nsteps); - new_tomb = (new_towc != NULL - ? __wcsmbs_getfct (complete_name, "INTERNAL", - &new_tomb_nsteps) - : NULL); - - /* If any of the conversion functions is not available we don't - use any since this would mean we cannot convert back and - forth.*/ - if (new_towc == NULL || new_tomb == NULL) - { - if (new_towc != NULL) - __gconv_close_transform (new_towc, 1); - - goto failed; - } - - __wcsmbs_gconv_fcts.tomb = new_tomb; - __wcsmbs_gconv_fcts.tomb_nsteps = new_tomb_nsteps; - __wcsmbs_gconv_fcts.towc = new_towc; - __wcsmbs_gconv_fcts.towc_nsteps = new_towc_nsteps; + if (new_fcts->towc != NULL) + __gconv_close_transform (new_fcts->towc, new_fcts->towc_nsteps); + + free (new_fcts); + goto failed; } - /* Set last-used variable for current locale. */ - __wcsmbs_last_locale = new_category; + new_category->private.ctype = new_fcts; + new_category->private.cleanup = &_nl_cleanup_ctype; } - __libc_lock_unlock (lock); + __libc_lock_unlock (__libc_setlocale_lock); } @@ -240,22 +217,18 @@ void internal_function __wcsmbs_clone_conv (struct gconv_fcts *copy) { - /* First make sure the function table is up-to-date. */ - update_conversion_ptrs (); + const struct gconv_fcts *orig; - /* Make sure the data structures remain the same until we are finished. */ - __libc_lock_lock (lock); + orig = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* Copy the data. */ - *copy = __wcsmbs_gconv_fcts; + *copy = *orig; /* Now increment the usage counters. */ if (copy->towc->__shlib_handle != NULL) ++copy->towc->__counter; if (copy->tomb->__shlib_handle != NULL) ++copy->tomb->__counter; - - __libc_lock_unlock (lock); } @@ -275,28 +248,18 @@ __wcsmbs_named_conv (struct gconv_fcts * return copy->towc == NULL || copy->tomb == NULL ? 1 : 0; } - -/* Free all resources if necessary. */ -static void __attribute__ ((unused)) -free_mem (void) +void internal_function +_nl_cleanup_ctype (struct locale_data *locale) { - if (__wcsmbs_gconv_fcts.tomb != &to_mb) + const struct gconv_fcts *const data = locale->private.ctype; + if (data != NULL) { - struct __gconv_step *old = __wcsmbs_gconv_fcts.tomb; - size_t nold = __wcsmbs_gconv_fcts.tomb_nsteps; - __wcsmbs_gconv_fcts.tomb = &to_mb; - __wcsmbs_gconv_fcts.tomb_nsteps = 1; - __gconv_release_cache (old, nold); - } + locale->private.ctype = NULL; + locale->private.cleanup = NULL; - if (__wcsmbs_gconv_fcts.towc != &__wcsmbs_to_wc) - { - struct __gconv_step *old = __wcsmbs_gconv_fcts.towc; - size_t nold = __wcsmbs_gconv_fcts.towc_nsteps; - __wcsmbs_gconv_fcts.towc = &__wcsmbs_to_wc; - __wcsmbs_gconv_fcts.towc_nsteps = 1; - __gconv_release_cache (old, nold); + /* Free the old conversions. */ + __gconv_close_transform (data->tomb, data->tomb_nsteps); + __gconv_close_transform (data->towc, data->towc_nsteps); + free ((char *) data); } } - -text_set_element (__libc_subfreeres, free_mem); --- libc/wcsmbs/btowc.c.jj 2001-08-07 14:14:05.000000000 +0200 +++ libc/wcsmbs/btowc.c 2002-09-02 11:37:12.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1996,1997,1998,1999,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -36,6 +36,7 @@ __btowc (c) const unsigned char *inptr = inbuf; size_t dummy; int status; + const struct gconv_fcts *fcts; /* If the parameter does not fit into one byte or it is the EOF value we can give the answer now. */ @@ -54,14 +55,14 @@ __btowc (c) /* Make sure we start in the initial state. */ memset (&data.__state, '\0', sizeof (mbstate_t)); - /* Make sure we use the correct function. */ - update_conversion_ptrs (); + /* Get the conversion functions. */ + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* Create the input string. */ inbuf[0] = c; - status = DL_CALL_FCT (__wcsmbs_gconv_fcts.towc->__fct, - (__wcsmbs_gconv_fcts.towc, &data, &inptr, inptr + 1, + status = DL_CALL_FCT (fcts->towc->__fct, + (fcts->towc, &data, &inptr, inptr + 1, NULL, &dummy, 0, 1)); /* The conversion failed. */ if (status != __GCONV_OK && status != __GCONV_FULL_OUTPUT --- libc/wcsmbs/mbrtowc.c.jj 2002-08-06 10:15:26.000000000 +0200 +++ libc/wcsmbs/mbrtowc.c 2002-09-02 11:37:12.000000000 +0200 @@ -42,6 +42,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t dummy; const unsigned char *inbuf; char *outbuf = (char *) (pwc ?: buf); + const struct gconv_fcts *fcts; /* Set information for this step. */ data.__invocation_counter = 0; @@ -63,13 +64,13 @@ __mbrtowc (wchar_t *pwc, const char *s, data.__outbuf = outbuf; data.__outbufend = outbuf + sizeof (wchar_t); - /* Make sure we use the correct function. */ - update_conversion_ptrs (); + /* Get the conversion functions. */ + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* Do a normal conversion. */ inbuf = (const unsigned char *) s; - status = DL_CALL_FCT (__wcsmbs_gconv_fcts.towc->__fct, - (__wcsmbs_gconv_fcts.towc, &data, &inbuf, inbuf + n, + status = DL_CALL_FCT (fcts->towc->__fct, + (fcts->towc, &data, &inbuf, inbuf + n, NULL, &dummy, 0, 1)); /* There must not be any problems with the conversion but illegal input --- libc/wcsmbs/mbsnrtowcs.c.jj 2001-08-07 14:14:05.000000000 +0200 +++ libc/wcsmbs/mbsnrtowcs.c 2002-09-02 11:37:12.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1996,1997,1998,1999,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -51,6 +51,7 @@ __mbsnrtowcs (dst, src, nmc, len, ps) int status; struct __gconv_step *towc; size_t dummy; + const struct gconv_fcts *fcts; /* Tell where we want the result. */ data.__invocation_counter = 0; @@ -63,11 +64,11 @@ __mbsnrtowcs (dst, src, nmc, len, ps) return 0; srcend = *src + __strnlen (*src, nmc - 1) + 1; - /* Make sure we use the correct function. */ - update_conversion_ptrs (); + /* Get the conversion functions. */ + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* Get the structure with the function pointers. */ - towc = __wcsmbs_gconv_fcts.towc; + towc = fcts->towc; /* We have to handle DST == NULL special. */ if (dst == NULL) --- libc/wcsmbs/mbsrtowcs.c.jj 2002-08-29 17:10:07.000000000 +0200 +++ libc/wcsmbs/mbsrtowcs.c 2002-09-02 11:37:12.000000000 +0200 @@ -58,6 +58,7 @@ __mbsrtowcs (dst, src, len, ps) int status; struct __gconv_step *towc; size_t non_reversible; + const struct gconv_fcts *fcts; /* Tell where we want the result. */ data.__invocation_counter = 0; @@ -70,16 +71,15 @@ __mbsrtowcs (dst, src, len, ps) #endif data.__trans = NULL; + /* Get the conversion functions. */ #ifdef USE_IN_EXTENDED_LOCALE_MODEL - /* Get the conversion function matching the locale. */ - towc = wcsmbs_get_towc_func (l); + fcts = get_gconv_fcts (l->__locales[LC_CTYPE]); #else - /* Make sure we use the correct function. */ - update_conversion_ptrs (); + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); +#endif /* Get the structure with the function pointers. */ - towc = __wcsmbs_gconv_fcts.towc; -#endif + towc = fcts->towc; /* We have to handle DST == NULL special. */ if (dst == NULL) @@ -160,11 +160,6 @@ __mbsrtowcs (dst, src, len, ps) __set_errno (EILSEQ); } -#ifdef USE_IN_EXTENDED_LOCALE_MODEL - /* Free the conversion function data structures. */ - wcsmbs_free_funcs (towc); -#endif - return result; } #ifndef USE_IN_EXTENDED_LOCALE_MODEL --- libc/wcsmbs/mbsrtowcs_l.c.jj 2002-08-29 08:39:06.000000000 +0200 +++ libc/wcsmbs/mbsrtowcs_l.c 2002-09-02 11:37:12.000000000 +0200 @@ -21,35 +21,5 @@ #include #include "wcsmbsload.h" - -static inline struct __gconv_step * -wcsmbs_get_towc_func (__locale_t l) -{ - const char *charset; - int use_translit; - char *norm; - size_t nsteps; - - charset = l->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX(CODESET)].string; - - /* Transliteration requested? */ - use_translit = l->__locales[LC_CTYPE]->use_translit; - - /* Normalize the name. */ - norm = norm_add_slashes (charset, use_translit ? "TRANSLIT" : NULL); - - return __wcsmbs_getfct ("INTERNAL", charset, &nsteps) ?: &__wcsmbs_to_wc; -} - - -static inline void -wcsmbs_free_funcs (struct __gconv_step *step) -{ - if (step != &__wcsmbs_to_wc) - /* There is only one step. */ - __gconv_close_transform (step, 1); -} - - #define USE_IN_EXTENDED_LOCALE_MODEL 1 #include "mbsrtowcs.c" --- libc/wcsmbs/wcrtomb.c.jj 2002-08-06 10:15:26.000000000 +0200 +++ libc/wcsmbs/wcrtomb.c 2002-09-02 11:37:12.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1996,1997,1998,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -42,6 +42,7 @@ __wcrtomb (char *s, wchar_t wc, mbstate_ int status; size_t result; size_t dummy; + const struct gconv_fcts *fcts; /* Set information for this step. */ data.__invocation_counter = 0; @@ -62,16 +63,16 @@ __wcrtomb (char *s, wchar_t wc, mbstate_ data.__outbuf = s; data.__outbufend = s + MB_CUR_MAX; - /* Make sure we use the correct function. */ - update_conversion_ptrs (); + /* Get the conversion functions. */ + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* If WC is the NUL character we write into the output buffer the byte sequence necessary for PS to get into the initial state, followed by a NUL byte. */ if (wc == L'\0') { - status = DL_CALL_FCT (__wcsmbs_gconv_fcts.tomb->__fct, - (__wcsmbs_gconv_fcts.tomb, &data, NULL, NULL, + status = DL_CALL_FCT (fcts->tomb->__fct, + (fcts->tomb, &data, NULL, NULL, NULL, &dummy, 1, 1)); if (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT) @@ -82,8 +83,8 @@ __wcrtomb (char *s, wchar_t wc, mbstate_ /* Do a normal conversion. */ const unsigned char *inbuf = (const unsigned char *) &wc; - status = DL_CALL_FCT (__wcsmbs_gconv_fcts.tomb->__fct, - (__wcsmbs_gconv_fcts.tomb, &data, &inbuf, + status = DL_CALL_FCT (fcts->tomb->__fct, + (fcts->tomb, &data, &inbuf, inbuf + sizeof (wchar_t), NULL, &dummy, 0, 1)); } --- libc/wcsmbs/wcsnrtombs.c.jj 2001-08-07 14:14:06.000000000 +0200 +++ libc/wcsmbs/wcsnrtombs.c 2002-09-02 11:37:12.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1996,1997,1998,1999,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -49,6 +49,7 @@ __wcsnrtombs (dst, src, nwc, len, ps) int status; size_t result; struct __gconv_step *tomb; + const struct gconv_fcts *fcts; /* Tell where we want the result. */ data.__invocation_counter = 0; @@ -61,11 +62,11 @@ __wcsnrtombs (dst, src, nwc, len, ps) return 0; srcend = *src + __wcsnlen (*src, nwc - 1) + 1; - /* Make sure we use the correct function. */ - update_conversion_ptrs (); + /* Get the conversion functions. */ + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* Get the structure with the function pointers. */ - tomb = __wcsmbs_gconv_fcts.tomb; + tomb = fcts->tomb; /* We have to handle DST == NULL special. */ if (dst == NULL) --- libc/wcsmbs/wcsrtombs.c.jj 2001-08-07 14:14:06.000000000 +0200 +++ libc/wcsmbs/wcsrtombs.c 2002-09-02 11:37:12.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1996,1997,1998,1999,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -45,6 +45,7 @@ __wcsrtombs (dst, src, len, ps) int status; size_t result; struct __gconv_step *tomb; + const struct gconv_fcts *fcts; /* Tell where we want the result. */ data.__invocation_counter = 0; @@ -53,11 +54,11 @@ __wcsrtombs (dst, src, len, ps) data.__statep = ps ?: &state; data.__trans = NULL; - /* Make sure we use the correct function. */ - update_conversion_ptrs (); + /* Get the conversion functions. */ + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* Get the structure with the function pointers. */ - tomb = __wcsmbs_gconv_fcts.tomb; + tomb = fcts->tomb; /* We have to handle DST == NULL special. */ if (dst == NULL) --- libc/wcsmbs/wctob.c.jj 2001-08-07 14:14:06.000000000 +0200 +++ libc/wcsmbs/wctob.c 2002-09-02 11:37:12.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1996,1997,1998,1999,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -35,6 +35,7 @@ wctob (c) wchar_t *inptr = inbuf; size_t dummy; int status; + const struct gconv_fcts *fcts; if (c == WEOF) return EOF; @@ -51,14 +52,14 @@ wctob (c) /* Make sure we start in the initial state. */ memset (&data.__state, '\0', sizeof (mbstate_t)); - /* Make sure we use the correct function. */ - update_conversion_ptrs (); + /* Get the conversion functions. */ + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); /* Create the input string. */ inbuf[0] = c; - status = DL_CALL_FCT (__wcsmbs_gconv_fcts.tomb->__fct, - (__wcsmbs_gconv_fcts.tomb, &data, + status = DL_CALL_FCT (fcts->tomb->__fct, + (fcts->tomb, &data, (const unsigned char **) &inptr, (const unsigned char *) &inbuf[1], NULL, &dummy, 0, 1)); Jakub From roland@redhat.com Mon Sep 2 12:35:00 2002 From: roland@redhat.com (Roland McGrath) Date: Mon, 02 Sep 2002 12:35:00 -0000 Subject: [PATCH] locale_data->private.ctype In-Reply-To: <20020902143531.H1013@sunsite.ms.mff.cuni.cz>; from jakub@redhat.com on Mon, Sep 02, 2002 at 02:35:31PM +0200 References: <20020902143531.H1013@sunsite.ms.mff.cuni.cz> Message-ID: <20020902123436.C7886@dhcp187.sf.frob.com> It's in. From roland@redhat.com Mon Sep 2 12:45:00 2002 From: roland@redhat.com (Roland McGrath) Date: Mon, 02 Sep 2002 12:45:00 -0000 Subject: __libc_internal_tsd_* In-Reply-To: <20020902140602.G1013@sunsite.ms.mff.cuni.cz>; from jakub@redhat.com on Mon, Sep 02, 2002 at 02:06:02PM +0200 References: <20020902140602.G1013@sunsite.ms.mff.cuni.cz> Message-ID: <20020902124408.G7886@dhcp187.sf.frob.com> That sounds reasonable to me. From jakub@redhat.com Mon Sep 2 13:12:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 02 Sep 2002 13:12:00 -0000 Subject: [PATCH] Fix prelinking with dlopen Message-ID: <20020902221222.I1013@sunsite.ms.mff.cuni.cz> Hi! The following patch fixes various crashes when successfully prelinked program calls dynamically loads other libraries. Finally prelinked OpenOffice.org works. 2002-09-02 Jakub Jelinek * elf/rtld.c (dl_main): If prelinking succeeded, mark all objects as relocated. --- libc/elf/rtld.c.jj 2002-08-28 17:08:14.000000000 +0200 +++ libc/elf/rtld.c 2002-09-02 21:32:11.000000000 +0200 @@ -1405,6 +1405,8 @@ cannot allocate TLS data structures for if (prelinked) { + struct link_map *l; + if (GL(dl_loaded)->l_info [ADDRIDX (DT_GNU_CONFLICT)] != NULL) { ElfW(Rela) *conflict, *conflictend; @@ -1425,6 +1427,10 @@ cannot allocate TLS data structures for HP_TIMING_DIFF (relocate_time, start, stop); } + /* Mark all the objects so we know they have been already relocated. */ + for (l = GL(dl_loaded); l; l = l->l_next) + l->l_relocated = 1; + _dl_sysdep_start_cleanup (); } else Jakub From jakub@redhat.com Tue Sep 3 11:30:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 03 Sep 2002 11:30:00 -0000 Subject: [PATCH] Fix typo in tst-C-locale Message-ID: <20020903203023.M1013@sunsite.ms.mff.cuni.cz> Hi! 2002-09-03 Jakub Jelinek * locale/tst-C_locale.c (run_test): Pass LC_ALL_MASK not LC_ALL to newlocale. --- libc/locale/tst-C-locale.c.jj 2002-08-28 12:58:05.000000000 +0200 +++ libc/locale/tst-C-locale.c 2002-09-03 20:31:56.000000000 +0200 @@ -223,7 +223,7 @@ run_test (const char *locname) STRTEST (NOSTR, ""); /* Test the new locale mechanisms. */ - loc = newlocale (LC_ALL, locname, NULL); + loc = newlocale (LC_ALL_MASK, locname, NULL); if (loc == NULL) { printf ("cannot create locale object for locale %s\n", locname); Jakub From drepper@redhat.com Tue Sep 3 11:42:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 03 Sep 2002 11:42:00 -0000 Subject: [PATCH] Fix typo in tst-C-locale References: <20020903203023.M1013@sunsite.ms.mff.cuni.cz> Message-ID: <3D750284.50107@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > * locale/tst-C_locale.c (run_test): Pass LC_ALL_MASK not LC_ALL to > newlocale. Thanks, I've applied the patch. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9dQKE2ijCOnn/RHQRAgw2AKCwZ35i8QgGEs9ulgsFnaNS6LL9nwCgi8lX TvNE8EPPP9120dHV0iW3gb8= =yZb1 -----END PGP SIGNATURE----- From jakub@redhat.com Thu Sep 5 13:20:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 05 Sep 2002 13:20:00 -0000 Subject: [PATCH] Fix wcsmbs with invalid charsets Message-ID: <20020905222050.V1013@sunsite.ms.mff.cuni.cz> Hi! When either malloc fails or there is no gconv module for the given charset, we end up with endless loop. This got broken when I was changing the patch to not test locale name against _nl_C_name (in that case was failed: in that if and the rest of code in else branch and so both would unlock/exit the function). Sorry. 2002-09-05 Jakub Jelinek * wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Unlock and return in case of failure. --- libc/wcsmbs/wcsmbsload.c.jj 2002-09-03 15:30:40.000000000 +0200 +++ libc/wcsmbs/wcsmbsload.c 2002-09-05 22:12:51.000000000 +0200 @@ -169,6 +169,8 @@ __wcsmbs_load_conv (struct locale_data * { failed: new_category->private.ctype = &__wcsmbs_gconv_fcts_c; + __libc_lock_unlock (__libc_setlocale_lock); + return; } /* Get name of charset of the locale. */ Jakub From jakub@redhat.com Thu Sep 5 13:31:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 05 Sep 2002 13:31:00 -0000 Subject: [PATCH] Fix wcsmbs with invalid charsets (take 2) In-Reply-To: <20020905222050.V1013@sunsite.ms.mff.cuni.cz>; from jakub@redhat.com on Thu, Sep 05, 2002 at 10:20:50PM +0200 References: <20020905222050.V1013@sunsite.ms.mff.cuni.cz> Message-ID: <20020905223115.W1013@sunsite.ms.mff.cuni.cz> On Thu, Sep 05, 2002 at 10:20:50PM +0200, Jakub Jelinek wrote: > When either malloc fails or there is no gconv module for the given charset, > we end up with endless loop. > This got broken when I was changing the patch to not test locale > name against _nl_C_name (in that case was failed: in that if and the rest > of code in else branch and so both would unlock/exit the function). > Sorry. Perhaps nicer variant of the patch which avoids duplicating the unlock and return in the middle of function... Both versions of the patch fix the testcase with invalid charset and in both cases doing setlocale(LC_CTYPE, "cs_CZ"); wcsmbs(NULL, L'\0'); seems to DTRT too. 2002-09-05 Jakub Jelinek * wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Unlock and return in case of failure. --- libc/wcsmbs/wcsmbsload.c.jj 2002-09-03 15:30:40.000000000 +0200 +++ libc/wcsmbs/wcsmbsload.c 2002-09-05 22:26:20.000000000 +0200 @@ -166,10 +166,7 @@ __wcsmbs_load_conv (struct locale_data * /* Allocate the gconv_fcts structure. */ new_fcts = malloc (sizeof *new_fcts); if (new_fcts == NULL) - { - failed: - new_category->private.ctype = &__wcsmbs_gconv_fcts_c; - } + goto failed; /* Get name of charset of the locale. */ charset_name = new_category->values[_NL_ITEM_INDEX(CODESET)].string; @@ -201,11 +198,14 @@ __wcsmbs_load_conv (struct locale_data * __gconv_close_transform (new_fcts->towc, new_fcts->towc_nsteps); free (new_fcts); - goto failed; + failed: + new_category->private.ctype = &__wcsmbs_gconv_fcts_c; + } + else + { + new_category->private.ctype = new_fcts; + new_category->private.cleanup = &_nl_cleanup_ctype; } - - new_category->private.ctype = new_fcts; - new_category->private.cleanup = &_nl_cleanup_ctype; } __libc_lock_unlock (__libc_setlocale_lock); Jakub From jakub@redhat.com Mon Sep 9 03:48:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 09 Sep 2002 03:48:00 -0000 Subject: [PATCH] Shut out some debugging messages for LD_DEBUG=statistics Message-ID: <20020909124803.G1013@sunsite.ms.mff.cuni.cz> Hi! Even LD_DEBUG=statistics or LD_TRACE_PRELINKING causes lots of debugging messages, which is pretty annoying (e.g. LD_DEBUG=statistics should really only enable statistics and nothing else). 2002-09-09 Jakub Jelinek * elf/dl-error.c (_dl_signal_cerror): Don't print anything if only LD_DEBUG=statistics or LD_TRACE_PRELINKING. --- libc/elf/dl-error.c.jj 2002-07-01 12:31:36.000000000 +0200 +++ libc/elf/dl-error.c 2002-09-09 12:43:39.000000000 +0200 @@ -119,7 +119,8 @@ internal_function _dl_signal_cerror (int errcode, const char *objname, const char *occation, const char *errstring) { - if (__builtin_expect (GL(dl_debug_mask), 0)) + if (__builtin_expect (GL(dl_debug_mask) + & ~(DL_DEBUG_STATISTICS|DL_DEBUG_PRELINK), 0)) INTUSE(_dl_debug_printf) ("%s: error: %s: %s (%s)\n", objname, occation, errstring, receiver ? "continued" : "fatal"); Jakub From jakub@redhat.com Mon Sep 9 12:00:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 09 Sep 2002 12:00:00 -0000 Subject: [PATCH] Kill 18 .plt entries from libm.so Message-ID: <20020909210007.I1013@sunsite.ms.mff.cuni.cz> Hi! PLT slot reduction for libm: 2002-09-09 Jakub Jelinek * include/math.h (__finite_internal, __finitef_internal, __finitel_internal, __isinf_internal, __isnan_internal): Remove. (isfinite): Remove. (__finite, __isinf, __isnan, __finitef, __isinff, __isnanf, __finitel, __isinfl, __isnanl): Add hidden_proto. (__fpclassify, __fpclassifyf, __fpclassifyl, __expm1l): Add libm_hidden_proto. * math/Makefile (libm-calls): Add s_isinf and s_isnan. * stdio-common/printf_fp.c (__printf_fp): Remove INTUSE from __is{inf,nan} calls. * stdio-common/printf_size.c (printf_size): Likewise. * sysdeps/generic/printf_fphex.c (__printf_fphex): Likewise. * sysdeps/generic/s_ldexp.c (__ldexp): Likewise. * sysdeps/generic/s_ldexpf.c (__ldexpf): Likewise. * sysdeps/generic/s_ldexpl.c (__ldexpl): Likewise. * sysdeps/generic/s_expm1l.c (__expm1l): Add libm_hidden_def. * sysdeps/i386/fpu/s_finite.S (__finite_internal): Remove alias. (__finite): Add hidden_def. * sysdeps/i386/fpu/s_finitef.S (__finitef_internal): Remove alias. (__finitef): Add hidden_def. * sysdeps/i386/fpu/s_finitel.S (__finitel_internal): Remove alias. (__finitel): Add hidden_def. * sysdeps/i386/fpu/s_isinfl.c (__isinfl): Remove INTDEF. Add hidden_def. * sysdeps/i386/fpu/s_isnanl.c (__isnanl): Likewise. * sysdeps/i386/fpu/s_fpclassifyl.c (__fpclassifyl): Add libm_hidden_def. * sysdeps/i386/fpu/s_expm1l.S (__expm1l): Likewise. * sysdeps/ieee754/dbl-64/s_finite.c (__finite): Remove INTDEF. Add hidden_def. * sysdeps/ieee754/dbl-64/s_isinf.c (__isinf): Likewise. (__isinfl): Remove INTDEF. * sysdeps/ieee754/dbl-64/s_isnan.c (__isnan): Remove INTDEF. Add hidden_def. (__isnanl): Remove INTDEF. * sysdeps/ieee754/dbl-64/s_fpclassify.c (__fpclassify): Add libm_hidden_def. * sysdeps/ieee754/dbl-64/e_lgamma_r.c (sin_pi): Use __sin and __cos instead of sin and cos. * sysdeps/ieee754/flt-32/s_finitef.c (__finitef): Remove INTDEF. Add hidden_def. * sysdeps/ieee754/flt-32/s_isinff.c (__isinff): Likewise. * sysdeps/ieee754/flt-32/s_isnanf.c (__isnanf): Likewise. * sysdeps/ieee754/flt-32/s_fpclassifyf.c (__fpclassifyf): Add libm_hidden_def. * sysdeps/ieee754/ldbl-128/s_finitel.c (__finitel): Remove INTDEF. Add hidden_def. * sysdeps/ieee754/ldbl-128/s_isinfl.c (__isinfl): Likewise. * sysdeps/ieee754/ldbl-128/s_isnanl.c (__isnanl): Likewise. * sysdeps/ieee754/ldbl-128/s_fpclassifyl.c (__fpclassifyl): Add libm_hidden_def. * sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Add libm_hidden_def. * sysdeps/ieee754/ldbl-96/s_finitel.c (__finitel): Remove INTDEF. Add hidden_def. * sysdeps/ieee754/ldbl-96/s_isinfl.c (__isinfl): Likewise. * sysdeps/ieee754/ldbl-96/s_isnanl.c (__isnanl): Likewise. * sysdeps/ieee754/ldbl-96/s_fpclassifyl.c (__fpclassifyl): Add libm_hidden_def. * sysdeps/ia64/fpu/s_finite.S (__finite_internal, __finitef_internal, __finitel_internal): Remove aliases. (__finite, __finitef, __finitel): Add hidden_def. * sysdeps/ia64/fpu/s_isnan.S (__isnan_internal, __isnanf_internal, __isnanl_internal): Remove aliases. (__isnan, __isnanf, __isnanl): Add hidden_def. * sysdeps/ia64/fpu/s_isinf.S (__isinf_internal, __isinff_internal, __isinfl_internal): Remove aliases. (__isinf, __isinff, __isinfl): Add hidden_def. * sysdeps/ia64/fpu/s_fpclassify.S (__fpclassify, __fpclassifyf, __fpclassifyl): Add libm_hidden_def. * sysdeps/ia64/fpu/s_expm1l.S (__expm1l): Likewise. * sysdeps/m68k/s_isinfl.c (__isinfl): Remove INTDEF. Add hidden_def. * sysdeps/m68k/fpu/s_isinf.c (INTDEFX): Remove. (hidden_defx): Define and use. * sysdeps/m68k/fpu/s_fpclassifyl.c (__fpclassifyl): Add libm_hidden_def. * sysdeps/m68k/fpu/s_expm1l.c (__expm1l): Likewise. * sysdeps/m68k/s_isnanl.c (__isnanl): Add hidden_def. * sysdeps/powerpc/fpu/s_isnan.c (__isnan, __isnanf, __isnanl): Remove INTDEF. (__isnan, __isnanf): Add hidden_def. * sysdeps/x86_64/fpu/s_finitel.S (__finitel_internal): Remove alias. (__finitel): Add libm_hidden_def. * sysdeps/x86_64/fpu/s_expm1l.S (__expm1l): Likewise. * include/fenv.h (feraiseexcept, fesetenv): Add libm_hidden_proto. * sysdeps/alpha/fpu/fesetenv.c (fesetenv): Add libm_hidden_ver. * sysdeps/alpha/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/arm/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/arm/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/generic/fesetenv.c (fesetenv): Likewise. * sysdeps/generic/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/i386/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/i386/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/m68k/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/m68k/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/mips/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/mips/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/powerpc/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/powerpc/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/sparc/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/sparc/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/hppa/fpu/fesetenv.c (fesetenv): Add libm_hidden_def. * sysdeps/hppa/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/ia64/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/ia64/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/sh/sh4/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/sh/sh4/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/s390/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/s390/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/x86_64/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/x86_64/fpu/fraiseexcpt.c (feraiseexcept): Likewise. --- libc/include/math.h.jj 2002-04-30 12:52:49.000000000 +0200 +++ libc/include/math.h 2002-09-09 18:28:50.000000000 +0200 @@ -5,40 +5,27 @@ /* Now define the internal interfaces. */ extern int __matherr (struct exception *__exc); -extern int __finite_internal (double __value) - __attribute__ ((__const__)) attribute_hidden; -extern int __finitef_internal (float __value) - __attribute__ ((__const__)) attribute_hidden; - -extern int __isinf_internal (double __value) - __attribute__ ((__const__)) attribute_hidden; -extern int __isnan_internal (double __value) - __attribute__ ((__const__)) attribute_hidden; - -#ifndef __NO_LONG_DOUBLE_MATH -extern int __finitel_internal (long double __value) - __attribute__ ((__const__)) attribute_hidden; +# if !defined NOT_IN_libc || defined IS_IN_libm +hidden_proto (__finite) +hidden_proto (__isinf) +hidden_proto (__isnan) +hidden_proto (__finitef) +hidden_proto (__isinff) +hidden_proto (__isnanf) + +# ifndef __NO_LONG_DOUBLE_MATH +hidden_proto (__finitel) +hidden_proto (__isinfl) +hidden_proto (__isnanl) +# endif +# endif -extern int __isinfl_internal (long double __value) - __attribute__ ((__const__)) attribute_hidden; -extern int __isnanl_internal (long double __value) - __attribute__ ((__const__)) attribute_hidden; -#endif +libm_hidden_proto (__fpclassify) +libm_hidden_proto (__fpclassifyf) -#if !defined NOT_IN_libc || defined IS_IN_libm -# undef isfinite -# ifdef __NO_LONG_DOUBLE_MATH -# define isfinite(x) \ - (sizeof (x) == sizeof (float) \ - ? INTUSE(__finitef) (x) : INTUSE(__finite) (x)) -# else -# define isfinite(x) \ - (sizeof (x) == sizeof (float) \ - ? INTUSE(__finitef) (x) \ - : sizeof (x) == sizeof (double) \ - ? INTUSE(__finite) (x) : INTUSE(__finitel) (x)) +# ifndef __NO_LONG_DOUBLE_MATH +libm_hidden_proto (__fpclassifyl) +libm_hidden_proto (__expm1l) # endif -#endif - #endif --- libc/include/fenv.h.jj 2001-01-02 14:17:32.000000000 +0100 +++ libc/include/fenv.h 2002-09-09 18:22:16.000000000 +0200 @@ -11,4 +11,7 @@ extern int __fegetenv (fenv_t *__envp); extern int __fesetenv (__const fenv_t *__envp); extern int __feupdateenv (__const fenv_t *__envp); +libm_hidden_proto (feraiseexcept) +libm_hidden_proto (fesetenv) + #endif --- libc/math/Makefile.jj 2002-07-23 10:05:39.000000000 +0200 +++ libc/math/Makefile 2002-09-09 16:57:26.000000000 +0200 @@ -57,7 +57,8 @@ libm-calls = e_acos e_acosh e_asin e_ata conj cimag creal cabs carg s_cexp s_csinh s_ccosh s_clog \ s_catan s_casin s_ccos s_csin s_ctan s_ctanh s_cacos \ s_casinh s_cacosh s_catanh s_csqrt s_cpow s_cproj s_clog10 \ - s_fma s_lrint s_llrint s_lround s_llround e_exp10 w_log2 + s_fma s_lrint s_llrint s_lround s_llround e_exp10 w_log2 \ + s_isinf s_isnan dbl-only-routines := branred doasin dosincos halfulp mpa mpatan2 \ mpatan mpexp mplog mpsqrt mptan sincos32 slowexp \ slowpow --- libc/stdio-common/printf_fp.c.jj 2002-08-03 11:09:34.000000000 +0200 +++ libc/stdio-common/printf_fp.c 2002-09-09 18:52:01.000000000 +0200 @@ -318,7 +318,7 @@ __printf_fp (FILE *fp, fpnum.ldbl = *(const long double *) args[0]; /* Check for special values: not a number or infinity. */ - if (INTUSE(__isnanl) (fpnum.ldbl)) + if (__isnanl (fpnum.ldbl)) { if (isupper (info->spec)) { @@ -332,7 +332,7 @@ __printf_fp (FILE *fp, } is_neg = 0; } - else if (INTUSE(__isinfl) (fpnum.ldbl)) + else if (__isinfl (fpnum.ldbl)) { if (isupper (info->spec)) { @@ -362,7 +362,7 @@ __printf_fp (FILE *fp, fpnum.dbl = *(const double *) args[0]; /* Check for special values: not a number or infinity. */ - if (INTUSE(__isnan) (fpnum.dbl)) + if (__isnan (fpnum.dbl)) { if (isupper (info->spec)) { @@ -376,7 +376,7 @@ __printf_fp (FILE *fp, } is_neg = 0; } - else if (INTUSE(__isinf) (fpnum.dbl)) + else if (__isinf (fpnum.dbl)) { if (isupper (info->spec)) { --- libc/stdio-common/printf_size.c.jj 2002-04-30 12:53:29.000000000 +0200 +++ libc/stdio-common/printf_size.c 2002-09-09 18:52:37.000000000 +0200 @@ -136,13 +136,13 @@ printf_size (FILE *fp, const struct prin fpnum.ldbl.d = *(const long double *) args[0]; /* Check for special values: not a number or infinity. */ - if (INTUSE(__isnanl) (fpnum.ldbl.d)) + if (__isnanl (fpnum.ldbl.d)) { special = "nan"; wspecial = L"nan"; negative = 0; } - else if (INTUSE(__isinfl) (fpnum.ldbl.d)) + else if (__isinfl (fpnum.ldbl.d)) { special = "inf"; wspecial = L"inf"; @@ -162,13 +162,13 @@ printf_size (FILE *fp, const struct prin fpnum.dbl.d = *(const double *) args[0]; /* Check for special values: not a number or infinity. */ - if (INTUSE(__isnan) (fpnum.dbl.d)) + if (__isnan (fpnum.dbl.d)) { special = "nan"; wspecial = L"nan"; negative = 0; } - else if (INTUSE(__isinf) (fpnum.dbl.d)) + else if (__isinf (fpnum.dbl.d)) { special = "inf"; wspecial = L"inf"; --- libc/sysdeps/alpha/fpu/fesetenv.c.jj 2001-08-23 18:49:20.000000000 +0200 +++ libc/sysdeps/alpha/fpu/fesetenv.c 2002-09-09 20:03:09.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1997,99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson , 1997 @@ -53,4 +53,5 @@ strong_alias (__fesetenv, __old_fesetenv compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1); #endif +libm_hidden_ver (__fesetenv, fesetenv) versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2); --- libc/sysdeps/alpha/fpu/fraiseexcpt.c.jj 2001-08-23 18:49:20.000000000 +0200 +++ libc/sysdeps/alpha/fpu/fraiseexcpt.c 2002-09-09 20:03:14.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 1997,98,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1997,98,99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson , 1997. @@ -44,4 +44,5 @@ strong_alias (__feraiseexcept, __old_fer compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); #endif +libm_hidden_ver (__feraiseexcept, feraiseexcept) versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); --- libc/sysdeps/arm/fpu/fesetenv.c.jj 2001-08-23 18:49:24.000000000 +0200 +++ libc/sysdeps/arm/fpu/fesetenv.c 2002-09-09 20:03:18.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1997,98,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1997,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 @@ -41,4 +41,5 @@ strong_alias (__fesetenv, __old_fesetenv compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1); #endif +libm_hidden_ver (__fesetenv, fesetenv) versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2); --- libc/sysdeps/arm/fpu/fraiseexcpt.c.jj 2001-08-23 18:49:24.000000000 +0200 +++ libc/sysdeps/arm/fpu/fraiseexcpt.c 2002-09-09 20:03:23.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 1997,98,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1997,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 @@ -40,4 +40,5 @@ strong_alias (__feraiseexcept, __old_fer compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); #endif +libm_hidden_ver (__feraiseexcept, feraiseexcept) versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); --- libc/sysdeps/generic/fesetenv.c.jj 2001-08-23 18:49:27.000000000 +0200 +++ libc/sysdeps/generic/fesetenv.c 2002-09-09 20:03:29.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -31,6 +31,7 @@ __fesetenv (const fenv_t *envp) strong_alias (__fesetenv, __old_fesetenv) compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1); #endif +libm_hidden_ver (__fesetenv, fesetenv) versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2); stub_warning (fesetenv) --- libc/sysdeps/generic/fraiseexcpt.c.jj 2001-08-23 18:49:27.000000000 +0200 +++ libc/sysdeps/generic/fraiseexcpt.c 2002-09-09 20:03:34.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -31,6 +31,7 @@ __feraiseexcept (int excepts) strong_alias (__feraiseexcept, __old_feraiseexcept) compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); #endif +libm_hidden_ver (__feraiseexcept, feraiseexcept) versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); stub_warning (feraiseexcept) --- libc/sysdeps/generic/s_expm1l.c.jj 1997-10-13 05:52:31.000000000 +0200 +++ libc/sysdeps/generic/s_expm1l.c 2002-09-09 18:16:36.000000000 +0200 @@ -9,6 +9,7 @@ __expm1l (long double x) __set_errno (ENOSYS); return 0.0; } +libm_hidden_def (__expm1l) weak_alias (__expm1l, expm1l) stub_warning (expm1l) --- libc/sysdeps/generic/s_ldexp.c.jj 2002-04-30 12:53:42.000000000 +0200 +++ libc/sysdeps/generic/s_ldexp.c 2002-09-09 18:49:50.000000000 +0200 @@ -25,9 +25,9 @@ static char rcsid[] = "$NetBSD: s_ldexp. double value; int exp; #endif { - if(!INTUSE(__finite)(value)||value==0.0) return value; + if(!__finite(value)||value==0.0) return value; value = __scalbn(value,exp); - if(!INTUSE(__finite)(value)||value==0.0) __set_errno (ERANGE); + if(!__finite(value)||value==0.0) __set_errno (ERANGE); return value; } weak_alias (__ldexp, ldexp) --- libc/sysdeps/generic/s_ldexpf.c.jj 2002-04-30 12:53:42.000000000 +0200 +++ libc/sysdeps/generic/s_ldexpf.c 2002-09-09 18:50:09.000000000 +0200 @@ -28,9 +28,9 @@ static char rcsid[] = "$NetBSD: s_ldexpf float value; int exp; #endif { - if(!INTUSE(__finitef)(value)||value==(float)0.0) return value; + if(!__finitef(value)||value==(float)0.0) return value; value = __scalbnf(value,exp); - if(!INTUSE(__finitef)(value)||value==(float)0.0) __set_errno (ERANGE); + if(!__finitef(value)||value==(float)0.0) __set_errno (ERANGE); return value; } INTDEF(__ldexpf) --- libc/sysdeps/generic/s_ldexpl.c.jj 2002-04-30 12:53:42.000000000 +0200 +++ libc/sysdeps/generic/s_ldexpl.c 2002-09-09 18:50:30.000000000 +0200 @@ -29,9 +29,9 @@ static char rcsid[] = "$NetBSD: $"; long double value; int exp; #endif { - if(!INTUSE(__finitel)(value)||value==0.0) return value; + if(!__finitel(value)||value==0.0) return value; value = __scalbnl(value,exp); - if(!INTUSE(__finitel)(value)||value==0.0) __set_errno (ERANGE); + if(!__finitel(value)||value==0.0) __set_errno (ERANGE); return value; } weak_alias (__ldexpl, ldexpl) --- libc/sysdeps/generic/printf_fphex.c.jj 2002-04-30 12:53:42.000000000 +0200 +++ libc/sysdeps/generic/printf_fphex.c 2002-09-09 18:51:25.000000000 +0200 @@ -170,7 +170,7 @@ __printf_fphex (FILE *fp, fpnum.ldbl.d = *(const long double *) args[0]; /* Check for special values: not a number or infinity. */ - if (INTUSE(__isnanl) (fpnum.ldbl.d)) + if (__isnanl (fpnum.ldbl.d)) { if (isupper (info->spec)) { @@ -186,7 +186,7 @@ __printf_fphex (FILE *fp, } else { - if (INTUSE(__isinfl) (fpnum.ldbl.d)) + if (__isinfl (fpnum.ldbl.d)) { if (isupper (info->spec)) { @@ -209,7 +209,7 @@ __printf_fphex (FILE *fp, fpnum.dbl.d = *(const double *) args[0]; /* Check for special values: not a number or infinity. */ - if (INTUSE(__isnan) (fpnum.dbl.d)) + if (__isnan (fpnum.dbl.d)) { if (isupper (info->spec)) { @@ -225,7 +225,7 @@ __printf_fphex (FILE *fp, } else { - if (INTUSE(__isinf) (fpnum.dbl.d)) + if (__isinf (fpnum.dbl.d)) { if (isupper (info->spec)) { --- libc/sysdeps/hppa/fpu/fesetenv.c.jj 2001-08-23 18:49:46.000000000 +0200 +++ libc/sysdeps/hppa/fpu/fesetenv.c 2002-09-09 20:03:47.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Huggins-Daines , 2000 Based on the m68k version by @@ -68,3 +68,4 @@ fesetenv (const fenv_t *envp) /* Success. */ return 0; } +libm_hidden_def (fesetenv) --- libc/sysdeps/hppa/fpu/fraiseexcpt.c.jj 2001-08-23 18:49:47.000000000 +0200 +++ libc/sysdeps/hppa/fpu/fraiseexcpt.c 2002-09-09 20:03:52.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Huggins-Daines @@ -88,3 +88,4 @@ feraiseexcept (int excepts) /* Success. */ return 0; } +libm_hidden_def (feraiseexcept) --- libc/sysdeps/i386/fpu/s_finite.S.jj 2002-04-30 12:53:50.000000000 +0200 +++ libc/sysdeps/i386/fpu/s_finite.S 2002-09-09 16:40:26.000000000 +0200 @@ -12,5 +12,6 @@ ENTRY(__finite) shrl $31, %eax ret END (__finite) -strong_alias(__finite, __finite_internal) weak_alias (__finite, finite) +hidden_def (__finite) + --- libc/sysdeps/i386/fpu/s_finitef.S.jj 2002-04-30 12:53:50.000000000 +0200 +++ libc/sysdeps/i386/fpu/s_finitef.S 2002-09-09 16:41:06.000000000 +0200 @@ -12,5 +12,5 @@ ENTRY(__finitef) shrl $31,%eax ret END (__finitef) -strong_alias(__finitef, __finitef_internal) weak_alias (__finitef, finitef) +hidden_def (__finitef) --- libc/sysdeps/i386/fpu/s_finitel.S.jj 2002-04-30 12:53:51.000000000 +0200 +++ libc/sysdeps/i386/fpu/s_finitel.S 2002-09-09 16:41:17.000000000 +0200 @@ -11,5 +11,5 @@ ENTRY(__finitel) shrl $31, %eax ret END (__finitel) -strong_alias(__finitel, __finitel_internal) weak_alias (__finitel, finitel) +hidden_def (__finitel) --- libc/sysdeps/i386/fpu/s_isinfl.c.jj 2002-04-30 12:53:51.000000000 +0200 +++ libc/sysdeps/i386/fpu/s_isinfl.c 2002-09-09 16:44:59.000000000 +0200 @@ -33,5 +33,5 @@ static char rcsid[] = "$NetBSD: $"; se &= 0x8000; return ~(lx >> 31) & (1 - (se >> 14)); } -INTDEF(__isinfl) +hidden_def (__isinfl) weak_alias (__isinfl, isinfl) --- libc/sysdeps/i386/fpu/s_isnanl.c.jj 2002-04-30 12:53:51.000000000 +0200 +++ libc/sysdeps/i386/fpu/s_isnanl.c 2002-09-09 16:45:09.000000000 +0200 @@ -44,5 +44,5 @@ static char rcsid[] = "$NetBSD: $"; se = 0xfffe - se; return (int)((u_int32_t)(se))>>16; } -INTDEF(__isnanl) +hidden_def (__isnanl) weak_alias (__isnanl, isnanl) --- libc/sysdeps/i386/fpu/s_fpclassifyl.c.jj 2001-08-23 18:49:50.000000000 +0200 +++ libc/sysdeps/i386/fpu/s_fpclassifyl.c 2002-09-09 20:04:01.000000000 +0200 @@ -1,5 +1,5 @@ /* Return classification value corresponding to argument. - Copyright (C) 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -40,3 +40,4 @@ __fpclassifyl (long double x) return retval; } +libm_hidden_def (__fpclassifyl) --- libc/sysdeps/i386/fpu/fesetenv.c.jj 2001-08-23 18:49:49.000000000 +0200 +++ libc/sysdeps/i386/fpu/fesetenv.c 2002-09-09 20:04:07.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1997,98,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1997,98,99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -84,4 +84,5 @@ strong_alias (__fesetenv, __old_fesetenv compat_symbol (libm, BP_SYM (__old_fesetenv), BP_SYM (fesetenv), GLIBC_2_1); #endif +libm_hidden_ver (__fesetenv, fesetenv) versioned_symbol (libm, BP_SYM (__fesetenv), BP_SYM (fesetenv), GLIBC_2_2); --- libc/sysdeps/i386/fpu/s_expm1l.S.jj 2001-08-23 18:49:50.000000000 +0200 +++ libc/sysdeps/i386/fpu/s_expm1l.S 2002-09-09 20:04:11.000000000 +0200 @@ -1,5 +1,5 @@ /* ix87 specific implementation of exp(x)-1. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. Based on code by John C. Bowman . @@ -85,4 +85,5 @@ ENTRY(__expm1l) fldl MO(minus1) // Set result to -1.0. 3: ret END(__expm1l) +libm_hidden_def (__expm1l) weak_alias (__expm1l, expm1l) --- libc/sysdeps/i386/fpu/fraiseexcpt.c.jj 2001-08-23 18:49:49.000000000 +0200 +++ libc/sysdeps/i386/fpu/fraiseexcpt.c 2002-09-09 20:04:16.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1997,99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -120,4 +120,5 @@ strong_alias (__feraiseexcept, __old_fer compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); #endif +libm_hidden_ver (__feraiseexcept, feraiseexcept) versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); --- libc/sysdeps/ieee754/dbl-64/s_finite.c.jj 2002-04-30 12:54:01.000000000 +0200 +++ libc/sysdeps/ieee754/dbl-64/s_finite.c 2002-09-09 16:52:15.000000000 +0200 @@ -22,8 +22,6 @@ static char rcsid[] = "$NetBSD: s_finite #include "math.h" #include "math_private.h" -#undef __finite - #ifdef __STDC__ int __finite(double x) #else @@ -35,7 +33,7 @@ static char rcsid[] = "$NetBSD: s_finite GET_HIGH_WORD(hx,x); return (int)((u_int32_t)((hx&0x7fffffff)-0x7ff00000)>>31); } -INTDEF(__finite) +hidden_def (__finite) weak_alias (__finite, finite) #ifdef NO_LONG_DOUBLE strong_alias (__finite, __finitel) --- libc/sysdeps/ieee754/dbl-64/s_isinf.c.jj 2002-04-30 12:54:01.000000000 +0200 +++ libc/sysdeps/ieee754/dbl-64/s_isinf.c 2002-09-09 16:52:39.000000000 +0200 @@ -25,10 +25,9 @@ __isinf (double x) lx |= -lx; return ~(lx >> 31) & (hx >> 30); } -INTDEF(__isinf) +hidden_def (__isinf) weak_alias (__isinf, isinf) #ifdef NO_LONG_DOUBLE strong_alias (__isinf, __isinfl) -INTDEF(__isinfl) weak_alias (__isinf, isinfl) #endif --- libc/sysdeps/ieee754/dbl-64/s_isnan.c.jj 2002-04-30 12:54:01.000000000 +0200 +++ libc/sysdeps/ieee754/dbl-64/s_isnan.c 2002-09-09 16:53:04.000000000 +0200 @@ -36,10 +36,9 @@ static char rcsid[] = "$NetBSD: s_isnan. hx = 0x7ff00000 - hx; return (int)(((u_int32_t)hx)>>31); } -INTDEF(__isnan) +hidden_def (__isnan) weak_alias (__isnan, isnan) #ifdef NO_LONG_DOUBLE strong_alias (__isnan, __isnanl) -INTDEF(__isnanl) weak_alias (__isnan, isnanl) #endif --- libc/sysdeps/ieee754/dbl-64/s_fpclassify.c.jj 2001-08-23 18:49:54.000000000 +0200 +++ libc/sysdeps/ieee754/dbl-64/s_fpclassify.c 2002-09-09 20:04:23.000000000 +0200 @@ -1,5 +1,5 @@ /* Return classification value corresponding to argument. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -41,3 +41,4 @@ __fpclassify (double x) return retval; } +libm_hidden_def (__fpclassify) --- libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c.jj 2001-03-16 10:01:25.000000000 +0100 +++ libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c 2002-09-09 18:09:31.000000000 +0200 @@ -175,7 +175,7 @@ static double zero= 0.00000000000000000 GET_HIGH_WORD(ix,x); ix &= 0x7fffffff; - if(ix<0x3fd00000) return sin(pi*x); + if(ix<0x3fd00000) return __sin(pi*x); y = -x; /* x is assume negative */ /* @@ -199,14 +199,14 @@ static double zero= 0.00000000000000000 } } switch (n) { - case 0: y = sin(pi*y); break; + case 0: y = __sin(pi*y); break; case 1: - case 2: y = cos(pi*(0.5-y)); break; + case 2: y = __cos(pi*(0.5-y)); break; case 3: - case 4: y = sin(pi*(one-y)); break; + case 4: y = __sin(pi*(one-y)); break; case 5: - case 6: y = -cos(pi*(y-1.5)); break; - default: y = sin(pi*(y-2.0)); break; + case 6: y = -__cos(pi*(y-1.5)); break; + default: y = __sin(pi*(y-2.0)); break; } return -y; } --- libc/sysdeps/ieee754/flt-32/s_finitef.c.jj 2002-04-30 12:54:07.000000000 +0200 +++ libc/sysdeps/ieee754/flt-32/s_finitef.c 2002-09-09 16:53:25.000000000 +0200 @@ -25,8 +25,6 @@ static char rcsid[] = "$NetBSD: s_finite #include "math.h" #include "math_private.h" -#undef __finitef - #ifdef __STDC__ int __finitef(float x) #else @@ -38,5 +36,5 @@ static char rcsid[] = "$NetBSD: s_finite GET_FLOAT_WORD(ix,x); return (int)((u_int32_t)((ix&0x7fffffff)-0x7f800000)>>31); } -INTDEF(__finitef) +hidden_def (__finitef) weak_alias (__finitef, finitef) --- libc/sysdeps/ieee754/flt-32/s_isinff.c.jj 2002-04-30 12:54:07.000000000 +0200 +++ libc/sysdeps/ieee754/flt-32/s_isinff.c 2002-09-09 16:53:40.000000000 +0200 @@ -25,5 +25,5 @@ __isinff (float x) t |= -t; return ~(t >> 31) & (ix >> 30); } -INTDEF(__isinff) +hidden_def (__isinff) weak_alias (__isinff, isinff) --- libc/sysdeps/ieee754/flt-32/s_isnanf.c.jj 2002-04-30 12:54:07.000000000 +0200 +++ libc/sysdeps/ieee754/flt-32/s_isnanf.c 2002-09-09 16:53:51.000000000 +0200 @@ -38,5 +38,5 @@ static char rcsid[] = "$NetBSD: s_isnanf ix = 0x7f800000 - ix; return (int)(((u_int32_t)(ix))>>31); } -INTDEF(__isnanf) +hidden_def (__isnanf) weak_alias (__isnanf, isnanf) --- libc/sysdeps/ieee754/flt-32/s_fpclassifyf.c.jj 2001-08-23 18:49:54.000000000 +0200 +++ libc/sysdeps/ieee754/flt-32/s_fpclassifyf.c 2002-09-09 20:04:31.000000000 +0200 @@ -1,5 +1,5 @@ /* Return classification value corresponding to argument. - Copyright (C) 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -40,3 +40,4 @@ __fpclassifyf (float x) return retval; } +libm_hidden_def (__fpclassifyf) --- libc/sysdeps/ieee754/ldbl-128/s_finitel.c.jj 2002-04-30 12:54:07.000000000 +0200 +++ libc/sysdeps/ieee754/ldbl-128/s_finitel.c 2002-09-09 16:54:10.000000000 +0200 @@ -25,8 +25,6 @@ static char rcsid[] = "$NetBSD: $"; #include "math.h" #include "math_private.h" -#undef __finitel - #ifdef __STDC__ int __finitel(long double x) #else @@ -39,5 +37,5 @@ static char rcsid[] = "$NetBSD: $"; return (int)((u_int64_t)((hx&0x7fffffffffffffffLL) -0x7fff000000000000LL)>>63); } -INTDEF(__finitel) +hidden_def (__finitel) weak_alias (__finitel, finitel) --- libc/sysdeps/ieee754/ldbl-128/s_isinfl.c.jj 2002-04-30 12:54:07.000000000 +0200 +++ libc/sysdeps/ieee754/ldbl-128/s_isinfl.c 2002-09-09 16:54:25.000000000 +0200 @@ -25,5 +25,5 @@ __isinfl (long double x) lx |= -lx; return ~(lx >> 63) & (hx >> 62); } -INTDEF(__isinfl) +hidden_def (__isinfl) weak_alias (__isinfl, isinfl) --- libc/sysdeps/ieee754/ldbl-128/s_isnanl.c.jj 2002-04-30 12:54:07.000000000 +0200 +++ libc/sysdeps/ieee754/ldbl-128/s_isnanl.c 2002-09-09 16:54:33.000000000 +0200 @@ -39,5 +39,5 @@ static char rcsid[] = "$NetBSD: $"; hx = 0x7fff000000000000LL - hx; return (int)((u_int64_t)hx>>63); } -INTDEF(__isnanl) +hidden_def (__isnanl) weak_alias (__isnanl, isnanl) --- libc/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c.jj 2001-08-23 18:49:59.000000000 +0200 +++ libc/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c 2002-09-09 20:04:41.000000000 +0200 @@ -1,5 +1,5 @@ /* Return classification value corresponding to argument. - Copyright (C) 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997 and Jakub Jelinek , 1999. @@ -42,3 +42,4 @@ __fpclassifyl (long double x) return retval; } +libm_hidden_def (__fpclassifyl) --- libc/sysdeps/ieee754/ldbl-128/s_expm1l.c.jj 2002-08-27 23:19:52.000000000 +0200 +++ libc/sysdeps/ieee754/ldbl-128/s_expm1l.c 2002-09-09 18:17:11.000000000 +0200 @@ -157,5 +157,5 @@ __expm1l (long double x) x = px * qx + (px - 1.0); return x; } - +libm_hidden_def (__expm1l) weak_alias (__expm1l, expm1l) --- libc/sysdeps/ieee754/ldbl-96/s_finitel.c.jj 2002-04-30 12:54:07.000000000 +0200 +++ libc/sysdeps/ieee754/ldbl-96/s_finitel.c 2002-09-09 16:54:54.000000000 +0200 @@ -26,8 +26,6 @@ static char rcsid[] = "$NetBSD: $"; #include "math.h" #include "math_private.h" -#undef __finitel - #ifdef __STDC__ int __finitel(long double x) #else @@ -39,5 +37,5 @@ static char rcsid[] = "$NetBSD: $"; GET_LDOUBLE_EXP(exp,x); return (int)((u_int32_t)((exp&0x7fff)-0x7fff)>>31); } -INTDEF(__finitel) +hidden_def (__finitel) weak_alias (__finitel, finitel) --- libc/sysdeps/ieee754/ldbl-96/s_isinfl.c.jj 2002-04-30 12:54:07.000000000 +0200 +++ libc/sysdeps/ieee754/ldbl-96/s_isinfl.c 2002-09-09 16:55:04.000000000 +0200 @@ -26,5 +26,5 @@ __isinfl (long double x) se &= 0x8000; return ~(lx >> 31) & (1 - (se >> 14)); } -INTDEF(__isinfl) +hidden_def (__isinfl) weak_alias (__isinfl, isinfl) --- libc/sysdeps/ieee754/ldbl-96/s_isnanl.c.jj 1999-07-14 02:14:00.000000000 +0200 +++ libc/sysdeps/ieee754/ldbl-96/s_isnanl.c 2002-09-09 16:55:26.000000000 +0200 @@ -41,4 +41,5 @@ static char rcsid[] = "$NetBSD: $"; se = 0xfffe - se; return (int)(((u_int32_t)(se))>>31); } +hidden_def (__isnanl) weak_alias (__isnanl, isnanl) --- libc/sysdeps/ieee754/ldbl-96/s_fpclassifyl.c.jj 2001-08-23 18:49:59.000000000 +0200 +++ libc/sysdeps/ieee754/ldbl-96/s_fpclassifyl.c 2002-09-09 20:04:53.000000000 +0200 @@ -1,5 +1,5 @@ /* Return classification value corresponding to argument. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. Fixed by Andreas Schwab . @@ -42,3 +42,4 @@ __fpclassifyl (long double x) return retval; } +libm_hidden_def (__fpclassifyl) --- libc/sysdeps/ia64/fpu/s_finite.S.jj 2002-04-30 12:53:57.000000000 +0200 +++ libc/sysdeps/ia64/fpu/s_finite.S 2002-09-09 20:04:58.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,12 +33,13 @@ ENTRY (__finite) } END (__finite) -strong_alias (__finite, __finite_internal) strong_alias (__finite, __finitef) -strong_alias (__finitef, __finitef_internal) strong_alias (__finite, __finitel) -strong_alias (__finitel, __finitel_internal) weak_alias (__finite, finite) weak_alias (__finitef, finitef) weak_alias (__finitel, finitel) + +hidden_def (__finite) +hidden_def (__finitef) +hidden_def (__finitel) --- libc/sysdeps/ia64/fpu/s_isnan.S.jj 2002-04-30 12:53:58.000000000 +0200 +++ libc/sysdeps/ia64/fpu/s_isnan.S 2002-09-09 16:46:18.000000000 +0200 @@ -39,12 +39,13 @@ ENTRY (__isnan) } END (__isnan) -strong_alias (__isnan, __isnan_internal) strong_alias (__isnan, __isnanf) -strong_alias (__isnanf, __isnanf_internal) strong_alias (__isnan, __isnanl) -strong_alias (__isnanl, __isnanl_internal) weak_alias (__isnan, isnan) weak_alias (__isnanf, isnanf) weak_alias (__isnanl, isnanl) + +hidden_def (__isnan) +hidden_def (__isnanf) +hidden_def (__isnanl) --- libc/sysdeps/ia64/fpu/s_isinf.S.jj 2002-04-30 12:53:58.000000000 +0200 +++ libc/sysdeps/ia64/fpu/s_isinf.S 2002-09-09 16:47:13.000000000 +0200 @@ -46,12 +46,13 @@ ENTRY (__isinf) } END (__isinf) -strong_alias (__isinf, __isinf_internal) strong_alias (__isinf, __isinff) -strong_alias (__isinff, __isinff_internal) strong_alias (__isinf, __isinfl) -strong_alias (__isinfl, __isinfl_internal) weak_alias (__isinf, isinf) weak_alias (__isinff, isinff) weak_alias (__isinfl, isinfl) + +hidden_def (__isinf) +hidden_def (__isinff) +hidden_def (__isinfl) --- libc/sysdeps/ia64/fpu/s_fpclassify.S.jj 2001-08-20 13:27:51.000000000 +0200 +++ libc/sysdeps/ia64/fpu/s_fpclassify.S 2002-09-09 20:05:07.000000000 +0200 @@ -1,5 +1,5 @@ /* Return classification value corresponding to argument. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -57,3 +57,6 @@ END (__fpclassify) strong_alias (__fpclassify, __fpclassifyf) strong_alias (__fpclassify, __fpclassifyl) +libm_hidden_def (__fpclassify) +libm_hidden_def (__fpclassifyf) +libm_hidden_def (__fpclassifyl) --- libc/sysdeps/ia64/fpu/fesetenv.c.jj 2001-08-20 13:27:51.000000000 +0200 +++ libc/sysdeps/ia64/fpu/fesetenv.c 2002-09-09 20:05:14.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jes Sorensen , 2000 @@ -39,3 +39,4 @@ fesetenv (const fenv_t *envp) return 0; } +libm_hidden_def (fesetenv) --- libc/sysdeps/ia64/fpu/fraiseexcpt.c.jj 2001-08-20 13:27:51.000000000 +0200 +++ libc/sysdeps/ia64/fpu/fraiseexcpt.c 2002-09-09 20:05:20.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jes Sorensen , 2000. @@ -77,3 +77,4 @@ feraiseexcept (int excepts) /* Success. */ return 0; } +libm_hidden_def (feraiseexcept) --- libc/sysdeps/ia64/fpu/s_expm1l.S.jj 2002-07-23 10:05:57.000000000 +0200 +++ libc/sysdeps/ia64/fpu/s_expm1l.S 2002-09-09 18:19:55.000000000 +0200 @@ -565,6 +565,10 @@ alloc r32 = ar.pfs,0,30,4,0 .endp expm1l ASM_SIZE_DIRECTIVE(expm1l) +#ifdef _LIBC +libm_hidden_def (__expm1l) +#endif + .section .text .proc expl# .global expl# --- libc/sysdeps/m68k/s_isinfl.c.jj 2002-04-30 12:54:07.000000000 +0200 +++ libc/sysdeps/m68k/s_isinfl.c 2002-09-09 16:48:36.000000000 +0200 @@ -19,10 +19,6 @@ #include #include "ieee754.h" -#undef __isinfl -#undef isinfl - - /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ int @@ -42,5 +38,5 @@ __isinfl (long double value) return 0; } -INTDEF(__isinfl) +hidden_def (__isinfl) weak_alias (__isinfl, isinfl); --- libc/sysdeps/m68k/fpu/s_isinf.c.jj 2002-06-21 11:39:49.000000000 +0200 +++ libc/sysdeps/m68k/fpu/s_isinf.c 2002-09-09 16:50:12.000000000 +0200 @@ -34,7 +34,7 @@ __CONCATX(__,FUNC) (x) return __m81_u(__CONCATX(__,FUNC))(x); } -#define INTDEFX(a) INTDEF(a) -INTDEFX(__CONCATX(__,FUNC)) +#define hidden_defx(a) hidden_def(a) +hidden_defx(__CONCATX(__,FUNC)) #define weak_aliasx(a,b) weak_alias(a,b) weak_aliasx (__CONCATX(__,FUNC), FUNC) --- libc/sysdeps/m68k/fpu/s_fpclassifyl.c.jj 2001-08-23 18:49:59.000000000 +0200 +++ libc/sysdeps/m68k/fpu/s_fpclassifyl.c 2002-09-09 20:05:33.000000000 +0200 @@ -1,5 +1,5 @@ /* Return classification value corresponding to argument. m68k version. - Copyright (C) 1997,2001 Free Software Foundation, Inc. + Copyright (C) 1997, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. Fixed for m68k by Andreas Schwab . @@ -41,3 +41,4 @@ __fpclassifyl (long double x) return retval; } +libm_hidden_def (__fpclassifyl) --- libc/sysdeps/m68k/fpu/fesetenv.c.jj 2001-08-23 18:49:59.000000000 +0200 +++ libc/sysdeps/m68k/fpu/fesetenv.c 2002-09-09 20:05:37.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1997,99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab @@ -56,4 +56,5 @@ strong_alias (__fesetenv, __old_fesetenv compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1); #endif +libm_hidden_ver (__fesetenv, fesetenv) versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2); --- libc/sysdeps/m68k/fpu/fraiseexcpt.c.jj 2001-08-23 18:49:59.000000000 +0200 +++ libc/sysdeps/m68k/fpu/fraiseexcpt.c 2002-09-09 20:05:41.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1997,99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab @@ -79,4 +79,5 @@ strong_alias (__feraiseexcept, __old_fer compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); #endif +libm_hidden_ver (__feraiseexcept, feraiseexcept) versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); --- libc/sysdeps/m68k/fpu/s_expm1l.c.jj 1996-06-06 07:22:24.000000000 +0200 +++ libc/sysdeps/m68k/fpu/s_expm1l.c 2002-09-09 18:20:18.000000000 +0200 @@ -1,2 +1,3 @@ #define FUNC expm1l #include +libm_hidden_def (__expm1l) --- libc/sysdeps/m68k/s_isnanl.c.jj 2001-08-23 18:49:59.000000000 +0200 +++ libc/sysdeps/m68k/s_isnanl.c 2002-09-09 20:05:49.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,10 +19,6 @@ #include #include "ieee754.h" -#undef __isnanl -#undef isnanl - - /* Return nonzero if VALUE is not a number. */ int __isnanl (long double value) @@ -38,4 +34,5 @@ __isnanl (long double value) ((u.ieee.mantissa0 & 0x7fffffff) != 0 || u.ieee.mantissa1 != 0)); } +hidden_def (__isnanl) weak_alias (__isnanl, isnanl); --- libc/sysdeps/mips/fpu/fesetenv.c.jj 2001-08-23 18:50:11.000000000 +0200 +++ libc/sysdeps/mips/fpu/fesetenv.c 2002-09-09 20:05:55.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1998. @@ -45,4 +45,5 @@ __fesetenv (const fenv_t *envp) strong_alias (__fesetenv, __old_fesetenv) compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1); #endif +libm_hidden_ver (__fesetenv, fesetenv) versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2); --- libc/sysdeps/mips/fpu/fraiseexcpt.c.jj 2002-03-23 11:52:39.000000000 +0100 +++ libc/sysdeps/mips/fpu/fraiseexcpt.c 2002-09-09 17:51:55.000000000 +0200 @@ -49,4 +49,5 @@ __feraiseexcept (int excepts) strong_alias (__feraiseexcept, __old_feraiseexcept) compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); #endif +libm_hidden_ver (__feraiseexcept, feraiseexcept) versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); --- libc/sysdeps/powerpc/fpu/s_isnan.c.jj 2002-04-30 12:55:33.000000000 +0200 +++ libc/sysdeps/powerpc/fpu/s_isnan.c 2002-09-09 17:04:48.000000000 +0200 @@ -36,19 +36,16 @@ __isnan (x) fesetenv_register (savedstate); return result; } -INTDEF(__isnan) +hidden_def (__isnan) weak_alias (__isnan, isnan) /* It turns out that the 'double' version will also always work for single-precision. */ -#undef __isnanf -#undef isnanf strong_alias (__isnan, __isnanf) -INTDEF(__isnanf) +hidden_def (__isnanf) weak_alias (__isnanf, isnanf) #ifdef NO_LONG_DOUBLE strong_alias (__isnan, __isnanl) -INTDEF(__isnanl) weak_alias (__isnan, isnanl) #endif --- libc/sysdeps/powerpc/fpu/fesetenv.c.jj 2001-08-23 18:50:14.000000000 +0200 +++ libc/sysdeps/powerpc/fpu/fesetenv.c 2002-09-09 20:06:03.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1997,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 @@ -35,4 +35,5 @@ strong_alias (__fesetenv, __old_fesetenv compat_symbol (libm, BP_SYM (__old_fesetenv), BP_SYM (fesetenv), GLIBC_2_1); #endif +libm_hidden_ver (__fesetenv, fesetenv) versioned_symbol (libm, BP_SYM (__fesetenv), BP_SYM (fesetenv), GLIBC_2_2); --- libc/sysdeps/powerpc/fpu/fraiseexcpt.c.jj 2001-08-23 18:50:14.000000000 +0200 +++ libc/sysdeps/powerpc/fpu/fraiseexcpt.c 2002-09-09 20:06:07.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1997,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 @@ -62,4 +62,5 @@ strong_alias (__feraiseexcept, __old_fer compat_symbol (libm, BP_SYM (__old_feraiseexcept), BP_SYM (feraiseexcept), GLIBC_2_1); #endif +libm_hidden_ver (__feraiseexcept, feraiseexcept) versioned_symbol (libm, BP_SYM (__feraiseexcept), BP_SYM (feraiseexcept), GLIBC_2_2); --- libc/sysdeps/sparc/fpu/fesetenv.c.jj 2001-08-23 18:50:19.000000000 +0200 +++ libc/sysdeps/sparc/fpu/fesetenv.c 2002-09-09 20:06:13.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -51,4 +51,5 @@ strong_alias (__fesetenv, __old_fesetenv compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1); #endif +libm_hidden_ver (__fesetenv, fesetenv) versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2); --- libc/sysdeps/sparc/fpu/fraiseexcpt.c.jj 2001-08-23 18:50:19.000000000 +0200 +++ libc/sysdeps/sparc/fpu/fraiseexcpt.c 2002-09-09 20:06:18.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -67,4 +67,5 @@ strong_alias (__feraiseexcept, __old_fer compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); #endif +libm_hidden_ver (__feraiseexcept, feraiseexcept) versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); --- libc/sysdeps/sh/sh4/fpu/fesetenv.c.jj 2001-08-23 18:50:19.000000000 +0200 +++ libc/sysdeps/sh/sh4/fpu/fesetenv.c 2002-09-09 20:06:23.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,3 +32,4 @@ fesetenv (const fenv_t *envp) } return 0; } +libm_hidden_def (fesetenv) --- libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c.jj 2001-08-23 18:50:19.000000000 +0200 +++ libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c 2002-09-09 20:06:28.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,3 +33,4 @@ feraiseexcept (int excepts) return 0; } +libm_hidden_def (feraiseexcept) --- libc/sysdeps/s390/fpu/fesetenv.c.jj 2001-08-23 18:50:16.000000000 +0200 +++ libc/sysdeps/s390/fpu/fesetenv.c 2002-09-09 20:06:32.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com). @@ -54,3 +54,4 @@ fesetenv (const fenv_t *envp) /* Success. */ return 0; } +libm_hidden_def (fesetenv) --- libc/sysdeps/s390/fpu/fraiseexcpt.c.jj 2001-08-23 18:50:16.000000000 +0200 +++ libc/sysdeps/s390/fpu/fraiseexcpt.c 2002-09-09 20:06:36.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com) and Martin Schwidefsky (schwidefsky@de.ibm.com). @@ -70,3 +70,4 @@ feraiseexcept (int excepts) /* Success. */ return 0; } +libm_hidden_def (feraiseexcept) --- libc/sysdeps/x86_64/fpu/s_finitel.S.jj 2002-07-06 17:07:10.000000000 +0200 +++ libc/sysdeps/x86_64/fpu/s_finitel.S 2002-09-09 16:47:46.000000000 +0200 @@ -12,5 +12,5 @@ ENTRY(__finitel) shrl $31, %eax ret END (__finitel) -strong_alias(__finitel, __finitel_internal) weak_alias (__finitel, finitel) +hidden_def (__finitel) --- libc/sysdeps/x86_64/fpu/fesetenv.c.jj 2001-09-19 12:23:17.000000000 +0200 +++ libc/sysdeps/x86_64/fpu/fesetenv.c 2002-09-09 20:06:43.000000000 +0200 @@ -1,5 +1,5 @@ /* Install given floating-point environment. - 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 @@ -87,3 +87,4 @@ fesetenv (const fenv_t *envp) /* Success. */ return 0; } +libm_hidden_def (fesetenv) --- libc/sysdeps/x86_64/fpu/fraiseexcpt.c.jj 2001-09-19 12:23:17.000000000 +0200 +++ libc/sysdeps/x86_64/fpu/fraiseexcpt.c 2002-09-09 20:06:47.000000000 +0200 @@ -1,5 +1,5 @@ /* Raise given exceptions. - 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 @@ -117,3 +117,4 @@ feraiseexcept (int excepts) /* Success. */ return 0; } +libm_hidden_def (feraiseexcept) --- libc/sysdeps/x86_64/fpu/s_expm1l.S.jj 2001-09-19 12:24:08.000000000 +0200 +++ libc/sysdeps/x86_64/fpu/s_expm1l.S 2002-09-09 20:06:52.000000000 +0200 @@ -1,5 +1,5 @@ /* ix87 specific implementation of exp(x)-1. - Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. Based on code by John C. Bowman . @@ -80,4 +80,5 @@ ENTRY(__expm1l) fldl MO(minus1) // Set result to -1.0. 3: ret END(__expm1l) +libm_hidden_def (__expm1l) weak_alias (__expm1l, expm1l) Jakub From drepper@redhat.com Mon Sep 9 17:36:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 09 Sep 2002 17:36:00 -0000 Subject: [PATCH] Shut out some debugging messages for LD_DEBUG=statistics References: <20020909124803.G1013@sunsite.ms.mff.cuni.cz> Message-ID: <3D7D3D90.3060500@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > Even LD_DEBUG=statistics or LD_TRACE_PRELINKING causes lots of debugging > messages, which is pretty annoying (e.g. LD_DEBUG=statistics should really > only enable statistics and nothing else). I've applied the patch. Thanks, - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9fT2Q2ijCOnn/RHQRAp4EAKCiligjiRf+0e4PFYheMoiuNKOxwgCggI2j XnfAOspFjS4XTxvoA/WTrq8= =uLqn -----END PGP SIGNATURE----- From drepper@redhat.com Mon Sep 9 18:31:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 09 Sep 2002 18:31:00 -0000 Subject: [PATCH] Kill 18 .plt entries from libm.so References: <20020909210007.I1013@sunsite.ms.mff.cuni.cz> Message-ID: <3D7D4B2B.3090305@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > Hi! > > PLT slot reduction for libm: Thanks, I've applied the patch. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9fUsv2ijCOnn/RHQRAoC/AJ9FuLldQq/Zi5J99k1vyIYs+31IgwCglagX bNsv4lyAjnyHGp5TyAWu3vE= =pRhN -----END PGP SIGNATURE----- From jakub@redhat.com Wed Sep 11 14:54:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 11 Sep 2002 14:54:00 -0000 Subject: [PATCH] Fix dl-environ.c Message-ID: <20020911235402.S1013@sunsite.ms.mff.cuni.cz> Hi! ld.so has apparently been too aggressive when removing variables from environment, particularly it removed all the unsecure envvars (as it should) plus all its prefixes, ie. it removed LOCALDOMAIN, but e.g. LOCALDOMAI, LOCAL, LOCA, LO or L variables too. 2002-09-11 Jakub Jelinek * sysdeps/generic/dl-environ.c (unsetenv): Only remove variables fully matching name. --- libc/sysdeps/generic/dl-environ.c.jj 2002-03-23 11:51:04.000000000 +0100 +++ libc/sysdeps/generic/dl-environ.c 2002-09-11 22:53:42.000000000 +0200 @@ -67,7 +67,7 @@ unsetenv (const char *name) while ((*ep)[cnt] == name[cnt] && name[cnt] != '\0') ++cnt; - if ((*ep)[cnt] == '=') + if ((*ep)[cnt] == '=' && name[cnt] == '\0') { /* Found it. Remove this pointer by moving later ones to the front. */ Jakub From roland@redhat.com Wed Sep 11 15:04:00 2002 From: roland@redhat.com (Roland McGrath) Date: Wed, 11 Sep 2002 15:04:00 -0000 Subject: [PATCH] Fix dl-environ.c In-Reply-To: <20020911235402.S1013@sunsite.ms.mff.cuni.cz>; from jakub@redhat.com on Wed, Sep 11, 2002 at 11:54:02PM +0200 References: <20020911235402.S1013@sunsite.ms.mff.cuni.cz> Message-ID: <20020911150322.F15869@dhcp187.sf.frob.com> D'oh! I don't see why that should be avoiding normal string routines, so I instead just snarfed the loop from the vanilla unsetenv, which does the same but using strncmp. From drepper@redhat.com Wed Sep 11 15:10:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 11 Sep 2002 15:10:00 -0000 Subject: [PATCH] Fix dl-environ.c References: <20020911235402.S1013@sunsite.ms.mff.cuni.cz> <20020911150322.F15869@dhcp187.sf.frob.com> Message-ID: <3D7FBF5F.2000805@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roland McGrath wrote: > D'oh! I don't see why that should be avoiding normal string routines, > so I instead just snarfed the loop from the vanilla unsetenv, which > does the same but using strncmp. The reason it is not using srncmp is that this is the only use of strncmp in ld.so and it's not time-critical. For a simple-minded inline function is better. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9f79i2ijCOnn/RHQRAkNSAJ913GpulPx7seOjnVyMK5nwqAZ7zgCfV6aq wvhiwAbIwsMEAIQpzO0Qaxo= =e9I+ -----END PGP SIGNATURE----- From jakub@redhat.com Thu Sep 12 07:58:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 12 Sep 2002 07:58:00 -0000 Subject: [PATCH] sparcv9-linux fixes Message-ID: <20020912165820.V1013@sunsite.ms.mff.cuni.cz> Hi! 4 different things: 1) libc.so did not compile at all, because of undefined __divdi3_internal reference. Instead of requiring each port using sysdeps/wordsize-32 to add divdi3 manually into sysdep_routines, I think sysdeps/wordsize-32/Makefile should do it for all. 2) ld.so segfaulted on sparcv9 (and sparc64), because they have HP_TIMING, even HP_TIMING_INLINE, but due to lack of relocations even accesses to static variables in pic go through .got and need R_SPARC_RELATIVE adjustement (ie. !defined DONT_USE_BOOTSTRAP_MAP). I think it is better to do HP_TIMING_NOW ASAP even on these arches to an automatic variable and copy it to static variable later. 3) DaveM changed sparc64-linux specs file so that it hardcodes even /usr/lib/crt[in].o for -m32 link. Thus the ugly workaround has to be extended for sparc32 too. 4) and last ulps regeneration to make math tests happy With all this sparcv9-linux glibc compiles and passes make check with exception of tst-timer test rpm -q binutils gcc binutils-2.13.90.0.2-2 gcc-3.2-7.1 (the latter based on 20020903 checkout). 2002-09-12 Jakub Jelinek * elf/rtld.c (struct dl_start_final_info): New. (_dl_start_final): Change second argument to struct dl_start_final_info *. Set start_time from info. (_dl_start): Remove bootstrap_map variable, add info. Define bootstrap_map as macro. If not DONT_USE_BOOTSTRAP_MAP, store HP_TIMING_NOW result into info.start_time. * sysdeps/wordsize-32/Makefile: New file. * sysdeps/arm/Makefile: Removed. * sysdeps/i386/Makefile (sysdep_routines, shared-only-routines): Don't add divdi3 here. * sysdeps/m68k/Makefile: Likewise. * sysdeps/powerpc/powerpc32/Makefile: Likewise. * sysdeps/sh/Makefile: Likewise. * sysdeps/s390/s390-32/Makefile: Likewise. * sysdeps/sparc/sparc32/fpu/libm-test-ulps: Regenerate. linuxthreads/ * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Move... * sysdeps/unix/sysv/linux/sparc/Makefile: ...here. Replace /usr/lib/crt[in].o with crt[in].o too. --- libc/elf/rtld.c.jj Thu Sep 12 02:54:46 2002 +++ libc/elf/rtld.c Thu Sep 12 10:12:40 2002 @@ -146,8 +146,15 @@ TLS_INIT_HELPER #ifdef DONT_USE_BOOTSTRAP_MAP static ElfW(Addr) _dl_start_final (void *arg); #else +struct dl_start_final_info +{ + struct link_map l; +#if !defined HP_TIMING_NONAVAIL && HP_TIMING_INLINE + hp_timing_t start_time; +#endif +}; static ElfW(Addr) _dl_start_final (void *arg, - struct link_map *bootstrap_map_p); + struct dl_start_final_info *info); #endif #ifdef RTLD_START @@ -176,7 +183,7 @@ static inline ElfW(Addr) __attribute__ ( _dl_start_final (void *arg) #else static ElfW(Addr) __attribute__ ((noinline)) -_dl_start_final (void *arg, struct link_map *bootstrap_map_p) +_dl_start_final (void *arg, struct dl_start_final_info *info) #endif { ElfW(Addr) start_addr; @@ -188,6 +195,10 @@ _dl_start_final (void *arg, struct link_ /* If it hasn't happen yet record the startup time. */ if (! HP_TIMING_INLINE) HP_TIMING_NOW (start_time); +#ifndef DONT_USE_BOOTSTRAP_MAP + else + start_time = info->start_time; +#endif /* Initialize the timing functions. */ HP_TIMING_DIFF_INIT (); @@ -195,11 +206,11 @@ _dl_start_final (void *arg, struct link_ /* Transfer data about ourselves to the permanent link_map structure. */ #ifndef DONT_USE_BOOTSTRAP_MAP - GL(dl_rtld_map).l_addr = bootstrap_map_p->l_addr; - GL(dl_rtld_map).l_ld = bootstrap_map_p->l_ld; - memcpy (GL(dl_rtld_map).l_info, bootstrap_map_p->l_info, + GL(dl_rtld_map).l_addr = info->l.l_addr; + GL(dl_rtld_map).l_ld = info->l.l_ld; + memcpy (GL(dl_rtld_map).l_info, info->l.l_info, sizeof GL(dl_rtld_map).l_info); - GL(dl_rtld_map).l_mach = bootstrap_map_p->l_mach; + GL(dl_rtld_map).l_mach = info->l.l_mach; #endif _dl_setup_hash (&GL(dl_rtld_map)); GL(dl_rtld_map).l_opencount = 1; @@ -208,20 +219,19 @@ _dl_start_final (void *arg, struct link_ /* Copy the TLS related data if necessary. */ #if USE_TLS && !defined DONT_USE_BOOTSTRAP_MAP # ifdef HAVE___THREAD - assert (bootstrap_map_p->l_tls_modid != 0); + assert (info->l.l_tls_modid != 0); # else - if (bootstrap_map_p->l_tls_modid != 0) + if (info->l.l_tls_modid != 0) # endif { - GL(dl_rtld_map).l_tls_blocksize = bootstrap_map_p->l_tls_blocksize; - GL(dl_rtld_map).l_tls_align = bootstrap_map_p->l_tls_align; - GL(dl_rtld_map).l_tls_initimage_size - = bootstrap_map_p->l_tls_initimage_size; - GL(dl_rtld_map).l_tls_initimage = bootstrap_map_p->l_tls_initimage; - GL(dl_rtld_map).l_tls_offset = bootstrap_map_p->l_tls_offset; + GL(dl_rtld_map).l_tls_blocksize = info->l.l_tls_blocksize; + GL(dl_rtld_map).l_tls_align = info->l.l_tls_align; + GL(dl_rtld_map).l_tls_initimage_size = info->l.l_tls_initimage_size; + GL(dl_rtld_map).l_tls_initimage = info->l.l_tls_initimage; + GL(dl_rtld_map).l_tls_offset = info->l.l_tls_offset; GL(dl_rtld_map).l_tls_modid = 1; GL(dl_rtld_map).l_tls_tp_initialized - = bootstrap_map_p->l_tls_tp_initialized; + = info->l.l_tls_tp_initialized; } #endif @@ -260,7 +270,8 @@ _dl_start (void *arg) #ifdef DONT_USE_BOOTSTRAP_MAP # define bootstrap_map GL(dl_rtld_map) #else - struct link_map bootstrap_map; + struct dl_start_final_info info; +# define bootstrap_map info.l #endif #if !defined HAVE_BUILTIN_MEMSET || defined USE_TLS size_t cnt; @@ -281,7 +292,11 @@ _dl_start (void *arg) #include "dynamic-link.h" if (HP_TIMING_INLINE && HP_TIMING_AVAIL) +#ifdef DONT_USE_BOOTSTRAP_MAP HP_TIMING_NOW (start_time); +#else + HP_TIMING_NOW (info.start_time); +#endif /* Partly clean the `bootstrap_map' structure up. Don't use `memset' since it might not be built in or inlined and we cannot @@ -439,7 +454,7 @@ _dl_start (void *arg) #ifdef DONT_USE_BOOTSTRAP_MAP ElfW(Addr) entry = _dl_start_final (arg); #else - ElfW(Addr) entry = _dl_start_final (arg, &bootstrap_map); + ElfW(Addr) entry = _dl_start_final (arg, &info); #endif #ifndef ELF_MACHINE_START_ADDRESS --- libc/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile.jj Wed Apr 25 06:39:42 2001 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile Thu Sep 12 13:01:55 2002 @@ -1,9 +0,0 @@ -ifeq ($(subdir),linuxthreads) -# gcc -m64 has /usr/lib64/crti.o hardcoded in the specs file, because otherwise -# it would normally find 32bit crti.o. -LDFLAGS-pthread.so += -specs=$(objpfx)specs -before-compile += $(objpfx)specs -generated += specs -$(objpfx)specs: - $(CC) $(CFLAGS) $(CPPFLAGS) -dumpspecs | sed 's_/usr/lib64/crti.o_crti.o_g' > $@ -endif --- libc/linuxthreads/sysdeps/unix/sysv/linux/sparc/Makefile.jj Thu Sep 12 13:01:59 2002 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/sparc/Makefile Thu Sep 12 13:03:20 2002 @@ -0,0 +1,10 @@ +ifeq ($(subdir),linuxthreads) +# gcc has /usr/lib{,64}/crti.o hardcoded in the specs file, because otherwise +# it would normally find {64,32}bit crt[in].o. +LDFLAGS-pthread.so += -specs=$(objpfx)specs +before-compile += $(objpfx)specs +generated += specs +$(objpfx)specs: + $(CC) $(CFLAGS) $(CPPFLAGS) -dumpspecs \ + | sed 's,/usr/lib\(\|64\)/\(crt[in]\.o\),\2,g' > $@ +endif --- libc/sysdeps/arm/Makefile.jj Mon Aug 12 15:36:38 2002 +++ libc/sysdeps/arm/Makefile Thu Sep 12 08:40:32 2002 @@ -1,7 +0,0 @@ -ifeq ($(subdir),csu) -ifeq (yes,$(build-shared)) -# Compatibility -sysdep_routines += divdi3 -shared-only-routines += divdi3 -endif -endif --- libc/sysdeps/i386/Makefile.jj Sat Mar 23 05:51:15 2002 +++ libc/sysdeps/i386/Makefile Thu Sep 12 08:40:19 2002 @@ -9,12 +9,6 @@ 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 Sat Mar 23 05:51:45 2002 +++ libc/sysdeps/m68k/Makefile Thu Sep 12 08:41:27 2002 @@ -33,14 +33,6 @@ 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/powerpc/powerpc32/Makefile.jj Thu Sep 5 05:49:38 2002 +++ libc/sysdeps/powerpc/powerpc32/Makefile Thu Sep 12 08:45:16 2002 @@ -37,8 +37,8 @@ ifeq (yes,$(have-protected)) CPPFLAGS-divdi3.c = -DHAVE_DOT_HIDDEN CPPFLAGS-libgcc-compat.S = -DHAVE_DOT_HIDDEN endif -sysdep_routines += divdi3 libgcc-compat -shared-only-routines += divdi3 libgcc-compat +sysdep_routines += libgcc-compat +shared-only-routines += libgcc-compat endif endif --- libc/sysdeps/sparc/sparc32/fpu/libm-test-ulps.jj Mon Oct 1 06:18:57 2001 +++ libc/sysdeps/sparc/sparc32/fpu/libm-test-ulps Thu Sep 12 12:14:49 2002 @@ -1,64 +1,18 @@ # Begin of automatic generation -# asin -Test "asin (-0.5) == -pi/6": -float: 2 -ifloat: 2 -Test "asin (0.5) == pi/6": -float: 2 -ifloat: 2 -Test "asin (0.7) == 0.77539749661075306374035335271498708": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -# atanh -Test "atanh (0.7) == 0.8673005276940531944": -double: 1 -idouble: 1 - # atan2 -Test "atan2 (0.7, -1.0) == 2.530866689200584621918884506789267": -float: 3.0000 -ifloat: 3.0000 -Test "atan2 (-0.7, -1.0) == -2.530866689200584621918884506789267": -float: 3.0000 -ifloat: 3.0000 -Test "atan2 (1.4, -0.93) == 2.1571487668237843754887415992772736": -float: 4.0000 -ifloat: 4.0000 -Function: "atan2": -float: 4.0000 -ifloat: 4.0000 - -# cabs -Test "cabs (-0.7 + 12.4 i) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "cabs (-0.7 - 12.4 i) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "cabs (-12.4 + 0.7 i) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "cabs (-12.4 - 0.7 i) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "cabs (0.7 + 1.2 i) == 1.3892443989449804508432547041028554": -double: 1 -idouble: 1 -Test "cabs (0.7 + 12.4 i) == 12.419742348374220601176836866763271": +Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025": +float: 3 +ifloat: 3 +Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025": +float: 3 +ifloat: 3 +Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772": float: 1 ifloat: 1 -# cacos -Test "Real part of: cacos (0.7 + 1.2 i) == 1.1351827477151551088992008271819053 - 1.0927647857577371459105272080819308 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Imaginary part of: cacos (0.7 + 1.2 i) == 1.1351827477151551088992008271819053 - 1.0927647857577371459105272080819308 i": +# atanh +Test "atanh (0.75) == 0.972955074527656652552676371721589865": float: 1 ifloat: 1 @@ -73,20 +27,12 @@ double: 1 float: 3 idouble: 1 ifloat: 3 -Test "Real part of: cacosh (0.7 + 1.2 i) == 1.0927647857577371459105272080819308 + 1.1351827477151551088992008271819053 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 # casin -Test "Real part of: casin (0.7 + 1.2 i) == 0.4356135790797415103321208644578462 + 1.0927647857577371459105272080819308 i": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 -Test "Imaginary part of: casin (0.7 + 1.2 i) == 0.4356135790797415103321208644578462 + 1.0927647857577371459105272080819308 i": +Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 # casinh @@ -100,11 +46,13 @@ double: 3 float: 6 idouble: 3 ifloat: 6 -Test "Real part of: casinh (0.7 + 1.2 i) == 0.97865459559367387689317593222160964 + 0.91135418953156011567903546856170941 i": +Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": +float: 1 +ifloat: 1 +Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": double: 1 -idouble: 1 -Test "Imaginary part of: casinh (0.7 + 1.2 i) == 0.97865459559367387689317593222160964 + 0.91135418953156011567903546856170941 i": float: 1 +idouble: 1 ifloat: 1 # catan @@ -116,12 +64,9 @@ double: 1 float: 1 idouble: 1 ifloat: 1 -Test "Real part of: catan (0.7 + 1.2 i) == 1.0785743834118921877443707996386368 + 0.57705737765343067644394541889341712 i": +Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i": float: 4 ifloat: 4 -Test "Imaginary part of: catan (0.7 + 1.2 i) == 1.0785743834118921877443707996386368 + 0.57705737765343067644394541889341712 i": -double: 1 -idouble: 1 # catanh Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i": @@ -130,20 +75,21 @@ idouble: 4 Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i": float: 4 ifloat: 4 -Test "Real part of: catanh (0.7 + 1.2 i) == 0.2600749516525135959200648705635915 + 0.97024030779509898497385130162655963 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: catanh (0.7 + 1.2 i) == 0.2600749516525135959200648705635915 + 0.97024030779509898497385130162655963 i": +Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i": double: 1 -float: 6 idouble: 1 +Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i": +float: 6 ifloat: 6 # cbrt Test "cbrt (-27.0) == -3.0": double: 1 idouble: 1 -Test "cbrt (0.970299) == 0.99": +Test "cbrt (0.75) == 0.908560296416069829445605878163630251": +double: 1 +idouble: 1 +Test "cbrt (0.9921875) == 0.997389022060725270579075195353955217": double: 1 idouble: 1 @@ -151,12 +97,14 @@ idouble: 1 Test "Imaginary part of: ccos (-2 - 3 i) == -4.1896256909688072301 - 9.1092278937553365979 i": float: 1 ifloat: 1 -Test "Real part of: ccos (0.7 + 1.2 i) == 1.3848657645312111080 - 0.97242170335830028619 i": -double: 1 -idouble: 1 -Test "Imaginary part of: ccos (0.7 + 1.2 i) == 1.3848657645312111080 - 0.97242170335830028619 i": +Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": double: 1 +float: 1 idouble: 1 +ifloat: 1 +Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": +float: 1 +ifloat: 1 # ccosh Test "Real part of: ccosh (-2 - 3 i) == -3.7245455049153225654 + 0.5118225699873846088 i": @@ -165,34 +113,30 @@ ifloat: 1 Test "Imaginary part of: ccosh (-2 - 3 i) == -3.7245455049153225654 + 0.5118225699873846088 i": float: 1 ifloat: 1 -Test "Real part of: ccosh (0.7 + 1.2 i) == 0.4548202223691477654 + 0.7070296600921537682 i": +Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": double: 1 float: 1 idouble: 1 ifloat: 1 -Test "Imaginary part of: ccosh (0.7 + 1.2 i) == 0.4548202223691477654 + 0.7070296600921537682 i": -double: 1 -idouble: 1 +Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": +float: 1 +ifloat: 1 # cexp Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i": float: 1 ifloat: 1 -Test "Real part of: cexp (0.7 + 1.2 i) == 0.72969890915032360123451688642930727 + 1.8768962328348102821139467908203072 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Imaginary part of: cexp (0.7 + 1.2 i) == 0.72969890915032360123451688642930727 + 1.8768962328348102821139467908203072 i": +Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i": float: 1 ifloat: 1 # clog Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i": -double: 1 float: 3 -idouble: 1 ifloat: 3 +Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i": +float: 1 +ifloat: 1 # clog10 Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i": @@ -230,14 +174,9 @@ ifloat: 1 Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i": float: 1 ifloat: 1 -Test "Real part of: clog10 (0.7 + 1.2 i) == 0.1427786545038868803 + 0.4528483579352493248 i": -double: 1 +Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i": float: 1 -idouble: 1 ifloat: 1 -Test "Imaginary part of: clog10 (0.7 + 1.2 i) == 0.1427786545038868803 + 0.4528483579352493248 i": -double: 1 -idouble: 1 Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i": float: 1 ifloat: 1 @@ -252,28 +191,39 @@ float: 1 ifloat: 1 # cos -Test "cos (0.7) == 0.76484218728448842625585999019186495": +Test "cos (M_PI_6l * 2.0) == 0.5": double: 1 float: 1 idouble: 1 ifloat: 1 -Test "cos (M_PI_6l * 2.0) == 0.5": -double: 1 -float: 0.5 -idouble: 1 -ifloat: 0.5 Test "cos (M_PI_6l * 4.0) == -0.5": double: 2 float: 1 idouble: 2 ifloat: 1 Test "cos (pi/2) == 0": -double: 0.2758 -float: 0.3667 -idouble: 0.2758 -ifloat: 0.3667 +double: 1 +float: 1 +idouble: 1 +ifloat: 1 # cpow +Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": +float: 1 +ifloat: 1 +Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": +float: 1 +ifloat: 1 +Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i": +double: 1 +float: 4 +idouble: 1 +ifloat: 4 +Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i": +double: 2 +float: 3 +idouble: 2 +ifloat: 3 Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": double: 1 float: 4 @@ -283,24 +233,19 @@ Test "Imaginary part of: cpow (2 + 3 i, float: 2 ifloat: 2 Test "Imaginary part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i": -double: 1.1031 -float: 1.4668 -idouble: 1.1031 -ifloat: 1.4668 - -# csin -Test "Imaginary part of: csin (0.7 + 1.2 i) == 1.1664563419657581376 + 1.1544997246948547371 i": -float: 1 -ifloat: 1 +double: 2 +float: 2 +idouble: 2 +ifloat: 2 # csinh Test "Imaginary part of: csinh (-2 - 3 i) == 3.5905645899857799520 - 0.5309210862485198052 i": double: 1 idouble: 1 -Test "Real part of: csinh (0.7 + 1.2 i) == 0.27487868678117583582 + 1.1698665727426565139 i": +Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": float: 1 ifloat: 1 -Test "Imaginary part of: csinh (0.7 + 1.2 i) == 0.27487868678117583582 + 1.1698665727426565139 i": +Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": float: 1 ifloat: 1 @@ -311,27 +256,14 @@ ifloat: 1 Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i": float: 1 ifloat: 1 -Test "Real part of: csqrt (0.7 + 1.2 i) == 1.022067610030026450706487883081139 + 0.58704531296356521154977678719838035 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Imaginary part of: csqrt (0.7 + 1.2 i) == 1.022067610030026450706487883081139 + 0.58704531296356521154977678719838035 i": -float: 1 -ifloat: 1 # ctan Test "Real part of: ctan (-2 - 3 i) == 0.0037640256415042482 - 1.0032386273536098014 i": double: 1 idouble: 1 -Test "Real part of: ctan (0.7 + 1.2 i) == 0.1720734197630349001 + 0.9544807059989405538 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: ctan (0.7 + 1.2 i) == 0.1720734197630349001 + 0.9544807059989405538 i": +Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i": double: 1 -float: 1 idouble: 1 -ifloat: 1 # ctanh Test "Real part of: ctanh (-2 - 3 i) == -0.9653858790221331242 + 0.0098843750383224937 i": @@ -342,34 +274,22 @@ ifloat: 2 Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i": float: 1 ifloat: 1 -Test "Real part of: ctanh (0.7 + 1.2 i) == 1.3472197399061191630 + 0.4778641038326365540 i": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "Imaginary part of: ctanh (0.7 + 1.2 i) == 1.3472197399061191630 + 0.4778641038326365540 i": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 +Test "Real part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i": +double: 1 +idouble: 1 + +# erf +Test "erf (1.25) == 0.922900128256458230136523481197281140": +double: 1 +idouble: 1 # erfc -Test "erfc (0.7) == 0.32219880616258152702": +Test "erfc (2.0) == 0.00467773498104726583793074363274707139": double: 1 idouble: 1 -Test "erfc (1.2) == 0.089686021770364619762": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 -Test "erfc (2.0) == 0.0046777349810472658379": +Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8": double: 1 idouble: 1 -Test "erfc (4.1) == 0.67000276540848983727e-8": -double: 24 -float: 12 -idouble: 24 -ifloat: 12 # exp10 Test "exp10 (-1) == 0.1": @@ -377,8 +297,10 @@ double: 2 float: 1 idouble: 2 ifloat: 1 -Test "exp10 (0.7) == 5.0118723362727228500155418688494574": +Test "exp10 (0.75) == 5.62341325190349080394951039776481231": +double: 1 float: 1 +idouble: 1 ifloat: 1 Test "exp10 (3) == 1000": double: 6 @@ -387,32 +309,13 @@ idouble: 6 ifloat: 2 # expm1 +Test "expm1 (0.75) == 1.11700001661267466854536981983709561": +double: 1 +idouble: 1 Test "expm1 (1) == M_El - 1.0": float: 1 ifloat: 1 -# fmod -Test "fmod (-6.5, -2.3) == -1.9": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "fmod (-6.5, 2.3) == -1.9": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "fmod (6.5, -2.3) == 1.9": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "fmod (6.5, 2.3) == 1.9": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 - # hypot Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271": float: 1 @@ -429,9 +332,6 @@ ifloat: 1 Test "hypot (0.7, -12.4) == 12.419742348374220601176836866763271": float: 1 ifloat: 1 -Test "hypot (0.7, 1.2) == 1.3892443989449804508432547041028554": -double: 1 -idouble: 1 Test "hypot (0.7, 12.4) == 12.419742348374220601176836866763271": float: 1 ifloat: 1 @@ -443,90 +343,110 @@ float: 1 ifloat: 1 # j0 -Test "j0 (10.0) == -0.24593576445134833520": +Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "j0 (0.75) == 0.864242275166648623555731103820923211": +float: 1 +ifloat: 1 +Test "j0 (10.0) == -0.245935764451348335197760862485328754": double: 2 float: 1 idouble: 2 ifloat: 1 -Test "j0 (2.0) == 0.22389077914123566805": +Test "j0 (2.0) == 0.223890779141235668051827454649948626": float: 2 ifloat: 2 -Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1" +Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1": double: 1 -idouble: 1 float: 1 -ifloat: 1 -Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1" -double: 1 idouble: 1 -float: 1 ifloat: 1 -Test "j0 (8.0) == 0.17165080713755390609": +Test "j0 (8.0) == 0.171650807137553906090869407851972001": float: 1 ifloat: 1 # j1 -Test "j1 (10.0) == 0.043472746168861436670": +Test "j1 (10.0) == 0.0434727461688614366697487680258592883": float: 2 ifloat: 2 -Test "j1 (2.0) == 0.57672480775687338720": +Test "j1 (2.0) == 0.576724807756873387202448242269137087": double: 1 idouble: 1 -Test "j1 (8.0) == 0.23463634685391462438": +Test "j1 (8.0) == 0.234636346853914624381276651590454612": double: 1 idouble: 1 # jn -Test "jn (0, 10.0) == -0.24593576445134833520": +Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "jn (0, 0.75) == 0.864242275166648623555731103820923211": +float: 1 +ifloat: 1 +Test "jn (0, 10.0) == -0.245935764451348335197760862485328754": double: 2 float: 1 idouble: 2 ifloat: 1 -Test "jn (0, 2.0) == 0.22389077914123566805": +Test "jn (0, 2.0) == 0.223890779141235668051827454649948626": float: 2 ifloat: 2 -Test "jn (0, 8.0) == 0.17165080713755390609": +Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1": +double: 1 float: 1 +idouble: 1 ifloat: 1 -Test "jn (1, 10.0) == 0.043472746168861436670": +Test "jn (0, 8.0) == 0.171650807137553906090869407851972001": +float: 1 +ifloat: 1 +Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883": float: 2 ifloat: 2 -Test "jn (1, 2.0) == 0.57672480775687338720": +Test "jn (1, 2.0) == 0.576724807756873387202448242269137087": double: 1 idouble: 1 -Test "jn (1, 8.0) == 0.23463634685391462438": +Test "jn (1, 8.0) == 0.234636346853914624381276651590454612": double: 1 idouble: 1 -Test "jn (10, 0.1) == 0.26905328954342155795e-19": -double: 6 -float: 4 -idouble: 6 -ifloat: 4 -Test "jn (10, 0.7) == 0.75175911502153953928e-11": -double: 3 +Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18": +double: 1 float: 1 -idouble: 3 +idouble: 1 +ifloat: 1 +Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10": +double: 1 +float: 1 +idouble: 1 ifloat: 1 -Test "jn (10, 10.0) == 0.20748610663335885770": +Test "jn (10, 10.0) == 0.207486106633358857697278723518753428": double: 4 float: 3 idouble: 4 ifloat: 3 -Test "jn (10, 2.0) == 0.25153862827167367096e-6": +Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6": float: 4 ifloat: 4 -Test "jn (3, 0.1) == 0.000020820315754756261429": +Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4": double: 1 +float: 1 idouble: 1 -Test "jn (3, 0.7) == 0.0069296548267508408077": +ifloat: 1 +Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2": +double: 1 float: 1 +idouble: 1 ifloat: 1 -Test "jn (3, 10.0) == 0.058379379305186812343": +Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563": double: 3 float: 1 idouble: 3 ifloat: 1 -Test "jn (3, 2.0) == 0.12894324947440205110": +Test "jn (3, 2.0) == 0.128943249474402051098793332969239835": double: 1 float: 2 idouble: 1 @@ -544,86 +464,45 @@ float: 2 idouble: 1 ifloat: 2 -# log -Test "log (0.7) == -0.35667494393873237891263871124118447": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - # log10 -Test "log10 (0.7) == -0.15490195998574316929": +Test "log10 (0.75) == -0.124938736608299953132449886193870744": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 Test "log10 (e) == log10(e)": float: 1 ifloat: 1 # log1p -Test "log1p (-0.3) == -0.35667494393873237891263871124118447": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# log2 -Test "log2 (0.7) == -0.51457317282975824043": -double: 1 +Test "log1p (-0.25) == -0.287682072451780927439219005993827432": float: 1 -idouble: 1 ifloat: 1 # sincos -Test "sincos (0.7, &sin_res, &cos_res) puts 0.76484218728448842625585999019186495 in cos_res": +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res": double: 1 float: 1 idouble: 1 ifloat: 1 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res": -double: 1 -float: 0.5 -idouble: 1 -ifloat: 0.5 Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res": double: 1 float: 1 idouble: 1 ifloat: 1 Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res": -double: 0.2758 -float: 0.3667 -idouble: 0.2758 -ifloat: 0.3667 -Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res": -float: 1 -ifloat: 1 - -# sinh -Test "sinh (0.7) == 0.75858370183953350346": double: 1 float: 1 idouble: 1 ifloat: 1 - -# tan -Test "tan (pi/4) == 1": -double: 0.5 -idouble: 0.5 - -# tanh -Test "tanh (0.7) == 0.60436777711716349631": -double: 1 +Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res": float: 1 -idouble: 1 ifloat: 1 -Test "tanh (-0.7) == -0.60436777711716349631": +# tan +Test "tan (pi/4) == 1": double: 1 -float: 1 idouble: 1 -ifloat: 1 # tgamma Test "tgamma (-0.5) == -2 sqrt (pi)": @@ -641,170 +520,130 @@ idouble: 1 ifloat: 1 # y0 -Test "y0 (0.7) == -0.19066492933739506743": +Test "y0 (1.0) == 0.0882569642156769579829267660235151628": double: 2 float: 1 idouble: 2 ifloat: 1 -Test "y0 (1.0) == 0.088256964215676957983": +Test "y0 (1.5) == 0.382448923797758843955068554978089862": double: 2 float: 1 idouble: 2 ifloat: 1 -Test "y0 (1.5) == 0.38244892379775884396": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "y0 (10.0) == 0.055671167283599391424": +Test "y0 (10.0) == 0.0556711672835993914244598774101900481": float: 1 ifloat: 1 -Test "y0 (8.0) == 0.22352148938756622053": +Test "y0 (8.0) == 0.223521489387566220527323400498620359": double: 1 float: 1 idouble: 1 ifloat: 1 # y1 -Test "y1 (0.1) == -6.4589510947020269877": +Test "y1 (0.125) == -5.19993611253477499595928744876579921": double: 1 idouble: 1 -Test "y1 (0.7) == -1.1032498719076333697": -double: 1 +Test "y1 (1.5) == -0.412308626973911295952829820633445323": float: 1 -idouble: 1 ifloat: 1 -Test "y1 (1.5) == -0.41230862697391129595": -float: 1 -ifloat: 1 -Test "y1 (10.0) == 0.24901542420695388392": +Test "y1 (10.0) == 0.249015424206953883923283474663222803": double: 3 float: 1 idouble: 3 ifloat: 1 -Test "y1 (2.0) == -0.10703243154093754689": +Test "y1 (2.0) == -0.107032431540937546888370772277476637": double: 1 float: 1 idouble: 1 ifloat: 1 -Test "y1 (8.0) == -0.15806046173124749426": +Test "y1 (8.0) == -0.158060461731247494255555266187483550": double: 1 float: 2 idouble: 1 ifloat: 2 # yn -Test "yn (0, 0.7) == -0.19066492933739506743": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "yn (0, 1.0) == 0.088256964215676957983": +Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628": double: 2 float: 1 idouble: 2 ifloat: 1 -Test "yn (0, 1.5) == 0.38244892379775884396": +Test "yn (0, 1.5) == 0.382448923797758843955068554978089862": double: 2 float: 1 idouble: 2 ifloat: 1 -Test "yn (0, 10.0) == 0.055671167283599391424": +Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481": float: 1 ifloat: 1 -Test "yn (0, 8.0) == 0.22352148938756622053": +Test "yn (0, 8.0) == 0.223521489387566220527323400498620359": double: 1 float: 1 idouble: 1 ifloat: 1 -Test "yn (1, 0.1) == -6.4589510947020269877": +Test "yn (1, 0.125) == -5.19993611253477499595928744876579921": double: 1 idouble: 1 -Test "yn (1, 0.7) == -1.1032498719076333697": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (1, 1.5) == -0.41230862697391129595": +Test "yn (1, 1.5) == -0.412308626973911295952829820633445323": float: 1 ifloat: 1 -Test "yn (1, 10.0) == 0.24901542420695388392": +Test "yn (1, 10.0) == 0.249015424206953883923283474663222803": double: 3 float: 1 idouble: 3 ifloat: 1 -Test "yn (1, 2.0) == -0.10703243154093754689": +Test "yn (1, 2.0) == -0.107032431540937546888370772277476637": double: 1 float: 1 idouble: 1 ifloat: 1 -Test "yn (1, 8.0) == -0.15806046173124749426": +Test "yn (1, 8.0) == -0.158060461731247494255555266187483550": double: 1 float: 2 idouble: 1 ifloat: 2 -Test "yn (10, 0.1) == -0.11831335132045197885e19": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 -Test "yn (10, 0.7) == -0.42447194260703866924e10": -double: 3 -idouble: 3 -Test "yn (10, 1.0) == -0.12161801427868918929e9": +Test "yn (10, 0.125) == -127057845771019398.252538486899753195": double: 1 idouble: 1 -Test "yn (10, 10.0) == -0.35981415218340272205": +Test "yn (10, 0.75) == -2133501638.90573424452445412893839236": double: 1 float: 1 idouble: 1 ifloat: 1 -Test "yn (10, 2.0) == -129184.54220803928264": -double: 2 -idouble: 2 -Test "yn (3, 0.1) == -5099.3323786129048894": +Test "yn (10, 1.0) == -121618014.278689189288130426667971145": double: 1 -float: 1 idouble: 1 -ifloat: 1 -Test "yn (3, 0.7) == -15.819479052819633505": -double: 3 -float: 1 -idouble: 3 -ifloat: 1 -Test "yn (3, 10.0) == -0.25136265718383732978": +Test "yn (10, 10.0) == -0.359814152183402722051986577343560609": double: 1 float: 1 idouble: 1 ifloat: 1 -Test "yn (3, 2.0) == -1.1277837768404277861": -double: 1 -idouble: 1 - -# Maximal error of functions: -Function: "asin": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: "atanh": +Test "yn (10, 2.0) == -129184.542208039282635913145923304214": +double: 2 +idouble: 2 +Test "yn (3, 0.125) == -2612.69757350066712600220955744091741": double: 1 idouble: 1 - -Function: "cabs": +Test "yn (3, 0.75) == -12.9877176234475433186319774484809207": double: 1 float: 1 idouble: 1 ifloat: 1 - -Function: Real part of "cacos": +Test "yn (3, 10.0) == -0.251362657183837329779204747654240998": double: 1 float: 1 idouble: 1 ifloat: 1 +Test "yn (3, 2.0) == -1.12778377684042778608158395773179238": +double: 1 +idouble: 1 -Function: Imaginary part of "cacos": +# Maximal error of functions: +Function: "atan2": +float: 3 +ifloat: 3 + +Function: "atanh": float: 1 ifloat: 1 @@ -821,13 +660,9 @@ idouble: 1 ifloat: 3 Function: Real part of "casin": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 - -Function: Imaginary part of "casin": +double: 1 float: 1 +idouble: 1 ifloat: 1 Function: Real part of "casinh": @@ -854,14 +689,10 @@ ifloat: 1 Function: Real part of "catanh": double: 4 -float: 1 idouble: 4 -ifloat: 1 Function: Imaginary part of "catanh": -double: 1 float: 6 -idouble: 1 ifloat: 6 Function: "cbrt": @@ -870,12 +701,12 @@ idouble: 1 Function: Real part of "ccos": double: 1 +float: 1 idouble: 1 +ifloat: 1 Function: Imaginary part of "ccos": -double: 1 float: 1 -idouble: 1 ifloat: 1 Function: Real part of "ccosh": @@ -885,31 +716,27 @@ idouble: 1 ifloat: 1 Function: Imaginary part of "ccosh": -double: 1 float: 1 -idouble: 1 ifloat: 1 Function: Real part of "cexp": -double: 1 float: 1 -idouble: 1 ifloat: 1 Function: Imaginary part of "cexp": float: 1 ifloat: 1 +Function: Real part of "clog": +float: 1 +ifloat: 1 + Function: Imaginary part of "clog": -double: 1 float: 3 -idouble: 1 ifloat: 3 Function: Real part of "clog10": -double: 1 float: 1 -idouble: 1 ifloat: 1 Function: Imaginary part of "clog10": @@ -925,21 +752,17 @@ idouble: 2 ifloat: 1 Function: Real part of "cpow": -double: 1 +double: 2 float: 4 -idouble: 1 +idouble: 2 ifloat: 4 Function: Imaginary part of "cpow": -double: 1.1031 +double: 2 float: 2 -idouble: 1.1031 +idouble: 2 ifloat: 2 -Function: Imaginary part of "csin": -float: 1 -ifloat: 1 - Function: Real part of "csinh": float: 1 ifloat: 1 @@ -951,44 +774,34 @@ idouble: 1 ifloat: 1 Function: Real part of "csqrt": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Imaginary part of "csqrt": float: 1 ifloat: 1 Function: Real part of "ctan": double: 1 -float: 1 idouble: 1 -ifloat: 1 Function: Imaginary part of "ctan": double: 1 -float: 1 idouble: 1 -ifloat: 1 Function: Real part of "ctanh": -double: 2 +double: 1 float: 2 -idouble: 2 +idouble: 1 ifloat: 2 Function: Imaginary part of "ctanh": -double: 2 float: 1 -idouble: 2 ifloat: 1 +Function: "erf": +double: 1 +idouble: 1 + Function: "erfc": -double: 24 -float: 12 -idouble: 24 -ifloat: 12 +double: 1 +idouble: 1 Function: "exp10": double: 6 @@ -997,19 +810,13 @@ idouble: 6 ifloat: 2 Function: "expm1": +double: 1 float: 1 -ifloat: 1 - -Function: "fmod": -double: 2 -float: 1 -idouble: 2 +idouble: 1 ifloat: 1 Function: "hypot": -double: 1 float: 1 -idouble: 1 ifloat: 1 Function: "j0": @@ -1025,9 +832,9 @@ idouble: 1 ifloat: 2 Function: "jn": -double: 6 +double: 4 float: 4 -idouble: 6 +idouble: 4 ifloat: 4 Function: "lgamma": @@ -1036,28 +843,14 @@ float: 2 idouble: 1 ifloat: 2 -Function: "log": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - Function: "log10": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 Function: "log1p": -double: 1 float: 1 -idouble: 1 -ifloat: 1 - -Function: "log2": -double: 1 -float: 1 -idouble: 1 ifloat: 1 Function: "sincos": @@ -1066,21 +859,9 @@ float: 1 idouble: 1 ifloat: 1 -Function: "sinh": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - Function: "tan": -double: 0.5 -idouble: 0.5 - -Function: "tanh": double: 1 -float: 1 idouble: 1 -ifloat: 1 Function: "tgamma": double: 1 --- libc/sysdeps/sh/Makefile.jj Tue Aug 27 17:19:53 2002 +++ libc/sysdeps/sh/Makefile Thu Sep 12 08:41:54 2002 @@ -1,11 +1,3 @@ ifeq ($(subdir),gmon) sysdep_routines += _mcount endif - -ifeq ($(subdir),csu) -ifeq (yes,$(build-shared)) -# Compatibility -sysdep_routines += divdi3 -shared-only-routines += divdi3 -endif -endif --- libc/sysdeps/s390/s390-32/Makefile.jj Sat Mar 23 05:52:40 2002 +++ libc/sysdeps/s390/s390-32/Makefile Thu Sep 12 08:42:11 2002 @@ -1,13 +1,5 @@ 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/Makefile.jj Thu Sep 12 08:39:41 2002 +++ libc/sysdeps/wordsize-32/Makefile Thu Sep 12 08:40:07 2002 @@ -0,0 +1,6 @@ +ifeq ($(subdir),csu) +ifeq (yes,$(build-shared)) +sysdep_routines += divdi3 +shared-only-routines += divdi3 +endif +endif Jakub From jakub@redhat.com Thu Sep 12 09:32:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 12 Sep 2002 09:32:00 -0000 Subject: [PATCH] TLS i386/dl-machine.h changes Message-ID: <20020912183240.W1013@sunsite.ms.mff.cuni.cz> Hi! IMHO R_386_TLS_DTPMOD32 should not use addend in REL version. It is a counterpart of R_386_GLOB_DAT which doesn't use it either. I believe the reason for R_386_GLOB_DAT is that if you reference x, x + 8 and x + 16 in one library, you don't end up with 3 dynamic relocs against x but just one. ATM binutils will never create R_386_TLS_DTPMOD32 with addend != 0 (unlike R_386_TLS_TPOFF32). Not using the addend has a serious advantage for prelink - it can prelink all DTPOFF32 relocs without the need for costly REL->RELA conversion. Another thing is that sym != NULL implies sym_map != NULL (otherwise e.g. Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value; would crash first). Plus we need the TLS RELA support too... 2002-09-12 Jakub Jelinek * sysdeps/i386/dl-machine.h (elf_machine_rel) [R_386_TLS_DTPMOD32]: Don't use addend. [R_386_TLS_TPOFF32]: Remove redundant sym_map != NULL check. (elf_machine_rela): Add support for TLS relocs. --- libc/sysdeps/i386/dl-machine.h.jj 2002-08-31 09:40:43.000000000 +0200 +++ libc/sysdeps/i386/dl-machine.h 2002-09-12 18:19:22.000000000 +0200 @@ -410,8 +410,6 @@ elf_machine_rel (struct link_map *map, c *reloc_addr = value; break; - /* XXX Remove TLS relocations which are not needed. */ - #ifdef USE_TLS case R_386_TLS_DTPMOD32: # ifdef RTLD_BOOTSTRAP @@ -432,7 +430,7 @@ elf_machine_rel (struct link_map *map, c /* During relocation all TLS symbols are defined and used. Therefore the offset is already correct. */ if (sym != NULL) - *reloc_addr += sym->st_value; + *reloc_addr = sym->st_value; # endif break; case R_386_TLS_TPOFF32: @@ -444,7 +442,7 @@ elf_machine_rel (struct link_map *map, c It is a positive value which will be subtracted from the thread pointer. To get the variable position in the TLS block we subtract the offset from that of the TLS block. */ - if (sym_map != NULL && sym != NULL) + if (sym != NULL) *reloc_addr += sym_map->l_tls_offset - sym->st_value; # endif break; @@ -516,7 +514,44 @@ elf_machine_rela (struct link_map *map, case R_386_PC32: *reloc_addr = (value + reloc->r_addend - (Elf32_Addr) reloc_addr); break; - /* XXX Do we have to handle the TLS relocation here? */ + +#ifdef USE_TLS + case R_386_TLS_DTPMOD32: +# ifdef RTLD_BOOTSTRAP + /* During startup the dynamic linker is always the module + with index 1. + XXX If this relocation is necessary move before RESOLVE + call. */ + *reloc_addr = 1; +# else + /* Get the information from the link map returned by the + resolv function. */ + if (sym_map != NULL) + *reloc_addr = sym_map->l_tls_modid; +# endif + break; + case R_386_TLS_DTPOFF32: +# ifndef RTLD_BOOTSTRAP + /* During relocation all TLS symbols are defined and used. + Therefore the offset is already correct. */ + *reloc_addr = (sym == NULL ? 0 : sym->st_value) + reloc->r_addend; +# endif + break; + case R_386_TLS_TPOFF32: + /* The offset is positive, backward from the thread pointer. */ +# ifdef RTLD_BOOTSTRAP + *reloc_addr = map->l_tls_offset - sym->st_value + reloc->r_addend; +# else + /* We know the offset of object the symbol is contained in. + It is a positive value which will be subtracted from the + thread pointer. To get the variable position in the TLS + block we subtract the offset from that of the TLS block. */ + *reloc_addr + = (sym == NULL ? 0 : sym_map->l_tls_offset - sym->st_value) + + reloc->r_addend; +# endif + break; +#endif /* use TLS */ default: /* We add these checks in the version to relocate ld.so only if we are still debugging. */ Jakub From aj@suse.de Sun Sep 15 20:40:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sun, 15 Sep 2002 20:40:00 -0000 Subject: Fix _exit for Linux Message-ID: Building glibc with GCC 3.3 CVS I get these errors: /opt/gcc/3.3-devel/bin/gcc -nostdlib -nostartfiles -o /builds/glibc/gcc-3.3/iconv/iconvconfig -Wl,-dynamic-linker=/usr/src/test/glibc-2.3/lib/ld-linux.so.2 -Wl,-z,combreloc /builds/glibc/gcc-3.3/csu/crt1.o /builds/glibc/gcc-3.3/csu/crti.o `/opt/gcc/3.3-devel/bin/gcc --print-file-name=crtbegin.o` /builds/glibc/gcc-3.3/iconv/iconvconfig.o /builds/glibc/gcc-3.3/iconv/strtab.o /builds/glibc/gcc-3.3/iconv/xmalloc.o -Wl,-rpath-link=/builds/glibc/gcc-3.3:/builds/glibc/gcc-3.3/math:/builds/glibc/gcc-3.3/elf:/builds/glibc/gcc-3.3/dlfcn:/builds/glibc/gcc-3.3/nss:/builds/glibc/gcc-3.3/nis:/builds/glibc/gcc-3.3/rt:/builds/glibc/gcc-3.3/resolv:/builds/glibc/gcc-3.3/crypt:/builds/glibc/gcc-3.3/linuxthreads /builds/glibc/gcc-3.3/libc.so.6 /builds/glibc/gcc-3.3/libc_nonshared.a -lgcc `/opt/gcc/3.3-devel/bin/gcc --print-file-name=crtend.o` /builds/glibc/gcc-3.3/csu/crtn.o /builds/glibc/gcc-3.3/libc.so.6(.data+0xb2c): multiple definition of `__ctype_toupper@GLIBC_2.0' /builds/glibc/gcc-3.3/libc.so.6(*IND*+0x0): multiple definition of `__ctype32_toupper@GLIBC_2.2' /builds/glibc/gcc-3.3/libc.so.6(.data+0xb34): first defined here /builds/glibc/gcc-3.3/libc.so.6(.data+0xb30): multiple definition of `__ctype32_tolower@GLIBC_2.2' /builds/glibc/gcc-3.3/libc.so.6(.data+0xb20): multiple definition of `__ctype_b@GLIBC_2.0' /builds/glibc/gcc-3.3/libc.so.6(*IND*+0x0): multiple definition of `__ctype_tolower@GLIBC_2.0' /builds/glibc/gcc-3.3/libc.so.6(.data+0xb28): first defined here /builds/glibc/gcc-3.3/libc.so.6(.data+0xb24): multiple definition of `__ctype32_b@GLIBC_2.0' /builds/glibc/gcc-3.3/libc.so.6: undefined reference to `__GI__exit' collect2: ld returned 1 exit status make[2]: *** [/builds/glibc/gcc-3.3/iconv/iconvconfig] Error 1 make[2]: Leaving directory `/usr/src/cvs/libc/iconv' __GI__exit comes from sysdeps/unix/sysv/linux/i386/clone.S: call HIDDEN_JUMPTARGET (_exit) The new _exit code needs the right aliases. I've changed i386/_exit.S also to use the macros. Ok to commit the appended patch? Andreas 2002-09-16 Andreas Jaeger * sysdeps/unix/sysv/linux/_exit.c: Add hidden alias and weak_alias to _Exit. * sysdeps/unix/sysv/linux/i386/_exit.S: Likewise. ============================================================ Index: sysdeps/unix/sysv/linux/i386/_exit.S --- sysdeps/unix/sysv/linux/i386/_exit.S 15 Sep 2002 02:28:28 -0000 1.1 +++ sysdeps/unix/sysv/linux/i386/_exit.S 16 Sep 2002 03:39:31 -0000 @@ -38,6 +38,5 @@ _exit: hlt .size _exit,.-_exit - .globl _Exit - .weak _Exit -_Exit = _exit +libc_hidden_def (_exit) +weak_alias (_exit, _Exit) ============================================================ Index: sysdeps/unix/sysv/linux/_exit.c --- sysdeps/unix/sysv/linux/_exit.c 15 Sep 2002 02:27:40 -0000 1.1 +++ sysdeps/unix/sysv/linux/_exit.c 16 Sep 2002 03:39:31 -0000 @@ -36,3 +36,5 @@ _exit (status) ABORT_INSTRUCTION; } } +libc_hidden_def (_exit) +weak_alias (_exit, _Exit) -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Sun Sep 15 20:55:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sun, 15 Sep 2002 20:55:00 -0000 Subject: problems with ctype... Message-ID: Roland, This patch looks broken: 2002-09-05 Roland McGrath * ctype/ctype-info.c: Renamed __ctype_old_* symbols to __ctype_*. * locale/lc-ctype.c (_nl_postload_ctype): Likewise. With current CVS I get: /opt/gcc/3.3-devel/bin/gcc -nostdlib -nostartfiles -o /builds/glibc/gcc-3.3/iconv/iconvconfig -Wl,-dynamic-linker=/usr/src/test/glibc-2.3/lib/ld-linux.so.2 -Wl,-z,combreloc /builds/glibc/gcc-3.3/csu/crt1.o /builds/glibc/gcc-3.3/csu/crti.o `/opt/gcc/3.3-devel/bin/gcc --print-file-name=crtbegin.o` /builds/glibc/gcc-3.3/iconv/iconvconfig.o /builds/glibc/gcc-3.3/iconv/strtab.o /builds/glibc/gcc-3.3/iconv/xmalloc.o -Wl,-rpath-link=/builds/glibc/gcc-3.3:/builds/glibc/gcc-3.3/math:/builds/glibc/gcc-3.3/elf:/builds/glibc/gcc-3.3/dlfcn:/builds/glibc/gcc-3.3/nss:/builds/glibc/gcc-3.3/nis:/builds/glibc/gcc-3.3/rt:/builds/glibc/gcc-3.3/resolv:/builds/glibc/gcc-3.3/crypt:/builds/glibc/gcc-3.3/linuxthreads /builds/glibc/gcc-3.3/libc.so.6 /builds/glibc/gcc-3.3/libc_nonshared.a -lgcc `/opt/gcc/3.3-devel/bin/gcc --print-file-name=crtend.o` /builds/glibc/gcc-3.3/csu/crtn.o /builds/glibc/gcc-3.3/libc.so.6(.data+0xb2c): multiple definition of `__ctype_toupper@GLIBC_2.0' /builds/glibc/gcc-3.3/libc.so.6(*IND*+0x0): multiple definition of `__ctype32_toupper@GLIBC_2.2' /builds/glibc/gcc-3.3/libc.so.6(.data+0xb34): first defined here /builds/glibc/gcc-3.3/libc.so.6(.data+0xb30): multiple definition of `__ctype32_tolower@GLIBC_2.2' /builds/glibc/gcc-3.3/libc.so.6(.data+0xb20): multiple definition of `__ctype_b@GLIBC_2.0' /builds/glibc/gcc-3.3/libc.so.6(*IND*+0x0): multiple definition of `__ctype_tolower@GLIBC_2.0' /builds/glibc/gcc-3.3/libc.so.6(.data+0xb28): first defined here /builds/glibc/gcc-3.3/libc.so.6(.data+0xb24): multiple definition of `__ctype32_b@GLIBC_2.0' collect2: ld returned 1 exit status but reverting the ctype-info.c part I get no more duplicates but only: /builds/glibc/gcc-3.3/libc.so.6: undefined reference to `__ctype32_b' /builds/glibc/gcc-3.3/libc.so.6: undefined reference to `__ctype_b' /builds/glibc/gcc-3.3/libc.so.6: undefined reference to `__ctype_toupper' /builds/glibc/gcc-3.3/libc.so.6: undefined reference to `__ctype32_toupper' /builds/glibc/gcc-3.3/libc.so.6: undefined reference to `__ctype32_tolower' /builds/glibc/gcc-3.3/libc.so.6: undefined reference to `__ctype_tolower' This is with GCC 3.3 CVS and binutils 2.12.90.0.4 20020408 on i686-linux-gnu. Any ideas what's going wrong here? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Sun Sep 15 22:11:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 15 Sep 2002 22:11:00 -0000 Subject: Fix _exit for Linux References: Message-ID: <3D856813.8080304@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andreas Jaeger wrote: > Ok to commit the appended patch? Yes. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9hWgW2ijCOnn/RHQRAjmrAJ4rE8d7oe9hwAhM7zl+tmFMpOoN/ACeLIhu 1Vk3vsRwc1+SwSFHpr7mY8E= =xm+Y -----END PGP SIGNATURE----- From roland@redhat.com Sun Sep 15 22:15:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 15 Sep 2002 22:15:00 -0000 Subject: problems with ctype... In-Reply-To: Andreas Jaeger's message of Monday, 16 September 2002 05:55:09 +0200 Message-ID: <200209160512.g8G5CUF04935@dhcp187.sf.frob.com> It certainly works fine for me, but I am not using the same tools. I am using GCC 3.2 with RH modifications and binutils is also a RH version. In my build the libc.so.6 symbol table contains (this is readelf -s output): 988: 00112a40 4 OBJECT GLOBAL DEFAULT 16 __ctype_toupper@GLIBC_2.0 3865: 00112a40 4 OBJECT LOCAL DEFAULT 16 __ctype_toupper and the dynamic symbol table contains: 5948: 00112a40 4 OBJECT GLOBAL DEFAULT 16 __ctype_toupper@GLIBC_2.0 In libc_pic.a, lc-ctype.os has: 25: 00000000 0 NOTYPE GLOBAL DEFAULT UND __ctype_toupper and ctype/ctype-info.os has: 32: 0000000c 4 OBJECT GLOBAL DEFAULT 10 __ctype_toupper 39: 0000000c 4 OBJECT GLOBAL DEFAULT 10 __ctype_toupper@GLIBC_2.0 Those are the only __ctype_toupper references. How does this compare with the symbols in your build? Perhaps the ld behavior is different. I don't know what the *IND* magic in the linker error message is. I presume that your libc.so.6 symbol tables must look different from mine, or the error doesn't make sense. I'm not sure if it's supposed to be the case that the references in lc-ctype.os uses the versioned name when it's being linked -shared with the object that defines the non-default versioned name. But I think not, since there is also a plain global __ctype_toupper defined in ctype-info.os. I could understand the multiple definition error more if it came up doing the ld -shared instead. From aj@suse.de Sun Sep 15 23:52:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sun, 15 Sep 2002 23:52:00 -0000 Subject: problems with ctype... In-Reply-To: <200209160512.g8G5CUF04935@dhcp187.sf.frob.com> (Roland McGrath's message of "Sun, 15 Sep 2002 22:12:30 -0700") References: <200209160512.g8G5CUF04935@dhcp187.sf.frob.com> Message-ID: Roland McGrath writes: > It certainly works fine for me, but I am not using the same tools. > I am using GCC 3.2 with RH modifications and binutils is also a RH version. I just tried it with newer binutils (2.12.90.0.15 20020717) and that worked fine. We might need to document the minimal supported binutils version. > > In my build the libc.so.6 symbol table contains (this is readelf -s output): > > 988: 00112a40 4 OBJECT GLOBAL DEFAULT 16 __ctype_toupper@GLIBC_2.0 > 3865: 00112a40 4 OBJECT LOCAL DEFAULT 16 __ctype_toupper gromit:/builds/glibc/gcc-3.3:[2]$ readelf -s libc.so.6 |grep ctype_toupper [From dynsym:] 696: 0010fb2c 4 OBJECT GLOBAL DEFAULT 16 __ctype_toupper@@GLIBC_2.0 989: 0010fb2c 4 OBJECT GLOBAL DEFAULT 16 __ctype_toupper@GLIBC_2.0 1923: 00022692 114 FUNC GLOBAL DEFAULT 11 __ctype_toupper_loc@@GLIBC_2.3 [From .symtab] 5647: 0010fb2c 4 OBJECT GLOBAL DEFAULT 16 __ctype_toupper 5940: 0010fb2c 4 OBJECT GLOBAL DEFAULT 16 __ctype_toupper@GLIBC_2.0 6874: 00022692 114 FUNC GLOBAL DEFAULT 11 __ctype_toupper_loc > and the dynamic symbol table contains: > > 5948: 00112a40 4 OBJECT GLOBAL DEFAULT 16 __ctype_toupper@GLIBC_2.0 > > In libc_pic.a, lc-ctype.os has: > > 25: 00000000 0 NOTYPE GLOBAL DEFAULT UND __ctype_toupper > > and ctype/ctype-info.os has: > > 32: 0000000c 4 OBJECT GLOBAL DEFAULT 10 __ctype_toupper > 39: 0000000c 4 OBJECT GLOBAL DEFAULT 10 __ctype_toupper@GLIBC_2.0 These looks the same for me. > > Those are the only __ctype_toupper references. How does this compare with > the symbols in your build? > > Perhaps the ld behavior is different. I don't know what the *IND* magic in > the linker error message is. I presume that your libc.so.6 symbol tables > must look different from mine, or the error doesn't make sense. > I'm not sure if it's supposed to be the case that the references in > lc-ctype.os uses the versioned name when it's being linked -shared with the > object that defines the non-default versioned name. But I think not, since > there is also a plain global __ctype_toupper defined in ctype-info.os. I > could understand the multiple definition error more if it came up doing the > ld -shared instead. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From roland@redhat.com Sun Sep 15 23:56:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 15 Sep 2002 23:56:00 -0000 Subject: Fix _exit for Linux In-Reply-To: Andreas Jaeger's message of Monday, 16 September 2002 05:39:46 +0200 Message-ID: <200209160653.g8G6rp205464@dhcp187.sf.frob.com> Those fixes look right to me. Also about this new exit code, I think that since __exit_thread is declared in a generic header and called from generic code, it should not be in the sysdeps makefile. From roland@redhat.com Sun Sep 15 23:59:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 15 Sep 2002 23:59:00 -0000 Subject: problems with ctype... In-Reply-To: Andreas Jaeger's message of Monday, 16 September 2002 08:52:35 +0200 Message-ID: <200209160656.g8G6ug205482@dhcp187.sf.frob.com> > I just tried it with newer binutils (2.12.90.0.15 20020717) and that > worked fine. We might need to document the minimal supported binutils > version. Certainly so. If there is some simple change that makes it work with more binutils versions, I would be happy with that too. From jakub@redhat.com Mon Sep 16 00:01:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 16 Sep 2002 00:01:00 -0000 Subject: problems with ctype... In-Reply-To: ; from aj@suse.de on Mon, Sep 16, 2002 at 08:52:35AM +0200 References: <200209160512.g8G5CUF04935@dhcp187.sf.frob.com> Message-ID: <20020916090138.B1013@sunsite.ms.mff.cuni.cz> On Mon, Sep 16, 2002 at 08:52:35AM +0200, Andreas Jaeger wrote: > Roland McGrath writes: > > > It certainly works fine for me, but I am not using the same tools. > > I am using GCC 3.2 with RH modifications and binutils is also a RH version. > > I just tried it with newer binutils (2.12.90.0.15 20020717) and that > worked fine. We might need to document the minimal supported binutils > version. Ours is binutils 2.13.90.0.2. Well, we need to find out the oldest binutils which worked ok and also write a binutils testcase whcih will ensure this will work right from now on. I think it is an useful feature to be able to access a compat-only variable (and getting to it through aliases doesn't work because of COPY relocs). Jakub From aj@suse.de Mon Sep 16 00:01:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 16 Sep 2002 00:01:00 -0000 Subject: problems with ctype... In-Reply-To: <200209160656.g8G6ug205482@dhcp187.sf.frob.com> (Roland McGrath's message of "Sun, 15 Sep 2002 23:56:42 -0700") References: <200209160656.g8G6ug205482@dhcp187.sf.frob.com> Message-ID: Roland McGrath writes: >> I just tried it with newer binutils (2.12.90.0.15 20020717) and that >> worked fine. We might need to document the minimal supported binutils >> version. > > Certainly so. If there is some simple change that makes it work with more > binutils versions, I would be happy with that too. Unfortunatly I haven't figured out such a way yet :-( Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Mon Sep 16 00:10:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 16 Sep 2002 00:10:00 -0000 Subject: Fix _exit for Linux References: <200209160653.g8G6rp205464@dhcp187.sf.frob.com> Message-ID: <3D8583DB.3050800@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roland McGrath wrote: > Those fixes look right to me. > > Also about this new exit code, I think that since __exit_thread is declared > in a generic header and called from generic code, it should not be in the > sysdeps makefile. Not every system might have this function and it is not exported. Therefore having the rule in a sysdep Makefile is correct. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9hYPl2ijCOnn/RHQRAte8AJ9enaI7LwMPsKB6sY2aB9PGtBn8dACffDkc cmXmLtnz8M29v32Cg3vqcW0= =v9BS -----END PGP SIGNATURE----- From roland@redhat.com Mon Sep 16 00:36:00 2002 From: roland@redhat.com (Roland McGrath) Date: Mon, 16 Sep 2002 00:36:00 -0000 Subject: Fix _exit for Linux In-Reply-To: Ulrich Drepper's message of Monday, 16 September 2002 00:10:19 -0700 <3D8583DB.3050800@redhat.com> Message-ID: <200209160732.g8G7Wkw05656@dhcp187.sf.frob.com> > Not every system might have this function and it is not exported. > Therefore having the rule in a sysdep Makefile is correct. Systems that don't have it are broken now because generic/libc-start.c refers to it. Either it belongs in the generic code and the generic makefile, or it belongs in the sysdeps makefile and a sysdeps libc-start.c. From drepper@redhat.com Mon Sep 16 00:45:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 16 Sep 2002 00:45:00 -0000 Subject: Fix _exit for Linux References: <200209160732.g8G7Wkw05656@dhcp187.sf.frob.com> Message-ID: <3D858BEB.2070707@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roland McGrath wrote: > Systems that don't have it are broken now because generic/libc-start.c > refers to it. Either it belongs in the generic code and the generic > makefile, or it belongs in the sysdeps makefile and a sysdeps libc-start.c. libc-start.c used __exit_thread only if HAVE_CANCELBUF is defined. If this symbol is defined (at it isn't in the public code) then the function is not used. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9hYvv2ijCOnn/RHQRAjWpAJsEqc7dhMu+BUeNLo1MKvHTpM9TcwCdFWcO vG2RjU06PyoVOVeU2hdIbSw= =DzVZ -----END PGP SIGNATURE----- From aj@suse.de Mon Sep 16 00:50:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 16 Sep 2002 00:50:00 -0000 Subject: problems with ctype... In-Reply-To: <20020916090138.B1013@sunsite.ms.mff.cuni.cz> (Jakub Jelinek's message of "Mon, 16 Sep 2002 09:01:38 +0200") References: <200209160512.g8G5CUF04935@dhcp187.sf.frob.com> <20020916090138.B1013@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > On Mon, Sep 16, 2002 at 08:52:35AM +0200, Andreas Jaeger wrote: >> Roland McGrath writes: >> >> > It certainly works fine for me, but I am not using the same tools. >> > I am using GCC 3.2 with RH modifications and binutils is also a RH version. >> >> I just tried it with newer binutils (2.12.90.0.15 20020717) and that >> worked fine. We might need to document the minimal supported binutils >> version. > > Ours is binutils 2.13.90.0.2. Well, we need to find out the oldest > binutils which worked ok and also write a binutils testcase whcih will > ensure this will work right from now on. I can easily test this with my old and broken binutils (2.12.90.0.4 20020408) but so far I didn't fully grab the problem and how a testcase might look. > I think it is an useful feature to be able to access a compat-only variable > (and getting to it through aliases doesn't work because of COPY relocs). Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Mon Sep 16 02:22:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 16 Sep 2002 02:22:00 -0000 Subject: problems with ctype... In-Reply-To: ; from aj@suse.de on Mon, Sep 16, 2002 at 09:03:54AM +0200 References: <200209160512.g8G5CUF04935@dhcp187.sf.frob.com> <20020916090138.B1013@sunsite.ms.mff.cuni.cz> Message-ID: <20020916112220.C1013@sunsite.ms.mff.cuni.cz> On Mon, Sep 16, 2002 at 09:03:54AM +0200, Andreas Jaeger wrote: > Jakub Jelinek writes: > > > On Mon, Sep 16, 2002 at 08:52:35AM +0200, Andreas Jaeger wrote: > >> Roland McGrath writes: > >> > >> > It certainly works fine for me, but I am not using the same tools. > >> > I am using GCC 3.2 with RH modifications and binutils is also a RH version. > >> > >> I just tried it with newer binutils (2.12.90.0.15 20020717) and that > >> worked fine. We might need to document the minimal supported binutils > >> version. > > > > Ours is binutils 2.13.90.0.2. Well, we need to find out the oldest > > binutils which worked ok and also write a binutils testcase whcih will > > ensure this will work right from now on. > > I can easily test this with my old and broken binutils (2.12.90.0.4 > 20020408) but so far I didn't fully grab the problem and how a > testcase might look. > > > I think it is an useful feature to be able to access a compat-only variable > > (and getting to it through aliases doesn't work because of COPY relocs). Actually, looking at it again, what is in CVS doesn't work at all. Just readelf -Wr libc.so | grep __ctype to find out. If it was supposed to work, it would have to have __ctype_b@GLIBC_2.0 (or __ctype_b@@GLIBC_2.0) etc. dynamic relocs. I'm afraid we're back where we used to be, ie. either have to make these symbols @@GLIBC_2.0 etc. (while leaving the headers as is, ie. not declaring nor using them), or have to apply post-link hackery using libelf, or come up with a new binutils solution and require binutils 2.14+. Jakub From roland@redhat.com Mon Sep 16 06:22:00 2002 From: roland@redhat.com (Roland McGrath) Date: Mon, 16 Sep 2002 06:22:00 -0000 Subject: problems with ctype... In-Reply-To: Jakub Jelinek's message of Monday, 16 September 2002 11:22:20 +0200 <20020916112220.C1013@sunsite.ms.mff.cuni.cz> Message-ID: <200209161203.g8GC3wa02139@magilla.sf.frob.com> > Actually, looking at it again, what is in CVS doesn't work at all. Works just fine for me. > Just readelf -Wr libc.so | grep __ctype to find out. You mean -Ws, no doubt. Here are just the __ctype_b matches in mine: 1721: 00021f98 114 FUNC GLOBAL DEFAULT 11 __ctype_b_loc@@GLIBC_2.3 2013: 00112a34 4 OBJECT GLOBAL DEFAULT 16 __ctype_b@GLIBC_2.0 3595: 00112a34 4 OBJECT LOCAL DEFAULT 16 __ctype_b 6681: 00021f98 114 FUNC GLOBAL DEFAULT 11 __ctype_b_loc 6973: 00112a34 4 OBJECT GLOBAL DEFAULT 16 __ctype_b@GLIBC_2.0 > If it was supposed to work, it would have to have __ctype_b@GLIBC_2.0 > (or __ctype_b@@GLIBC_2.0) etc. dynamic relocs. ??? Must be too early in the morning, else it's too late for me. There are no relocs referring to these symbols because the references resolve internally. There are dynamic symbol table entries as there should be. From jakub@redhat.com Mon Sep 16 06:44:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 16 Sep 2002 06:44:00 -0000 Subject: ld.so TLS problems Message-ID: <20020916154413.E1013@sunsite.ms.mff.cuni.cz> Hi! We have a problem with errno in --with-tls ld.so: case R_386_TLS_TPOFF32: /* The offset is positive, backward from the thread pointer. */ # ifdef RTLD_BOOTSTRAP *reloc_addr += map->l_tls_offset - sym->st_value; # else /* We know the offset of object the symbol is contained in. It is a positive value which will be subtracted from the thread pointer. To get the variable position in the TLS block we subtract the offset from that of the TLS block. */ if (sym != NULL) *reloc_addr += sym_map->l_tls_offset - sym->st_value; # endif This means that errno R_386_TLS_TPOFF32 .got slot is relocated twice, without undoing what the first ld.so relocation did. Even if _dl_rtld_map l_tls_offset is (temporarily) adjusted for its initial l_tls_offset, I have a problem with prelink: if prelink is to store the initial TPOFF32 reloc into ld.so, it would either have to do REL->RELA conversion for ld.so (very bad - rela handling is ATM #ifndef RTLD_BOOTSTRAP), or would have to be special cased for ld.so all over prelink. I wonder, do we really need TLS errno in ld.so? ATM --without-tls ld.so has its private errno and __errno_location which returns address of that variable (for all threads). Either this means that all accesses to errno within the dynamic linker are before application starts, or are guarded by dl_load_lock. Or it means --without-tls ld.so is broken (as two different threads could modify/read the same errno variable at the same time). If the former is true, I think we should just use extern int errno attribute_hidden; for IS_IN_rtld, otherwise we need to fix --without-tls ld.so first... The only other TLS variable ld.so uses is __libc_tsd_DL_ERROR (but this one for some reason doesn't use TPOFF32 ATM, will figure out what's going on). I think that could be handled by *(GL(__libc_internal_tsd_[sg]et))(). Jakub From hjl@lucon.org Mon Sep 16 08:01:00 2002 From: hjl@lucon.org (H. J. Lu) Date: Mon, 16 Sep 2002 08:01:00 -0000 Subject: problems with ctype... In-Reply-To: ; from aj@suse.de on Mon, Sep 16, 2002 at 08:52:35AM +0200 References: <200209160512.g8G5CUF04935@dhcp187.sf.frob.com> Message-ID: <20020916080124.A2206@lucon.org> On Mon, Sep 16, 2002 at 08:52:35AM +0200, Andreas Jaeger wrote: > Roland McGrath writes: > > > It certainly works fine for me, but I am not using the same tools. > > I am using GCC 3.2 with RH modifications and binutils is also a RH version. > > I just tried it with newer binutils (2.12.90.0.15 20020717) and that > worked fine. We might need to document the minimal supported binutils > version. >From release.binutils-2.13.90.0.4: ---- Changes from binutils 2.13.90.0.3: 1. Update from binutils 2002 0814. 2. Fix symbol versioning bugs for gcc 3.2. 3. Fix mips gas. Changes from binutils 2.13.90.0.2: 1. Update from binutils 2002 0809. 2. Fix a mips gas compatibility bug. 3. Fix an x86 TLS bfd bug. 4. Fix an x86 PIC gas bug. 5. Improve symbol versioning support. Changes from binutils 2.12.90.0.15: 1. Update from binutils 2002 0802. 2. Initial support for mips n32 ABI. 3. Fix some x86 TLS bugs. Changes from binutils 2.12.90.0.14: 1. Update from binutils 2002 0717. 2. Fix an ia64 assembler bug. 3. Fix a symbol versioning bug. 4. You have to upgrade to modutils 2.4.19 or apply the modutils patch enclosed here in order to support System.map generated by the new nm. --- If you have to document the minimal supported binutils version, please use 2.13.90.0.4 since it has another symbol versioning fix. H.J. From hjl@lucon.org Mon Sep 16 08:04:00 2002 From: hjl@lucon.org (H. J. Lu) Date: Mon, 16 Sep 2002 08:04:00 -0000 Subject: problems with ctype... In-Reply-To: <20020916090138.B1013@sunsite.ms.mff.cuni.cz>; from jakub@redhat.com on Mon, Sep 16, 2002 at 09:01:38AM +0200 References: <200209160512.g8G5CUF04935@dhcp187.sf.frob.com> <20020916090138.B1013@sunsite.ms.mff.cuni.cz> Message-ID: <20020916080445.B2206@lucon.org> On Mon, Sep 16, 2002 at 09:01:38AM +0200, Jakub Jelinek wrote: > > Ours is binutils 2.13.90.0.2. Well, we need to find out the oldest > binutils which worked ok and also write a binutils testcase whcih will > ensure this will work right from now on. I added at least one testcase to binutils for each symbol versioning bug I fixed. You can take a look at them. H.J. From hjl@lucon.org Mon Sep 16 08:07:00 2002 From: hjl@lucon.org (H. J. Lu) Date: Mon, 16 Sep 2002 08:07:00 -0000 Subject: problems with ctype... In-Reply-To: ; from aj@suse.de on Mon, Sep 16, 2002 at 09:00:59AM +0200 References: <200209160656.g8G6ug205482@dhcp187.sf.frob.com> Message-ID: <20020916080738.C2206@lucon.org> On Mon, Sep 16, 2002 at 09:00:59AM +0200, Andreas Jaeger wrote: > Roland McGrath writes: > > >> I just tried it with newer binutils (2.12.90.0.15 20020717) and that > >> worked fine. We might need to document the minimal supported binutils > >> version. > > > > Certainly so. If there is some simple change that makes it work with more > > binutils versions, I would be happy with that too. > > Unfortunatly I haven't figured out such a way yet :-( They are real bugs exposed by glibc 2.3 and gcc 3.2. Please ask users to upgrade binutils. H.J. From aj@suse.de Mon Sep 16 09:37:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 16 Sep 2002 09:37:00 -0000 Subject: Fix _exit for Linux In-Reply-To: (Alexandre Oliva's message of "16 Sep 2002 11:48:44 -0300") References: Message-ID: Alexandre Oliva writes: > On Sep 16, 2002, Andreas Jaeger wrote: > >> +libc_hidden_def (_exit) > > Hmm. I don't think this is right. libc_hidden_proto (_exit) is > commented out in include/unistd.h, so, if my understanding is correct, In that case it couldn't have worked before, have a look at sysdeps/unix/_exit.S, I just copied the declarations from there and that was the default used before AFAIK. > libc_hidden_def (_exit) is not guaranteed to have the right effect. > In fact, it fails to link libc.so on mips-linux, not only because > _exit ends up undefined, but also because INLINE_SYSCALL has no > arch-specific definition on mips, and we end up with a call to > __syscall_exit, that does not exist. I've tweaked the syscall file > such that a definition for __syscall_exit is generated, but this was > not enough to get _exit() to be defined, so the link of libc.so still > failed. Please send a patch, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aoliva@redhat.com Mon Sep 16 09:46:00 2002 From: aoliva@redhat.com (Alexandre Oliva) Date: Mon, 16 Sep 2002 09:46:00 -0000 Subject: Fix _exit for Linux In-Reply-To: References: Message-ID: On Sep 16, 2002, Andreas Jaeger wrote: > +libc_hidden_def (_exit) Hmm. I don't think this is right. libc_hidden_proto (_exit) is commented out in include/unistd.h, so, if my understanding is correct, libc_hidden_def (_exit) is not guaranteed to have the right effect. In fact, it fails to link libc.so on mips-linux, not only because _exit ends up undefined, but also because INLINE_SYSCALL has no arch-specific definition on mips, and we end up with a call to __syscall_exit, that does not exist. I've tweaked the syscall file such that a definition for __syscall_exit is generated, but this was not enough to get _exit() to be defined, so the link of libc.so still failed. -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org} CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist Professional serial bug killer From aoliva@redhat.com Mon Sep 16 09:52:00 2002 From: aoliva@redhat.com (Alexandre Oliva) Date: Mon, 16 Sep 2002 09:52:00 -0000 Subject: Fix _exit for Linux In-Reply-To: References: Message-ID: On Sep 16, 2002, Andreas Jaeger wrote: > Alexandre Oliva writes: >> On Sep 16, 2002, Andreas Jaeger wrote: >> >>> +libc_hidden_def (_exit) >> >> Hmm. I don't think this is right. libc_hidden_proto (_exit) is >> commented out in include/unistd.h, so, if my understanding is correct, > In that case it couldn't have worked before, have a look at > sysdeps/unix/_exit.S, I just copied the declarations from there and > that was the default used before AFAIK. I found that confusing too. But the difference is that in the assembly implementation, the prototype declaration doesn't matter, as it is the assembly code that determines the symbol name in the function definition, whereas in C it is the prototype declaration that has the symbol renamed. > Please send a patch, As soon as I get confirmation on whether we're to actually hide _exit() or not. -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org} CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist Professional serial bug killer From jakub@redhat.com Mon Sep 16 09:54:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 16 Sep 2002 09:54:00 -0000 Subject: Fix _exit for Linux In-Reply-To: ; from aj@suse.de on Mon, Sep 16, 2002 at 05:57:08PM +0200 References: Message-ID: <20020916185406.G1013@sunsite.ms.mff.cuni.cz> On Mon, Sep 16, 2002 at 05:57:08PM +0200, Andreas Jaeger wrote: > Alexandre Oliva writes: > > > On Sep 16, 2002, Andreas Jaeger wrote: > > > >> +libc_hidden_def (_exit) > > > > Hmm. I don't think this is right. libc_hidden_proto (_exit) is > > commented out in include/unistd.h, so, if my understanding is correct, > > In that case it couldn't have worked before, have a look at > sysdeps/unix/_exit.S, I just copied the declarations from there and > that was the default used before AFAIK. There is a difference between libc_hidden_def in .S files and in .c files. In .S files it will work even if libc_hidden_proto () was not declared in header files (usually the assembly doesn't even include those headers), while if you use libc_hidden_{def,weak} without previous libc_hidden_proto, things will break badly... Jakub From drepper@redhat.com Mon Sep 16 10:14:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 16 Sep 2002 10:14:00 -0000 Subject: Fix _exit for Linux References: <20020916185406.G1013@sunsite.ms.mff.cuni.cz> Message-ID: <3D861180.2070903@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > There is a difference between libc_hidden_def in .S files and in .c files. > In .S files it will work even if libc_hidden_proto () was not declared > in header files (usually the assembly doesn't even include those headers), > while if you use libc_hidden_{def,weak} without previous libc_hidden_proto, > things will break badly... Anyway, the _exit code can now be hidden. The implementation in glibc itself is now correct if compiled with the new kernel headers so there is no need to allow it to be overwritten. Let's change include/unistd.h and add hidden everywhere for _exit. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9hhGA2ijCOnn/RHQRAodIAKDGKsw02EoXxh2IKij3axJlDlb80ACgtfNr bj9Y/7TEIN7bdij2o/pIUfU= =/JH9 -----END PGP SIGNATURE----- From roland@redhat.com Mon Sep 16 21:54:00 2002 From: roland@redhat.com (Roland McGrath) Date: Mon, 16 Sep 2002 21:54:00 -0000 Subject: problems with ctype... In-Reply-To: H. J. Lu's message of Monday, 16 September 2002 08:07:38 -0700 <20020916080738.C2206@lucon.org> Message-ID: <200209170454.g8H4sPl03090@magilla.sf.frob.com> > They are real bugs exposed by glibc 2.3 and gcc 3.2. Please ask users > to upgrade binutils. I think that is fine, we just need to be able to make it easy for users for be doing the right thing. i.e. a configure check that will really prevent people from attempting to use the losing tools. Hopefully we can see a future GNU binutils release relatively soon so that we can have a clear, canonical, and official GNU, best version to refer to. From hjl@lucon.org Mon Sep 16 22:00:00 2002 From: hjl@lucon.org (H. J. Lu) Date: Mon, 16 Sep 2002 22:00:00 -0000 Subject: problems with ctype... In-Reply-To: <200209170454.g8H4sPl03090@magilla.sf.frob.com>; from roland@redhat.com on Mon, Sep 16, 2002 at 09:54:25PM -0700 References: <20020916080738.C2206@lucon.org> <200209170454.g8H4sPl03090@magilla.sf.frob.com> Message-ID: <20020916220020.A2904@lucon.org> On Mon, Sep 16, 2002 at 09:54:25PM -0700, Roland McGrath wrote: > > They are real bugs exposed by glibc 2.3 and gcc 3.2. Please ask users > > to upgrade binutils. > > I think that is fine, we just need to be able to make it easy for users for > be doing the right thing. i.e. a configure check that will really prevent You can take a look at the testcases I added to binutils. They are vers23, vers22 and vers21 in ld/testsuite/ld-elfvers. > people from attempting to use the losing tools. Hopefully we can see a > future GNU binutils release relatively soon so that we can have a clear, > canonical, and official GNU, best version to refer to. I don't think you can count on that unless they make a release for every Linux bug fixed, which is what I have been doing with my Linux binutils. H.J. From aj@suse.de Tue Sep 17 09:28:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Tue, 17 Sep 2002 09:28:00 -0000 Subject: Fix warnings Message-ID: Building glibc produces lots of these warnings: ../include/ctype.h:27: warning: no previous prototype for `__ctype_b_loc' ../include/ctype.h:37: warning: no previous prototype for `__ctype_toupper_loc' ../include/ctype.h:47: warning: no previous prototype for `__ctype_tolower_loc' And these: ctype_l.c:28: warning: no previous prototype for `__isalnum_l' ctype_l.c:29: warning: no previous prototype for `__isalpha_l' ctype_l.c:30: warning: no previous prototype for `__iscntrl_l' And also this one: ../sysdeps/posix/spawni.c:278: warning: control reaches end of non-void function How can we add an __attribute__ ((noreturn)) to _exit in include/unistd.h? Ok to commit the appended patch for the ctype warnings? Andreas 2002-09-17 Andreas Jaeger * ctype/ctype_l.c (func): Add prototype. * include/ctype.h: Add prototypes for __ctype_b_loc, __ctype_toupper_loc, __ctype_tolower_loc to remove warnings. ============================================================ Index: ctype/ctype_l.c --- ctype/ctype_l.c 6 Aug 2002 08:39:59 -0000 1.4 +++ ctype/ctype_l.c 17 Sep 2002 16:21:09 -0000 @@ -21,7 +21,8 @@ /* Provide real-function versions of all the ctype macros. */ -#define func(name, type) \ +#define func(name, type) \ + extern int __##name (int c, __locale_t l); \ int __##name (int c, __locale_t l) { return __isctype_l (c, type, l); } \ weak_alias (__##name, name) ============================================================ Index: include/ctype.h --- include/ctype.h 2 Sep 2002 07:08:54 -0000 1.5 +++ include/ctype.h 17 Sep 2002 16:21:09 -0000 @@ -22,6 +22,11 @@ __libc_tsd_define (extern, CTYPE_B) __libc_tsd_define (extern, CTYPE_TOUPPER) __libc_tsd_define (extern, CTYPE_TOLOWER) +extern const uint16_t ** __attribute__ ((const)) __ctype_b_loc (void); +extern const int32_t ** __attribute__ ((const)) __ctype_toupper_loc (void); +extern const int32_t ** __attribute__ ((const)) __ctype_tolower_loc (void); + + CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const)) __ctype_b_loc (void) { -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From roland@redhat.com Tue Sep 17 13:28:00 2002 From: roland@redhat.com (Roland McGrath) Date: Tue, 17 Sep 2002 13:28:00 -0000 Subject: Fix warnings In-Reply-To: Andreas Jaeger's message of Tuesday, 17 September 2002 18:28:42 +0200 Message-ID: <200209172027.g8HKRtb07411@magilla.sf.frob.com> > Building glibc produces lots of these warnings: > ../include/ctype.h:27: warning: no previous prototype for `__ctype_b_loc' > ../include/ctype.h:37: warning: no previous prototype for `__ctype_toupper_loc' > ../include/ctype.h:47: warning: no previous prototype for `__ctype_tolower_loc' Compiling what files? I don't see any such warnings. Are you using unusual options? What compiler? > And also this one: > ../sysdeps/posix/spawni.c:278: warning: control reaches end of non-void function > > How can we add an __attribute__ ((noreturn)) to _exit in include/unistd.h? It's a GCC bug. The attributes should be preserved by using typeof in libc_hidden_proto, but are not. I see Ulrich has put it in a workaround, but I think we should have just ignored it and get GCC fixed. From ralf@linux-mips.org Tue Sep 17 20:20:00 2002 From: ralf@linux-mips.org (Ralf Baechle) Date: Tue, 17 Sep 2002 20:20:00 -0000 Subject: Signal handler arguments Message-ID: <20020918052025.A23294@linux-mips.org> I'm revamping the sycall interfaces of the 64-bit Linux/MIPS kernel. So far the 32-bit MIPS kernel is calling all non rt-signal handlers as: handler(signr, 0, struct sigcontext *) The rt-signal handlers (setup with SA_SIGINFO) get invoked as: handler(signr, struct siginfo *, struct ucontext *) What do applicable standards say about the arguments passed to signal handlers? I'd like to settle with just the second signal handler type as the x86-64 port seems to do but I'm a bit nervous that this might break application code or standard compliance. Can anybody shed light into this? Thanks, Ralf From drepper@redhat.com Tue Sep 17 21:06:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 17 Sep 2002 21:06:00 -0000 Subject: Signal handler arguments References: <20020918052025.A23294@linux-mips.org> Message-ID: <3D87FBA7.4010907@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ralf Baechle wrote: > handler(signr, 0, struct sigcontext *) > > The rt-signal handlers (setup with SA_SIGINFO) get invoked as: > > handler(signr, struct siginfo *, struct ucontext *) > > What do applicable standards say about the arguments passed to signal > handlers? void (*sa_handler)(int) What to do on receipt of signal. sigset_t sa_mask Set of signals to be blocked during execution of the signal handling function. int sa_flags Special flags. void (*)(int, siginfo_t *, void *) sa_sigaction Pointer to signal handler function or one of the macros SIG_IGN or SIG_DFL. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9h/uq2ijCOnn/RHQRAn6SAKCzssVnfBUo6fgiyjWJYOUTb9xSDACgnRhO uQzkoOoA81hLw6LVvYM5vn4= =S1W3 -----END PGP SIGNATURE----- From roland@redhat.com Tue Sep 17 22:15:00 2002 From: roland@redhat.com (Roland McGrath) Date: Tue, 17 Sep 2002 22:15:00 -0000 Subject: Signal handler arguments In-Reply-To: Ulrich Drepper's message of Tuesday, 17 September 2002 21:05:59 -0700 <3D87FBA7.4010907@redhat.com> Message-ID: <200209180515.g8I5F1h13409@magilla.sf.frob.com> The only standards per se is what Ulrich cited. That is, the SA_SIGINFO signature you already have and all that's required is the first argument for the no-SA_SIGINFO case. So by the standards, it would always be fine to just pass the SA_SIGINFO form. What really matters though is existing practice on your platform. The traditional signature before SA_SIGINFO was invented was (int sig, long code, struct sigcontext *) i.e. compatible with what you cited. For signals like SIGSEGV/SIGBUS the CODE parameter is something useful like an address. If it's really always been 0 on mips for all signals, then there can't be anything expecting a useful value. The struct sigcontext parameter might be another story. But if you are breaking binary compatibility with the struct sigcontext format anyway, then you don't care. From aj@suse.de Wed Sep 18 00:00:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Wed, 18 Sep 2002 00:00:00 -0000 Subject: Fix warnings In-Reply-To: <200209172027.g8HKRtb07411@magilla.sf.frob.com> (Roland McGrath's message of "Tue, 17 Sep 2002 13:27:55 -0700") References: <200209172027.g8HKRtb07411@magilla.sf.frob.com> Message-ID: Roland McGrath writes: >> Building glibc produces lots of these warnings: >> ../include/ctype.h:27: warning: no previous prototype for `__ctype_b_loc' >> ../include/ctype.h:37: warning: no previous prototype for `__ctype_toupper_loc' >> ../include/ctype.h:47: warning: no previous prototype for `__ctype_tolower_loc' > > Compiling what files? I don't see any such warnings. Are you using > unusual options? What compiler? GCC 3.2 and using -Wmissing-prototypes -Wmissing-declarations to find such problems. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From roland@redhat.com Wed Sep 18 00:09:00 2002 From: roland@redhat.com (Roland McGrath) Date: Wed, 18 Sep 2002 00:09:00 -0000 Subject: Fix warnings In-Reply-To: Andreas Jaeger's message of Wednesday, 18 September 2002 08:42:13 +0200 Message-ID: <200209180709.g8I79eT14228@magilla.sf.frob.com> > GCC 3.2 and using -Wmissing-prototypes -Wmissing-declarations to find > such problems. Ah, well extra warning options are sometimes not in the makefile for a reason. I don't think the warnings for failing to have declared a prototype prior to the prototype definition of a function are really useful. The changes you make to suppress those warnings just give us yet more error-prone duplication to wade through and have to fix up with duplicate changes forevermore. From aj@suse.de Wed Sep 18 02:00:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Wed, 18 Sep 2002 02:00:00 -0000 Subject: Fix warnings In-Reply-To: <200209180709.g8I79eT14228@magilla.sf.frob.com> (Roland McGrath's message of "Wed, 18 Sep 2002 00:09:40 -0700") References: <200209180709.g8I79eT14228@magilla.sf.frob.com> Message-ID: Roland McGrath writes: >> GCC 3.2 and using -Wmissing-prototypes -Wmissing-declarations to find >> such problems. > > Ah, well extra warning options are sometimes not in the makefile for a > reason. I don't think the warnings for failing to have declared a > prototype prior to the prototype definition of a function are really > useful. The changes you make to suppress those warnings just give us yet > more error-prone duplication to wade through and have to fix up with > duplicate changes forevermore. >From Makeconfig: # Extra flags to pass to GCC. ifeq ($(all-warnings),yes) +gccwarn := -Wall -Wwrite-strings -Winline -Wstrict-prototypes -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar So, is the goal to get these warnings shut down eventually - or not? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From roland@redhat.com Wed Sep 18 02:32:00 2002 From: roland@redhat.com (Roland McGrath) Date: Wed, 18 Sep 2002 02:32:00 -0000 Subject: Fix warnings In-Reply-To: Andreas Jaeger's message of Wednesday, 18 September 2002 11:00:44 +0200 Message-ID: <200209180931.g8I9Vvc14872@magilla.sf.frob.com> > So, is the goal to get these warnings shut down eventually - or not? I don't think so. Some of the gcc warnings are just overeager. From roland@redhat.com Wed Sep 18 11:34:00 2002 From: roland@redhat.com (Roland McGrath) Date: Wed, 18 Sep 2002 11:34:00 -0000 Subject: problems with ctype... In-Reply-To: Jakub Jelinek's message of Monday, 16 September 2002 09:29:49 -0400 <20020916092949.A12870@devserv.devel.redhat.com> Message-ID: <200209181834.g8IIY3k07883@magilla.sf.frob.com> > Nope, I mean -Wr. If libc.so doesn't have any R_386_GLOB_DAT __ctype_b Ah, I see the problem now. Always forgetting about those pesky copy relocs. I inserted compat_symbol (i.e. .symver) decls in lc-ctype.c where the variables are set, and that gets those relocs bound early to the versioned name and thus proper GLOB_DAT relocs in the shared object. This exposed a trivial ld.so bug in handling relocs referring to non-default versioned symbols defined in the same object, which I fixed. I think this puts this problem to rest. The only thing I don't know is if older binutils versions have any problem producing the right output with this usage. I would tend to doubt off hand that it's a problem with the new straightforward usage of the symbols by their versioned names. From schwab@suse.de Sun Sep 22 09:45:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Sun, 22 Sep 2002 09:45:00 -0000 Subject: cppflags-iterator.mk Message-ID: This fixes cppflags-iterator.mk to not overwrite previous settings of CPPFLAGS-foo.c, like those in math/Makefile. 2002-09-22 Andreas Schwab * cppflags-iterator.mk (CPPFLAGS-$(cpp-src)): Append, not overwrite. --- cppflags-iterator.mk.~1.4.~ 2002-09-12 10:38:00.000000000 +0200 +++ cppflags-iterator.mk 2002-09-22 18:39:25.000000000 +0200 @@ -4,4 +4,4 @@ cpp-src := $(firstword $(cpp-srcs-left)) cpp-srcs-left := $(filter-out $(cpp-src),$(cpp-srcs-left)) -CPPFLAGS-$(cpp-src) = -DNOT_IN_libc -DIS_IN_$(lib) +CPPFLAGS-$(cpp-src) += -DNOT_IN_libc -DIS_IN_$(lib) Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, 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 Sun Sep 22 10:15:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Sun, 22 Sep 2002 10:15:00 -0000 Subject: test-src in elf/Makefile Message-ID: Hi! What is this supposed to fix: * elf/Makefile (test-srcs): Add $(modules-names) to it. test-srcs is supposed to only contain targets for binaries, but modules-names only contains .so targets. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, 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 roland@redhat.com Sun Sep 22 13:45:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 22 Sep 2002 13:45:00 -0000 Subject: cppflags-iterator.mk In-Reply-To: Andreas Schwab's message of Sunday, 22 September 2002 18:45:55 +0200 Message-ID: <200209222044.g8MKix227871@magilla.sf.frob.com> > This fixes cppflags-iterator.mk to not overwrite previous settings of > CPPFLAGS-foo.c, like those in math/Makefile. Oops! That was my fault. Thanks, I put the fix in. From roland@redhat.com Sun Sep 22 13:48:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 22 Sep 2002 13:48:00 -0000 Subject: test-src in elf/Makefile In-Reply-To: Andreas Schwab's message of Sunday, 22 September 2002 19:15:51 +0200 Message-ID: <200209222048.g8MKm8n02937@magilla.sf.frob.com> > What is this supposed to fix: > > * elf/Makefile (test-srcs): Add $(modules-names) to it. > > test-srcs is supposed to only contain targets for binaries, but > modules-names only contains .so targets. This was the easy way to make sure that cppflags-iterator.mk got used for compiling those modules, which should have -DNOT_IN_libc. I now notice that test-srcs is used for binaries-bounded, which is not appropriate for these modules, but I am not sure it hurts. From schwab@suse.de Mon Sep 23 01:53:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Mon, 23 Sep 2002 01:53:00 -0000 Subject: test-src in elf/Makefile In-Reply-To: <200209222048.g8MKm8n02937@magilla.sf.frob.com> (Roland McGrath's message of "Sun, 22 Sep 2002 13:48:08 -0700") References: <200209222048.g8MKm8n02937@magilla.sf.frob.com> Message-ID: Roland McGrath writes: |> > What is this supposed to fix: |> > |> > * elf/Makefile (test-srcs): Add $(modules-names) to it. |> > |> > test-srcs is supposed to only contain targets for binaries, but |> > modules-names only contains .so targets. |> |> This was the easy way to make sure that cppflags-iterator.mk got used for |> compiling those modules, which should have -DNOT_IN_libc. I now notice |> that test-srcs is used for binaries-bounded, which is not appropriate for |> these modules, but I am not sure it hurts. It hurts when compiling with a cross compiler, see the tests target in Rules: ifeq ($(cross-compiling),yes) tests: $(addprefix $(objpfx),$(tests) $(test-srcs)) xtests: tests else Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, 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 roland@redhat.com Mon Sep 23 10:44:00 2002 From: roland@redhat.com (Roland McGrath) Date: Mon, 23 Sep 2002 10:44:00 -0000 Subject: test-src in elf/Makefile In-Reply-To: Andreas Schwab's message of Monday, 23 September 2002 10:53:39 +0200 Message-ID: <200209231744.g8NHi5d23440@magilla.sf.frob.com> > It hurts when compiling with a cross compiler, see the tests target in > Rules: Ah, ok. I see. Thanks. I've replaced the use I added with a new variable `test-extras', which is used to give the right CPPFLAGS settings to all those modules but not for anything else. From jakub@redhat.com Tue Sep 24 08:19:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 24 Sep 2002 08:19:00 -0000 Subject: [PATCH] New sparc* elf_machine_load_address Message-ID: <20020924171931.C2194@sunsite.ms.mff.cuni.cz> Hi! I'm going to commit a change into binutils to cope with a new "feature" in Solaris ld.so and it breaks sparc-linux elf_machine_load_address unfortunately. The following method is maybe not the fastest around (2 additional reads), but certainly reliable and without need to rely on stuff like relative position between .got and .dynamic or that that ld.so is smaller than 1MB and aligned to 1MB (the last is not true for sparc32). 2002-09-24 Jakub Jelinek * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_load_address): Don't rely on *r_offset of R_SPARC_RELATIVE reloc in .got to contain the addend. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_load_address): Use the same l_addr computation. * sysdeps/sparc/sparc64/configure.in: Removed. * sysdeps/sparc/sparc64/configure: Removed. * config.h.in (SPARC64_DYNAMIC_BEFORE_GOT): Remove. --- libc/sysdeps/sparc/sparc32/dl-machine.h.jj Thu Aug 29 11:09:59 2002 +++ libc/sysdeps/sparc/sparc32/dl-machine.h Tue Sep 24 14:43:05 2002 @@ -101,21 +101,20 @@ elf_machine_dynamic (void) static inline Elf32_Addr elf_machine_load_address (void) { - register Elf32_Addr pc __asm("%o7"), pic __asm("%l7"), got; + register Elf32_Addr *pc __asm ("%o7"), *got __asm ("%l7"); - LOAD_PIC_REG (pic); + __asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" + "call 1f\n\t" + " add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" + "call _DYNAMIC\n\t" + "call _GLOBAL_OFFSET_TABLE_\n" + "1:\tadd %1, %0, %1\n\t" : "=r" (pc), "=r" (got)); - /* Utilize the fact that a local .got entry will be partially - initialized at startup awaiting its RELATIVE fixup. */ - - __asm("sethi %%hi(.Load_address),%1\n" - ".Load_address:\n\t" - "call 1f\n\t" - "or %1,%%lo(.Load_address),%1\n" - "1:\tld [%2+%1],%1" - : "=r"(pc), "=r"(got) : "r"(pic)); - - return pc - got; + /* got is now l_addr + _GLOBAL_OFFSET_TABLE_ + *got is _DYNAMIC + pc[2]*4 is l_addr + _DYNAMIC - (long)pc - 8 + pc[3]*4 is l_addr + _GLOBAL_OFFSET_TABLE_ - (long)pc - 12 */ + return (Elf32_Addr) got - *got + (pc[2] - pc[3]) * 4 - 4; } /* Set up the loaded object described by L so its unrelocated PLT --- libc/sysdeps/sparc/sparc64/configure.jj Mon Mar 11 19:33:57 2002 +++ libc/sysdeps/sparc/sparc64/configure Tue Sep 24 14:46:29 2002 @@ -1,33 +0,0 @@ - # Local configure fragment for sysdeps/sparc/sparc64. - -# Check whether .got section comes before or after .dynamic -echo $ac_n "checking where sparc64 .dynamic section comes before .got""... $ac_c" 1>&6 -echo "configure:6: checking where sparc64 .dynamic section comes before .got" >&5 -if eval "test \"`echo '$''{'libc_cv_sparc64_dynamic_before_got'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -${CC-cc} $CFLAGS -shared -Wl,--verbose 2>&1 \ - | grep '^[ ]*\.\(got\|dynamic\)[^A-Za-z0-9_]' > conftest.order - -if test `cat conftest.order | wc -l` != 2; then - { echo "configure: error: Couldn't figure .got/.dynamic relative placement" 1>&2; exit 1; } -else - - if head -n 1 conftest.order | grep '^[ ]*\.got'; then - libc_cv_sparc64_dynamic_before_got=no - else - libc_cv_sparc64_dynamic_before_got=yes - fi - -fi -rm -f conftest* -fi - -echo "$ac_t""$libc_cv_sparc64_dynamic_before_got" 1>&6 -if test $libc_cv_sparc64_dynamic_before_got = yes; then - cat >> confdefs.h <<\EOF -#define SPARC64_DYNAMIC_BEFORE_GOT 1 -EOF - -fi --- libc/sysdeps/sparc/sparc64/dl-machine.h.jj Wed Jun 5 04:27:51 2002 +++ libc/sysdeps/sparc/sparc64/dl-machine.h Tue Sep 24 14:40:18 2002 @@ -68,44 +68,21 @@ elf_machine_dynamic (void) static inline Elf64_Addr elf_machine_load_address (void) { - register Elf64_Addr *elf_pic_register __asm__("%l7"); + register Elf32_Addr *pc __asm ("%o7"); + register Elf64_Addr *got __asm ("%l7"); - LOAD_PIC_REG (elf_pic_register); - - /* We used to utilize the fact that a local .got entry will - be partially initialized at startup awaiting its RELATIVE - fixup: - - Elf64_Addr pc, la; - - __asm("sethi %%hi(.Load_address), %1\n" - ".Load_address:\n\t" - "rd %%pc, %0\n\t" - "or %1, %%lo(.Load_address), %1\n\t" - : "=r"(pc), "=r"(la)); - - return pc - *(Elf64_Addr *)(elf_pic_register + la); - - Unfortunately as binutils tries to work around Solaris - dynamic linker bug which resolves R_SPARC_RELATIVE as X += B + A - instead of X = B + A this does not work any longer, since ld - clears it. - - The following method relies on the fact that sparcv9 ABI maximal - page length is 1MB and all ELF segments on sparc64 are aligned - to 1MB. Also assumes that they both fit into the first 1MB of - the RW segment. This should be true for some time unless ld.so - grows too much, at the moment the whole stripped ld.so is 128KB - and only smaller part of that is in the RW segment. */ - -#ifdef SPARC64_DYNAMIC_BEFORE_GOT - /* If _DYNAMIC comes before _GLOBAL_OFFSET_TABLE_... */ - return ((Elf64_Addr)elf_pic_register - *elf_pic_register) & ~0xfffffUL; -#else - /* ... and if _DYNAMIC comes after _GLOBAL_OFFSET_TABLE_. */ - return ((Elf64_Addr)elf_pic_register - *elf_pic_register + 0xfffff) - & ~0xfffffUL; -#endif + __asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" + "call 1f\n\t" + " add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" + "call _DYNAMIC\n\t" + "call _GLOBAL_OFFSET_TABLE_\n" + "1:\tadd %1, %0, %1\n\t" : "=r" (pc), "=r" (got)); + + /* got is now l_addr + _GLOBAL_OFFSET_TABLE_ + *got is _DYNAMIC + pc[2]*4 is l_addr + _DYNAMIC - (long)pc - 8 + pc[3]*4 is l_addr + _GLOBAL_OFFSET_TABLE_ - (long)pc - 12 */ + return (Elf64_Addr) got - *got + (Elf32_Sword) ((pc[2] - pc[3]) * 4) - 4; } /* We have 4 cases to handle. And we code different code sequences --- libc/sysdeps/sparc/sparc64/configure.in.jj Mon Mar 11 19:33:30 2002 +++ libc/sysdeps/sparc/sparc64/configure.in Tue Sep 24 14:46:25 2002 @@ -1,26 +0,0 @@ -sinclude(./aclocal.m4)dnl Autoconf lossage -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. -# Local configure fragment for sysdeps/sparc/sparc64. - -# Check whether .got section comes before or after .dynamic -AC_CACHE_CHECK(where sparc64 .dynamic section comes before .got, - libc_cv_sparc64_dynamic_before_got, [dnl -changequote(,) -${CC-cc} $CFLAGS -shared -Wl,--verbose 2>&1 \ - | grep '^[ ]*\.\(got\|dynamic\)[^A-Za-z0-9_]' > conftest.order -changequote([,]) -if test `cat conftest.order | wc -l` != 2; then - AC_ERROR(Couldn't figure .got/.dynamic relative placement) -else - changequote(,) - if head -n 1 conftest.order | grep '^[ ]*\.got'; then - libc_cv_sparc64_dynamic_before_got=no - else - libc_cv_sparc64_dynamic_before_got=yes - fi - changequote([,]) -fi -rm -f conftest*]) -if test $libc_cv_sparc64_dynamic_before_got = yes; then - AC_DEFINE(SPARC64_DYNAMIC_BEFORE_GOT) -fi --- libc/config.h.in.jj Tue Aug 27 17:19:40 2002 +++ libc/config.h.in Tue Sep 24 14:43:52 2002 @@ -175,10 +175,6 @@ /* Mach/i386 specific: define if the `i386_io_perm_*' RPCs are available. */ #undef HAVE_I386_IO_PERM_MODIFY -/* Sparc64 specific: define if .dynamic section comes before .got for - shared libs. */ -#undef SPARC64_DYNAMIC_BEFORE_GOT - /* */ Jakub From davem@redhat.com Tue Sep 24 14:47:00 2002 From: davem@redhat.com (David S. Miller) Date: Tue, 24 Sep 2002 14:47:00 -0000 Subject: [PATCH] New sparc* elf_machine_load_address In-Reply-To: <20020924171931.C2194@sunsite.ms.mff.cuni.cz> References: <20020924171931.C2194@sunsite.ms.mff.cuni.cz> Message-ID: <20020924.143710.64973355.davem@redhat.com> From: Jakub Jelinek Date: Tue, 24 Sep 2002 17:19:31 +0200 I'm going to commit a change into binutils to cope with a new "feature" in Solaris ld.so and it breaks sparc-linux elf_machine_load_address unfortunately. The following method is maybe not the fastest around (2 additional reads), but certainly reliable and without need to rely on stuff like relative position between .got and .dynamic or that that ld.so is smaller than 1MB and aligned to 1MB (the last is not true for sparc32). It's a few cycles at startup, no big deal. I guess the binutils change could not be done keeping backwards compat with existing Linux glibc? I know people like Ben Collins et al. are going to hit this if they update binutils and keep whatever glibc sources they use right now. So I don't know how nice it is to break older glibc with a binutils update like that. From aoliva@redhat.com Tue Sep 24 20:24:00 2002 From: aoliva@redhat.com (Alexandre Oliva) Date: Tue, 24 Sep 2002 20:24:00 -0000 Subject: Fix _exit for Linux In-Reply-To: <3D861180.2070903@redhat.com> References: <20020916185406.G1013@sunsite.ms.mff.cuni.cz> <3D861180.2070903@redhat.com> Message-ID: On Sep 16, 2002, Ulrich Drepper wrote: > Jakub Jelinek wrote: >> There is a difference between libc_hidden_def in .S files and in .c files. >> In .S files it will work even if libc_hidden_proto () was not declared >> in header files (usually the assembly doesn't even include those headers), >> while if you use libc_hidden_{def,weak} without previous libc_hidden_proto, >> things will break badly... > Anyway, the _exit code can now be hidden. The implementation in glibc > itself is now correct if compiled with the new kernel headers so there > is no need to allow it to be overwritten. Let's change > include/unistd.h and add hidden everywhere for _exit. Apologies for the delay. Here's the patch that fixes the mips port such that libc.so doesn't fail to link because __syscall_exit is not defined. -------------- next part -------------- A non-text attachment was scrubbed... Name: glibc-mips-_exit.patch Type: text/x-patch Size: 834 bytes Desc: not available URL: -------------- next part -------------- -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org} CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist Professional serial bug killer From roland@redhat.com Tue Sep 24 20:28:00 2002 From: roland@redhat.com (Roland McGrath) Date: Tue, 24 Sep 2002 20:28:00 -0000 Subject: Fix _exit for Linux In-Reply-To: Alexandre Oliva's message of , 25 September 2002 00:24:45 -0300 Message-ID: <200209250328.g8P3Sjm19237@magilla.sf.frob.com> I think you can just add the alias to sysdeps/unix/_exit.S instead. From drepper@redhat.com Tue Sep 24 20:35:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 24 Sep 2002 20:35:00 -0000 Subject: Fix _exit for Linux References: <200209250328.g8P3Sjm19237@magilla.sf.frob.com> Message-ID: <3D912EE8.9000409@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roland McGrath wrote: > I think you can just add the alias to sysdeps/unix/_exit.S instead. No. MIPS is one of the platforms without a functioning INLINE_SYSCALL implementation. They need __syscall_* entry points. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9kS7o2ijCOnn/RHQRAt2vAJ9numer5IQ70wh6H58xVnjTTtUN7gCfVGbT 5DX6d3+KJvnNLrC7ic7zRJ8= =S4rk -----END PGP SIGNATURE----- From roland@redhat.com Tue Sep 24 21:08:00 2002 From: roland@redhat.com (Roland McGrath) Date: Tue, 24 Sep 2002 21:08:00 -0000 Subject: Fix _exit for Linux In-Reply-To: Ulrich Drepper's message of Tuesday, 24 September 2002 20:35:04 -0700 <3D912EE8.9000409@redhat.com> Message-ID: <200209250408.g8P48Pw19378@magilla.sf.frob.com> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Roland McGrath wrote: > > I think you can just add the alias to sysdeps/unix/_exit.S instead. > > No. MIPS is one of the platforms without a functioning INLINE_SYSCALL > implementation. They need __syscall_* entry points. Yes, they need a __syscall_exit alias for _exit. Why not use an alias of the existing _exit instead of having syscalls.list generate a different one? From drepper@redhat.com Tue Sep 24 21:53:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 24 Sep 2002 21:53:00 -0000 Subject: Fix _exit for Linux References: <200209250408.g8P48Pw19378@magilla.sf.frob.com> Message-ID: <3D914135.50200@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roland McGrath wrote: > Yes, they need a __syscall_exit alias for _exit. Why not use an alias of > the existing _exit instead of having syscalls.list generate a different one? It's not an alias. The _exit function does now more than it did before and the exit syscall is only part of the job. At least if the exit_group syscall is also known at compile time. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9kUE52ijCOnn/RHQRAuAsAKC9/noWjvA5IYbqIYwijGqviSm4JwCgoo69 9Qo9F8FgbDx7BjlNwV2wQh0= =v1lG -----END PGP SIGNATURE----- From aoliva@redhat.com Tue Sep 24 21:55:00 2002 From: aoliva@redhat.com (Alexandre Oliva) Date: Tue, 24 Sep 2002 21:55:00 -0000 Subject: Fix _exit for Linux In-Reply-To: <200209250408.g8P48Pw19378@magilla.sf.frob.com> References: <200209250408.g8P48Pw19378@magilla.sf.frob.com> Message-ID: On Sep 25, 2002, Roland McGrath wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Roland McGrath wrote: >> > I think you can just add the alias to sysdeps/unix/_exit.S instead. >> >> No. MIPS is one of the platforms without a functioning INLINE_SYSCALL >> implementation. They need __syscall_* entry points. > Yes, they need a __syscall_exit alias for _exit. Such that _exit calls itself recursively? (this was my first reading) I don't see any useful code in sysdeps/unix/_exit.S. Certainly not anything that resembles an actual system call. What do you mean? Perhaps that the syscall code generated by syscalls.list should define _exit as an alias to __syscall_exit? -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org} CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist Professional serial bug killer From roland@redhat.com Tue Sep 24 22:01:00 2002 From: roland@redhat.com (Roland McGrath) Date: Tue, 24 Sep 2002 22:01:00 -0000 Subject: Fix _exit for Linux In-Reply-To: Alexandre Oliva's message of , 25 September 2002 01:55:24 -0300 Message-ID: <200209250501.g8P51Si19569@magilla.sf.frob.com> > I don't see any useful code in sysdeps/unix/_exit.S. Certainly not > anything that resembles an actual system call. The `PSEUDO' macro does all the work that is done for any actual system call defined in libc. From roland@redhat.com Tue Sep 24 22:02:00 2002 From: roland@redhat.com (Roland McGrath) Date: Tue, 24 Sep 2002 22:02:00 -0000 Subject: Fix _exit for Linux In-Reply-To: Ulrich Drepper's message of Tuesday, 24 September 2002 21:53:09 -0700 <3D914135.50200@redhat.com> Message-ID: <200209250502.g8P52CO19577@magilla.sf.frob.com> > It's not an alias. The _exit function does now more than it did before > and the exit syscall is only part of the job. At least if the > exit_group syscall is also known at compile time. Oh, right, I was overlooking the new unix/linux/_exit.c that overrides _exit.S. From aj@suse.de Wed Sep 25 10:27:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Wed, 25 Sep 2002 10:27:00 -0000 Subject: Fix _exit for Linux In-Reply-To: <3D912EE8.9000409@redhat.com> (Ulrich Drepper's message of "Tue, 24 Sep 2002 20:35:04 -0700") References: <200209250328.g8P3Sjm19237@magilla.sf.frob.com> <3D912EE8.9000409@redhat.com> Message-ID: Ulrich Drepper writes: > Roland McGrath wrote: >> I think you can just add the alias to sysdeps/unix/_exit.S instead. > > No. MIPS is one of the platforms without a functioning INLINE_SYSCALL > implementation. They need __syscall_* entry points. I've committed a similar patch that I got from elsewhere today, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Thu Sep 26 23:44:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 26 Sep 2002 23:44:00 -0000 Subject: [PATCH] _dl_addr with prelinked libs Message-ID: <20020927084342.O2194@sunsite.ms.mff.cuni.cz> Hi! Current _dl_addr sets dli_fname to _dl_argv[0] for all prelinked libraries in addition to main program (since l_addr is 0 for them). It should do that for the main binary only. 2002-09-27 Jakub Jelinek * elf/dl-addr.c (_dl_addr): Set dli_fbase to l_map_start unconditionally. Set dli_fname to _dl_argv[0] only for main program. --- libc/elf/dl-addr.c.jj 2002-09-27 08:32:30.000000000 +0200 +++ libc/elf/dl-addr.c 2002-09-27 08:42:46.000000000 +0200 @@ -60,14 +60,12 @@ _dl_addr (const void *address, Dl_info * /* Now we know what object the address lies in. */ info->dli_fname = match->l_name; - info->dli_fbase = (void *) match->l_addr; + info->dli_fbase = (void *) match->l_map_start; /* If this is the main program the information is incomplete. */ - if (__builtin_expect (info->dli_fbase == NULL, 0)) - { - info->dli_fname = _dl_argv[0]; - info->dli_fbase = (void *) match->l_map_start; - } + if (__builtin_expect (l->l_name[0], 'a') == '\0' + && l->l_type == lt_executable) + info->dli_fname = _dl_argv[0]; symtab = (const void *) D_PTR (match, l_info[DT_SYMTAB]); strtab = (const void *) D_PTR (match, l_info[DT_STRTAB]); Jakub From drepper@redhat.com Fri Sep 27 23:47:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 27 Sep 2002 23:47:00 -0000 Subject: ready for 2.3? Message-ID: <3D955075.4060405@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 With the regex problem solved all the not unimportant issues are resolved. Unless somebody sees a problem let's throw 2.3 out so that we actually get some testing done. We'll probably have a 2.3.1 release fairly soon so that the missing ppc64 and hppa patches will also be available in an official release in the very near future. - -- - ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9lVB12ijCOnn/RHQRArDuAJwOXmNrhPb7PYg+lYQyaOCfHcQpxQCgrQZO ZtD+zfWhS+LcDv2+qqi2gbs= =QcfU -----END PGP SIGNATURE----- From kukuk@suse.de Sat Sep 28 04:51:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Sat, 28 Sep 2002 04:51:00 -0000 Subject: ready for 2.3? In-Reply-To: <3D955075.4060405@redhat.com>; from drepper@redhat.com on Fri, Sep 27, 2002 at 11:47:17PM -0700 References: <3D955075.4060405@redhat.com> Message-ID: <20020928135106.A10322@suse.de> Hi Uli, there is one patch for the nice() emulation from me, where I and Andreas Jaeger already asked you for inclusion in the official tree, but never got an answer. Since all Linux Distributions have this patch in their glibc version, I think we should include it in the official release. The problem is, that, if the result of the current priority of a process and the added nice value is out of the priority range, nice should return the new priority which is really used, and not our calculated value: 2002-03-02 Thorsten Kukuk * sysdeps/unix/nice.c: Use getpriority() for the return value --- sysdeps/unix/nice.c +++ sysdeps/unix/nice.c 2002/03/02 09:40:14 @@ -43,7 +43,7 @@ result = setpriority (PRIO_PROCESS, 0, prio + incr); if (result != -1) - return prio + incr; + return getpriority (PRIO_PROCESS, 0); else return -1; -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrnstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From aj@suse.de Sat Sep 28 09:59:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sat, 28 Sep 2002 09:59:00 -0000 Subject: Fix tls build in linuxthreads_db Message-ID: I just got this failure when building glibc from CVS on i686 with --with-tls --enable-kernel=2.4.16: gcc td_thr_tls_get_addr.c -c -O -Wall -Winline -Wstrict-prototypes -Wwrite-strings -g -fPIC -I../include -I. -I/builds/glibc/main-with-tls/linuxthreads_db -I.. -I../libio -I/builds/glibc/main-with-tls -I../sysdeps/i386/elf -I../linuxthreads/sysdeps/unix/sysv/linux/i386 -I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread -I../sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv -I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/i386/i686 -I../linuxthreads/sysdeps/i386 -I../sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I /lib/modules/2.4.19-64GB-SMP/build/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DNOT_IN_libc -DIS_IN_libthread_db -o /builds/glibc/main-with-tls/linuxthreads_db/td_thr_tls_get_addr.os td_thr_tls_get_addr.c: In function `td_thr_tls_get_addr': td_thr_tls_get_addr.c:43: structure has no member named `dtv' make[2]: *** [/builds/glibc/main-with-tls/linuxthreads_db/td_thr_tls_get_addr.os] Error 1 make[2]: Leaving directory `/cvs/libc/linuxthreads_db' I'm surprised that nobody noticed this - seems that this combination has not been tested really. Ok to commit the appended patch? Andreas 2002-09-28 Andreas Jaeger * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Fix reference to dtv. ============================================================ Index: linuxthreads_db/td_thr_tls_get_addr.c --- linuxthreads_db/td_thr_tls_get_addr.c 25 Sep 2002 02:43:10 -0000 1.5 +++ linuxthreads_db/td_thr_tls_get_addr.c 28 Sep 2002 16:54:54 -0000 @@ -40,7 +40,7 @@ td_thr_tls_get_addr (const td_thrhandle_ /* Get the DTV pointer from the thread descriptor. */ if (ps_pdread (th->th_ta_p->ph, - &((struct _pthread_descr_struct *) th->th_unique)->dtv, + &((struct _pthread_descr_struct *) th->th_unique)->p_header.data.dtvp, &dtvp, sizeof dtvp) != PS_OK) return TD_ERR; /* XXX Other error value? */ -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Sat Sep 28 10:42:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 28 Sep 2002 10:42:00 -0000 Subject: Fix tls build in linuxthreads_db References: Message-ID: <3D95EA23.3030202@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andreas Jaeger wrote: > I'm surprised that nobody noticed this - seems that this combination > has not been tested really. No, it hasn't. Not surprising, since it's not supported in the moment. > Ok to commit the appended patch? I've done so now. Thanks, - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9leon2ijCOnn/RHQRAtfaAKC7TzLOQ6XxqoqtuiZXkXoimqbafQCeMy5u A7afV0pUmFRS7gWjbwx/4go= =RV2n -----END PGP SIGNATURE----- From drepper@redhat.com Sat Sep 28 12:14:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 28 Sep 2002 12:14:00 -0000 Subject: ready for 2.3? References: <3D955075.4060405@redhat.com> <20020928135106.A10322@suse.de> Message-ID: <3D95FF77.4000401@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thorsten Kukuk wrote: > * sysdeps/unix/nice.c: Use getpriority() for the return value I've applied the patch. Thanks, - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD4DBQE9lf932ijCOnn/RHQRAt3DAKC9lDfzJn5kYLUdGZgv/p0MocBCpgCWKuhe OSmM2WUeUQFCIcsvp6W2JQ== =wCKT -----END PGP SIGNATURE----- From aj@suse.de Sat Sep 28 12:26:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sat, 28 Sep 2002 12:26:00 -0000 Subject: Fix tls build in linuxthreads_db In-Reply-To: <3D95EA23.3030202@redhat.com> (Ulrich Drepper's message of "Sat, 28 Sep 2002 10:42:59 -0700") References: <3D95EA23.3030202@redhat.com> Message-ID: Ulrich Drepper writes: > Andreas Jaeger wrote: > >> I'm surprised that nobody noticed this - seems that this combination >> has not been tested really. > > No, it hasn't. Not surprising, since it's not supported in the moment. Not supported? Then we should disable it. Why it is not supported? In that case I guess this failure running make check is known: arthur:/cvs/libc/dlfcn:[1]$ LD_DEBUG=all GCONV_PATH=/builds/glibc/main-with-tls/iconvdata LC_ALL=C LD_LIBRARY_PATH=/builds/glibc/main-with-tls/dlfcn/:/builds/glibc/main-with-tls/:/builds/glibc/main-with-tls/elf /builds/glibc/main-with-tls/dlfcn/tststatic libc.so.6: shared object cannot be dlopen()ed > >> Ok to commit the appended patch? > > I've done so now. Thanks, Ok, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From roland@redhat.com Sat Sep 28 12:38:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sat, 28 Sep 2002 12:38:00 -0000 Subject: Fix tls build in linuxthreads_db In-Reply-To: Andreas Jaeger's message of Saturday, 28 September 2002 21:26:45 +0200 Message-ID: <200209281936.g8SJagl10777@magilla.sf.frob.com> > Not supported? Then we should disable it. Why it is not supported? --with-tls is not the default. It's not supported because it's not all finished, the tools aren't all finished, etc. > In that case I guess this failure running make check is known: > > arthur:/cvs/libc/dlfcn:[1]$ LD_DEBUG=all GCONV_PATH=/builds/glibc/main-with-tls/iconvdata LC_ALL=C LD_LIBRARY_PATH=/builds/glibc/main-with-tls/dlfcn/:/builds/glibc/main-with-tls/:/builds/glibc/main-with-tls/elf /builds/glibc/main-with-tls/dlfcn/tststatic > libc.so.6: shared object cannot be dlopen()ed Yes. That test will probably never work with TLS. From drepper@redhat.com Sat Sep 28 12:54:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 28 Sep 2002 12:54:00 -0000 Subject: Fix tls build in linuxthreads_db References: <3D95EA23.3030202@redhat.com> Message-ID: <3D9608D3.8090302@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andreas Jaeger wrote: > Not supported? Then we should disable it. Why it is not supported? TLS is not supported and it is disabled. You don't use --with-tls, right? There are still too many problems with it (including gdb). > In that case I guess this failure running make check is known: > > arthur:/cvs/libc/dlfcn:[1]$ LD_DEBUG=all GCONV_PATH=/builds/glibc/main-with-tls/iconvdata LC_ALL=C LD_LIBRARY_PATH=/builds/glibc/main-with-tls/dlfcn/:/builds/glibc/main-with-tls/:/builds/glibc/main-with-tls/elf /builds/glibc/main-with-tls/dlfcn/tststatic > libc.so.6: shared object cannot be dlopen()ed When and how do you get this? I'm certainly running make check and don't see any problem at all. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9lgjT2ijCOnn/RHQRAkFWAJ4tydl9KmgXazYV8aQus6cPXFiV2wCgzghb wLQgKTPWmedN5Ua8AcuEAq4= =5nBy -----END PGP SIGNATURE----- From roland@frob.com Sat Sep 28 15:02:00 2002 From: roland@frob.com (Roland McGrath) Date: Sat, 28 Sep 2002 15:02:00 -0000 Subject: ready for 2.3? In-Reply-To: Ulrich Drepper's message of Friday, 27 September 2002 23:47:17 -0700 <3D955075.4060405@redhat.com> Message-ID: <200209282200.g8SM0Q223477@magilla.sf.frob.com> The Hurd build still has some problems. I am ok with those not getting fixed in the 2.3 release (hopefully fixed in 2.3.1). But I don't know if this will be a real pain for the Debian/Hurd people. From drepper@redhat.com Sat Sep 28 15:34:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 28 Sep 2002 15:34:00 -0000 Subject: ready for 2.3? References: <200209282200.g8SM0Q223477@magilla.sf.frob.com> Message-ID: <3D962E63.3070004@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roland McGrath wrote: > The Hurd build still has some problems. I am ok with those not getting > fixed in the 2.3 release (hopefully fixed in 2.3.1). But I don't know if > this will be a real pain for the Debian/Hurd people. I haven't seen anybody rushing in to help. And that although they were on notivce for a month now. So it cannot be problematic for them. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9li5m2ijCOnn/RHQRAu1EAKCDVK82VsMqONrOMpwpmBUroxneqgCff0V+ OUxJSlOaB7qfY/SjTwCZZCI= =IJm0 -----END PGP SIGNATURE----- From aj@suse.de Sat Sep 28 23:06:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sat, 28 Sep 2002 23:06:00 -0000 Subject: Fix tls build in linuxthreads_db In-Reply-To: <3D9608D3.8090302@redhat.com> (Ulrich Drepper's message of "Sat, 28 Sep 2002 12:53:55 -0700") References: <3D95EA23.3030202@redhat.com> <3D9608D3.8090302@redhat.com> Message-ID: Ulrich Drepper writes: > Andreas Jaeger wrote: > >> Not supported? Then we should disable it. Why it is not supported? > > TLS is not supported and it is disabled. You don't use --with-tls, > right? There are still too many problems with it (including gdb). I did use --with-tls as I said in my original email. > > >> In that case I guess this failure running make check is known: >> >> arthur:/cvs/libc/dlfcn:[1]$ LD_DEBUG=all GCONV_PATH=/builds/glibc/main-with-tls/iconvdata LC_ALL=C LD_LIBRARY_PATH=/builds/glibc/main-with-tls/dlfcn/:/builds/glibc/main-with-tls/:/builds/glibc/main-with-tls/elf /builds/glibc/main-with-tls/dlfcn/tststatic >> libc.so.6: shared object cannot be dlopen()ed > > When and how do you get this? I'm certainly running make check and > don't see any problem at all. With --with-tls. Ok, then let's print out some warning that --with-tls is not supported currently, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Sun Sep 29 03:26:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sun, 29 Sep 2002 03:26:00 -0000 Subject: glibc make check fails... Message-ID: All thread tests currently fail for me - yesterday they worked fine: $ GCONV_PATH=/builds/glibc/main/iconvdata LC_ALL=C /builds/glibc/main/elf/ld-linux.so.2 --library-path /builds/glibc/main:/builds/glibc/main/math:/builds/glibc/main/elf:/builds/glibc/main/dlfcn:/builds/glibc/main/nss:/builds/glibc/main/nis:/builds/glibc/main/rt:/builds/glibc/main/resolv:/builds/glibc/main/crypt:/builds/glibc/main/linuxthreads /builds/glibc/main/linuxthreads/ex1 Segmentation fault I run configure as: /cvs/libc/configure --disable-profile --enable-add-ons --prefix=/builds/test-install --enable-kernel=2.4.18 strace shows: open("/builds/glibc/main/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\"Y\1\000"..., 1024) = 1024 fstat64(3, {st_mode=S_IFREG|0755, st_size=11459957, ...}) = 0 mmap2(NULL, 1113892, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40050000 mprotect(0x40157000, 36644, PROT_NONE) = 0 mmap2(0x40157000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x107) = 0x40157000 mmap2(0x4015c000, 16164, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4015c000 close(3) = 0 shutdown(-1073745480, 1073795200) = -1 ENOSYS (Function not implemented) --- SIGSEGV (Segmentation fault) --- +++ killed by SIGSEGV +++ Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From roland@redhat.com Sun Sep 29 03:54:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 29 Sep 2002 03:54:00 -0000 Subject: glibc make check fails... In-Reply-To: Andreas Jaeger's message of Sunday, 29 September 2002 12:26:28 +0200 Message-ID: <200209291050.g8TAotA05506@magilla.sf.frob.com> My build didn't have --enable-kernel=2.4.18 but now I've tried that and reproduced the crash, so I will fix it shortly. From roland@redhat.com Sun Sep 29 04:20:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 29 Sep 2002 04:20:00 -0000 Subject: glibc make check fails... In-Reply-To: Roland McGrath's message of Sunday, 29 September 2002 03:50:55 -0700 <200209291050.g8TAotA05506@magilla.sf.frob.com> Message-ID: <200209291116.g8TBG6U00631@magilla.sf.frob.com> Ok, I was wrong. I actually can only reproduce this in a build that's using not 2.4.18 headers but newer headers that define __NR_set_thread_area (when running on a 2.4.18 kernel that doesn't have the system call). If that is your situation too, are you sure it worked before? If that is not your situation, then I can't reproduce your situation and you will have to find some more information for me. The crash I see is from the useldt.h macros' use of INLINE_SYSCALL resulting in it calling __errno_location, which bombs when %gs isn't set up yet. AFAICT the useldt.h macros have the very same issue with errno not being set up as the TLS macros have (errno TLS var vs __errno_location definition from libpthread, but both need %gs to be set up or they crash). So I am going to consolidate those macros and use the versions that avoid trying to set errno for both. From jakub@redhat.com Sun Sep 29 04:29:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Sun, 29 Sep 2002 04:29:00 -0000 Subject: [PATCH] Fix sparcv9-linux build Message-ID: <20020929132935.G3451@sunsite.ms.mff.cuni.cz> Hi! With the recent _exit.c changes I get SIGBUS whenever a program exits (ie. already rpcgen breaks out). The problem is that gcc optimized __GI__exit into: illtrap 0xf00 b %xcc, 0 <__GI__exit+0x0> The reason is that sparc INLINE_SYSCALL macros weren't using volatile asm and thus when not looking at return value it was optimized out. Fix below, powerpc{32,64} apparently has the same problem, so I've changed that too. Other arches apparently do use __asm __volatile. 2002-09-29 Jakub Jelinek * sysdeps/unix/sysv/linux/sparc/sysdep.h (inline_syscall0): Make asm volatile. (inline_syscall1, inline_syscall2, inline_syscall3, inline_syscall4, inline_syscall5, inline_syscall6): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (INLINE_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h (INLINE_SYSCALL): Likewise. --- libc/sysdeps/unix/sysv/linux/sparc/sysdep.h.jj 2001-08-23 18:51:33.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/sparc/sysdep.h 2002-09-29 13:21:44.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 2000. @@ -27,9 +27,9 @@ ({ \ register long __o0 __asm__ ("o0"); \ register long __g1 __asm__ ("g1") = __NR_##name; \ - __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1) : \ - __SYSCALL_CLOBBERS); \ + __asm __volatile (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1) : \ + __SYSCALL_CLOBBERS); \ __o0; \ }) @@ -37,9 +37,9 @@ ({ \ register long __o0 __asm__ ("o0") = (long)(arg1); \ register long __g1 __asm__ ("g1") = __NR_##name; \ - __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1), "1" (__o0) : \ - __SYSCALL_CLOBBERS); \ + __asm __volatile (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1), "1" (__o0) : \ + __SYSCALL_CLOBBERS); \ __o0; \ }) @@ -48,9 +48,9 @@ register long __o0 __asm__ ("o0") = (long)(arg1); \ register long __o1 __asm__ ("o1") = (long)(arg2); \ register long __g1 __asm__ ("g1") = __NR_##name; \ - __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1), "1" (__o0), "r" (__o1) : \ - __SYSCALL_CLOBBERS); \ + __asm __volatile (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1), "1" (__o0), "r" (__o1) : \ + __SYSCALL_CLOBBERS); \ __o0; \ }) @@ -60,9 +60,10 @@ register long __o1 __asm__ ("o1") = (long)(arg2); \ register long __o2 __asm__ ("o2") = (long)(arg3); \ register long __g1 __asm__ ("g1") = __NR_##name; \ - __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1), "1" (__o0), "r" (__o1), "r" (__o2) : \ - __SYSCALL_CLOBBERS); \ + __asm __volatile (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1), "1" (__o0), "r" (__o1), \ + "r" (__o2) : \ + __SYSCALL_CLOBBERS); \ __o0; \ }) @@ -73,10 +74,10 @@ register long __o2 __asm__ ("o2") = (long)(arg3); \ register long __o3 __asm__ ("o3") = (long)(arg4); \ register long __g1 __asm__ ("g1") = __NR_##name; \ - __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1), "1" (__o0), "r" (__o1), "r" (__o2), \ - "r" (__o3) : \ - __SYSCALL_CLOBBERS); \ + __asm __volatile (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1), "1" (__o0), "r" (__o1), \ + "r" (__o2), "r" (__o3) : \ + __SYSCALL_CLOBBERS); \ __o0; \ }) @@ -88,10 +89,10 @@ register long __o3 __asm__ ("o3") = (long)(arg4); \ register long __o4 __asm__ ("o4") = (long)(arg5); \ register long __g1 __asm__ ("g1") = __NR_##name; \ - __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1), "1" (__o0), "r" (__o1), "r" (__o2), \ - "r" (__o3), "r" (__o4) : \ - __SYSCALL_CLOBBERS); \ + __asm __volatile (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1), "1" (__o0), "r" (__o1), \ + "r" (__o2), "r" (__o3), "r" (__o4) : \ + __SYSCALL_CLOBBERS); \ __o0; \ }) @@ -104,10 +105,11 @@ register long __o4 __asm__ ("o4") = (long)(arg5); \ register long __o5 __asm__ ("o5") = (long)(arg6); \ register long __g1 __asm__ ("g1") = __NR_##name; \ - __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1), "1" (__o0), "r" (__o1), "r" (__o2), \ - "r" (__o3), "r" (__o4), "r" (__o5) : \ - __SYSCALL_CLOBBERS); \ + __asm __volatile (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1), "1" (__o0), "r" (__o1), \ + "r" (__o2), "r" (__o3), "r" (__o4), \ + "r" (__o5) : \ + __SYSCALL_CLOBBERS); \ __o0; \ }) --- libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h.jj 2002-09-18 00:31:46.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h 2002-09-29 13:23:30.000000000 +0200 @@ -41,11 +41,11 @@ ({ \ long ret, err; \ LOADARGS_##nr(name, args); \ - __asm__ ("sc\n\t" \ - "mfcr %1\n\t" \ - : "=r" (r3), "=r" (err) \ - : ASM_INPUT_##nr \ - : "cc", "memory"); \ + __asm __volatile ("sc\n\t" \ + "mfcr %1\n\t" \ + : "=r" (r3), "=r" (err) \ + : ASM_INPUT_##nr \ + : "cc", "memory"); \ ret = r3; \ if (err & 1 << 28) \ { \ --- libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h.jj 2002-09-18 01:50:03.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h 2002-09-29 13:25:17.000000000 +0200 @@ -57,11 +57,11 @@ DECLARGS_##nr; \ long ret, err; \ LOADARGS_##nr(name, args); \ - __asm__ ("sc\n\t" \ - "mfcr %1\n\t" \ - : "=r" (r3), "=r" (err) \ - : ASM_INPUT_##nr \ - : "cc", "memory"); \ + __asm __volatile ("sc\n\t" \ + "mfcr %1\n\t" \ + : "=r" (r3), "=r" (err) \ + : ASM_INPUT_##nr \ + : "cc", "memory"); \ ret = r3; \ if (err & 1 << 28) \ { \ @@ -123,18 +123,20 @@ register long r8 __asm__ ("r8"); \ long ret, err; \ LOADARGS_##nr(name, args); \ - __asm__ ("sc\n\t" \ - "mfcr %7\n\t" \ - : "=r" (r0), "=r" (r3), "=r" (r4), "=r" (r5), \ - "=r" (r6), "=r" (r7), "=r" (r8), "=r" (err) \ - : ASM_INPUT_##nr \ - : "r9", "r10", "r11", "r12", \ - "fr0", "fr1", "fr2", "fr3", \ - "fr4", "fr5", "fr6", "fr7", \ - "fr8", "fr9", "fr10", "fr11", \ - "fr12", "fr13", \ - "ctr", "lr", \ - "cr0", "cr1", "cr5", "cr6", "cr7", "memory"); \ + __asm __volatile ("sc\n\t" \ + "mfcr %7\n\t" \ + : "=r" (r0), "=r" (r3), "=r" (r4), \ + "=r" (r5), "=r" (r6), "=r" (r7), \ + "=r" (r8), "=r" (err) \ + : ASM_INPUT_##nr \ + : "r9", "r10", "r11", "r12", \ + "fr0", "fr1", "fr2", "fr3", \ + "fr4", "fr5", "fr6", "fr7", \ + "fr8", "fr9", "fr10", "fr11", \ + "fr12", "fr13", \ + "ctr", "lr", \ + "cr0", "cr1", "cr5", "cr6", "cr7", \ + "memory"); \ ret = r3; \ if (err & 1 << 28) \ { \ Jakub From roland@redhat.com Sun Sep 29 04:32:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 29 Sep 2002 04:32:00 -0000 Subject: [PATCH] Fix sparcv9-linux build In-Reply-To: Jakub Jelinek's message of Sunday, 29 September 2002 13:29:35 +0200 <20020929132935.G3451@sunsite.ms.mff.cuni.cz> Message-ID: <200209291128.g8TBSLT12340@magilla.sf.frob.com> Thanks, I've put it in. From jakub@redhat.com Sun Sep 29 05:29:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Sun, 29 Sep 2002 05:29:00 -0000 Subject: [PATCH] Fix alpha build Message-ID: <20020929142935.H3451@sunsite.ms.mff.cuni.cz> Hi! PARAMS(args) is not defined on Alpha. In fact, IMHO GCC doesn't need it either, since longlong.h is only used in libgcc.a which is compiled already by gcc, not host compiler, and without -Wtraditional. 2002-09-29 Jakub Jelinek * stdlib/longlong.h (__udiv_qrnnd): Remove PARAMS from prototype. --- libc/stdlib/longlong.h.jj Sat Sep 28 16:40:59 2002 +++ libc/stdlib/longlong.h Sun Sep 29 08:19:21 2002 @@ -126,7 +126,7 @@ (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ (r) = __r; \ } while (0) -extern UDItype __udiv_qrnnd PARAMS ((UDItype *, UDItype, UDItype, UDItype)); +extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype); #define UDIV_TIME 220 #endif /* LONGLONG_STANDALONE */ #ifdef __alpha_cix__ Jakub From roland@redhat.com Sun Sep 29 05:35:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 29 Sep 2002 05:35:00 -0000 Subject: [PATCH] Fix alpha build In-Reply-To: Jakub Jelinek's message of Sunday, 29 September 2002 14:29:35 +0200 <20020929142935.H3451@sunsite.ms.mff.cuni.cz> Message-ID: <200209291231.g8TCV7J16629@magilla.sf.frob.com> > PARAMS(args) is not defined on Alpha. In fact, IMHO GCC doesn't need > it either, since longlong.h is only used in libgcc.a which is compiled > already by gcc, not host compiler, and without -Wtraditional. Ok. I put the change in. Please see if you can get the gcc file changed. From aj@suse.de Sun Sep 29 06:23:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sun, 29 Sep 2002 06:23:00 -0000 Subject: glibc make check fails... In-Reply-To: <200209291116.g8TBG6U00631@magilla.sf.frob.com> (Roland McGrath's message of "Sun, 29 Sep 2002 04:16:06 -0700") References: <200209291116.g8TBG6U00631@magilla.sf.frob.com> Message-ID: Roland McGrath writes: > Ok, I was wrong. I actually can only reproduce this in a build that's > using not 2.4.18 headers but newer headers that define __NR_set_thread_area > (when running on a 2.4.18 kernel that doesn't have the system call). My kernel headers do not have that call. > > If that is your situation too, are you sure it worked before? If that is > not your situation, then I can't reproduce your situation and you will have > to find some more information for me. > > The crash I see is from the useldt.h macros' use of INLINE_SYSCALL > resulting in it calling __errno_location, which bombs when %gs isn't set up > yet. AFAICT the useldt.h macros have the very same issue with errno not > being set up as the TLS macros have (errno TLS var vs __errno_location > definition from libpthread, but both need %gs to be set up or they crash). > So I am going to consolidate those macros and use the versions that avoid > trying to set errno for both. Unfortunatly my gdb cannot debug this but it's somewhere in the libpthread startup code: 22306: calling init: /builds/test-install/lib/libpthread.so.0 22306: 22306: symbol=__errno_location; lookup in file=linuxthreads/ex3 22306: symbol=__errno_location; lookup in file=/builds/test-install/lib/libpthread.so.0 22306: binding file /builds/test-install/lib/libpthread.so.0 to /builds/test-install/lib/libpthread.so.0: normal symbol `__errno_location' [GLIBC_2.0] Segmentation fault Without the --enable-kernel=2.4.18 everything works, so it seems to be a problem with the useldt code, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Sun Sep 29 06:55:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Sun, 29 Sep 2002 06:55:00 -0000 Subject: Some make check results Message-ID: <20020929155536.I3451@sunsite.ms.mff.cuni.cz> Hi! I succeeded with i386, i686 (2x - --enable-kernel=2.2.5 and --enable-kernel=2.4.1), alpha, alphaev6, ia64 builds. bug-regex12 failed everywhere (expected), likewise bug-erange (DNS is not set up in our buildroots, I think something like attached patch would be good) everywhere, string/stratcliff failed on alpha/alphaev6/ia64 and tst-timer on ia64/i686 (both builds). This was automated build, so to look up further details or debug it I need to build again. 2002-09-29 Jakub Jelinek * nss/bug-erange.c (main): Don't fail if /etc/resolv.conf doesn't exist. --- libc/nss/bug-erange.c.jj 2002-09-12 03:44:18.000000000 +0200 +++ libc/nss/bug-erange.c 2002-09-29 15:54:16.000000000 +0200 @@ -6,6 +6,7 @@ #include #include #include +#include int main (void) @@ -35,6 +36,11 @@ main (void) if (res != 0 || hp == NULL) { printf ("gethostbyname_r failed: %s (errno: %m)\n", strerror (res)); + if (access ("/etc/resolv.conf", R_OK)) + { + puts ("DNS probably not set up"); + return 0; + } return 1; } Jakub From drepper@redhat.com Sun Sep 29 10:43:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 29 Sep 2002 10:43:00 -0000 Subject: glibc make check fails... References: <200209291116.g8TBG6U00631@magilla.sf.frob.com> Message-ID: <3D973BCC.1000705@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roland McGrath wrote: > The crash I see is from the useldt.h macros' use of INLINE_SYSCALL > resulting in it calling __errno_location, which bombs when %gs isn't set up > yet. AFAICT the useldt.h macros have the very same issue with errno not > being set up as the TLS macros have (errno TLS var vs __errno_location > definition from libpthread, This is why the macros in don't use INLINE_SYSCALL. I should have caught this before. The answer is torewrite the code a bit which is trivial. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9lzvR2ijCOnn/RHQRAlgwAJ0fMZaSaXMcXC5yMCPwCXpVcHAtDQCdF03p PHOwddQvR+/13VOsfC/NBlQ= =udhH -----END PGP SIGNATURE----- From drepper@redhat.com Sun Sep 29 11:14:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 29 Sep 2002 11:14:00 -0000 Subject: glibc make check fails... References: Message-ID: <3D97430D.1060102@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andreas Jaeger wrote: > All thread tests currently fail for me - yesterday they worked fine: > > $ GCONV_PATH=/builds/glibc/main/iconvdata LC_ALL=C /builds/glibc/main/elf/ld-linux.so.2 --library-path /builds/glibc/main:/builds/glibc/main/math:/builds/glibc/main/elf:/builds/glibc/main/dlfcn:/builds/glibc/main/nss:/builds/glibc/main/nis:/builds/glibc/main/rt:/builds/glibc/main/resolv:/builds/glibc/main/crypt:/builds/glibc/main/linuxthreads /builds/glibc/main/linuxthreads/ex1 > Segmentation fault Try the current code. I haven't actually build it yet but it should at least be very close to working. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9l0MN2ijCOnn/RHQRAjn/AJsErOL3x4RJnkAHRJyGyyJ+tN8IUQCfVxwj QTSF6sIXsDuzQxYy43QDpaI= =G14X -----END PGP SIGNATURE----- From drepper@redhat.com Sun Sep 29 11:21:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 29 Sep 2002 11:21:00 -0000 Subject: Some make check results References: <20020929155536.I3451@sunsite.ms.mff.cuni.cz> Message-ID: <3D974495.4000901@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > likewise bug-erange (DNS > is not set up in our buildroots, I think something like > attached patch would be good) everywhere, I have put in your patch but I've also moved bug-erange from tests to xtests. This goal was creates for just this purpose, tests which cannot generally be run but are still useful. > string/stratcliff failed on alpha/alphaev6/ia64 I've asked rth to review the strncpy patch... > and tst-timer on ia64/i686 (both builds). Don't know what that is. Works for me. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9l0SV2ijCOnn/RHQRAqTrAKCWUKM+Fk9GTk6ZCuWP2GCjst0PeQCdGPtH Wzbz9mJA54ONxMmJiz3sjKo= =c/gX -----END PGP SIGNATURE----- From jakub@redhat.com Sun Sep 29 13:28:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Sun, 29 Sep 2002 13:28:00 -0000 Subject: [PATCH] Fix sparc64 build Message-ID: <20020929222809.K3451@sunsite.ms.mff.cuni.cz> Hi! Without this I got ../sysdeps/unix/sysv/linux/seteuid.c:26:58: operator '>' has no left operand error in sparc64 build. Verified no other broken defines like this are in kernel-features.h. sparc32 make check is still ongoing, so far only bug-regex12 failed. Also, one note to all the builds - they were done with the __ctype_b etc. exporting patch as @@GLIBC*, not @GLIBC*, so although it works for me on ia64, it probably doesn't work for others there due to ld issues. 2002-09-29 Jakub Jelinek * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_SETRESUID_SYSCALL): On the sparc, define to 1, not empty. --- libc/sysdeps/unix/sysv/linux/kernel-features.h.jj 2002-09-18 00:31:46.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/kernel-features.h 2002-09-29 22:28:04.000000000 +0200 @@ -124,7 +124,7 @@ /* Linux 2.3.39 sparc added setresuid. */ #if __LINUX_KERNEL_VERSION >= 131879 && defined __sparc__ -# define __ASSUME_SETRESUID_SYSCALL +# define __ASSUME_SETRESUID_SYSCALL 1 #endif /* Linux 2.3.39 introduced IPC64. Except for powerpc. */ Jakub From drepper@redhat.com Sun Sep 29 13:42:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 29 Sep 2002 13:42:00 -0000 Subject: [PATCH] Fix sparc64 build References: <20020929222809.K3451@sunsite.ms.mff.cuni.cz> Message-ID: <3D9765AB.5080906@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub Jelinek wrote: > * sysdeps/unix/sysv/linux/kernel-features.h > (__ASSUME_SETRESUID_SYSCALL): On the sparc, define to 1, not empty. I've applied the patch. Thanks, - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9l2Wr2ijCOnn/RHQRAst8AKCiKWHgUj6fM4JwgOERw7OiUVRLowCeNRzR g5h0ZgQ6YrlYFJnnjGkRYrI= =1ePG -----END PGP SIGNATURE----- From roland@redhat.com Sun Sep 29 14:44:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 29 Sep 2002 14:44:00 -0000 Subject: glibc make check fails... In-Reply-To: Ulrich Drepper's message of Sunday, 29 September 2002 10:43:40 -0700 <3D973BCC.1000705@redhat.com> Message-ID: <200209292138.g8TLcoi11349@magilla.sf.frob.com> > This is why the macros in don't use INLINE_SYSCALL. I should > have caught this before. The answer is torewrite the code a bit which > is trivial. Yes, just not quite trivial enough for me to do blearily at 5am today. :) However, this does not explain AJ's crash because he has a build with no __NR_set_thread_area. It must be the modify_ldt call failing, for which we have no explanation and AFAIK noone else has seen it. In principle the modify_ldt call can fail too, and it would be preferable to crash in abort as intended rather than crash in the errno access. Also I would be happier not having the duplication between tls.h and useldt.h. From roland@redhat.com Sun Sep 29 14:46:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 29 Sep 2002 14:46:00 -0000 Subject: glibc make check fails... In-Reply-To: Andreas Jaeger's message of Sunday, 29 September 2002 15:22:06 +0200 Message-ID: <200209292140.g8TLeaJ11364@magilla.sf.frob.com> > My kernel headers do not have that call. Then it is very mysterious! > Unfortunatly my gdb cannot debug this but it's somewhere in the > libpthread startup code: Do you get a core dump you can look at? > 22306: calling init: /builds/test-install/lib/libpthread.so.0 > 22306: > 22306: symbol=__errno_location; lookup in file=linuxthreads/ex3 > 22306: symbol=__errno_location; lookup in file=/builds/test-install/lib/libpthread.so.0 > 22306: binding file /builds/test-install/lib/libpthread.so.0 to /builds/test-install/lib/libpthread.so.0: normal symbol `__errno_location' [GLIBC_2.0] > Segmentation fault That looks exactly like the failure you'd expect if the set_thread_area call (via INLINE_SYSCALL) or the modify_ldt call had failed. Since you don't have set_thread_area, it must be modify_ldt but I don't think anyone else has seen that fail. From drepper@redhat.com Sun Sep 29 15:00:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 29 Sep 2002 15:00:00 -0000 Subject: glibc make check fails... References: <200209292138.g8TLcoi11349@magilla.sf.frob.com> Message-ID: <3D9777F7.7090702@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roland McGrath wrote: > However, this does not explain AJ's crash because he has a build with no > __NR_set_thread_area. It must be the modify_ldt call failing, for which we > have no explanation and AFAIK noone else has seen it. If this happens the system is in deep trouble anyway. > In principle the modify_ldt call can fail too, and it would be preferable > to crash in abort as intended rather than crash in the errno access. > Also I would be happier not having the duplication between tls.h and useldt.h. The new thread code has all this cleaned up. It's just not worth it to worry about the old code too much. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9l3f72ijCOnn/RHQRAsefAKDIxY1NFcEWVMHGsGqyeirIngR9ogCgzeI/ j+l8PBeIK3r9tTAKYDLSzvY= =XJTG -----END PGP SIGNATURE----- From roland@redhat.com Sun Sep 29 15:05:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 29 Sep 2002 15:05:00 -0000 Subject: glibc make check fails... In-Reply-To: Ulrich Drepper's message of Sunday, 29 September 2002 15:00:23 -0700 <3D9777F7.7090702@redhat.com> Message-ID: <200209292159.g8TLxel13894@magilla.sf.frob.com> > If this happens the system is in deep trouble anyway. Indeed so. But the deeper the trouble, the more every little bit less of confusion can help the poor sucker trying to find the trouble. > The new thread code has all this cleaned up. It's just not worth it to > worry about the old code too much. Agreed. From jakub@redhat.com Sun Sep 29 15:39:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Sun, 29 Sep 2002 15:39:00 -0000 Subject: [PATCH] Fix tst-timer (was Re: Some make check results) In-Reply-To: <3D974495.4000901@redhat.com>; from drepper@redhat.com on Sun, Sep 29, 2002 at 11:21:09AM -0700 References: <20020929155536.I3451@sunsite.ms.mff.cuni.cz> <3D974495.4000901@redhat.com> Message-ID: <20020930003906.N3451@sunsite.ms.mff.cuni.cz> On Sun, Sep 29, 2002 at 11:21:09AM -0700, Ulrich Drepper wrote: > I have put in your patch but I've also moved bug-erange from tests to > xtests. This goal was creates for just this purpose, tests which cannot > generally be run but are still useful. Thanks. > > string/stratcliff failed on alpha/alphaev6/ia64 > > I've asked rth to review the strncpy patch... That's alpha. On IA-64 the following segfaults: #include #include #include char buf[128] __attribute__((aligned(128))); int main (void) { int i; char *p = mmap (NULL, 65536, PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); if (p == NULL) abort (); memset (p + 65536 - 26, 'T', 26); strncpy (buf, p + 65536 - 26, 25); } Will debug it. > > and tst-timer on ia64/i686 (both builds). > > Don't know what that is. Works for me. tst-timer fails on sparc build too actually (well, there it run for 3 hours until I killed that test, with exception of bug-regex12 all other tests succeeded). On i686 and ia64 the reason is random value in sigev_notify_attributes. It may well be 0 for you and you don't see the crash, for me it died on: newtimer->attr = *(pthread_attr_t *) evp->sigev_notify_attributes; because evp->sigev_notify_attributes was garbage. Will need to check sparc if that is the same reason or something else. 2002-09-29 Jakub Jelinek * sysdeps/pthread/tst-timer.c (main): Clear sigev2.sigev_notify_attributes. --- linuxthreads/sysdeps/pthread/tst-timer.c.jj 2002-09-28 16:37:10.000000000 -0400 +++ linuxthreads/sysdeps/pthread/tst-timer.c 2002-09-29 18:30:42.000000000 -0400 @@ -76,6 +76,7 @@ main (void) sigev2.sigev_notify = SIGEV_THREAD; sigev2.sigev_notify_function = notify_func; + sigev2.sigev_notify_attributes = NULL; setvbuf (stdout, 0, _IOLBF, 0); Jakub From roland@redhat.com Sun Sep 29 15:41:00 2002 From: roland@redhat.com (Roland McGrath) Date: Sun, 29 Sep 2002 15:41:00 -0000 Subject: ld.so needs __errno_location PLT entry? Message-ID: <200209292235.g8TMZx420266@magilla.sf.frob.com> Unless I am missing something, I think ld.so needs to have a PLT entry for __errno_location. This bites fatally on Hurd, where the implementations of read et al must come from libc.so and so the real errno must be found by ld.so's calls to see any values at all. On Linux with PLT reduction it never matters to communicate an errno value between libc and ld.so, so always getting ld.so's private errno cell is fine most of the time. But there is only one private cell, so ld.so's uses of it are not thread-safe. I am not positive off hand that every possible access to errno inside ld.so happens with _dl_load_lock held. If so, then it's ok. But that is certainly a subtlety that requires some comments somewhere. From aj@suse.de Sun Sep 29 23:51:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sun, 29 Sep 2002 23:51:00 -0000 Subject: Fix tst-e2big Message-ID: I just noticed these warnings and will commit now the appended patch: tst-e2big.c: In function `test': tst-e2big.c:70: warning: int format, different type arg (arg 4) tst-e2big.c:76: warning: int format, different type arg (arg 4) Andreas 2002-09-30 Andreas Jaeger * iconvdata/tst-e2big.c (test): Use %td in printf for ptrdiff_t. ============================================================ Index: iconvdata/tst-e2big.c --- iconvdata/tst-e2big.c 23 Sep 2002 17:56:29 -0000 1.1 +++ iconvdata/tst-e2big.c 30 Sep 2002 06:50:36 -0000 @@ -67,12 +67,12 @@ test (const char *encoding, char *inbuf, if (!empty_input && empty_output) { - fprintf (stderr, "%s: ate %d input bytes\n", encoding, inptr - inbuf); + fprintf (stderr, "%s: ate %td input bytes\n", encoding, inptr - inbuf); exit (1); } if (empty_input && !empty_output) { - fprintf (stderr, "%s: produced %d output bytes\n", + fprintf (stderr, "%s: produced %td output bytes\n", encoding, outptr - outbuf); exit (1); } -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From schwidefsky@de.ibm.com Mon Sep 30 00:27:00 2002 From: schwidefsky@de.ibm.com (Martin Schwidefsky) Date: Mon, 30 Sep 2002 00:27:00 -0000 Subject: s390 wordsize. Message-ID: <200209300925.22549.schwidefsky@de.ibm.com> Hi, Bernd Kaindl from SuSE noticed that a make install copies the wrong wordsize.h header. The implies file in sysdeps/s390/s390-{32,64} specifies the wordsize-{32,64} directory. The wordsize header file in wordsize-{32,64} overrides the wordsize header in sysdeps/s390/bits. Bernds solution is to copy the wordsize.h file back to their original location sysdeps/s390/s390-{32,64}/bits. Then a make install picks up the correct file and biarch compiles work. blue skies, Martin. 2002-09-30 Bernd Kaindl * sysdeps/s390/bits/wordsize.h: Move to... * sysdeps/s390/s390-32/bits/byteswap.h: ...here. * sysdeps/s390/s390-64/bits/byteswap.h: ...and here. diff -urN libc-head/sysdeps/s390/bits/wordsize.h libc-s390/sysdeps/s390/bits/wordsize.h --- libc-head/sysdeps/s390/bits/wordsize.h Thu Jul 11 23:38:44 2002 +++ libc-s390/sysdeps/s390/bits/wordsize.h Thu Jan 1 01:00:00 1970 @@ -1,7 +0,0 @@ -/* Determine the wordsize from the preprocessor defines. */ - -#if defined __s390x__ -# define __WORDSIZE 64 -#else -# define __WORDSIZE 32 -#endif diff -urN libc-head/sysdeps/s390/s390-32/bits/wordsize.h libc-s390/sysdeps/s390/s390-32/bits/wordsize.h --- libc-head/sysdeps/s390/s390-32/bits/wordsize.h Thu Jan 1 01:00:00 1970 +++ libc-s390/sysdeps/s390/s390-32/bits/wordsize.h Mon Sep 30 09:04:52 2002 @@ -0,0 +1,7 @@ +/* Determine the wordsize from the preprocessor defines. */ + +#if defined __s390x__ +# define __WORDSIZE 64 +#else +# define __WORDSIZE 32 +#endif diff -urN libc-head/sysdeps/s390/s390-64/bits/wordsize.h libc-s390/sysdeps/s390/s390-64/bits/wordsize.h --- libc-head/sysdeps/s390/s390-64/bits/wordsize.h Thu Jan 1 01:00:00 1970 +++ libc-s390/sysdeps/s390/s390-64/bits/wordsize.h Thu Jul 11 23:38:44 2002 @@ -0,0 +1,7 @@ +/* Determine the wordsize from the preprocessor defines. */ + +#if defined __s390x__ +# define __WORDSIZE 64 +#else +# define __WORDSIZE 32 +#endif From aj@suse.de Mon Sep 30 00:41:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 30 Sep 2002 00:41:00 -0000 Subject: Status on x86-64 Message-ID: Compiling with: /usr/src/aj/libc/configure --prefix=/usr/src/aj/install-glibc-mainline --enable-add-ons All tests passed on x86-64 with these known exceptions: - tst-aio7 - bug-regex12 Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Mon Sep 30 00:46:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 30 Sep 2002 00:46:00 -0000 Subject: Fix format strings in testsuite Message-ID: Running the testsuite on x86-64 I noticed these problems and fixed them with the appended patch. I'm committing the patch now, Andreas 2002-09-30 Andreas Jaeger * stdlib/tst-bsearch.c (main): Fix format strings. * stdio-common/tst-rndseek.c (do_test): Likewise. * libio/tst_swprintf.c (main): Likewise. * catgets/tst-catgets.c (main): Likewise. * libio/tst-fgetws.c (main): Likewise. * posix/tst-mmap.c (main): Likewise. * posix/bug-regex12.c (main): Likewise. * posix/bug-regex11.c (main): Likewise. * io/tst-getcwd.c (do_test): Likewise. ============================================================ Index: stdlib/tst-bsearch.c --- stdlib/tst-bsearch.c 24 Sep 2002 04:21:06 -0000 1.4 +++ stdlib/tst-bsearch.c 30 Sep 2002 07:44:42 -0000 @@ -67,7 +67,7 @@ main (void) res = (struct entry *) bsearch (&key, arr, narr, sizeof (arr[0]), comp); if (res == NULL) { - printf ("entry %d not found\n", cnt); + printf ("entry %zd not found\n", cnt); result = 1; } else if (res != &arr[cnt]) @@ -112,7 +112,7 @@ main (void) { if (res == NULL) { - printf ("entry %d not found\n", cnt); + printf ("entry %zd not found\n", cnt); result = 1; } else if (res != &arr[cnt]) ============================================================ Index: stdio-common/tst-rndseek.c --- stdio-common/tst-rndseek.c 24 Sep 2002 04:21:04 -0000 1.4 +++ stdio-common/tst-rndseek.c 30 Sep 2002 07:44:42 -0000 @@ -117,7 +117,7 @@ do_test (void) if (ch1 != ch2) { - printf ("%d: '%c' vs '%c'\n", i, ch1, ch2); + printf ("%zd: '%c' vs '%c'\n", i, ch1, ch2); return 1; } } ============================================================ Index: libio/tst_swprintf.c --- libio/tst_swprintf.c 24 Sep 2002 04:21:05 -0000 1.5 +++ libio/tst_swprintf.c 30 Sep 2002 07:44:42 -0000 @@ -28,7 +28,7 @@ main (int argc, char *argv[]) n = swprintf (buf, nbuf, L"Hello %s", "world"); if (n != 11) { - printf ("incorrect return value: %d instead of 11\n", n); + printf ("incorrect return value: %zd instead of 11\n", n); result = 1; } else if (wcscmp (buf, L"Hello world") != 0) @@ -41,7 +41,7 @@ main (int argc, char *argv[]) n = swprintf (buf, nbuf, L"Is this >%g< 3.1?", 3.1); if (n != 18) { - printf ("incorrect return value: %d instead of 18\n", n); + printf ("incorrect return value: %zd instead of 18\n", n); result = 1; } else if (wcscmp (buf, L"Is this >3.1< 3.1?") != 0) ============================================================ Index: libio/tst-fgetws.c --- libio/tst-fgetws.c 24 Sep 2002 04:21:05 -0000 1.2 +++ libio/tst-fgetws.c 30 Sep 2002 07:44:42 -0000 @@ -91,7 +91,7 @@ main (int argc, char *argv[]) { printf ("Return Value: %p\n", ret); for (i = 0; i < wcslen (wcs) + 1; i++) - printf (" wcs[%d] = %04x", i, (unsigned int)wcs[i]); + printf (" wcs[%zd] = %04x", i, (unsigned int)wcs[i]); printf ("\n"); result = 1; } @@ -127,7 +127,7 @@ main (int argc, char *argv[]) printf ("Return Value: %p\n", ret); for (i = 0; i < wcslen (wcs) + 1; i++) - printf (" wcs[%d] = 0x%04x", i, (unsigned int)wcs[i]); + printf (" wcs[%zd] = 0x%04x", i, (unsigned int)wcs[i]); printf ("\n"); for (i = 0; il_str2[i] != '\n'; ++i) @@ -172,7 +172,7 @@ main (int argc, char *argv[]) { printf ("Return Value: %p\n", ret); for (i = 0; i < wcslen (wcs) + 1; i++) - printf (" wcs[%d] = 0x%04x", i, (unsigned int)wcs[i]); + printf (" wcs[%zd] = 0x%04x", i, (unsigned int)wcs[i]); printf ("\n"); } ============================================================ Index: catgets/tst-catgets.c --- catgets/tst-catgets.c 24 Sep 2002 04:21:06 -0000 1.3 +++ catgets/tst-catgets.c 30 Sep 2002 07:44:42 -0000 @@ -45,7 +45,7 @@ main (void) if (trans == NULL) { - printf ("catgets return NULL for %d\n", cnt); + printf ("catgets return NULL for %zd\n", cnt); result = 1; } else if (strcmp (trans, msgs[cnt]) != 0 && msgs[cnt][0] != '\0') ============================================================ Index: posix/tst-mmap.c --- posix/tst-mmap.c 24 Sep 2002 04:21:02 -0000 1.3 +++ posix/tst-mmap.c 30 Sep 2002 07:44:42 -0000 @@ -167,7 +167,7 @@ main (void) for (c = ps; c < ps + 1000; ++c) if (ptr[c - ps] != '0' + (c % 10)) { - printf ("wrong data mapped at offset %d\n", c); + printf ("wrong data mapped at offset %zd\n", c); result = 1; } } @@ -187,7 +187,7 @@ main (void) for (c = ps; c < ps + 1000; ++c) if (ptr[c - ps] != '0' + (c % 10)) { - printf ("wrong data mapped at offset %d\n", c); + printf ("wrong data mapped at offset %zd\n", c); result = 1; } } ============================================================ Index: posix/bug-regex12.c --- posix/bug-regex12.c 28 Sep 2002 20:51:17 -0000 1.1 +++ posix/bug-regex12.c 30 Sep 2002 07:44:42 -0000 @@ -52,7 +52,7 @@ main (void) { char buf[500]; regerror (n, &re, buf, sizeof (buf)); - printf ("regcomp %d failed: %s\n", i, buf); + printf ("regcomp %zd failed: %s\n", i, buf); ret = 1; continue; } @@ -60,7 +60,7 @@ main (void) if (! regexec (&re, tests[i].string, tests[i].nmatch, tests[i].nmatch ? rm : NULL, 0)) { - printf ("regexec %d incorrectly matched\n", i); + printf ("regexec %zd incorrectly matched\n", i); ret = 1; } ============================================================ Index: posix/bug-regex11.c --- posix/bug-regex11.c 28 Sep 2002 20:51:17 -0000 1.3 +++ posix/bug-regex11.c 30 Sep 2002 07:44:42 -0000 @@ -58,14 +58,14 @@ main (void) { char buf[500]; regerror (n, &re, buf, sizeof (buf)); - printf ("regcomp %d failed: %s\n", i, buf); + printf ("regcomp %zd failed: %s\n", i, buf); ret = 1; continue; } if (regexec (&re, tests[i].string, tests[i].nmatch, rm, 0)) { - printf ("regexec %d failed\n", i); + printf ("regexec %zd failed\n", i); ret = 1; regfree (&re); continue; ============================================================ Index: io/tst-getcwd.c --- io/tst-getcwd.c 24 Sep 2002 04:21:09 -0000 1.4 +++ io/tst-getcwd.c 30 Sep 2002 07:44:42 -0000 @@ -152,7 +152,7 @@ getcwd (NULL, sbs) = \"%s\", getcwd (the for (i = len + 1; i < sizeof thepath; ++i) if (thepath[i] != '\xff') { - printf ("thepath[%d] != '\xff'\n", i); + printf ("thepath[%zd] != '\xff'\n", i); return 1; } -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From roland@redhat.com Mon Sep 30 00:47:00 2002 From: roland@redhat.com (Roland McGrath) Date: Mon, 30 Sep 2002 00:47:00 -0000 Subject: s390 wordsize. In-Reply-To: Martin Schwidefsky's message of Monday, 30 September 2002 09:25:22 +0200 <200209300925.22549.schwidefsky@de.ibm.com> Message-ID: <200209300747.g8U7laD08203@magilla.sf.frob.com> > Bernd Kaindl from SuSE noticed that a make install copies the wrong > wordsize.h header. The implies file in sysdeps/s390/s390-{32,64} > specifies the wordsize-{32,64} directory. The wordsize header file in > wordsize-{32,64} overrides the wordsize header in sysdeps/s390/bits. > Bernds solution is to copy the wordsize.h file back to their original > location sysdeps/s390/s390-{32,64}/bits. Then a make install picks > up the correct file and biarch compiles work. That's how it is for sparc32/sparc64 too, so I guess this is the thing to do. It would be nice to avoid the duplication. I can quickly whip up a way to have an Implies file line say it should apply after the parent dir rather than before, but that might be pushing the obscurity of the system even further. As an example kludge if you want to try it, take this patch to configure.in (and make sure your autoconf is 2.13), and change wordsize-NN to wordsize-NN+ in s390-NN/Implies. Conversely, you might see what happens to your sysdirs list if you just put s390 before wordsize-NN in the Implies files. From jakub@redhat.com Mon Sep 30 00:54:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 30 Sep 2002 00:54:00 -0000 Subject: s390 wordsize. In-Reply-To: <200209300747.g8U7laD08203@magilla.sf.frob.com>; from roland@redhat.com on Mon, Sep 30, 2002 at 12:47:36AM -0700 References: <200209300925.22549.schwidefsky@de.ibm.com> <200209300747.g8U7laD08203@magilla.sf.frob.com> Message-ID: <20020930095350.T3451@sunsite.ms.mff.cuni.cz> On Mon, Sep 30, 2002 at 12:47:36AM -0700, Roland McGrath wrote: > > Bernd Kaindl from SuSE noticed that a make install copies the wrong > > wordsize.h header. The implies file in sysdeps/s390/s390-{32,64} > > specifies the wordsize-{32,64} directory. The wordsize header file in > > wordsize-{32,64} overrides the wordsize header in sysdeps/s390/bits. > > Bernds solution is to copy the wordsize.h file back to their original > > location sysdeps/s390/s390-{32,64}/bits. Then a make install picks > > up the correct file and biarch compiles work. > > That's how it is for sparc32/sparc64 too, so I guess this is the thing to > do. It would be nice to avoid the duplication. I can quickly whip up a > way to have an Implies file line say it should apply after the parent dir > rather than before, but that might be pushing the obscurity of the system > even further. As an example kludge if you want to try it, take this patch > to configure.in (and make sure your autoconf is 2.13), and change > wordsize-NN to wordsize-NN+ in s390-NN/Implies. > > Conversely, you might see what happens to your sysdirs list if you just put > s390 before wordsize-NN in the Implies files. Patch is missing. Anyway, if we are not going to change this, sysdeps/powerpc/bits/wordsize.h has to be moved one level deeper and duplicated too. Otherwise, all those 3 arches will need to be audited for files in wordsize-* directories, fortunately there aren't too many. Jakub From roland@redhat.com Mon Sep 30 00:55:00 2002 From: roland@redhat.com (Roland McGrath) Date: Mon, 30 Sep 2002 00:55:00 -0000 Subject: s390 wordsize. In-Reply-To: Jakub Jelinek's message of Monday, 30 September 2002 09:53:50 +0200 <20020930095350.T3451@sunsite.ms.mff.cuni.cz> Message-ID: <200209300755.g8U7tTt08240@magilla.sf.frob.com> > Patch is missing. D'oh. > Anyway, if we are not going to change this, sysdeps/powerpc/bits/wordsize.h > has to be moved one level deeper and duplicated too. > Otherwise, all those 3 arches will need to be audited for files in > wordsize-* directories, fortunately there aren't too many. That makes me lean more towards finding a solution (not this exact kludge) to avoid the duplication. Index: configure.in =================================================================== RCS file: /cvs/glibc/libc/configure.in,v retrieving revision 1.356 diff -u -b -p -r1.356 configure.in --- configure.in 29 Sep 2002 11:05:02 -0000 1.356 +++ configure.in 30 Sep 2002 07:43:06 -0000 @@ -501,7 +501,14 @@ while test $# -gt 0; do # Collect more names from the `Implies' file (removing comments). implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`" implied= + preimplied= + postimplied= for x in $implied_candidate; do + case "$x" in + *+) x=${x%+}; whichimplied=postimplied ;; + *) whichimplied=preimplied ;; + esac + eval implied=\$$whichimplied found=no if test -d $xsrcdir$name_base/$x; then implied="$implied $name_base/$x"; @@ -524,9 +531,12 @@ while test $# -gt 0; do if test $found = no; then AC_MSG_WARN($name/Implies specifies nonexistent $x) fi + eval $whichimplied=\$implied done else implied= + preimplied= + postimplied= fi # Add NAME to the list of names. @@ -544,7 +554,7 @@ changequote([,])dnl # configuration components; this ensures that for sysv4, unix/common # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*) # after sysv4). - sysnames="`echo $implied $* $parent`" + sysnames="`echo $preimplied $* $parent $postimplied`" test -n "$sysnames" && set $sysnames done From jakub@redhat.com Mon Sep 30 07:58:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 30 Sep 2002 07:58:00 -0000 Subject: [PATCH] Fix string/stratcliff on IA-64 Message-ID: <20020930165850.U3451@sunsite.ms.mff.cuni.cz> Hi! strncpy did not handle the case with no '\0' chars in src with (src + len + 7) & ~7L on page boundary with next page unmapped and where ((src ^ dst) & 7) != 0. We need to segfault only when we need to use at least a byte from the next page. Tested with stratcliff and #include #include #include char buf[128] __attribute__((aligned(128))); int main (int argc, char **argv) { int i, j = atoi(argv[1]); char *p = mmap (NULL, 65536, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); if (p == NULL) abort (); memset (p + 65536 - j, 'T', j); strncpy (buf, p + 65536 - j, j - 1); strncpy (buf, p + 65536 - j, j); strncpy (buf, p + 65536 - j, j + 1); strncpy (buf, p + 65536 - j, j + 7); } for various numbers (always should segfault on 3rd strncpy). IMHO it is better to deal with this in the recovery code than to slow down the routine for the common case. 2002-09-30 Jakub Jelinek * sysdeps/ia64/strncpy.S: Only segfault in .recovery2 if some bits from the next quad are needed. --- libc/sysdeps/ia64/strncpy.S.jj 2002-04-30 12:53:57.000000000 +0200 +++ libc/sysdeps/ia64/strncpy.S 2002-09-30 16:50:03.000000000 +0200 @@ -1,6 +1,6 @@ /* Optimized version of the standard strncpy() function. This file is part of the GNU C Library. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Dan Pop and Jakub Jelinek . @@ -210,8 +210,11 @@ ENTRY(strncpy) mov pr = saved_pr, -1 // restore the predicate registers br.ret.sptk.many b0 .recovery2: + add c = 8, len add tmp = -8, asrc ;; - ld8 r[0] = [tmp] + cmp.gtu p8, p5 = c, thresh ;; +(p8) ld8 r[0] = [tmp] +(p5) mov r[0] = r0 br.cond.sptk .back2 .recovery3: add tmp = -MEMLAT * 8, src ;; Jakub From aj@suse.de Mon Sep 30 09:51:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 30 Sep 2002 09:51:00 -0000 Subject: glibc make check fails... In-Reply-To: <200209292140.g8TLeaJ11364@magilla.sf.frob.com> (Roland McGrath's message of "Sun, 29 Sep 2002 14:40:36 -0700") References: <200209292140.g8TLeaJ11364@magilla.sf.frob.com> Message-ID: Roland McGrath writes: >> My kernel headers do not have that call. > > Then it is very mysterious! > >> Unfortunatly my gdb cannot debug this but it's somewhere in the >> libpthread startup code: > > Do you get a core dump you can look at? > >> 22306: calling init: /builds/test-install/lib/libpthread.so.0 >> 22306: >> 22306: symbol=__errno_location; lookup in file=linuxthreads/ex3 >> 22306: symbol=__errno_location; lookup in file=/builds/test-install/lib/libpthread.so.0 >> 22306: binding file /builds/test-install/lib/libpthread.so.0 to /builds/test-install/lib/libpthread.so.0: normal symbol `__errno_location' [GLIBC_2.0] >> Segmentation fault > > That looks exactly like the failure you'd expect if the set_thread_area > call (via INLINE_SYSCALL) or the modify_ldt call had failed. Since you > don't have set_thread_area, it must be modify_ldt but I don't think anyone > else has seen that fail. I tried this morning's (12 hours ago) CVS and that worked fine. I'm retrying current CVS (as of 10 minutes ago) and if you do not hear anything in the next two hours, the problems are fixed for me, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Mon Sep 30 10:03:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 30 Sep 2002 10:03:00 -0000 Subject: glibc make check fails... In-Reply-To: (Andreas Jaeger's message of "Mon, 30 Sep 2002 18:51:50 +0200") References: <200209292140.g8TLeaJ11364@magilla.sf.frob.com> Message-ID: Just for the record since make was fast: make check passes everything (except the known regex12 failure) on my dual athlon configured with: /cvs/libc/configure --disable-profile --enable-add-ons --prefix=/builds/test-install --enable-kernel=2.4.18 So, this leaves as only known problem the buggy --with-tls option, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Mon Sep 30 10:06:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 30 Sep 2002 10:06:00 -0000 Subject: [Fwd: Memory violation in init on ARM Linux. in glibc mainline...] Message-ID: <3D98848F.6000308@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Forwarded for Scott. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9mISP2ijCOnn/RHQRAghwAJ9fypf/Q7qOKmPvCGhOmLOhPQIo6gCgyq7p RwpFMLVP6js+BdGKQOV/jnE= =a9fz -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Scott Bambrough Subject: Memory violation in init on ARM Linux. in glibc mainline... Date: 30 Sep 2002 12:10:06 -0400 Size: 8312 URL: From roland@redhat.com Mon Sep 30 13:17:00 2002 From: roland@redhat.com (Roland McGrath) Date: Mon, 30 Sep 2002 13:17:00 -0000 Subject: [PATCH] Fix string/stratcliff on IA-64 In-Reply-To: Jakub Jelinek's message of Monday, 30 September 2002 16:58:51 +0200 <20020930165850.U3451@sunsite.ms.mff.cuni.cz> Message-ID: <200209302016.g8UKGui00517@magilla.sf.frob.com> I put that in. From pb@nexus.co.uk Mon Sep 30 14:27:00 2002 From: pb@nexus.co.uk (Philip Blundell) Date: Mon, 30 Sep 2002 14:27:00 -0000 Subject: [Fwd: Memory violation in init on ARM Linux. in glibc mainline...] In-Reply-To: <3D98848F.6000308@redhat.com> References: <3D98848F.6000308@redhat.com> Message-ID: <1033421269.30796.3.camel@kc> On Mon, 2002-09-30 at 18:06, Ulrich Drepper wrote: > I'm trying to build glibc on my NetWinder and am running into a memory > violation in glibc when running rpcgen during the build of the others > target in the sunrpc directory. I think this is a binutils bug. From what I remember, the relocation information gets scrunged somehow when -z combreloc is enabled, so none of the GOT entries are actually relocated properly at run time. I have some BFD patches somewhere to implement reference counting properly, which seemed to help with that. I can send you a copy if you want, but I'm not sure if they will still apply against the latest sources. p. From davidm@napali.hpl.hp.com Mon Sep 30 16:54:00 2002 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Mon, 30 Sep 2002 16:54:00 -0000 Subject: bug fix for ia64/dl-fptr.c Message-ID: <200209302354.g8UNsN1D023968@napali.hpl.hp.com> The ia64 version of dl-fptr.c has a bug in that it incorrectly assumes that the "local" variable will be within a 22-bit offset of gp. The fix is to use "movl" instead so that "local" can be anywhere in the 64-bit address space. Thanks to Asit Mallick for reporting this bug. --david 2002-09-19 David Mosberger * sysdeps/ia64/dl-fptr.c (make_fdesc): Load address of "local" via a 64-bit gp-relative address to enable binaries with large data sections. Index: sysdeps/ia64/dl-fptr.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/ia64/dl-fptr.c,v retrieving revision 1.6 diff -u -r1.6 dl-fptr.c --- sysdeps/ia64/dl-fptr.c 31 Jan 2002 03:39:21 -0000 1.6 +++ sysdeps/ia64/dl-fptr.c 20 Sep 2002 01:38:17 -0000 @@ -127,7 +127,7 @@ unsigned int old; struct local *l; - asm ("addl %0 = @gprel (local), gp" : "=r" (l)); + asm ("movl %0 = @gprel (local);; add %0 = %0, gp" : "=&r"(l)); t = l->root; while (1) From drepper@redhat.com Mon Sep 30 17:02:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 30 Sep 2002 17:02:00 -0000 Subject: bug fix for ia64/dl-fptr.c References: <200209302354.g8UNsN1D023968@napali.hpl.hp.com> Message-ID: <3D98E628.8090203@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Mosberger wrote: > The ia64 version of dl-fptr.c has a bug in that it incorrectly assumes > that the "local" variable will be within a 22-bit offset of gp. The > fix is to use "movl" instead so that "local" can be anywhere in the > 64-bit address space. Thanks, I've applied the patch. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE9mOYo2ijCOnn/RHQRAjAMAJ0TUw3L6Sr69OsdAXDKKDPh11L8QACgouM7 nkW34bMwVPVR2cGEbTDEK2c= =b6ql -----END PGP SIGNATURE----- From roland@redhat.com Mon Sep 30 23:45:00 2002 From: roland@redhat.com (Roland McGrath) Date: Mon, 30 Sep 2002 23:45:00 -0000 Subject: separately compiling libc modules for rtld Message-ID: <200210010645.g916jJ510346@magilla.sf.frob.com> The following makefile changes implement a fully-automated means by which the modules that heretofore have been linked into ld.so from libc_pic.a are instead compiled separately for inclusion in ld.so, and so can be conditionally compiled into different code in ld.so than what goes into libc. Having separately compiled modules is desireable for a few reasons: The Hurd needs this to be able to get all the PLT entries it needs in ld.so without sacrificing the PLT reduction in libc.so itself. When libc is built using TLS/__thread, we would like to have ld.so not use any TLS accesses during startup, but libc_pic.a modules use TLS for errno. This avoids the need for temporary thread pointer setup during bootstrap and reduces the number of switch cases in the reloc handling for rtld bootstrap. More importantly, it lets prelinking ld.so work without difficult new hackery for the TLS relocs. It lets us use #if's freely in any libc code to minimize/optimize it specially for the restricted uses in ld.so, rather than having to write separate replacements. e.g. the dl-xstat64.c kludge can go away because the SHLIB_COMPAT macro can just be made not to fire for libc symbols in the ld.so build. These build changes per se should be a zero-change or close to it in the compiled results. (It provides a place where different build options could be inserted, but nothing different is actually there yet. I didn't compare the compiled objects, but my builds with this work just the same as before.) But it is some untested new subtlety, so if 2.3 is very imminent I don't know if this should wait for 2.3.1. However, the Hurd is broken now and without this can only be fixed with unacceptably ugly changes. If this goes in, I can do a very simple and clean fix for the Hurd's problems. And it will open the gates for figuring out exactly how we want the TLS build to be. 2002-09-30 Roland McGrath * elf/rtld-Rules: New file. * elf/Makefile ($(objpfx)librtld.map, $(objpfx)librtld.mk, $(objpfx)rtld-libc.a): New targets. (generated): Add them. (reloc-link): Remove -o $@ from the variable. ($(objpfx)dl-allobjs.os): Add -o $@ after $(reloc-link). (distribute): Add rtld-Rules. (CPPFLAGS-.os): Define this instead of CFLAGS-.os. * Makerules ($(+sysdir_pfx)sysd-rules): Emit rules for rtld-% targets. (common-mostlyclean, common-clean): Clean up rtld-* files. * sysdeps/unix/make-syscalls.sh: Add rtld-*.os target name to rules. Index: Makerules =================================================================== RCS file: /cvs/glibc/libc/Makerules,v retrieving revision 1.366 diff -u -p -r1.366 Makerules --- Makerules 23 Sep 2002 17:43:16 -0000 1.366 +++ Makerules 1 Oct 2002 05:50:55 -0000 @@ -235,16 +235,26 @@ $(+sysdir_pfx)sysd-rules: $(+sysdir_pfx) echo "\$$(objpfx)%$$o: $$dir/%.S \$$(before-compile); \ \$$(compile-command.S)"; \ echo "\$$(objpfx)%$$o: $$dir/%.s \$$(before-compile); \ - \$$(compile-command.s)"; \ + \$$(compile-command.s)"; \ + echo "\$$(objpfx)rtld-%$$o: $$dir/%.S \$$(before-compile); \ + \$$(compile-command.S)"; \ + echo "\$$(objpfx)rtld-%$$o: $$dir/%.s \$$(before-compile); \ + \$$(compile-command.s)"; \ $(close-check-inhibit-asm) \ echo "\$$(objpfx)%$$o: $$dir/%.c \$$(before-compile); \ \$$(compile-command.c)"; \ + echo "\$$(objpfx)rtld-%$$o: $$dir/%.c \$$(before-compile); \ + \$$(compile-command.c)"; \ done; \ $(open-check-inhibit-asm) \ echo "\$$(objpfx)%.d: $$dir/%.s \$$(common-objpfx)dummy.d; \ \$$(make-dummy-dep)"; \ + echo "\$$(objpfx)rtld-%.d: $$dir/%.s \$$(common-objpfx)dummy.d; \ + \$$(make-dummy-dep)"; \ echo "\$$(objpfx)%.d: $$dir/%.S \$$(before-compile); \ \$$(+make-deps)"; \ + echo "\$$(objpfx)rtld-%.d: $$dir/%.S \$$(before-compile); \ + \$$(+make-deps)"; \ $(close-check-inhibit-asm) \ echo "\$$(objpfx)%.d: $$dir/%.c \$$(before-compile); \ \$$(+make-deps)"; \ @@ -1090,6 +1100,7 @@ common-mostlyclean: $(install-lib.so) \ $(install-lib.so:%.so=%_pic.a)) -rm -f core + -rm -f $(objpfx)rtld-*.os $(rmobjs) define rmobjs $(foreach o,$(object-suffixes-for-libc), @@ -1099,6 +1110,7 @@ endef # Also remove the dependencies and generated source files. common-clean: common-mostlyclean -rm -f $(addprefix $(objpfx),$(generated)) $(+depfiles) + -rm -f $(objpfx)rtld-*.d -rm -fr $(addprefix $(objpfx),$(generated-dirs)) -rm -f $(addprefix $(common-objpfx),$(common-generated)) -rm -f $(objpfx)distinfo Index: elf/Makefile =================================================================== RCS file: /cvs/glibc/libc/elf/Makefile,v retrieving revision 1.237 diff -u -p -r1.237 Makefile --- elf/Makefile 23 Sep 2002 17:43:15 -0000 1.237 +++ elf/Makefile 1 Oct 2002 05:50:56 -0000 @@ -41,7 +41,8 @@ rtld-routines := rtld $(dl-routines) dl- 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 \ +distribute := rtld-Rules \ + $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \ dl-cache.h dl-hash.h soinit.c sofini.c ldd.bash.in \ genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \ dl-librecon.h interp.c sln.c dl-dst.h hp-timing.h \ @@ -163,14 +164,49 @@ lib-noranlib: $(objpfx)$(rtld-installed- endif # Command to link into a larger single relocatable object. -reloc-link = $(LINK.o) -nostdlib -nostartfiles -r -o $@ +reloc-link = $(LINK.o) -nostdlib -nostartfiles -r $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os) - $(reloc-link) $^ + $(reloc-link) -o $@ $^ # Link together the dynamic linker into a single relocatable object. -$(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a - $(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)' +# First we do a link against libc_pic.a just to get a link map, +# and discard the object produced by that link. From the link map +# we can glean all the libc modules that need to go into the dynamic +# linker. Then we do a recursive make that goes into all the subdirs +# those modules come from and builds special rtld-foo.os versions that +# are compiled with special flags, and puts these modules into rtld-libc.a +# for us. Then we do the real link using rtld-libc.a instead of libc_pic.a. + +$(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a + $(reloc-link) -o $@.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@ + rm -f $@.o + +$(objpfx)librtld.mk: $(objpfx)librtld.map Makefile + sed -n 's@^$(common-objpfx)\([^(]*\)(\(.*.os\))$$@\1 \2@p' $< | \ + while read lib file; do \ + case $$lib in \ + libc_pic.a) \ + fgrep -l /$$file \ + $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \ + sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\ + ;; \ + */*.a) \ + echo rtld-$${lib%%/*} += $$file ;; \ + *) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \ + esac; \ + done > $@T + echo rtld-subdirs = `sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \ + | sort -u` >> $@T + mv -f $@T $@ + +$(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE + $(MAKE) -f $< -f rtld-Rules + +generated += librtld.map librtld.mk rtld-libc.a + +$(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a + $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) @rm -f $@.lds @@ -206,6 +242,7 @@ $(objpfx)trusted-dirs.st: Makefile $(..) $(make-target-directory) echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \ | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T}; + echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T} $(move-if-change) ${@:st=T} ${@:st=h} touch $@ CPPFLAGS-dl-load.c = -I$(objpfx). -I$(csu-objpfx). @@ -262,7 +299,7 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D' CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) CFLAGS-cache.c = $(SYSCONF-FLAGS) -CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc -DIS_IN_rtld) +CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc -DIS_IN_rtld) test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) generated += $(addsuffix .so,$(strip $(modules-names))) Index: elf/rtld-Rules =================================================================== RCS file: elf/rtld-Rules diff -N elf/rtld-Rules --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ elf/rtld-Rules 1 Oct 2002 05:50:56 -0000 @@ -0,0 +1,100 @@ +# Subroutine makefile for compiling libc modules linked into dynamic linker. + +# 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 makefile is never used by itself, but only from the rtld-libc.a +# rule in Makefile, which does make -f librtld.mk -f rtld-Rules. +# librtld.mk is the generated file containing variable definitions for +# `rtld-subdirs', a subset of the top-level $(subdirs) list; and for each +# SUBDIR in $(rtld-subdirs), `rtld-SUBDIR' listing `module.os' file names. + +.PHONY: rtld-all +rtld-all: + +# When run from the elf/Makefile to build rtld-libc.a, $(subdir) is elf. +ifeq ($(subdir),elf) + +ifndef rtld-subdirs +error This is makefile is a subroutine of elf/Makefile not to be used directly +endif + +include ../Makeconfig + +rtld-all: $(objpfx)rtld-libc.a + +$(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\ + $(addprefix $(common-objpfx)$(dir)/rtld-,\ + $(rtld-$(dir)))) + @-rm -f $@T + $(AR) cq $@T $^ + $(RANLIB) $@T + mv -f $@T $@ + +# For each subdirectory, define a pattern rule that makes all of that +# subdirectory's modules at once with one recursive make command. +object-suffixes-left := $(rtld-subdirs) +define o-iterator-doit +$(foreach obj,$(rtld-$o),$(common-objpfx)%/rtld-$(obj)): FORCE ; \ + +$$(rtld-subdir-make) +endef +include $(patsubst %,../o-iterator.mk,$(object-suffixes-left)) + +# This is how we descend into each subdirectory. See below. +define rtld-subdir-make +$(MAKE) -C ../$* objdir=$(objdir) -f Makefile -f ../elf/rtld-Rules rtld-all \ + rtld-modules='$(addprefix rtld-,$(rtld-$*))' +endef + +FORCE: + +else + +# In this case we are being run by $(rtld-subdir-make), above. +# Some other subdir's Makefile has provided all its normal rules, +# and we just provide some additional definitions. + +# These are the basic compilation rules corresponding to the Makerules ones. +# The sysd-rules generated makefile already defines pattern rules for rtld-% +# targets built from sysdeps source files. +$(objpfx)rtld-%.os: %.S $(before-compile); $(compile-command.S) +$(objpfx)rtld-%.d: %.S $(before-compile); $(+make-deps) +$(objpfx)rtld-%.os: %.s $(before-compile); $(compile-command.s) +$(objpfx)rtld-%.d: %.s $(before-compile); $(+make-deps) +$(objpfx)rtld-%.os: %.c $(before-compile); $(compile-command.c) +$(objpfx)rtld-%.d: %.c $(before-compile); $(+make-deps) + +# The command line setting of rtld-modules (see above) tells us +# what we need to build, and that tells us what dependency files we need. +rtld-all: $(addprefix $(objpfx),$(rtld-modules)) + +-include $(rtld-modules:%.os=$(objpfx)%.d) + +# Just in case we wind up e.g. regenerating dependencies for non-rtld objects, +# we don't unconditionally modify the flags. For rtld-% targets, use the +# special flags set below. +CPPFLAGS += $(patsubst rtld-%,$(CPPFLAGS-rtld),$(@F)) +CFLAGS += $(patsubst rtld-%,$(CFLAGS-rtld),$(@F)) + + +# This here is the whole point of all the shenanigans. +CPPFLAGS-rtld := -DNOT_IN_libc -DIS_IN_rtld +CFLAGS-rtld := # blah + + +endif Index: sysdeps/unix/make-syscalls.sh =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/make-syscalls.sh,v retrieving revision 1.26 diff -u -p -r1.26 make-syscalls.sh --- sysdeps/unix/make-syscalls.sh 5 Aug 2002 06:57:52 -0000 1.26 +++ sysdeps/unix/make-syscalls.sh 1 Oct 2002 05:50:56 -0000 @@ -128,7 +128,8 @@ shared-only-routines += $file ;; *) echo "\ -\$(foreach o,\$(object-suffixes),\$(objpfx)$file\$o): \\" +\$(foreach o,\$(object-suffixes),\$(objpfx)$file\$o) \ +\$(objpfx)rtld-$file.os: \\" ;; esac