diff mbox series

x86: Fixup some nits in longjmp asm implementation

Message ID 20240104232512.3617987-1-goldstein.w.n@gmail.com
State New
Headers show
Series x86: Fixup some nits in longjmp asm implementation | expand

Commit Message

Noah Goldstein Jan. 4, 2024, 11:25 p.m. UTC
Replace a stray `nop` with a `.p2align` directive.
---
 sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

H.J. Lu Jan. 5, 2024, 4:33 p.m. UTC | #1
On Thu, Jan 4, 2024 at 3:25 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> Replace a stray `nop` with a `.p2align` directive.
> ---
>  sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
> index 9aa24620b9..083ffb33f2 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
> +++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
> @@ -57,7 +57,7 @@ longjmp_msg:
>         cfi_def_cfa_offset(16);                                         \
>         LOAD_MSG;                                                       \
>         call    HIDDEN_JUMPTARGET(__fortify_fail);                      \
> -       nop;                                                            \
> +       .p2align 3, 5;                                                          \

p2align should be placed after cfi_restore_state.

>         cfi_restore_state;                                              \
>  .Lok2:                                                                 \
>         movq    %r10, %rdi;                                             \
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
index 9aa24620b9..083ffb33f2 100644
--- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
@@ -57,7 +57,7 @@  longjmp_msg:
 	cfi_def_cfa_offset(16);						\
 	LOAD_MSG;							\
 	call	HIDDEN_JUMPTARGET(__fortify_fail);			\
-	nop;								\
+	.p2align 3, 5;								\
 	cfi_restore_state;						\
 .Lok2:									\
 	movq	%r10, %rdi;						\