summaryrefslogtreecommitdiff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-12-12 18:13:35 +0000
committerJakub Jelinek <jakub@redhat.com>2007-12-12 18:13:35 +0000
commit574e283890a6ca92325a06dafa76ff307a8019a2 (patch)
tree055e44e24a55fb4863e5d9cdc04e320cde52ffe9 /sysdeps/i386
parenta162e5955f7e324be82d9318bbcbe869c66ffb86 (diff)
Updated to fedora-glibc-20071212T1051
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/backtrace.c35
-rw-r--r--sysdeps/i386/i586/memcpy_chk.S1
-rw-r--r--sysdeps/i386/i586/mempcpy_chk.S1
-rw-r--r--sysdeps/i386/i586/memset_chk.S1
4 files changed, 30 insertions, 8 deletions
diff --git a/sysdeps/i386/backtrace.c b/sysdeps/i386/backtrace.c
index 8b61913dde..cf3b2719b9 100644
--- a/sysdeps/i386/backtrace.c
+++ b/sysdeps/i386/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state.
- Copyright (C) 1998, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2003-2005, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -36,21 +36,26 @@ static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *);
static _Unwind_Ptr (*unwind_getip) (struct _Unwind_Context *);
static _Unwind_Ptr (*unwind_getcfa) (struct _Unwind_Context *);
static _Unwind_Ptr (*unwind_getgr) (struct _Unwind_Context *, int);
+static void *libgcc_handle;
static void
init (void)
{
- void *handle = __libc_dlopen ("libgcc_s.so.1");
+ libgcc_handle = __libc_dlopen ("libgcc_s.so.1");
- if (handle == NULL)
+ if (libgcc_handle == NULL)
return;
- unwind_backtrace = __libc_dlsym (handle, "_Unwind_Backtrace");
- unwind_getip = __libc_dlsym (handle, "_Unwind_GetIP");
- unwind_getcfa = __libc_dlsym (handle, "_Unwind_GetCFA");
- unwind_getgr = __libc_dlsym (handle, "_Unwind_GetGR");
+ unwind_backtrace = __libc_dlsym (libgcc_handle, "_Unwind_Backtrace");
+ unwind_getip = __libc_dlsym (libgcc_handle, "_Unwind_GetIP");
+ unwind_getcfa = __libc_dlsym (libgcc_handle, "_Unwind_GetCFA");
+ unwind_getgr = __libc_dlsym (libgcc_handle, "_Unwind_GetGR");
if (unwind_getip == NULL || unwind_getgr == NULL || unwind_getcfa == NULL)
- unwind_backtrace = NULL;
+ {
+ unwind_backtrace = NULL;
+ __libc_dlclose (libgcc_handle);
+ libgcc_handle = NULL;
+ }
}
#else
# define unwind_backtrace _Unwind_Backtrace
@@ -142,3 +147,17 @@ __backtrace (array, size)
}
weak_alias (__backtrace, backtrace)
libc_hidden_def (__backtrace)
+
+
+#ifdef SHARED
+/* Free all resources if necessary. */
+libc_freeres_fn (free_mem)
+{
+ unwind_backtrace = NULL;
+ if (libgcc_handle != NULL)
+ {
+ __libc_dlclose (libgcc_handle);
+ libgcc_handle = NULL;
+ }
+}
+#endif
diff --git a/sysdeps/i386/i586/memcpy_chk.S b/sysdeps/i386/i586/memcpy_chk.S
new file mode 100644
index 0000000000..ab8a95c9b4
--- /dev/null
+++ b/sysdeps/i386/i586/memcpy_chk.S
@@ -0,0 +1 @@
+#include <sysdeps/i386/i686/memcpy_chk.S>
diff --git a/sysdeps/i386/i586/mempcpy_chk.S b/sysdeps/i386/i586/mempcpy_chk.S
new file mode 100644
index 0000000000..9a1de1dfe3
--- /dev/null
+++ b/sysdeps/i386/i586/mempcpy_chk.S
@@ -0,0 +1 @@
+#include <sysdeps/i386/i686/mempcpy_chk.S>
diff --git a/sysdeps/i386/i586/memset_chk.S b/sysdeps/i386/i586/memset_chk.S
new file mode 100644
index 0000000000..09f9d42e0d
--- /dev/null
+++ b/sysdeps/i386/i586/memset_chk.S
@@ -0,0 +1 @@
+#include <sysdeps/i386/i686/memset_chk.S>