public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Noah Goldstein <goldstein.w.n@gmail.com>,
	 libc-alpha@sourceware.org, carlos@systemhalted.org
Subject: Re: x86: Fixup some nits in longjmp asm implementation
Date: Thu, 04 Jan 2024 23:40:11 +0100	[thread overview]
Message-ID: <878r54soxg.fsf@igel.home> (raw)
In-Reply-To: <CAMe9rOq0db1w8YNSM3s1nfbRtpegBQC0qTBq_WU_LVLAdUPg0w@mail.gmail.com> (H. J. Lu's message of "Thu, 4 Jan 2024 14:22:44 -0800")

On Jan 04 2024, H.J. Lu wrote:

>  #ifdef PIC
> -# define CALL_FAIL  leaq  longjmp_msg(%rip), %rdi;            \
> -        call  __GI___fortify_fail
> +# define CALL_FAIL  subq  $8, %rsp;                  \
> +        cfi_remember_state;                 \
> +        cfi_def_cfa_offset(16);                \
> +        leaq  longjmp_msg(%rip), %rdi;            \
> +        call  __GI___fortify_fail;             \
> +        nop;                       \
> +        cfi_restore_state
>
> I don't think NOP is required.

Is the unwind information correct without the nop?  Without it, the
return address points to the following label.  It is customary that a
noreturn call is followed by a nop to avoid that.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

  reply	other threads:[~2024-01-04 22:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04 22:16 Noah Goldstein
2024-01-04 22:22 ` H.J. Lu
2024-01-04 22:40   ` Andreas Schwab [this message]
2024-01-04 23:07     ` Noah Goldstein
2024-01-04 23:42     ` H.J. Lu
2024-01-05 11:18       ` Andreas Schwab
2024-01-05 15:22         ` H.J. Lu
2024-01-05 16:42           ` Andreas Schwab
2024-01-04 23:25 ` Noah Goldstein
2024-01-05 16:33   ` H.J. Lu
2024-01-05 19:12 ` Noah Goldstein
2024-01-05 20:09   ` H.J. Lu
2024-01-05 22:00 ` Noah Goldstein
2024-01-05 22:29   ` H.J. Lu

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=878r54soxg.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=carlos@systemhalted.org \
    --cc=goldstein.w.n@gmail.com \
    --cc=hjl.tools@gmail.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).