[binutils-gdb] Remove m68k-aout and m68k-coff support

Alan Modra amodra@sourceware.org
Mon Apr 16 06:28:00 GMT 2018


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

commit dc12032bca08554cf0a72d224e44f755f7789ff3
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Apr 16 15:31:36 2018 +0930

    Remove m68k-aout and m68k-coff support
    
    include/
    	* aout/host.h: Remove m68k-aout and m68k-coff support.
    	* aout/hp300hpux.h: Delete.
    	* coff/apollo.h: Delete.
    	* coff/aux-coff.h: Delete.
    	* coff/m68k.h: Delete.
    bfd/
    	* Makefile.am: Remove m68k-aout and m68k-coff support.
    	* aoutf1.h: Likewise.
    	* aoutx.h: Likewise.
    	* archive.c: Likewise.
    	* bfd-in.h: Likewise.
    	* bfd.c: Likewise.
    	* coffcode.h: Likewise.
    	* coffswap.h: Likewise.
    	* config.bfd: Likewise.
    	* configure.ac: Likewise.
    	* configure.host: Likewise.
    	* doc/bfd.texinfo: Likewise.
    	* doc/bfdint.texi: Likewise.
    	* freebsd.h: Likewise.
    	* gen-aout.c: Likewise.
    	* hpux-core.c: Likewise.
    	* libaout.h: Likewise.
    	* libbfd-in.h: Likewise.
    	* pdp11.c: Likewise.
    	* peicode.h: Likewise.
    	* riscix.c: Likewise.
    	* targets.c: Likewise.
    	* aout0.c: Delete.
    	* coff-apollo.c: Delete.
    	* coff-aux.c: Delete.
    	* coff-m68k.c: Delete.
    	* coff-svm68k.c: Delete.
    	* coff-u68k.c: Delete.
    	* hosts/delta68.h: Delete.
    	* hosts/hp300bsd.h: Delete.
    	* hosts/m68kaux.h: Delete.
    	* hosts/news.h: Delete.
    	* hp300bsd.c: Delete.
    	* hp300hpux.c: Delete.
    	* liboasys.h: Delete.
    	* m68k4knetbsd.c: Delete.
    	* m68klinux.c: Delete.
    	* m68knetbsd.c: Delete.
    	* oasys.c: Delete.
    	* versados.c: Delete.
    	* Makefile.in: Regenerate.
    	* bfd-in2.h: Regenerate.
    	* configure: Regenerate.
    	* libbfd.h: Regenerate.
    	* po/SRC-POTFILES.in: Regenerate.
    binutils/
    	* testsuite/binutils-all/copy-2.d: Remove m68k-aout and m68k-coff
    	support.
    	* testsuite/binutils-all/copy-3.d: Likewise.
    	* testsuite/binutils-all/objcopy.exp: Likewise.
    	* testsuite/lib/binutils-common.exp: Likewise.
    gas/
    	* Makefile.am: Remove m68k-aout and m68k-coff support.
    	* config/tc-m68k.c: Likewise.
    	* config/tc-m68k.h: Likewise.
    	* configure.ac: Likewise.
    	* configure.tgt: Likewise.
    	* testsuite/gas/all/weakref1u.d: Likewise.
    	* testsuite/gas/m68k/all.exp: Likewise.
    	* testsuite/gas/m68k/br-isaa.d: Likewise.
    	* testsuite/gas/m68k/br-isab.d: Likewise.
    	* testsuite/gas/m68k/br-isac.d: Likewise.
    	* config/te-psos.h: Delete.
    	* config/te-sun3.h: Delete.
    	* testsuite/gas/m68k-coff/gas.exp: Delete.
    	* testsuite/gas/m68k-coff/p2389.s: Delete.
    	* testsuite/gas/m68k-coff/p2389a.s: Delete.
    	* testsuite/gas/m68k-coff/p2430.s: Delete.
    	* testsuite/gas/m68k-coff/p2430a.s: Delete.
    	* testsuite/gas/m68k-coff/t1.s: Delete.
    	* testsuite/gas/m68k/p3041.d: Delete.
    	* testsuite/gas/m68k/p3041.s: Delete.
    	* testsuite/gas/m68k/p3041data.d: Delete.
    	* testsuite/gas/m68k/p3041data.s: Delete.
    	* testsuite/gas/m68k/p3041pcrel.d: Delete.
    	* testsuite/gas/m68k/p3041pcrel.s: Delete.
    	* testsuite/gas/m68k/t2.d: Delete.
    	* Makefile.in: Regenerate.
    	* config.in: Regenerate.
    	* configure: Regenerate.
    	* po/POTFILES.in: Regenerate.
    ld/
    	* Makefile.am: Remove m68k-aout and m68k-coff support.
    	* configure.tgt: Likewise.
    	* emultempl/m68kelf.em: Likewise.
    	* ld.texinfo: Likewise.
    	* mri.c: Likewise.
    	* emulparams/delta68.sh: Delete.
    	* emulparams/hp300bsd.sh: Delete.
    	* emulparams/hp3hpux.sh: Delete.
    	* emulparams/m68k4knbsd.sh: Delete.
    	* emulparams/m68kaout.sh: Delete.
    	* emulparams/m68kaux.sh: Delete.
    	* emulparams/m68kcoff.sh: Delete.
    	* emulparams/m68klinux.sh: Delete.
    	* emulparams/m68knbsd.sh: Delete.
    	* emulparams/m68kpsos.sh: Delete.
    	* emulparams/sun3.sh: Delete.
    	* emultempl/m68kcoff.em: Delete.
    	* scripttempl/delta68.sc: Delete.
    	* scripttempl/m68kaux.sc: Delete.
    	* scripttempl/m68kcoff.sc: Delete.
    	* scripttempl/psos.sc: Delete.
    	* testsuite/ld-versados/t1-1.ro: Delete.
    	* testsuite/ld-versados/t1-2.ro: Delete.
    	* testsuite/ld-versados/t1.ld: Delete.
    	* testsuite/ld-versados/t1.ook: Delete.
    	* testsuite/ld-versados/t2-1.ro: Delete.
    	* testsuite/ld-versados/t2-2.ro: Delete.
    	* testsuite/ld-versados/t2-3.ro: Delete.
    	* testsuite/ld-versados/t2.ld: Delete.
    	* testsuite/ld-versados/t2.ook: Delete.
    	* testsuite/ld-versados/versados.exp: Delete.
    	* Makefile.in: Regenerate.
    	* po/BLD-POTFILES.in: Regenerate.

Diff:
---
 bfd/ChangeLog                               |   48 +
 bfd/Makefile.am                             |   28 +-
 bfd/Makefile.in                             |   41 +-
 bfd/aout0.c                                 |   38 -
 bfd/aoutf1.h                                |   48 +-
 bfd/aoutx.h                                 |   19 +-
 bfd/archive.c                               |  109 ---
 bfd/bfd-in.h                                |    5 -
 bfd/bfd-in2.h                               |    8 -
 bfd/bfd.c                                   |    2 -
 bfd/coff-apollo.c                           |  120 ---
 bfd/coff-aux.c                              |  145 ----
 bfd/coff-m68k.c                             |  548 ------------
 bfd/coff-svm68k.c                           |   27 -
 bfd/coff-u68k.c                             |   36 -
 bfd/coffcode.h                              |   59 +-
 bfd/coffswap.h                              |    7 -
 bfd/config.bfd                              |  105 +--
 bfd/configure                               |   30 +-
 bfd/configure.ac                            |   30 +-
 bfd/configure.host                          |    2 -
 bfd/doc/bfd.texinfo                         |    1 -
 bfd/doc/bfdint.texi                         |    2 -
 bfd/freebsd.h                               |    6 -
 bfd/gen-aout.c                              |    3 -
 bfd/hosts/delta68.h                         |   33 -
 bfd/hosts/hp300bsd.h                        |   32 -
 bfd/hosts/m68kaux.h                         |   35 -
 bfd/hosts/news.h                            |   28 -
 bfd/hp300bsd.c                              |   40 -
 bfd/hp300hpux.c                             |  855 ------------------
 bfd/hpux-core.c                             |    2 +-
 bfd/libaout.h                               |    2 +-
 bfd/libbfd-in.h                             |    2 -
 bfd/libbfd.h                                |    2 -
 bfd/liboasys.h                              |   83 --
 bfd/m68k4knetbsd.c                          |   36 -
 bfd/m68klinux.c                             |  737 ----------------
 bfd/m68knetbsd.c                            |   38 -
 bfd/oasys.c                                 | 1254 ---------------------------
 bfd/pdp11.c                                 |   19 +-
 bfd/peicode.h                               |    6 -
 bfd/po/SRC-POTFILES.in                      |   14 -
 bfd/riscix.c                                |    5 +-
 bfd/targets.c                               |   45 -
 bfd/versados.c                              |  939 --------------------
 binutils/ChangeLog                          |    8 +
 binutils/testsuite/binutils-all/copy-2.d    |    2 +-
 binutils/testsuite/binutils-all/copy-3.d    |    2 +-
 binutils/testsuite/binutils-all/objcopy.exp |    3 -
 binutils/testsuite/lib/binutils-common.exp  |    4 -
 gas/ChangeLog                               |   32 +
 gas/Makefile.am                             |    2 -
 gas/Makefile.in                             |    2 -
 gas/config.in                               |    3 -
 gas/config/tc-m68k.c                        |  151 +---
 gas/config/tc-m68k.h                        |   55 +-
 gas/config/te-psos.h                        |   35 -
 gas/config/te-sun3.h                        |   48 -
 gas/configure                               |    3 -
 gas/configure.ac                            |    1 -
 gas/configure.tgt                           |    4 -
 gas/po/POTFILES.in                          |    2 -
 gas/testsuite/gas/all/weakref1u.d           |    2 +-
 gas/testsuite/gas/m68k-coff/gas.exp         |   31 -
 gas/testsuite/gas/m68k-coff/p2389.s         |   19 -
 gas/testsuite/gas/m68k-coff/p2389a.s        |    3 -
 gas/testsuite/gas/m68k-coff/p2430.s         |    6 -
 gas/testsuite/gas/m68k-coff/p2430a.s        |    4 -
 gas/testsuite/gas/m68k-coff/t1.s            |   36 -
 gas/testsuite/gas/m68k/all.exp              |   16 +-
 gas/testsuite/gas/m68k/br-isaa.d            |    1 -
 gas/testsuite/gas/m68k/br-isab.d            |    1 -
 gas/testsuite/gas/m68k/br-isac.d            |    1 -
 gas/testsuite/gas/m68k/p3041.d              |   36 -
 gas/testsuite/gas/m68k/p3041.s              |   27 -
 gas/testsuite/gas/m68k/p3041data.d          |   28 -
 gas/testsuite/gas/m68k/p3041data.s          |   27 -
 gas/testsuite/gas/m68k/p3041pcrel.d         |   38 -
 gas/testsuite/gas/m68k/p3041pcrel.s         |   28 -
 gas/testsuite/gas/m68k/t2.d                 |    8 -
 include/ChangeLog                           |    8 +
 include/aout/host.h                         |    7 +-
 include/aout/hp300hpux.h                    |  131 ---
 include/coff/apollo.h                       |  125 ---
 include/coff/aux-coff.h                     |   49 --
 include/coff/m68k.h                         |   82 --
 ld/ChangeLog                                |   36 +
 ld/Makefile.am                              |   44 -
 ld/Makefile.in                              |   55 --
 ld/configure.tgt                            |   29 +-
 ld/emulparams/delta68.sh                    |    5 -
 ld/emulparams/hp300bsd.sh                   |    5 -
 ld/emulparams/hp3hpux.sh                    |    8 -
 ld/emulparams/m68k4knbsd.sh                 |    9 -
 ld/emulparams/m68kaout.sh                   |    6 -
 ld/emulparams/m68kaux.sh                    |    8 -
 ld/emulparams/m68kcoff.sh                   |    6 -
 ld/emulparams/m68klinux.sh                  |    9 -
 ld/emulparams/m68knbsd.sh                   |    9 -
 ld/emulparams/m68kpsos.sh                   |    6 -
 ld/emulparams/sun3.sh                       |   10 -
 ld/emultempl/m68kcoff.em                    |  247 ------
 ld/emultempl/m68kelf.em                     |   27 +-
 ld/ld.texinfo                               |   11 +-
 ld/mri.c                                    |    3 -
 ld/po/BLD-POTFILES.in                       |   11 -
 ld/scripttempl/delta68.sc                   |   61 --
 ld/scripttempl/m68kaux.sc                   |   59 --
 ld/scripttempl/m68kcoff.sc                  |   54 --
 ld/scripttempl/psos.sc                      |   73 --
 ld/testsuite/ld-versados/t1-1.ro            |  Bin 3840 -> 0 bytes
 ld/testsuite/ld-versados/t1-2.ro            |  Bin 256 -> 0 bytes
 ld/testsuite/ld-versados/t1.ld              |  281 ------
 ld/testsuite/ld-versados/t1.ook             |  133 ---
 ld/testsuite/ld-versados/t2-1.ro            |  Bin 256 -> 0 bytes
 ld/testsuite/ld-versados/t2-2.ro            |  Bin 2304 -> 0 bytes
 ld/testsuite/ld-versados/t2-3.ro            |  Bin 1024 -> 0 bytes
 ld/testsuite/ld-versados/t2.ld              |  281 ------
 ld/testsuite/ld-versados/t2.ook             |   99 ---
 ld/testsuite/ld-versados/versados.exp       |  102 ---
 121 files changed, 178 insertions(+), 8254 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 337d1a0..cdf708c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,53 @@
 2018-04-16  Alan Modra  <amodra@gmail.com>
 
+	* Makefile.am: Remove m68k-aout and m68k-coff support.
+	* aoutf1.h: Likewise.
+	* aoutx.h: Likewise.
+	* archive.c: Likewise.
+	* bfd-in.h: Likewise.
+	* bfd.c: Likewise.
+	* coffcode.h: Likewise.
+	* coffswap.h: Likewise.
+	* config.bfd: Likewise.
+	* configure.ac: Likewise.
+	* configure.host: Likewise.
+	* doc/bfd.texinfo: Likewise.
+	* doc/bfdint.texi: Likewise.
+	* freebsd.h: Likewise.
+	* gen-aout.c: Likewise.
+	* hpux-core.c: Likewise.
+	* libaout.h: Likewise.
+	* libbfd-in.h: Likewise.
+	* pdp11.c: Likewise.
+	* peicode.h: Likewise.
+	* riscix.c: Likewise.
+	* targets.c: Likewise.
+	* aout0.c: Delete.
+	* coff-apollo.c: Delete.
+	* coff-aux.c: Delete.
+	* coff-m68k.c: Delete.
+	* coff-svm68k.c: Delete.
+	* coff-u68k.c: Delete.
+	* hosts/delta68.h: Delete.
+	* hosts/hp300bsd.h: Delete.
+	* hosts/m68kaux.h: Delete.
+	* hosts/news.h: Delete.
+	* hp300bsd.c: Delete.
+	* hp300hpux.c: Delete.
+	* liboasys.h: Delete.
+	* m68k4knetbsd.c: Delete.
+	* m68klinux.c: Delete.
+	* m68knetbsd.c: Delete.
+	* oasys.c: Delete.
+	* versados.c: Delete.
+	* Makefile.in: Regenerate.
+	* bfd-in2.h: Regenerate.
+	* configure: Regenerate.
+	* libbfd.h: Regenerate.
+	* po/SRC-POTFILES.in: Regenerate.
+
+2018-04-16  Alan Modra  <amodra@gmail.com>
+
 	* Makefile.am: Remove sh5 and sh64 support.
 	* archures.c: Likewise.
 	* config.bfd: Likewise.
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index ff748d4..1e92647 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -262,28 +262,22 @@ BFD32_BACKENDS = \
 	aout-ns32k.lo \
 	aout-sparcle.lo \
 	aout-tic30.lo \
-	aout0.lo \
 	aout32.lo \
 	armnetbsd.lo \
 	cf-i386lynx.lo \
 	cf-sparclynx.lo \
-	coff-apollo.lo \
 	coff-arm.lo \
-	coff-aux.lo \
 	coff-go32.lo \
 	coff-i386.lo \
-	coff-m68k.lo \
 	coff-mips.lo \
 	coff-rs6000.lo \
 	coff-sh.lo \
 	coff-sparc.lo \
 	coff-stgo32.lo \
-	coff-svm68k.lo \
 	coff-tic30.lo \
 	coff-tic4x.lo \
 	coff-tic54x.lo \
 	coff-tic80.lo \
-	coff-u68k.lo \
 	coff-z80.lo \
 	coff-z8k.lo \
 	coffgen.lo \
@@ -368,8 +362,6 @@ BFD32_BACKENDS = \
 	elfxx-tilegx.lo \
 	epoc-pe-arm.lo \
 	epoc-pei-arm.lo \
-	hp300bsd.lo \
-	hp300hpux.lo \
 	i386aout.lo \
 	i386bsd.lo \
 	i386dynix.lo \
@@ -380,15 +372,11 @@ BFD32_BACKENDS = \
 	i386msdos.lo \
 	i386netbsd.lo \
 	i386os9k.lo \
-	m68k4knetbsd.lo \
-	m68klinux.lo \
-	m68knetbsd.lo \
 	mach-o.lo \
 	mach-o-i386.lo \
 	mach-o-arm.lo \
 	mipsbsd.lo \
 	ns32knetbsd.lo \
-	oasys.lo \
 	pc532-mach.lo \
 	pdp11.lo \
 	pe-arm-wince.lo \
@@ -418,7 +406,6 @@ BFD32_BACKENDS = \
 	sunos.lo \
 	vax1knetbsd.lo \
 	vaxnetbsd.lo \
-	versados.lo \
 	vms-lib.lo \
 	vms-misc.lo \
 	wasm-module.lo \
@@ -433,28 +420,22 @@ BFD32_BACKENDS_CFILES = \
 	aout-ns32k.c \
 	aout-sparcle.c \
 	aout-tic30.c \
-	aout0.c \
 	aout32.c \
 	armnetbsd.c \
 	cf-i386lynx.c \
 	cf-sparclynx.c \
-	coff-apollo.c \
 	coff-arm.c \
-	coff-aux.c \
 	coff-go32.c \
 	coff-i386.c \
-	coff-m68k.c \
 	coff-mips.c \
 	coff-rs6000.c \
 	coff-sh.c \
 	coff-sparc.c \
 	coff-stgo32.c \
-	coff-svm68k.c \
 	coff-tic30.c \
 	coff-tic4x.c \
 	coff-tic54x.c \
 	coff-tic80.c \
-	coff-u68k.c \
 	coff-z80.c \
 	coff-z8k.c \
 	coffgen.c \
@@ -539,8 +520,6 @@ BFD32_BACKENDS_CFILES = \
 	elfxx-tilegx.c \
 	epoc-pe-arm.c \
 	epoc-pei-arm.c \
-	hp300bsd.c \
-	hp300hpux.c \
 	i386aout.c \
 	i386bsd.c \
 	i386dynix.c \
@@ -551,15 +530,11 @@ BFD32_BACKENDS_CFILES = \
 	i386msdos.c \
 	i386netbsd.c \
 	i386os9k.c \
-	m68k4knetbsd.c \
-	m68klinux.c \
-	m68knetbsd.c \
 	mach-o.c \
 	mach-o-i386.c \
 	mach-o-arm.c \
 	mipsbsd.c \
 	ns32knetbsd.c \
-	oasys.c \
 	pc532-mach.c \
 	pdp11.c \
 	pe-arm-wince.c \
@@ -588,7 +563,6 @@ BFD32_BACKENDS_CFILES = \
 	sunos.c \
 	vax1knetbsd.c \
 	vaxnetbsd.c \
-	versados.c \
 	vms-lib.c \
 	vms-misc.c \
 	wasm-module.c \
@@ -748,7 +722,7 @@ SOURCE_HFILES = \
 	elf64-hppa.h elfcode.h elfcore.h \
 	freebsd.h genlink.h go32stub.h \
 	libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
-	liboasys.h libpei.h libxcoff.h mach-o.h \
+	libpei.h libxcoff.h mach-o.h \
 	netbsd.h ns32k.h \
 	pef.h pef-traceback.h peicode.h som.h version.h \
 	vms.h xsym.h
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 600afdd..a916c3b 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -596,28 +596,22 @@ BFD32_BACKENDS = \
 	aout-ns32k.lo \
 	aout-sparcle.lo \
 	aout-tic30.lo \
-	aout0.lo \
 	aout32.lo \
 	armnetbsd.lo \
 	cf-i386lynx.lo \
 	cf-sparclynx.lo \
-	coff-apollo.lo \
 	coff-arm.lo \
-	coff-aux.lo \
 	coff-go32.lo \
 	coff-i386.lo \
-	coff-m68k.lo \
 	coff-mips.lo \
 	coff-rs6000.lo \
 	coff-sh.lo \
 	coff-sparc.lo \
 	coff-stgo32.lo \
-	coff-svm68k.lo \
 	coff-tic30.lo \
 	coff-tic4x.lo \
 	coff-tic54x.lo \
 	coff-tic80.lo \
-	coff-u68k.lo \
 	coff-z80.lo \
 	coff-z8k.lo \
 	coffgen.lo \
@@ -702,8 +696,6 @@ BFD32_BACKENDS = \
 	elfxx-tilegx.lo \
 	epoc-pe-arm.lo \
 	epoc-pei-arm.lo \
-	hp300bsd.lo \
-	hp300hpux.lo \
 	i386aout.lo \
 	i386bsd.lo \
 	i386dynix.lo \
@@ -714,15 +706,11 @@ BFD32_BACKENDS = \
 	i386msdos.lo \
 	i386netbsd.lo \
 	i386os9k.lo \
-	m68k4knetbsd.lo \
-	m68klinux.lo \
-	m68knetbsd.lo \
 	mach-o.lo \
 	mach-o-i386.lo \
 	mach-o-arm.lo \
 	mipsbsd.lo \
 	ns32knetbsd.lo \
-	oasys.lo \
 	pc532-mach.lo \
 	pdp11.lo \
 	pe-arm-wince.lo \
@@ -752,7 +740,6 @@ BFD32_BACKENDS = \
 	sunos.lo \
 	vax1knetbsd.lo \
 	vaxnetbsd.lo \
-	versados.lo \
 	vms-lib.lo \
 	vms-misc.lo \
 	wasm-module.lo \
@@ -767,28 +754,22 @@ BFD32_BACKENDS_CFILES = \
 	aout-ns32k.c \
 	aout-sparcle.c \
 	aout-tic30.c \
-	aout0.c \
 	aout32.c \
 	armnetbsd.c \
 	cf-i386lynx.c \
 	cf-sparclynx.c \
-	coff-apollo.c \
 	coff-arm.c \
-	coff-aux.c \
 	coff-go32.c \
 	coff-i386.c \
-	coff-m68k.c \
 	coff-mips.c \
 	coff-rs6000.c \
 	coff-sh.c \
 	coff-sparc.c \
 	coff-stgo32.c \
-	coff-svm68k.c \
 	coff-tic30.c \
 	coff-tic4x.c \
 	coff-tic54x.c \
 	coff-tic80.c \
-	coff-u68k.c \
 	coff-z80.c \
 	coff-z8k.c \
 	coffgen.c \
@@ -873,8 +854,6 @@ BFD32_BACKENDS_CFILES = \
 	elfxx-tilegx.c \
 	epoc-pe-arm.c \
 	epoc-pei-arm.c \
-	hp300bsd.c \
-	hp300hpux.c \
 	i386aout.c \
 	i386bsd.c \
 	i386dynix.c \
@@ -885,15 +864,11 @@ BFD32_BACKENDS_CFILES = \
 	i386msdos.c \
 	i386netbsd.c \
 	i386os9k.c \
-	m68k4knetbsd.c \
-	m68klinux.c \
-	m68knetbsd.c \
 	mach-o.c \
 	mach-o-i386.c \
 	mach-o-arm.c \
 	mipsbsd.c \
 	ns32knetbsd.c \
-	oasys.c \
 	pc532-mach.c \
 	pdp11.c \
 	pe-arm-wince.c \
@@ -922,7 +897,6 @@ BFD32_BACKENDS_CFILES = \
 	sunos.c \
 	vax1knetbsd.c \
 	vaxnetbsd.c \
-	versados.c \
 	vms-lib.c \
 	vms-misc.c \
 	wasm-module.c \
@@ -1083,7 +1057,7 @@ SOURCE_HFILES = \
 	elf64-hppa.h elfcode.h elfcore.h \
 	freebsd.h genlink.h go32stub.h \
 	libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
-	liboasys.h libpei.h libxcoff.h mach-o.h \
+	libpei.h libxcoff.h mach-o.h \
 	netbsd.h ns32k.h \
 	pef.h pef-traceback.h peicode.h som.h version.h \
 	vms.h xsym.h
@@ -1255,7 +1229,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout-ns32k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout-sparcle.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout-tic30.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout0.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout64.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/archive.Plo@am__quote@
@@ -1271,24 +1244,19 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cf-sparclynx.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cisco-core.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-alpha.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-apollo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-arm.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-aux.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-bfd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-go32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-i386.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-m68k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-mips.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-rs6000.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sh.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sparc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-stgo32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-svm68k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-tic30.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-tic4x.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-tic54x.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-tic80.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-u68k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-x86_64.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-z80.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-z8k.Plo@am__quote@
@@ -1487,8 +1455,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoc-pei-arm.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hp300bsd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hp300hpux.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hpux-core.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386aout.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386bsd.Plo@am__quote@
@@ -1506,9 +1472,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linker.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lynx-core.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m68k4knetbsd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m68klinux.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m68knetbsd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mach-o-aarch64.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mach-o-arm.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mach-o-i386.Plo@am__quote@
@@ -1519,7 +1482,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netbsd-core.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ns32knetbsd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oasys.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opncls.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osf-core.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc532-mach.Plo@am__quote@
@@ -1569,7 +1531,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vax1knetbsd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vaxnetbsd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verilog.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versados.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vms-alpha.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vms-lib.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vms-misc.Plo@am__quote@
diff --git a/bfd/aout0.c b/bfd/aout0.c
deleted file mode 100644
index 890dce6..0000000
--- a/bfd/aout0.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* BFD backend for SunOS style a.out with flags set to 0
-   Copyright (C) 1990-2018 Free Software Foundation, Inc.
-   Written by Cygnus Support.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-#define TARGETNAME "a.out-zero-big"
-
-/* Do not "beautify" the CONCAT* macro args.  Traditional C will not
-   remove whitespace added here, and thus will fail to concatenate
-   the tokens.  */
-#define MY(OP) CONCAT2 (aout0_be_,OP)
-
-#include "sysdep.h"
-#include "bfd.h"
-
-#define MY_exec_hdr_flags 0
-
-#define MACHTYPE_OK(mtype) \
-  ((mtype) == M_UNKNOWN || (mtype) == M_68010 || (mtype) == M_68020)
-
-/* Include the usual a.out support.  */
-#include "aoutf1.h"
diff --git a/bfd/aoutf1.h b/bfd/aoutf1.h
index b039d6a..cb8e403 100644
--- a/bfd/aoutf1.h
+++ b/bfd/aoutf1.h
@@ -36,9 +36,7 @@
    probably no longer reject a NewsOS object.  <ian@cygnus.com>.  */
 #ifndef MACHTYPE_OK
 #define MACHTYPE_OK(mtype) \
-  (((mtype) == M_SPARC && bfd_lookup_arch (bfd_arch_sparc, 0) != NULL) \
-   || (((mtype) == M_UNKNOWN || (mtype) == M_68010 || (mtype) == M_68020) \
-       && bfd_lookup_arch (bfd_arch_m68k, 0) != NULL))
+  ((mtype) == M_SPARC && bfd_lookup_arch (bfd_arch_sparc, 0) != NULL)
 #endif
 
 /* The file @code{aoutf1.h} contains the code for BFD's
@@ -103,25 +101,6 @@ sunos_set_arch_mach (bfd *abfd, enum machine_type machtype)
 
   switch (machtype)
     {
-    case M_UNKNOWN:
-      /* Some Sun3s make magic numbers without cpu types in them, so
-	 we'll default to the 68000.  */
-      arch = bfd_arch_m68k;
-      machine = bfd_mach_m68000;
-      break;
-
-    case M_68010:
-    case M_HP200:
-      arch = bfd_arch_m68k;
-      machine = bfd_mach_m68010;
-      break;
-
-    case M_68020:
-    case M_HP300:
-      arch = bfd_arch_m68k;
-      machine = bfd_mach_m68020;
-      break;
-
     case M_SPARC:
       arch = bfd_arch_sparc;
       machine = 0;
@@ -143,11 +122,6 @@ sunos_set_arch_mach (bfd *abfd, enum machine_type machtype)
       machine = 0;
       break;
 
-    case M_HPUX:
-      arch = bfd_arch_m68k;
-      machine = 0;
-      break;
-
     default:
       arch = bfd_arch_obscure;
       machine = 0;
@@ -191,21 +165,6 @@ sunos_write_object_contents (bfd *abfd)
   /* Magic number, maestro, please!  */
   switch (bfd_get_arch (abfd))
     {
-    case bfd_arch_m68k:
-      switch (bfd_get_mach (abfd))
-	{
-	case bfd_mach_m68000:
-	  N_SET_MACHTYPE (execp, M_UNKNOWN);
-	  break;
-	case bfd_mach_m68010:
-	  N_SET_MACHTYPE (execp, M_68010);
-	  break;
-	default:
-	case bfd_mach_m68020:
-	  N_SET_MACHTYPE (execp, M_68020);
-	  break;
-	}
-      break;
     case bfd_arch_sparc:
       switch (bfd_get_mach (abfd))
 	{
@@ -722,11 +681,6 @@ sunos4_set_sizes (bfd *abfd)
       adata (abfd).segment_size = 0x2000;
       adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
       return TRUE;
-    case bfd_arch_m68k:
-      adata (abfd).page_size = 0x2000;
-      adata (abfd).segment_size = 0x20000;
-      adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
-      return TRUE;
     }
 }
 
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index c430593..0e0bab0 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -467,10 +467,7 @@ NAME (aout, some_aout_object_p) (bfd *abfd,
   oldrawptr = abfd->tdata.aout_data;
   abfd->tdata.aout_data = rawptr;
 
-  /* Copy the contents of the old tdata struct.
-     In particular, we want the subformat, since for hpux it was set in
-     hp300hpux.c:swap_exec_header_in and will be used in
-     hp300hpux.c:callback.  */
+  /* Copy the contents of the old tdata struct.  */
   if (oldrawptr != NULL)
     *abfd->tdata.aout_data = *oldrawptr;
 
@@ -751,17 +748,6 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
 	arch_flags = M_SPARCLET;
       break;
 
-    case bfd_arch_m68k:
-      switch (machine)
-	{
-	case 0:		      arch_flags = M_68010; break;
-	case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = FALSE; break;
-	case bfd_mach_m68010: arch_flags = M_68010; break;
-	case bfd_mach_m68020: arch_flags = M_68020; break;
-	default:	      arch_flags = M_UNKNOWN; break;
-	}
-      break;
-
     case bfd_arch_i386:
       if (machine == 0
 	  || machine == bfd_mach_i386_i386
@@ -5497,8 +5483,7 @@ NAME (aout, final_link) (bfd *abfd,
      FIXME: At this point we do not know how much space the symbol
      table will require.  This will not work for any (nonstandard)
      a.out target that needs to know the symbol table size before it
-     can compute the relocation file positions.  This may or may not
-     be the case for the hp300hpux target, for example.  */
+     can compute the relocation file positions.  */
   (*callback) (abfd, &aout_info.treloff, &aout_info.dreloff,
 	       &aout_info.symoff);
   obj_textsec (abfd)->rel_filepos = aout_info.treloff;
diff --git a/bfd/archive.c b/bfd/archive.c
index b949310..d56bb06 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -1182,115 +1182,6 @@ bfd_slurp_armap (bfd *abfd)
   return TRUE;
 }
 
-/* Returns FALSE on error, TRUE otherwise.  */
-/* Flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the
-   header is in a slightly different order and the map name is '/'.
-   This flavour is used by hp300hpux.  */
-
-#define HPUX_SYMDEF_COUNT_SIZE 2
-
-bfd_boolean
-bfd_slurp_bsd_armap_f2 (bfd *abfd)
-{
-  struct areltdata *mapdata;
-  char nextname[17];
-  unsigned int counter;
-  bfd_byte *raw_armap, *rbase;
-  struct artdata *ardata = bfd_ardata (abfd);
-  char *stringbase;
-  unsigned int stringsize;
-  unsigned int left;
-  bfd_size_type amt;
-  carsym *set;
-  int i = bfd_bread (nextname, 16, abfd);
-
-  if (i == 0)
-    return TRUE;
-  if (i != 16)
-    return FALSE;
-
-  /* The archive has at least 16 bytes in it.  */
-  if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
-    return FALSE;
-
-  if (CONST_STRNEQ (nextname, "__.SYMDEF       ")
-      || CONST_STRNEQ (nextname, "__.SYMDEF/      ")) /* Old Linux archives.  */
-    return do_slurp_bsd_armap (abfd);
-
-  if (! CONST_STRNEQ (nextname, "/               "))
-    {
-      bfd_has_map (abfd) = FALSE;
-      return TRUE;
-    }
-
-  mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
-  if (mapdata == NULL)
-    return FALSE;
-
-  if (mapdata->parsed_size < HPUX_SYMDEF_COUNT_SIZE + BSD_STRING_COUNT_SIZE)
-    {
-      free (mapdata);
-    wrong_format:
-      bfd_set_error (bfd_error_wrong_format);
-    byebye:
-      return FALSE;
-    }
-  left = mapdata->parsed_size - HPUX_SYMDEF_COUNT_SIZE - BSD_STRING_COUNT_SIZE;
-
-  amt = mapdata->parsed_size;
-  free (mapdata);
-
-  raw_armap = (bfd_byte *) bfd_zalloc (abfd, amt);
-  if (raw_armap == NULL)
-    goto byebye;
-
-  if (bfd_bread (raw_armap, amt, abfd) != amt)
-    {
-      if (bfd_get_error () != bfd_error_system_call)
-	bfd_set_error (bfd_error_malformed_archive);
-      goto byebye;
-    }
-
-  ardata->symdef_count = H_GET_16 (abfd, raw_armap);
-
-  ardata->cache = 0;
-
-  stringsize = H_GET_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE);
-  if (stringsize > left)
-    goto wrong_format;
-  left -= stringsize;
-
-  /* Skip sym count and string sz.  */
-  stringbase = ((char *) raw_armap
-		+ HPUX_SYMDEF_COUNT_SIZE
-		+ BSD_STRING_COUNT_SIZE);
-  rbase = (bfd_byte *) stringbase + stringsize;
-  amt = ardata->symdef_count * BSD_SYMDEF_SIZE;
-  if (amt > left)
-    goto wrong_format;
-
-  ardata->symdefs = (struct carsym *) bfd_alloc (abfd, amt);
-  if (!ardata->symdefs)
-    return FALSE;
-
-  for (counter = 0, set = ardata->symdefs;
-       counter < ardata->symdef_count;
-       counter++, set++, rbase += BSD_SYMDEF_SIZE)
-    {
-      set->name = H_GET_32 (abfd, rbase) + stringbase;
-      set->file_offset = H_GET_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);
-    }
-
-  ardata->first_file_filepos = bfd_tell (abfd);
-  /* Pad to an even boundary if you have to.  */
-  ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
-  /* FIXME, we should provide some way to free raw_ardata when
-     we are done using the strings from it.  For now, it seems
-     to be allocated on an objalloc anyway...  */
-  bfd_has_map (abfd) = TRUE;
-  return TRUE;
-}
-
 /** Extended name table.
 
   Normally archives support only 14-character filenames.
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index cc59ed6..50a8b52 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -776,8 +776,6 @@ extern bfd_boolean bfd_sunos_size_dynamic_sections
 
 extern bfd_boolean bfd_i386linux_size_dynamic_sections
   (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_m68klinux_size_dynamic_sections
-  (bfd *, struct bfd_link_info *);
 extern bfd_boolean bfd_sparclinux_size_dynamic_sections
   (bfd *, struct bfd_link_info *);
 
@@ -846,9 +844,6 @@ union internal_auxent;
 extern bfd_boolean bfd_coff_set_symbol_class
   (bfd *, struct bfd_symbol *, unsigned int);
 
-extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
-  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
-
 /* ARM VFP11 erratum workaround support.  */
 typedef enum
 {
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 55fcd85..041b3b1 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -783,8 +783,6 @@ extern bfd_boolean bfd_sunos_size_dynamic_sections
 
 extern bfd_boolean bfd_i386linux_size_dynamic_sections
   (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_m68klinux_size_dynamic_sections
-  (bfd *, struct bfd_link_info *);
 extern bfd_boolean bfd_sparclinux_size_dynamic_sections
   (bfd *, struct bfd_link_info *);
 
@@ -853,9 +851,6 @@ union internal_auxent;
 extern bfd_boolean bfd_coff_set_symbol_class
   (bfd *, struct bfd_symbol *, unsigned int);
 
-extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
-  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
-
 /* ARM VFP11 erratum workaround support.  */
 typedef enum
 {
@@ -6994,8 +6989,6 @@ struct bfd
     {
       struct aout_data_struct *aout_data;
       struct artdata *aout_ar_data;
-      struct _oasys_data *oasys_obj_data;
-      struct _oasys_ar_data *oasys_ar_data;
       struct coff_tdata *coff_obj_data;
       struct pe_tdata *pe_obj_data;
       struct xcoff_tdata *xcoff_obj_data;
@@ -7313,7 +7306,6 @@ enum bfd_flavour
   bfd_target_ecoff_flavour,
   bfd_target_xcoff_flavour,
   bfd_target_elf_flavour,
-  bfd_target_oasys_flavour,
   bfd_target_tekhex_flavour,
   bfd_target_srec_flavour,
   bfd_target_verilog_flavour,
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 8b7fbab..3bf56a6 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -304,8 +304,6 @@ CODE_FRAGMENT
 .    {
 .      struct aout_data_struct *aout_data;
 .      struct artdata *aout_ar_data;
-.      struct _oasys_data *oasys_obj_data;
-.      struct _oasys_ar_data *oasys_ar_data;
 .      struct coff_tdata *coff_obj_data;
 .      struct pe_tdata *pe_obj_data;
 .      struct xcoff_tdata *xcoff_obj_data;
diff --git a/bfd/coff-apollo.c b/bfd/coff-apollo.c
deleted file mode 100644
index 36b88b3..0000000
--- a/bfd/coff-apollo.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* BFD back-end for Apollo 68000 COFF binaries.
-   Copyright (C) 1990-2018 Free Software Foundation, Inc.
-   By Troy Rollo (troy@cbme.unsw.edu.au)
-   Based on m68k standard COFF version Written by Cygnus Support.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-#include "coff/apollo.h"
-#include "coff/internal.h"
-#include "libcoff.h"
-
-#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
-
-#ifdef ONLY_DECLARE_RELOCS
-extern reloc_howto_type apollocoff_howto_table[];
-#else
-reloc_howto_type apollocoff_howto_table[] =
-  {
-    HOWTO (R_RELBYTE,	       0,  0,	8,  FALSE, 0, complain_overflow_bitfield, 0, "8",	TRUE, 0x000000ff,0x000000ff, FALSE),
-    HOWTO (R_RELWORD,	       0,  1,	16, FALSE, 0, complain_overflow_bitfield, 0, "16",	TRUE, 0x0000ffff,0x0000ffff, FALSE),
-    HOWTO (R_RELLONG,	       0,  2,	32, FALSE, 0, complain_overflow_bitfield, 0, "32",	TRUE, 0xffffffff,0xffffffff, FALSE),
-    HOWTO (R_PCRBYTE,	       0,  0,	8,  TRUE,  0, complain_overflow_signed,	  0, "DISP8",	TRUE, 0x000000ff,0x000000ff, FALSE),
-    HOWTO (R_PCRWORD,	       0,  1,	16, TRUE,  0, complain_overflow_signed,	  0, "DISP16",	TRUE, 0x0000ffff,0x0000ffff, FALSE),
-    HOWTO (R_PCRLONG,	       0,  2,	32, TRUE,  0, complain_overflow_signed,	  0, "DISP32",	TRUE, 0xffffffff,0xffffffff, FALSE),
-    HOWTO (R_RELLONG_NEG,      0,  -2,	32, FALSE, 0, complain_overflow_bitfield, 0, "-32",	TRUE, 0xffffffff,0xffffffff, FALSE),
-  };
-#endif /* not ONLY_DECLARE_RELOCS */
-
-#ifndef BADMAG
-#define BADMAG(x) M68KBADMAG(x)
-#endif
-#define APOLLO_M68 1		/* Customize coffcode.h */
-
-/* Turn a howto into a reloc number.  */
-
-extern void apollo_rtype2howto (arelent *, int);
-extern int  apollo_howto2rtype (reloc_howto_type *);
-#ifndef ONLY_DECLARE_RELOCS
-
-void
-apollo_rtype2howto (arelent *internal, int relocentry)
-{
-  switch (relocentry)
-    {
-    case R_RELBYTE:	internal->howto = apollocoff_howto_table + 0; break;
-    case R_RELWORD:	internal->howto = apollocoff_howto_table + 1; break;
-    case R_RELLONG:	internal->howto = apollocoff_howto_table + 2; break;
-    case R_PCRBYTE:	internal->howto = apollocoff_howto_table + 3; break;
-    case R_PCRWORD:	internal->howto = apollocoff_howto_table + 4; break;
-    case R_PCRLONG:	internal->howto = apollocoff_howto_table + 5; break;
-    case R_RELLONG_NEG:	internal->howto = apollocoff_howto_table + 6; break;
-    }
-}
-
-int
-apollo_howto2rtype (reloc_howto_type *internal)
-{
-  if (internal->pc_relative)
-    {
-      switch (internal->bitsize)
-	{
-	case 32: return R_PCRLONG;
-	case 16: return R_PCRWORD;
-	case 8: return R_PCRBYTE;
-	}
-    }
-  else
-    {
-      switch (internal->bitsize)
-	{
-	case 32: return R_RELLONG;
-	case 16: return R_RELWORD;
-	case 8: return R_RELBYTE;
-	}
-    }
-  return R_RELLONG;
-}
-#endif /* not ONLY_DECLARE_RELOCS */
-
-#define RTYPE2HOWTO(internal, relocentry) \
-  apollo_rtype2howto (internal, (relocentry)->r_type)
-
-#define SELECT_RELOC(external, internal) \
-  external.r_type = apollo_howto2rtype (internal);
-
-#define bfd_pe_print_pdata	NULL
-
-#include "coffcode.h"
-
-#ifndef TARGET_SYM
-#define TARGET_SYM m68k_coff_apollo_vec
-#endif
-
-#ifndef TARGET_NAME
-#define TARGET_NAME "apollo-m68k"
-#endif
-
-#ifdef NAMES_HAVE_UNDERSCORE
-CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, 0, 0, '_', NULL, COFF_SWAP_TABLE)
-#else
-CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, 0, 0, 0, NULL, COFF_SWAP_TABLE)
-#endif
diff --git a/bfd/coff-aux.c b/bfd/coff-aux.c
deleted file mode 100644
index f55e6e0..0000000
--- a/bfd/coff-aux.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/* BFD back-end for Apple M68K COFF A/UX 3.x files.
-   Copyright (C) 1996-2018 Free Software Foundation, Inc.
-   Written by Richard Henderson <rth@tamu.edu>.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-#define TARGET_SYM	m68k_coff_aux_vec
-#define TARGET_NAME	"coff-m68k-aux"
-
-#ifndef TARG_AUX
-#define TARG_AUX
-#endif
-
-#define COFF_LONG_FILENAMES
-
-/* 4k pages */
-#define COFF_PAGE_SIZE 0x1000
-
-/* On AUX, a STYP_NOLOAD|STYP_BSS section is part of a shared library.  */
-#define BSS_NOLOAD_IS_SHARED_LIBRARY
-
-#define STATIC_RELOCS
-
-#define COFF_COMMON_ADDEND
-
-#include "sysdep.h"
-#include "bfd.h"
-
-#define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol
-static bfd_boolean
-coff_m68k_aux_link_add_one_symbol
-  (struct bfd_link_info *, bfd *, const char *, flagword, asection *,
-   bfd_vma, const char *, bfd_boolean, bfd_boolean,
-   struct bfd_link_hash_entry **);
-
-#ifndef bfd_pe_print_pdata
-#define bfd_pe_print_pdata	NULL
-#endif
-
-#include "coff/aux-coff.h"  /* override coff/internal.h and coff/m68k.h */
-#include "coff-m68k.c"
-
-/* We need non-absolute symbols to override absolute symbols.  This
-   mirrors Apple's "solution" to let a static library symbol override
-   a shared library symbol.  On the whole not a good thing, given how
-   shared libraries work here, but can work if you are careful with
-   what you include in the shared object.  */
-
-static bfd_boolean
-coff_m68k_aux_link_add_one_symbol (struct bfd_link_info *info,
-				   bfd *abfd,
-				   const char *name,
-				   flagword flags,
-				   asection *section,
-				   bfd_vma value,
-				   const char *string,
-				   bfd_boolean copy,
-				   bfd_boolean collect,
-				   struct bfd_link_hash_entry **hashp)
-{
-  struct bfd_link_hash_entry *h, *inh, *t;
-
-  if ((flags & (BSF_WARNING | BSF_CONSTRUCTOR | BSF_WEAK)) == 0
-      && !bfd_is_und_section (section)
-      && !bfd_is_com_section (section))
-    {
-      /* The new symbol is a definition or an indirect definition */
-
-      /* This bit copied from linker.c */
-      if (hashp != NULL && *hashp != NULL)
-	h = *hashp;
-      else
-	{
-	  h = bfd_link_hash_lookup (info->hash, name, TRUE, copy, FALSE);
-	  if (h == NULL)
-	    {
-	      if (hashp != NULL)
-		*hashp = NULL;
-	      return FALSE;
-	    }
-	}
-
-      if (hashp != (struct bfd_link_hash_entry **) NULL)
-	*hashp = h;
-      /* end duplication from linker.c */
-
-      t = h;
-      inh = NULL;
-      if (h->type == bfd_link_hash_indirect)
-	{
-	  inh = h->u.i.link;
-	  t = inh;
-	}
-
-      if (t->type == bfd_link_hash_defined)
-	{
-	  asection *msec = t->u.def.section;
-	  bfd_boolean special = FALSE;
-
-	  if (bfd_is_abs_section (msec) && !bfd_is_abs_section (section))
-	    {
-	      t->u.def.section = section;
-	      t->u.def.value = value;
-	      special = TRUE;
-	    }
-	  else if (bfd_is_abs_section (section) && !bfd_is_abs_section (msec))
-	    special = TRUE;
-
-	  if (special)
-	    {
-	      if (info->notice_all
-		  || (info->notice_hash != NULL
-		      && bfd_hash_lookup (info->notice_hash, name,
-					  FALSE, FALSE) != NULL))
-		{
-		  if (!(*info->callbacks->notice) (info, h, inh,
-						   abfd, section, value, flags))
-		    return FALSE;
-		}
-
-	      return TRUE;
-	    }
-	}
-    }
-
-  /* If we didn't exit early, finish processing in the generic routine */
-  return _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section,
-					   value, string, copy, collect,
-					   hashp);
-}
diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c
deleted file mode 100644
index f7777a1..0000000
--- a/bfd/coff-m68k.c
+++ /dev/null
@@ -1,548 +0,0 @@
-/* BFD back-end for Motorola 68000 COFF binaries.
-   Copyright (C) 1990-2018 Free Software Foundation, Inc.
-   Written by Cygnus Support.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-#include "coff/m68k.h"
-#include "coff/internal.h"
-#include "libcoff.h"
-
-/* This source file is compiled multiple times for various m68k COFF
-   variants.  The following macros control its behaviour:
-
-   TARGET_SYM
-     The C name of the BFD target vector.  The default is m68k_coff_vec.
-   TARGET_NAME
-     The user visible target name.  The default is "coff-m68k".
-   NAMES_HAVE_UNDERSCORE
-     Whether symbol names have an underscore.
-   ONLY_DECLARE_RELOCS
-     Only declare the relocation howto array.  Don't actually compile
-     it.  The actual array will be picked up in another version of the
-     file.
-   STATIC_RELOCS
-     Make the relocation howto array, and associated functions, static.
-   COFF_COMMON_ADDEND
-     If this is defined, then, for a relocation against a common
-     symbol, the object file holds the value (the size) of the common
-     symbol.  If this is not defined, then, for a relocation against a
-     common symbol, the object file holds zero.  */
-
-#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
-
-#ifndef COFF_PAGE_SIZE
-/* The page size is a guess based on ELF.  */
-#define COFF_PAGE_SIZE 0x2000
-#endif
-
-#ifndef COFF_COMMON_ADDEND
-#define RELOC_SPECIAL_FN 0
-#else
-static bfd_reloc_status_type m68kcoff_common_addend_special_fn
-  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-
-#define RELOC_SPECIAL_FN m68kcoff_common_addend_special_fn
-#endif
-
-static bfd_boolean m68k_coff_is_local_label_name (bfd *, const char *);
-
-/* On the delta, a symbol starting with L% is local.  We won't see
-   such a symbol on other platforms, so it should be safe to always
-   consider it local here.  */
-
-static bfd_boolean
-m68k_coff_is_local_label_name (bfd *abfd, const char *name)
-{
-  if (name[0] == 'L' && name[1] == '%')
-    return TRUE;
-
-  return _bfd_coff_is_local_label_name (abfd, name);
-}
-
-#ifndef STATIC_RELOCS
-/* Clean up namespace.  */
-#define m68kcoff_howto_table	_bfd_m68kcoff_howto_table
-#define m68k_rtype2howto	_bfd_m68kcoff_rtype2howto
-#define m68k_howto2rtype	_bfd_m68kcoff_howto2rtype
-#define m68k_reloc_type_lookup	_bfd_m68kcoff_reloc_type_lookup
-#define m68k_reloc_name_lookup _bfd_m68kcoff_reloc_name_lookup
-#endif
-
-#ifdef ONLY_DECLARE_RELOCS
-extern reloc_howto_type m68kcoff_howto_table[];
-#else
-#ifdef STATIC_RELOCS
-static
-#endif
-reloc_howto_type m68kcoff_howto_table[] =
-  {
-    HOWTO (R_RELBYTE,	       0,  0,	8,  FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8",	TRUE, 0x000000ff,0x000000ff, FALSE),
-    HOWTO (R_RELWORD,	       0,  1,	16, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16",	TRUE, 0x0000ffff,0x0000ffff, FALSE),
-    HOWTO (R_RELLONG,	       0,  2,	32, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "32",	TRUE, 0xffffffff,0xffffffff, FALSE),
-    HOWTO (R_PCRBYTE,	       0,  0,	8,  TRUE,  0, complain_overflow_signed,	  RELOC_SPECIAL_FN, "DISP8",	TRUE, 0x000000ff,0x000000ff, FALSE),
-    HOWTO (R_PCRWORD,	       0,  1,	16, TRUE,  0, complain_overflow_signed,	  RELOC_SPECIAL_FN, "DISP16",	TRUE, 0x0000ffff,0x0000ffff, FALSE),
-    HOWTO (R_PCRLONG,	       0,  2,	32, TRUE,  0, complain_overflow_signed,	  RELOC_SPECIAL_FN, "DISP32",	TRUE, 0xffffffff,0xffffffff, FALSE),
-    HOWTO (R_RELLONG_NEG,      0, -2,	32, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "-32",	TRUE, 0xffffffff,0xffffffff, FALSE),
-  };
-#endif /* not ONLY_DECLARE_RELOCS */
-
-#ifndef BADMAG
-#define BADMAG(x) M68KBADMAG(x)
-#endif
-#define M68 1		/* Customize coffcode.h */
-
-/* Turn a howto into a reloc number */
-
-#ifdef ONLY_DECLARE_RELOCS
-extern void m68k_rtype2howto (arelent *internal, int relocentry);
-extern int m68k_howto2rtype (reloc_howto_type *);
-extern reloc_howto_type * m68k_reloc_type_lookup
-  (bfd *, bfd_reloc_code_real_type);
-extern reloc_howto_type * m68k_reloc_name_lookup (bfd *, const char *);
-#else
-
-#ifdef STATIC_RELOCS
-#define STAT_REL static
-#else
-#define STAT_REL
-#endif
-
-STAT_REL void m68k_rtype2howto (arelent *, int);
-STAT_REL int  m68k_howto2rtype (reloc_howto_type *);
-STAT_REL reloc_howto_type * m68k_reloc_type_lookup (bfd *, bfd_reloc_code_real_type);
-STAT_REL reloc_howto_type * m68k_reloc_name_lookup (bfd *, const char *);
-
-STAT_REL void
-m68k_rtype2howto (arelent *internal, int relocentry)
-{
-  switch (relocentry)
-    {
-    case R_RELBYTE:	internal->howto = m68kcoff_howto_table + 0; break;
-    case R_RELWORD:	internal->howto = m68kcoff_howto_table + 1; break;
-    case R_RELLONG:	internal->howto = m68kcoff_howto_table + 2; break;
-    case R_PCRBYTE:	internal->howto = m68kcoff_howto_table + 3; break;
-    case R_PCRWORD:	internal->howto = m68kcoff_howto_table + 4; break;
-    case R_PCRLONG:	internal->howto = m68kcoff_howto_table + 5; break;
-    case R_RELLONG_NEG:	internal->howto = m68kcoff_howto_table + 6; break;
-    default:		internal->howto = NULL; break;
-    }
-}
-
-STAT_REL int
-m68k_howto2rtype (reloc_howto_type * internal)
-{
-  if (internal->pc_relative)
-    {
-      switch (internal->bitsize)
-	{
-	case 32: return R_PCRLONG;
-	case 16: return R_PCRWORD;
-	case 8: return R_PCRBYTE;
-	}
-    }
-  else
-    {
-      switch (internal->bitsize)
-	{
-	case 32: return R_RELLONG;
-	case 16: return R_RELWORD;
-	case 8: return R_RELBYTE;
-	}
-    }
-  return R_RELLONG;
-}
-
-STAT_REL reloc_howto_type *
-m68k_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
-			bfd_reloc_code_real_type code)
-{
-  switch (code)
-    {
-    default:			return NULL;
-    case BFD_RELOC_8:		return m68kcoff_howto_table + 0;
-    case BFD_RELOC_16:		return m68kcoff_howto_table + 1;
-    case BFD_RELOC_CTOR:
-    case BFD_RELOC_32:		return m68kcoff_howto_table + 2;
-    case BFD_RELOC_8_PCREL:	return m68kcoff_howto_table + 3;
-    case BFD_RELOC_16_PCREL:	return m68kcoff_howto_table + 4;
-    case BFD_RELOC_32_PCREL:	return m68kcoff_howto_table + 5;
-      /* FIXME: There doesn't seem to be a code for R_RELLONG_NEG.  */
-    }
-  /*NOTREACHED*/
-}
-
-STAT_REL reloc_howto_type *
-m68k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
-			const char *r_name)
-{
-  unsigned int i;
-
-  for (i = 0;
-       i < sizeof (m68kcoff_howto_table) / sizeof (m68kcoff_howto_table[0]);
-       i++)
-    if (m68kcoff_howto_table[i].name != NULL
-	&& strcasecmp (m68kcoff_howto_table[i].name, r_name) == 0)
-      return &m68kcoff_howto_table[i];
-
-  return NULL;
-}
-
-#endif /* not ONLY_DECLARE_RELOCS */
-
-#define RTYPE2HOWTO(internal, relocentry) \
-  m68k_rtype2howto(internal, (relocentry)->r_type)
-
-#define SELECT_RELOC(external, internal) \
-  external.r_type = m68k_howto2rtype (internal)
-
-#define coff_bfd_reloc_type_lookup m68k_reloc_type_lookup
-#define coff_bfd_reloc_name_lookup m68k_reloc_name_lookup
-
-#ifndef COFF_COMMON_ADDEND
-#ifndef coff_rtype_to_howto
-
-#define coff_rtype_to_howto m68kcoff_rtype_to_howto
-
-static reloc_howto_type *
-m68kcoff_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
-			 asection *sec,
-			 struct internal_reloc *rel,
-			 struct coff_link_hash_entry *h ATTRIBUTE_UNUSED,
-			 struct internal_syment *sym ATTRIBUTE_UNUSED,
-			 bfd_vma *addendp)
-{
-  arelent relent;
-  reloc_howto_type *howto;
-
-  relent.howto = NULL;
-  RTYPE2HOWTO (&relent, rel);
-
-  howto = relent.howto;
-
-  if (howto != NULL && howto->pc_relative)
-    *addendp += sec->vma;
-
-  return howto;
-}
-
-#endif /* ! defined (coff_rtype_to_howto) */
-#endif /* ! defined (COFF_COMMON_ADDEND) */
-
-#ifdef COFF_COMMON_ADDEND
-
-/* If COFF_COMMON_ADDEND is defined, then when using m68k COFF the
-   value stored in the .text section for a reference to a common
-   symbol is the value itself plus any desired offset.  (taken from
-   work done by Ian Taylor, Cygnus Support, for I386 COFF).  */
-
-/* If we are producing relocatable output, we need to do some
-   adjustments to the object file that are not done by the
-   bfd_perform_relocation function.  This function is called by every
-   reloc type to make any required adjustments.  */
-
-static bfd_reloc_status_type
-m68kcoff_common_addend_special_fn (bfd *abfd,
-				   arelent *reloc_entry,
-				   asymbol *symbol,
-				   void * data,
-				   asection *input_section ATTRIBUTE_UNUSED,
-				   bfd *output_bfd,
-				   char **error_message ATTRIBUTE_UNUSED)
-{
-  symvalue diff;
-
-  if (output_bfd == (bfd *) NULL)
-    return bfd_reloc_continue;
-
-  if (bfd_is_com_section (symbol->section))
-    {
-      /* We are relocating a common symbol.  The current value in the
-	 object file is ORIG + OFFSET, where ORIG is the value of the
-	 common symbol as seen by the object file when it was compiled
-	 (this may be zero if the symbol was undefined) and OFFSET is
-	 the offset into the common symbol (normally zero, but may be
-	 non-zero when referring to a field in a common structure).
-	 ORIG is the negative of reloc_entry->addend, which is set by
-	 the CALC_ADDEND macro below.  We want to replace the value in
-	 the object file with NEW + OFFSET, where NEW is the value of
-	 the common symbol which we are going to put in the final
-	 object file.  NEW is symbol->value.  */
-      diff = symbol->value + reloc_entry->addend;
-    }
-  else
-    {
-      /* For some reason bfd_perform_relocation always effectively
-	 ignores the addend for a COFF target when producing
-	 relocatable output.  This seems to be always wrong for 386
-	 COFF, so we handle the addend here instead.  */
-      diff = reloc_entry->addend;
-    }
-
-#define DOIT(x) \
-  x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask))
-
-  if (diff != 0)
-    {
-      reloc_howto_type *howto = reloc_entry->howto;
-      unsigned char *addr = (unsigned char *) data + reloc_entry->address;
-
-      if (! bfd_reloc_offset_in_range (howto, abfd, input_section,
-				       reloc_entry->address
-				       * bfd_octets_per_byte (abfd)))
-	return bfd_reloc_outofrange;
-
-      switch (howto->size)
-	{
-	case 0:
-	  {
-	    char x = bfd_get_8 (abfd, addr);
-	    DOIT (x);
-	    bfd_put_8 (abfd, x, addr);
-	  }
-	  break;
-
-	case 1:
-	  {
-	    short x = bfd_get_16 (abfd, addr);
-	    DOIT (x);
-	    bfd_put_16 (abfd, (bfd_vma) x, addr);
-	  }
-	  break;
-
-	case 2:
-	  {
-	    long x = bfd_get_32 (abfd, addr);
-	    DOIT (x);
-	    bfd_put_32 (abfd, (bfd_vma) x, addr);
-	  }
-	  break;
-
-	default:
-	  abort ();
-	}
-    }
-
-  /* Now let bfd_perform_relocation finish everything up.  */
-  return bfd_reloc_continue;
-}
-
-/* Compute the addend of a reloc.  If the reloc is to a common symbol,
-   the object file contains the value of the common symbol.  By the
-   time this is called, the linker may be using a different symbol
-   from a different object file with a different value.  Therefore, we
-   hack wildly to locate the original symbol from this file so that we
-   can make the correct adjustment.  This macro sets coffsym to the
-   symbol from the original file, and uses it to set the addend value
-   correctly.  If this is not a common symbol, the usual addend
-   calculation is done, except that an additional tweak is needed for
-   PC relative relocs.
-   FIXME: This macro refers to symbols and asect; these are from the
-   calling function, not the macro arguments.  */
-
-#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr)		\
-  {								\
-    coff_symbol_type *coffsym = (coff_symbol_type *) NULL;	\
-    if (ptr && bfd_asymbol_bfd (ptr) != abfd)			\
-      coffsym = (obj_symbols (abfd)				\
-		 + (cache_ptr->sym_ptr_ptr - symbols));		\
-    else if (ptr)						\
-      coffsym = coff_symbol_from (ptr);				\
-    if (coffsym != (coff_symbol_type *) NULL			\
-	&& coffsym->native->u.syment.n_scnum == 0)		\
-      cache_ptr->addend = - coffsym->native->u.syment.n_value;	\
-    else if (ptr && bfd_asymbol_bfd (ptr) == abfd		\
-	     && ptr->section != (asection *) NULL)		\
-      cache_ptr->addend = - (ptr->section->vma + ptr->value);	\
-    else							\
-      cache_ptr->addend = 0;					\
-    if (ptr && (reloc.r_type == R_PCRBYTE			\
-		|| reloc.r_type == R_PCRWORD			\
-		|| reloc.r_type == R_PCRLONG))			\
-      cache_ptr->addend += asect->vma;				\
-  }
-
-#ifndef coff_rtype_to_howto
-
-/* coff-m68k.c uses the special COFF backend linker.  We need to
-   adjust common symbols.  */
-
-static reloc_howto_type *
-m68kcoff_common_addend_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
-				       asection *sec,
-				       struct internal_reloc *rel,
-				       struct coff_link_hash_entry *h,
-				       struct internal_syment *sym,
-				       bfd_vma *addendp)
-{
-  arelent relent;
-  reloc_howto_type *howto;
-
-  relent.howto = NULL;
-  RTYPE2HOWTO (&relent, rel);
-
-  howto = relent.howto;
-
-  if (howto->pc_relative)
-    *addendp += sec->vma;
-
-  if (sym != NULL && sym->n_scnum == 0 && sym->n_value != 0)
-    {
-      /* This is a common symbol.  The section contents include the
-	 size (sym->n_value) as an addend.  The relocate_section
-	 function will be adding in the final value of the symbol.  We
-	 need to subtract out the current size in order to get the
-	 correct result.  */
-      BFD_ASSERT (h != NULL);
-      *addendp -= sym->n_value;
-    }
-
-  /* If the output symbol is common (in which case this must be a
-     relocatable link), we need to add in the final size of the
-     common symbol.  */
-  if (h != NULL && h->root.type == bfd_link_hash_common)
-    *addendp += h->root.u.c.size;
-
-  return howto;
-}
-
-#define coff_rtype_to_howto m68kcoff_common_addend_rtype_to_howto
-
-#endif /* ! defined (coff_rtype_to_howto) */
-
-#endif /* COFF_COMMON_ADDEND */
-
-#if !defined ONLY_DECLARE_RELOCS && ! defined STATIC_RELOCS
-/* Given a .data section and a .emreloc in-memory section, store
-   relocation information into the .emreloc section which can be
-   used at runtime to relocate the section.  This is called by the
-   linker when the --embedded-relocs switch is used.  This is called
-   after the add_symbols entry point has been called for all the
-   objects, and before the final_link entry point is called.  */
-
-bfd_boolean
-bfd_m68k_coff_create_embedded_relocs (bfd *abfd,
-				      struct bfd_link_info *info,
-				      asection *datasec,
-				      asection *relsec,
-				      char **errmsg)
-{
-  char *extsyms;
-  bfd_size_type symesz;
-  struct internal_reloc *irel, *irelend;
-  bfd_byte *p;
-  bfd_size_type amt;
-
-  BFD_ASSERT (! bfd_link_relocatable (info));
-
-  *errmsg = NULL;
-
-  if (datasec->reloc_count == 0)
-    return TRUE;
-
-  extsyms = obj_coff_external_syms (abfd);
-  symesz = bfd_coff_symesz (abfd);
-
-  irel = _bfd_coff_read_internal_relocs (abfd, datasec, TRUE, NULL, FALSE,
-					 NULL);
-  irelend = irel + datasec->reloc_count;
-
-  amt = (bfd_size_type) datasec->reloc_count * 12;
-  relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt);
-  if (relsec->contents == NULL)
-    return FALSE;
-
-  p = relsec->contents;
-
-  for (; irel < irelend; irel++, p += 12)
-    {
-      asection *targetsec;
-
-      /* We are going to write a four byte longword into the runtime
-       reloc section.  The longword will be the address in the data
-       section which must be relocated.  It is followed by the name
-       of the target section NUL-padded or truncated to 8
-       characters.  */
-
-      /* We can only relocate absolute longword relocs at run time.  */
-      if (irel->r_type != R_RELLONG)
-	{
-	  *errmsg = _("unsupported relocation type");
-	  bfd_set_error (bfd_error_bad_value);
-	  return FALSE;
-	}
-
-      if (irel->r_symndx == -1)
-	targetsec = bfd_abs_section_ptr;
-      else
-	{
-	  struct coff_link_hash_entry *h;
-
-	  h = obj_coff_sym_hashes (abfd)[irel->r_symndx];
-	  if (h == NULL)
-	    {
-	      struct internal_syment isym;
-
-	      bfd_coff_swap_sym_in (abfd, extsyms + symesz * irel->r_symndx,
-				    &isym);
-	      targetsec = coff_section_from_bfd_index (abfd, isym.n_scnum);
-	    }
-	  else if (h->root.type == bfd_link_hash_defined
-		   || h->root.type == bfd_link_hash_defweak)
-	    targetsec = h->root.u.def.section;
-	  else
-	    targetsec = NULL;
-	}
-
-      bfd_put_32 (abfd,
-		  (irel->r_vaddr - datasec->vma + datasec->output_offset), p);
-      memset (p + 4, 0, 8);
-      if (targetsec != NULL)
-	strncpy ((char *) p + 4, targetsec->output_section->name, 8);
-    }
-
-  return TRUE;
-}
-#endif /* neither ONLY_DECLARE_RELOCS not STATIC_RELOCS  */
-
-#define coff_bfd_is_local_label_name m68k_coff_is_local_label_name
-
-#define coff_relocate_section _bfd_coff_generic_relocate_section
-
-#ifndef bfd_pe_print_pdata
-#define bfd_pe_print_pdata	NULL
-#endif
-
-#include "coffcode.h"
-
-#ifndef TARGET_SYM
-#define TARGET_SYM m68k_coff_vec
-#endif
-
-#ifndef TARGET_NAME
-#define TARGET_NAME "coff-m68k"
-#endif
-
-#ifdef NAMES_HAVE_UNDERSCORE
-CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL, COFF_SWAP_TABLE)
-#else
-CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, 0, NULL, COFF_SWAP_TABLE)
-#endif
diff --git a/bfd/coff-svm68k.c b/bfd/coff-svm68k.c
deleted file mode 100644
index ae12b49..0000000
--- a/bfd/coff-svm68k.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* BFD back-end for Motorola sysv68
-   Copyright (C) 1997-2018 Free Software Foundation, Inc.
-   Written by Philippe De Muyter <phdm@info.ucl.ac.be>.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-#define TARGET_SYM	m68k_coff_sysv_vec
-#define TARGET_NAME	"coff-m68k-sysv"
-#define STATIC_RELOCS
-#define COFF_COMMON_ADDEND
-
-#include "coff-m68k.c"
diff --git a/bfd/coff-u68k.c b/bfd/coff-u68k.c
deleted file mode 100644
index cbdb6aa..0000000
--- a/bfd/coff-u68k.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* BFD back-end for Motorola 68000 COFF binaries having underscore with name.
-   Copyright (C) 1990-2018 Free Software Foundation, Inc.
-   Written by Cygnus Support.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-#define TARGET_SYM	m68k_coff_un_vec
-#define TARGET_NAME	"coff-m68k-un"
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* define this to not have multiple copy of m68k_rtype2howto
-   in the executable file */
-#define ONLY_DECLARE_RELOCS
-
-/* This magic number indicates that the names have underscores.
-   Other 68k magic numbers indicate that the names do not have
-   underscores.  */
-#define BADMAG(x) ((x).f_magic != MC68KBCSMAGIC)
-
-#include "coff-m68k.c"
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 8674850..c63ebd2 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -2103,7 +2103,7 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr)
     case I386MAGIC:
     case I386PTXMAGIC:
     case I386AIXMAGIC:		/* Danbury PS/2 AIX C Compiler.  */
-    case LYNXCOFFMAGIC:		/* Shadows the m68k Lynx number below, sigh.  */
+    case LYNXCOFFMAGIC:
       arch = bfd_arch_i386;
       break;
 #endif
@@ -2145,22 +2145,6 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr)
 	}
       break;
 #endif
-#ifdef MC68MAGIC
-    case MC68MAGIC:
-    case M68MAGIC:
-#ifdef MC68KBCSMAGIC
-    case MC68KBCSMAGIC:
-#endif
-#ifdef APOLLOM68KMAGIC
-    case APOLLOM68KMAGIC:
-#endif
-#ifdef LYNXCOFFMAGIC
-    case LYNXCOFFMAGIC:
-#endif
-      arch = bfd_arch_m68k;
-      machine = bfd_mach_m68020;
-      break;
-#endif
 #ifdef Z80MAGIC
     case Z80MAGIC:
       arch = bfd_arch_z80;
@@ -2792,25 +2776,6 @@ coff_set_flags (bfd * abfd,
       return TRUE;
 #endif
 
-#ifdef MC68MAGIC
-    case bfd_arch_m68k:
-#ifdef APOLLOM68KMAGIC
-      *magicp = APOLLO_COFF_VERSION_NUMBER;
-#else
-      /* NAMES_HAVE_UNDERSCORE may be defined by coff-u68k.c.  */
-#ifdef NAMES_HAVE_UNDERSCORE
-      *magicp = MC68KBCSMAGIC;
-#else
-      *magicp = MC68MAGIC;
-#endif
-#endif
-#ifdef LYNXOS
-      /* Just overwrite the usual value if we're doing Lynx.  */
-      *magicp = LYNXCOFFMAGIC;
-#endif
-      return TRUE;
-#endif
-
 #ifdef SH_ARCH_MAGIC_BIG
     case bfd_arch_sh:
 #ifdef COFF_IMAGE_WITH_PE
@@ -3870,28 +3835,6 @@ coff_write_object_contents (bfd * abfd)
 #define __A_MAGIC_SET__
 #endif /* TIC80 */
 
-#if APOLLO_M68
-#define __A_MAGIC_SET__
-    internal_a.magic = APOLLO_COFF_VERSION_NUMBER;
-#endif
-
-#if defined(M68) || defined(M68K)
-#define __A_MAGIC_SET__
-#if defined(LYNXOS)
-    internal_a.magic = LYNXCOFFMAGIC;
-#else
-#if defined(TARG_AUX)
-    internal_a.magic = (abfd->flags & D_PAGED ? PAGEMAGICPEXECPAGED :
-			abfd->flags & WP_TEXT ? PAGEMAGICPEXECSWAPPED :
-			PAGEMAGICEXECSWAPPED);
-#else
-#if defined (PAGEMAGICPEXECPAGED)
-    internal_a.magic = PAGEMAGICPEXECPAGED;
-#endif
-#endif /* TARG_AUX */
-#endif /* LYNXOS */
-#endif /* M68 || M68K */
-
 #if defined(ARM)
 #define __A_MAGIC_SET__
     internal_a.magic = ZMAGIC;
diff --git a/bfd/coffswap.h b/bfd/coffswap.h
index 844d601..d1dfb1f 100644
--- a/bfd/coffswap.h
+++ b/bfd/coffswap.h
@@ -618,13 +618,6 @@ coff_swap_aouthdr_in (bfd * abfd, void * aouthdr_ext1, void * aouthdr_int1)
   aouthdr_int->data_start =
     GET_AOUTHDR_DATA_START (abfd, aouthdr_ext->data_start);
 
-#ifdef APOLLO_M68
-  H_PUT_32 (abfd, aouthdr_int->o_inlib, aouthdr_ext->o_inlib);
-  H_PUT_32 (abfd, aouthdr_int->o_sri, aouthdr_ext->o_sri);
-  H_PUT_32 (abfd, aouthdr_int->vid[0], aouthdr_ext->vid);
-  H_PUT_32 (abfd, aouthdr_int->vid[1], aouthdr_ext->vid + 4);
-#endif
-
 #ifdef RS6000COFF_C
 #ifdef XCOFF64
   aouthdr_int->o_toc = H_GET_64 (abfd, aouthdr_ext->o_toc);
diff --git a/bfd/config.bfd b/bfd/config.bfd
index f9c9f33..10bc1df 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -77,16 +77,6 @@ case $targ in
  i[3-7]86-*-os9k | \
  i[3-7]86-none-* | \
  i[3-7]86-*-aout* | i[3-7]86*-*-vsta* | \
- m68*-motorola-sysv* | m68*-hp-bsd* | m68*-*-aout* | \
- m68*-*-coff* | m68*-*-sysv* | \
- m68*-*-hpux* | \
- m68*-*-linux*aout* | \
- m68*-hp*-netbsd* | \
- m68*-*-netbsdaout* | \
- m68*-*-sunos* | m68*-*-os68k* | m68*-*-vxworks* | m68*-netx-* | \
- m68*-*-bsd* | m68*-*-vsta* | \
- m68*-ericsson-* | \
- m68*-*-psos* | \
  mips*-big-* | \
  mips*-dec-* | mips*el-*-ecoff* | \
  mips*-*-ecoff* | \
@@ -113,6 +103,9 @@ case $targ in
 esac
 
 case $targ in
+ m68*-*-netbsdelf*)
+    # Not obsolete
+    ;;
  *-adobe-* | \
  *-go32-rtems* | \
  *-sony-* | \
@@ -129,10 +122,24 @@ case $targ in
  i370-* | \
  i860-*-* | \
  i960-*-* | \
+ m68*-*-*bsd* | \
+ m68*-*-aout* | \
+ m68*-*-coff* | \
+ m68*-*-hpux* | \
+ m68*-*-linux*aout* | \
  m68*-*-lynxos* | \
+ m68*-*-os68k* | \
+ m68*-*-psos* | \
+ m68*-*-sunos* | \
+ m68*-*-sysv* | \
+ m68*-*-vsta* | \
+ m68*-*-vxworks* | \
  m68*-apollo-* | \
  m68*-apple-aux* | \
  m68*-bull-sysv* | \
+ m68*-ericsson-* | \
+ m68*-motorola-sysv* | \
+ m68*-netx-* | \
  m88*-*-* | \
  maxq-*-coff | \
  mips*el-*-rtems* | \
@@ -526,7 +533,6 @@ case "${targ}" in
 
   fido-*-elf* )
     targ_defvec=m68k_elf32_vec
-    targ_selvecs="m68k_coff_vec"
     ;;
 
   fr30-*-elf)
@@ -906,83 +912,8 @@ case "${targ}" in
     targ_selvecs="m68hc11_elf32_vec m68hc12_elf32_vec"
     ;;
 
-  m68*-motorola-sysv*)
-    targ_defvec=m68k_coff_sysv_vec
-    ;;
-  m68*-hp-bsd*)
-    targ_defvec=m68k_aout_hp300bsd_vec
-    targ_underscore=yes
-    ;;
-  m68*-*-aout*)
-    targ_defvec=aout0_be_vec
-    # We include core_cisco_be_vec here, rather than making a separate cisco
-    # configuration, so that cisco-core.c gets routinely tested at
-    # least for compilation.
-    targ_selvecs="core_cisco_be_vec"
-    targ_underscore=yes
-    ;;
-  m68*-*-elf* | m68*-*-sysv4* | m68*-*-rtems* | m68*-*-uclinux*)
-    targ_defvec=m68k_elf32_vec
-    targ_selvecs="m68k_coff_vec"
-    ;;
-  m68*-*-coff* | m68*-*-sysv*)
-    targ_defvec=m68k_coff_vec
-    targ_selvecs="m68k_coff_vec m68k_versados_vec"
-    ;;
-  m68*-*-hpux*)
-    targ_defvec=m68k_aout_hp300hpux_vec
-    targ_underscore=yes
-    ;;
-  m68*-*-linux*aout*)
-    targ_defvec=m68k_aout_linux_vec
-    targ_selvecs=m68k_elf32_vec
-    targ_underscore=yes
-    ;;
-  m68*-*-linux-*)
+  m68*-*-*)
     targ_defvec=m68k_elf32_vec
-    targ_selvecs=m68k_aout_linux_vec
-    ;;
-  m68*-*-gnu*)
-    targ_defvec=m68k_elf32_vec
-    # targ_selvecs=m68kmach3_vec
-    # targ_cflags=-DSTAT_FOR_EXEC
-    ;;
-  m68*-hp*-netbsd*)
-    targ_defvec=m68k_aout_4knbsd_vec
-    targ_selvecs="m68k_aout_nbsd_vec m68k_aout_hp300bsd_vec sparc_aout_sunos_be_vec"
-    targ_underscore=yes
-    ;;
-  m68*-*-netbsdelf*)
-    targ_defvec=m68k_elf32_vec
-    targ_selvecs="m68k_aout_nbsd_vec m68k_aout_4knbsd_vec m68k_aout_hp300bsd_vec sparc_aout_sunos_be_vec"
-    ;;
-  m68*-*-netbsdaout* | m68*-*-netbsd*)
-    targ_defvec=m68k_aout_nbsd_vec
-    targ_selvecs="m68k_aout_4knbsd_vec m68k_elf32_vec m68k_aout_hp300bsd_vec sparc_aout_sunos_be_vec"
-    targ_underscore=yes
-    ;;
-  m68*-*-openbsd*)
-    targ_defvec=m68k_aout_nbsd_vec
-    targ_selvecs="m68k_aout_4knbsd_vec m68k_aout_hp300bsd_vec sparc_aout_sunos_be_vec"
-    targ_underscore=yes
-    ;;
-  m68*-*-sunos* | m68*-*-os68k* | m68*-*-vxworks* | m68*-netx-* | \
-  m68*-*-bsd* | m68*-*-vsta*)
-    targ_defvec=sparc_aout_sunos_be_vec
-    targ_underscore=yes
-    ;;
-  m68*-ericsson-*)
-    targ_defvec=sparc_aout_sunos_be_vec
-    targ_selvecs="m68k_coff_vec m68k_versados_vec tekhex_vec"
-    targ_underscore=yes
-    ;;
-  m68*-cbm-*)
-    targ_defvec=m68k_elf32_vec
-    targ_selvecs=m68k_coff_vec
-    ;;
-  m68*-*-psos*)
-    targ_defvec=m68k_elf32_vec
-    targ_underscore=yes
     ;;
 
   mcore-*-elf)
diff --git a/bfd/configure b/bfd/configure
index 079ab66..6f7916f 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -14445,18 +14445,7 @@ do
     m32r_elf32_linux_le_vec)	 tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
     m68hc11_elf32_vec)		 tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
     m68hc12_elf32_vec)		 tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
-    m68k_aout_4knbsd_vec)	 tb="$tb m68k4knetbsd.lo aout32.lo" ;;
-    m68k_aout_hp300bsd_vec)	 tb="$tb hp300bsd.lo aout32.lo" ;;
-    m68k_aout_hp300hpux_vec)	 tb="$tb hp300hpux.lo aout32.lo" ;;
-    m68k_aout_linux_vec)	 tb="$tb m68klinux.lo aout32.lo" ;;
-    m68k_aout_nbsd_vec)		 tb="$tb m68knetbsd.lo aout32.lo" ;;
-    m68k_coff_vec)		 tb="$tb coff-m68k.lo $coff" ;;
-    m68k_coff_apollo_vec)	 tb="$tb coff-apollo.lo $coffgen" ;;
-    m68k_coff_aux_vec)		 tb="$tb coff-aux.lo coff-m68k.lo $coff" ;;
-    m68k_coff_sysv_vec)		 tb="$tb coff-svm68k.lo $coff" ;;
-    m68k_coff_un_vec)		 tb="$tb coff-u68k.lo coff-m68k.lo $coff" ;;
     m68k_elf32_vec)		 tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
-    m68k_versados_vec)		 tb="$tb versados.lo" ;;
     mach_o_be_vec)		 tb="$tb mach-o.lo dwarf2.lo" ;;
     mach_o_le_vec)		 tb="$tb mach-o.lo dwarf2.lo" ;;
     mach_o_fat_vec)		 tb="$tb mach-o.lo dwarf2.lo" ;;
@@ -14862,30 +14851,13 @@ if test "${target}" = "${host}"; then
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/riscos.h"'
 	;;
-  m68*-bull*-sysv*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/dpx2.h"'
-	;;
-  m68*-hp-hpux*)	COREFILE=hpux-core.lo ;;
-  m68*-hp-bsd*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/hp300bsd.h"'
-	;;
   m68*-*-linux-*)
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/m68klinux.h"'
 	;;
-  m68*-motorola-sysv*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/delta68.h"'
-	;;
-  m68*-*-netbsd* | m68*-*-openbsd*)
+  m68*-*-netbsd*)
 	COREFILE=netbsd-core.lo
 	;;
-  m68*-apple-aux*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/m68kaux.h"'
-	;;
   ns32k-pc532-mach)
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/pc532mach.h"'
diff --git a/bfd/configure.ac b/bfd/configure.ac
index 7eba3c6..b8bb5ca 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -522,18 +522,7 @@ do
     m32r_elf32_linux_le_vec)	 tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
     m68hc11_elf32_vec)		 tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
     m68hc12_elf32_vec)		 tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
-    m68k_aout_4knbsd_vec)	 tb="$tb m68k4knetbsd.lo aout32.lo" ;;
-    m68k_aout_hp300bsd_vec)	 tb="$tb hp300bsd.lo aout32.lo" ;;
-    m68k_aout_hp300hpux_vec)	 tb="$tb hp300hpux.lo aout32.lo" ;;
-    m68k_aout_linux_vec)	 tb="$tb m68klinux.lo aout32.lo" ;;
-    m68k_aout_nbsd_vec)		 tb="$tb m68knetbsd.lo aout32.lo" ;;
-    m68k_coff_vec)		 tb="$tb coff-m68k.lo $coff" ;;
-    m68k_coff_apollo_vec)	 tb="$tb coff-apollo.lo $coffgen" ;;
-    m68k_coff_aux_vec)		 tb="$tb coff-aux.lo coff-m68k.lo $coff" ;;
-    m68k_coff_sysv_vec)		 tb="$tb coff-svm68k.lo $coff" ;;
-    m68k_coff_un_vec)		 tb="$tb coff-u68k.lo coff-m68k.lo $coff" ;;
     m68k_elf32_vec)		 tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
-    m68k_versados_vec)		 tb="$tb versados.lo" ;;
     mach_o_be_vec)		 tb="$tb mach-o.lo dwarf2.lo" ;;
     mach_o_le_vec)		 tb="$tb mach-o.lo dwarf2.lo" ;;
     mach_o_fat_vec)		 tb="$tb mach-o.lo dwarf2.lo" ;;
@@ -948,30 +937,13 @@ changequote([,])dnl
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/riscos.h"'
 	;;
-  m68*-bull*-sysv*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/dpx2.h"'
-	;;
-  m68*-hp-hpux*)	COREFILE=hpux-core.lo ;;
-  m68*-hp-bsd*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/hp300bsd.h"'
-	;;
   m68*-*-linux-*)
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/m68klinux.h"'
 	;;
-  m68*-motorola-sysv*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/delta68.h"'
-	;;
-  m68*-*-netbsd* | m68*-*-openbsd*)
+  m68*-*-netbsd*)
 	COREFILE=netbsd-core.lo
 	;;
-  m68*-apple-aux*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/m68kaux.h"'
-	;;
   ns32k-pc532-mach)
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/pc532mach.h"'
diff --git a/bfd/configure.host b/bfd/configure.host
index 486de7f..fe66a58 100644
--- a/bfd/configure.host
+++ b/bfd/configure.host
@@ -72,8 +72,6 @@ mips*-*-sysv4*)		;;
 mips*-*-sysv*)		HDEFINES="-G 4" ;;
 mips*-*-riscos*)	HDEFINES="-G 4" ;;
 
-m68*-hp-hpux*)		HDEFINES=-DHOST_HP300HPUX ;;
-
 # Some Solaris systems (osol0906 at least) have a libc that doesn't recognise
 # the "MS-ANSI" code page name, so we define an override for CP_ACP (sets the
 # default code page used by windres/windmc when not specified by a commandline
diff --git a/bfd/doc/bfd.texinfo b/bfd/doc/bfd.texinfo
index 8f925a1..143cb5e 100644
--- a/bfd/doc/bfd.texinfo
+++ b/bfd/doc/bfd.texinfo
@@ -293,7 +293,6 @@ structures.
 * elf  ::	elf backends
 * mmo  ::	mmo backend
 @ignore
-* oasys ::	oasys backends
 * srecord ::	s-record backend
 @end ignore
 @end menu
diff --git a/bfd/doc/bfdint.texi b/bfd/doc/bfdint.texi
index c9f8942..bcab35e 100644
--- a/bfd/doc/bfdint.texi
+++ b/bfd/doc/bfdint.texi
@@ -336,8 +336,6 @@ COFF.
 ECOFF.
 @item bfd_target_elf_flavour
 ELF.
-@item bfd_target_oasys_flavour
-OASYS.
 @item bfd_target_tekhex_flavour
 Tektronix hex format.
 @item bfd_target_srec_flavour
diff --git a/bfd/freebsd.h b/bfd/freebsd.h
index 8d7e3f8..8bb36fe 100644
--- a/bfd/freebsd.h
+++ b/bfd/freebsd.h
@@ -80,12 +80,6 @@ MY (write_object_contents) (bfd *abfd)
   /* Magic number, maestro, please!  */
   switch (bfd_get_arch(abfd))
     {
-    case bfd_arch_m68k:
-      if (strcmp (abfd->xvec->name, "a.out-m68k4k-netbsd") == 0)
-	N_SET_MACHTYPE (execp, M_68K4K_NETBSD);
-      else
-	N_SET_MACHTYPE (execp, M_68K_NETBSD);
-      break;
     case bfd_arch_sparc:
       N_SET_MACHTYPE (execp, M_SPARC_NETBSD);
       break;
diff --git a/bfd/gen-aout.c b/bfd/gen-aout.c
index 34086f0..02fc8f8 100644
--- a/bfd/gen-aout.c
+++ b/bfd/gen-aout.c
@@ -93,9 +93,6 @@ main (int argc, char** argv)
 #ifdef vax
   arch = "vax";
 #endif
-#ifdef m68k
-  arch = "m68k";
-#endif
   if (arch[0] == '1')
     {
       fprintf (stderr, _("warning: preprocessor substituted architecture name inside string;"));
diff --git a/bfd/hosts/delta68.h b/bfd/hosts/delta68.h
deleted file mode 100644
index cd61820..0000000
--- a/bfd/hosts/delta68.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-/* Definitions for a Motorola Delta 3300 box running System V R3.0.
-   Contributed by manfred@lts.sel.alcatel.de.  */
-
-#include <sys/param.h>
-
-/* Definitions used by trad-core.c.  */
-#define	NBPG			NBPC
-#define	HOST_DATA_START_ADDR	u.u_exdata.ux_datorg
-#define	HOST_TEXT_START_ADDR	u.u_exdata.ux_txtorg
-/* User's stack, copied from sys/param.h  */
-#define HOST_STACK_END_ADDR	USRSTACK
-#define	UPAGES			USIZE
-#define	TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(abfd) \
-  abfd->tdata.trad_core_data->u.u_abort
diff --git a/bfd/hosts/hp300bsd.h b/bfd/hosts/hp300bsd.h
deleted file mode 100644
index fb0725f..0000000
--- a/bfd/hosts/hp300bsd.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-#include <sys/param.h>
-#ifdef BSD4_4
-#define NO_CORE_COMMAND
-#endif
-
-#define	HOST_PAGE_SIZE		NBPG
-#define	HOST_SEGMENT_SIZE	NBPG	/* Data seg start addr rounds to NBPG */
-#define	HOST_MACHINE_ARCH	bfd_arch_m68k
-/* #define	HOST_MACHINE_MACHINE	 */
-
-#define	HOST_TEXT_START_ADDR		0
-#define	HOST_STACK_END_ADDR		0xfff00000
-#define	HOST_BIG_ENDIAN_P
diff --git a/bfd/hosts/m68kaux.h b/bfd/hosts/m68kaux.h
deleted file mode 100644
index 87da682..0000000
--- a/bfd/hosts/m68kaux.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-/* Definitions for an Apple Macintosh running A/UX 3.x. */
-
-#include <sys/param.h>
-#include <sys/page.h>
-
-/* Definitions used by trad-core.c.  */
-#define	NBPG			NBPP
-
-#define	HOST_DATA_START_ADDR	u.u_exdata.ux_datorg
-#define	HOST_TEXT_START_ADDR	u.u_exdata.ux_txtorg
-#define	HOST_STACK_END_ADDR	0x100000000
-
-#define	UPAGES			USIZE
-
-#define	TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(abfd) \
-  (abfd->tdata.trad_core_data->u.u_arg[0])
diff --git a/bfd/hosts/news.h b/bfd/hosts/news.h
deleted file mode 100644
index 80cc911..0000000
--- a/bfd/hosts/news.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-/* Sony News running NewsOS 3.2.  */
-
-#include <machine/vmparam.h>
-
-#define HOST_PAGE_SIZE NBPG
-#define HOST_SEGMENT_SIZE NBPG
-#define HOST_MACHINE_ARCH bfd_arch_m68k
-#define HOST_TEXT_START_ADDR 0
-#define HOST_STACK_END_ADDR (KERNBASE - (UPAGES * NBPG))
diff --git a/bfd/hp300bsd.c b/bfd/hp300bsd.c
deleted file mode 100644
index 502f31a..0000000
--- a/bfd/hp300bsd.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* BFD back-end for HP 9000/300 (68000-based) machines running BSD Unix.
-   Copyright (C) 1992-2018 Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-#define TARGET_IS_BIG_ENDIAN_P
-#define N_HEADER_IN_TEXT(x) 0
-#define ENTRY_CAN_BE_ZERO
-#define TEXT_START_ADDR 0
-#define TARGET_PAGE_SIZE 4096
-#define SEGMENT_SIZE TARGET_PAGE_SIZE
-#define DEFAULT_ARCH bfd_arch_m68k
-
-/* Do not "beautify" the CONCAT* macro args.  Traditional C will not
-   remove whitespace added here, and thus will fail to concatenate
-   the tokens.  */
-#define MY(OP) CONCAT2 (m68k_aout_hp300bsd_,OP)
-#define TARGETNAME "a.out-hp300bsd"
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-#include "libaout.h"
-
-#include "aout-target.h"
diff --git a/bfd/hp300hpux.c b/bfd/hp300hpux.c
deleted file mode 100644
index f51092a..0000000
--- a/bfd/hp300hpux.c
+++ /dev/null
@@ -1,855 +0,0 @@
-/* BFD backend for hp-ux 9000/300
-   Copyright (C) 1990-2018 Free Software Foundation, Inc.
-   Written by Glenn Engel.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-
-/*  hpux native	 ------------> |	       |
-			       | hp300hpux bfd | ----------> hpux w/gnu ext
-    hpux w/gnu extension ----> |	       |
-
-    Support for the 9000/[34]00 has several limitations.
-      1. Shared libraries are not supported.
-      2. The output format from this bfd is not usable by native tools.
-
-    The primary motivation for writing this bfd was to allow use of
-    gdb and gcc for host based debugging and not to mimic the hp-ux tools
-    in every detail.  This leads to a significant simplification of the
-    code and a leap in performance.  The decision to not output hp native
-    compatible objects was further strengthened by the fact that the richness
-    of the gcc compiled objects could not be represented without loss of
-    information.  For example, while the hp format supports the concept of
-    secondary symbols, it does not support indirect symbols.  Another
-    reason is to maintain backwards compatibility with older implementations
-    of gcc on hpux which used 'hpxt' to translate .a and .o files into a
-    format which could be readily understood by the gnu linker and gdb.
-    This allows reading hp secondary symbols and converting them into
-    indirect symbols but the reverse it not always possible.
-
-    Another example of differences is that the hp format stores symbol offsets
-    in the object code while the gnu utilities use a field in the
-    relocation record for this.  To support the hp native format, the object
-    code would need to be patched with the offsets when producing .o files.
-
-    The basic technique taken in this implementation is to #include the code
-    from aoutx.h and aout-target.h with appropriate #defines to override
-    code where a unique implementation is needed:
-
-    {
-	#define a bunch of stuff
-	#include <aoutx.h>
-
-	implement a bunch of functions
-
-	#include "aout-target.h"
-    }
-
-    The hp symbol table is a bit different than other a.out targets.  Instead
-    of having an array of nlist items and an array of strings, hp's format
-    has them mixed together in one structure.  In addition, the strings are
-    not null terminated.  It looks something like this:
-
-    nlist element 1
-    string1
-    nlist element 2
-    string2
-    ...
-
-    The whole symbol table is read as one chunk and then we march thru it
-    and convert it to canonical form.  As we march thru the table, we copy
-    the nlist data into the internal form and we compact the strings and null
-    terminate them, using storage from the already allocated symbol table:
-
-    string1
-    null
-    string2
-    null
- */
-
-/* @@ Is this really so different from normal a.out that it needs to include
-   aoutx.h?  We should go through this file sometime and see what can be made
-   more dependent on aout32.o and what might need to be broken off and accessed
-   through the backend_data field.  Or, maybe we really do need such a
-   completely separate implementation.  I don't have time to investigate this
-   much further right now.  [raeburn:19930428.2124EST] */
-/* @@ Also, note that there wind up being two versions of some routines, with
-   different names, only one of which actually gets used.  For example:
-	slurp_symbol_table
-	swap_std_reloc_in
-	slurp_reloc_table
-	canonicalize_symtab
-	get_symtab_upper_bound
-	canonicalize_reloc
-	mkobject
-   This should also be fixed.  */
-
-#define TARGETNAME "a.out-hp300hpux"
-
-/* Do not "beautify" the CONCAT* macro args.  Traditional C will not
-   remove whitespace added here, and thus will fail to concatenate
-   the tokens.  */
-#define MY(OP) CONCAT2 (m68k_aout_hp300hpux_,OP)
-
-#define external_exec hp300hpux_exec_bytes
-#define external_nlist hp300hpux_nlist_bytes
-
-#include "aout/hp300hpux.h"
-
-/* define these so we can compile unused routines in aoutx.h */
-#define e_strx  e_shlib
-#define e_other e_length
-#define e_desc  e_almod
-
-#define AR_PAD_CHAR '/'
-#define TARGET_IS_BIG_ENDIAN_P
-#define DEFAULT_ARCH bfd_arch_m68k
-
-#define MY_get_section_contents aout_32_get_section_contents
-#define MY_slurp_armap bfd_slurp_bsd_armap_f2
-
-/***********************************************/
-/* provide overrides for routines in this file */
-/***********************************************/
-/* these don't use MY because that causes problems within JUMP_TABLE
-   (CONCAT2 winds up being expanded recursively, which ANSI C compilers
-   will not do).  */
-#define MY_canonicalize_symtab m68k_aout_hp300hpux_canonicalize_symtab
-#define MY_get_symtab_upper_bound m68k_aout_hp300hpux_get_symtab_upper_bound
-#define MY_canonicalize_reloc m68k_aout_hp300hpux_canonicalize_reloc
-#define MY_write_object_contents m68k_aout_hp300hpux_write_object_contents
-
-#define MY_read_minisymbols _bfd_generic_read_minisymbols
-#define MY_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-
-#define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define MY_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define MY_final_link_callback unused
-#define MY_bfd_final_link _bfd_generic_final_link
-
-/* Until and unless we convert the slurp_reloc and slurp_symtab
-   routines in this file, we can not use the default aout
-   free_cached_info routine which assumes that the relocs and symtabs
-   were allocated using malloc.  */
-#define MY_bfd_free_cached_info _bfd_bool_bfd_true
-
-#define m68k_aout_hp300hpux_write_syms aout_32_write_syms
-
-#define MY_callback MY(callback)
-
-#define MY_exec_hdr_flags 0x2
-
-#define NAME_swap_exec_header_in NAME(hp300hpux_32_,swap_exec_header_in)
-
-#define HP_SYMTYPE_UNDEFINED	0x00
-#define HP_SYMTYPE_ABSOLUTE	0x01
-#define HP_SYMTYPE_TEXT		0x02
-#define HP_SYMTYPE_DATA		0x03
-#define HP_SYMTYPE_BSS		0x04
-#define HP_SYMTYPE_COMMON	0x05
-
-#define HP_SYMTYPE_TYPE		0x0F
-#define HP_SYMTYPE_FILENAME	0x1F
-
-#define HP_SYMTYPE_ALIGN	0x10
-#define HP_SYMTYPE_EXTERNAL	0x20
-#define HP_SECONDARY_SYMBOL	0x40
-
-/* RELOCATION DEFINITIONS */
-#define HP_RSEGMENT_TEXT	0x00
-#define HP_RSEGMENT_DATA	0x01
-#define HP_RSEGMENT_BSS		0x02
-#define HP_RSEGMENT_EXTERNAL	0x03
-#define HP_RSEGMENT_PCREL	0x04
-#define HP_RSEGMENT_RDLT	0x05
-#define HP_RSEGMENT_RPLT	0x06
-#define HP_RSEGMENT_NOOP	0x3F
-
-#define HP_RLENGTH_BYTE		0x00
-#define HP_RLENGTH_WORD		0x01
-#define HP_RLENGTH_LONG		0x02
-#define HP_RLENGTH_ALIGN	0x03
-
-#define NAME(x,y) CONCAT3 (hp300hpux,_32_,y)
-#define ARCH_SIZE 32
-
-/* aoutx.h requires definitions for BMAGIC and QMAGIC.  */
-#define BMAGIC HPUX_DOT_O_MAGIC
-#define QMAGIC 0314
-
-#include "aoutx.h"
-
-static const bfd_target * MY (callback) (bfd *);
-static bfd_boolean MY (write_object_contents) (bfd *);
-static void convert_sym_type
-  (struct external_nlist *, aout_symbol_type *, bfd *);
-
-bfd_boolean MY (slurp_symbol_table) (bfd *);
-void MY (swap_std_reloc_in)
-  (bfd *, struct hp300hpux_reloc *, arelent *, asymbol **, bfd_size_type);
-bfd_boolean MY (slurp_reloc_table)
-  (bfd *, sec_ptr, asymbol **);
-long MY (canonicalize_symtab)  (bfd *, asymbol **);
-long MY (get_symtab_upper_bound)  (bfd *);
-long MY (canonicalize_reloc)  (bfd *, sec_ptr, arelent **, asymbol **);
-
-/* Since the hpux symbol table has nlist elements interspersed with
-   strings and we need to insert som strings for secondary symbols, we
-   give ourselves a little extra padding up front to account for
-   this.  Note that for each non-secondary symbol we process, we gain
-   9 bytes of space for the discarded nlist element (one byte used for
-   null).  SYM_EXTRA_BYTES is the extra space.  */
-#define SYM_EXTRA_BYTES   1024
-
-/* Set parameters about this a.out file that are machine-dependent.
-   This routine is called from some_aout_object_p just before it returns.  */
-static const bfd_target *
-MY (callback) (bfd *abfd)
-{
-  struct internal_exec *execp = exec_hdr (abfd);
-
-  /* Calculate the file positions of the parts of a newly read aout header */
-  obj_textsec (abfd)->size = N_TXTSIZE (execp);
-
-  /* The virtual memory addresses of the sections */
-  obj_textsec (abfd)->vma = N_TXTADDR (execp);
-  obj_datasec (abfd)->vma = N_DATADDR (execp);
-  obj_bsssec (abfd)->vma = N_BSSADDR (execp);
-
-  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
-  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
-  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
-
-  /* The file offsets of the sections */
-  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
-  obj_datasec (abfd)->filepos = N_DATOFF (execp);
-
-  /* The file offsets of the relocation info */
-  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
-  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
-
-  /* The file offsets of the string table and symbol table.  */
-  obj_sym_filepos (abfd) = N_SYMOFF (execp);
-  obj_str_filepos (abfd) = N_STROFF (execp);
-
-  /* Determine the architecture and machine type of the object file.  */
-#ifdef SET_ARCH_MACH
-  SET_ARCH_MACH (abfd, execp);
-#else
-  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
-#endif
-
-  if (obj_aout_subformat (abfd) == gnu_encap_format)
-    {
-      /* The file offsets of the relocation info */
-      obj_textsec (abfd)->rel_filepos = N_GNU_TRELOFF (execp);
-      obj_datasec (abfd)->rel_filepos = N_GNU_DRELOFF (execp);
-
-      /* The file offsets of the string table and symbol table.  */
-      obj_sym_filepos (abfd) = N_GNU_SYMOFF (execp);
-      obj_str_filepos (abfd) = (obj_sym_filepos (abfd) + execp->a_syms);
-
-      abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
-      bfd_get_symcount (abfd) = execp->a_syms / 12;
-      obj_symbol_entry_size (abfd) = 12;
-      obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
-    }
-
-  return abfd->xvec;
-}
-
-extern bfd_boolean aout_32_write_syms (bfd *);
-
-static bfd_boolean
-MY (write_object_contents) (bfd * abfd)
-{
-  struct external_exec exec_bytes;
-  struct internal_exec *execp = exec_hdr (abfd);
-
-  memset (&exec_bytes, 0, sizeof (exec_bytes));
-
-  obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
-
-  if (adata (abfd).magic == undecided_magic)
-    NAME (aout,adjust_sizes_and_vmas) (abfd);
-  execp->a_syms = 0;
-
-  execp->a_entry = bfd_get_start_address (abfd);
-
-  execp->a_trsize = ((obj_textsec (abfd)->reloc_count) *
-		     obj_reloc_entry_size (abfd));
-  execp->a_drsize = ((obj_datasec (abfd)->reloc_count) *
-		     obj_reloc_entry_size (abfd));
-
-  N_SET_MACHTYPE (execp, 0xc);
-  N_SET_FLAGS (execp, aout_backend_info (abfd)->exec_hdr_flags);
-
-  NAME (aout,swap_exec_header_out) (abfd, execp, &exec_bytes);
-
-  /* update fields not covered by default swap_exec_header_out */
-
-  /* this is really the sym table size but we store it in drelocs */
-  H_PUT_32 (abfd, (bfd_get_symcount (abfd) * 12), exec_bytes.e_drelocs);
-
-  if (bfd_seek (abfd, (file_ptr) 0, FALSE) != 0
-      || (bfd_bwrite (&exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, abfd)
-	  != EXEC_BYTES_SIZE))
-    return FALSE;
-
-  /* Write out the symbols, and then the relocs.  We must write out
-       the symbols first so that we know the symbol indices.  */
-
-  if (bfd_get_symcount (abfd) != 0)
-    {
-      /* Skip the relocs to where we want to put the symbols.  */
-      if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp) + execp->a_drsize),
-		    SEEK_SET) != 0)
-	return FALSE;
-    }
-
-  if (!MY (write_syms) (abfd))
-    return FALSE;
-
-  if (bfd_get_symcount (abfd) != 0)
-    {
-      if (bfd_seek (abfd, (file_ptr) N_TRELOFF (execp), SEEK_CUR) != 0)
-	return FALSE;
-      if (!NAME (aout,squirt_out_relocs) (abfd, obj_textsec (abfd)))
-	return FALSE;
-      if (bfd_seek (abfd, (file_ptr) N_DRELOFF (execp), SEEK_CUR) != 0)
-	return FALSE;
-      if (!NAME (aout,squirt_out_relocs) (abfd, obj_datasec (abfd)))
-	return FALSE;
-    }
-
-  return TRUE;
-}
-
-/* Convert the hp symbol type to be the same as aout64.h usage so we
-   can piggyback routines in aoutx.h.  */
-
-static void
-convert_sym_type (struct external_nlist *sym_pointer ATTRIBUTE_UNUSED,
-		  aout_symbol_type *cache_ptr,
-		  bfd *abfd ATTRIBUTE_UNUSED)
-{
-  int name_type;
-  int new_type;
-
-  name_type = (cache_ptr->type);
-  new_type = 0;
-
-  if ((name_type & HP_SYMTYPE_ALIGN) != 0)
-    {
-      /* iou_error ("aligned symbol encountered: %s", name);*/
-      name_type = 0;
-    }
-
-  if (name_type == HP_SYMTYPE_FILENAME)
-    new_type = N_FN;
-  else
-    {
-      switch (name_type & HP_SYMTYPE_TYPE)
-	{
-	case HP_SYMTYPE_UNDEFINED:
-	  new_type = N_UNDF;
-	  break;
-
-	case HP_SYMTYPE_ABSOLUTE:
-	  new_type = N_ABS;
-	  break;
-
-	case HP_SYMTYPE_TEXT:
-	  new_type = N_TEXT;
-	  break;
-
-	case HP_SYMTYPE_DATA:
-	  new_type = N_DATA;
-	  break;
-
-	case HP_SYMTYPE_BSS:
-	  new_type = N_BSS;
-	  break;
-
-	case HP_SYMTYPE_COMMON:
-	  new_type = N_COMM;
-	  break;
-
-	default:
-	  abort ();
-	  break;
-	}
-      if (name_type & HP_SYMTYPE_EXTERNAL)
-	new_type |= N_EXT;
-
-      if (name_type & HP_SECONDARY_SYMBOL)
-	{
-	  switch (new_type)
-	    {
-	    default:
-	      abort ();
-	    case N_UNDF | N_EXT:
-	      /* If the value is nonzero, then just treat this as a
-		 common symbol.  I don't know if this is correct in
-		 all cases, but it is more correct than treating it as
-		 a weak undefined symbol.  */
-	      if (cache_ptr->symbol.value == 0)
-		new_type = N_WEAKU;
-	      break;
-	    case N_ABS | N_EXT:
-	      new_type = N_WEAKA;
-	      break;
-	    case N_TEXT | N_EXT:
-	      new_type = N_WEAKT;
-	      break;
-	    case N_DATA | N_EXT:
-	      new_type = N_WEAKD;
-	      break;
-	    case N_BSS | N_EXT:
-	      new_type = N_WEAKB;
-	      break;
-	    }
-	}
-    }
-  cache_ptr->type = new_type;
-
-}
-
-/*
-DESCRIPTION
-	Swaps the information in an executable header taken from a raw
-	byte stream memory image, into the internal exec_header
-	structure.
-*/
-
-void
-NAME (aout,swap_exec_header_in) (bfd *abfd,
-				 struct external_exec *raw_bytes,
-				 struct internal_exec *execp)
-{
-  struct external_exec *bytes = (struct external_exec *) raw_bytes;
-
-  /* The internal_exec structure has some fields that are unused in this
-     configuration (IE for i960), so ensure that all such uninitialized
-     fields are zero'd out.  There are places where two of these structs
-     are memcmp'd, and thus the contents do matter. */
-  memset (execp, 0, sizeof (struct internal_exec));
-  /* Now fill in fields in the execp, from the bytes in the raw data.  */
-  execp->a_info = H_GET_32 (abfd, bytes->e_info);
-  execp->a_text = GET_WORD (abfd, bytes->e_text);
-  execp->a_data = GET_WORD (abfd, bytes->e_data);
-  execp->a_bss = GET_WORD (abfd, bytes->e_bss);
-  execp->a_syms = GET_WORD (abfd, bytes->e_syms);
-  execp->a_entry = GET_WORD (abfd, bytes->e_entry);
-  execp->a_trsize = GET_WORD (abfd, bytes->e_trsize);
-  execp->a_drsize = GET_WORD (abfd, bytes->e_drsize);
-
-  /***************************************************************/
-  /* check the header to see if it was generated by a bfd output */
-  /* this is detected rather bizarrely by requiring a bunch of   */
-  /* header fields to be zero and an old unused field (now used) */
-  /* to be set.							 */
-  /***************************************************************/
-  do
-    {
-      long syms;
-      struct aout_data_struct *rawptr;
-      bfd_size_type amt;
-
-      if (H_GET_32 (abfd, bytes->e_passize) != 0)
-	break;
-      if (H_GET_32 (abfd, bytes->e_syms) != 0)
-	break;
-      if (H_GET_32 (abfd, bytes->e_supsize) != 0)
-	break;
-
-      syms = H_GET_32 (abfd, bytes->e_drelocs);
-      if (syms == 0)
-	break;
-
-      /* OK, we've passed the test as best as we can determine */
-      execp->a_syms = syms;
-
-      /* allocate storage for where we will store this result */
-      amt = sizeof (*rawptr);
-      rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, amt);
-
-      if (rawptr == NULL)
-	return;
-      abfd->tdata.aout_data = rawptr;
-      obj_aout_subformat (abfd) = gnu_encap_format;
-    }
-  while (0);
-}
-
-/* The hp symbol table is a bit different than other a.out targets.  Instead
-   of having an array of nlist items and an array of strings, hp's format
-   has them mixed together in one structure.  In addition, the strings are
-   not null terminated.  It looks something like this:
-
-   nlist element 1
-   string1
-   nlist element 2
-   string2
-   ...
-
-   The whole symbol table is read as one chunk and then we march thru it
-   and convert it to canonical form.  As we march thru the table, we copy
-   the nlist data into the internal form and we compact the strings and null
-   terminate them, using storage from the already allocated symbol table:
-
-   string1
-   null
-   string2
-   null
-   ...
-*/
-
-bfd_boolean
-MY (slurp_symbol_table) (bfd *abfd)
-{
-  bfd_size_type symbol_bytes;
-  struct external_nlist *syms;
-  struct external_nlist *sym_pointer;
-  struct external_nlist *sym_end;
-  char *strings;
-  aout_symbol_type *cached;
-  unsigned num_syms = 0;
-  bfd_size_type amt;
-
-  /* If there's no work to be done, don't do any */
-  if (obj_aout_symbols (abfd) != (aout_symbol_type *) NULL)
-    return TRUE;
-  symbol_bytes = exec_hdr (abfd)->a_syms;
-
-  amt = symbol_bytes + SYM_EXTRA_BYTES;
-  strings = (char *) bfd_alloc (abfd, amt);
-  if (!strings)
-    return FALSE;
-  syms = (struct external_nlist *) (strings + SYM_EXTRA_BYTES);
-  if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
-      || bfd_bread (syms, symbol_bytes, abfd) != symbol_bytes)
-    {
-      bfd_release (abfd, syms);
-      return FALSE;
-    }
-
-  sym_end = (struct external_nlist *) (((char *) syms) + symbol_bytes);
-
-  /* first, march thru the table and figure out how many symbols there are */
-  for (sym_pointer = syms; sym_pointer < sym_end; sym_pointer++, num_syms++)
-    {
-      /* skip over the embedded symbol. */
-      sym_pointer = (struct external_nlist *) (((char *) sym_pointer) +
-					       sym_pointer->e_length[0]);
-    }
-
-  /* now that we know the symbol count, update the bfd header */
-  bfd_get_symcount (abfd) = num_syms;
-
-  amt = num_syms;
-  amt *= sizeof (aout_symbol_type);
-  cached = (aout_symbol_type *) bfd_zalloc (abfd, amt);
-  if (cached == NULL && num_syms != 0)
-    return FALSE;
-
-  /*[...]

[diff truncated at 100000 bytes]



More information about the Binutils-cvs mailing list