Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align stack on 16-bytes boundary #58

Merged
merged 2 commits into from
May 8, 2024
Merged

Align stack on 16-bytes boundary #58

merged 2 commits into from
May 8, 2024

Conversation

kolerov
Copy link
Contributor

@kolerov kolerov commented May 6, 2024

The linker script for ARC-V aligns the stack on 4-bytes boundary and it leads to undefined behaviour while pushing argument to the stack.

It's necessary to align it on 16-bytes boundary since it's a maximum possible alignment for RISC-V targets according to RISC-V ABI.

@kolerov kolerov requested review from abrodkin and shahab-vahedi May 6, 2024 18:35
Copy link
Member

@shahab-vahedi shahab-vahedi left a comment

Choose a reason for hiding this comment

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

Looks good to me (with one small nitpick)

libgloss/riscv/arcv.ld Show resolved Hide resolved
kolerov added 2 commits May 8, 2024 12:08
The linker script for ARC-V aligns the stack on 4-bytes boundary
and it leads to undefined behaviour while pushing arguments to
the stack.

It's necessary to align it on 16-bytes boundary since it's a
maximum possible alignment for RISC-V targets according to
RISC-V ABI.

Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
@kolerov kolerov force-pushed the arcvx-fix-alignment branch from 7847132 to 3e9c834 Compare May 8, 2024 09:08
@kolerov
Copy link
Contributor Author

kolerov commented May 8, 2024

@shahab-vahedi I've also included a commit for fixing indentation in Makefile.in for ARC-V. It's necessary for clean regeneration of this file when adding new files.

@kolerov kolerov merged commit 2eb9cf0 into arcvx May 8, 2024
2 checks passed
@kolerov kolerov deleted the arcvx-fix-alignment branch May 8, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants