1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-11 16:58:12 +03:00
mold/test/version-script.sh
2021-03-07 15:41:45 +09:00

26 lines
451 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
echo 'ver_x { global: *; };' > $t/a.ver
cat <<EOF > $t/b.s
.globl foo, bar, baz
foo:
nop
bar:
nop
baz:
nop
EOF
clang -fuse-ld=`pwd`/../mold -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