You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(7) |
2
(5) |
3
(2) |
4
(8) |
5
(10) |
|
6
(3) |
7
(9) |
8
(7) |
9
(8) |
10
(7) |
11
(4) |
12
(11) |
|
13
(5) |
14
(17) |
15
(6) |
16
(15) |
17
|
18
(3) |
19
(1) |
|
20
(6) |
21
(18) |
22
(5) |
23
(9) |
24
(6) |
25
(3) |
26
(1) |
|
27
(1) |
28
|
29
(8) |
30
(5) |
|
|
|
|
From: <sv...@va...> - 2015-09-30 20:58:42
|
Author: florian
Date: Wed Sep 30 21:58:36 2015
New Revision: 15694
Log:
Beef up the check_headers_and_includes script to make sure
every assembler file instantiates MARK_STACK_NO_EXEC unconditionally.
Modified:
trunk/tests/check_headers_and_includes
Modified: trunk/tests/check_headers_and_includes
==============================================================================
--- trunk/tests/check_headers_and_includes (original)
+++ trunk/tests/check_headers_and_includes Wed Sep 30 21:58:36 2015
@@ -14,6 +14,10 @@
# (7) include/*.h and tool *.[ch] must not use vg_assert
# (8) coregrind/ *.[ch] must not use VG_(tool_panic)
# (9) include/*.h and tool *.[ch] must not use VG_(core_panic)
+# (10) *.S must unconditionally instantiate MARK_STACK_NO_EXEC
+#
+# There can be false positives as we don't really parse the source files.
+# Instead we only match regular expressions.
#-------------------------------------------------------------------
use strict;
@@ -144,8 +148,8 @@
next;
}
-# Regular files; only interested in *.c and *.h
- next if (! ($file =~ /\.[ch]$/));
+# Regular files; only interested in *.c, *.S and *.h
+ next if (! ($file =~ /\.[cSh]$/));
my $path_name = defined $path ? "$path/$file" : $file;
process_file($path_name);
}
@@ -306,6 +310,36 @@
}
}
+#---------------------------------------------------------------------
+# Check an assembler file
+#---------------------------------------------------------------------
+sub check_assembler_file {
+ my ($path_name) = @_;
+ my $file = basename($path_name);
+ my $found = 0;
+
+ open(FILE, "<$file") || die "Cannot open file '$file'";
+
+ while (my $line = <FILE>) {
+ if ($line =~ /^\s*MARK_STACK_NO_EXEC/) {
+ $found = 1;
+ last;
+ }
+ }
+ if ($found == 0) {
+ error("File $path_name does not instantiate MARK_STACK_NO_EXEC\n");
+ } else {
+ while (my $line = <FILE>) {
+ if ($line =~ /^\s*#\s*endif/) {
+ error("File $path_name instantiates MARK_STACK_NO_EXEC"
+ . " under a condition\n");
+ last;
+ }
+ }
+ }
+ close FILE;
+}
+
sub process_file {
my ($path_name) = @_;
@@ -318,6 +352,10 @@
} elsif (is_tool_file($path_name)) {
check_tool_file($path_name);
}
+
+ if ($path_name =~ /\.S$/) {
+ check_assembler_file($path_name);
+ }
}
sub error {
|
|
From: <sv...@va...> - 2015-09-30 20:34:40
|
Author: florian
Date: Wed Sep 30 21:34:32 2015
New Revision: 15693
Log:
Remove an unneeded header file. Spotted by Matthias Schwarzott.
Modified:
trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S
Modified: trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S Wed Sep 30 21:34:32 2015
@@ -32,7 +32,6 @@
#if defined(VGP_ppc32_linux)
-#include "config.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_ppc32_CIA */
|
|
From: Florian K. <fl...@ei...> - 2015-09-30 20:32:36
|
On 30.09.2015 19:58, Matthias Schwarzott wrote: > >> What I did not quite understand why (sometimes) you moved code outside >> the #ifdef that guards the complete contents of a file. For instance: >> .... snip ..... >> >> I don't see a need for that or did you encounter some sort of problem? >> > The reason can be explained considering linker behaviour. > The linker will request an executable stack as soon as at least one > object file, that is linked in, wants an executable stack. > And the absence of the above mentioned .note.GNU-stack section is enough > to tell the linker that an executable stack is needed. > > So even an empty asm-file must at least contain this statement to not > force executable stacks on the whole executable. Thanks for explaining. I did not know that. Patch applied as r15692 Florian |
|
From: <sv...@va...> - 2015-09-30 20:30:59
|
Author: florian
Date: Wed Sep 30 21:30:48 2015
New Revision: 15692
Log:
Make sure no executable stack gets created.
Explanation by Matthias Schwarzott:
The linker will request an executable stack as soon as at least one
object file, that is linked in, wants an executable stack.
And the absence of the
.section .note.GNU-stack."",@progbits
is enough to tell the linker that an executable stack is needed.
So even an empty asm-file must at least contain this statement to not
force executable stacks on the whole executable.
* Define a helper macro MARK_STACK_NO_EXEC that disables the
executable stack.
* Instantiate this macro unconditionally at the end of each asm file.
Patch by Matthias Schwarzott <zz...@ge...>.
Modified:
trunk/coregrind/m_cpuid.S
trunk/coregrind/m_dispatch/dispatch-amd64-darwin.S
trunk/coregrind/m_dispatch/dispatch-amd64-linux.S
trunk/coregrind/m_dispatch/dispatch-amd64-solaris.S
trunk/coregrind/m_dispatch/dispatch-arm-linux.S
trunk/coregrind/m_dispatch/dispatch-arm64-linux.S
trunk/coregrind/m_dispatch/dispatch-mips32-linux.S
trunk/coregrind/m_dispatch/dispatch-mips64-linux.S
trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S
trunk/coregrind/m_dispatch/dispatch-ppc64be-linux.S
trunk/coregrind/m_dispatch/dispatch-ppc64le-linux.S
trunk/coregrind/m_dispatch/dispatch-s390x-linux.S
trunk/coregrind/m_dispatch/dispatch-tilegx-linux.S
trunk/coregrind/m_dispatch/dispatch-x86-darwin.S
trunk/coregrind/m_dispatch/dispatch-x86-linux.S
trunk/coregrind/m_dispatch/dispatch-x86-solaris.S
trunk/coregrind/m_mach/mach_traps-amd64-darwin.S
trunk/coregrind/m_mach/mach_traps-x86-darwin.S
trunk/coregrind/m_syswrap/syscall-amd64-darwin.S
trunk/coregrind/m_syswrap/syscall-amd64-linux.S
trunk/coregrind/m_syswrap/syscall-amd64-solaris.S
trunk/coregrind/m_syswrap/syscall-arm-linux.S
trunk/coregrind/m_syswrap/syscall-arm64-linux.S
trunk/coregrind/m_syswrap/syscall-mips32-linux.S
trunk/coregrind/m_syswrap/syscall-mips64-linux.S
trunk/coregrind/m_syswrap/syscall-ppc32-linux.S
trunk/coregrind/m_syswrap/syscall-ppc64be-linux.S
trunk/coregrind/m_syswrap/syscall-ppc64le-linux.S
trunk/coregrind/m_syswrap/syscall-s390x-linux.S
trunk/coregrind/m_syswrap/syscall-tilegx-linux.S
trunk/coregrind/m_syswrap/syscall-x86-darwin.S
trunk/coregrind/m_syswrap/syscall-x86-linux.S
trunk/coregrind/m_syswrap/syscall-x86-solaris.S
trunk/coregrind/m_trampoline.S
trunk/include/pub_tool_basics_asm.h
Modified: trunk/coregrind/m_cpuid.S
==============================================================================
--- trunk/coregrind/m_cpuid.S (original)
+++ trunk/coregrind/m_cpuid.S Wed Sep 30 21:30:48 2015
@@ -151,10 +151,8 @@
ret
#endif
-#if defined(VGP_x86_linux) || defined(VGP_amd64_linux)
/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-#endif
+MARK_STACK_NO_EXEC
/*--------------------------------------------------------------------*/
/*--- end ---*/
Modified: trunk/coregrind/m_dispatch/dispatch-amd64-darwin.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-amd64-darwin.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-amd64-darwin.S Wed Sep 30 21:30:48 2015
@@ -29,9 +29,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_amd64_darwin)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_amd64_RIP */
@@ -250,6 +251,9 @@
#endif // defined(VGP_amd64_darwin)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-amd64-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-amd64-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-amd64-linux.S Wed Sep 30 21:30:48 2015
@@ -29,9 +29,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_amd64_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_amd64_RIP */
@@ -249,11 +250,11 @@
.size VG_(disp_run_translations), .-VG_(disp_run_translations)
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
#endif // defined(VGP_amd64_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-amd64-solaris.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-amd64-solaris.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-amd64-solaris.S Wed Sep 30 21:30:48 2015
@@ -29,9 +29,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_amd64_solaris)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_amd64_RIP */
@@ -251,6 +252,9 @@
#endif // defined(VGP_amd64_solaris)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-arm-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-arm-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-arm-linux.S Wed Sep 30 21:30:48 2015
@@ -29,10 +29,11 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_arm_linux)
.fpu vfp
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_arm_R* */
@@ -206,11 +207,11 @@
.size VG_(disp_run_translations), .-VG_(disp_run_translations)
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",%progbits
-
#endif // defined(VGP_arm_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end dispatch-arm-linux.S ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-arm64-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-arm64-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-arm64-linux.S Wed Sep 30 21:30:48 2015
@@ -29,9 +29,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_arm64_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_arm_R* */
@@ -231,11 +232,11 @@
.size VG_(disp_run_translations), .-VG_(disp_run_translations)
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",%progbits
-
#endif // defined(VGP_arm64_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end dispatch-arm64-linux.S ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-mips32-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-mips32-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-mips32-linux.S Wed Sep 30 21:30:48 2015
@@ -29,10 +29,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
#if defined(VGP_mips32_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_mips_PC */
@@ -235,11 +235,11 @@
.size VG_(disp_run_translations), .-VG_(disp_run_translations)
+#endif // defined(VGP_mips32_linux)
-/* Let the linker know we do not need an executable stack */
-.section .note.GNU-stack,"",@progbits
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
-#endif // defined(VGP_mips32_linux)
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-mips64-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-mips64-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-mips64-linux.S Wed Sep 30 21:30:48 2015
@@ -29,10 +29,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
#if defined(VGP_mips64_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_mips_PC */
@@ -235,11 +235,11 @@
.size VG_(disp_run_translations), .-VG_(disp_run_translations)
+#endif // defined(VGP_mips64_linux)
-/* Let the linker know we do not need an executable stack */
-.section .note.GNU-stack,"",@progbits
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
-#endif // defined(VGP_mips64_linux)
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S Wed Sep 30 21:30:48 2015
@@ -28,10 +28,11 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_ppc32_linux)
#include "config.h"
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_ppc32_CIA */
@@ -495,11 +496,11 @@
.size VG_(disp_run_translations), .-VG_(disp_run_translations)
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
#endif // defined(VGP_ppc32_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-ppc64be-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-ppc64be-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-ppc64be-linux.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_ppc64be_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_ppc64_CIA */
@@ -527,11 +528,11 @@
.size .VG_(disp_run_translations), .-.VG_(disp_run_translations)
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
#endif // defined(VGP_ppc64be_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-ppc64le-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-ppc64le-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-ppc64le-linux.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_ppc64le_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_ppc64_CIA */
@@ -620,11 +621,11 @@
.size .VG_(disp_run_translations), .-.VG_(disp_run_translations)
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
#endif // defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-s390x-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-s390x-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-s390x-linux.S Wed Sep 30 21:30:48 2015
@@ -267,11 +267,11 @@
.size VG_(disp_run_translations), .-VG_(disp_run_translations)
-/* Let the linker know we don't need an executable stack */
- .section .note.GNU-stack,"",@progbits
-
#endif /* VGA_s390x */
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end dispatch-s390x-linux.S ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-tilegx-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-tilegx-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-tilegx-linux.S Wed Sep 30 21:30:48 2015
@@ -29,8 +29,9 @@
/* Contributed by Zhi-Gang Liu <zliu at tilera dot com> */
-#if defined(VGP_tilegx_linux)
#include "pub_core_basics_asm.h"
+
+#if defined(VGP_tilegx_linux)
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_tilegx_PC */
@@ -297,11 +298,11 @@
.size VG_(disp_run_translations), .-VG_(disp_run_translations)
+#endif /* defined(VGP_tilegx_linux) */
- /* Let the linker know we do not need an executable stack */
- .section .note.GNU-stack,"",@progbits
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
-#endif /* defined(VGP_tilegx_linux) */
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-x86-darwin.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-x86-darwin.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-x86-darwin.S Wed Sep 30 21:30:48 2015
@@ -29,9 +29,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_x86_darwin)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_x86_EIP */
@@ -239,6 +240,9 @@
#endif // defined(VGP_x86_darwin)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-x86-linux.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-x86-linux.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-x86-linux.S Wed Sep 30 21:30:48 2015
@@ -29,9 +29,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_x86_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_x86_EIP */
@@ -240,11 +241,11 @@
.size VG_(disp_run_translations), .-VG_(disp_run_translations)
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
#endif // defined(VGP_x86_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-x86-solaris.S
==============================================================================
--- trunk/coregrind/m_dispatch/dispatch-x86-solaris.S (original)
+++ trunk/coregrind/m_dispatch/dispatch-x86-solaris.S Wed Sep 30 21:30:48 2015
@@ -29,9 +29,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_x86_solaris)
-#include "pub_core_basics_asm.h"
#include "pub_core_dispatch_asm.h"
#include "pub_core_transtab_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_x86_EIP */
@@ -242,6 +243,9 @@
#endif // defined(VGP_x86_solaris)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_mach/mach_traps-amd64-darwin.S
==============================================================================
--- trunk/coregrind/m_mach/mach_traps-amd64-darwin.S (original)
+++ trunk/coregrind/m_mach/mach_traps-amd64-darwin.S Wed Sep 30 21:30:48 2015
@@ -27,6 +27,8 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_amd64_darwin)
#include "vki/vki-scnums-darwin.h"
@@ -134,6 +136,9 @@
#endif // defined(VGP_amd64_darwin)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_mach/mach_traps-x86-darwin.S
==============================================================================
--- trunk/coregrind/m_mach/mach_traps-x86-darwin.S (original)
+++ trunk/coregrind/m_mach/mach_traps-x86-darwin.S Wed Sep 30 21:30:48 2015
@@ -27,6 +27,8 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_x86_darwin)
// DDD: should use __NR_ constants in here instead of the trap numbers
@@ -124,6 +126,9 @@
#endif // defined(VGP_x86_darwin)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-amd64-darwin.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-amd64-darwin.S (original)
+++ trunk/coregrind/m_syswrap/syscall-amd64-darwin.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_amd64_darwin)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -251,6 +252,9 @@
#endif // defined(VGP_amd64_darwin)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-amd64-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-amd64-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-amd64-linux.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_amd64_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -244,11 +245,11 @@
ML_(blksys_finished): .quad 5b
.previous
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
#endif // defined(VGP_amd64_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-amd64-solaris.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-amd64-solaris.S (original)
+++ trunk/coregrind/m_syswrap/syscall-amd64-solaris.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_amd64_solaris)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -273,6 +274,9 @@
#endif // defined(VGP_amd64_solaris)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-arm-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-arm-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-arm-linux.S Wed Sep 30 21:30:48 2015
@@ -27,9 +27,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_arm_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -141,12 +142,10 @@
ML_(blksys_committed): .long 4b
ML_(blksys_finished): .long 5b
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",%progbits
-
-.previous
-
#endif // defined(VGP_arm_linux)
+
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
/*--------------------------------------------------------------------*/
/*--- end ---*/
Modified: trunk/coregrind/m_syswrap/syscall-arm64-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-arm64-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-arm64-linux.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_arm64_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -169,12 +170,10 @@
ML_(blksys_committed): .quad 4b
ML_(blksys_finished): .quad 5b
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",%progbits
-
-.previous
-
#endif // defined(VGP_arm_linux)
+
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
/*--------------------------------------------------------------------*/
/*--- end ---*/
Modified: trunk/coregrind/m_syswrap/syscall-mips32-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-mips32-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-mips32-linux.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_mips32_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -202,14 +203,12 @@
ML_(blksys_complete): .long 3b
ML_(blksys_committed): .long 4b
ML_(blksys_finished): .long 5b
-.previous
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",%progbits
+#endif // defined(VGP_mips32_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
-#endif // defined(VGP_mips32_linux)
-
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-mips64-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-mips64-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-mips64-linux.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_mips64_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -144,12 +145,12 @@
ML_(blksys_complete): .quad 3b
ML_(blksys_committed): .quad 4b
ML_(blksys_finished): .quad 5b
-.previous
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",%progbits
#endif // defined(VGP_mips64_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-ppc32-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-ppc32-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-ppc32-linux.S Wed Sep 30 21:30:48 2015
@@ -27,9 +27,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_ppc32_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -153,13 +154,11 @@
ML_(blksys_committed): .long 4b
ML_(blksys_finished): .long 5b
-.previous
-
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
#endif // defined(VGP_ppc32_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-ppc64be-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-ppc64be-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-ppc64be-linux.S Wed Sep 30 21:30:48 2015
@@ -27,9 +27,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_ppc64be_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -161,11 +162,10 @@
ML_(blksys_committed): .quad 4b
ML_(blksys_finished): .quad 5b
+#endif // defined(VGP_ppc64be_linux)
/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
-#endif // defined(VGP_ppc64be_linux)
+MARK_STACK_NO_EXEC
/*--------------------------------------------------------------------*/
/*--- end ---*/
Modified: trunk/coregrind/m_syswrap/syscall-ppc64le-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-ppc64le-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-ppc64le-linux.S Wed Sep 30 21:30:48 2015
@@ -27,9 +27,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_ppc64le_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -178,11 +179,10 @@
ML_(blksys_committed): .quad 4b
ML_(blksys_finished): .quad 5b
+#endif // defined(VGP_ppc64le_linux)
/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
-#endif // defined(VGP_ppc64le_linux)
+MARK_STACK_NO_EXEC
/*--------------------------------------------------------------------*/
/*--- end ---*/
Modified: trunk/coregrind/m_syswrap/syscall-s390x-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-s390x-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-s390x-linux.S Wed Sep 30 21:30:48 2015
@@ -162,11 +162,11 @@
ML_(blksys_finished): .quad 5b
.previous
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
#endif /* VGA_s390x */
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-tilegx-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-tilegx-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-tilegx-linux.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
/* Contributed by Zhi-Gang Liu <zliu at tilera dot com> */
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_tilegx_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -180,11 +181,12 @@
ML_(blksys_committed): .quad 4b
ML_(blksys_finished): .quad 5b
.previous
- /* Let the linker know we don't need an executable stack */
- .section .note.GNU-stack,"",%progbits
#endif /* defined(VGP_tilegx_linux) */
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-x86-darwin.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-x86-darwin.S (original)
+++ trunk/coregrind/m_syswrap/syscall-x86-darwin.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_x86_darwin)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -248,7 +249,10 @@
ML_(blksys_finished_UNIX): .long MK_L_SCCLASS_N(UNIX,5)
#endif // defined(VGP_x86_darwin)
-
+
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-x86-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-x86-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-x86-linux.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_x86_linux)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -183,12 +184,12 @@
ML_(blksys_committed): .long 4b
ML_(blksys_finished): .long 5b
.previous
-
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
#endif // defined(VGP_x86_linux)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syscall-x86-solaris.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-x86-solaris.S (original)
+++ trunk/coregrind/m_syswrap/syscall-x86-solaris.S Wed Sep 30 21:30:48 2015
@@ -28,9 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "pub_core_basics_asm.h"
+
#if defined(VGP_x86_solaris)
-#include "pub_core_basics_asm.h"
#include "pub_core_vkiscnums_asm.h"
#include "libvex_guest_offsets.h"
@@ -270,6 +271,9 @@
#endif // defined(VGP_x86_solaris)
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_trampoline.S
==============================================================================
--- trunk/coregrind/m_trampoline.S (original)
+++ trunk/coregrind/m_trampoline.S Wed Sep 30 21:30:48 2015
@@ -1599,14 +1599,8 @@
#endif
#endif
-#if defined(VGO_linux)
/* Let the linker know we don't need an executable stack */
-# if defined(VGP_arm_linux)
- .section .note.GNU-stack,"",%progbits
-# else
- .section .note.GNU-stack,"",@progbits
-# endif
-#endif
+MARK_STACK_NO_EXEC
/*--------------------------------------------------------------------*/
/*--- end ---*/
Modified: trunk/include/pub_tool_basics_asm.h
==============================================================================
--- trunk/include/pub_tool_basics_asm.h (original)
+++ trunk/include/pub_tool_basics_asm.h Wed Sep 30 21:30:48 2015
@@ -58,6 +58,20 @@
# error Unknown OS
#endif
+/* Let the linker know we don't need an executable stack.
+ The call to MARK_STACK_NO_EXEC should be put unconditionally
+ at the end of all asm source files.
+*/
+#if defined(VGO_linux)
+# if defined(VGA_arm)
+# define MARK_STACK_NO_EXEC .section .note.GNU-stack,"",%progbits
+# else
+# define MARK_STACK_NO_EXEC .section .note.GNU-stack,"",@progbits
+# endif
+#else
+# define MARK_STACK_NO_EXEC
+#endif
+
#endif /* __PUB_TOOL_BASICS_ASM_H */
/*--------------------------------------------------------------------*/
|
|
From: Matthias S. <zz...@ge...> - 2015-09-30 17:59:19
|
Am 29.09.2015 um 22:30 schrieb Florian Krohm: > On 27.09.2015 21:19, Matthias Schwarzott wrote: >> Hi there! >> >> This patch will fix all assembler files that do not declare their stack >> as non-executable. >> >> All assembler files that do not contain this code tells the linker to >> mark the stack executable: >> >> .section .note.GNU-stack,"",@progbits >> OR >> .section .note.GNU-stack,"",%progbits >> >> My patch creates a macro that contains either version or nothing if the >> platform does not require it. >> >> Then all asm-files are changed to unconditionally call this macro at the >> end of file. >> > > It's nice to clean this up. Thanks! > >> Additionally it removes an unneeded inclusion of "config.h" from >> "dispatch-ppc32-linux.S". > > No. dispatch-ppc32-linux.S has an #ifdef HAS_ALTIVEC and that symbol is > being defined in config.h . > pub_core_basics_asm.h already includes config.h so I thought this second inclusion is not necessary. But as this is not the intention to clean up includes I dropped this part. > >> >> The only thing I am not sure about is: On which platforms to use >> @progbits or %progbits. > > m_trampoline.S has this: > > #if defined(VGO_linux) > /* Let the linker know we don't need an executable stack */ > # if defined(VGP_arm_linux) > .section .note.GNU-stack,"",%progbits > # else > .section .note.GNU-stack,"",@progbits > # endif > #endif > > That code is shared for all platforms. A web search provides further > evidence that on ARM the @ character introduces a comment in assembler > code. On other platforms, the choice of @progbits or %progbits > apparently does not matter. At least on mips a grep shows: > > ./coregrind/m_syswrap/syscall-mips64-linux.S:.section > .note.GNU-stack,"",%progbits > ./coregrind/m_dispatch/dispatch-mips64-linux.S:.section > .note.GNU-stack,"",@progbits > > So let's run with the above ifdeffery. > Yes, I also found this code, but was wondering about some mips and tilegx asm files using %progbits. As you say m_trampoline.S is compiled everywhere I use the logic from there. > What I did not quite understand why (sometimes) you moved code outside > the #ifdef that guards the complete contents of a file. For instance: > > --- a/coregrind/m_syswrap/syscall-x86-solaris.S > +++ b/coregrind/m_syswrap/syscall-x86-solaris.S > @@ -28,9 +28,10 @@ > The GNU General Public License is contained in the file COPYING. > */ > > +#include "pub_core_basics_asm.h" > + > #if defined(VGP_x86_solaris) > > -#include "pub_core_basics_asm.h" > #include "pub_core_vkiscnums_asm.h" > #include "libvex_guest_offsets.h" > > @@ -270,6 +271,9 @@ ML_(blksys_finished_DRET): .long 4b > > #endif // defined(VGP_x86_solaris) > > +/* Let the linker know we don't need an executable stack */ > +MARK_STACK_NO_EXEC > + > > I don't see a need for that or did you encounter some sort of problem? > The reason can be explained considering linker behaviour. The linker will request an executable stack as soon as at least one object file, that is linked in, wants an executable stack. And the absence of the above mentioned .note.GNU-stack section is enough to tell the linker that an executable stack is needed. So even an empty asm-file must at least contain this statement to not force executable stacks on the whole executable. To use the macro, also the "#include" must be unconditional. An updated patch is attached. Regards Matthias |