]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20041120T0949
authorJakub Jelinek <jakub@redhat.com>
Sat, 20 Nov 2004 09:56:34 +0000 (09:56 +0000)
committerJakub Jelinek <jakub@redhat.com>
Sat, 20 Nov 2004 09:56:34 +0000 (09:56 +0000)
14 files changed:
ChangeLog
fedora/branch.mk
fedora/glibc.spec.in
malloc/malloc.c
nptl/ChangeLog
nptl/Makefile
nptl/allocatestack.c
nptl/init.c
nptl/pthreadP.h
nptl/pthread_create.c
nptl/sysdeps/pthread/createthread.c
nptl/vars.c [new file with mode: 0644]
signal/signal.h
sysdeps/unix/sysv/linux/bits/socket.h

index 2fbe2f3a14ba6a9c867d2870a7452e8e2c7f13f4..956684e50714516632db388dfdf4dce783453103 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2004-11-20  Ulrich Drepper  <drepper@redhat.com>
+
+       * signal/signal.h: Add deprecated attributes to sigstack,
+       sigpause, sigblock, sigsetmask, siggetmask.
+
+2004-11-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/unix/sysv/linux/bits/socket.h (SCM_RIGHTS): Avoid
+       comma at the end of enum if __USE_BSD is not defined.
+
+2004-11-19  Ulrich Drepper  <drepper@redhat.com>
+
+       * malloc/malloc.c (_int_malloc): Check for corruption of chunk
+       which is about to be returned.
+
+       * malloc/malloc.c (_int_free): Add a few more cheap tests for
+       corruption.
+
 2004-11-17  Randolph Chung  <tausq@debian.org>
 
        * sysdeps/hppa/dl-machine.h (TRAMPOLINE_TEMPLATE): Add unwind
@@ -14,8 +32,7 @@
        (re_compile_internal): Call it.
        (re_compile_pattern): Set preg->no_sub to 1 if RE_NO_SUB.
        (free_dfa_content): Free subexp_map.
-       (calc_inveclosure, calc_eclosure): Skip OP_DELETED_SUBEXP
-       nodes.
+       (calc_inveclosure, calc_eclosure): Skip OP_DELETED_SUBEXP nodes.
        * posix/regexec.c (re_search_internal): If subexp_map
        is not NULL, duplicate registers as needed.
        * posix/Makefile: Add rules to build and run tst-regex2.
@@ -27,7 +44,7 @@
 
        * libio/libio.h (_IO_FLAGS2_FORTIFY): Renamed from
        _IO_FLAGS2_CHECK_PERCENT_N.
-       * debug/fprintff_chk.c: Adjust all users.
+       * debug/fprintf_chk.c: Adjust all users.
        * debug/printf_chk.c: Likewise.
        * debug/vfprintf_chk.c: Likewise.
        * debug/vprintf_chk.c: Likewise.
index fa2d8e74b53d2048810ac404d489b9ff26d9fce2..dda0e2564a64b001ab8ed610f5813a7dad9466f3 100644 (file)
@@ -1,5 +1,5 @@
 # This file is updated automatically by Makefile.
 glibc-branch := fedora
 glibc-base := HEAD
-fedora-sync-date := 2004-11-19 00:03 UTC
-fedora-sync-tag := fedora-glibc-20041119T0003
+fedora-sync-date := 2004-11-20 09:49 UTC
+fedora-sync-tag := fedora-glibc-20041120T0949
index 3b19c8048604ca66f33787c66684e4d40122b23b..7bcb8064564fedd9adb1800298f40e4454037cba 100644 (file)
@@ -1,4 +1,4 @@
-%define glibcrelease 81
+%define glibcrelease 82
 %define auxarches i586 i686 athlon sparcv9 alphaev6
 %define prelinkarches noarch
 %define nptlarches i386 i686 athlon x86_64 ia64 s390 s390x sparcv9 ppc ppc64
@@ -1256,6 +1256,12 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Sat Nov 20 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-82
+- update from CVS
+  - some malloc () checking
+  - libpthread.a object dependency cleanups (#115157)
+  - <bits/socket.h> fix for -std=c89 -pedantic-errors (#140132)
+
 * Fri Nov 19 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-81
 - don't use chunksize in <= 2 * SIZE_SZ free () checks
 
index c2ec82d0c845b55e753e8d3da571116ed18974bb..b62ffb57c0d859e1f3f89319a9894f37c598d2f7 100644 (file)
@@ -3840,8 +3840,12 @@ _int_malloc(mstate av, size_t bytes)
   */
 
   if ((unsigned long)(nb) <= (unsigned long)(av->max_fast)) {
-    fb = &(av->fastbins[(fastbin_index(nb))]);
+    long int idx = fastbin_index(nb);
+    fb = &(av->fastbins[idx]);
     if ( (victim = *fb) != 0) {
+      if (__builtin_expect (fastbin_index (chunksize (victim)) != idx, 0))
+       malloc_printerr (check_action, "malloc(): memory corruption (fast)",
+                        chunk2mem (victim));
       *fb = victim->fd;
       check_remalloced_chunk(av, victim, nb);
       return chunk2mem(victim);
@@ -3911,6 +3915,10 @@ _int_malloc(mstate av, size_t bytes)
 
     while ( (victim = unsorted_chunks(av)->bk) != unsorted_chunks(av)) {
       bck = victim->bk;
+      if (__builtin_expect (victim->size <= 2 * SIZE_SZ, 0)
+         || __builtin_expect (victim->size > av->system_mem, 0))
+       malloc_printerr (check_action, "malloc(): memory corruption",
+                        chunk2mem (victim));
       size = chunksize(victim);
 
       /*
@@ -4233,8 +4241,7 @@ _int_free(mstate av, Void_t* mem)
 #endif
       ) {
 
-    if (__builtin_expect (chunk_at_offset (p, size)->size <= 2 * SIZE_SZ,
-                         0)
+    if (__builtin_expect (chunk_at_offset (p, size)->size <= 2 * SIZE_SZ, 0)
        || __builtin_expect (chunksize (chunk_at_offset (p, size))
                             >= av->system_mem, 0))
       {
index 4c4305da1474a00e329b81493fab402c53cc4479..dde6f3b99efe5cae9df69e94aa20932df18e5487 100644 (file)
@@ -1,3 +1,18 @@
+2004-11-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * Makefile (libpthread-routines): Add vars.
+       * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
+       * init.c (__default_stacksize, __is_smp): Remove.
+       * vars.c: New file.
+       * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
+       and define a wrapper macro.
+       (PTHREAD_STATIC_FN_REQUIRE): Define.
+       * allocatestack.c (__find_thread_by_id): Undefine.
+       * pthread_create (__pthread_keys): Remove.
+       (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
+       pthread_key_create, pthread_setspecific, pthread_getspecific): Add
+       PTHREAD_STATIC_FN_REQUIRE.
+
 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
 
        * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
index 805b4dc046118d75b97ee4ff97950061ea770078..50156895bc5c7a5fe2848faca4d34866ef5aace2 100644 (file)
@@ -30,7 +30,7 @@ install-lib-ldscripts := libpthread.so
 routines = alloca_cutoff forward libc-lowlevellock libc-cancellation
 shared-only-routines = forward
 
-libpthread-routines = init events version \
+libpthread-routines = init vars events version \
                      pthread_create pthread_exit pthread_detach \
                      pthread_join pthread_tryjoin pthread_timedjoin \
                      pthread_self pthread_equal pthread_yield \
index 6c2367cc89313040a070c50599fd3b1445d09741..89a034e0ecb07a7462a1243451d1181a62a409fe 100644 (file)
@@ -771,6 +771,7 @@ __reclaim_stacks (void)
 
 
 #if HP_TIMING_AVAIL
+# undef __find_thread_by_id
 /* Find a thread given the thread ID.  */
 attribute_hidden
 struct pthread *
index aad2c9001f198cdb1473b189de5b81f8cb14fd3a..a18078edb8c87314b0fe0e295f711b838cc87f31 100644 (file)
 #endif
 
 
-/* Default stack size.  */
-size_t __default_stacksize attribute_hidden;
-
 /* Size and alignment of static TLS block.  */
 size_t __static_tls_size;
 size_t __static_tls_align_m1;
 
-/* Flag whether the machine is SMP or not.  */
-int __is_smp attribute_hidden;
-
 /* Version of the library, used in libthread_db to detect mismatches.  */
 static const char nptl_version[] __attribute_used__ = VERSION;
 
index f73c817f6002255d64ebcc32210302d6f55237b2..24168146fa3742d267af0043df219cf6cf13bf19 100644 (file)
@@ -278,7 +278,14 @@ extern int *__libc_multiple_threads_ptr attribute_hidden;
 #endif
 
 /* Find a thread given its TID.  */
-extern struct pthread *__find_thread_by_id (pid_t tid) attribute_hidden;
+extern struct pthread *__find_thread_by_id (pid_t tid) attribute_hidden
+#ifdef SHARED
+;
+#else
+weak_function;
+#define __find_thread_by_id(tid) \
+  (__find_thread_by_id ? (__find_thread_by_id) (tid) : (struct pthread *) NULL)
+#endif
 
 extern void __pthread_init_static_tls (struct link_map *) attribute_hidden;
 
@@ -450,4 +457,10 @@ extern void __nptl_deallocate_tsd (void) attribute_hidden;
 
 extern int __nptl_setxid (struct xid_command *cmdp) attribute_hidden;
 
+#ifdef SHARED
+# define PTHREAD_STATIC_FN_REQUIRE(name)
+#else
+# define PTHREAD_STATIC_FN_REQUIRE(name) __asm (".globl " #name);
+#endif
+
 #endif /* pthreadP.h */
index 82a3c683aaaf0df6bfabf7d7553edabe1672636a..fcfc5c6d97720934d168f38716927c97e28f74e8 100644 (file)
@@ -55,11 +55,6 @@ unsigned int __nptl_nthreads = 1;
 #include "createthread.c"
 
 
-/* Table of the key information.  */
-struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX]
-  __attribute__ ((nocommon));
-hidden_data_def (__pthread_keys)
-
 struct pthread *
 internal_function
 __find_in_stack_list (pd)
@@ -513,3 +508,14 @@ compat_symbol (libpthread, __pthread_create_2_0, pthread_create,
 /* Information for libthread_db.  */
 
 #include "../nptl_db/db_info.c"
+\f
+/* If pthread_create is present, libgcc_eh.a and libsupc++.a expects some other POSIX thread
+   functions to be present as well.  */
+PTHREAD_STATIC_FN_REQUIRE (pthread_mutex_lock)
+PTHREAD_STATIC_FN_REQUIRE (pthread_mutex_unlock)
+
+PTHREAD_STATIC_FN_REQUIRE (pthread_once)
+
+PTHREAD_STATIC_FN_REQUIRE (pthread_key_create)
+PTHREAD_STATIC_FN_REQUIRE (pthread_setspecific)
+PTHREAD_STATIC_FN_REQUIRE (pthread_getspecific)
index 25a2703ae139581bebbcd805bddc312ac27f3540..03a0f1aa377a28cdfe16604f2a78a6fd3523267b 100644 (file)
@@ -42,8 +42,6 @@
 
 
 #ifndef TLS_MULTIPLE_THREADS_IN_TCB
-/* Variable set to a nonzero value if more than one thread runs or ran.  */
-int __pthread_multiple_threads attribute_hidden;
 /* Pointer to the corresponding variable in libc.  */
 int *__libc_multiple_threads_ptr attribute_hidden;
 #endif
diff --git a/nptl/vars.c b/nptl/vars.c
new file mode 100644 (file)
index 0000000..1e1a3cf
--- /dev/null
@@ -0,0 +1,43 @@
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <pthreadP.h>
+#include <stdlib.h>
+#include <tls.h>
+#include <unistd.h>
+
+/* Default stack size.  */
+size_t __default_stacksize attribute_hidden
+#ifdef SHARED
+;
+#else
+  = PTHREAD_STACK_MIN;
+#endif
+
+/* Flag whether the machine is SMP or not.  */
+int __is_smp attribute_hidden;
+
+#ifndef TLS_MULTIPLE_THREADS_IN_TCB
+/* Variable set to a nonzero value if more than one thread runs or ran.  */
+int __pthread_multiple_threads attribute_hidden;
+#endif
+
+/* Table of the key information.  */
+struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX]
+  __attribute__ ((nocommon));
+hidden_data_def (__pthread_keys)
index e99ef28d962cfeda31da14fa5f0458874af6f2c5..76c0f67a8fac66931961d852d977a773c0c782bf 100644 (file)
@@ -152,8 +152,7 @@ extern int __sigpause (int __sig_or_mask, int __is_sig);
 #ifdef __FAVOR_BSD
 /* Set the mask of blocked signals to MASK,
    wait for a signal to arrive, and then restore the mask.  */
-extern int sigpause (int __mask) __THROW;
-# define sigpause(mask) __sigpause ((mask), 0)
+extern int sigpause (int __mask) __THROW __attribute_deprecated__;
 #else
 # ifdef __USE_XOPEN
 #  ifdef __GNUC__
@@ -176,13 +175,13 @@ extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
 # define sigmask(sig)  __sigmask(sig)
 
 /* Block signals in MASK, returning the old mask.  */
-extern int sigblock (int __mask) __THROW;
+extern int sigblock (int __mask) __THROW __attribute_deprecated__;
 
 /* Set the mask of blocked signals to MASK, returning the old mask.  */
-extern int sigsetmask (int __mask) __THROW;
+extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;
 
 /* Return currently selected signal mask.  */
-extern int siggetmask (void) __THROW;
+extern int siggetmask (void) __THROW __attribute_deprecated__;
 #endif /* Use BSD.  */
 
 
@@ -349,7 +348,8 @@ extern int siginterrupt (int __sig, int __interrupt) __THROW;
 /* Run signals handlers on the stack specified by SS (if not NULL).
    If OSS is not NULL, it is filled in with the old signal stack status.
    This interface is obsolete and on many platform not implemented.  */
-extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) __THROW;
+extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
+     __THROW __attribute_deprecated__;
 
 /* Alternate signal handler stack interface.
    This interface should always be preferred over `sigstack'.  */
index 5335caff2824c17caf7b2accbbdb5b81f489fb67..77e9b83c921713489c3a73eda80c88676f4ad5c3 100644 (file)
@@ -283,10 +283,10 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
    <linux/socket.h>.  */
 enum
   {
-    SCM_RIGHTS = 0x01,         /* Transfer file descriptors.  */
+    SCM_RIGHTS = 0x01          /* Transfer file descriptors.  */
 #define SCM_RIGHTS SCM_RIGHTS
 #ifdef __USE_BSD
-    SCM_CREDENTIALS = 0x02     /* Credentials passing.  */
+    , SCM_CREDENTIALS = 0x02   /* Credentials passing.  */
 # define SCM_CREDENTIALS SCM_CREDENTIALS
 #endif
   };