mirror of
https://github.com/rui314/mold.git
synced 2026-10-29 17:16:16 +08:00
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.
16 lines
387 B
Bash
Executable File
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 '
|