This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: [PATCH] ld testsuite add test for noexecstack
- From: "Ceolin, Flavio" <flavio dot ceolin at intel dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Wed, 30 May 2018 22:34:14 +0000
- Subject: RE: [PATCH] ld testsuite add test for noexecstack
- References: <20180517203527.9778-1-flavio.ceolin@intel.com>
ping :)
________________________________________
From: Ceolin, Flavio
Sent: Thursday, May 17, 2018 13:35
To: binutils@sourceware.org
Cc: Ceolin, Flavio
Subject: [PATCH] ld testsuite add test for noexecstack
Add a test similar to "execstack" flag but for "noexecstack".
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
---
ld/ChangeLog | 5 +++++
ld/testsuite/ld-elf/elf.exp | 2 ++
ld/testsuite/ld-elf/stack-noexec.rd | 3 +++
3 files changed, 10 insertions(+)
create mode 100644 ld/testsuite/ld-elf/stack-noexec.rd
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 78c0d265e2..203d3871dd 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-16 Flavio Ceolin <flavio.ceolin@intel.com>
+
+ * testsuite/ld-elf/elf.exp Run new test.
+ * testsuite/ld-elf/stack-noexec.rd New file: Expected readelf output.
+
2018-05-15 Alan Modra <amodra@gmail.com>
* testsuite/ld-elf/notes.exp: Restore LDFLAGS.
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index b74b82ceab..b3223cf721 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -165,6 +165,8 @@ if { [istarget *-*-*linux*]
run_ld_link_tests {
{"stack exec" "-z execstack" "" "" {stack.s}
{{readelf {-Wl} stack-exec.rd}} "stack-exec.exe"}
+ {"stack noexec" "-z noexecstack" "" "" {stack.s}
+ {{readelf {-Wl} stack-noexec.rd}} "stack-noexec.exe"}
{"stack size" "-z stack-size=0x123400" "" "" {stack.s}
{{readelf {-Wl} stack-size.rd}} "stack-size.exe"}
}
diff --git a/ld/testsuite/ld-elf/stack-noexec.rd b/ld/testsuite/ld-elf/stack-noexec.rd
new file mode 100644
index 0000000000..96afb07d40
--- /dev/null
+++ b/ld/testsuite/ld-elf/stack-noexec.rd
@@ -0,0 +1,3 @@
+#...
+ GNU_STACK 0x0+00000 0x0+000000 0x0+000000 0x0+000 0x.+0000 RW 0x[0-9a-f]+
+#pass
--
2.14.3