1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-26 18:02:30 +03:00
mold/test/z_nodump.sh
Rui Ueyama 1bac9c7b8d Add -z nodump
This is needed by Gentoo's sci-libs/indilib-1.8.9 package.
2021-06-21 06:56:07 +09:00

19 lines
436 B
Bash
Executable File

#!/bin/bash
set -e
cd $(dirname $0)
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
cat <<EOF | clang -c -o $t/a.o -xc -
void foo() {}
EOF
clang -fuse-ld=`pwd`/../mold -shared -o $t/b.so $t/a.o
! readelf --dynamic $t/b.so | grep -Pq 'Flags: NODUMP' || false
clang -fuse-ld=`pwd`/../mold -shared -o $t/b.so $t/a.o -Wl,-z,nodump
readelf --dynamic $t/b.so | grep -Pq 'Flags: NODUMP'
echo OK