Add a test of the linker's "-z noexecstack" command line option.
authorFlavio Ceolin <flavio.ceolin@intel.com>
Tue, 5 Jun 2018 11:39:47 +0000 (12:39 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 5 Jun 2018 11:39:47 +0000 (12:39 +0100)
ld * testsuite/ld-elf/elf.exp Run new test.
* testsuite/ld-elf/stack-noexec.rd New file: Expected readelf output.

ld/ChangeLog
ld/testsuite/ld-elf/elf.exp
ld/testsuite/ld-elf/stack-noexec.rd [new file with mode: 0644]

index 70e30e65dfc86c8cca03a15e2c3b83667770d840..7d9b456d98319b3e8bc12263fb0123c2d203a52c 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-05  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-06-03  Sebastian Huber  <sebastian.huber@embedded-brains.de>
            Jim Wilson  <jimw@sifive.com>
 
index b74b82ceab5a7511f3497d3acf33823047a9e5bb..b3223cf7212ef0d9daf8262a53396e883381b99e 100644 (file)
@@ -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 (file)
index 0000000..96afb07
--- /dev/null
@@ -0,0 +1,3 @@
+#...
+  GNU_STACK      0x0+00000 0x0+000000 0x0+000000 0x0+000 0x.+0000 RW  0x[0-9a-f]+
+#pass