On Mon, Apr 10, 2023 at 10:04 PM Samuel Thibault
<samuel.thiba...@gnu.org> wrote:
> Sergey Bugaev, le lun. 03 avril 2023 14:56:21 +0300, a ecrit:
> > @@ -110,6 +132,10 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, 
> > const struct sigaction *action
> >             ucontext_t *uctxp;            /* Points to uctx, below.  */
> >           } posix;
> >       };
> > +
> > +#ifdef __x86_64__
> > +      void *_pad;
> > +#endif
>
> Please mention what that is for.

This is to make sigreturn_addr 16-byte aligned (and this is verified
by the static assert below). Our %rsp points right here at
&sigreturn_addr when we call the user's signal handler (and then
sigreturn, except we ret to it instead of call'ing it, but either way
it's pushing or popping 8 bytes), and it needs to be 16-byte aligned
before a function call per the x86_64 ABI. You're right that another
comment next to _pad itself wouldn't hurt.

Sergey

Reply via email to