mirror of
https://github.com/rui314/mold.git
synced 2026-10-28 16:45:11 +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.
24 lines
476 B
Bash
Executable File
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
|
|
|