about summary refs log tree commit diff
path: root/sysdeps/s390/s390-64/backtrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/s390/s390-64/backtrace.c')
-rw-r--r--sysdeps/s390/s390-64/backtrace.c9
1 files changed, 8 insertions, 1 deletions
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);