This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Run more ld tests when not native


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d98164028637041c5de99af0d057bde3f168a8a8

commit d98164028637041c5de99af0d057bde3f168a8a8
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Jan 2 22:45:37 2017 +1030

    Run more ld tests when not native
    
    Many of the ld tests are not run for cross builds, in some cases
    because the test needs to run a newly linked executable, and in others
    simply because it was easier to write the test for native only.  Even
    when a test needs to run, it's good to compile and link to exercise
    the linker.  So that's what this patch does.  I've also rid us of
    the old ld_link procedure with all the HOSTING_CRT0 etc. setup.  It's
    much simpler to just link with $CC.
    
    This does mean that a cross build with cross-compiler installed but
    no cross C-library will give lots of failures.  If that turns out to
    be too annoying, I guess we can write a tcl procedure to detect it and
    not run all the extra tests.
    
    	* Makefile.am (bootstrap): Delete rule.
    	(ld-partial, ld1, ld1-full, ld2, ld3): Likewise.
    	(HOSTING_CRT0, HOSTING_SCRT0): Don't define.
    	(HOSTING_LIBS, HOSTING_SLIBS, HOSTING_EMU): Likewise.
    	* configure.ac (HOSTING_CRT0, HOSTING_SCRT0): Don't define.
    	(HOSTING_LIBS, HOSTING_SLIBS): Likewise.
    	* configure.host (HOSTING_CRT0, HOSTING_LIBS): Don't define.
    	* Makefile.in: Regenerate.
    	* configure: Regenerate.
    	* testsuite/config/default.exp (get_link_files): Delete.
    	(HOSTING_CRT0, HOSTING_SCRT0, HOSTING_LIBS, HOSTING_SLIBS): Don't
    	define.
    	(ld_simple_link): Delete.
    	* testsuite/lib/ld-lib.exp (default_ld_link): Delete
    	(default_ld_simple_link): Rename to default_ld_link.
    	(ld_simple_link_defsyms): Rename to ld_link_defsyms.
    	(run_ld_link_tests): Use ld_link, not ld_simple_link.
    	(run_cc_link_tests): Likewise.
    	(run_ld_link_exec_tests): Use $CC or $CXX to link, not $ld.
    	Don't run exe when not native, and return unsupported.
    	* testsuite/ld-bootstrap/bootstrap.exp: Create gccld1 etc. dirs.
    	Link ld1 etc. using $CC.
    	* testsuite/ld-cdtest/cdtest.exp: Link cdtest using $CC.
    	* testsuite/ld-checks/checks.exp: Use ld_link, not ld_simple_link.
    	* testsuite/ld-cygwin/exe-export.exp: Likewise.
    	* testsuite/ld-elf/binutils.exp: Likewise.
    	* testsuite/ld-elf/eh-group.exp: Likewise.
    	* testsuite/ld-elf/exclude.exp: Likewise.
    	* testsuite/ld-elf/frame.exp: Likewise.
    	* testsuite/ld-elf/sec-to-seg.exp: Likewise.
    	* testsuite/ld-elf/tls_common.exp: Likewise.
    	* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
    	* testsuite/ld-fastcall/fastcall.exp: Likewise.
    	* testsuite/ld-gc/gc.exp: Likewise.
    	* testsuite/ld-ifunc/binutils.exp: Likewise.
    	* testsuite/ld-mep/mep.exp: Likewise.
    	* testsuite/ld-mips-elf/mips-elf-flags.exp: Likewise.
    	* testsuite/ld-mn10300/mn10300.exp: Likewise.
    	* testsuite/ld-nios2/nios2.exp: Likewise.
    	* testsuite/ld-pe/pe-compile.exp: Likewise.
    	* testsuite/ld-pe/pe-run.exp: Likewise.
    	* testsuite/ld-pe/pe-run2.exp: Likewise.
    	* testsuite/ld-plugin/plugin.exp: Likewise.
    	* testsuite/ld-scripts/align.exp: Likewise.
    	* testsuite/ld-scripts/alignof.exp: Likewise.
    	* testsuite/ld-scripts/assert.exp: Likewise.
    	* testsuite/ld-scripts/defined.exp: Likewise.
    	* testsuite/ld-scripts/extern.exp: Likewise.
    	* testsuite/ld-scripts/log2.exp: Likewise.
    	* testsuite/ld-scripts/map-address.exp: Likewise.
    	* testsuite/ld-scripts/phdrs.exp: Likewise.
    	* testsuite/ld-scripts/phdrs2.exp: Likewise.
    	* testsuite/ld-scripts/script.exp: Likewise.
    	* testsuite/ld-scripts/section-flags.exp: Likewise.
    	* testsuite/ld-scripts/sizeof.exp: Likewise.
    	* testsuite/ld-scripts/sysroot-prefix.exp: Likewise.
    	* testsuite/ld-scripts/weak.exp: Likewise.
    	* testsuite/ld-selective/selective.exp: Likewise.
    	* testsuite/ld-sh/sh.exp: Likewise.
    	* testsuite/ld-sh/sh64/relax.exp: Likewise.
    	* testsuite/ld-sh/sh64/relfail.exp: Likewise.
    	* testsuite/ld-srec/srec.exp: Likewise.
    	* testsuite/ld-tic6x/tic6x.exp: Likewise.
    	* testsuite/ld-undefined/weak-undef.exp: Likewise.
    	* testsuite/ld-versados/versados.exp: Likewise.
    	* testsuite/ld-x86-64/dwarfreloc.exp: Likewise.
    	* testsuite/ld-xtensa/coalesce.exp: Likewise.
    	* testsuite/ld-xtensa/diff_overflow.exp: Likewise.
    	* testsuite/ld-xtensa/lcall.exp: Likewise.
    	* testsuite/ld-elf/audit.exp: Run non-native too.
    	* testsuite/ld-elf/compress.exp: Likewise.  Replace ld options with
    	gcc -Wl, options.
    	* testsuite/ld-elf/dwarf.exp: Run non-native too.  Use ld_link,
    	not ld_simple_link.  Add -Wl,--no-as-needed to some tests.
    	* testsuite/ld-elf/elf.exp: Run non-native too.  Formatting.
    	* testsuite/ld-elf/indirect.exp: Run non-native too.  Add
    	-Wl,--no-as-needed to most tests.
    	* testsuite/ld-elf/shared.exp: Run non-native too.  Use braces
    	to simplify quoting.  Set run_tests using [list] rather than
    	brace assignment to expand $extralibs.  Add -Wl,--no-as-needed
    	to many test.  Prefix ld options with -Wl,.
    	(mix_pic_and_non_pic): Don't run exe if not native.
    	* testsuite/ld-elf/wrap.exp: Run non-native too.  Add
    	-Wl,--no-as-needed and prefix ld options with -Wl,.
    	* testsuite/ld-elfvers/vers.exp: Run non-native too.  Use ld_link,
    	not ld_simple_link.
    	* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
    	(visibility_test): Don't run exe if not native.
    	* testsuite/ld-elfweak/elfweak.exp: Run non-native too.  Use ld_link,
    	not ld_simple_link.
    	(build_exec): Don't run exe if not native.
    	* testsuite/ld-ifunc/ifunc.exp: Run non-native too.  Use ld_link,
    	not ld_simple_link.  Link using $CC.  Add -Wl,--no-as-needed
    	to some tests and prefix ld options with -Wl,.  Expect GNU
    	for hppa-linux even when no ifuncs.  Delete cleanup.
    	* testsuite/ld-pie/pie.exp: Run non-native too.
    	* testsuite/ld-plugin/lto.exp: Likewise.
    	* testsuite/ld-shared/shared.exp: Likewise.  Use ld_link,
    	not ld_simple_link.
    	(shared_test): Don't run exe if not native.
    	* testsuite/ld-size/size.exp: Run non-native too.  Add
    	-Wl,--no-as-needed to some tests.  Prefix ld options with -Wl,.
    	* testsuite/ld-unique/unique.exp: Run non-native too.  Use ld_link,
    	not ld_simple_link.  Link using $CC.  Add -Wl,--no-as-needed
    	to some tests and prefix ld options with -Wl,.  Expect GNU
    	for hppa-linux even when no unique syms.  Delete cleanup.
    	* testsuite/ld-x86-64/tls.exp: Add -Wl,--no-as-needed to some
    	tests and prefix ld options with -Wl,.
    	* testsuite/ld-x86-64/x86-64.exp: Use ld_link, not ld_simple_link.
    	Add -Wl,--no-as-needed to some tests.  Prefix ld options with -Wl,.

Diff:
---
 ld/ChangeLog                                | 113 ++++++++++
 ld/Makefile.am                              |  61 ------
 ld/Makefile.in                              |  61 ------
 ld/configure                                |  12 +-
 ld/configure.ac                             |   4 -
 ld/configure.host                           | 231 +-------------------
 ld/testsuite/config/default.exp             |  35 ---
 ld/testsuite/ld-bootstrap/bootstrap.exp     |  60 ++---
 ld/testsuite/ld-cdtest/cdtest.exp           |   4 +-
 ld/testsuite/ld-checks/checks.exp           |   4 +-
 ld/testsuite/ld-cygwin/exe-export.exp       |   2 +-
 ld/testsuite/ld-elf/audit.exp               |   5 -
 ld/testsuite/ld-elf/binutils.exp            |   2 +-
 ld/testsuite/ld-elf/compress.exp            |  17 +-
 ld/testsuite/ld-elf/dwarf.exp               |   9 +-
 ld/testsuite/ld-elf/eh-group.exp            |   2 +-
 ld/testsuite/ld-elf/elf.exp                 |  44 ++--
 ld/testsuite/ld-elf/exclude.exp             |  14 +-
 ld/testsuite/ld-elf/frame.exp               |   4 +-
 ld/testsuite/ld-elf/indirect.exp            |  37 ++--
 ld/testsuite/ld-elf/sec-to-seg.exp          |   2 +-
 ld/testsuite/ld-elf/shared.exp              | 325 ++++++++++++++--------------
 ld/testsuite/ld-elf/tls_common.exp          |   8 +-
 ld/testsuite/ld-elf/wrap.exp                |   9 +-
 ld/testsuite/ld-elfcomm/elfcomm.exp         |  10 +-
 ld/testsuite/ld-elfvers/vers.exp            |  12 +-
 ld/testsuite/ld-elfvsb/elfvsb.exp           |  27 ++-
 ld/testsuite/ld-elfweak/elfweak.exp         |  22 +-
 ld/testsuite/ld-fastcall/fastcall.exp       |   2 +-
 ld/testsuite/ld-gc/gc.exp                   |   8 +-
 ld/testsuite/ld-ifunc/binutils.exp          |   2 +-
 ld/testsuite/ld-ifunc/ifunc.exp             |  63 ++----
 ld/testsuite/ld-mep/mep.exp                 |   2 +-
 ld/testsuite/ld-mips-elf/mips-elf-flags.exp |   4 +-
 ld/testsuite/ld-mn10300/mn10300.exp         |   4 +-
 ld/testsuite/ld-nios2/nios2.exp             |   2 +-
 ld/testsuite/ld-pe/pe-compile.exp           |   4 +-
 ld/testsuite/ld-pe/pe-run.exp               |  12 +-
 ld/testsuite/ld-pe/pe-run2.exp              |  12 +-
 ld/testsuite/ld-pie/pie.exp                 |   9 +-
 ld/testsuite/ld-plugin/lto.exp              |   5 -
 ld/testsuite/ld-plugin/plugin.exp           |   2 +-
 ld/testsuite/ld-scripts/align.exp           |   2 +-
 ld/testsuite/ld-scripts/alignof.exp         |   2 +-
 ld/testsuite/ld-scripts/assert.exp          |   2 +-
 ld/testsuite/ld-scripts/defined.exp         |   2 +-
 ld/testsuite/ld-scripts/extern.exp          |   2 +-
 ld/testsuite/ld-scripts/log2.exp            |   2 +-
 ld/testsuite/ld-scripts/map-address.exp     |   2 +-
 ld/testsuite/ld-scripts/phdrs.exp           |   2 +-
 ld/testsuite/ld-scripts/phdrs2.exp          |   2 +-
 ld/testsuite/ld-scripts/script.exp          |   8 +-
 ld/testsuite/ld-scripts/section-flags.exp   |   2 +-
 ld/testsuite/ld-scripts/sizeof.exp          |   2 +-
 ld/testsuite/ld-scripts/sysroot-prefix.exp  |   2 +-
 ld/testsuite/ld-scripts/weak.exp            |   2 +-
 ld/testsuite/ld-selective/selective.exp     |   2 +-
 ld/testsuite/ld-sh/sh.exp                   |   8 +-
 ld/testsuite/ld-sh/sh64/relax.exp           |   2 +-
 ld/testsuite/ld-sh/sh64/relfail.exp         |   2 +-
 ld/testsuite/ld-shared/shared.exp           |  15 +-
 ld/testsuite/ld-size/size.exp               |  24 +-
 ld/testsuite/ld-srec/srec.exp               |   6 +-
 ld/testsuite/ld-tic6x/tic6x.exp             |  12 +-
 ld/testsuite/ld-undefined/weak-undef.exp    |   6 +-
 ld/testsuite/ld-unique/unique.exp           |  40 +---
 ld/testsuite/ld-versados/versados.exp       |   4 +-
 ld/testsuite/ld-x86-64/dwarfreloc.exp       |   4 +-
 ld/testsuite/ld-x86-64/tls.exp              |  12 +-
 ld/testsuite/ld-x86-64/x86-64.exp           |  48 ++--
 ld/testsuite/ld-xtensa/coalesce.exp         |   2 +-
 ld/testsuite/ld-xtensa/diff_overflow.exp    |   2 +-
 ld/testsuite/ld-xtensa/lcall.exp            |   2 +-
 ld/testsuite/lib/ld-lib.exp                 |  58 +----
 74 files changed, 596 insertions(+), 954 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 1fb60ed..c216229 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,118 @@
 2017-01-02  Alan Modra  <amodra@gmail.com>
 
+	* Makefile.am (bootstrap): Delete rule.
+	(ld-partial, ld1, ld1-full, ld2, ld3): Likewise.
+	(HOSTING_CRT0, HOSTING_SCRT0): Don't define.
+	(HOSTING_LIBS, HOSTING_SLIBS, HOSTING_EMU): Likewise.
+	* configure.ac (HOSTING_CRT0, HOSTING_SCRT0): Don't define.
+	(HOSTING_LIBS, HOSTING_SLIBS): Likewise.
+	* configure.host (HOSTING_CRT0, HOSTING_LIBS): Don't define.
+	* Makefile.in: Regenerate.
+	* configure: Regenerate.
+	* testsuite/config/default.exp (get_link_files): Delete.
+	(HOSTING_CRT0, HOSTING_SCRT0, HOSTING_LIBS, HOSTING_SLIBS): Don't
+	define.
+	(ld_simple_link): Delete.
+	* testsuite/lib/ld-lib.exp (default_ld_link): Delete
+	(default_ld_simple_link): Rename to default_ld_link.
+	(ld_simple_link_defsyms): Rename to ld_link_defsyms.
+	(run_ld_link_tests): Use ld_link, not ld_simple_link.
+	(run_cc_link_tests): Likewise.
+	(run_ld_link_exec_tests): Use $CC or $CXX to link, not $ld.
+	Don't run exe when not native, and return unsupported.
+	* testsuite/ld-bootstrap/bootstrap.exp: Create gccld1 etc. dirs.
+	Link ld1 etc. using $CC.
+	* testsuite/ld-cdtest/cdtest.exp: Link cdtest using $CC.
+	* testsuite/ld-checks/checks.exp: Use ld_link, not ld_simple_link.
+	* testsuite/ld-cygwin/exe-export.exp: Likewise.
+	* testsuite/ld-elf/binutils.exp: Likewise.
+	* testsuite/ld-elf/eh-group.exp: Likewise.
+	* testsuite/ld-elf/exclude.exp: Likewise.
+	* testsuite/ld-elf/frame.exp: Likewise.
+	* testsuite/ld-elf/sec-to-seg.exp: Likewise.
+	* testsuite/ld-elf/tls_common.exp: Likewise.
+	* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
+	* testsuite/ld-fastcall/fastcall.exp: Likewise.
+	* testsuite/ld-gc/gc.exp: Likewise.
+	* testsuite/ld-ifunc/binutils.exp: Likewise.
+	* testsuite/ld-mep/mep.exp: Likewise.
+	* testsuite/ld-mips-elf/mips-elf-flags.exp: Likewise.
+	* testsuite/ld-mn10300/mn10300.exp: Likewise.
+	* testsuite/ld-nios2/nios2.exp: Likewise.
+	* testsuite/ld-pe/pe-compile.exp: Likewise.
+	* testsuite/ld-pe/pe-run.exp: Likewise.
+	* testsuite/ld-pe/pe-run2.exp: Likewise.
+	* testsuite/ld-plugin/plugin.exp: Likewise.
+	* testsuite/ld-scripts/align.exp: Likewise.
+	* testsuite/ld-scripts/alignof.exp: Likewise.
+	* testsuite/ld-scripts/assert.exp: Likewise.
+	* testsuite/ld-scripts/defined.exp: Likewise.
+	* testsuite/ld-scripts/extern.exp: Likewise.
+	* testsuite/ld-scripts/log2.exp: Likewise.
+	* testsuite/ld-scripts/map-address.exp: Likewise.
+	* testsuite/ld-scripts/phdrs.exp: Likewise.
+	* testsuite/ld-scripts/phdrs2.exp: Likewise.
+	* testsuite/ld-scripts/script.exp: Likewise.
+	* testsuite/ld-scripts/section-flags.exp: Likewise.
+	* testsuite/ld-scripts/sizeof.exp: Likewise.
+	* testsuite/ld-scripts/sysroot-prefix.exp: Likewise.
+	* testsuite/ld-scripts/weak.exp: Likewise.
+	* testsuite/ld-selective/selective.exp: Likewise.
+	* testsuite/ld-sh/sh.exp: Likewise.
+	* testsuite/ld-sh/sh64/relax.exp: Likewise.
+	* testsuite/ld-sh/sh64/relfail.exp: Likewise.
+	* testsuite/ld-srec/srec.exp: Likewise.
+	* testsuite/ld-tic6x/tic6x.exp: Likewise.
+	* testsuite/ld-undefined/weak-undef.exp: Likewise.
+	* testsuite/ld-versados/versados.exp: Likewise.
+	* testsuite/ld-x86-64/dwarfreloc.exp: Likewise.
+	* testsuite/ld-xtensa/coalesce.exp: Likewise.
+	* testsuite/ld-xtensa/diff_overflow.exp: Likewise.
+	* testsuite/ld-xtensa/lcall.exp: Likewise.
+	* testsuite/ld-elf/audit.exp: Run non-native too.
+	* testsuite/ld-elf/compress.exp: Likewise.  Replace ld options with
+	gcc -Wl, options.
+	* testsuite/ld-elf/dwarf.exp: Run non-native too.  Use ld_link,
+	not ld_simple_link.  Add -Wl,--no-as-needed to some tests.
+	* testsuite/ld-elf/elf.exp: Run non-native too.  Formatting.
+	* testsuite/ld-elf/indirect.exp: Run non-native too.  Add
+	-Wl,--no-as-needed to most tests.
+	* testsuite/ld-elf/shared.exp: Run non-native too.  Use braces
+	to simplify quoting.  Set run_tests using [list] rather than
+	brace assignment to expand $extralibs.  Add -Wl,--no-as-needed
+	to many test.  Prefix ld options with -Wl,.
+	(mix_pic_and_non_pic): Don't run exe if not native.
+	* testsuite/ld-elf/wrap.exp: Run non-native too.  Add
+	-Wl,--no-as-needed and prefix ld options with -Wl,.
+	* testsuite/ld-elfvers/vers.exp: Run non-native too.  Use ld_link,
+	not ld_simple_link.
+	* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
+	(visibility_test): Don't run exe if not native.
+	* testsuite/ld-elfweak/elfweak.exp: Run non-native too.  Use ld_link,
+	not ld_simple_link.
+	(build_exec): Don't run exe if not native.
+	* testsuite/ld-ifunc/ifunc.exp: Run non-native too.  Use ld_link,
+	not ld_simple_link.  Link using $CC.  Add -Wl,--no-as-needed
+	to some tests and prefix ld options with -Wl,.  Expect GNU
+	for hppa-linux even when no ifuncs.  Delete cleanup.
+	* testsuite/ld-pie/pie.exp: Run non-native too.
+	* testsuite/ld-plugin/lto.exp: Likewise.
+	* testsuite/ld-shared/shared.exp: Likewise.  Use ld_link,
+	not ld_simple_link.
+	(shared_test): Don't run exe if not native.
+	* testsuite/ld-size/size.exp: Run non-native too.  Add
+	-Wl,--no-as-needed to some tests.  Prefix ld options with -Wl,.
+	* testsuite/ld-unique/unique.exp: Run non-native too.  Use ld_link,
+	not ld_simple_link.  Link using $CC.  Add -Wl,--no-as-needed
+	to some tests and prefix ld options with -Wl,.  Expect GNU
+	for hppa-linux even when no unique syms.  Delete cleanup.
+	* testsuite/ld-x86-64/tls.exp: Add -Wl,--no-as-needed to some
+	tests and prefix ld options with -Wl,.
+	* testsuite/ld-x86-64/x86-64.exp: Use ld_link, not ld_simple_link.
+	Add -Wl,--no-as-needed to some tests.  Prefix ld options with -Wl,.
+
+2017-01-02  Alan Modra  <amodra@gmail.com>
+
 	* emulparams/elf32metag.sh (COMMONPAGESIZE): Define.
 
 2017-01-02  Alan Modra  <amodra@gmail.com>
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 21e0aeb..3a3e34d 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -88,13 +88,6 @@ TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
 POD2MAN = pod2man --center="GNU Development Tools" \
 	--release="binutils-$(VERSION)" --section=1
 
-#stuff for self hosting (can be overridden in config file).
-HOSTING_CRT0 = @HOSTING_CRT0@
-HOSTING_SCRT0 = @HOSTING_SCRT0@
-HOSTING_LIBS = @HOSTING_LIBS@
-HOSTING_SLIBS = @HOSTING_SLIBS@
-HOSTING_EMU = -m $(EMUL)
-
 # Setup the testing framework, if you have one
 EXPECT = expect
 RUNTEST = runtest
@@ -2118,60 +2111,6 @@ check-DEJAGNU: site.exp
 	else echo "WARNING: could not find \`runtest'" 1>&2; :;\
 	fi
 
-# Rules for testing by relinking ld itself.
-# A similar test is in the testsuite.  This target is for ease of use
-# when porting ld.
-
-ld-partial.@OBJEXT@: ld-new$(EXEEXT)
-	./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld-partial.@OBJEXT@ -r $(OFILES)
-ld1$(EXEEXT): ld-partial.@OBJEXT@
-	./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.@OBJEXT@ $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld1-full$(EXEEXT): ld-new
-	./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld2$(EXEEXT): ld1$(EXEEXT)
-	./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld3$(EXEEXT): ld2$(EXEEXT)
-	./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-bootstrap: ld3$(EXEEXT)
-	cmp ld2$(EXEEXT) ld3$(EXEEXT)
-
-.PHONY: bootstrap
-
-# A test program for C++ constructors and destructors.
-# This test is now in the testsuite.
-#
-#cdtest: cdtest-main.@OBJEXT@ cdtest-bar.@OBJEXT@ cdtest-foo.@OBJEXT@ ld.new
-#	./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
-#	  cdtest-main.@OBJEXT@ cdtest-bar.@OBJEXT@ cdtest-foo.@OBJEXT@ $(HOSTING_LIBS)
-#
-#cdtest.out: cdtest
-#	./cdtest > cdtest.tmp
-#	mv cdtest.tmp cdtest.out
-#
-#cdtest-ur.@OBJEXT@: cdtest-main.@OBJEXT@ cdtest-bar.@OBJEXT@ cdtest-foo.@OBJEXT@ ld.new
-#	./ld.new $(HOSTING_EMU) -o cdtest-ur.@OBJEXT@ -Ur cdtest-main.@OBJEXT@ \
-#	  cdtest-bar.@OBJEXT@ cdtest-foo.@OBJEXT@
-#
-#cdtest-ur: cdtest-ur.@OBJEXT@
-#	./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.@OBJEXT@ \
-#	  $(HOSTING_LIBS)
-#
-#cdtest-ur.out: cdtest-ur
-#	./cdtest-ur > cdtest-ur.tmp
-#	mv cdtest-ur.tmp cdtest-ur.out
-#
-#check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
-#	diff $(srcdir)/cdtest.exp cdtest.out
-#	diff $(srcdir)/cdtest.exp cdtest-ur.out
-#
-#.PHONY: check-cdtest
-
-# END OF CHECK TARGETS
-
 #
 # Build a dummy plugin using libtool.
 #
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 80d97c1..9c5f77e 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -282,12 +282,6 @@ GENCAT = @GENCAT@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 HDEFINES = @HDEFINES@
-
-#stuff for self hosting (can be overridden in config file).
-HOSTING_CRT0 = @HOSTING_CRT0@
-HOSTING_LIBS = @HOSTING_LIBS@
-HOSTING_SCRT0 = @HOSTING_SCRT0@
-HOSTING_SLIBS = @HOSTING_SLIBS@
 INCINTL = @INCINTL@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -466,7 +460,6 @@ TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
 POD2MAN = pod2man --center="GNU Development Tools" \
 	--release="binutils-$(VERSION)" --section=1
 
-HOSTING_EMU = -m $(EMUL)
 
 # Setup the testing framework, if you have one
 EXPECT = expect
@@ -955,37 +948,6 @@ ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \
 
 ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
 
-# A test program for C++ constructors and destructors.
-# This test is now in the testsuite.
-#
-#cdtest: cdtest-main.@OBJEXT@ cdtest-bar.@OBJEXT@ cdtest-foo.@OBJEXT@ ld.new
-#	./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
-#	  cdtest-main.@OBJEXT@ cdtest-bar.@OBJEXT@ cdtest-foo.@OBJEXT@ $(HOSTING_LIBS)
-#
-#cdtest.out: cdtest
-#	./cdtest > cdtest.tmp
-#	mv cdtest.tmp cdtest.out
-#
-#cdtest-ur.@OBJEXT@: cdtest-main.@OBJEXT@ cdtest-bar.@OBJEXT@ cdtest-foo.@OBJEXT@ ld.new
-#	./ld.new $(HOSTING_EMU) -o cdtest-ur.@OBJEXT@ -Ur cdtest-main.@OBJEXT@ \
-#	  cdtest-bar.@OBJEXT@ cdtest-foo.@OBJEXT@
-#
-#cdtest-ur: cdtest-ur.@OBJEXT@
-#	./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.@OBJEXT@ \
-#	  $(HOSTING_LIBS)
-#
-#cdtest-ur.out: cdtest-ur
-#	./cdtest-ur > cdtest-ur.tmp
-#	mv cdtest-ur.tmp cdtest-ur.out
-#
-#check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
-#	diff $(srcdir)/cdtest.exp cdtest.out
-#	diff $(srcdir)/cdtest.exp cdtest-ur.out
-#
-#.PHONY: check-cdtest
-
-# END OF CHECK TARGETS
-
 #
 # Build a dummy plugin using libtool.
 #
@@ -3692,29 +3654,6 @@ check-DEJAGNU: site.exp
 	else echo "WARNING: could not find \`runtest'" 1>&2; :;\
 	fi
 
-# Rules for testing by relinking ld itself.
-# A similar test is in the testsuite.  This target is for ease of use
-# when porting ld.
-
-ld-partial.@OBJEXT@: ld-new$(EXEEXT)
-	./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld-partial.@OBJEXT@ -r $(OFILES)
-ld1$(EXEEXT): ld-partial.@OBJEXT@
-	./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.@OBJEXT@ $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld1-full$(EXEEXT): ld-new
-	./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld2$(EXEEXT): ld1$(EXEEXT)
-	./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld3$(EXEEXT): ld2$(EXEEXT)
-	./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-bootstrap: ld3$(EXEEXT)
-	cmp ld2$(EXEEXT) ld3$(EXEEXT)
-
-.PHONY: bootstrap
-
 # DOCUMENTATION TARGETS
 # Manual configuration file; not usually attached to normal configuration,
 # because almost all configs use "gen" version of manual.
diff --git a/ld/configure b/ld/configure
index b3cf784..c238f54 100755
--- a/ld/configure
+++ b/ld/configure
@@ -616,10 +616,6 @@ enable_initfini_array
 ENABLE_PLUGINS_FALSE
 ENABLE_PLUGINS_TRUE
 NATIVE_LIB_DIRS
-HOSTING_SLIBS
-HOSTING_LIBS
-HOSTING_SCRT0
-HOSTING_CRT0
 HDEFINES
 do_compare
 GENINSRC_NEVER_FALSE
@@ -11724,7 +11720,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11727 "configure"
+#line 11723 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11830,7 +11826,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11833 "configure"
+#line 11829 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16411,10 +16407,6 @@ do_compare="$gcc_cv_prog_cmp_skip"
 
 
 
-
-
-
-
 for ac_header in string.h strings.h stdlib.h unistd.h elf-hints.h limits.h locale.h sys/param.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
diff --git a/ld/configure.ac b/ld/configure.ac
index 36a9f50..fe8eff6 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -206,10 +206,6 @@ ACX_PROG_CMP_IGNORE_INITIAL
 . ${srcdir}/configure.host
 
 AC_SUBST(HDEFINES)
-AC_SUBST(HOSTING_CRT0)
-AC_SUBST(HOSTING_SCRT0)
-AC_SUBST(HOSTING_LIBS)
-AC_SUBST(HOSTING_SLIBS)
 AC_SUBST(NATIVE_LIB_DIRS)
 
 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h elf-hints.h limits.h locale.h sys/param.h)
diff --git a/ld/configure.host b/ld/configure.host
index 7632793..331ec0e 100644
--- a/ld/configure.host
+++ b/ld/configure.host
@@ -22,237 +22,10 @@
 
 # This file sets the following shell variables:
 #  HDEFINES		host specific compiler flags
-#  HOSTING_CRT0		crt0.o file used for bootstrapping
-#  HOSTING_LIBS		libraries used for bootstrapping
 
 HDEFINES=
-HOSTING_CRT0=/lib/crt0.o
-HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$$libgcc $$libgcc_eh"; fi; fi; if [ -f ../gcc/libunwind.a ]; then libgcc="$$libgcc ../gcc/libunwind.a"; else libunwind=\`${CC} -print-file-name=libunwind.a\`; if [ x"$$libunwind" != xlibunwind.a ]; then libgcc="$$libgcc $$libunwind"; fi; fi; echo --start-group $$libgcc -lc --end-group`'
-
-#
-#	Generic configurations:
-#
 
 case "${host}" in
-
-*-*-dragonfly*)
-  HOSTING_CRT0='-dynamic-linker `[ -f \`${CC} --print-prog-name=ld-elf.so.2\` ] || echo /usr/libexec/``${CC} --print-prog-name=ld-elf.so.2` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
-  HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
-  ;;
-
-*-*-freebsd* | *-*-kfreebsd*-gnu)
-  HOSTING_CRT0='-dynamic-linker `[ -f \`${CC} --print-prog-name=ld-elf.so.1\` ] || echo /usr/libexec/``${CC} --print-prog-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
-  HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
-  ;;
-
-*-*-linux*aout* | *-*-linux*oldld)
-  HOSTING_CRT0=/usr/lib/crt0.o
-  ;;
-
-*-*-linux*libc1*)
-  HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
-  HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
-  ;;
-
-*-*-linux*)
-  HOSTING_CRT0='-dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld[^ ]*\.so" | sed -e "s,.*-dynamic-linker[ 	][ 	]*\(.*/ld[^ ]*\.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
-  HOSTING_SCRT0='-dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld[^ ]*\.so" | sed -e "s,.*-dynamic-linker[ 	][ 	]*\(.*/ld[^ ]*\.so..\).*,\1,"` `${CC} --print-file-name=Scrt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbeginS.o ]; then echo ../gcc/crtbeginS.o; else ${CC} --print-file-name=crtbeginS.o; fi`'
-  HOSTING_SLIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtendS.o ]; then echo ../gcc/crtendS.o; else ${CC} --print-file-name=crtendS.o; fi` `${CC} --print-file-name=crtn.o`'
-  HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
-  ;;
-
-*-*-gnu*)
-  # When creating static executables, we ought to use crt0.o instead of crt1.o,
-  # <http://www.gnu.org/software/hurd/open_issues/binutils.html#static>,
-  # but the testing infrastructure is not prepared for that.  This is not
-  # relevant for most tests, and the few remaining ones have been XFAILed.
-  HOSTING_CRT0='-dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld[^ ]*\.so" | sed -e "s,.*-dynamic-linker[ 	][ 	]*\(.*/ld[^ ]*\.so[^ 	]*\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
-  HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
-  ;;
-
-*-*-netbsd*)
-  # Different versions of NetBSD with the ELF object format use different
-  # sets of start/end files.
-  HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o'
-  if [ -f `${CC} --print-file-name=crti.o` ]; then
-    # Support for GCC's crtstuff present.
-    HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crti.o`"
-    if [ -f ../gcc/crtbegin.o ]; then
-      HOSTING_CRT0="$HOSTING_CRT0 ../gcc/crtbegin.o"
-    else
-      HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`"
-    fi
-  else
-    # Support for GCC's crtstuff not present.
-    HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`"
-  fi
-  if [ -f `${CC} --print-file-name=crtn.o` ]; then
-    # Support for GCC's crtstuff present.
-    if [ -f ../gcc/crtbegin.o ]; then
-      HOSTING_LIBS="$HOSTING_LIBS ../gcc/crtend.o"
-    else
-      HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`"
-    fi
-    HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtn.o`"
-  else
-    # Support for GCC's crtstuff not present.
-    HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`"
-  fi
-  ;;
-
-*-*-openbsd*)
-  HOSTING_CRT0="-dynamic-linker /usr/libexec/ld.so /usr/lib/crt0.o"
-  HOSTING_CRT0="$HOSTING_CRT0 /usr/lib/crtbegin.o"
-  HOSTING_LIBS="$HOSTING_LIBS /usr/lib/crtend.o"
-  ;;
-
+     m88*-*-dgux*)
+	HDEFINES=-D__using_DGUX ;;
 esac
-
-#
-# Now more specific configurations
-#
-
-case "${host}" in
-
-*-*-linux*aout* | *-*-linux*oldld | *-*-linux*libc1*)
-  # No further tweaking needed
-  ;;
-
-arm*-*-linux-*)
-  HOSTING_CRT0='-p '"$HOSTING_CRT0"
-  ;;
-
-hppa*64*-*-hpux11*)
-  HOSTING_CRT0=/usr/ccs/lib/pa20_64/crt0.o
-  # Even if CC is not gcc, the tests use gcc.
-  HOSTING_LIBS='--start-group `if [ -f ../gcc/libgcc.a ]; then echo ../gcc/libgcc.a; else if test "$GCC" = yes; then ${CC} --print-libgcc-file-name; else gcc --print-libgcc-file-name; fi fi` -lc --end-group /usr/lib/pa20_64/milli.a'
-  ;;
-
-i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[12] | i[3-7]86-*-freebsd[12]\.* | i[3-7]86-*-freebsd*aout*)
-  HOSTING_CRT0=/usr/lib/crt0.o
-  ;;
-
-i[3-7]86-*-sysv4*)
-  HOSTING_CRT0='/usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
-  HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o'
-  ;;
-
-i[3-7]86-sequent-ptx* | i[3-7]86-sequent-sysv*)
-  HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
-  HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
-  ;;
-
-i[3-7]86-*-sysv*)
-  HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`'
-  HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o'
-  ;;
-
-i[3-7]86-*-solaris*)
-  HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
-  HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
-  ;;
-
-i[3-7]86-*-sco* | i[3-7]86-*-isc*)
-  # In some configurations gcc does not use crtbegin.o and crtend.o.
-  # In that case gcc -print-file-name=crtbegin.o will simply print
-  # crtbegin.o.  We create dummy crtbegin.o and crtend.o files to
-  # handle this.
-  echo "int dummy_crtbegin () { return 0; }" > crtbegin.c
-  ${CC} -c crtbegin.c -o crtbegin.o
-  rm -f crtbegin.c
-  echo "int dummy_crteng () { return 0; }" > crtend.c
-  ${CC} -c crtend.c -o crtend.o
-  rm -f crtend.c
-  HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
-  HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /lib/crtn.o'
-  ;;
-
-i[3-7]86-pc-interix*)
-  HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o'
-  HOSTING_LIBS='-L $$X/local_bin -L $$INTERIX_ROOT/usr/lib '"$HOSTING_LIBS"' -lcpsx -lc -lcpsx $$INTERIX_ROOT/usr/lib/psxdll.a $$INTERIX_ROOT/usr/lib/psxdll2.a'
-  ;;
-
-i[3-7]86-*-cygwin* | x86_64-*-cygwin*)
-  HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
-  ;;
-
-i[3-7]86-*-mingw*)
-  #We only support msvcrt.dll, crtid == 2.
-  HOSTING_CRT0='/mingw/lib/crt2.o'
-  HOSTING_LIBS='-L/mingw/lib -lmingw32 -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lmoldname -lmingwex -lmsvcrt `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
-  ;;
-
-mips*-sgi-irix4* | mips*-sgi-irix5*)
-  HOSTING_CRT0=/usr/lib/crt1.o
-  HOSTING_LIBS="$HOSTING_LIBS"' /usr/lib/crtn.o'
-  ;;
-
-mips*-sgi-irix6*)
-  HOSTING_CRT0='/usr/lib32/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o ; else ${CC} -print-file-name=crtbegin.o; fi`'
-  HOSTING_LIBS='-L/usr/lib32 '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o ; else ${CC} -print-file-name=crtend.o; fi` /usr/lib32/crtn.o -init __do_global_ctors -fini __do_global_dtors'
-  ;;
-
-m68*-motorola-sysv)
-  HOSTING_CRT0='`if [ -f ../gcc/crt0.o ]; then echo ../gcc/crt0.o; elif [ -f \`${CC} -print-file-name=\`crt0.o ]; then echo \`${CC} -print-file-name=\`crt0.o; else echo /lib/crt0.o; fi`'
-  HOSTING_LIBS=`sed -e 's,-lc,-lc881,' <<EOF
-$HOSTING_LIBS
-EOF`
-  ;;
-
-m68*-sun-*)
-  HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o'
-  ;;
-
-m88*-*-dgux*)
-  HDEFINES=-D__using_DGUX
-  HOSTING_CRT0='/lib/crt0.o -X'
-  HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a
-  ;;
-
-m88*-motorola-sysv3)
-  HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
-  HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
-  ;;
-
-sparc-*-solaris2*)
-  HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
-  HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
-  ;;
-
-sparc64-*-solaris2* | sparcv9-*-solaris2*)
-  HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/sparcv9/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
-  HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
-  ;;
-
-*-*-dragonfly*)
-  ;;
-
-*-*-freebsd* | *-*-kfreebsd*-gnu)
-  ;;
-
-*-*-linux* | *-*-gnu*)
-  ;;
-
-*-*-netbsd*)
-  ;;
-
-*-*-openbsd*)
-  ;;
-
-alpha*-*-*)
-  HOSTING_CRT0=/usr/ccs/lib/crt0.o
-  ;;
-
-esac
-
-# Provide default HOSTING_SCRT0.  Each host should define a proper one
-# if needed.
-if test -z "$HOSTING_SCRT0"; then
-  HOSTING_SCRT0="$HOSTING_CRT0"
-fi
-
-# Provide default HOSTING_SLIBS.  Each host should define a proper one
-# if needed.
-if test -z "$HOSTING_SLIBS"; then
-  HOSTING_SLIBS="$HOSTING_LIBS"
-fi
diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp
index 33cc19d..899943c 100644
--- a/ld/testsuite/config/default.exp
+++ b/ld/testsuite/config/default.exp
@@ -114,26 +114,6 @@ if { [istarget rx-*-*] } {
 # load the utility procedures
 load_lib ld-lib.exp
 
-proc get_link_files {varname} {
-    global $varname
-    global target_triplet
-    global srcdir
-    global CC
-    if ![info exists $varname] {
-	#configure.host returns variables that can be substituted into
-	#makefile rules, with embedded shell variable expansions.
-	#make wants $$shell_var, we want $shell_var ...
-	set cmd "host='$target_triplet' && . $srcdir/../configure.host && sed -e 's,\\\$\\\$,\$,g' <<EOF\n\$$varname\nEOF"
-	set status [catch "exec sh -c [list $cmd]" result]
-	if $status { error "Error getting native link files: $result" }
-	set cmd "CC='$CC' && eval echo \"$result\""
-	set status [catch "exec sh -c [list $cmd]" result]
-	if $status { error "Error getting native link files: $result" }
-	set $varname $result
-	send_log "$varname = $result\n"
-    }
-}
-
 proc get_target_emul {} {
     global target_triplet
     global srcdir
@@ -142,13 +122,6 @@ proc get_target_emul {} {
     return $result
 }
 
-if [isnative] {
-    foreach x {HOSTING_CRT0 HOSTING_SCRT0 HOSTING_LIBS HOSTING_SLIBS} {
-	get_link_files $x
-    }
-} else {
-    foreach x {HOSTING_CRT0 HOSTING_SCRT0 HOSTING_LIBS HOSTING_SLIBS} { set $x "" }
-}
 if ![info exists HOSTING_EMU] { set HOSTING_EMU "-m [get_target_emul]" }
 
 #
@@ -190,14 +163,6 @@ proc ld_link { ld target objects } {
 }
 
 #
-# ld_simple_link 
-#	link a program using ld, without including any libraries
-#
-proc ld_simple_link { ld target objects } {
-	default_ld_simple_link $ld $target $objects
-}
-
-#
 # ld_compile 
 #	compile an object using $cc
 #
diff --git a/ld/testsuite/ld-bootstrap/bootstrap.exp b/ld/testsuite/ld-bootstrap/bootstrap.exp
index 726b3fe..9a68ebe 100644
--- a/ld/testsuite/ld-bootstrap/bootstrap.exp
+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp
@@ -48,13 +48,25 @@ if [check_plugin_api_available] {
 # order to test -r.  Then link the result into an executable, ld1, to
 # really test -r.  Use ld1 to link a fresh ld, ld2.  Use ld2 to link a
 # new ld, ld3.  ld2 and ld3 should be identical.
-set test_flags {"" "strip" "--static" "--traditional-format"
-		"--no-keep-memory" "--relax"}
+set test_flags {"" "strip" "--static" "-Wl,--traditional-format"
+		"-Wl,--no-keep-memory" "-Wl,--relax"}
 if { [istarget "powerpc-*-*"] } {
-    lappend test_flags "--ppc476-workaround"
+    lappend test_flags "-Wl,--ppc476-workaround"
+}
+
+set gcc_B_opt_save $gcc_B_opt
+
+foreach ldexe {ld1 ld2 ld3} {
+    if {![file isdirectory tmpdir/gcc$ldexe]} then {
+	catch "exec mkdir tmpdir/gcc$ldexe" status
+	catch "exec ln -s ../$ldexe tmpdir/gcc$ldexe/ld" status
+	catch "exec ln -s ld tmpdir/gcc$ldexe/collect-ld" status
+	catch "exec ln -s ../../../gas/as-new tmpdir/gcc$ldexe/as" status
+    }
 }
 
 foreach flags $test_flags {
+    set gcc_B_opt $gcc_B_opt_save
     set do_strip "no"
     if {"$flags" == "strip"} { 
 	set testname "bootstrap with $flags"
@@ -67,8 +79,8 @@ foreach flags $test_flags {
     }}
 
     # --static is meaningless and --relax is incompatible with -r.
-    set partial_flags "$flags"
-    if { "$flags" == "--static" || "$flags" == "--relax" } {
+    regsub -- "-Wl," $flags "" partial_flags
+    if { "$partial_flags" == "--static" || "$partial_flags" == "--relax" } {
 	set partial_flags ""
     }
 
@@ -140,7 +152,7 @@ foreach flags $test_flags {
 	setup_xfail "mips*-*-irix5*"
     }
 
-    if ![ld_link $ld tmpdir/ld1 "$flags tmpdir/ld-partial.o $BFDLIB $LIBIBERTY $extralibs"] {
+    if ![ld_link $CC tmpdir/ld1 "$flags tmpdir/ld-partial.o $BFDLIB $LIBIBERTY $extralibs"] {
 	fail $testname
 	continue
     }
@@ -155,36 +167,27 @@ foreach flags $test_flags {
 	}
     }
 
-    if ![ld_link tmpdir/ld1 tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
+    regsub /tmpdir/ld/ $gcc_B_opt_save /tmpdir/gccld1/ gcc_B_opt
+    if ![ld_link $CC tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
 	fail $testname
 	continue
     }
 
-    if ![ld_link tmpdir/ld2 tmpdir/ld3 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
+    regsub /tmpdir/ld/ $gcc_B_opt_save /tmpdir/gccld2/ gcc_B_opt
+    if ![ld_link $CC tmpdir/ld3 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
 	fail $testname
 	continue
     }
 
-    if {"$flags" == "--static"} {
-	if { [istarget ia64-*-elf*]
-	     || [istarget ia64-*-linux*] } {
-	    # On ia64, tmpdir/ld2 != tmpdir/ld3 is normal since they are
-	    # generated by different linkers, tmpdir/ld1 and tmpdir/ld2.
-	    # So we rebuild tmpdir/ld2 with tmpdir/ld3.
-	    if ![ld_link tmpdir/ld3 tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
-		fail $testname
-		continue
-	    }
-	}
-    } else {
-	if { [istarget mips*-*-linux*] } {
-	    # On Linux/mips, tmpdir/ld2 != tmpdir/ld3 is normal since
-	    # they are generated by different linkers, tmpdir/ld1 and
-	    # tmpdir/ld2. So we rebuild tmpdir/ld2 with tmpdir/ld3.
-	    if ![ld_link tmpdir/ld3 tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
-		fail $testname
-		continue
-	    }
+    if { "$flags" == "--static" && { [istarget ia64-*-elf*] || [istarget ia64-*-linux*] }
+	 || [istarget mips*-*-linux*] } {
+	# On ia64 and mips, tmpdir/ld2 != tmpdir/ld3 is normal since they are
+	# generated by different linkers, tmpdir/ld1 and tmpdir/ld2.
+	# So we rebuild tmpdir/ld2 with tmpdir/ld3.
+	regsub /tmpdir/ld/ $gcc_B_opt_save /tmpdir/gccld3/ gcc_B_opt
+	if ![ld_link $CC tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
+	    fail $testname
+	    continue
 	}
     }
 
@@ -222,5 +225,6 @@ foreach flags $test_flags {
     }
 }
 
+set gcc_B_opt $gcc_B_opt_save
 catch "exec rm -f tmpdir/ld-partial.o tmpdir/ld1 tmpdir/ld2 tmpdir/ld3" status
 catch "exec rm -f tmpdir/ld2tail tmpdir/ld3tail" status
diff --git a/ld/testsuite/ld-cdtest/cdtest.exp b/ld/testsuite/ld-cdtest/cdtest.exp
index 31eb957..7920de5 100644
--- a/ld/testsuite/ld-cdtest/cdtest.exp
+++ b/ld/testsuite/ld-cdtest/cdtest.exp
@@ -48,7 +48,7 @@ if {   ![ld_compile "$CXX $CXXFLAGS -fno-exceptions" $srcdir/$subdir/cdtest-foo.
 
 set expected_output "$srcdir/$subdir/cdtest.dat"
 
-if ![ld_link $ld tmpdir/cdtest {tmpdir/cdtest-foo.o tmpdir/cdtest-bar.o tmpdir/cdtest-main.o}] {
+if ![ld_link $CC tmpdir/cdtest {tmpdir/cdtest-foo.o tmpdir/cdtest-bar.o tmpdir/cdtest-main.o}] {
     fail $test1
 } else {
     send_log   "tmpdir/cdtest >tmpdir/cdtest.out\n"
@@ -95,7 +95,7 @@ if ![ld_link $ld tmpdir/cdtest {tmpdir/cdtest-foo.o tmpdir/cdtest-bar.o tmpdir/c
 if ![ld_relocate $ld tmpdir/cdtest.o {-Ur tmpdir/cdtest-foo.o tmpdir/cdtest-bar.o tmpdir/cdtest-main.o}] {
     fail $test2
 } else {
-    if ![ld_link $ld tmpdir/cdtest tmpdir/cdtest.o] {
+    if ![ld_link $CC tmpdir/cdtest tmpdir/cdtest.o] {
 	fail $test2
     } else {
 	send_log   "tmpdir/cdtest >tmpdir/cdtest.out\n"
diff --git a/ld/testsuite/ld-checks/checks.exp b/ld/testsuite/ld-checks/checks.exp
index 9775b34..b1c8454 100644
--- a/ld/testsuite/ld-checks/checks.exp
+++ b/ld/testsuite/ld-checks/checks.exp
@@ -43,7 +43,7 @@ proc section_check {} {
 	return
     }
 
-    if ![ld_simple_link $ld tmpdir/asm.x "$ldflags tmpdir/asm.o"] {
+    if ![ld_link $ld tmpdir/asm.x "$ldflags tmpdir/asm.o"] {
 	fail $test
     } else {
 	pass $test
@@ -55,7 +55,7 @@ proc section_check {} {
     # script is used.
     set ldflags "--check-sections -T $srcdir/$subdir/script -e foo"
 
-    # Perform the equivalent of invoking ld_simple_link
+    # Perform the equivalent of invoking ld_link
     # except that we need to massage the output further.
 
     set exec_output [run_host_cmd "$ld" "-o tmpdir/asm.x $ldflags tmpdir/asm.o"]
diff --git a/ld/testsuite/ld-cygwin/exe-export.exp b/ld/testsuite/ld-cygwin/exe-export.exp
index 4643bac..f3bf275 100644
--- a/ld/testsuite/ld-cygwin/exe-export.exp
+++ b/ld/testsuite/ld-cygwin/exe-export.exp
@@ -63,7 +63,7 @@ proc run_dlltool { lib_file def_file } {
 }
 
 # ld_special_link
-#       A copy of ld_simple_link (from ld-lib.exp) with extra
+#       A copy of ld_link (from ld-lib.exp) with extra
 #       code to strip warnings about creating libraries.
 #
 proc ld_special_link { ld target objects } {
diff --git a/ld/testsuite/ld-elf/audit.exp b/ld/testsuite/ld-elf/audit.exp
index b278ec1..aad5339 100644
--- a/ld/testsuite/ld-elf/audit.exp
+++ b/ld/testsuite/ld-elf/audit.exp
@@ -25,11 +25,6 @@ if ![is_elf_format] {
     return
 }
 
-# The following tests require running the executable generated by ld.
-if ![isnative] {
-    return
-}
-
 # Check if compiler works
 if { [which $CC] == 0 } {
     return
diff --git a/ld/testsuite/ld-elf/binutils.exp b/ld/testsuite/ld-elf/binutils.exp
index 2a41bdf..61e6031 100644
--- a/ld/testsuite/ld-elf/binutils.exp
+++ b/ld/testsuite/ld-elf/binutils.exp
@@ -61,7 +61,7 @@ proc binutils_test { prog_name ld_options test {test_name ""} {readelf_options "
 	return
     }
 
-    if { ![ld_simple_link $ld tmpdir/$test "$ld_options -z stack-size=0 tmpdir/$test.o"] } {
+    if { ![ld_link $ld tmpdir/$test "$ld_options -z stack-size=0 tmpdir/$test.o"] } {
 	if { [string match "*not supported*" $link_output]
 	     || [string match "*unrecognized option*" $link_output]
 	     || [string match "*-z relro ignored*" $link_output] } {
diff --git a/ld/testsuite/ld-elf/compress.exp b/ld/testsuite/ld-elf/compress.exp
index a5c154f..b2b6ca1 100644
--- a/ld/testsuite/ld-elf/compress.exp
+++ b/ld/testsuite/ld-elf/compress.exp
@@ -25,11 +25,6 @@ if ![is_elf_format] {
     return
 }
 
-# The following tests require running the executable generated by ld.
-if ![isnative] {
-    return
-}
-
 # Check if compiler works
 if { [which $CC] == 0 } {
     return
@@ -92,22 +87,22 @@ set run_tests {
      "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o" ""
      {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"}
     {"Run zlibnormal with libzlibfoo.so with zlib compressed debug sections"
-     "tmpdir/begin.o tmpdir/libzlibfoo.so tmpdir/end.o --compress-debug-sections=zlib" ""
+     "tmpdir/begin.o tmpdir/libzlibfoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" ""
      {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib"}
     {"Run zlibnormal with libfoozlib.so with zlib compressed debug sections"
-     "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o --compress-debug-sections=zlib" ""
+     "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" ""
      {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib"}
     {"Run gnunormal with libgnufoo.so with zlib-gnu compressed debug sections"
-     "tmpdir/gnubegin.o tmpdir/libgnufoo.so tmpdir/end.o --compress-debug-sections=zlib-gnu" ""
+     "tmpdir/gnubegin.o tmpdir/libgnufoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" ""
      {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu"}
     {"Run gnunormal with libfoozlib.so with zlib-gnu compressed debug sections"
-     "tmpdir/gnubegin.o tmpdir/libfoozlib.so tmpdir/end.o --compress-debug-sections=zlib-gnu" ""
+     "tmpdir/gnubegin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" ""
      {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu"}
     {"Run gabinormal with libgabifoo.so with zlib-gabi compressed debug sections"
-     "tmpdir/zlibbegin.o tmpdir/libgabifoo.so tmpdir/gabiend.o --compress-debug-sections=zlib-gabi" ""
+     "tmpdir/zlibbegin.o tmpdir/libgabifoo.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" ""
      {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"}
     {"Run gabinormal with libfoozlib.so with zlib-gabi compressed debug sections"
-     "tmpdir/zlibbegin.o tmpdir/libfoozlib.so tmpdir/gabiend.o --compress-debug-sections=zlib-gabi" ""
+     "tmpdir/zlibbegin.o tmpdir/libfoozlib.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" ""
      {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"}
 }
 
diff --git a/ld/testsuite/ld-elf/dwarf.exp b/ld/testsuite/ld-elf/dwarf.exp
index 86b4896..572c704 100644
--- a/ld/testsuite/ld-elf/dwarf.exp
+++ b/ld/testsuite/ld-elf/dwarf.exp
@@ -29,11 +29,6 @@ if ![is_elf_format] {
     return
 }
 
-# The following tests require running the executable generated by ld.
-if ![isnative] {
-    return
-}
-
 # Check if compiler works
 if { [which $CC] == 0 } {
     return
@@ -52,7 +47,7 @@ set build_tests {
 
 set run_tests {
     {"Run with libdwarf1.so first"
-     "tmpdir/libdwarf1.so" ""
+     "-Wl,--no-as-needed tmpdir/libdwarf1.so" ""
      {dwarf1main.c} "dwarf1a" "dwarf1.out"
      "-g -feliminate-dwarf2-dups"}
     {"Run with libdwarf1.so last"
@@ -73,7 +68,7 @@ proc strip_test {} {
     set test_name "Strip -s $test"
     set prog $strip
 
-    if ![ld_simple_link $ld tmpdir/$test "-shared tmpdir/dwarf1.o"] {
+    if ![ld_link $ld tmpdir/$test "-shared tmpdir/dwarf1.o"] {
 	unresolved "$test_name"
 	return
     }
diff --git a/ld/testsuite/ld-elf/eh-group.exp b/ld/testsuite/ld-elf/eh-group.exp
index 17dd2f9..59f6092 100644
--- a/ld/testsuite/ld-elf/eh-group.exp
+++ b/ld/testsuite/ld-elf/eh-group.exp
@@ -65,7 +65,7 @@ set build_tests_ld [list			\
 run_ld_link_tests $build_tests_ld
 
 set testname "Link eh-group.o to eh-group"
-if [ld_simple_link $ld "tmpdir/eh-group" "-e _start tmpdir/eh-group.o"] {
+if [ld_link $ld "tmpdir/eh-group" "-e _start tmpdir/eh-group.o"] {
     pass $testname
 } else {
     fail $testname
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index e8b2d64..a5244e4 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -221,11 +221,6 @@ if { [istarget *-*-*linux*]
 
 set LDFLAGS $old_ldflags
 
-# The following tests require running the executable generated by ld.
-if ![isnative] {
-    return
-}
-
 if [check_gc_sections_available] {
     run_cc_link_tests {
 	{"PR ld/13195" "-Wl,--gc-sections" ""
@@ -234,23 +229,36 @@ if [check_gc_sections_available] {
 }
 
 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."}
+    {"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"}
+    {"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."}
+    {"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.
diff --git a/ld/testsuite/ld-elf/exclude.exp b/ld/testsuite/ld-elf/exclude.exp
index 438fd02..9b6dd2f 100644
--- a/ld/testsuite/ld-elf/exclude.exp
+++ b/ld/testsuite/ld-elf/exclude.exp
@@ -70,7 +70,7 @@ if {![string match "" $catch_output]} {
 
 # Test that the symbol is normally exported.
 
-if { [ld_simple_link $ld tmpdir/exclude.so "--shared tmpdir/exclude1.o -Ltmpdir -lexclude"] } {
+if { [ld_link $ld tmpdir/exclude.so "--shared tmpdir/exclude1.o -Ltmpdir -lexclude"] } {
     pass $test1
 } else {
     if [string match "*shared not supported*" $link_output] {
@@ -92,7 +92,7 @@ if ![ld_nm $nm "-D" tmpdir/exclude.so] {
 
 # Test --exclude-libs libexclude
 
-if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs libexclude --shared tmpdir/exclude1.o -Ltmpdir -lexclude"] } {
+if { [ld_link $ld tmpdir/exclude.so "--exclude-libs libexclude --shared tmpdir/exclude1.o -Ltmpdir -lexclude"] } {
     pass $test3
 } else {
     fail $test3
@@ -109,7 +109,7 @@ if ![ld_nm $nm "-D" tmpdir/exclude.so] {
 
 # Test alternate spellings of --exclude-libs
 
-if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs libexclude.a --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
+if { [ld_link $ld tmpdir/exclude.so "--exclude-libs libexclude.a --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
      && [ld_nm $nm "-D" tmpdir/exclude.so]
      && ! [info exists nm_output(exclude_common)]
      && ! [info exists nm_output(exclude_sym)] } {
@@ -118,7 +118,7 @@ if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs libexclude.a --shared
     fail $test5
 }
 
-if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs ALL --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
+if { [ld_link $ld tmpdir/exclude.so "--exclude-libs ALL --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
      && [ld_nm $nm "-D" tmpdir/exclude.so]
      && ! [info exists nm_output(exclude_common)]
      && ! [info exists nm_output(exclude_sym)] } {
@@ -127,7 +127,7 @@ if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs ALL --shared tmpdir/e
     fail $test6
 }
 
-if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs foo:libexclude.a --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
+if { [ld_link $ld tmpdir/exclude.so "--exclude-libs foo:libexclude.a --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
      && [ld_nm $nm "-D" tmpdir/exclude.so]
      && ! [info exists nm_output(exclude_common)]
      && ! [info exists nm_output(exclude_sym)] } {
@@ -136,7 +136,7 @@ if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs foo:libexclude.a --sh
     fail $test7
 }
 
-if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs foo,libexclude.a --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
+if { [ld_link $ld tmpdir/exclude.so "--exclude-libs foo,libexclude.a --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
      && [ld_nm $nm "-D" tmpdir/exclude.so]
      && ! [info exists nm_output(exclude_common)]
      && ! [info exists nm_output(exclude_sym)] } {
@@ -145,7 +145,7 @@ if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs foo,libexclude.a --sh
     fail $test8
 }
 
-if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs foo:bar --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
+if { [ld_link $ld tmpdir/exclude.so "--exclude-libs foo:bar --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
      && [ld_nm $nm "-D" tmpdir/exclude.so]
      && [info exists nm_output(exclude_common)]
      && [info exists nm_output(exclude_sym)] } {
diff --git a/ld/testsuite/ld-elf/frame.exp b/ld/testsuite/ld-elf/frame.exp
index 3363568..0ddd77e 100644
--- a/ld/testsuite/ld-elf/frame.exp
+++ b/ld/testsuite/ld-elf/frame.exp
@@ -64,7 +64,7 @@ if { ![ld_assemble_flags $as $as_opt $srcdir/$subdir/tbss.s tmpdir/tbss.o ]
     return
 }
 
-if { [ld_simple_link $ld tmpdir/frame.so "--shared tmpdir/frame.o tmpdir/tbss.o"] } {
+if { [ld_link $ld tmpdir/frame.so "--shared tmpdir/frame.o tmpdir/tbss.o"] } {
     pass "$test1"
 } else {
     if [string match "*shared not supported*" $link_output] {
@@ -79,7 +79,7 @@ if ![ld_assemble_flags $as $as_opt $srcdir/$subdir/table.s tmpdir/table.o ] {
     return
 }
 
-if { [ld_simple_link $ld tmpdir/table.so "--shared tmpdir/table.o tmpdir/tbss.o"] } {
+if { [ld_link $ld tmpdir/table.so "--shared tmpdir/table.o tmpdir/tbss.o"] } {
     pass "$test2"
 } else {
     if [string match "*shared not supported*" $link_output] {
diff --git a/ld/testsuite/ld-elf/indirect.exp b/ld/testsuite/ld-elf/indirect.exp
index a650505..5c5382c 100644
--- a/ld/testsuite/ld-elf/indirect.exp
+++ b/ld/testsuite/ld-elf/indirect.exp
@@ -126,59 +126,54 @@ set testname "Indirect symbol 2"
 set cmd "$ld -shared  -o tmpdir/indirect2.so tmpdir/indirect2.o"
 check_link_message "$cmd" [list $string2 $string] "$testname"
 
-# The following tests require running the executable generated by ld.
-if ![isnative] {
-    return
-}
-
 set run_tests {
     {"Run with libindirect3c.so 1"
-     "tmpdir/indirect3a.o tmpdir/indirect3b.o tmpdir/libindirect3c.so" ""
+     "-Wl,--no-as-needed tmpdir/indirect3a.o tmpdir/indirect3b.o tmpdir/libindirect3c.so" ""
      {dummy.c} "indirect3a" "indirect3.out"}
     {"Run with libindirect3c.so 2"
-     "tmpdir/indirect3a.o tmpdir/libindirect3c.so tmpdir/indirect3b.o" ""
+     "-Wl,--no-as-needed tmpdir/indirect3a.o tmpdir/libindirect3c.so tmpdir/indirect3b.o" ""
      {dummy.c} "indirect3b" "indirect3.out"}
     {"Run with libindirect3c.so 3"
-     "tmpdir/indirect3b.o tmpdir/libindirect3c.so tmpdir/indirect3a.o" ""
+     "-Wl,--no-as-needed tmpdir/indirect3b.o tmpdir/libindirect3c.so tmpdir/indirect3a.o" ""
      {dummy.c} "indirect3c" "indirect3.out"}
     {"Run with libindirect3c.so 4"
-     "tmpdir/libindirect3c.so tmpdir/indirect3b.o tmpdir/indirect3a.o" ""
+     "-Wl,--no-as-needed tmpdir/libindirect3c.so tmpdir/indirect3b.o tmpdir/indirect3a.o" ""
      {dummy.c} "indirect3d" "indirect3.out"}
     {"Run with libindirect4c.so 1"
-     "tmpdir/indirect4a.o tmpdir/indirect4b.o tmpdir/libindirect4c.so" ""
+     "-Wl,--no-as-needed tmpdir/indirect4a.o tmpdir/indirect4b.o tmpdir/libindirect4c.so" ""
      {dummy.c} "indirect4a" "indirect4.out"}
     {"Run with libindirect4c.so 2"
-     "tmpdir/indirect4a.o tmpdir/libindirect4c.so tmpdir/indirect4b.o" ""
+     "-Wl,--no-as-needed tmpdir/indirect4a.o tmpdir/libindirect4c.so tmpdir/indirect4b.o" ""
      {dummy.c} "indirect4b" "indirect4.out"}
     {"Run with libindirect4c.so 3"
-     "tmpdir/indirect4b.o tmpdir/libindirect4c.so tmpdir/indirect4a.o" ""
+     "-Wl,--no-as-needed tmpdir/indirect4b.o tmpdir/libindirect4c.so tmpdir/indirect4a.o" ""
      {dummy.c} "indirect4c" "indirect4.out"}
     {"Run with libindirect4c.so 4"
-     "tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" ""
+     "-Wl,--no-as-needed tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" ""
      {dummy.c} "indirect4d" "indirect4.out"}
     {"Run with libpr18720c.so 1"
-     "tmpdir/pr18720a.o tmpdir/pr18720b.o tmpdir/libpr18720c.so" ""
+     "-Wl,--no-as-needed tmpdir/pr18720a.o tmpdir/pr18720b.o tmpdir/libpr18720c.so" ""
      {check-ptr-eq.c} "pr18720a" "pr18720.out"}
     {"Run with libpr18720c.so 2"
-     "tmpdir/pr18720a.o tmpdir/libpr18720c.so tmpdir/pr18720b.o" ""
+     "-Wl,--no-as-needed tmpdir/pr18720a.o tmpdir/libpr18720c.so tmpdir/pr18720b.o" ""
      {check-ptr-eq.c} "pr18720b" "pr18720.out"}
     {"Run with libpr18720c.so 3"
-     "tmpdir/pr18720b.o tmpdir/libpr18720c.so tmpdir/pr18720a.o" ""
+     "-Wl,--no-as-needed tmpdir/pr18720b.o tmpdir/libpr18720c.so tmpdir/pr18720a.o" ""
      {check-ptr-eq.c} "pr18720c" "pr18720.out"}
     {"Run with libpr18720c.so 4"
-     "tmpdir/libpr18720c.so tmpdir/pr18720b.o tmpdir/pr18720a.o" ""
+     "-Wl,--no-as-needed tmpdir/libpr18720c.so tmpdir/pr18720b.o tmpdir/pr18720a.o" ""
      {check-ptr-eq.c} "pr18720d" "pr18720.out"}
     {"Run with libpr18720c.so 5"
-     "tmpdir/libpr18720c.so tmpdir/pr18720b1.o tmpdir/pr18720a.o" ""
+     "-Wl,--no-as-needed tmpdir/libpr18720c.so tmpdir/pr18720b1.o tmpdir/pr18720a.o" ""
      {check-ptr-eq.c} "pr18720d" "pr18720.out"}
     {"Run with libpr19553b.so"
-     "tmpdir/libpr19553b.so tmpdir/libpr19553d.so -rpath-link ." ""
+     "-Wl,--no-as-needed tmpdir/libpr19553b.so tmpdir/libpr19553d.so -Wl,-rpath-link,." ""
      {pr19553a.c} "pr19553b" "pr19553b.out"}
     {"Run with libpr19553c.so"
-     "tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" ""
+     "-Wl,--no-as-needed tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" ""
      {pr19553a.c} "pr19553c" "pr19553c.out"}
     {"Run with libpr19553d.so"
-     "tmpdir/libpr19553d.so tmpdir/libpr19553b.so -rpath-link ." ""
+     "-Wl,--no-as-needed tmpdir/libpr19553d.so tmpdir/libpr19553b.so -Wl,-rpath-link,." ""
      {pr19553a.c} "pr19553d" "pr19553d.out"}
 }
 
diff --git a/ld/testsuite/ld-elf/sec-to-seg.exp b/ld/testsuite/ld-elf/sec-to-seg.exp
index 05da6ef..5d86a32 100644
--- a/ld/testsuite/ld-elf/sec-to-seg.exp
+++ b/ld/testsuite/ld-elf/sec-to-seg.exp
@@ -40,7 +40,7 @@ proc sec_to_seg_test { testname scriptname same_seg } {
     global exec_output
     global READELF
     
-    if {! [ld_simple_link $ld tmpdir/sec-to-seg "-T $srcdir/$subdir/$scriptname tmpdir/sec-to-seg1.o tmpdir/sec-to-seg2.o"] } then {
+    if {! [ld_link $ld tmpdir/sec-to-seg "-T $srcdir/$subdir/$scriptname tmpdir/sec-to-seg1.o tmpdir/sec-to-seg2.o"] } then {
 	fail $testname
 	return 0
     }
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 3cdac45..52baadd 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -21,13 +21,6 @@
 
 # Exclude non-ELF targets.
 
-# The following tests require running the executable generated by ld,
-# or enough of a build environment to create a fully linked executable.
-# This is not commonly available when testing a cross-built linker.
-if ![isnative] {
-    return
-}
-
 if ![is_elf_format] {
     return
 }
@@ -38,6 +31,7 @@ if { [which $CC] == 0 } {
 }
 
 # Add -ldl to extralibs if needed
+set extralibs ""
 if { ![istarget *-*-freebsd*]} {
     set extralibs "-ldl"
 }
@@ -55,7 +49,7 @@ set build_tests {
   {"Build warn libbar.so"
    "-shared" "-fPIC"
    {beginwarn.c end.c} {{readelf {-S --wide} libbarw.rd}} "libbarw.so"
-    "C" "^.*\\\): warning: function foo is deprecated$"}
+   "c" {^.*\): warning: function foo is deprecated$} }
   {"Build hidden libbar.so"
    "-shared" "-fPIC"
    {begin.c endhidden.c} {} "libbarh.so"}
@@ -283,156 +277,156 @@ set build_tests {
 
 run_cc_link_tests $build_tests
 
-set run_tests {
-    {"Run normal with libfoo.so"
-     "tmpdir/begin.o tmpdir/libfoo.so tmpdir/end.o" ""
-     {main.c} "normal" "normal.out"}
-    {"Run protected with libfoo.so"
-     "tmpdir/begin.o tmpdir/libfoo.so tmpdir/endprotected.o" ""
-     {main.c} "protected" "normal.out"}
-    {"Run hidden with libfoo.so"
-     "tmpdir/begin.o tmpdir/libfoo.so tmpdir/endhidden.o" ""
-     {main.c} "hidden" "hidden.out"}
-    {"Run normal with versioned libfoo.so"
-     "tmpdir/begin.o tmpdir/libfoov.so tmpdir/end.o" ""
-     {main.c} "normalv" "normal.out"}
-    {"Run warn with versioned libfoo.so"
-     "tmpdir/beginwarn.o tmpdir/libfoov.so" ""
-     {main.c} "warn" "warn.out"
-     "" "" "^.*\\\): warning: function foo is deprecated$"}
-    {"Run protected with versioned libfoo.so"
-     "tmpdir/begin.o tmpdir/libfoov.so tmpdir/endprotected.o" ""
-     {main.c} "protected" "normal.out"}
-    {"Run hidden with versioned libfoo.so"
-     "tmpdir/begin.o tmpdir/libfoov.so tmpdir/endhidden.o" ""
-     {main.c} "hiddenv" "hidden.out"}
-    {"Run normal libbar.so with libfoo.so"
-     "tmpdir/libbarfoo.so tmpdir/libfoo.so" ""
-     {main.c} "normal" "normal.out"}
-    {"Run protected libbar.so with libfoo.so"
-     "tmpdir/libbarpfoo.so tmpdir/libfoo.so" ""
-     {main.c} "protected" "normal.out"}
-    {"Run hidden libbar.so with libfoo.so"
-     "tmpdir/libbarhfoo.so tmpdir/libfoo.so" ""
-     {main.c} "hidden" "hidden.out"}
-    {"Run normal libbar.so with versioned libfoo.so"
-     "tmpdir/libbarfoov.so tmpdir/libfoov.so" ""
-     {main.c} "normal" "normal.out"}
-    {"Run protected libbar.so with versioned libfoo.so"
-     "tmpdir/libbarpfoov.so tmpdir/libfoov.so" ""
-     {main.c} "protected" "normal.out"}
-    {"Run hidden libbar.so with versioned libfoo.so"
-     "tmpdir/libbarhfoov.so tmpdir/libfoov.so" ""
-     {main.c} "hidden" "hidden.out"}
-    {"Run dl1a with --dynamic-list=dl1.list and dlopen on libdl1.so"
-     "--dynamic-list=dl1.list $extralibs" ""
-     {dl1main.c} "dl1a" "dl1.out"}
-    {"Run dl1b with --dynamic-list-data and dlopen on libdl1.so"
-     "--dynamic-list-data $extralibs" ""
-     {dl1main.c} "dl1b" "dl1.out"}
-    {"Run with libdl2a.so"
-     "tmpdir/libdl2a.so" ""
-     {dl2main.c} "dl2a" "dl2a.out"}
-    {"Run with libdl2b.so"
-     "tmpdir/libdl2b.so" ""
-     {dl2main.c} "dl2b" "dl2b.out"}
-    {"Run with libdl2c.so"
-     "tmpdir/libdl2c.so" ""
-     {dl2main.c} "dl2c" "dl2b.out"}
-    {"Run with libdl4a.so"
-     "tmpdir/libdl4a.so" ""
-     {dl4main.c} "dl4a" "dl4a.out"}
-    {"Run with libdl4b.so"
-     "tmpdir/libdl4b.so" ""
-     {dl4main.c} "dl4b" "dl4a.out"}
-    {"Run with libdl4c.so"
-     "tmpdir/libdl4c.so" ""
-     {dl4main.c} "dl4c" "dl4b.out"}
-    {"Run with libdl4d.so"
-     "tmpdir/libdl4d.so" ""
-     {dl4main.c} "dl4d" "dl4b.out"}
-    {"Run with libdl4e.so"
-     "tmpdir/libdl4e.so" ""
-     {dl4main.c} "dl4e" "dl4a.out"}
-    {"Run with libdl4f.so"
-     "tmpdir/libdl4f.so" ""
-     {dl4main.c} "dl4f" "dl4a.out"}
-    {"Run dl6a1 with --dynamic-list-data and dlopen on libdl6a.so"
-     "--dynamic-list-data $extralibs" ""
-     {dl6amain.c} "dl6a1" "dl6a.out"}
-    {"Run dl6a2 with -Bsymbolic-functions and dlopen on libdl6a.so"
-     "-Bsymbolic-functions $extralibs" ""
-     {dl6amain.c} "dl6a2" "dl6b.out"}
-    {"Run dl6a3 with -Bsymbolic and dlopen on libdl6a.so"
-     "-Bsymbolic $extralibs" ""
-     {dl6amain.c} "dl6a3" "dl6b.out"}
-    {"Run dl6a4 with -Bsymbolic --dynamic-list-data and dlopen on libdl6a.so"
-     "-Bsymbolic --dynamic-list-data $extralibs" ""
-     {dl6amain.c} "dl6a4" "dl6a.out"}
-    {"Run dl6a5 with -Bsymbolic-functions --dynamic-list-cpp-new and dlopen on libdl6a.so"
-     "-Bsymbolic-functions --dynamic-list-cpp-new $extralibs" ""
-     {dl6amain.c} "dl6a5" "dl6b.out"}
-    {"Run dl6a6 with --dynamic-list-cpp-new -Bsymbolic-functions and dlopen on libdl6a.so"
-     "--dynamic-list-cpp-new -Bsymbolic-functions $extralibs" ""
-     {dl6amain.c} "dl6a6" "dl6b.out"}
-    {"Run dl6a7 with --dynamic-list-data -Bsymbolic and dlopen on libdl6a.so"
-     "--dynamic-list-data -Bsymbolic $extralibs" ""
-     {dl6amain.c} "dl6a7" "dl6a.out"}
-    {"Run dl6b1 with --dynamic-list-data and dlopen on libdl6b.so"
-     "--dynamic-list-data $extralibs" ""
-     {dl6bmain.c} "dl6b1" "dl6a.out"}
-    {"Run dl6b2 with dlopen on libdl6b.so"
-     "$extralibs" ""
-     {dl6bmain.c} "dl6b2" "dl6b.out"}
-    {"Run dl6c1 with --dynamic-list-data and dlopen on libdl6c.so"
-     "--dynamic-list-data $extralibs" ""
-     {dl6cmain.c} "dl6c1" "dl6b.out"}
-    {"Run dl6d1 with --dynamic-list-data and dlopen on libdl6d.so"
-     "--dynamic-list-data $extralibs" ""
-     {dl6dmain.c} "dl6d1" "dl6b.out"}
-    {"Run with libdata1.so"
-     "tmpdir/libdata1.so" ""
-     {dynbss1.c} "dynbss1" "pass.out"}
-    {"Run with libdata2.so"
-     "tmpdir/libdata2.so" ""
-     {weakdef1.c} "weakdef1" "pass.out"}
-    {"Run with libfunc1.so comm1.o"
-     "tmpdir/libfunc1.so tmpdir/comm1.o" ""
-     {dummy.c} "comm1" "pass.out"}
-    {"Run with comm1.o libfunc1.so"
-     "tmpdir/comm1.o tmpdir/libfunc1.so" ""
-     {dummy.c} "comm1" "pass.out"}
-    {"Run with pr11138-2.c libpr11138-1.so"
-     "--version-script=pr11138-2.map tmpdir/pr11138-2.o tmpdir/libpr11138-1.so" ""
-     {dummy.c} "pr11138a" "pr11138.out"}
-    {"Run with libpr11138-1.so pr11138-2.c"
-     "--version-script=pr11138-2.map tmpdir/libpr11138-1.so tmpdir/pr11138-2.o" ""
-     {dummy.c} "pr11138b" "pr11138.out"}
-    {"Run with pr13250-3.c, libpr13250-1.so and libpr13250-2.so"
-     "--as-needed tmpdir/pr13250-3.o tmpdir/libpr13250-1.so tmpdir/libpr13250-2.so" ""
-     {dummy.c} "pr13250" "pass.out"}
-    {"Run with pr14323-1.c pr14323-2.so"
-     "tmpdir/libpr14323-2.so" ""
-     {pr14323-1.c} "pr14323" "pass.out"}
-    {"Run with pr14862-1.c libpr14862.so"
-     "--as-needed tmpdir/libpr14862-1.o tmpdir/libpr14862.so" ""
-     {dummy.c} "pr14862" "pr14862.out"}
-    {"Link with --add-needed"
-     "tmpdir/libneeded1c.o --add-needed -rpath=tmpdir -Ltmpdir -lneeded1a" ""
-     {dummy.c} "needed1a" "needed1.out"}
-    {"Link with --copy-dt-needed-entries"
-     "tmpdir/libneeded1c.o --copy-dt-needed-entries -rpath=tmpdir -Ltmpdir -lneeded1a" ""
-     {dummy.c} "needed1b" "needed1.out"}
-    {"Run relmain"
-     "--no-as-needed -rpath=tmpdir -Ltmpdir -lrel" ""
-     {relmain.c} "relmain" "relmain.out"}
-    {"Run pr2404"
-     "tmpdir/pr2404b.o tmpdir/libpr2404a.so" ""
-     {dummy.c} "pr2404" "pr2404.out"}
-    {"Run pr18458"
-     "tmpdir/libpr18458a.so tmpdir/libpr18458b.so -z now" ""
-     {pr18458c.c} "pr18458" "pass.out"}
-}
+set run_tests [list \
+    [list "Run normal with libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/begin.o tmpdir/libfoo.so tmpdir/end.o" "" \
+     {main.c} "normal" "normal.out" ] \
+    [list "Run protected with libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/begin.o tmpdir/libfoo.so tmpdir/endprotected.o" "" \
+     {main.c} "protected" "normal.out" ] \
+    [list "Run hidden with libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/begin.o tmpdir/libfoo.so tmpdir/endhidden.o" "" \
+     {main.c} "hidden" "hidden.out" ] \
+    [list "Run normal with versioned libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/begin.o tmpdir/libfoov.so tmpdir/end.o" "" \
+     {main.c} "normalv" "normal.out" ] \
+    [list "Run warn with versioned libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/beginwarn.o tmpdir/libfoov.so" "" \
+     {main.c} "warn" "warn.out" \
+     "" "c" {^.*\): warning: function foo is deprecated$} ] \
+    [list "Run protected with versioned libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/begin.o tmpdir/libfoov.so tmpdir/endprotected.o" "" \
+     {main.c} "protected" "normal.out" ] \
+    [list "Run hidden with versioned libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/begin.o tmpdir/libfoov.so tmpdir/endhidden.o" "" \
+     {main.c} "hiddenv" "hidden.out" ] \
+    [list "Run normal libbar.so with libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/libbarfoo.so tmpdir/libfoo.so" "" \
+     {main.c} "normal" "normal.out" ] \
+    [list "Run protected libbar.so with libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/libbarpfoo.so tmpdir/libfoo.so" "" \
+     {main.c} "protected" "normal.out" ] \
+    [list "Run hidden libbar.so with libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/libbarhfoo.so tmpdir/libfoo.so" "" \
+     {main.c} "hidden" "hidden.out" ] \
+    [list "Run normal libbar.so with versioned libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/libbarfoov.so tmpdir/libfoov.so" "" \
+     {main.c} "normal" "normal.out" ] \
+    [list "Run protected libbar.so with versioned libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/libbarpfoov.so tmpdir/libfoov.so" "" \
+     {main.c} "protected" "normal.out" ] \
+    [list "Run hidden libbar.so with versioned libfoo.so" \
+     "-Wl,--no-as-needed tmpdir/libbarhfoov.so tmpdir/libfoov.so" "" \
+     {main.c} "hidden" "hidden.out" ] \
+    [list "Run dl1a with --dynamic-list=dl1.list and dlopen on libdl1.so" \
+     "-Wl,--no-as-needed,--dynamic-list=dl1.list $extralibs" "" \
+     {dl1main.c} "dl1a" "dl1.out" ] \
+    [list "Run dl1b with --dynamic-list-data and dlopen on libdl1.so" \
+     "-Wl,--no-as-needed,--dynamic-list-data $extralibs" "" \
+     {dl1main.c} "dl1b" "dl1.out" ] \
+    [list "Run with libdl2a.so" \
+     "-Wl,--no-as-needed tmpdir/libdl2a.so" "" \
+     {dl2main.c} "dl2a" "dl2a.out" ] \
+    [list "Run with libdl2b.so" \
+     "-Wl,--no-as-needed tmpdir/libdl2b.so" "" \
+     {dl2main.c} "dl2b" "dl2b.out" ] \
+    [list "Run with libdl2c.so" \
+     "-Wl,--no-as-needed tmpdir/libdl2c.so" "" \
+     {dl2main.c} "dl2c" "dl2b.out" ] \
+    [list "Run with libdl4a.so" \
+     "-Wl,--no-as-needed tmpdir/libdl4a.so" "" \
+     {dl4main.c} "dl4a" "dl4a.out" ] \
+    [list "Run with libdl4b.so" \
+     "-Wl,--no-as-needed tmpdir/libdl4b.so" "" \
+     {dl4main.c} "dl4b" "dl4a.out" ] \
+    [list "Run with libdl4c.so" \
+     "-Wl,--no-as-needed tmpdir/libdl4c.so" "" \
+     {dl4main.c} "dl4c" "dl4b.out" ] \
+    [list "Run with libdl4d.so" \
+     "-Wl,--no-as-needed tmpdir/libdl4d.so" "" \
+     {dl4main.c} "dl4d" "dl4b.out" ] \
+    [list "Run with libdl4e.so" \
+     "-Wl,--no-as-needed tmpdir/libdl4e.so" "" \
+     {dl4main.c} "dl4e" "dl4a.out" ] \
+    [list "Run with libdl4f.so" \
+     "-Wl,--no-as-needed tmpdir/libdl4f.so" "" \
+     {dl4main.c} "dl4f" "dl4a.out" ] \
+    [list "Run dl6a1 with --dynamic-list-data and dlopen on libdl6a.so" \
+     "-Wl,--no-as-needed,--dynamic-list-data $extralibs" "" \
+     {dl6amain.c} "dl6a1" "dl6a.out" ] \
+    [list "Run dl6a2 with -Bsymbolic-functions and dlopen on libdl6a.so" \
+     "-Wl,--no-as-needed,-Bsymbolic-functions $extralibs" "" \
+     {dl6amain.c} "dl6a2" "dl6b.out" ] \
+    [list "Run dl6a3 with -Bsymbolic and dlopen on libdl6a.so" \
+     "-Wl,--no-as-needed,-Bsymbolic $extralibs" "" \
+     {dl6amain.c} "dl6a3" "dl6b.out" ] \
+    [list "Run dl6a4 with -Bsymbolic --dynamic-list-data and dlopen on libdl6a.so" \
+     "-Wl,--no-as-needed,-Bsymbolic,--dynamic-list-data $extralibs" "" \
+     {dl6amain.c} "dl6a4" "dl6a.out" ] \
+    [list "Run dl6a5 with -Bsymbolic-functions --dynamic-list-cpp-new and dlopen on libdl6a.so" \
+     "-Wl,--no-as-needed,-Bsymbolic-functions,--dynamic-list-cpp-new $extralibs" "" \
+     {dl6amain.c} "dl6a5" "dl6b.out" ] \
+    [list "Run dl6a6 with --dynamic-list-cpp-new -Bsymbolic-functions and dlopen on libdl6a.so" \
+     "-Wl,--no-as-needed,--dynamic-list-cpp-new,-Bsymbolic-functions $extralibs" "" \
+     {dl6amain.c} "dl6a6" "dl6b.out" ] \
+    [list "Run dl6a7 with --dynamic-list-data -Bsymbolic and dlopen on libdl6a.so" \
+     "-Wl,--no-as-needed,--dynamic-list-data,-Bsymbolic $extralibs" "" \
+     {dl6amain.c} "dl6a7" "dl6a.out" ] \
+    [list "Run dl6b1 with --dynamic-list-data and dlopen on libdl6b.so" \
+     "-Wl,--no-as-needed,--dynamic-list-data $extralibs" "" \
+     {dl6bmain.c} "dl6b1" "dl6a.out" ] \
+    [list "Run dl6b2 with dlopen on libdl6b.so" \
+     "-Wl,--no-as-needed $extralibs" "" \
+     {dl6bmain.c} "dl6b2" "dl6b.out" ] \
+    [list "Run dl6c1 with --dynamic-list-data and dlopen on libdl6c.so" \
+     "-Wl,--no-as-needed,--dynamic-list-data $extralibs" "" \
+     {dl6cmain.c} "dl6c1" "dl6b.out" ] \
+    [list "Run dl6d1 with --dynamic-list-data and dlopen on libdl6d.so" \
+     "-Wl,--no-as-needed,--dynamic-list-data $extralibs" "" \
+     {dl6dmain.c} "dl6d1" "dl6b.out" ] \
+    [list "Run with libdata1.so" \
+     "-Wl,--no-as-needed tmpdir/libdata1.so" "" \
+     {dynbss1.c} "dynbss1" "pass.out" ] \
+    [list "Run with libdata2.so" \
+     "-Wl,--no-as-needed tmpdir/libdata2.so" "" \
+     {weakdef1.c} "weakdef1" "pass.out" ] \
+    [list "Run with libfunc1.so comm1.o" \
+     "-Wl,--no-as-needed tmpdir/libfunc1.so tmpdir/comm1.o" "" \
+     {dummy.c} "comm1" "pass.out" ] \
+    [list "Run with comm1.o libfunc1.so" \
+     "-Wl,--no-as-needed tmpdir/comm1.o tmpdir/libfunc1.so" "" \
+     {dummy.c} "comm1" "pass.out" ] \
+    [list "Run with pr11138-2.c libpr11138-1.so" \
+     "-Wl,--no-as-needed,--version-script=pr11138-2.map tmpdir/pr11138-2.o tmpdir/libpr11138-1.so" "" \
+     {dummy.c} "pr11138a" "pr11138.out" ] \
+    [list "Run with libpr11138-1.so pr11138-2.c" \
+     "-Wl,--no-as-needed,--version-script=pr11138-2.map tmpdir/libpr11138-1.so tmpdir/pr11138-2.o" "" \
+     {dummy.c} "pr11138b" "pr11138.out" ] \
+    [list "Run with pr13250-3.c, libpr13250-1.so and libpr13250-2.so" \
+     "-Wl,--as-needed tmpdir/pr13250-3.o tmpdir/libpr13250-1.so tmpdir/libpr13250-2.so" "" \
+     {dummy.c} "pr13250" "pass.out" ] \
+    [list "Run with pr14323-1.c pr14323-2.so" \
+     "-Wl,--no-as-needed tmpdir/libpr14323-2.so" "" \
+     {pr14323-1.c} "pr14323" "pass.out" ] \
+    [list "Run with pr14862-1.c libpr14862.so" \
+     "-Wl,--as-needed tmpdir/libpr14862-1.o tmpdir/libpr14862.so" "" \
+     {dummy.c} "pr14862" "pr14862.out" ] \
+    [list "Link with --add-needed" \
+     "tmpdir/libneeded1c.o -Wl,--no-as-needed,--add-needed,-rpath=tmpdir -Ltmpdir -lneeded1a" "" \
+     {dummy.c} "needed1a" "needed1.out" ] \
+    [list "Link with --copy-dt-needed-entries" \
+     "tmpdir/libneeded1c.o -Wl,--no-as-needed,--copy-dt-needed-entries,-rpath=tmpdir -Ltmpdir -lneeded1a" "" \
+     {dummy.c} "needed1b" "needed1.out" ] \
+    [list "Run relmain" \
+     "-Wl,--no-as-needed,-rpath=tmpdir -Ltmpdir -lrel" "" \
+     {relmain.c} "relmain" "relmain.out" ] \
+    [list "Run pr2404" \
+     "-Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404a.so" "" \
+     {dummy.c} "pr2404" "pr2404.out" ] \
+    [list "Run pr18458" \
+     "-Wl,--no-as-needed,-z,now tmpdir/libpr18458a.so tmpdir/libpr18458b.so" "" \
+     {pr18458c.c} "pr18458" "pass.out" ] \
+]
 
 # NetBSD ELF systems do not currently support the .*_array sections.
 run_ld_link_exec_tests $run_tests "*-*-netbsdelf*"
@@ -502,10 +496,10 @@ set run_cxx_tests {
      "-Wl,--no-as-needed tmpdir/libdl3c.so" ""
      {dl3main.cc} "dl3c" "dl3a.out" "" "c++"}
     {"Run with libnew1a.so"
-     "tmpdir/libnew1a.so" ""
+     "-Wl,--no-as-needed tmpdir/libnew1a.so" ""
      {dl5.cc} "dl5a" "dl5.out" "" "c++"}
     {"Run with libnew1b.so"
-     "tmpdir/libnew1b.so" ""
+     "-Wl,--no-as-needed tmpdir/libnew1b.so" ""
      {dl5.cc} "dl5b" "dl5.out" "" "c++"}
 }
 
@@ -543,7 +537,7 @@ if { [istarget *-*-linux*]
     run_ld_link_exec_tests [list \
 	[list \
 	    "Run pr2404 with PIE" \
-	    "-pie tmpdir/pr2404b.o tmpdir/libpr2404a.so" \
+	    "-pie -Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404a.so" \
 	    "" \
 	    { dummy.c } \
 	    "pr2404pie" \
@@ -597,7 +591,7 @@ if { [istarget *-*-linux*]
 	] \
 	[list \
 	    "Run pr19579" \
-	    "-pie -z text tmpdir/pr19579a.o tmpdir/libpr19579.so" \
+	    "-pie -Wl,--no-as-needed,-z,text tmpdir/pr19579a.o tmpdir/libpr19579.so" \
 	    "" \
 	    {dummy.c} \
 	    "pr19579" \
@@ -641,7 +635,7 @@ proc mix_pic_and_non_pic {xfails cflags ldflags exe} {
     run_ld_link_exec_tests [list \
 	[list \
 	    "Run $exe fun defined" \
-	    "$ldflags tmpdir/libpr19719b.o tmpdir/libpr19719.so -rpath tmpdir" \
+	    "-Wl,--no-as-needed,-rpath,tmpdir $ldflags tmpdir/libpr19719b.o tmpdir/libpr19719.so" \
 	    "" \
 	    { pr19719a.c pr19719c.c } \
 	    $exe \
@@ -657,6 +651,11 @@ proc mix_pic_and_non_pic {xfails cflags ldflags exe} {
 	setup_xfail $targ
     }
 
+    if ![isnative] {
+	unsupported "Run $exe fun undefined"
+	return
+    }
+
     set exec_output [run_host_cmd "tmpdir/$exe" ""]
     if {![string match "PASS" $exec_output]} {
 	fail "Run $exe fun undefined"
diff --git a/ld/testsuite/ld-elf/tls_common.exp b/ld/testsuite/ld-elf/tls_common.exp
index 7ebe016..b900312 100644
--- a/ld/testsuite/ld-elf/tls_common.exp
+++ b/ld/testsuite/ld-elf/tls_common.exp
@@ -47,13 +47,13 @@ if { ![ld_assemble $as "--elf-stt-common=no $srcdir/$subdir/tls_common.s" tmpdir
     return
 }
 
-if { ![ld_simple_link $ld tmpdir/tls_common1a.o "-r tmpdir/tls_commona.o"]
-     || ![ld_simple_link $ld tmpdir/tls_common1b.o "-r tmpdir/tls_commona.o"] } {
+if { ![ld_link $ld tmpdir/tls_common1a.o "-r tmpdir/tls_commona.o"]
+     || ![ld_link $ld tmpdir/tls_common1b.o "-r tmpdir/tls_commona.o"] } {
     fail "tls_common"
     return
 }
 
-if { ![ld_simple_link $ld tmpdir/tls_commona "tmpdir/tls_common1a.o"] } {
+if { ![ld_link $ld tmpdir/tls_commona "tmpdir/tls_common1a.o"] } {
     if { [string match "*not supported*" $link_output]
 	 || [string match "*unrecognized option*" $link_output] } {
 	unsupported "$ld_options is not supported by this target"
@@ -65,7 +65,7 @@ if { ![ld_simple_link $ld tmpdir/tls_commona "tmpdir/tls_common1a.o"] } {
     return
 }
 
-if { ![ld_simple_link $ld tmpdir/tls_commonb "tmpdir/tls_common1b.o"] } {
+if { ![ld_link $ld tmpdir/tls_commonb "tmpdir/tls_common1b.o"] } {
     if { [string match "*not supported*" $link_output]
 	 || [string match "*unrecognized option*" $link_output] } {
 	unsupported "$ld_options is not supported by this target"
diff --git a/ld/testsuite/ld-elf/wrap.exp b/ld/testsuite/ld-elf/wrap.exp
index be88ef6..4bf8faa 100644
--- a/ld/testsuite/ld-elf/wrap.exp
+++ b/ld/testsuite/ld-elf/wrap.exp
@@ -25,11 +25,6 @@ if ![is_elf_format] {
     return
 }
 
-# The following tests require running the executable generated by ld.
-if ![isnative] {
-    return
-}
-
 # Check if compiler works
 if { [which $CC] == 0 } {
     return
@@ -46,10 +41,10 @@ set build_tests {
 
 set run_tests {
     {"Run with libwrap1a.so and libwrap1b.so"
-     "--wrap par tmpdir/libwrap1a.so tmpdir/libwrap1b.so" ""
+     "-Wl,--no-as-needed,--wrap,par tmpdir/libwrap1a.so tmpdir/libwrap1b.so" ""
      {wrap1.c} "wrap1" "wrap1.out"}
     {"Run with libwrap1b.so and libwrap1a.so"
-     "--wrap par tmpdir/libwrap1b.so tmpdir/libwrap1a.so" ""
+     "-Wl,--no-as-needed,--wrap,par tmpdir/libwrap1b.so tmpdir/libwrap1a.so" ""
      {wrap1.c} "wrap1" "wrap1.out"}
 }
 
diff --git a/ld/testsuite/ld-elfcomm/elfcomm.exp b/ld/testsuite/ld-elfcomm/elfcomm.exp
index 860ce98..da33768 100644
--- a/ld/testsuite/ld-elfcomm/elfcomm.exp
+++ b/ld/testsuite/ld-elfcomm/elfcomm.exp
@@ -58,7 +58,7 @@ proc test_sort_common {} {
 	return 0
     }
 
-    if { ![ld_simple_link $ld tmpdir/sort-common.dx "--sort-common=descending tmpdir/sort-common.o"] } {
+    if { ![ld_link $ld tmpdir/sort-common.dx "--sort-common=descending tmpdir/sort-common.o"] } {
 	fail "$test"
 	return 0
     }
@@ -82,7 +82,7 @@ proc test_sort_common {} {
   
     verbose "Check to see that --sort-common=ascending sorts in ascending alignment"
 
-    if { ![ld_simple_link $ld tmpdir/sort-common.ax "--sort-common=ascending tmpdir/sort-common.o"] } {
+    if { ![ld_link $ld tmpdir/sort-common.ax "--sort-common=ascending tmpdir/sort-common.o"] } {
 	fail "$test"
 	return 0
     }
@@ -146,7 +146,7 @@ proc stt_common_test { options testname } {
 
     set options "$options tmpdir/common1c.o"
 
-    if { ! [ld_simple_link $ld tmpdir/common.exe $options] } {
+    if { ! [ld_link $ld tmpdir/common.exe $options] } {
       unresolved $testname
       return 0
     }
@@ -191,7 +191,7 @@ if [istarget sh64*-*-*] {
     }
 }
 
-if { [ld_simple_link $ld tmpdir/common1.o $options] } {
+if { [ld_link $ld tmpdir/common1.o $options] } {
     unresolved $test1w1
     return
 }
@@ -228,7 +228,7 @@ if [istarget sh64*-*-*] {
     }
 }
 
-if { [ld_simple_link $ld tmpdir/common1.o $options] } {
+if { [ld_link $ld tmpdir/common1.o $options] } {
     unresolved $test1w2
     return
 }
diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp
index 90f204f..bd35ae2 100644
--- a/ld/testsuite/ld-elfvers/vers.exp
+++ b/ld/testsuite/ld-elfvers/vers.exp
@@ -22,8 +22,10 @@
 
 #
 
-# This test can only be run if ld generates native executables.
-if ![isnative] then {return}
+# Check to see if the C compiler works
+if { [which $CC] == 0 } {
+    return
+}
 
 # This test can only be run on a couple of ELF platforms.
 # Square bracket expressions seem to confuse istarget.
@@ -544,7 +546,7 @@ proc build_binary { shared pic test source libname other mapfile verexp versymex
 	set script_arg "$script $srcdir/$subdir/$mapfile"
     }
 
-    if {![ld_simple_link $ld $tmpdir/$libname.so "$shared $tmpdir/$libname.o $other_lib $script_arg $ldargs"]}     {
+    if {![ld_link $ld $tmpdir/$libname.so "$shared $tmpdir/$libname.o $other_lib $script_arg $ldargs"]}     {
 	fail "$test"
 	return
     }
@@ -635,7 +637,7 @@ proc test_ldfail { test flag source execname other mapfile whyfail } {
 	set script_arg "-Wl,$script $srcdir/$subdir/$mapfile"
     }
 
-    if {![ld_simple_link $CC $tmpdir/$execname "$tmpdir/$execname.o $other_lib $script_arg"]}     {
+    if {![ld_link $CC $tmpdir/$execname "$tmpdir/$execname.o $other_lib $script_arg"]}     {
 	pass "$test"
 	return
     }
@@ -733,7 +735,7 @@ proc build_exec { test source execname flags solibname verexp versymexp symexp }
 	set solibname_lib $tmpdir/$solibname
     }
 
-    if {![ld_simple_link $CC $tmpdir/$execname "$flags $tmpdir/$execname.o $solibname_lib"]}     {
+    if {![ld_link $CC $tmpdir/$execname "$flags $tmpdir/$execname.o $solibname_lib"]}     {
 	fail "$test"
 	return
     }
diff --git a/ld/testsuite/ld-elfvsb/elfvsb.exp b/ld/testsuite/ld-elfvsb/elfvsb.exp
index 5331ad5..9d590c74 100644
--- a/ld/testsuite/ld-elfvsb/elfvsb.exp
+++ b/ld/testsuite/ld-elfvsb/elfvsb.exp
@@ -24,6 +24,11 @@
 
 # Make sure that ld can generate ELF shared libraries with visibility.
 
+# Check to see if the C compiler works
+if { [which $CC] == 0 } {
+    return
+}
+
 # This test can only be run on a couple of ELF platforms.
 # Square bracket expressions seem to confuse istarget.
 if { ![istarget hppa*64*-*-hpux*] \
@@ -56,9 +61,6 @@ foreach t $test_list {
     run_dump_test [file rootname $t]
 }
 
-# The remaining tests can only be run if ld generates native executables.
-if ![isnative] then {return}
-
 set tmpdir tmpdir
 set SHCFLAG ""
 set shared_needs_pic "no"
@@ -121,7 +123,7 @@ if { [istarget *-*-linux*]
      || [istarget *-*-nacl*]
      || [istarget *-*-gnu*] } {
     if [ld_compile "$CC -g $CFLAGS -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] {
-      if [ld_simple_link $CC $tmpdir/main "$tmpdir/main.o"] {
+      if [ld_link $CC $tmpdir/main "$tmpdir/main.o"] {
 	catch "exec $tmpdir/main" support_protected
       }
     }
@@ -145,7 +147,7 @@ proc visibility_test { visibility progname testname main sh1 sh2 dat args } {
     if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
 	set shared "-bM:SRE -bE:$tmpdir/xcoff.exp"
     }
-    if {![ld_simple_link $CC $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} {
+    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]
 	     && [regexp "undefined reference to \`visibility_var\'" $link_output] } {
@@ -168,7 +170,7 @@ proc visibility_test { visibility progname testname main sh1 sh2 dat args } {
     if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
 	set rpath /lib:$tmpdir
     }
-    if ![ld_simple_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] {
+    if ![ld_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] {
 	if { [ string match $visibility "hidden" ]
 	     && [regexp "undefined reference to \`\.?visibility\'" $link_output]
 	     && [regexp "undefined reference to \`visibility_var\'" $link_output] } {
@@ -191,6 +193,11 @@ proc visibility_test { visibility progname testname main sh1 sh2 dat args } {
 	fail "$testname"
     }
 
+    if ![isnative] {
+	unsupported "$testname"
+	return
+    }
+
     # Run the resulting program
     send_log "$tmpdir/$progname >$tmpdir/$progname.out\n"
     verbose "$tmpdir/$progname >$tmpdir/$progname.out"
@@ -502,7 +509,7 @@ visibility_run normal
 if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/common.c tmpdir/common.o] } {
     unresolved "common hidden symbol"
 } else {
-    if ![ld_simple_link $ld tmpdir/common "tmpdir/common.o"] {
+    if ![ld_link $ld tmpdir/common "tmpdir/common.o"] {
 	fail "common hidden symbol"
     } else {
 	pass "common hidden symbol"
@@ -515,15 +522,15 @@ if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/test.c tmpdir/test.o] } {
    if { ![ld_compile "$CC -g $CFLAGS -DSHARED $picflag" $srcdir/$subdir/sh3.c tmpdir/sh3.o] } {
 	unresolved "weak hidden symbol"
     } else {
-	if ![ld_simple_link $ld tmpdir/sh3.so "-shared tmpdir/sh3.o"] {
+	if ![ld_link $ld tmpdir/sh3.so "-shared tmpdir/sh3.o"] {
 	    fail "weak hidden symbol"
 	} else {
-	    if ![ld_simple_link $ld tmpdir/weak "tmpdir/test.o tmpdir/sh3.o"] {
+	    if ![ld_link $ld tmpdir/weak "tmpdir/test.o tmpdir/sh3.o"] {
 		fail "weak hidden symbol DSO last"
 	    } else {
 		pass "weak hidden symbol DSO last"
 	    }
-	    if ![ld_simple_link $ld tmpdir/weak "tmpdir/sh3.so tmpdir/test.o"] {
+	    if ![ld_link $ld tmpdir/weak "tmpdir/sh3.so tmpdir/test.o"] {
 		fail "weak hidden symbol DSO first"
 	    } else {
 		pass "weak hidden symbol DSO first"
diff --git a/ld/testsuite/ld-elfweak/elfweak.exp b/ld/testsuite/ld-elfweak/elfweak.exp
index 88df180..e62291e 100644
--- a/ld/testsuite/ld-elfweak/elfweak.exp
+++ b/ld/testsuite/ld-elfweak/elfweak.exp
@@ -22,8 +22,10 @@
 #	     Eric Youngdale (eric@andante.jic.com)
 #
 
-# This test can only be run if ld generates native executables.
-if ![isnative] then {return}
+# Check to see if the C compiler works
+if { [which $CC] == 0 } {
+    return
+}
 
 # This test can only be run on a couple of ELF platforms.
 # Square bracket expressions seem to confuse istarget.
@@ -290,7 +292,7 @@ proc build_lib {test libname objs dynsymexp} {
       set files "$files $tmpdir/$obj"
     }
 
-    if {![ld_simple_link $CC $tmpdir/$libname.so "$shared $files"]} {
+    if {![ld_link $CC $tmpdir/$libname.so "$shared $files"]} {
 	fail $test
 	return
     }
@@ -316,7 +318,7 @@ proc build_exec { test execname objs flags dat dynsymexp symexp} {
       set files "$files $tmpdir/$obj"
     }
 
-    if {![ld_simple_link $CC $tmpdir/$execname "$flags $files"]} {
+    if {![ld_link $CC $tmpdir/$execname "$flags $files"]} {
 	fail "$test"
 	return
     }
@@ -335,6 +337,10 @@ proc build_exec { test execname objs flags dat dynsymexp symexp} {
 	}
     }
 
+    if ![isnative] {
+	unsupported $test
+	return
+    }
     # Run the resulting program
     send_log "$tmpdir/$execname >$tmpdir/$execname.out\n"
     verbose "$tmpdir/$execname >$tmpdir/$execname.out"
@@ -402,7 +408,7 @@ if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main.c $tmpdir/main.o] {
     return
 }
 
-if {![ld_simple_link $CC $tmpdir/libbar.so "$shared $tmpdir/bar.o"]} {
+if {![ld_link $CC $tmpdir/libbar.so "$shared $tmpdir/bar.o"]} {
     fail "ELF weak"
     return
 }
@@ -437,17 +443,17 @@ if ![ld_compile "$CC $CFLAGS $picflag" $srcdir/$subdir/main1.c $tmpdir/main1.o]
     return
 }
 
-if {![ld_simple_link $CC $tmpdir/libfoo1a.so "$shared $tmpdir/foo1a.o"]} {
+if {![ld_link $CC $tmpdir/libfoo1a.so "$shared $tmpdir/foo1a.o"]} {
     fail "ELF weak"
     return
 }
 
-if {![ld_simple_link $CC $tmpdir/libfoo1b.so "$shared $tmpdir/foo1b.o"]} {
+if {![ld_link $CC $tmpdir/libfoo1b.so "$shared $tmpdir/foo1b.o"]} {
     fail "ELF weak"
     return
 }
 
-if {![ld_simple_link $CC $tmpdir/libbar1a.so "$shared $tmpdir/bar1a.o $tmpdir/libfoo1a.so"]} {
+if {![ld_link $CC $tmpdir/libbar1a.so "$shared $tmpdir/bar1a.o $tmpdir/libfoo1a.so"]} {
     fail "ELF weak"
     return
 }
diff --git a/ld/testsuite/ld-fastcall/fastcall.exp b/ld/testsuite/ld-fastcall/fastcall.exp
index d6184fa4..261a668 100644
--- a/ld/testsuite/ld-fastcall/fastcall.exp
+++ b/ld/testsuite/ld-fastcall/fastcall.exp
@@ -45,7 +45,7 @@ if ![ld_assemble $as $srcdir/$subdir/import.s tmpdir/import.o] {
     return
 }
 
-if ![ld_simple_link $ld tmpdir/extern.x "$ldflags tmpdir/export.o tmpdir/import.o"] {
+if ![ld_link $ld tmpdir/extern.x "$ldflags tmpdir/export.o tmpdir/import.o"] {
     fail $testname
 } else {
     pass $testname
diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp
index 0e7b8c0..ba4f70b 100644
--- a/ld/testsuite/ld-gc/gc.exp
+++ b/ld/testsuite/ld-gc/gc.exp
@@ -54,7 +54,7 @@ proc test_gc { testname filename linker ldflags} {
 
     set outfile "tmpdir/$filename"
     set options "-L$srcdir/$subdir"
-    append options " " $ldflags " " [ld_simple_link_defsyms] " " $objfile
+    append options " " $ldflags " " [ld_link_defsyms] " " $objfile
 
     # SH64 targets needs an extra ld option for this test.
     if [istarget sh64*-*-*] {
@@ -65,7 +65,7 @@ proc test_gc { testname filename linker ldflags} {
 	}
     }
 
-    if ![ld_simple_link $linker $outfile $options] {
+    if ![ld_link $linker $outfile $options] {
 	fail $testname
 	return
     }
@@ -112,7 +112,7 @@ if { [is_elf_format] && [check_shared_lib_support] } then {
 	set gasopt "-mpic -mpid=near"
     }
     if {![ld_assemble_flags $as $gasopt $srcdir/$subdir/libpersonality.s tmpdir/libpersonality.o]
-	|| ![ld_simple_link $ld tmpdir/libpersonality.so "-shared tmpdir/libpersonality.o"] } then {
+	|| ![ld_link $ld tmpdir/libpersonality.so "-shared tmpdir/libpersonality.o"] } then {
 	fail libpersonality
     } else {
 	run_dump_test "personality"
@@ -125,7 +125,7 @@ if { [is_remote host] || [which $CC] != 0 } {
 	 || [istarget "*-*-nacl*"]
 	 || [istarget "*-*-gnu*"] } {
 	ld_compile "$CC -fPIC $CFLAGS $cflags" $srcdir/$subdir/pr11218-1.c tmpdir/pr11218-1.o
-	ld_simple_link $ld tmpdir/pr11218-1.so "-shared tmpdir/pr11218-1.o"
+	ld_link $ld tmpdir/pr11218-1.so "-shared tmpdir/pr11218-1.o"
  	ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/pr11218-2.c tmpdir/pr11218-2.o
 	run_dump_test "pr11218"
     }
diff --git a/ld/testsuite/ld-ifunc/binutils.exp b/ld/testsuite/ld-ifunc/binutils.exp
index 0567c20..a02b71f 100644
--- a/ld/testsuite/ld-ifunc/binutils.exp
+++ b/ld/testsuite/ld-ifunc/binutils.exp
@@ -54,7 +54,7 @@ proc binutils_test { prog_name ld_options test } {
 	return
     }
 
-    if { ![ld_simple_link $ld tmpdir/$test "$ld_options tmpdir/$test.o"] } {
+    if { ![ld_link $ld tmpdir/$test "$ld_options tmpdir/$test.o"] } {
 	if { [string match "*not supported*" $link_output]
 	     || [string match "*unrecognized option*" $link_output] } {
 	    unsupported "$ld_options is not supported by this target"
diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp
index 0b488d0..d7519b5 100644
--- a/ld/testsuite/ld-ifunc/ifunc.exp
+++ b/ld/testsuite/ld-ifunc/ifunc.exp
@@ -41,15 +41,6 @@ if {!(([istarget "i?86-*-*"]
     return
 }
 
-# We need a native system.  FIXME: Strictly speaking this
-# is not true, we just need to know how to create a fully
-# linked executable, including the C and Z libraries, using
-# the linker that is under test.
-if ![isnative] {
-    verbose "IFUNC tests not run - not a native toolchain"
-    return
-}
-
 # We need a working compiler.  (Strictly speaking this is
 # not true, we could use target specific assembler files).
 if { [which $CC] == 0 } {
@@ -200,7 +191,7 @@ if { $fails != 0 } {
     return
 }
 
-if ![ld_simple_link $ld "tmpdir/libshared_ifunc.so" "-shared tmpdir/shared_ifunc.o"] {
+if ![ld_link $ld "tmpdir/libshared_ifunc.so" "-shared tmpdir/shared_ifunc.o"] {
     fail "Could not create a shared library containing an IFUNC symbol"
     set fails [expr $fails + 1]
 }
@@ -213,27 +204,27 @@ if { $fails != 0 } {
     return
 }
 
-if ![default_ld_link $ld "tmpdir/dynamic_prog" "-Ltmpdir tmpdir/shared_prog.o -Bdynamic -lshared_ifunc -rpath ./tmpdir"] {
+if ![ld_link $CC "tmpdir/dynamic_prog" "-Wl,--no-as-needed,-rpath=./tmpdir,-Bdynamic -Ltmpdir tmpdir/shared_prog.o -lshared_ifunc"] {
     fail "Could not link a dynamic executable"
     set fails [expr $fails + 1]
 }
-if ![default_ld_link $ld "tmpdir/local_prog" "-Ltmpdir tmpdir/static_prog.o -lifunc"] {
+if ![ld_link $CC "tmpdir/local_prog" "-Wl,--no-as-needed,-rpath=./tmpdir -Ltmpdir tmpdir/static_prog.o -lifunc"] {
     fail "Could not link a dynamic executable using local ifunc"
     set fails [expr $fails + 1]
 }
-if ![default_ld_link $ld "tmpdir/static_prog" "-static -Ltmpdir tmpdir/static_prog.o -lifunc"] {
+if ![ld_link $CC "tmpdir/static_prog" "-static -Ltmpdir tmpdir/static_prog.o -lifunc"] {
     fail "Could not link a static executable"
     set fails [expr $fails + 1]
 }
-if ![ld_simple_link $ld "tmpdir/static_nonifunc_prog" "-static tmpdir/empty.o"] {
+if ![ld_link $ld "tmpdir/static_nonifunc_prog" "-static tmpdir/empty.o"] {
     fail "Could not link a non-ifunc using static executable"
     set fails [expr $fails + 1]
 }
-if ![default_ld_link $ld "tmpdir/test-1" "tmpdir/test-1.o tmpdir/libshared_ifunc.so"] {
+if ![ld_link $CC "tmpdir/test-1" "-Wl,--no-as-needed,-rpath=./tmpdir tmpdir/test-1.o tmpdir/libshared_ifunc.so"] {
     fail "Could not link test-1"
     set fails [expr $fails + 1]
 }
-if ![ld_simple_link $ld "tmpdir/libtest-2.so" "-shared tmpdir/test-2.o"] {
+if ![ld_link $ld "tmpdir/libtest-2.so" "-shared tmpdir/test-2.o"] {
     fail "Could not link libtest-2.so"
     set fails [expr $fails + 1]
 }
@@ -251,6 +242,11 @@ if { $fails == 0 } {
 # ifunc should have an OSABI field of GNU.  The linked non-ifunc using
 # executable should have an OSABI field of NONE (aka System V).
 
+case $target_triplet in {
+    { hppa*-*-linux* } { set expected_none {UNIX - GNU} }
+    default { set expected_none {UNIX - System V} }
+}
+
 if {! [check_osabi tmpdir/libshared_ifunc.so {UNIX - GNU}]} {
     fail "Shared libraries containing ifunc does not have an OS/ABI field of GNU"
     set fails [expr $fails + 1]
@@ -263,12 +259,12 @@ if {! [check_osabi tmpdir/static_prog {UNIX - GNU}]} {
     fail "Static ifunc-using executable does not have an OS/ABI field of GNU"
     set fails [expr $fails + 1]
 }
-if {! [check_osabi tmpdir/dynamic_prog {UNIX - System V}]} {
-    fail "Dynamic ifunc-using executable does not have an OS/ABI field of System V"
+if {! [check_osabi tmpdir/dynamic_prog $expected_none]} {
+    fail "Dynamic ifunc-using executable does not have an OS/ABI field of $expected_none"
     set fails [expr $fails + 1]
 }
-if {! [check_osabi tmpdir/static_nonifunc_prog {UNIX - System V}]} {
-    fail "Static non-ifunc-using executable does not have an OS/ABI field of System V"
+if {! [check_osabi tmpdir/static_nonifunc_prog $expected_none]} {
+    fail "Static non-ifunc-using executable does not have an OS/ABI field of $expected_none"
     set fails [expr $fails + 1]
 }
 
@@ -335,21 +331,6 @@ if { $fails == 0 } {
   pass "Checking ifunc binaries"
 }
 
-# Clean up, unless we are being verbose, in which case we leave the files available.
-if { $verbose < 1 } {
-    remote_file host delete "tmpdir/shared_prog.o"
-    remote_file host delete "tmpdir/static_prog.o"
-    remote_file host delete "tmpdir/shared_ifunc.o"
-    remote_file host delete "tmpdir/static_ifunc.o"
-    remote_file host delete "tmpdir/static_noifunc.o"
-    remote_file host delete "tmpdir/libshared_ifunc.so"
-    remote_file host delete "tmpdir/libifunc.a"
-    remote_file host delete "tmpdir/dynamic_prog"
-    remote_file host delete "tmpdir/local_prog"
-    remote_file host delete "tmpdir/static_prog"
-    remote_file host delete "tmpdir/static_nonifunc_prog"
-}
-
 run_cc_link_tests [list \
     [list \
 	"Build libpr16467a.so" \
@@ -433,7 +414,7 @@ run_cc_link_tests [list \
 run_ld_link_exec_tests [list \
     [list \
 	"Run pr16467" \
-	"tmpdir/pr16467c.o tmpdir/libpr16467b.so tmpdir/libpr16467a.so" \
+	"-Wl,--no-as-needed tmpdir/pr16467c.o tmpdir/libpr16467b.so tmpdir/libpr16467a.so" \
 	"" \
 	{ dummy.c } \
 	"pr16467" \
@@ -442,7 +423,7 @@ run_ld_link_exec_tests [list \
     ] \
     [list \
 	"Run ifunc-main" \
-	"tmpdir/libifunc-lib.so" \
+	"-Wl,--no-as-needed tmpdir/libifunc-lib.so" \
 	"" \
 	{ ifunc-main.c } \
 	"ifunc-main" \
@@ -450,7 +431,7 @@ run_ld_link_exec_tests [list \
     ] \
     [list \
 	"Run ifunc-main with -fpic" \
-	"tmpdir/libifunc-lib.so" \
+	"-Wl,--no-as-needed tmpdir/libifunc-lib.so" \
 	"" \
 	{ ifunc-main.c } \
 	"ifunc-main" \
@@ -510,7 +491,7 @@ run_cc_link_tests [list \
 run_ld_link_exec_tests [list \
     [list \
 	"Run pr18808" \
-	"tmpdir/pr18808a.o tmpdir/libpr18808.so" \
+	"-Wl,--no-as-needed tmpdir/pr18808a.o tmpdir/libpr18808.so" \
 	"" \
 	{ dummy.c } \
 	"pr18808" \
@@ -518,7 +499,7 @@ run_ld_link_exec_tests [list \
     ] \
     [list \
 	"Run pr18841 with libpr18841b.so" \
-	"tmpdir/pr18841a.o tmpdir/libpr18841b.so" \
+	"-Wl,--no-as-needed tmpdir/pr18841a.o tmpdir/libpr18841b.so" \
 	"" \
 	{ dummy.c } \
 	"pr18841b" \
@@ -526,7 +507,7 @@ run_ld_link_exec_tests [list \
     ] \
     [list \
 	"Run pr18841 with libpr18841c.so" \
-	"--as-needed tmpdir/pr18841a.o tmpdir/libpr18841c.so" \
+	"-Wl,--as-needed tmpdir/pr18841a.o tmpdir/libpr18841c.so" \
 	"" \
 	{ dummy.c } \
 	"pr18841c" \
diff --git a/ld/testsuite/ld-mep/mep.exp b/ld/testsuite/ld-mep/mep.exp
index 4b8e3a9..d6df072 100644
--- a/ld/testsuite/ld-mep/mep.exp
+++ b/ld/testsuite/ld-mep/mep.exp
@@ -31,7 +31,7 @@ set testbsrweak "MeP bsr to undefined weak function"
 
 if ![ld_assemble $as "$srcdir/$subdir/mep1.s" tmpdir/mep1.o] {
     unresolved $testbsrweak
-} else { if ![ld_simple_link $ld tmpdir/mep1 "-T$srcdir/$subdir/mep1.ld tmpdir/mep1.o"] {
+} else { if ![ld_link $ld tmpdir/mep1 "-T$srcdir/$subdir/mep1.ld tmpdir/mep1.o"] {
     fail $testbsrweak
 } else {
     pass $testbsrweak
diff --git a/ld/testsuite/ld-mips-elf/mips-elf-flags.exp b/ld/testsuite/ld-mips-elf/mips-elf-flags.exp
index 80f218f..dd84c9c 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf-flags.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf-flags.exp
@@ -67,7 +67,7 @@ proc good_combination {arglist flags} {
 
     if {$objs == ""} {
 	unresolved $testname
-    } elseif {![ld_simple_link "$ld $ldemul" $finalobj "-r $objs"]} {
+    } elseif {![ld_link "$ld $ldemul" $finalobj "-r $objs"]} {
 	fail $testname
     } else {
 	catch "exec $READELF --headers $finalobj" output
@@ -106,7 +106,7 @@ proc bad_combination {arglist message} {
 
     if {$objs == ""} {
 	unresolved $testname
-    } elseif {[ld_simple_link "$ld $ldemul" $finalobj "-r $objs"]
+    } elseif {[ld_link "$ld $ldemul" $finalobj "-r $objs"]
 	      || [string first $message $link_output] < 0} {
 	fail $testname
     } else {
diff --git a/ld/testsuite/ld-mn10300/mn10300.exp b/ld/testsuite/ld-mn10300/mn10300.exp
index 98c77cd..503dd77 100644
--- a/ld/testsuite/ld-mn10300/mn10300.exp
+++ b/ld/testsuite/ld-mn10300/mn10300.exp
@@ -147,12 +147,12 @@ proc i126256-test { } {
     	return
     }
     
-    if { ![ld_simple_link $ld $tmpdir/i126256-1.so "-shared $tmpdir/i126256-1.o -e 0"]} {
+    if { ![ld_link $ld $tmpdir/i126256-1.so "-shared $tmpdir/i126256-1.o -e 0"]} {
         unresolved $testname
     	return
     }
 
-    if { ![ld_simple_link $ld $tmpdir/i126256-2.so "--relax -shared $tmpdir/i126256-2.o $tmpdir/i126256-1.so -e 0"]} {
+    if { ![ld_link $ld $tmpdir/i126256-2.so "--relax -shared $tmpdir/i126256-2.o $tmpdir/i126256-1.so -e 0"]} {
         fail $testname
     	return
     }
diff --git a/ld/testsuite/ld-nios2/nios2.exp b/ld/testsuite/ld-nios2/nios2.exp
index b8ffd49..b712e9e 100644
--- a/ld/testsuite/ld-nios2/nios2.exp
+++ b/ld/testsuite/ld-nios2/nios2.exp
@@ -22,7 +22,7 @@ if ![ld_assemble $as "-march=r2 $srcdir/$subdir/${test}b.s" tmpdir/${test}b.o] {
     return
 }
 
-if { ![ld_simple_link $ld tmpdir/$test "tmpdir/${test}a.o tmpdir/${test}b.o"] } {
+if { ![ld_link $ld tmpdir/$test "tmpdir/${test}a.o tmpdir/${test}b.o"] } {
     if [string match "*architecture * is incompatible*" $link_output] {
 	pass "$test_name"
     } {
diff --git a/ld/testsuite/ld-pe/pe-compile.exp b/ld/testsuite/ld-pe/pe-compile.exp
index 67a63e2..f29e5cf 100644
--- a/ld/testsuite/ld-pe/pe-compile.exp
+++ b/ld/testsuite/ld-pe/pe-compile.exp
@@ -52,7 +52,7 @@ proc run_basefile_test { testname } {
     global subdir
     global verbose
 
-    if ![ld_simple_link "$LD -e start \
+    if ![ld_link "$LD -e start \
 	    --base-file=tmpdir/$testname.base \
 	    --export-all-symbols" tmpdir/$testname.dll \
 	    "tmpdir/basefile1.o"] {
@@ -92,7 +92,7 @@ proc run_ver_script_test { testname } {
     global subdir
     global verbose
 
-    if ![ld_simple_link "$CC -shared \
+    if ![ld_link "$CC -shared \
 	    -Wl,--version-script,$srcdir/$subdir/$testname.ver \
 	    -Wl,--output-def,tmpdir/$testname.def" tmpdir/$testname.dll \
 	    "tmpdir/vers-script-dll.o"] {
diff --git a/ld/testsuite/ld-pe/pe-run.exp b/ld/testsuite/ld-pe/pe-run.exp
index 3fda17c..9fa6848 100644
--- a/ld/testsuite/ld-pe/pe-run.exp
+++ b/ld/testsuite/ld-pe/pe-run.exp
@@ -71,9 +71,9 @@ proc test_direct_link_dll {} {
     # Compile the dll.
     if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/direct_dll.c $tmpdir/direct_dll.o ] {
 	fail "compiling shared lib"
-    } elseif ![ld_simple_link "$CC -shared" $tmpdir/direct_dll.dll "$tmpdir/direct_dll.o" ] {
+    } elseif ![ld_link "$CC -shared" $tmpdir/direct_dll.dll "$tmpdir/direct_dll.o" ] {
 	fail "linking shared lib (.dll)"
-    } elseif ![ld_simple_link "$CC -shared" $tmpdir/direct_dll.sl "$tmpdir/direct_dll.o" ] {
+    } elseif ![ld_link "$CC -shared" $tmpdir/direct_dll.sl "$tmpdir/direct_dll.o" ] {
 	fail "linking shared lib (.sl)"
     } else {
 	# Compile and link the client program.
@@ -82,7 +82,7 @@ proc test_direct_link_dll {} {
 	} else {
 	    # Check linking directly to direct_dll.dll.
 	    set msg "linking client (.dll)"
-	    if [ld_simple_link "$CC -Wl,--enable-auto-import" $tmpdir/direct_client_dll.exe \
+	    if [ld_link "$CC -Wl,--enable-auto-import" $tmpdir/direct_client_dll.exe \
 	      "$tmpdir/direct_client.o $tmpdir/direct_dll.dll" ] {
 		pass $msg
 	    } else {
@@ -91,7 +[...]

[diff truncated at 100000 bytes]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]