# Expect script for ld-visibility tests
-# Copyright (C) 2000-2018 Free Software Foundation, Inc.
+# Copyright (C) 2000-2020 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# Make sure that ld can generate ELF shared libraries with visibility.
# Check to see if the C compiler works
-if { [which $CC] == 0 } {
+if { ![check_compiler_available] } {
return
}
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
set shared "-bM:SRE -bE:$tmpdir/xcoff.exp"
}
+ if { [is_elf_format] && [check_shared_lib_support] } {
+ append shared " -Wl,-z,notext"
+ }
if {![ld_link $CC $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} {
if { [ string match $visibility "hidden_undef" ]
&& [regexp "undefined reference to \`\.?visibility\'" $link_output]