aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-02-13 17:35:07 +0000
committerJoseph Myers <joseph@codesourcery.com>2009-02-13 17:35:07 +0000
commitf281f9cfdae6156aca98c23cecc796907e9ca913 (patch)
treeee13da2b4e22c04a9e370939744453c0cc09cd3d
parentb3862ba3c8905a9332bd4338068a26062e1e2722 (diff)
downloadglibc-f281f9cfdae6156aca98c23cecc796907e9ca913.tar.xz
glibc-f281f9cfdae6156aca98c23cecc796907e9ca913.zip
2009-02-13 Khem Raj <raj.khem@gmail.com>
* sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c (libgcc_s_handle): New variable. (pthread_cancel_init): Depend in libgcc_s_handle for decision to load DSO. Assign last. (__unwind_freeres): New function. * sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c: Likewise.
-rw-r--r--ChangeLog.arm13
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c20
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c20
3 files changed, 46 insertions, 7 deletions
diff --git a/ChangeLog.arm b/ChangeLog.arm
index fd520bcd9c..864fd57117 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,14 @@
+2009-02-13 Khem Raj <raj.khem@gmail.com>
+
+ * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+ (libgcc_s_handle): New variable.
+ (pthread_cancel_init): Depend in libgcc_s_handle for decision to
+ load DSO. Assign last.
+ (__unwind_freeres): New function.
+
+ * sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c:
+ Likewise.
+
2009-02-05 Paul Brook <paul@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
@@ -36,7 +47,7 @@
2009-01-27 Ryosei Takagi <ryosei@sm.sony.co.jp>
- * sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+ * sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
(lll_futex_wake_unlock, lll_futex_requeue): Return zero if success.
2009-01-27 Daniel Jacobowitz <dan@codesourcery.com>
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
index 71ab77c6fa..ed321a3964 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
+++ b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
@@ -22,6 +22,7 @@
#include <unwind.h>
#include <pthreadP.h>
+static void *libgcc_s_handle;
static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
static _Unwind_Reason_Code (*libgcc_s_personality)
(_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
@@ -36,7 +37,7 @@ pthread_cancel_init (void)
void *resume, *personality, *forcedunwind, *getcfa;
void *handle;
- if (__builtin_expect (libgcc_s_getcfa != NULL, 1))
+ if (__builtin_expect (libgcc_s_handle != NULL, 1))
{
/* Force gcc to reload all values. */
asm volatile ("" ::: "memory");
@@ -60,11 +61,24 @@ pthread_cancel_init (void)
libgcc_s_resume = resume;
libgcc_s_personality = personality;
libgcc_s_forcedunwind = forcedunwind;
+ libgcc_s_getcfa = getcfa;
/* Make sure libgcc_s_getcfa is written last. Otherwise,
pthread_cancel_init might return early even when the pointer the
caller is interested in is not initialized yet. */
atomic_write_barrier ();
- libgcc_s_getcfa = getcfa;
+ libgcc_s_handle = handle;
+}
+
+void
+__libc_freeres_fn_section
+__unwind_freeres (void)
+{
+ void *handle = libgcc_s_handle;
+ if (handle != NULL)
+ {
+ libgcc_s_handle = NULL;
+ __libc_dlclose (handle);
+ }
}
/* It's vitally important that _Unwind_Resume not have a stack frame; the
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
index b281963568..e19facfb89 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+++ b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
@@ -22,6 +22,7 @@
#include <unwind.h>
#include <pthreadP.h>
+static void *libgcc_s_handle;
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 *,
@@ -40,7 +41,7 @@ pthread_cancel_init (void)
void *handle;
void *sjlj_register, *sjlj_unregister;
- if (__builtin_expect (libgcc_s_getcfa != NULL, 1))
+ if (__builtin_expect (libgcc_s_handle != NULL, 1))
{
/* Force gcc to reload all values. */
asm volatile ("" ::: "memory");
@@ -65,11 +66,24 @@ pthread_cancel_init (void)
libgcc_s_forcedunwind = forcedunwind;
libgcc_s_sjlj_register = sjlj_register;
libgcc_s_sjlj_unregister = sjlj_unregister;
+ libgcc_s_getcfa = getcfa;
/* Make sure libgcc_s_getcfa is written last. Otherwise,
pthread_cancel_init might return early even when the pointer the
caller is interested in is not initialized yet. */
atomic_write_barrier ();
- libgcc_s_getcfa = getcfa;
+ libgcc_s_handle = handle;
+}
+
+void
+__libc_freeres_fn_section
+__unwind_freeres (void)
+{
+ void *handle = libgcc_s_handle;
+ if (handle != NULL)
+ {
+ libgcc_s_handle = NULL;
+ __libc_dlclose (handle);
+ }
}
void