Skip to content

Commit 7c32e61

Browse files
authored
Merge pull request #683 from ksco/tls
2 parents 96524e4 + a0dc74b commit 7c32e61

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

test/elf/tls-gd2.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ t=out/test/elf/$MACHINE/$testname
1313
mkdir -p $t
1414

1515
if [ $MACHINE = x86_64 ]; then
16-
dialect=gnu
16+
mtls=-mtls-dialect=gnu
1717
elif [ $MACHINE = aarch64 ]; then
18-
dialect=trad
19-
else
18+
mtls=-mtls-dialect=trad
19+
elif [ $MACHINE '!=' riscv64 -a $MACHINE '!=' riscv32 ]; then
2020
echo skipped
2121
exit
2222
fi
2323

2424
echo '{ global: bar; local: *; };' > $t/a.ver
2525

26-
cat <<EOF | $GCC -mtls-dialect=$dialect -fPIC -c -o $t/b.o -xc -
26+
cat <<EOF | $GCC $mtls -fPIC -c -o $t/b.o -xc -
2727
_Thread_local int foo;
2828
2929
int bar() {

test/elf/tls-ie.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ t=out/test/elf/$MACHINE/$testname
1313
mkdir -p $t
1414

1515
if [ $MACHINE = x86_64 ]; then
16-
dialect=gnu
16+
mtls=-mtls-dialect=gnu
1717
elif [ $MACHINE = aarch64 ]; then
18-
dialect=trad
19-
else
18+
mtls=-mtls-dialect=trad
19+
elif [ $MACHINE '!=' riscv64 -a $MACHINE '!=' riscv32 ]; then
2020
echo skipped
2121
exit
2222
fi
2323

24-
cat <<EOF | $GCC -ftls-model=initial-exec -mtls-dialect=$dialect -fPIC -c -o $t/a.o -xc -
24+
cat <<EOF | $GCC -ftls-model=initial-exec $mtls -fPIC -c -o $t/a.o -xc -
2525
#include <stdio.h>
2626
2727
static _Thread_local int foo;

test/elf/tls-large-tbss.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ echo -n "Testing $testname ... "
1212
t=out/test/elf/$MACHINE/$testname
1313
mkdir -p $t
1414

15-
[ $MACHINE = x86_64 ] || { echo skipped; exit; }
15+
[ $MACHINE = x86_64 -o $MACHINE = riscv64 -o $MACHINE = riscv32 ] || { echo skipped; exit; }
1616

1717
cat <<EOF | $CC -c -o $t/a.o -x assembler -
1818
.globl x, y

test/elf/tls-ld-noplt.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ t=out/test/elf/$MACHINE/$testname
1313
mkdir -p $t
1414

1515
if [ $MACHINE = x86_64 ]; then
16-
dialect=gnu
16+
mtls=-mtls-dialect=gnu
1717
elif [ $MACHINE = aarch64 ]; then
18-
dialect=trad
19-
else
18+
mtls=-mtls-dialect=trad
19+
elif [ $MACHINE '!=' riscv64 -a $MACHINE '!=' riscv32 ]; then
2020
echo skipped
2121
exit
2222
fi
2323

24-
cat <<EOF | $GCC -ftls-model=local-dynamic -mtls-dialect=$dialect -fPIC -fno-plt -c -o $t/a.o -xc -
24+
cat <<EOF | $GCC -ftls-model=local-dynamic $mtls -fPIC -fno-plt -c -o $t/a.o -xc -
2525
#include <stdio.h>
2626
2727
extern _Thread_local int foo;
@@ -38,7 +38,7 @@ int main() {
3838
}
3939
EOF
4040

41-
cat <<EOF | $GCC -ftls-model=local-dynamic -mtls-dialect=$dialect -fPIC -fno-plt -c -o $t/b.o -xc -
41+
cat <<EOF | $GCC -ftls-model=local-dynamic $mtls -fPIC -fno-plt -c -o $t/b.o -xc -
4242
_Thread_local int foo = 3;
4343
EOF
4444

test/elf/tls-ld.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ t=out/test/elf/$MACHINE/$testname
1313
mkdir -p $t
1414

1515
if [ $MACHINE = x86_64 ]; then
16-
dialect=gnu
16+
mtls=-mtls-dialect=gnu
1717
elif [ $MACHINE = aarch64 ]; then
18-
dialect=trad
19-
else
18+
mtls=-mtls-dialect=trad
19+
elif [ $MACHINE '!=' riscv64 -a $MACHINE '!=' riscv32 ]; then
2020
echo skipped
2121
exit
2222
fi
2323

24-
cat <<EOF | $GCC -ftls-model=local-dynamic -mtls-dialect=$dialect -fPIC -c -o $t/a.o -xc -
24+
cat <<EOF | $GCC -ftls-model=local-dynamic $mtls -fPIC -c -o $t/a.o -xc -
2525
#include <stdio.h>
2626
2727
extern _Thread_local int foo;
@@ -38,7 +38,7 @@ int main() {
3838
}
3939
EOF
4040

41-
cat <<EOF | $GCC -ftls-model=local-dynamic -mtls-dialect=$dialect -fPIC -c -o $t/b.o -xc -
41+
cat <<EOF | $GCC -ftls-model=local-dynamic $mtls -fPIC -c -o $t/b.o -xc -
4242
_Thread_local int foo = 3;
4343
EOF
4444

test/elf/tls-le.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ t=out/test/elf/$MACHINE/$testname
1313
mkdir -p $t
1414

1515
if [ $MACHINE = x86_64 ]; then
16-
dialect=gnu
16+
mtls=-mtls-dialect=gnu
1717
elif [ $MACHINE = aarch64 ]; then
18-
dialect=trad
19-
else
18+
mtls=-mtls-dialect=trad
19+
elif [ $MACHINE '!=' riscv64 -a $MACHINE '!=' riscv32 ]; then
2020
echo skipped
2121
exit
2222
fi
2323

24-
cat <<EOF | $GCC -ftls-model=local-exec -mtls-dialect=$dialect -fPIC -c -o $t/a.o -xc -
24+
cat <<EOF | $GCC -ftls-model=local-exec $mtls -fPIC -c -o $t/a.o -xc -
2525
#include <stdio.h>
2626
2727
extern _Thread_local int foo;
@@ -38,7 +38,7 @@ int main() {
3838
}
3939
EOF
4040

41-
cat <<EOF | $GCC -ftls-model=local-exec -mtls-dialect=$dialect -fPIC -c -o $t/b.o -xc -
41+
cat <<EOF | $GCC -ftls-model=local-exec $mtls -fPIC -c -o $t/b.o -xc -
4242
_Thread_local int foo = 3;
4343
EOF
4444

test/elf/tls-nopic.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ t=out/test/elf/$MACHINE/$testname
1313
mkdir -p $t
1414

1515
if [ $MACHINE = x86_64 ]; then
16-
dialect=gnu
16+
mtls=-mtls-dialect=gnu
1717
elif [ $MACHINE = aarch64 ]; then
18-
dialect=trad
19-
else
18+
mtls=-mtls-dialect=trad
19+
elif [ $MACHINE '!=' riscv64 -a $MACHINE '!=' riscv32 ]; then
2020
echo skipped
2121
exit
2222
fi
2323

24-
cat <<EOF | $GCC -mtls-dialect=$dialect -c -o $t/a.o -xc -
24+
cat <<EOF | $GCC $mtls -c -o $t/a.o -xc -
2525
#include <stdio.h>
2626
2727
extern _Thread_local int foo;

test/elf/tls-pic.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ t=out/test/elf/$MACHINE/$testname
1313
mkdir -p $t
1414

1515
if [ $MACHINE = x86_64 ]; then
16-
dialect=gnu
16+
mtls=-mtls-dialect=gnu
1717
elif [ $MACHINE = aarch64 ]; then
18-
dialect=trad
19-
else
18+
mtls=-mtls-dialect=trad
19+
elif [ $MACHINE '!=' riscv64 -a $MACHINE '!=' riscv32 ]; then
2020
echo skipped
2121
exit
2222
fi
2323

24-
cat <<EOF | $GCC -mtls-dialect=$dialect -fPIC -c -o $t/a.o -xc -
24+
cat <<EOF | $GCC $mtls -fPIC -c -o $t/a.o -xc -
2525
#include <stdio.h>
2626
2727
extern _Thread_local int foo;

0 commit comments

Comments
 (0)