From a9e526e7d2fc77ee4b77de7e35a6d6a41c450fb2 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 11 Jun 2004 20:12:55 +0000 Subject: * sysdeps/s390/s390-32/backtrace.c (init): Guard with #ifdef SHARED. (unwind_backtrace, unwind_getip): Define #ifndef SHARED. (__backtrace): Don't call init #ifndef SHARED. * sysdeps/s390/s390-64/backtrace.c (init): Guard with #ifdef SHARED. (unwind_backtrace, unwind_getip): Define #ifndef SHARED. (__backtrace): Don't call init #ifndef SHARED. * sysdeps/ia64/backtrace.c (init): Guard with #ifdef SHARED. (unwind_backtrace, unwind_getip): Define #ifndef SHARED. (__backtrace): Don't call init #ifndef SHARED. --- sysdeps/ia64/backtrace.c | 9 ++++++++- sysdeps/s390/s390-32/backtrace.c | 9 ++++++++- sysdeps/s390/s390-64/backtrace.c | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/ia64/backtrace.c b/sysdeps/ia64/backtrace.c index d9daf0f54a..efacccce15 100644 --- a/sysdeps/ia64/backtrace.c +++ b/sysdeps/ia64/backtrace.c @@ -1,5 +1,5 @@ /* Return backtrace of current program state. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 2003. @@ -30,6 +30,7 @@ struct trace_arg int cnt, size; }; +#ifdef SHARED static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *); static _Unwind_Ptr (*unwind_getip) (struct _Unwind_Context *); @@ -46,6 +47,10 @@ init (void) if (unwind_getip == NULL) unwind_backtrace = NULL; } +#else +# define unwind_backtrace _Unwind_Backtrace +# define unwind_getip _Unwind_GetIP +#endif static _Unwind_Reason_Code backtrace_helper (struct _Unwind_Context *ctx, void *a) @@ -67,11 +72,13 @@ __backtrace (array, size) int size; { struct trace_arg arg = { .array = array, .size = size, .cnt = -1 }; +#ifdef SHARED __libc_once_define (static, once); __libc_once (once, init); if (unwind_backtrace == NULL) return 0; +#endif if (size >= 1) unwind_backtrace (backtrace_helper, &arg); diff --git a/sysdeps/s390/s390-32/backtrace.c b/sysdeps/s390/s390-32/backtrace.c index c52750cecf..7a632572b5 100644 --- a/sysdeps/s390/s390-32/backtrace.c +++ b/sysdeps/s390/s390-32/backtrace.c @@ -1,5 +1,5 @@ /* Return backtrace of current program state. - Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -61,6 +61,7 @@ struct trace_arg int cnt, size; }; +#ifdef SHARED static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *); static _Unwind_Ptr (*unwind_getip) (struct _Unwind_Context *); @@ -77,6 +78,10 @@ init (void) if (unwind_getip == NULL) unwind_backtrace = NULL; } +#else +# define unwind_backtrace _Unwind_Backtrace +# define unwind_getip _Unwind_GetIP +#endif static int __backchain_backtrace (void **array, int size) @@ -122,9 +127,11 @@ int __backtrace (void **array, int size) { struct trace_arg arg = { .array = array, .size = size, .cnt = -1 }; +#ifdef SHARED __libc_once_define (static, once); __libc_once (once, init); +#endif if (unwind_backtrace == NULL) return __backchain_backtrace (array, size); diff --git a/sysdeps/s390/s390-64/backtrace.c b/sysdeps/s390/s390-64/backtrace.c index 8efdc6c0ac..05321349ca 100644 --- a/sysdeps/s390/s390-64/backtrace.c +++ b/sysdeps/s390/s390-64/backtrace.c @@ -1,5 +1,5 @@ /* Return backtrace of current program state. 64 bit S/390 version. - Copyright (C) 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -60,6 +60,7 @@ struct trace_arg int cnt, size; }; +#ifdef SHARED static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *); static _Unwind_Ptr (*unwind_getip) (struct _Unwind_Context *); @@ -76,6 +77,10 @@ init (void) if (unwind_getip == NULL) unwind_backtrace = NULL; } +#else +# define unwind_backtrace _Unwind_Backtrace +# define unwind_getip _Unwind_GetIP +#endif int __backchain_backtrace (void **array, int size) @@ -121,9 +126,11 @@ int __backtrace (void **array, int size) { struct trace_arg arg = { .array = array, .size = size, .cnt = -1 }; +#ifdef SHARED __libc_once_define (static, once); __libc_once (once, init); +#endif if (unwind_backtrace == NULL) return __backchain_backtrace (array, size); -- cgit v1.2.3