1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-04 16:48:04 +03:00
mold/test/elf/linker-script4.sh

28 lines
492 B
Bash
Raw Normal View History

#!/bin/bash
export LANG=
set -e
cd $(dirname $0)
2021-09-08 13:11:48 +03:00
mold=`pwd`/../../mold
echo -n "Testing $(basename -s .sh $0) ... "
2021-10-12 12:32:20 +03:00
t=$(pwd)/../../out/test/elf/$(basename -s .sh $0)
mkdir -p $t
echo 'VERSION { ver_x { global: *; }; };' > $t/a.script
cat <<EOF > $t/b.s
.globl foo, bar, baz
foo:
nop
bar:
nop
baz:
nop
EOF
clang -fuse-ld=$mold -shared -o $t/c.so $t/a.script $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