Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Fix x86_64 Sys-V ABI section #29

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chorman0773
Copy link

Adjusts section 1.2 to match the System-V x86_64 psABI, as defined by https://uclibc.org/docs/psABI-x86_64.pdf.

Also removes references to rbp from the stack section, as most compiled code will not push the base pointer nowadays.

Adjusts section 1.2 to match the System-V x86_64 psABI, as defined by https://uclibc.org/docs/psABI-x86_64.pdf.
@chorman0773 chorman0773 changed the title Patch 1 Fix x86_64 Sys-V ABI section Sep 1, 2022
Copy link
Member

@lukflug lukflug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm in general
would need another person to verify factual accuracy


If the parameter is of type `float` or `double`, it will be stored in the next
available SSE register (`XMM0`-`XMM7`).

`long double` and structs/unions larger than 32-bytes are passed by the caller allocating space, and passing a pointer to that space in place as an integer parameter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing full stop

A function calling this needs to have at least 32 bytes of stack to store the
parameters and align the stack upon call.
parameters in `RDI`, `XMM0`, `RSI`, `RDX`, `RCX`, and `XMM1` respectively.
As no parameters are passed on the stack, the caller would also have to push 8 bytes before calling the function (which will align the stack by pushing an additional 8 bytes),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

full stop, instead of comma

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants