Change to the documentation discussing stack frames

19 views
Skip to first unread message

Lukas Diekmann

unread,
Feb 16, 2021, 8:53:36 AM2/16/21
to X86-64 System V Application Binary Interface
Hello,

I would like to propose a change to the documentation discussion stack frames,
as I found the following paragraph slightly confusing:

> The end of the input argument area shall be aligned on a 16 byte boundary. In
> other words, the value (%rsp+ 8) is always a multiple of 16 when control is
> transferred to the function entry point.

I believe the crucial part is "when control is transferred" which can be
interpreted as both before and after the call instruction was executed. To make
things a little clearer, I would like to propose to change this paragraph as
follows:

> The end of the input argument area shall be aligned on a 16-byte boundary. In
> other words, the stack needs to be 16-byte aligned immediately before the call
> instruction is executed. Once control has been transferred to the function
> entry point, i.e. immediately after the return value has been pushed, %rsp
> points to the return address, and the value of (%rsp+8) is a multiple of 16.

I'd be happy to raise a PR for this.

Kind regards,
Lukas

Christian Convey

unread,
Feb 16, 2021, 9:21:15 AM2/16/21
to Lukas Diekmann, X86-64 System V Application Binary Interface
I think adding some clarification makes sense. The current wording caused me some confusion as well.

--
You received this message because you are subscribed to the Google Groups "X86-64 System V Application Binary Interface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to x86-64-abi+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/x86-64-abi/330d7131-91f0-4d91-ba79-a4e0296a5093n%40googlegroups.com.

H.J. Lu

unread,
Feb 16, 2021, 9:24:14 AM2/16/21
to Christian Convey, Lukas Diekmann, X86-64 System V Application Binary Interface
On Tue, Feb 16, 2021 at 6:21 AM Christian Convey
<christia...@gmail.com> wrote:
>
> I think adding some clarification makes sense. The current wording caused me some confusion as well.
>
> On Tue, Feb 16, 2021 at 8:53 AM Lukas Diekmann <lukas.d...@gmail.com> wrote:
>>
>> Hello,
>>
>> I would like to propose a change to the documentation discussion stack frames,
>> as I found the following paragraph slightly confusing:
>>
>> > The end of the input argument area shall be aligned on a 16 byte boundary. In
>> > other words, the value (%rsp+ 8) is always a multiple of 16 when control is
>> > transferred to the function entry point.
>>
>> I believe the crucial part is "when control is transferred" which can be
>> interpreted as both before and after the call instruction was executed. To make
>> things a little clearer, I would like to propose to change this paragraph as
>> follows:
>>
>> > The end of the input argument area shall be aligned on a 16-byte boundary. In
>> > other words, the stack needs to be 16-byte aligned immediately before the call
>> > instruction is executed. Once control has been transferred to the function
>> > entry point, i.e. immediately after the return value has been pushed, %rsp
>> > points to the return address, and the value of (%rsp+8) is a multiple of 16.
>>
>> I'd be happy to raise a PR for this.
>>

You can open an issue and create a merge request at:

https://gitlab.com/x86-psABIs/x86-64-ABI

--
H.J.

Florian Weimer

unread,
Feb 16, 2021, 11:11:43 AM2/16/21
to Lukas Diekmann, X86-64 System V Application Binary Interface
* Lukas Diekmann:
Can we align the wording with the i386 ABI? It has a similar
requirement, but more than two residue classes (modulo 4), so not all
wordings work there.

Thanks,
Florian
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill

Lukas Diekmann

unread,
Mar 4, 2021, 4:46:21 AM3/4/21
to X86-64 System V Application Binary Interface
The pull request for this is ready but unfortunately seems to have stalled: https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/19
Is there anything else I need to do to get this merged?

Kind regards,
Lukas
Reply all
Reply to author
Forward
0 new messages