summaryrefslogtreecommitdiff
blob: a3face06f35cb19ad4a564ba07eb795fafacc54c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
--- a/src/effect/2xsaimmx.asm
+++ b/src/effect/2xsaimmx.asm
@@ -2107,3 +2107,7 @@
 final1b       resb 8
 final2a       resb 8
 final2b       resb 8
+
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
--- a/src/effect/effect_i386.asm
+++ b/src/effect/effect_i386.asm
@@ -88,3 +88,7 @@
 	emms
 	
 	endproc
+
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
--- a/src/effect/hq2x16.asm
+++ b/src/effect/hq2x16.asm
@@ -1935,3 +1935,7 @@
     dd ..@cross8, ..@flag0,  ..@flag0,  ..@flag0,
     dd ..@flag0,  ..@flag0,  ..@flag0,  ..@flag0
 
+
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
--- a/src/effect/hq3x16.asm
+++ b/src/effect/hq3x16.asm
@@ -2520,3 +2520,7 @@
     dd ..@cross8, ..@flag0,  ..@flag0,  ..@flag0,
     dd ..@flag0,  ..@flag0,  ..@flag0,  ..@flag0
 
+
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
--- a/src/memcpy.S
+++ b/src/memcpy.S
@@ -495,4 +495,8 @@
 
 Lmemcpy_bsrcul1l4:
 add r1, r1, #1
-b Lmemcpy_bl4
\ No newline at end of file
+b Lmemcpy_bl4
+
+#ifdef __ELF__
+.section .note.GNU-stack,"",@progbits
+#endif
--- a/src/raze/Makefile.am
+++ b/src/raze/Makefile.am
@@ -20,7 +20,7 @@
 	$(srcdir)/strip_ $< $@
 
 raze2.asm: raze.asmu raze.incu raze.regu
-	nasm -w+orphan-labels -I $(srcdir)/ -e $< -o $@
+	nasm -w+orphan-labels -f elf -I $(srcdir)/ -e $< -o $@
 
 # This assembles the file, once it's been pre-processed
 raze.o: raze2.asm
--- a/src/raze/raze.asm
+++ b/src/raze/raze.asm
@@ -4259,3 +4259,6 @@
 
 ;- the end ------------------------------------------------------------------;
 
+%ifidn ___OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
--- a/src/screen_i386.asm
+++ b/src/screen_i386.asm
@@ -96,3 +96,6 @@
 	endproc
 
 
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
--- a/src/star/star.c
+++ b/src/star/star.c
@@ -2431,6 +2431,10 @@
 */
 static void suffixes(void) {
 	emit("end\n");
+
+	emit("%%ifidn ___OUTPUT_FORMAT__,elf\n");
+	emit("section .note.GNU-stack noalloc noexec nowrite progbits\n");
+	emit("%%endif\n");
 }
 
 /****************************************************************************
--- a/src/video_i386.asm
+++ b/src/video_i386.asm
@@ -86,3 +86,7 @@
 	
 	popa
 	endproc
+
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif