Skip to content

Commit 45ca78d

Browse files
committed
[druntime]: Simplify .note.GNU-stack condition in assembly files
Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
1 parent 0c5275f commit 45ca78d

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

runtime/druntime/src/core/thread/fiber/switch_context_asm.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* http://www.boost.org/LICENSE_1_0.txt)
1414
*/
1515

16-
#if (__linux__ || __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__) && __ELF__
16+
#if __ELF__
1717
/*
1818
* Mark the resulting object file as not requiring execution permissions on
1919
* stack memory. The absence of this section would mark the whole resulting

runtime/druntime/src/core/thread/fiber/switch_context_riscv.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Authors: Denis Feklushkin
77
*/
88

9-
#if (__linux__ || __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__) && __ELF__
9+
#if __ELF__
1010
/*
1111
* Mark the resulting object file as not requiring execution permissions on
1212
* stack memory. The absence of this section would mark the whole resulting

runtime/druntime/src/ldc/eh_asm.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
77
*/
88

9+
#if __ELF__
910
/*
1011
* Mark the resulting object file as not requiring execution
1112
* permissions on stack memory. The absence of this section would mark
1213
* the whole resulting library as requiring an executable stack,
1314
* making it impossible to dynamically load druntime on several
1415
* platforms where this is forbidden due to security policies.
1516
*/
16-
17-
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__)
1817
.section .note.GNU-stack,"",%progbits
1918
.previous
2019
#endif

0 commit comments

Comments
 (0)