This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Use LIBGCC_S_SO in x86_64 backtrace [committed]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Tue, 16 Jan 2018 20:53:41 +0000
- Subject: Use LIBGCC_S_SO in x86_64 backtrace [committed]
- Authentication-results: sourceware.org; auth=none
The x86_64 backtrace implementation is used as a generic
implementation (unwinding via unwind info and _Unwind_Backtrace) by
various other architectures. This patch makes it more generic by
making it use LIBGCC_S_SO from gnu/lib-names.h instead of hardcoding
the libgcc_s.so.1 name, so that it can also be used on hppa which uses
libgcc_s.so.4.
Tested for x86_64. Committed.
2018-01-16 Joseph Myers <joseph@codesourcery.com>
* sysdeps/x86_64/backtrace.c: Include <gnu/lib-names.h>.
(init): Use LIBGCC_S_SO not hardcoded "libgcc_s.so.1".
diff --git a/sysdeps/x86_64/backtrace.c b/sysdeps/x86_64/backtrace.c
index 2706b50..d423cc0 100644
--- a/sysdeps/x86_64/backtrace.c
+++ b/sysdeps/x86_64/backtrace.c
@@ -20,6 +20,7 @@
#include <libc-lock.h>
#include <dlfcn.h>
#include <execinfo.h>
+#include <gnu/lib-names.h>
#include <stdlib.h>
#include <unwind.h>
@@ -49,7 +50,7 @@ dummy_getcfa (struct _Unwind_Context *ctx __attribute__ ((unused)))
static void
init (void)
{
- libgcc_handle = __libc_dlopen ("libgcc_s.so.1");
+ libgcc_handle = __libc_dlopen (LIBGCC_S_SO);
if (libgcc_handle == NULL)
return;
--
Joseph S. Myers
joseph@codesourcery.com