# Expect script for common symbol override.
#
-# Copyright (C) 2011-2020 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
append LFLAGS " -call_shared"
}
+# Set the pointer size according to the ELF flavor.
+set AFLAGS ""
+if [is_elf64 "tmpdir/libcomm-data.so"] {
+ append AFLAGS " --defsym ELF64=1"
+}
+# HPUX targets use a different .comm syntax.
+if [istarget "*-*-hpux*"] {
+ append AFLAGS " --defsym HPUX=1"
+}
+
set testname "Common symbol override test"
# Define a global symbol.
} \
"libcomm-data.so" \
] \
+ [list \
+ "libpr26580-1.so" \
+ "$LFLAGS -shared" "" \
+ "$AFLAGS_PIC $AFLAGS" \
+ { pr26580-b.s } \
+ { } \
+ "libpr26580-1.so" \
+ ] \
]
-# Set the pointer size according to the ELF flavor.
-set AFLAGS ""
-if [is_elf64 "tmpdir/libcomm-data.so"] {
- append AFLAGS " --defsym ELF64=1"
-}
-# HPUX targets use a different .comm syntax.
-if [istarget "*-*-hpux*"] {
- append AFLAGS " --defsym HPUX=1"
-}
-
-# bfin does not currently support copy relocs.
+# bfin-elf does not currently support copy relocs.
setup_xfail "bfin-*-*"
-
-setup_xfail "arm*-*-*" "ld/13802"
-
-# List targets here that keep copy relocs rather than eliminating
-# them where possible in favour to dynamic relocs in the relevant
-# loadable sections; see also the "-z nocopyreloc" command-line
-# option and the ELIMINATE_COPY_RELOCS macro some backends use.
-set copy_reloc [expr [istarget mn10300-*-*] || [istarget vax-*-*]]
+clear_xfail "bfin-*-linux-uclibc*"
# Verify that a common symbol has been converted to an undefined
# reference to the global symbol of the same name defined above
"$AFLAGS" \
{ comm-data2.s } \
[list \
- [list readelf -s \
- [expr { $copy_reloc ? "comm-data2r.sd" : "comm-data2.sd"}]] \
- [list readelf -r \
- [expr { $copy_reloc ? "comm-data2r.rd" : "comm-data2.rd"}]] \
- [list readelf "-x .debug_foo" \
- [expr { $copy_reloc ? "comm-data2r.xd" : "comm-data2.xd"}]]] \
+ [list readelf -s comm-data2.sd] \
+ [list readelf -r comm-data2.rd] \
+ [list readelf "-x .debug_foo" comm-data2.xd]] \
"comm-data" \
] \
[list \
} \
"comm-data3b" \
] \
+ [list \
+ "pr26580-1" \
+ "$LFLAGS --as-needed -Ltmpdir -lpr26580-1" "" \
+ "$AFLAGS" \
+ { pr26580-a.s } \
+ { {readelf -s pr26580-1.sd} } \
+ "pr26580-1" \
+ ] \
+ [list \
+ "pr26580-2" \
+ "$LFLAGS --no-as-needed -Ltmpdir -lpr26580-1" "" \
+ "$AFLAGS" \
+ { pr26580-a.s } \
+ { {readelf -s pr26580-2.sd} } \
+ "pr26580-2" \
+ ] \
]