[test] Test that the exec-stack bit isn't set on libzstd.so
Tests that libzstd.so doesn't have the exec-stack bit set using readelf. If the stack is marked executable systemd will refuse to link against zstd. We now test that it isn't set on every PR. Adds a test for PR #2857 Fixes Issue #2865
This commit is contained in:
@@ -23,14 +23,19 @@ mustBeAbsent() {
|
||||
|
||||
# default compilation : all features enabled - no zbuff
|
||||
$ECHO "testing default library compilation"
|
||||
CFLAGS= make -C $DIR/../lib libzstd.a > $INTOVOID
|
||||
CFLAGS= make -C $DIR/../lib libzstd libzstd.a > $INTOVOID
|
||||
nm $DIR/../lib/libzstd.a | $GREP "\.o" > tmplog
|
||||
isPresent "zstd_compress.o"
|
||||
isPresent "zstd_decompress.o"
|
||||
isPresent "zdict.o"
|
||||
isPresent "zstd_v07.o"
|
||||
mustBeAbsent "zbuff_compress.o"
|
||||
$RM $DIR/../lib/libzstd.a tmplog
|
||||
$RM tmplog
|
||||
|
||||
# Check that the exec-stack bit isn't set
|
||||
readelf -lW $DIR/../lib/libzstd.so | $GREP "GNU_STACK" > tmplog
|
||||
mustBeAbsent "RWE"
|
||||
$RM $DIR/../lib/libzstd.a $DIR/../lib/libzstd.so* tmplog
|
||||
|
||||
# compression disabled => also disable zdict
|
||||
$ECHO "testing with compression disabled"
|
||||
Reference in New Issue
Block a user