This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: backtrace for hppa
- From: Zack Weinberg <zackw at panix dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, "Carlos O'Donell" <carlos at redhat dot com>, dave dot anglin at bell dot net
- Date: Tue, 16 Jan 2018 11:30:41 -0500
- Subject: Re: backtrace for hppa
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.20.1801161611370.17210@digraph.polyomino.org.uk>
On Tue, Jan 16, 2018 at 11:20 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> As far as I can tell, the only architecture in glibc that uses the generic
> debug/backtrace.c is hppa.
> <https://sourceware.org/glibc/wiki/Release/2.26#HPPA> also shows the
> debug/tst-backtrace* tests as failing for hppa. That suggests the generic
> debug/backtrace.c is not in fact functional anywhere and so the x86_64
> backtrace implementation (which many other architectures include) would be
> a better generic version.
I observe that sysdeps/hppa/frame.h has received no substantive
changes since 2000, and contains
| /* FIXME: will verify this later */
| struct layout
| {
| void *next;
| void *return_address;
| };
which suggests that the use of debug/backtrace.c for HPPA was never
properly validated.
> --- 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;
This change should probably be applied independently of whether it
helps hppa (and I don't see any reason to wait, either).
zw