# Expect script for linker support of STB_GNU_UNIQUE symbols
#
-# Copyright (C) 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
# Contributed by Red Hat.
#
# This file is part of the GNU Binutils.
}
# Require STB_GNU_UNIQUE support with OSABI set to GNU.
-if { ![supports_gnu_unique] } {
+if { ![supports_gnu_unique] || [istarget tic6x-*-*] } {
verbose "UNIQUE tests not run - target does not support UNIQUE"
return
}
# Look for a line like this:
# 54: 0000000000400474 4 OBJECT UNIQUE DEFAULT 13 a
- if { ![regexp ".*\[ \]*OBJECT\[ \]+UNIQUE\[ \]+DEFAULT\[ \]+\[UND0-9\]+\[ \]+\[ab\]\n" [file_contents readelf.out]] } {
+ if { ![regexp ".*\[ \]*OBJECT\[ \]+UNIQUE\[ \]+DEFAULT\[ \]+\[UND0-9\]+\[ \]+\[ab\]_val\n" [file_contents readelf.out]] } {
return 0
}
}
# Create executable containing unique symbol.
-if ![ld_link "$CC $board_cflags" "tmpdir/unique_prog" "tmpdir/unique.o"] {
+if ![ld_link "$CC $NOPIE_LDFLAGS $board_cflags" "tmpdir/unique_prog" "tmpdir/unique.o"] {
fail "Could not link a unique executable"
set fails [expr $fails + 1]
}
}
# Check the empty object file.
-case $target_triplet in {
- { hppa*-*-linux* } { set expected_none {UNIX - GNU} }
+switch -glob $target_triplet {
+ hppa*-*-linux* { set expected_none {UNIX - GNU} }
default { set expected_none {UNIX - System V} }
}
if {! [check_osabi tmpdir/unique_empty.o $expected_none]} {
}
# Create executable NOT containing unique symbol linked against library.
-if {![ld_link "$CC $board_cflags" "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_empty.o -Wl,-Bdynamic,-rpath=./tmpdir -lunique_shared"] } {
+if {![ld_link "$CC $NOPIE_LDFLAGS $board_cflags" "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_empty.o -Wl,-Bdynamic,-rpath=./tmpdir -lunique_shared"] } {
fail "Could not link a dynamic executable"
set fails [expr $fails + 1]
}
# Create shared library containing unique symbol with reference.
-if {![ld_link $ld "tmpdir/libunique_shared_ref.so" "-shared tmpdir/unique_shared.o tmpdir/unique_empty.o"] } {
+if {![ld_link $ld "tmpdir/libunique_shared_ref.so" "-shared -z notext tmpdir/unique_shared.o tmpdir/unique_empty.o"] } {
fail "Could not create a shared library containing an unique symbol with reference"
set fails [expr $fails + 1]
}