Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions runtime/druntime/src/core/thread/fiber/switch_context_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
* http://www.boost.org/LICENSE_1_0.txt)
*/

#if (__linux__ || __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__) && __ELF__
#if __ELF__
/*
* Mark the resulting object file as not requiring execution permissions on
* stack memory. The absence of this section would mark the whole resulting
* library as requiring an executable stack, making it impossible to
* dynamically load druntime on several Linux platforms where this is
* forbidden due to security policies.
* dynamically load druntime on several platforms where this is forbidden
* due to security policies.
*/
.section .note.GNU-stack,"",%progbits
#endif
Expand Down
12 changes: 12 additions & 0 deletions runtime/druntime/src/core/thread/fiber/switch_context_riscv.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
* Authors: Denis Feklushkin
*/

#if __ELF__
/*
* Mark the resulting object file as not requiring execution permissions on
* stack memory. The absence of this section would mark the whole resulting
* library as requiring an executable stack, making it impossible to
* dynamically load druntime on several platforms where this is forbidden
* due to security policies.
*/
.section .note.GNU-stack,"",%progbits
#endif


#if defined(__riscv)

// For save/load a register in memory, regardless of the size of machine register bit size
Expand Down
5 changes: 2 additions & 3 deletions runtime/druntime/src/ldc/eh_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
*/

#if __ELF__
/*
* Mark the resulting object file as not requiring execution
* permissions on stack memory. The absence of this section would mark
* the whole resulting library as requiring an executable stack,
* making it impossible to dynamically load druntime on several Linux
* making it impossible to dynamically load druntime on several
* platforms where this is forbidden due to security policies.
*/

#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
.previous
#endif
Expand Down
Loading