Files
mold/test/version-script18.sh
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

24 lines
476 B
Bash
Executable File

#!/bin/bash
. $(dirname $0)/common.inc
# Test version script precedence.
cat <<'EOF' > $t/a.ver
{ global: extern "C++" { *libalpha::*; }; local: *libbeta*; };
EOF
cat <<EOF | $CC -fPIC -c -o $t/b.o -xc++ -
namespace libbeta {
struct Bar;
}
namespace libalpha {
template <typename T>
void foo() {}
template void foo<libbeta::Bar>();
}
EOF
$CC -B. -shared -Wl,--version-script=$t/a.ver -o $t/c.so $t/b.o
readelf --wide --dyn-syms $t/c.so | grep libalpha | grep Bar