* elflink.c (elf_link_add_object_symbols): Don't create .tcommon
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / tls_common.exp
CommitLineData
6a4a0940
JJ
1# Expect script for .tls_common tests
2# Copyright 2006 Free Software Foundation, Inc.
3#
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.
8#
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.
13#
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.
17#
18# Written by Jakub Jelinek (jakub@redhat.com)
19#
20
21# Make sure that binutils can correctly handle ld output in ELF.
22
23# Run on Linux only.
24if { ![istarget *-*-linux*] } {
25 return
26}
27
28if { [istarget *-*-linux*aout*]
29 || [istarget *-*-linux*oldld*] } {
30 return
31}
32
33global as
34global ld
35global READELF
36global srcdir
37global subdir
38global link_output
39
40if { ![ld_assemble $as $srcdir/$subdir/tls_common.s tmpdir/tls_common.o ] } {
41 unresolved "tls_common"
42 return
43}
44
45if { ![ld_simple_link $ld tmpdir/tls_common1.o "-r tmpdir/tls_common.o"] } {
46 fail "tls_common"
47 return
48}
49
50if { ![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] } {
55 fail "tls_common"
56 } else {
57 unresolved "tls_common"
58 }
59 return
60}
61
62send_log "$READELF -l --wide tmpdir/tls_common\n"
63catch "exec $READELF -l --wide tmpdir/tls_common" readelf_output
64if ![string match "*TLS*0x000000 0x000004 R *" $readelf_output] then {
65 send_log "$readelf_output\n"
66 fail "tls_common"
67 return
68}
69
70pass "tls_common"
This page took 0.025543 seconds and 4 git commands to generate.