binutils-gdb/ld/testsuite/ld-elf/elf.exp
Alan Modra bab55c0522 Support different ld --hash-style in the ld testsuite
When ld is running with something other than --hash-style=sysv by
default, numerous tests need tweaking.  Most of the changes just add
--hash-style=sysv.  I didn't want to make --hash-style=sysv global as
that means --hash-style=gnu isn't well tested.

	* testsuite/ld-alpha/alpha.exp: Add --hash-style=sysv to various
	test's ld options.
	* testsuite/ld-arm/arm-elf.exp: Likewise.
	* testsuite/ld-elf/elf.exp: Likewise.
	* testsuite/ld-elf/readelf.exp: Likewise.
	* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
	* testsuite/ld-i386/i386.exp: Likewise.
	* testsuite/ld-ia64/ia64.exp: Likewise.
	* testsuite/ld-m68k/m68k.exp: Likewise.
	* testsuite/ld-metag/metag.exp: Likewise.
	* testsuite/ld-powerpc/powerpc.exp: Likewise.
	* testsuite/ld-s390/s390.exp: Likewise.
	* testsuite/ld-sh/sh-vxworks.exp: Likewise.
	* testsuite/ld-shared/shared.exp: Likewise.
	* testsuite/ld-sparc/sparc.exp: Likewise.
	* testsuite/ld-tic6x/tic6x.exp: Likewise.
	* testsuite/ld-vax-elf/vax-elf.exp: Likewise.
	* testsuite/ld-x86-64/mpx.exp: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* testsuite/ld-xtensa/xtensa.exp: Likewise.

	* testsuite/ld-elf/comm-data2.ld: Add .gnu.hash output section.
	* testsuite/ld-elf/pr20828-v.ld: Likewise.
	* testsuite/ld-elf/pr20828.ld: Likewise.
	* testsuite/ld-elf/pr21233.ld: Likewise.
	* testsuite/ld-elf/pr21384.ld: Likewise.
	* testsuite/ld-elf/provide-hidden-1.ld: Likewise.
	* testsuite/ld-elf/provide-hidden-2.ld: Likewise.
	* testsuite/ld-elf/provide-hidden-s.ld: Likewise.
	* testsuite/ld-scripts/cross1.t: Likewise.

	* testsuite/ld-elf/stab.d: Adjust allowed section indices.

	* testsuite/ld-i386/pie1.d: Don't match addresses.
	* testsuite/ld-i386/plt-pic2.dd: Likewise.
	* testsuite/ld-i386/pr19636-1d.d: Likewise.
	* testsuite/ld-i386/pr19636-2c.d: Likewise.
	* testsuite/ld-powerpc/elfv2so.d: Likewise.
	* testsuite/ld-powerpc/tlsopt5.d: Likewise.
	* testsuite/ld-powerpc/tlsopt5.wf: Likewise.
	* testsuite/ld-powerpc/tlsopt5_32.d: Likewise.

	* testsuite/ld-i386/pr19636-2b.d: Don't match _start.

	* testsuite/ld-powerpc/ambiguousv1.d: Relax symbol count, index
	and address match.
	* testsuite/ld-powerpc/ambiguousv1b.d: Likewise.
	* testsuite/ld-powerpc/ambiguousv2.d: Likewise.
	* testsuite/ld-powerpc/ambiguousv2b.d: Likewise.

	* testsuite/ld-aarch64/gc-plt-relocs.d: Run ld with --hash-style=sysv.
	* testsuite/ld-aarch64/ifunc-1.d: Likewise.
	* testsuite/ld-aarch64/ifunc-2.d: Likewise.
	* testsuite/ld-aarch64/ifunc-21.d: Likewise.
	* testsuite/ld-aarch64/relasz.d: Likewise.
	* testsuite/ld-aarch64/tls-small-ld.d: Likewise.
	* testsuite/ld-aarch64/tls-tiny-ld.d: Likewise.
	* testsuite/ld-arc/tls_gd-01.d: Likewise.
	* testsuite/ld-cris/libdso-10.d: Likewise.
	* testsuite/ld-cris/libdso-2.d: Likewise.
	* testsuite/ld-cris/pic-gc-72.d: Likewise.
	* testsuite/ld-cris/pic-gc-73.d: Likewise.
	* testsuite/ld-cris/tls-gd-1.d: Likewise.
	* testsuite/ld-cris/tls-gd-1h.d: Likewise.
	* testsuite/ld-cris/tls-gd-2.d: Likewise.
	* testsuite/ld-cris/tls-gd-2h.d: Likewise.
	* testsuite/ld-cris/tls-ie-10.d: Likewise.
	* testsuite/ld-cris/tls-ie-11.d: Likewise.
	* testsuite/ld-cris/tls-ie-8.d: Likewise.
	* testsuite/ld-cris/tls-ie-9.d: Likewise.
	* testsuite/ld-cris/tls-ld-4.d: Likewise.
	* testsuite/ld-cris/tls-ld-5.d: Likewise.
	* testsuite/ld-cris/tls-ld-6.d: Likewise.
	* testsuite/ld-cris/tls-ld-7.d: Likewise.
	* testsuite/ld-cris/tls-ldgd-14.d: Likewise.
	* testsuite/ld-cris/tls-ldgd-15.d: Likewise.
	* testsuite/ld-cris/tls-ldgdx-14.d: Likewise.
	* testsuite/ld-cris/tls-ldgdx-15.d: Likewise.
	* testsuite/ld-cris/tls-local-54.d: Likewise.
	* testsuite/ld-cris/tls-local-60.d: Likewise.
	* testsuite/ld-cris/tls-local-61.d: Likewise.
	* testsuite/ld-cris/weakhiddso.d: Likewise.
	* testsuite/ld-elf/linkinfo1a.d: Likewise.
	* testsuite/ld-elf/linkinfo1b.d: Likewise.
	* testsuite/ld-elf/pr19617a.d: Likewise.
	* testsuite/ld-elfvsb/hidden2.d: Likewise.
	* testsuite/ld-frv/fdpic-pie-6.d: Likewise.
	* testsuite/ld-frv/fdpic-shared-2.d: Likewise.
	* testsuite/ld-frv/fdpic-shared-5.d: Likewise.
	* testsuite/ld-frv/fdpic-shared-6.d: Likewise.
	* testsuite/ld-frv/fdpic-shared-8.d: Likewise.
	* testsuite/ld-frv/fdpic-shared-local-2.d: Likewise.
	* testsuite/ld-frv/fdpic-shared-local-8.d: Likewise.
	* testsuite/ld-frv/tls-dynamic-2.d: Likewise.
	* testsuite/ld-i386/ibt-plt-1.d: Likewise.
	* testsuite/ld-i386/ibt-plt-2a.d: Likewise.
	* testsuite/ld-i386/ibt-plt-2c.d: Likewise.
	* testsuite/ld-i386/ibt-plt-3a.d: Likewise.
	* testsuite/ld-i386/ibt-plt-3c.d: Likewise.
	* testsuite/ld-i386/pr20830.d: Likewise.
	* testsuite/ld-ia64/merge1.d: Likewise.
	* testsuite/ld-ia64/merge2.d: Likewise.
	* testsuite/ld-ia64/merge3.d: Likewise.
	* testsuite/ld-ia64/merge4.d: Likewise.
	* testsuite/ld-ia64/merge5.d: Likewise.
	* testsuite/ld-ifunc/ifunc-1-local-x86.d: Likewise.
	* testsuite/ld-ifunc/ifunc-1-x86.d: Likewise.
	* testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise.
	* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
	* testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise.
	* testsuite/ld-ifunc/ifunc-2-local-x86-64.d: Likewise.
	* testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise.
	* testsuite/ld-ifunc/ifunc-2-x86-64.d: Likewise.
	* testsuite/ld-ifunc/ifunc-3a-x86.d: Likewise.
	* testsuite/ld-ifunc/pr17154-i386-now.d: Likewise.
	* testsuite/ld-ifunc/pr17154-i386.d: Likewise.
	* testsuite/ld-ifunc/pr17154-x86-64-now.d: Likewise.
	* testsuite/ld-ifunc/pr17154-x86-64.d: Likewise.
	* testsuite/ld-m68k/got-1.d: Likewise.
	* testsuite/ld-m68k/got-multigot-12-13-14-34-35-ok.d: Likewise.
	* testsuite/ld-m68k/got-multigot-14-ok.d: Likewise.
	* testsuite/ld-m68k/got-multigot-15-er.d: Likewise.
	* testsuite/ld-m68k/got-negative-12-13-14-34-ok.d: Likewise.
	* testsuite/ld-m68k/got-negative-12-13-14-35-er.d: Likewise.
	* testsuite/ld-m68k/got-negative-14-ok.d: Likewise.
	* testsuite/ld-m68k/got-negative-15-er.d: Likewise.
	* testsuite/ld-m68k/got-single-12-ok.d: Likewise.
	* testsuite/ld-m68k/got-single-13-er.d: Likewise.
	* testsuite/ld-m68k/got-xgot-12-13-14-15-34-35-ok.d: Likewise.
	* testsuite/ld-m68k/got-xgot-15-ok.d: Likewise.
	* testsuite/ld-m68k/tls-gd-1.d: Likewise.
	* testsuite/ld-m68k/tls-gd-2.d: Likewise.
	* testsuite/ld-m68k/tls-gd-ie-1.d: Likewise.
	* testsuite/ld-m68k/tls-ie-1.d: Likewise.
	* testsuite/ld-m68k/tls-ld-1.d: Likewise.
	* testsuite/ld-m68k/tls-ld-2.d: Likewise.
	* testsuite/ld-sh/shared-2.d: Likewise.
	* testsuite/ld-sh/tlsbin-2.d: Likewise.
	* testsuite/ld-sh/tlspic-2.d: Likewise.
	* testsuite/ld-x86-64/bnd-branch-1-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-ifunc-1.d: Likewise.
	* testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
	* testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-plt-1.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-1.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2a.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3a.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3c.d: Likewise.
	* testsuite/ld-x86-64/ilp32-4-nacl.d: Likewise.
	* testsuite/ld-x86-64/ilp32-4.d: Likewise.
	* testsuite/ld-x86-64/load1c-nacl.d: Likewise.
	* testsuite/ld-x86-64/load1c.d: Likewise.
	* testsuite/ld-x86-64/load1d-nacl.d: Likewise.
	* testsuite/ld-x86-64/load1d.d: Likewise.
	* testsuite/ld-x86-64/pie3-nacl.d: Likewise.
	* testsuite/ld-x86-64/pie3.d: Likewise.
	* testsuite/ld-x86-64/pr14207.d: Likewise.
	* testsuite/ld-x86-64/pr19162.d: Likewise.
	* testsuite/ld-x86-64/pr19636-2d-nacl.d: Likewise.
	* testsuite/ld-x86-64/pr19636-2d.d: Likewise.
	* testsuite/ld-x86-64/pr20253-1d.d: Likewise.
	* testsuite/ld-x86-64/pr20253-1f.d: Likewise.
	* testsuite/ld-x86-64/pr20253-1j.d: Likewise.
	* testsuite/ld-x86-64/pr20253-1l.d: Likewise.
	* testsuite/ld-x86-64/pr20830a-now.d: Likewise.
	* testsuite/ld-x86-64/pr20830a.d: Likewise.
	* testsuite/ld-x86-64/pr20830b-now.d: Likewise.
	* testsuite/ld-x86-64/pr20830b.d: Likewise.
	* testsuite/ld-x86-64/pr21038a-now.d: Likewise.
	* testsuite/ld-x86-64/pr21038a.d: Likewise.
	* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
	* testsuite/ld-x86-64/pr21038b.d: Likewise.
	* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
	* testsuite/ld-x86-64/pr21038c.d: Likewise.
2017-08-07 22:10:51 +09:30

338 lines
10 KiB
Plaintext

# Expect script for various ELF tests.
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# 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.
#
# Exclude non-ELF targets.
if ![is_elf_format] {
return
}
set old_ldflags $LDFLAGS
if { [istarget spu*-*-*] } {
set LDFLAGS "$LDFLAGS --local-store 0:0"
}
# hpux .comm differs from everyone else
set hpux ""
set old_asflags $ASFLAGS
if [istarget "*-*-hpux*"] {
set hpux "--defsym HPUX=1"
set ASFLAGS "$ASFLAGS --defsym HPUX=1"
}
if { [istarget alpha*-*-* ] } {
# The compress1 test is written expecting 32-bit addresses; force the
# executable down into the low address space to match.
# ??? How can we adjust just the one testcase?
set LDFLAGS "$LDFLAGS -Ttext-segment 0x1000000"
}
if { [istarget "*-*-nacl*"] } {
# The eh[1-4] cases are written to expect ELFCLASS64 layout on x86-64.
# But the target default is ELFCLASS32. So the cases explicitly use
# -melf_x86_64 to select that, but NaCl needs a different emulation name.
set options_regsub(ld) {-melf_x86_64 -melf_x86_64_nacl}
}
if { [istarget "*-*-solaris*"] } {
# Same for Solaris
set options_regsub(ld) {-melf_x86_64 -melf_x86_64_sol2}
}
if { [is_remote host] } then {
remote_download host merge.ld
}
run_ld_link_tests [list \
[list "Build symbol3.a" \
"" "" $hpux \
{symbol3.s} {} "symbol3.a" ] \
[list "Build symbol3w.a" \
"" "" "" \
{symbol3w.s} {} "symbol3w.a" ] \
]
if { [check_shared_lib_support] } then {
run_ld_link_tests {
{"Build pr14170a.o" "" "" "" {pr14170a.s} {} "pr14170.a" }
}
setup_xfail "tic6x-*-*"
run_ld_link_tests {
{"Build shared library for pr14170"
"-shared" "" "" "pr14170b.s" {} "pr14170.so" }
}
# bfin does not currently support copy relocs.
setup_xfail "bfin-*-*"
run_ld_link_tests [list \
[list "PR ld/14170" \
"--no-dynamic-linker tmpdir/pr14170a.o tmpdir/pr14170.so" "" $hpux \
{pr14170c.s} { } "pr14170" ] \
]
}
# Only run these tests on targets that support creating shared libraries.
if { [check_shared_lib_support] } then {
# This target requires extra GAS options when building non-PIC code
# for linking with shared libraries.
set AFLAGS_NONPIC ""
if [istarget "mips*-*-*"] {
append AFLAGS_NONPIC " -call_nonpic"
}
# Run a test to check linking a shared library with a broken linker
# script that accidentally marks dynamic sections as notes. The
# resulting executable is not expected to work, but the linker
# should not seg-fault whilst creating the binary.
setup_xfail "tic6x-*-*"
run_ld_link_tests {
{"Build shared library for next test"
"-shared --hash-style=sysv" "" "" "note-3.s" {} "note-3.so" }
{"Link using broken linker script"
"--script note-3.t tmpdir/note-3.so" "" "" ""
{ { ld "note-3.l" } }
"a.out" }
}
setup_xfail "tic6x-*-*"
run_ld_link_tests {
{"Build pr17068.so"
"-shared" "" ""
{pr17068d.s} {} "pr17068.so"}
{"Build pr17068a.a"
"" "" ""
{pr17068a.s pr17068c.s pr17068ez.s} {} "pr17068a.a"}
{"Build pr17068b.a"
"" "" ""
{pr17068b.s pr17068e.s} {} "pr17068b.a"}
}
# bfin does not currently support copy relocs.
setup_xfail "bfin-*-*"
run_ld_link_tests {
{"pr17068 link --as-needed lib in group"
"--as-needed --no-dynamic-linker" "--start-group tmpdir/pr17068a.a tmpdir/pr17068.so tmpdir/pr17068b.a --end-group" ""
{start.s pr17068.s} {} "pr17068"}
}
# xfail on tic6x due to non-PIC/non-PID warnings
setup_xfail "tic6x-*-*"
# Fails on MIPS because ABI trickery means that a NULL reloc is also emitted.
setup_xfail "mips*-*-*"
# Fails on bfin because relocations are not created.
setup_xfail "bfin-*-*"
run_ld_link_tests {
{"-Bsymbolic-functions"
"-shared -Bsymbolic-functions" "" ""
{symbolic-func.s} {{readelf {-r --wide} symbolic-func.r}}
"symbolic-func.so"}
}
# xfail on tic6x due to non-PIC/non-PID warnings
setup_xfail "tic6x-*-*"
run_ld_link_tests {
{"Build pr20995.so"
"-shared" "" ""
{pr20995b.s} {} "pr20995.so"}
}
setup_xfail "tic6x-*-*"
# xfail on arm*-*-eabi*. The list can be enlarged to those targets that
# don't support GNU_RELRO. For more details, please see discussions at:
# https://sourceware.org/ml/binutils/2017-01/msg00441.html
setup_xfail "arm*-*-eabi*" "hppa*64*-*-hpux*"
run_ld_link_tests {
{"Build pr20995-2.so"
"-shared -z relro" "" ""
{pr20995c.s} {{readelf {-l --wide} pr20995-2so.r}} "pr20995-2.so"}
}
# These targets don't copy dynamic variables into .bss.
setup_xfail "alpha-*-*" "bfin-*-*" "ia64-*-*" "xtensa-*-*"
# or don't have .data.rel.ro
setup_xfail "hppa*64*-*-hpux*"
run_ld_link_tests [list \
[list \
"pr20995" \
"" "tmpdir/pr20995.so" "$AFLAGS_NONPIC" \
{pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995"]]
# xfail on arm*-*-eabi* is particularly because of no support of GNU_RELRO.
# Please see the link above for details.
setup_xfail "alpha-*-*" "bfin-*-*" "ia64-*-*" "xtensa-*-*" "arm*-*-eabi*"
setup_xfail "hppa*64*-*-hpux*"
run_ld_link_tests [list \
[list \
"pr20995-2" \
"" "tmpdir/pr20995-2.so" "$AFLAGS_NONPIC" \
{pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995-2"]]
}
if [is_underscore_target] {
set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1"
}
set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
foreach t $test_list {
# We need to strip the ".d", but can leave the dirname.
verbose [file rootname $t]
run_dump_test [file rootname $t]
}
# Targets using the generic linker backend don't support generating
# an import library.
set xfail_implib ""
if [is_generic_elf] {
set xfail_implib "*-*-*"
}
# Check that the --out-implib option work correctly.
run_ld_link_tests [list \
[list "Generate empty import library" \
"--out-implib=tmpdir/implib.lib" "" \
[concat "--defsym NO_GLOBAL=1" $hpux] \
{implib.s} \
{{ld empty-implib.out}} \
"implib" ] \
[list "Generate import library" \
"--out-implib=tmpdir/implib.lib" "" \
$hpux \
{implib.s} \
{{readelf {-s tmpdir/implib.lib} implib.rd}} \
"implib" ] \
] $xfail_implib
if { [istarget *-*-linux*]
|| [istarget *-*-nacl*]
|| [istarget *-*-gnu*] } {
run_ld_link_tests {
{"Weak symbols in dynamic objects 1 (support)"
"-shared" "" "" {weak-dyn-1a.s}
{}
"libweakdyn1a.so"}
{"Weak symbols in dynamic objects 1 (main test)"
"-shared tmpdir/libweakdyn1a.so -Tweak-dyn-1.ld" "" "" {weak-dyn-1b.s}
{{readelf {--relocs --wide} weak-dyn-1.rd}}
"libweakdyn1b.so"}
}
}
#v850 gas complains about .tbss.var section attributes.
if { [check_gc_sections_available] && ![istarget "v850-*-*"] } {
run_ld_link_tests {
{"--gc-sections on tls variable"
"--gc-section" "" "" {tls_gc.s} {} "tls_gc"}
}
}
if { [istarget *-*-*linux*]
|| [istarget *-*-nacl*]
|| [istarget *-*-gnu*] } {
run_ld_link_tests {
{"stack exec" "-z execstack" "" "" {stack.s}
{{readelf {-Wl} stack-exec.rd}} "stack-exec.exe"}
{"stack size" "-z stack-size=0x123400" "" "" {stack.s}
{{readelf {-Wl} stack-size.rd}} "stack-size.exe"}
}
}
set LDFLAGS $old_ldflags
set ASFLAGS $old_asflags
# Check to see if the C compiler works
if { [which $CC] == 0 } {
return
}
if [check_gc_sections_available] {
run_cc_link_tests {
{"PR ld/13195" "-Wl,--gc-sections" ""
{pr13195.c} {} "pr13195"}
}
}
set array_tests {
{"preinit array" "" ""
{preinit.c} "preinit" "preinit.out"}
{"init array" "" ""
{init.c} "init" "init.out"}
{"fini array" "" ""
{fini.c} "fini" "fini.out"}
{"init array mixed" "" ""
{init-mixed.c} "init-mixed" "init-mixed.out" "-I."}
}
set array_tests_pie {
{"PIE preinit array" "-pie" ""
{preinit.c} "preinit" "preinit.out" "-fPIE"}
{"PIE init array" "-pie" ""
{init.c} "init" "init.out" "-fPIE"}
{"PIE fini array" "-pie" ""
{fini.c} "fini" "fini.out" "-fPIE"}
{"PIE init array mixed" "-pie" ""
{init-mixed.c} "init-mixed" "init-mixed.out" "-I. -fPIE"}
{"PIE PR ld/14525" "-pie" ""
{pr14525.c} "pr14525" "pr14525.out" "-fPIE"}
}
set array_tests_static {
{"static preinit array" "-static" ""
{preinit.c} "preinit" "preinit.out"}
{"static init array" "-static" ""
{init.c} "init" "init.out"}
{"static fini array" "-static" ""
{fini.c} "fini" "fini.out"}
{"static init array mixed" "-static" ""
{init-mixed.c} "init-mixed" "init-mixed.out" "-I."}
}
# NetBSD ELF systems do not currently support the .*_array sections.
set xfails "*-*-netbsdelf*"
run_ld_link_exec_tests $array_tests $xfails
if { [istarget *-*-linux*]
|| [istarget *-*-nacl*]
|| [istarget *-*-gnu*] } {
run_ld_link_exec_tests $array_tests_pie $xfails
run_ld_link_exec_tests [list \
[list \
"Run mbind2a" \
"$NOPIE_LDFLAGS -Wl,-z,common-page-size=0x4000" \
"" \
{ mbind2a.s mbind2b.c } \
"mbind2a" \
"pass.out" \
"-O2 -I../bfd" \
] \
[list \
"Run mbind2b" \
"-static -Wl,-z,common-page-size=0x4000" \
"" \
{ mbind2a.s mbind2b.c } \
"mbind2b" \
"pass.out" \
"-O2 -I../bfd" \
] \
]
}
# <http://www.gnu.org/software/hurd/open_issues/binutils.html#static>
# Be cautious to not XFAIL for *-*-linux-gnu*, *-*-kfreebsd-gnu*, etc.
switch -regexp $target_triplet {
^\[^-\]*-\[^-\]*-gnu.*$ {
set xfails "*-*-*"
}
}
run_ld_link_exec_tests $array_tests_static $xfails
catch "exec rm -f tmpdir/preinit tmpdir/init tmpdir/fini tmpdir/init-mixed" status