diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-05-09 15:19:13 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-05-09 15:19:13 +0000 |
commit | be434a72b023edab7851c13da8f0639e46ee4fa8 (patch) | |
tree | 99f98e631af6a49de5add8870d12413a61e7fc47 /nptl/sysdeps | |
parent | bf3635d31d18ed1d6274115ed332db374a3e7bcf (diff) | |
download | glibc-be434a72b023edab7851c13da8f0639e46ee4fa8.tar.gz glibc-be434a72b023edab7851c13da8f0639e46ee4fa8.tar.xz glibc-be434a72b023edab7851c13da8f0639e46ee4fa8.zip |
[BZ #2644]
2006-05-09 Ulrich Drepper <drepper@redhat.com> [BZ #2644] * sysdeps/pthread/unwind-forcedunwind.c: Different solution for the reload problem. Change the one path in pthread_cancel_init which causes the problem. Force gcc to reload. Simplify callers. * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c (_Unwind_GetBSP): Undo last patch.
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r-- | nptl/sysdeps/pthread/unwind-forcedunwind.c | 42 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c | 7 |
2 files changed, 19 insertions, 30 deletions
diff --git a/nptl/sysdeps/pthread/unwind-forcedunwind.c b/nptl/sysdeps/pthread/unwind-forcedunwind.c index 47f67bc721..2f1579586d 100644 --- a/nptl/sysdeps/pthread/unwind-forcedunwind.c +++ b/nptl/sysdeps/pthread/unwind-forcedunwind.c @@ -22,13 +22,13 @@ #include <unwind.h> #include <pthreadP.h> -static void (*volatile libgcc_s_resume) (struct _Unwind_Exception *exc); -static _Unwind_Reason_Code (*volatile libgcc_s_personality) +static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); +static _Unwind_Reason_Code (*libgcc_s_personality) (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, struct _Unwind_Context *); -static _Unwind_Reason_Code (*volatile libgcc_s_forcedunwind) +static _Unwind_Reason_Code (*libgcc_s_forcedunwind) (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); -static _Unwind_Word (*volatile libgcc_s_getcfa) (struct _Unwind_Context *); +static _Unwind_Word (*libgcc_s_getcfa) (struct _Unwind_Context *); void pthread_cancel_init (void) @@ -37,7 +37,11 @@ pthread_cancel_init (void) void *handle; if (__builtin_expect (libgcc_s_getcfa != NULL, 1)) - return; + { + /* Force gcc to reload all values. */ + asm volatile ("" ::: "memory"); + return; + } handle = __libc_dlopen ("libgcc_s.so.1"); @@ -67,11 +71,8 @@ void _Unwind_Resume (struct _Unwind_Exception *exc) { if (__builtin_expect (libgcc_s_resume == NULL, 0)) - { - pthread_cancel_init (); - /* The function pointer has changed, ensure we reload it. */ - asm volatile ("" : "+m" (libgcc_s_resume)); - } + pthread_cancel_init (); + libgcc_s_resume (exc); } @@ -82,11 +83,8 @@ __gcc_personality_v0 (int version, _Unwind_Action actions, struct _Unwind_Context *context) { if (__builtin_expect (libgcc_s_personality == NULL, 0)) - { - pthread_cancel_init (); - /* The function pointer has changed, ensure we reload it. */ - asm volatile ("" : "+m" (libgcc_s_personality)); - } + pthread_cancel_init (); + return libgcc_s_personality (version, actions, exception_class, ue_header, context); } @@ -96,11 +94,8 @@ _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop, void *stop_argument) { if (__builtin_expect (libgcc_s_forcedunwind == NULL, 0)) - { - pthread_cancel_init (); - /* The function pointer has changed, ensure we reload it. */ - asm volatile ("" : "+m" (libgcc_s_forcedunwind)); - } + pthread_cancel_init (); + return libgcc_s_forcedunwind (exc, stop, stop_argument); } @@ -108,10 +103,7 @@ _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *context) { if (__builtin_expect (libgcc_s_getcfa == NULL, 0)) - { - pthread_cancel_init (); - /* The function pointer has changed, ensure we reload it. */ - asm volatile ("" : "+m" (libgcc_s_getcfa)); - } + pthread_cancel_init (); + return libgcc_s_getcfa (context); } diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c b/nptl/sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c index a788fa31f9..d0c77a62e6 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c +++ b/nptl/sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c @@ -33,10 +33,7 @@ _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *context) { if (__builtin_expect (libgcc_s_getbsp == NULL, 0)) - { - pthread_cancel_init (); - /* The function pointer has changed, ensure we reload it. */ - asm volatile ("" : "+m" (libgcc_s_getbsp)); - } + pthread_cancel_init (); + return libgcc_s_getbsp (context); } |