Use PTHFCT_CALL to demangle pointer.
authordrepper <drepper>
Wed, 17 Jan 2007 08:36:51 +0000 (08:36 +0000)
committerdrepper <drepper>
Wed, 17 Jan 2007 08:36:51 +0000 (08:36 +0000)
csu/libc-start.c
nptl/sysdeps/pthread/setxid.h
nptl/sysdeps/unix/sysv/linux/jmp-unwind.c
nptl/sysdeps/unix/sysv/linux/s390/jmp-unwind.c
sysdeps/unix/sysv/linux/fatal-prepare.h

index 6348447..0ed9936 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2006, 2007 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
@@ -225,7 +225,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
     {
       /* Remove the thread-local data.  */
 # ifdef SHARED
-      __libc_pthread_functions.ptr__nptl_deallocate_tsd ();
+      PTHFCT_CALL (ptr__nptl_deallocate_tsd, ());
 # else
       extern void __nptl_deallocate_tsd (void) __attribute ((weak));
       __nptl_deallocate_tsd ();
@@ -235,7 +235,8 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
         terminate the entire process.  */
       result = 0;
 # ifdef SHARED
-      unsigned int *const ptr = __libc_pthread_functions.ptr_nthreads;
+      unsigned int *ptr = __libc_pthread_functions.ptr_nthreads;
+      PTR_DEMANGLE (ptr);
 # else
       extern unsigned int __nptl_nthreads __attribute ((weak));
       unsigned int *const ptr = &__nptl_nthreads;
index 8ec382f..aebdbd2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2007 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
 # define INLINE_SETXID_SYSCALL(name, nr, args...) \
   ({                                                                   \
     int __result;                                                      \
-    if (__builtin_expect (__libc_pthread_functions.ptr__nptl_setxid    \
-                         != NULL, 0))                                  \
+    if (__builtin_expect (__libc_pthread_functions_init, 0))           \
       {                                                                        \
        struct xid_command __cmd;                                       \
        __cmd.syscall_no = __NR_##name;                                 \
        __SETXID_##nr (__cmd, args);                                    \
-       __result = __libc_pthread_functions.ptr__nptl_setxid (&__cmd);  \
+       __result = PTHFCT_CALL (ptr__nptl_setxid, (&__cmd));            \
        }                                                               \
     else                                                               \
       __result = INLINE_SYSCALL (name, nr, args);                      \
index c435eff..f279551 100644 (file)
@@ -1,5 +1,5 @@
 /* Clean up stack frames unwound by longjmp.  Linux version.
-   Copyright (C) 1995, 1997, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1997, 2002, 2003, 2007 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
@@ -29,11 +29,11 @@ void
 _longjmp_unwind (jmp_buf env, int val)
 {
 #ifdef SHARED
-# define fptr __libc_pthread_functions.ptr___pthread_cleanup_upto
+  if (__libc_pthread_functions_init)
+    PTHFCT_CALL (ptr___pthread_cleanup_upto, (env->__jmpbuf,
+                                             CURRENT_STACK_FRAME));
 #else
-# define fptr __pthread_cleanup_upto
+  if (__pthread_cleanup_upto != NULL)
+    __pthread_cleanup_upto (env->__jmpbuf, CURRENT_STACK_FRAME);
 #endif
-
-  if (fptr != NULL)
-    fptr (env->__jmpbuf, CURRENT_STACK_FRAME);
 }
index 36886f5..3c18df2 100644 (file)
@@ -1,5 +1,5 @@
 /* Clean up stack frames unwound by longjmp.  Linux/s390 version.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -28,14 +28,13 @@ extern void __pthread_cleanup_upto (__jmp_buf env, char *targetframe);
 void
 _longjmp_unwind (jmp_buf env, int val)
 {
+  unsigned char local_var;
+
 #ifdef SHARED
-# define fptr __libc_pthread_functions.ptr___pthread_cleanup_upto
+  if (__libc_pthread_functions_init)
+    PTHFCT_CALL (ptr___pthread_cleanup_upto, (env->__jmpbuf, &local_var));
 #else
-# define fptr __pthread_cleanup_upto
+  if (__pthread_cleanup_upto != NULL)
+    __pthread_cleanup_upto (env->__jmpbuf, &local_var);
 #endif
-
-  unsigned char local_var;
-
-  if (fptr != NULL)
-    fptr (env->__jmpbuf, &local_var);
 }
index d48ae62..81f38b0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2007 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
 # include <pthread-functions.h>
 # define FATAL_PREPARE \
   {                                                                          \
-    int (*fp) (int, int *);                                                  \
-    fp = __libc_pthread_functions.ptr_pthread_setcancelstate;                \
-    if (fp != NULL)                                                          \
-      fp (PTHREAD_CANCEL_DISABLE, NULL);                                     \
+    if (__libc_pthread_functions_init)                                       \
+      PTHFCT_CALL (ptr_pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE,              \
+                                               NULL));                       \
   }
 #else
 # pragma weak pthread_setcancelstate