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

Assert non-executable stack for assembly files #2080

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

albinahlback
Copy link
Collaborator

Some GNU linkers do not set the stack as non-executable when the .note.GNU-stack section is missing.

Solves #2075. @mezzarobba

@albinahlback
Copy link
Collaborator Author

Clang yields warnings for this, and also for other things when compiling assembly files. Will fix this before merging this.

@mezzarobba
Copy link
Contributor

I still get the warnings:

/usr/bin/ld: warning: build/mpn_extras/x86_64/broadwell/sqrhigh_normalised_hard.lo: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
Building libflint.so.20.0.0
/usr/bin/ld: warning: build/mpn_extras_merged.lo: requires executable stack (because the .note.GNU-stack section is executable)
~/co/flint:noexecstack$

@albinahlback
Copy link
Collaborator Author

Hmm, I'll look into it. Thanks for taking the time.

Some GNU linkers do not set the stack as non-executable when the
`.note.GNU-stack` section is missing. Herein, we fix this.

Also remove some warnings when compiling assembly on Clang by removing
unneccessary/unused compiler options.

Also remove some warnings in source code.
@albinahlback
Copy link
Collaborator Author

This change yields different binaries compared to earlier for both GCC and Clang, which I suppose implies a now non-executable stack. This should work, and is what GMP does.

@albinahlback albinahlback merged commit ac70d4d into flintlib:main Oct 4, 2024
13 checks passed
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.

2 participants