ld: Update function prototypes for compilers defaulting to -std=gnu23
[binutils-gdb.git] / ld / testsuite / ld-elf / tls_common.exp
blob31f36efd1380d9e73d44a871b21a223e937572a8
1 # Expect script for .tls_common tests
2 # Copyright (C) 2006-2025 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,
19 # MA 02110-1301, USA.
21 # Written by Jakub Jelinek (jakub@redhat.com)
24 # Make sure that binutils can correctly handle ld output in ELF.
26 if { !([istarget *-*-linux*]
27 || [istarget arm*-*-uclinuxfdpiceabi]
28 || [istarget *-*-nacl*]
29 || [istarget *-*-gnu*]) || [istarget *ecoff] } then {
30 return
33 if { ![ld_assemble $as "--elf-stt-common=no $srcdir/$subdir/tls_common.s" tmpdir/tls_commona.o]
34 || ![ld_assemble $as "--elf-stt-common=yes $srcdir/$subdir/tls_common.s" tmpdir/tls_commonb.o] } {
35 unsupported "tls_common"
36 return
39 if { ![ld_link $ld tmpdir/tls_common1a.o "-r tmpdir/tls_commona.o"]
40 || ![ld_link $ld tmpdir/tls_common1b.o "-r tmpdir/tls_commona.o"] } {
41 fail "tls_common"
42 return
45 if { ![ld_link $ld tmpdir/tls_commona "tmpdir/tls_common1a.o"] } {
46 if { [string match "*not supported*" $link_output]
47 || [string match "*unrecognized option*" $link_output] } {
48 unsupported "$ld_options is not supported by this target"
49 } else {
50 fail "tls_common"
52 return
55 if { ![ld_link $ld tmpdir/tls_commonb "tmpdir/tls_common1b.o"] } {
56 if { [string match "*not supported*" $link_output]
57 || [string match "*unrecognized option*" $link_output] } {
58 unsupported "$ld_options is not supported by this target"
59 } else {
60 fail "tls_common"
62 return
65 set readelf_output [run_host_cmd "$READELF" "-l --wide tmpdir/tls_commona"]
66 if ![regexp ".*TLS.*0x0+ 0x0+4 R .*" $readelf_output] then {
67 send_log "$readelf_output\n"
68 fail "tls_common"
69 return
72 set readelf_output [run_host_cmd "$READELF" "-l --wide tmpdir/tls_commona"]
73 if ![regexp ".*TLS.*0x0+ 0x0+4 R .*" $readelf_output] then {
74 send_log "$readelf_output\n"
75 fail "tls_common"
76 return
79 pass "tls_common"