From: Flavio Ceolin Date: Tue, 5 Jun 2018 11:39:47 +0000 (+0100) Subject: Add a test of the linker's "-z noexecstack" command line option. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=112ba8675ec7756ef8065feb655df2d4f39ee731;p=binutils-gdb.git Add a test of the linker's "-z noexecstack" command line option. ld * testsuite/ld-elf/elf.exp Run new test. * testsuite/ld-elf/stack-noexec.rd New file: Expected readelf output. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 70e30e65dfc..7d9b456d983 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2018-06-05 Flavio Ceolin + + * testsuite/ld-elf/elf.exp Run new test. + * testsuite/ld-elf/stack-noexec.rd New file: Expected readelf output. + 2018-06-03 Sebastian Huber Jim Wilson diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp index b74b82ceab5..b3223cf7212 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 00000000000..96afb07d404 --- /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