1 # Expect script
for .tls_common tests
2 # Copyright
2006 Free Software Foundation
, Inc.
4 # This file is free software
; you can redistribute it and
/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation
; either version
2 of the License
, or
7 #
(at your option
) any later version.
9 # This
program is distributed in the hope that it will be useful
,
10 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License
for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this
program; if not
, write to the Free Software
16 # Foundation
, Inc.
, 51 Franklin Street
- Fifth Floor
, Boston
, MA
02110-1301, USA.
18 # Written by Jakub Jelinek
(jakub@redhat.com
)
21 # Make sure that binutils can correctly handle
ld output in ELF.
24 if { ![istarget
*-*-linux
*] } {
28 if { [istarget
*-*-linux
*aout
*]
29 ||
[istarget
*-*-linux
*oldld
*] } {
40 if { ![ld_assemble $as $srcdir
/$subdir
/tls_common.s tmpdir
/tls_common.o
] } {
41 unresolved
"tls_common"
45 if { ![ld_simple_link $
ld tmpdir
/tls_common1.o
"-r tmpdir/tls_common.o"] } {
50 if { ![ld_simple_link $
ld tmpdir
/tls_common
"tmpdir/tls_common1.o"] } {
51 if { [string match
"*not supported*" $link_output]
52 ||
[string match
"*unrecognized option*" $link_output] } {
53 unsupported
"$ld_options is not supported by this target"
54 } elseif
{ [string match
"*Warning*alignment*of common symbol*" $link_output] } {
57 unresolved
"tls_common"
62 send_log
"$READELF -l --wide tmpdir/tls_common\n"
63 catch
"exec $READELF -l --wide tmpdir/tls_common" readelf_output
64 if ![regexp
".*TLS.*0x0+ 0x0+4 R .*" $readelf_output] then {
65 send_log
"$readelf_output\n"