mirror of
https://github.com/rui314/mold.git
synced 2024-10-05 00:57:08 +03:00
31 lines
513 B
Bash
Executable File
31 lines
513 B
Bash
Executable File
#!/bin/bash
|
|
export LANG=
|
|
set -e
|
|
CC="${CC:-cc}"
|
|
CXX="${CXX:-c++}"
|
|
testname=$(basename "$0" .sh)
|
|
echo -n "Testing $testname ... "
|
|
cd "$(dirname "$0")"/../..
|
|
mold="$(pwd)/mold"
|
|
t=out/test/elf/$testname
|
|
mkdir -p $t
|
|
|
|
echo 'ver_x { global: *; };' > $t/a.ver
|
|
|
|
cat <<EOF > $t/b.s
|
|
.globl foo, bar, baz
|
|
foo:
|
|
nop
|
|
bar:
|
|
nop
|
|
baz:
|
|
nop
|
|
EOF
|
|
|
|
$CC -B. -shared -o $t/c.so -Wl,-version-script,$t/a.ver $t/b.s
|
|
readelf --version-info $t/c.so > $t/log
|
|
|
|
fgrep -q 'Rev: 1 Flags: none Index: 2 Cnt: 1 Name: ver_x' $t/log
|
|
|
|
echo OK
|