-
-
Notifications
You must be signed in to change notification settings - Fork 267
fiber/switch_context_riscv.S: disable executable stack #4968
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
base: master
Are you sure you want to change the base?
Conversation
Like it is done for the other assembly files, add the GNU-stack note. Signed-off-by: Andrei Horodniceanu <[email protected]>
I hope that this doesn't break anything, but I have no way of testing riscv |
cc @denizzzka |
I checked this PR on QEMU rv64, Ubuntu 24.10 - compiler and druntime was built and druntime tests passed |
Signed-off-by: Andrei Horodniceanu <[email protected]>
87e5683
to
0c5275f
Compare
@@ -6,6 +6,18 @@ | |||
* Authors: Denis Feklushkin | |||
*/ | |||
|
|||
#if (__linux__ || __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__) && __ELF__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the #if
needed? Seems better to include this section for all targets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the #if
here and in the other two files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the other files. This functionality is perhaps only available for ELF and GCC ld
(I read that lld
ignores this section and defaults to noexecstack
for all object files), so the #if ELF
may make sense in the other files that are used for broader range of targets including non-ELF ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if #if __ELF__
is enough. I've added it to all three files since they are all part of the build, regardless of target. The riscv-specificity comes from the code being in an #if defined(__riscv)
would it be possible to add a test for the noexecstack attribute of linked binaries produced by the compiler? (also thikning about betterC programs that do not link any library. Those should default to noexecstack too, with an arcane option to bail out) |
Signed-off-by: Andrei Horodniceanu <[email protected]>
381b50a
to
45ca78d
Compare
Like it is done for the other assembly files, add the GNU-stack note.