1 # Expect script for x86-64 TLS tests.
2 # Copyright (C) 2016 Free Software Foundation, Inc.
4 # This file is part of the GNU Binutils.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22 # The following tests require running the executable generated by ld,
23 # or enough of a build environment to create a fully linked executable.
24 # This is not commonly available when testing a cross-built linker.
29 # Only on Linux for now.
30 if ![istarget "x86_64-*-linux*"] {
34 # Check to see if the C compiler works
35 if { [which $CC] == 0 } {
39 run_cc_link_tests [list \
41 "Build tls-def1.c tls-main1.c" \
44 {tls-def1.c tls-main1.c} \
47 "Build tls-gd1.o tls-ld1.o" \
49 "-fPIC -Wa,-mrelax-relocations=yes" \
50 {tls-gd1.S tls-ld1.S} \
53 "Build libtls-1a.so" \
54 "-shared tmpdir/tls-def1.o" \
61 "Build libtls-1b.so" \
62 "-shared tmpdir/tls-gd1.o tmpdir/tls-ld1.o" \
70 run_ld_link_exec_tests [] [list \
72 "TLS GD/LD -> LE transition without PLT (dynamic)" \
73 "tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
81 "TLS GD/LD -> LE transition without PLT (PIE)" \
82 "-pie tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
90 "TLS GD/LD -> LE transition without PLT (static)" \
91 "-static tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
99 "TLS GD/LD -> IE transition without PLT" \
100 "tmpdir/tls-main1.o tmpdir/tls-gd1.o tmpdir/tls-ld1.o \
101 tmpdir/libtls-1a.so -R tmpdir" \
108 "TLS without PLT (1)" \
109 "tmpdir/tls-main1.o \
110 tmpdir/libtls-1a.so tmpdir/libtls-1b.so -R tmpdir" \
117 "TLS without PLT (2)" \
118 "tmpdir/tls-main1.o tmpdir/tls-def1.o \
119 tmpdir/libtls-1b.so -R tmpdir" \