2017-10-13 05:41:22 +08:00
|
|
|
# Expect script for TLS tests.
|
2020-01-01 15:57:01 +08:00
|
|
|
# Copyright (C) 2017-2020 Free Software Foundation, Inc.
|
2017-10-13 05:41:22 +08:00
|
|
|
#
|
|
|
|
# This file is part of the GNU Binutils.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
|
|
# MA 02110-1301, USA.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Make sure that binutils can correctly handle TLS.
|
|
|
|
|
2020-06-20 09:17:32 +08:00
|
|
|
if { !([istarget *-*-linux*]
|
|
|
|
|| [istarget arm*-*-uclinuxfdpiceabi]
|
|
|
|
|| [istarget *-*-nacl*]
|
|
|
|
|| [istarget *-*-gnu*]) || [istarget *ecoff] } then {
|
2017-10-13 05:41:22 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
# Check to see if the C compiler works.
|
2019-04-25 03:14:56 +08:00
|
|
|
if { ![check_compiler_available] } {
|
2017-10-13 05:41:22 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-02-07 01:15:56 +08:00
|
|
|
# This target requires extra GAS options when building PIC/PIE code.
|
|
|
|
set AFLAGS_PIC ""
|
|
|
|
if [istarget "sparc*-*-*"] {
|
|
|
|
append AFLAGS_PIC " -K PIC"
|
|
|
|
}
|
|
|
|
|
2017-10-13 05:41:22 +08:00
|
|
|
run_ld_link_tests [list \
|
|
|
|
[list \
|
|
|
|
"Build pr22263-1" \
|
2017-10-13 12:53:35 +08:00
|
|
|
"-pie -e _start -z text" \
|
2017-10-13 05:41:22 +08:00
|
|
|
"" \
|
2018-02-07 01:15:56 +08:00
|
|
|
"$AFLAGS_PIC" \
|
2017-10-13 05:41:22 +08:00
|
|
|
{ pr22263-1a.c pr22263-1b.c } \
|
|
|
|
{{readelf -r pr22263-1.rd}} \
|
|
|
|
"pr22263-1" \
|
2020-09-04 08:17:19 +08:00
|
|
|
"-fPIE -O2 $NOSANITIZE_CFLAGS" \
|
2017-10-13 05:41:22 +08:00
|
|
|
] \
|
|
|
|
]
|