Files
Rui Ueyama 14a276ecde Set pipefail to test rigorously
We need to stop using `grep -q` because grep terminates immediately after
finding the first match with `-q`, causing SIGPIPE to the process on the
other side of the pipe.
2025-02-09 07:33:54 +09:00

16 lines
387 B
Bash
Executable File

#!/bin/bash
. $(dirname $0)/common.inc
cat <<EOF | $CC -c -xc -o $t/a.o -
int main() {}
EOF
$CC -B. -o $t/exe $t/a.o -Wl,-z,execstack
readelf --segments -W $t/exe | grep 'GNU_STACK.* RWE '
$CC -B. -o $t/exe $t/a.o -Wl,-z,execstack -Wl,-z,noexecstack
readelf --segments -W $t/exe | grep 'GNU_STACK.* RW '
$CC -B. -o $t/exe $t/a.o
readelf --segments -W $t/exe | grep 'GNU_STACK.* RW '