Skip to content

Commit

Permalink
[BZ #2644]
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ulrich Drepper committed May 9, 2006
1 parent bf3635d commit be434a7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 30 deletions.
9 changes: 9 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
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.

2006-05-07 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
Expand Down
42 changes: 17 additions & 25 deletions nptl/sysdeps/pthread/unwind-forcedunwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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");

Expand Down Expand Up @@ -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);
}

Expand All @@ -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);
}
Expand All @@ -96,22 +94,16 @@ _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);
}

_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);
}
7 changes: 2 additions & 5 deletions nptl/sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit be434a7

Please sign in to comment.