From: Carlos O'Donell <carlos@redhat.com>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH 07/10] __frame_state_for: Use <unwind-link.h> for unwinder access
Date: Mon, 1 Mar 2021 08:54:59 -0500 [thread overview]
Message-ID: <d0b7831c-9ecb-6d74-0028-32e5df429cf7@redhat.com> (raw)
In-Reply-To: <ebeb7219e9450125c2ef122aa2114ad7e52453b9.1613577607.git.fweimer@redhat.com>
On 2/17/21 11:03 AM, Florian Weimer via Libc-alpha wrote:
LGTM. Cleanup generic __frame_state_for.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
> ---
> sysdeps/generic/framestate.c | 21 ++++++++-------------
> 1 file changed, 8 insertions(+), 13 deletions(-)
>
> diff --git a/sysdeps/generic/framestate.c b/sysdeps/generic/framestate.c
> index c1b364dbaa..54c4817f37 100644
> --- a/sysdeps/generic/framestate.c
> +++ b/sysdeps/generic/framestate.c
> @@ -17,7 +17,6 @@
> License along with the GNU C Library; if not, see
> <https://www.gnu.org/licenses/>. */
>
> -#include <dlfcn.h>
> #include <stdlib.h>
> #define STATIC static
> #define __frame_state_for fallback_frame_state_for
> @@ -25,6 +24,8 @@
> #undef __frame_state_for
> #include <gnu/lib-names.h>
>
> +#include <unwind-link.h>
> +
> typedef struct frame_state * (*framesf)(void *pc, struct frame_state *);
> struct frame_state *__frame_state_for (void *pc,
> struct frame_state *frame_state);
> @@ -32,21 +33,15 @@ struct frame_state *__frame_state_for (void *pc,
> struct frame_state *
> __frame_state_for (void *pc, struct frame_state *frame_state)
> {
> - static framesf frame_state_for;
> -
> - if (frame_state_for == NULL)
> + struct unwind_link *unwind_link = __libc_unwind_link_get ();
> + if (unwind_link != NULL)
> + return UNWIND_LINK_PTR (unwind_link, __frame_state_for) (pc, frame_state);
> + else
> {
> - void *handle = __libc_dlopen (LIBGCC_S_SO);
> -
> - if (handle == NULL
> - || (frame_state_for
> - = (framesf) __libc_dlsym (handle, "__frame_state_for")) == NULL)
> #ifndef __USING_SJLJ_EXCEPTIONS__
> - frame_state_for = fallback_frame_state_for;
> + return fallback_frame_state_for (pc, frame_state);
> #else
> - frame_state_for = abort;
> + abort ();
> #endif
> }
> -
> - return frame_state_for (pc, frame_state);
> }
>
--
Cheers,
Carlos.
next prev parent reply other threads:[~2021-03-01 13:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-17 16:02 [PATCH 00/10] Unwinder interface consolidation Florian Weimer
2021-02-17 16:02 ` [PATCH 01/10] Implement <unwind-link.h> for dynamically loading the libgcc_s unwinder Florian Weimer
2021-03-01 13:54 ` Carlos O'Donell
2021-02-17 16:02 ` [PATCH 02/10] backtrace: Implement on top of <unwind-link.h> Florian Weimer
2021-03-01 13:54 ` Carlos O'Donell
2021-02-17 16:02 ` [PATCH 03/10] arm: Implement backtrace " Florian Weimer
2021-03-01 13:54 ` Carlos O'Donell
2021-02-17 16:03 ` [PATCH 04/10] i386: " Florian Weimer
2021-03-01 13:54 ` Carlos O'Donell
2021-02-17 16:03 ` [PATCH 05/10] m68k: " Florian Weimer
2021-03-01 13:54 ` Carlos O'Donell
2021-02-17 16:03 ` [PATCH 06/10] sparc: Implement backtrace on top <unwind-link.h> Florian Weimer
2021-03-01 13:54 ` Carlos O'Donell
2021-02-17 16:03 ` [PATCH 07/10] __frame_state_for: Use <unwind-link.h> for unwinder access Florian Weimer
2021-03-01 13:54 ` Carlos O'Donell [this message]
2021-02-17 16:03 ` [PATCH 08/10] Move sysdeps/gnu/unwind-resume.c to sysdeps/generic/unwind-resume.c Florian Weimer
2021-03-01 13:55 ` Carlos O'Donell
2021-02-17 16:03 ` [PATCH 09/10] Implement _Unwind_Resume in libc on top of <unwind-link.h> Florian Weimer
2021-03-01 13:55 ` Carlos O'Donell
2021-02-17 16:03 ` [PATCH 10/10] nptl: Use <unwind-link.h> for accessing the libgcc_s unwinder Florian Weimer
2021-03-01 13:55 ` Carlos O'Donell
2021-03-01 13:54 ` [PATCH 00/10] Unwinder interface consolidation Carlos O'Donell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d0b7831c-9ecb-6d74-0028-32e5df429cf7@redhat.com \
--to=carlos@redhat.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).