aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-04-16 15:31:36 +0930
committerAlan Modra <amodra@gmail.com>2018-04-16 15:31:36 +0930
commitdc12032bca08554cf0a72d224e44f755f7789ff3 (patch)
tree4366214b6cac7beb93cab44b1eb44868623e66a2 /bfd
parent211dc24b8744ed14ee5c293e7ac164d02e1fa1fe (diff)
downloadgdb-dc12032bca08554cf0a72d224e44f755f7789ff3.zip
gdb-dc12032bca08554cf0a72d224e44f755f7789ff3.tar.gz
gdb-dc12032bca08554cf0a72d224e44f755f7789ff3.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog48
-rw-r--r--bfd/Makefile.am28
-rw-r--r--bfd/Makefile.in41
-rw-r--r--bfd/aout0.c38
-rw-r--r--bfd/aoutf1.h48
-rw-r--r--bfd/aoutx.h19
-rw-r--r--bfd/archive.c109
-rw-r--r--bfd/bfd-in.h5
-rw-r--r--bfd/bfd-in2.h8
-rw-r--r--bfd/bfd.c2
-rw-r--r--bfd/coff-apollo.c120
-rw-r--r--bfd/coff-aux.c145
-rw-r--r--bfd/coff-m68k.c548
-rw-r--r--bfd/coff-svm68k.c27
-rw-r--r--bfd/coff-u68k.c36
-rw-r--r--bfd/coffcode.h59
-rw-r--r--bfd/coffswap.h7
-rw-r--r--bfd/config.bfd105
-rwxr-xr-xbfd/configure30
-rw-r--r--bfd/configure.ac30
-rw-r--r--bfd/configure.host2
-rw-r--r--bfd/doc/bfd.texinfo1
-rw-r--r--bfd/doc/bfdint.texi2
-rw-r--r--bfd/freebsd.h6
-rw-r--r--bfd/gen-aout.c3
-rw-r--r--bfd/hosts/delta68.h33
-rw-r--r--bfd/hosts/hp300bsd.h32
-rw-r--r--bfd/hosts/m68kaux.h35
-rw-r--r--bfd/hosts/news.h28
-rw-r--r--bfd/hp300bsd.c40
-rw-r--r--bfd/hp300hpux.c855
-rw-r--r--bfd/hpux-core.c2
-rw-r--r--bfd/libaout.h2
-rw-r--r--bfd/libbfd-in.h2
-rw-r--r--bfd/libbfd.h2
-rw-r--r--bfd/liboasys.h83
-rw-r--r--bfd/m68k4knetbsd.c36
-rw-r--r--bfd/m68klinux.c737
-rw-r--r--bfd/m68knetbsd.c38
-rw-r--r--bfd/oasys.c1254
-rw-r--r--bfd/pdp11.c19
-rw-r--r--bfd/peicode.h6
-rw-r--r--bfd/po/SRC-POTFILES.in14
-rw-r--r--bfd/riscix.c5
-rw-r--r--bfd/targets.c45
-rw-r--r--bfd/versados.c939
46 files changed, 79 insertions, 5595 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;
-
- /* as we march thru the hp symbol table, convert it into a list of
- null terminated strings to hold the symbol names. Make sure any
- assignment to the strings pointer is done after we're thru using
- the nlist so we don't overwrite anything important. */
-
- /* OK, now walk the new symtable, caching symbol properties */
- {
- aout_symbol_type *cache_ptr = cached;
- /* Run through table and copy values */
- for (sym_pointer = syms, cache_ptr = cached;
- sym_pointer < sym_end; sym_pointer++, cache_ptr++)
- {
- unsigned int length;
- cache_ptr->symbol.the_bfd = abfd;
- cache_ptr->symbol.value = GET_SWORD (abfd, sym_pointer->e_value);
- cache_ptr->desc = bfd_get_16 (abfd, sym_pointer->e_almod);
- cache_ptr->type = bfd_get_8 (abfd, sym_pointer->e_type);
- cache_ptr->symbol.udata.p = NULL;
- length = bfd_get_8 (abfd, sym_pointer->e_length);
- cache_ptr->other = length; /* other not used, save length here */
-
- convert_sym_type (sym_pointer, cache_ptr, abfd);
- if (!translate_from_native_sym_flags (abfd, cache_ptr))
- return FALSE;
-
- /********************************************************/
- /* for hpux, the 'length' value indicates the length of */
- /* the symbol name which follows the nlist entry. */
- /********************************************************/
- if (length)
- {
- /**************************************************************/
- /* the hp string is not null terminated so we create a new one*/
- /* by copying the string to overlap the just vacated nlist */
- /* structure before it in memory. */
- /**************************************************************/
- cache_ptr->symbol.name = strings;
- memcpy (strings, sym_pointer + 1, length);
- strings[length] = '\0';
- strings += length + 1;
- }
- else
- cache_ptr->symbol.name = (char *) NULL;
-
- /* skip over the embedded symbol. */
- sym_pointer = (struct external_nlist *) (((char *) sym_pointer) +
- length);
- }
- }
-
- obj_aout_symbols (abfd) = cached;
-
- return TRUE;
-}
-
-void
-MY (swap_std_reloc_in) (bfd *abfd,
- struct hp300hpux_reloc *bytes,
- arelent *cache_ptr,
- asymbol **symbols,
- bfd_size_type symcount ATTRIBUTE_UNUSED)
-{
- int r_index;
- int r_extern = 0;
- unsigned int r_length;
- int r_pcrel = 0;
- struct aoutdata *su = &(abfd->tdata.aout_data->a);
-
- cache_ptr->address = H_GET_32 (abfd, bytes->r_address);
- r_index = H_GET_16 (abfd, bytes->r_index);
-
- switch (bytes->r_type[0])
- {
- case HP_RSEGMENT_TEXT:
- r_index = N_TEXT;
- break;
- case HP_RSEGMENT_DATA:
- r_index = N_DATA;
- break;
- case HP_RSEGMENT_BSS:
- r_index = N_BSS;
- break;
- case HP_RSEGMENT_EXTERNAL:
- r_extern = 1;
- break;
- case HP_RSEGMENT_PCREL:
- r_extern = 1;
- r_pcrel = 1;
- break;
- case HP_RSEGMENT_RDLT:
- break;
- case HP_RSEGMENT_RPLT:
- break;
- case HP_RSEGMENT_NOOP:
- break;
- default:
- abort ();
- break;
- }
-
- switch (bytes->r_length[0])
- {
- case HP_RLENGTH_BYTE:
- r_length = 0;
- break;
- case HP_RLENGTH_WORD:
- r_length = 1;
- break;
- case HP_RLENGTH_LONG:
- r_length = 2;
- break;
- default:
- abort ();
- break;
- }
-
- cache_ptr->howto = howto_table_std + r_length + 4 * r_pcrel;
- /* FIXME-soon: Roll baserel, jmptable, relative bits into howto setting */
-
- /* This macro uses the r_index value computed above */
- if (r_pcrel && r_extern)
- {
- /* The GNU linker assumes any offset from beginning of section */
- /* is already incorporated into the image while the HP linker */
- /* adds this in later. Add it in now... */
- MOVE_ADDRESS (-cache_ptr->address);
- }
- else
- {
- MOVE_ADDRESS (0);
- }
-}
-
-bfd_boolean
-MY (slurp_reloc_table) (bfd *abfd, sec_ptr asect, asymbol **symbols)
-{
- bfd_size_type count;
- bfd_size_type reloc_size;
- void * relocs;
- arelent *reloc_cache;
- size_t each_size;
- struct hp300hpux_reloc *rptr;
- unsigned int counter;
- arelent *cache_ptr;
-
- if (asect->relocation)
- return TRUE;
-
- if (asect->flags & SEC_CONSTRUCTOR)
- return TRUE;
-
- if (asect == obj_datasec (abfd))
- {
- reloc_size = exec_hdr (abfd)->a_drsize;
- goto doit;
- }
-
- if (asect == obj_textsec (abfd))
- {
- reloc_size = exec_hdr (abfd)->a_trsize;
- goto doit;
- }
-
- bfd_set_error (bfd_error_invalid_operation);
- return FALSE;
-
-doit:
- if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0)
- return FALSE;
- each_size = obj_reloc_entry_size (abfd);
-
- count = reloc_size / each_size;
-
- reloc_cache = (arelent *) bfd_zalloc (abfd, count * sizeof (arelent));
- if (!reloc_cache && count != 0)
- return FALSE;
-
- relocs = bfd_alloc (abfd, reloc_size);
- if (!relocs && reloc_size != 0)
- {
- bfd_release (abfd, reloc_cache);
- return FALSE;
- }
-
- if (bfd_bread (relocs, reloc_size, abfd) != reloc_size)
- {
- bfd_release (abfd, relocs);
- bfd_release (abfd, reloc_cache);
- return FALSE;
- }
-
- rptr = (struct hp300hpux_reloc *) relocs;
- counter = 0;
- cache_ptr = reloc_cache;
-
- for (; counter < count; counter++, rptr++, cache_ptr++)
- {
- MY (swap_std_reloc_in) (abfd, rptr, cache_ptr, symbols,
- (bfd_size_type) bfd_get_symcount (abfd));
- }
-
- bfd_release (abfd, relocs);
- asect->relocation = reloc_cache;
- asect->reloc_count = count;
- return TRUE;
-}
-
-/************************************************************************/
-/* The following functions are identical to functions in aoutx.h except */
-/* they refer to MY(func) rather than NAME(aout,func) and they also */
-/* call aout_32 versions if the input file was generated by gcc */
-/************************************************************************/
-
-long aout_32_canonicalize_symtab (bfd *, asymbol **);
-long aout_32_get_symtab_upper_bound (bfd *);
-long aout_32_canonicalize_reloc (bfd *, sec_ptr, arelent **, asymbol **);
-
-long
-MY (canonicalize_symtab) (bfd *abfd, asymbol **location)
-{
- unsigned int counter = 0;
- aout_symbol_type *symbase;
-
- if (obj_aout_subformat (abfd) == gnu_encap_format)
- return aout_32_canonicalize_symtab (abfd, location);
-
- if (!MY (slurp_symbol_table) (abfd))
- return -1;
-
- for (symbase = obj_aout_symbols (abfd); counter++ < bfd_get_symcount (abfd);)
- *(location++) = (asymbol *) (symbase++);
- *location++ = 0;
- return bfd_get_symcount (abfd);
-}
-
-long
-MY (get_symtab_upper_bound) (bfd *abfd)
-{
- if (obj_aout_subformat (abfd) == gnu_encap_format)
- return aout_32_get_symtab_upper_bound (abfd);
- if (!MY (slurp_symbol_table) (abfd))
- return -1;
-
- return (bfd_get_symcount (abfd) + 1) * (sizeof (aout_symbol_type *));
-}
-
-long
-MY (canonicalize_reloc) (bfd *abfd,
- sec_ptr section,
- arelent **relptr,
- asymbol **symbols)
-{
- arelent *tblptr = section->relocation;
- unsigned int count;
-
- if (obj_aout_subformat (abfd) == gnu_encap_format)
- return aout_32_canonicalize_reloc (abfd, section, relptr, symbols);
-
- if (!(tblptr || MY (slurp_reloc_table) (abfd, section, symbols)))
- return -1;
-
- if (section->flags & SEC_CONSTRUCTOR)
- {
- arelent_chain *chain = section->constructor_chain;
- for (count = 0; count < section->reloc_count; count++)
- {
- *relptr++ = &chain->relent;
- chain = chain->next;
- }
- }
- else
- {
- tblptr = section->relocation;
-
- for (count = 0; count++ < section->reloc_count;)
- {
- *relptr++ = tblptr++;
- }
- }
- *relptr = 0;
-
- return section->reloc_count;
-}
-
-#include "aout-target.h"
diff --git a/bfd/hpux-core.c b/bfd/hpux-core.c
index 4bf15d0..3d2f621 100644
--- a/bfd/hpux-core.c
+++ b/bfd/hpux-core.c
@@ -28,7 +28,7 @@
#include "bfd.h"
#include "libbfd.h"
-#if defined (HOST_HPPAHPUX) || defined (HOST_HP300HPUX) || defined (HOST_HPPAMPEIX)
+#if defined (HOST_HPPAHPUX) || defined (HOST_HPPAMPEIX)
/* FIXME: sys/core.h doesn't exist for HPUX version 7. HPUX version
5, 6, and 7 core files seem to be standard trad-core.c type core
diff --git a/bfd/libaout.h b/bfd/libaout.h
index c7d787d..0a421e4 100644
--- a/bfd/libaout.h
+++ b/bfd/libaout.h
@@ -349,7 +349,7 @@ typedef struct aout_symbol
enum aout_subformat {
default_format = 0,
- /* Used on HP 9000/300 running HP/UX. See hp300hpux.c. */
+ /* Used on HP 9000/300 running HP/UX. */
gnu_encap_format,
/* Used on Linux, 386BSD, etc. See include/aout/aout64.h. */
q_magic_format
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index e1eea28..0c80f4d 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -134,8 +134,6 @@ const bfd_target *bfd_generic_archive_p
(bfd *);
bfd_boolean bfd_slurp_armap
(bfd *);
-bfd_boolean bfd_slurp_bsd_armap_f2
- (bfd *);
#define bfd_slurp_bsd_armap bfd_slurp_armap
#define bfd_slurp_coff_armap bfd_slurp_armap
bfd_boolean _bfd_archive_64_bit_slurp_armap
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 5a087a7..f50cc03 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -139,8 +139,6 @@ const bfd_target *bfd_generic_archive_p
(bfd *);
bfd_boolean bfd_slurp_armap
(bfd *);
-bfd_boolean bfd_slurp_bsd_armap_f2
- (bfd *);
#define bfd_slurp_bsd_armap bfd_slurp_armap
#define bfd_slurp_coff_armap bfd_slurp_armap
bfd_boolean _bfd_archive_64_bit_slurp_armap
diff --git a/bfd/liboasys.h b/bfd/liboasys.h
deleted file mode 100644
index 02a9008..0000000
--- a/bfd/liboasys.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* BFD internal declarations for Oasys file format handling.
- Copyright (C) 1990-2018 Free Software Foundation, Inc.
- Scrawled by Steve Chamberlain of 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. */
-
-typedef struct _oasys_symbol
-{
- asymbol symbol;
-} oasys_symbol_type;
-
-typedef struct _oasys_reloc {
- arelent relent;
- struct _oasys_reloc *next;
- unsigned int symbol;
-} oasys_reloc_type;
-
-
-#define oasys_symbol(x) ((oasys_symbol_type *)(x))
-#define oasys_per_section(x) ((oasys_per_section_type *)(x->used_by_bfd))
-
-typedef struct _oasys_per_section
-{
- asection *section;
- bfd_byte *data;
- bfd_vma offset;
- bfd_boolean had_vma;
- oasys_reloc_type **reloc_tail_ptr;
- bfd_vma pc;
-
-
- file_ptr current_pos;
- unsigned int current_byte;
- bfd_boolean initialized;
-} oasys_per_section_type;
-
-#define NSECTIONS 10
-
-typedef struct _oasys_ar_obstack {
- file_ptr file_offset;
- bfd *abfd;
-} oasys_ar_obstack_type;
-
-
-typedef struct _oasys_module_info {
- file_ptr pos;
- unsigned int size;
- bfd *abfd;
- char *name;
-} oasys_module_info_type;
-
-typedef struct _oasys_ar_data {
- oasys_module_info_type *module;
- unsigned int module_count;
- unsigned int module_index;
-} oasys_ar_data_type;
-
-typedef struct _oasys_data {
- char *strings;
- asymbol *symbols;
- unsigned int symbol_string_length;
- asection *sections[OASYS_MAX_SEC_COUNT];
- file_ptr first_data_record;
-} oasys_data_type;
-
-#define OASYS_DATA(abfd) ((abfd)->tdata.oasys_obj_data)
-#define OASYS_AR_DATA(abfd) ((abfd)->tdata.oasys_ar_data)
-
diff --git a/bfd/m68k4knetbsd.c b/bfd/m68k4knetbsd.c
deleted file mode 100644
index ec04dcb..0000000
--- a/bfd/m68k4knetbsd.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* BFD back-end for NetBSD/m68k a.out-ish binaries.
- Copyright (C) 1990-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 TARGET_PAGE_SIZE 0x1000
-
-#define DEFAULT_ARCH bfd_arch_m68k
-#define DEFAULT_MID M_68K4K_NETBSD
-
-/* 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_4knbsd_,OP)
-
-/* This needs to start with a.out so GDB knows it is an a.out variant. */
-#define TARGETNAME "a.out-m68k4k-netbsd"
-
-#include "netbsd.h"
diff --git a/bfd/m68klinux.c b/bfd/m68klinux.c
deleted file mode 100644
index eb0401f..0000000
--- a/bfd/m68klinux.c
+++ /dev/null
@@ -1,737 +0,0 @@
-/* BFD back-end for linux flavored m68k a.out binaries.
- 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_PAGE_SIZE 4096
-#define ZMAGIC_DISK_BLOCK_SIZE 1024
-#define SEGMENT_SIZE TARGET_PAGE_SIZE
-#define TEXT_START_ADDR 0x0
-
-#define MACHTYPE_OK(mtype) ((mtype) == M_68020 || (mtype) == M_UNKNOWN)
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-#include "aout/aout64.h"
-#include "aout/stab_gnu.h"
-#include "aout/ar.h"
-#include "libaout.h" /* BFD a.out internal data structures */
-
-#define TARGET_IS_BIG_ENDIAN_P
-#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_linux_,OP)
-#define TARGETNAME "a.out-m68k-linux"
-
-extern const bfd_target MY(vec);
-
-/* We always generate QMAGIC files in preference to ZMAGIC files. It
- would be possible to make this a linker option, if that ever
- becomes important. */
-
-static void MY_final_link_callback
- (bfd *, file_ptr *, file_ptr *, file_ptr *);
-
-static bfd_boolean
-m68klinux_bfd_final_link (bfd *abfd,
- struct bfd_link_info *info)
-{
- obj_aout_subformat (abfd) = q_magic_format;
- return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
-}
-
-#define MY_bfd_final_link m68klinux_bfd_final_link
-
-/* Set the machine type correctly. */
-
-static bfd_boolean
-m68klinux_write_object_contents (bfd *abfd)
-{
- struct external_exec exec_bytes;
- struct internal_exec *execp = exec_hdr (abfd);
-
- N_SET_MACHTYPE (execp, M_68020);
-
- obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
-
- WRITE_HEADERS (abfd, execp);
-
- return TRUE;
-}
-
-#define MY_write_object_contents m68klinux_write_object_contents
-
-/* Code to link against Linux a.out shared libraries. */
-
-/* See if a symbol name is a reference to the global offset table. */
-
-#ifndef GOT_REF_PREFIX
-#define GOT_REF_PREFIX "__GOT_"
-#endif
-
-#define IS_GOT_SYM(name) (CONST_STRNEQ (name, GOT_REF_PREFIX))
-
-/* See if a symbol name is a reference to the procedure linkage table. */
-
-#ifndef PLT_REF_PREFIX
-#define PLT_REF_PREFIX "__PLT_"
-#endif
-
-#define IS_PLT_SYM(name) (CONST_STRNEQ (name, PLT_REF_PREFIX))
-
-/* This string is used to generate specialized error messages. */
-
-#ifndef NEEDS_SHRLIB
-#define NEEDS_SHRLIB "__NEEDS_SHRLIB_"
-#endif
-
-/* This special symbol is a set vector that contains a list of
- pointers to fixup tables. It will be present in any dynamically
- linked file. The linker generated fixup table should also be added
- to the list, and it should always appear in the second slot (the
- first one is a dummy with a magic number that is defined in
- crt0.o). */
-
-#ifndef SHARABLE_CONFLICTS
-#define SHARABLE_CONFLICTS "__SHARABLE_CONFLICTS__"
-#endif
-
-/* We keep a list of fixups. The terminology is a bit strange, but
- each fixup contains two 32 bit numbers. A regular fixup contains
- an address and a pointer, and at runtime we should store the
- address at the location pointed to by the pointer. A builtin fixup
- contains two pointers, and we should read the address using one
- pointer and store it at the location pointed to by the other
- pointer. Builtin fixups come into play when we have duplicate
- __GOT__ symbols for the same variable. The builtin fixup will copy
- the GOT pointer from one over into the other. */
-
-struct fixup
-{
- struct fixup *next;
- struct linux_link_hash_entry *h;
- bfd_vma value;
-
- /* Nonzero if this is a jump instruction that needs to be fixed,
- zero if this is just a pointer */
- char jump;
-
- char builtin;
-};
-
-/* We don't need a special hash table entry structure, but we do need
- to keep some information between linker passes, so we use a special
- hash table. */
-
-struct linux_link_hash_entry
-{
- struct aout_link_hash_entry root;
-};
-
-struct linux_link_hash_table
-{
- struct aout_link_hash_table root;
-
- /* First dynamic object found in link. */
- bfd *dynobj;
-
- /* Number of fixups. */
- size_t fixup_count;
-
- /* Number of builtin fixups. */
- size_t local_builtins;
-
- /* List of fixups. */
- struct fixup *fixup_list;
-};
-
-/* Routine to create an entry in an Linux link hash table. */
-
-static struct bfd_hash_entry *
-linux_link_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
-{
- struct linux_link_hash_entry *ret = (struct linux_link_hash_entry *) entry;
-
- /* Allocate the structure if it has not already been allocated by a
- subclass. */
- if (ret == (struct linux_link_hash_entry *) NULL)
- ret = ((struct linux_link_hash_entry *)
- bfd_hash_allocate (table, sizeof (struct linux_link_hash_entry)));
- if (ret == NULL)
- return (struct bfd_hash_entry *) ret;
-
- /* Call the allocation method of the superclass. */
- ret = ((struct linux_link_hash_entry *)
- NAME(aout,link_hash_newfunc) ((struct bfd_hash_entry *) ret,
- table, string));
- if (ret != NULL)
- {
- /* Set local fields; there aren't any. */
- }
-
- return (struct bfd_hash_entry *) ret;
-}
-
-/* Create a Linux link hash table. */
-
-static struct bfd_link_hash_table *
-linux_link_hash_table_create (bfd *abfd)
-{
- struct linux_link_hash_table *ret;
- bfd_size_type amt = sizeof (struct linux_link_hash_table);
-
- ret = (struct linux_link_hash_table *) bfd_zmalloc (amt);
- if (ret == (struct linux_link_hash_table *) NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return (struct bfd_link_hash_table *) NULL;
- }
- if (!NAME(aout,link_hash_table_init) (&ret->root, abfd,
- linux_link_hash_newfunc,
- sizeof (struct linux_link_hash_entry)))
- {
- free (ret);
- return (struct bfd_link_hash_table *) NULL;
- }
-
- return &ret->root.root;
-}
-
-/* Look up an entry in a Linux link hash table. */
-
-#define linux_link_hash_lookup(table, string, create, copy, follow) \
- ((struct linux_link_hash_entry *) \
- aout_link_hash_lookup (&(table)->root, (string), (create), (copy),\
- (follow)))
-
-/* Traverse a Linux link hash table. */
-
-#define linux_link_hash_traverse(table, func, info) \
- (aout_link_hash_traverse \
- (&(table)->root, \
- (bfd_boolean (*) (struct aout_link_hash_entry *, void *)) (func), \
- (info)))
-
-/* Get the Linux link hash table from the info structure. This is
- just a cast. */
-
-#define linux_hash_table(p) ((struct linux_link_hash_table *) ((p)->hash))
-
-/* Store the information for a new fixup. */
-
-static struct fixup *
-new_fixup (struct bfd_link_info *info,
- struct linux_link_hash_entry *h,
- bfd_vma value,
- int builtin)
-{
- struct fixup *f;
-
- f = (struct fixup *) bfd_hash_allocate (&info->hash->table,
- sizeof (struct fixup));
- if (f == NULL)
- return f;
- f->next = linux_hash_table (info)->fixup_list;
- linux_hash_table (info)->fixup_list = f;
- f->h = h;
- f->value = value;
- f->builtin = builtin;
- f->jump = 0;
- ++linux_hash_table (info)->fixup_count;
- return f;
-}
-
-/* We come here once we realize that we are going to link to a shared
- library. We need to create a special section that contains the
- fixup table, and we ultimately need to add a pointer to this into
- the set vector for SHARABLE_CONFLICTS. At this point we do not
- know the size of the section, but that's OK - we just need to
- create it for now. */
-
-static bfd_boolean
-linux_link_create_dynamic_sections (bfd *abfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
-{
- flagword flags;
- asection *s;
-
- /* Note that we set the SEC_IN_MEMORY flag. */
- flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
-
- /* We choose to use the name ".linux-dynamic" for the fixup table.
- Why not? */
- s = bfd_make_section_with_flags (abfd, ".linux-dynamic", flags);
- if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
- return FALSE;
- s->size = 0;
- s->contents = 0;
-
- return TRUE;
-}
-
-/* Function to add a single symbol to the linker hash table. This is
- a wrapper around _bfd_generic_link_add_one_symbol which handles the
- tweaking needed for dynamic linking support. */
-
-static bfd_boolean
-linux_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 linux_link_hash_entry *h;
- bfd_boolean insert;
-
- /* Look up and see if we already have this symbol in the hash table.
- If we do, and the defining entry is from a shared library, we
- need to create the dynamic sections.
-
- FIXME: What if abfd->xvec != info->output_bfd->xvec? We may
- want to be able to link Linux a.out and ELF objects together,
- but serious confusion is possible. */
-
- insert = FALSE;
-
- if (! bfd_link_relocatable (info)
- && linux_hash_table (info)->dynobj == NULL
- && strcmp (name, SHARABLE_CONFLICTS) == 0
- && (flags & BSF_CONSTRUCTOR) != 0
- && abfd->xvec == info->output_bfd->xvec)
- {
- if (! linux_link_create_dynamic_sections (abfd, info))
- return FALSE;
- linux_hash_table (info)->dynobj = abfd;
- insert = TRUE;
- }
-
- if (bfd_is_abs_section (section)
- && abfd->xvec == info->output_bfd->xvec)
- {
- h = linux_link_hash_lookup (linux_hash_table (info), name, FALSE,
- FALSE, FALSE);
- if (h != NULL
- && (h->root.root.type == bfd_link_hash_defined
- || h->root.root.type == bfd_link_hash_defweak))
- {
- struct fixup *f;
-
- if (hashp != NULL)
- *hashp = (struct bfd_link_hash_entry *) h;
-
- f = new_fixup (info, h, value, ! IS_PLT_SYM (name));
- if (f == NULL)
- return FALSE;
- f->jump = IS_PLT_SYM (name);
-
- return TRUE;
- }
- }
-
- /* Do the usual procedure for adding a symbol. */
- if (! _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section,
- value, string, copy, collect,
- hashp))
- return FALSE;
-
- /* Insert a pointer to our table in the set vector. The dynamic
- linker requires this information */
- if (insert)
- {
- asection *s;
-
- /* Here we do our special thing to add the pointer to the
- dynamic section in the SHARABLE_CONFLICTS set vector. */
- s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
- ".linux-dynamic");
- BFD_ASSERT (s != NULL);
-
- if (! (_bfd_generic_link_add_one_symbol
- (info, linux_hash_table (info)->dynobj, SHARABLE_CONFLICTS,
- BSF_GLOBAL | BSF_CONSTRUCTOR, s, (bfd_vma) 0, NULL,
- FALSE, FALSE, NULL)))
- return FALSE;
- }
-
- return TRUE;
-}
-
-/* We will crawl the hash table and come here for every global symbol.
- We will examine each entry and see if there are indications that we
- need to add a fixup. There are two possible cases - one is where
- you have duplicate definitions of PLT or GOT symbols - these will
- have already been caught and added as "builtin" fixups. If we find
- that the corresponding non PLT/GOT symbol is also present, we
- convert it to a regular fixup instead.
-
- This function is called via linux_link_hash_traverse. */
-
-static bfd_boolean
-linux_tally_symbols (struct linux_link_hash_entry *h,
- void * data)
-{
- struct bfd_link_info *info = (struct bfd_link_info *) data;
- struct fixup *f, *f1;
- int is_plt;
- struct linux_link_hash_entry *h1, *h2;
- bfd_boolean exists;
-
- if (h->root.root.type == bfd_link_hash_undefined
- && CONST_STRNEQ (h->root.root.root.string, NEEDS_SHRLIB))
- {
- const char *name;
- char *p;
- char *alloc = NULL;
-
- name = h->root.root.root.string + sizeof NEEDS_SHRLIB - 1;
- p = strrchr (name, '_');
- if (p != NULL)
- alloc = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 1);
-
- if (p == NULL || alloc == NULL)
- _bfd_error_handler (_("output file requires shared library `%s'"),
- name);
- else
- {
- strcpy (alloc, name);
- p = strrchr (alloc, '_');
- *p++ = '\0';
- _bfd_error_handler
- /* xgettext:c-format */
- (_("output file requires shared library `%s.so.%s'"),
- alloc, p);
- free (alloc);
- }
-
- abort ();
- }
-
- /* If this symbol is not a PLT/GOT, we do not even need to look at it */
- is_plt = IS_PLT_SYM (h->root.root.root.string);
-
- if (is_plt || IS_GOT_SYM (h->root.root.root.string))
- {
- /* Look up this symbol twice. Once just as a regular lookup,
- and then again following all of the indirect links until we
- reach a real symbol. */
- h1 = linux_link_hash_lookup (linux_hash_table (info),
- (h->root.root.root.string
- + sizeof PLT_REF_PREFIX - 1),
- FALSE, FALSE, TRUE);
- /* h2 does not follow indirect symbols. */
- h2 = linux_link_hash_lookup (linux_hash_table (info),
- (h->root.root.root.string
- + sizeof PLT_REF_PREFIX - 1),
- FALSE, FALSE, FALSE);
-
- /* The real symbol must exist but if it is also an ABS symbol,
- there is no need to have a fixup. This is because they both
- came from the same library. If on the other hand, we had to
- use an indirect symbol to get to the real symbol, we add the
- fixup anyway, since there are cases where these symbols come
- from different shared libraries */
- if (h1 != NULL
- && (((h1->root.root.type == bfd_link_hash_defined
- || h1->root.root.type == bfd_link_hash_defweak)
- && ! bfd_is_abs_section (h1->root.root.u.def.section))
- || h2->root.root.type == bfd_link_hash_indirect))
- {
- /* See if there is a "builtin" fixup already present
- involving this symbol. If so, convert it to a regular
- fixup. In the end, this relaxes some of the requirements
- about the order of performing fixups. */
- exists = FALSE;
- for (f1 = linux_hash_table (info)->fixup_list;
- f1 != NULL;
- f1 = f1->next)
- {
- if ((f1->h != h && f1->h != h1)
- || (! f1->builtin && ! f1->jump))
- continue;
- if (f1->h == h1)
- exists = TRUE;
- if (! exists
- && bfd_is_abs_section (h->root.root.u.def.section))
- {
- f = new_fixup (info, h1, f1->h->root.root.u.def.value, 0);
- f->jump = is_plt;
- }
- f1->h = h1;
- f1->jump = is_plt;
- f1->builtin = 0;
- exists = TRUE;
- }
- if (! exists
- && bfd_is_abs_section (h->root.root.u.def.section))
- {
- f = new_fixup (info, h1, h->root.root.u.def.value, 0);
- if (f == NULL)
- {
- /* FIXME: No way to return error. */
- abort ();
- }
- f->jump = is_plt;
- }
- }
-
- /* Quick and dirty way of stripping these symbols from the
- symtab. */
- if (bfd_is_abs_section (h->root.root.u.def.section))
- h->root.written = TRUE;
- }
-
- return TRUE;
-}
-
-/* This is called to set the size of the .linux-dynamic section is.
- It is called by the Linux linker emulation before_allocation
- routine. We have finished reading all of the input files, and now
- we just scan the hash tables to find out how many additional fixups
- are required. */
-
-bfd_boolean
-bfd_m68klinux_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
-{
- struct fixup *f;
- asection *s;
-
- if (output_bfd->xvec != &MY(vec))
- return TRUE;
-
- /* First find the fixups... */
- linux_link_hash_traverse (linux_hash_table (info),
- linux_tally_symbols,
- info);
-
- /* If there are builtin fixups, leave room for a marker. This is
- used by the dynamic linker so that it knows that all that follow
- are builtin fixups instead of regular fixups. */
- for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
- {
- if (f->builtin)
- {
- ++linux_hash_table (info)->fixup_count;
- ++linux_hash_table (info)->local_builtins;
- break;
- }
- }
-
- if (linux_hash_table (info)->dynobj == NULL)
- {
- if (linux_hash_table (info)->fixup_count > 0)
- abort ();
- return TRUE;
- }
-
- /* Allocate memory for our fixup table. We will fill it in later. */
- s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
- ".linux-dynamic");
- if (s != NULL)
- {
- s->size = linux_hash_table (info)->fixup_count + 1;
- s->size *= 8;
- s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->size);
- if (s->contents == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/* We come here once we are ready to actually write the fixup table to
- the output file. Scan the fixup tables and so forth and generate
- the stuff we need. */
-
-static bfd_boolean
-linux_finish_dynamic_link (bfd *output_bfd, struct bfd_link_info *info)
-{
- asection *s, *os, *is;
- bfd_byte *fixup_table;
- struct linux_link_hash_entry *h;
- struct fixup *f;
- unsigned int new_addr;
- int section_offset;
- unsigned int fixups_written;
-
- if (linux_hash_table (info)->dynobj == NULL)
- return TRUE;
-
- s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
- ".linux-dynamic");
- BFD_ASSERT (s != NULL);
- os = s->output_section;
- fixups_written = 0;
-
-#ifdef LINUX_LINK_DEBUG
- printf ("Fixup table file offset: %x VMA: %x\n",
- os->filepos + s->output_offset,
- os->vma + s->output_offset);
-#endif
-
- fixup_table = s->contents;
- bfd_put_32 (output_bfd, (bfd_vma) linux_hash_table (info)->fixup_count,
- fixup_table);
- fixup_table += 4;
-
- /* Fill in fixup table. */
- for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
- {
- if (f->builtin)
- continue;
-
- if (f->h->root.root.type != bfd_link_hash_defined
- && f->h->root.root.type != bfd_link_hash_defweak)
- {
- _bfd_error_handler
- (_("symbol %s not defined for fixups"),
- f->h->root.root.root.string);
- continue;
- }
-
- is = f->h->root.root.u.def.section;
- section_offset = is->output_section->vma + is->output_offset;
- new_addr = f->h->root.root.u.def.value + section_offset;
-
-#ifdef LINUX_LINK_DEBUG
- printf ("Fixup(%d) %s: %x %x\n",f->jump, f->h->root.root.string,
- new_addr, f->value);
-#endif
-
- if (f->jump)
- {
- bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
- fixup_table += 4;
- bfd_put_32 (output_bfd, f->value + 2, fixup_table);
- fixup_table += 4;
- }
- else
- {
- bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
- fixup_table += 4;
- bfd_put_32 (output_bfd, f->value, fixup_table);
- fixup_table += 4;
- }
- ++fixups_written;
- }
-
- if (linux_hash_table (info)->local_builtins != 0)
- {
- /* Special marker so we know to switch to the other type of fixup */
- bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
- fixup_table += 4;
- bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
- fixup_table += 4;
- ++fixups_written;
- for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
- {
- if (! f->builtin)
- continue;
-
- if (f->h->root.root.type != bfd_link_hash_defined
- && f->h->root.root.type != bfd_link_hash_defweak)
- {
- _bfd_error_handler
- (_("symbol %s not defined for fixups"),
- f->h->root.root.root.string);
- continue;
- }
-
- is = f->h->root.root.u.def.section;
- section_offset = is->output_section->vma + is->output_offset;
- new_addr = f->h->root.root.u.def.value + section_offset;
-
-#ifdef LINUX_LINK_DEBUG
- printf ("Fixup(B) %s: %x %x\n", f->h->root.root.string,
- new_addr, f->value);
-#endif
-
- bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
- fixup_table += 4;
- bfd_put_32 (output_bfd, f->value, fixup_table);
- fixup_table += 4;
- ++fixups_written;
- }
- }
-
- if (linux_hash_table (info)->fixup_count != fixups_written)
- {
- _bfd_error_handler (_("warning: fixup count mismatch"));
- while (linux_hash_table (info)->fixup_count > fixups_written)
- {
- bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
- fixup_table += 4;
- bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
- fixup_table += 4;
- ++fixups_written;
- }
- }
-
- h = linux_link_hash_lookup (linux_hash_table (info),
- "__BUILTIN_FIXUPS__",
- FALSE, FALSE, FALSE);
-
- if (h != NULL
- && (h->root.root.type == bfd_link_hash_defined
- || h->root.root.type == bfd_link_hash_defweak))
- {
- is = h->root.root.u.def.section;
- section_offset = is->output_section->vma + is->output_offset;
- new_addr = h->root.root.u.def.value + section_offset;
-
-#ifdef LINUX_LINK_DEBUG
- printf ("Builtin fixup table at %x\n", new_addr);
-#endif
-
- bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
- }
- else
- bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
-
- if (bfd_seek (output_bfd, (file_ptr) (os->filepos + s->output_offset),
- SEEK_SET) != 0)
- return FALSE;
-
- if (bfd_bwrite (s->contents, s->size, output_bfd) != s->size)
- return FALSE;
-
- return TRUE;
-}
-
-#define MY_bfd_link_hash_table_create linux_link_hash_table_create
-#define MY_add_one_symbol linux_add_one_symbol
-#define MY_finish_dynamic_link linux_finish_dynamic_link
-
-#define MY_zmagic_contiguous 1
-
-#include "aout-target.h"
diff --git a/bfd/m68knetbsd.c b/bfd/m68knetbsd.c
deleted file mode 100644
index b0401ad..0000000
--- a/bfd/m68knetbsd.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* BFD back-end for NetBSD/m68k a.out-ish binaries.
- Copyright (C) 1990-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
-
-/* Our m68k ports use either 4K or 8K pages, but object files always
- assume 8K page alignment so they will work on all m68k machines. */
-#define TARGET_PAGE_SIZE 0x2000
-
-#define DEFAULT_ARCH bfd_arch_m68k
-#define DEFAULT_MID M_68K_NETBSD
-
-/* 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_nbsd_,OP)
-
-/* This needs to start with a.out so GDB knows it is an a.out variant. */
-#define TARGETNAME "a.out-m68k-netbsd"
-
-#include "netbsd.h"
diff --git a/bfd/oasys.c b/bfd/oasys.c
deleted file mode 100644
index d76e712..0000000
--- a/bfd/oasys.c
+++ /dev/null
@@ -1,1254 +0,0 @@
-/* BFD back-end for oasys objects.
- Copyright (C) 1990-2018 Free Software Foundation, Inc.
- Written by Steve Chamberlain of Cygnus Support, <sac@cygnus.com>.
-
- 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 UNDERSCORE_HACK 1
-#include "sysdep.h"
-#include "bfd.h"
-#include "safe-ctype.h"
-#include "libbfd.h"
-#include "oasys.h"
-#include "liboasys.h"
-#include "libiberty.h"
-
-/* Read in all the section data and relocation stuff too. */
-
-static bfd_boolean
-oasys_read_record (bfd *abfd, oasys_record_union_type *record)
-{
- bfd_size_type amt = sizeof (record->header);
-
- if (bfd_bread ((void *) record, amt, abfd) != amt)
- return FALSE;
-
- amt = record->header.length - sizeof (record->header);
- if ((long) amt <= 0)
- return TRUE;
- if (bfd_bread ((void *) ((char *) record + sizeof (record->header)), amt, abfd)
- != amt)
- return FALSE;
- return TRUE;
-}
-
-static size_t
-oasys_string_length (oasys_record_union_type *record)
-{
- return record->header.length
- - ((char *) record->symbol.name - (char *) record);
-}
-
-/* Slurp the symbol table by reading in all the records at the start file
- till we get to the first section record.
-
- We'll sort the symbolss into two lists, defined and undefined. The
- undefined symbols will be placed into the table according to their
- refno.
-
- We do this by placing all undefined symbols at the front of the table
- moving in, and the defined symbols at the end of the table moving back. */
-
-static bfd_boolean
-oasys_slurp_symbol_table (bfd *const abfd)
-{
- oasys_record_union_type record;
- oasys_data_type *data = OASYS_DATA (abfd);
- bfd_boolean loop = TRUE;
- asymbol *dest_defined;
- asymbol *dest;
- char *string_ptr;
- bfd_size_type amt;
-
- if (data->symbols != NULL)
- return TRUE;
-
- /* Buy enough memory for all the symbols and all the names. */
- amt = abfd->symcount;
- amt *= sizeof (asymbol);
- data->symbols = bfd_alloc (abfd, amt);
-
- amt = data->symbol_string_length;
-#ifdef UNDERSCORE_HACK
- /* Buy 1 more char for each symbol to keep the underscore in. */
- amt += abfd->symcount;
-#endif
- data->strings = bfd_alloc (abfd, amt);
-
- if (!data->symbols || !data->strings)
- return FALSE;
-
- dest_defined = data->symbols + abfd->symcount - 1;
-
- string_ptr = data->strings;
- if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
- return FALSE;
- while (loop)
- {
- if (! oasys_read_record (abfd, &record))
- return FALSE;
-
- switch (record.header.type)
- {
- case oasys_record_is_header_enum:
- break;
- case oasys_record_is_local_enum:
- case oasys_record_is_symbol_enum:
- {
- int flag = record.header.type == (int) oasys_record_is_local_enum ?
- (BSF_LOCAL) : (BSF_GLOBAL | BSF_EXPORT);
-
- size_t length = oasys_string_length (&record);
- switch (record.symbol.relb & RELOCATION_TYPE_BITS)
- {
- case RELOCATION_TYPE_ABS:
- dest = dest_defined--;
- dest->section = bfd_abs_section_ptr;
- dest->flags = 0;
-
- break;
- case RELOCATION_TYPE_REL:
- dest = dest_defined--;
- dest->section =
- OASYS_DATA (abfd)->sections[record.symbol.relb &
- RELOCATION_SECT_BITS];
- if (record.header.type == (int) oasys_record_is_local_enum)
- {
- dest->flags = BSF_LOCAL;
- if (dest->section == (asection *) (~0))
- {
- /* It seems that sometimes internal symbols are tied up, but
- still get output, even though there is no
- section */
- dest->section = 0;
- }
- }
- else
- dest->flags = flag;
- break;
- case RELOCATION_TYPE_UND:
- dest = data->symbols + H_GET_16 (abfd, record.symbol.refno);
- dest->section = bfd_und_section_ptr;
- break;
- case RELOCATION_TYPE_COM:
- dest = dest_defined--;
- dest->name = string_ptr;
- dest->the_bfd = abfd;
- dest->section = bfd_com_section_ptr;
- break;
- default:
- dest = dest_defined--;
- BFD_ASSERT (FALSE);
- break;
- }
- dest->name = string_ptr;
- dest->the_bfd = abfd;
- dest->udata.p = NULL;
- dest->value = H_GET_32 (abfd, record.symbol.value);
-
-#ifdef UNDERSCORE_HACK
- if (record.symbol.name[0] != '_')
- {
- string_ptr[0] = '_';
- string_ptr++;
- }
-#endif
- memcpy (string_ptr, record.symbol.name, length);
-
- string_ptr[length] = 0;
- string_ptr += length + 1;
- }
- break;
- default:
- loop = FALSE;
- }
- }
- return TRUE;
-}
-
-static long
-oasys_get_symtab_upper_bound (bfd *const abfd)
-{
- if (! oasys_slurp_symbol_table (abfd))
- return -1;
-
- return (abfd->symcount + 1) * (sizeof (oasys_symbol_type *));
-}
-
-extern const bfd_target oasys_vec;
-
-static long
-oasys_canonicalize_symtab (bfd *abfd, asymbol **location)
-{
- asymbol *symbase;
- unsigned int counter;
-
- if (! oasys_slurp_symbol_table (abfd))
- return -1;
-
- symbase = OASYS_DATA (abfd)->symbols;
- for (counter = 0; counter < abfd->symcount; counter++)
- *(location++) = symbase++;
-
- *location = 0;
- return abfd->symcount;
-}
-
-/* Archive stuff. */
-
-static const bfd_target *
-oasys_archive_p (bfd *abfd)
-{
- oasys_archive_header_type header;
- oasys_extarchive_header_type header_ext;
- unsigned int i;
- file_ptr filepos;
- bfd_size_type amt;
-
- amt = sizeof (header_ext);
- if (bfd_seek (abfd, (file_ptr) 0, 0) != 0
- || bfd_bread ((void *) &header_ext, amt, abfd) != amt)
- {
- if (bfd_get_error () != bfd_error_system_call)
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
-
- header.version = H_GET_32 (abfd, header_ext.version);
- header.mod_count = H_GET_32 (abfd, header_ext.mod_count);
- header.mod_tbl_offset = H_GET_32 (abfd, header_ext.mod_tbl_offset);
- header.sym_tbl_size = H_GET_32 (abfd, header_ext.sym_tbl_size);
- header.sym_count = H_GET_32 (abfd, header_ext.sym_count);
- header.sym_tbl_offset = H_GET_32 (abfd, header_ext.sym_tbl_offset);
- header.xref_count = H_GET_32 (abfd, header_ext.xref_count);
- header.xref_lst_offset = H_GET_32 (abfd, header_ext.xref_lst_offset);
-
- /* There isn't a magic number in an Oasys archive, so the best we
- can do to verify reasonableness is to make sure that the values in
- the header are too weird. */
-
- if (header.version > 10000
- || header.mod_count > 10000
- || header.sym_count > 100000
- || header.xref_count > 100000)
- return NULL;
-
- /* That all worked, let's buy the space for the header and read in
- the headers. */
- {
- oasys_ar_data_type *ar;
- oasys_module_info_type *module;
- oasys_module_table_type record;
-
- amt = sizeof (oasys_ar_data_type);
- ar = bfd_alloc (abfd, amt);
-
- amt = header.mod_count;
- amt *= sizeof (oasys_module_info_type);
- module = bfd_alloc (abfd, amt);
-
- if (!ar || !module)
- return NULL;
-
- abfd->tdata.oasys_ar_data = ar;
- ar->module = module;
- ar->module_count = header.mod_count;
-
- filepos = header.mod_tbl_offset;
- for (i = 0; i < header.mod_count; i++)
- {
- oasys_extmodule_table_type_b_type record_ext;
-
- if (bfd_seek (abfd, filepos, SEEK_SET) != 0)
- return NULL;
-
- /* There are two ways of specifying the archive header. */
- amt = sizeof (record_ext);
- if (bfd_bread ((void *) &record_ext, amt, abfd) != amt)
- return NULL;
-
- record.mod_size = H_GET_32 (abfd, record_ext.mod_size);
- record.file_offset = H_GET_32 (abfd, record_ext.file_offset);
-
- record.dep_count = H_GET_32 (abfd, record_ext.dep_count);
- record.depee_count = H_GET_32 (abfd, record_ext.depee_count);
- record.sect_count = H_GET_32 (abfd, record_ext.sect_count);
- record.module_name_size = H_GET_32 (abfd,
- record_ext.mod_name_length);
-
- amt = record.module_name_size;
- module[i].name = bfd_alloc (abfd, amt + 1);
- if (!module[i].name)
- return NULL;
- if (bfd_bread ((void *) module[i].name, amt, abfd) != amt)
- return NULL;
- module[i].name[record.module_name_size] = 0;
- filepos += (sizeof (record_ext)
- + record.dep_count * 4
- + record.module_name_size + 1);
-
- module[i].size = record.mod_size;
- module[i].pos = record.file_offset;
- module[i].abfd = 0;
- }
- }
- return abfd->xvec;
-}
-
-static bfd_boolean
-oasys_mkobject (bfd *abfd)
-{
- bfd_size_type amt = sizeof (oasys_data_type);
-
- abfd->tdata.oasys_obj_data = bfd_alloc (abfd, amt);
-
- return abfd->tdata.oasys_obj_data != NULL;
-}
-
-/* The howto table is build using the top two bits of a reloc byte to
- index into it. The bits are PCREL,WORD/LONG. */
-
-static reloc_howto_type howto_table[] =
-{
-
- HOWTO (0, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
- HOWTO (0, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "abs32", TRUE, 0xffffffff, 0xffffffff, FALSE),
- HOWTO (0, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "pcrel16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
- HOWTO (0, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "pcrel32", TRUE, 0xffffffff, 0xffffffff, FALSE)
-};
-
-/* Read in all the section data and relocation stuff too. */
-
-static bfd_boolean
-oasys_slurp_section_data (bfd *const abfd)
-{
- oasys_record_union_type record;
- oasys_data_type *data = OASYS_DATA (abfd);
- bfd_boolean loop = TRUE;
- oasys_per_section_type *per;
- asection *s;
- bfd_size_type amt;
-
- /* See if the data has been slurped already. */
- for (s = abfd->sections; s != NULL; s = s->next)
- {
- per = oasys_per_section (s);
- if (per->initialized)
- return TRUE;
- }
-
- if (data->first_data_record == 0)
- return TRUE;
-
- if (bfd_seek (abfd, data->first_data_record, SEEK_SET) != 0)
- return FALSE;
-
- while (loop)
- {
- if (! oasys_read_record (abfd, &record))
- return FALSE;
-
- switch (record.header.type)
- {
- case oasys_record_is_header_enum:
- break;
- case oasys_record_is_data_enum:
- {
- bfd_byte *src = record.data.data;
- bfd_byte *end_src = ((bfd_byte *) & record) + record.header.length;
- bfd_byte *dst_ptr;
- bfd_byte *dst_base_ptr;
- unsigned int relbit;
- unsigned int count;
- asection *section =
- data->sections[record.data.relb & RELOCATION_SECT_BITS];
- bfd_vma dst_offset;
-
- per = oasys_per_section (section);
-
- if (! per->initialized)
- {
- arelent **relpp;
-
- per->data = bfd_zalloc (abfd, section->size);
- if (!per->data)
- return FALSE;
- relpp = &section->relocation;
- per->reloc_tail_ptr = (oasys_reloc_type **) relpp;
- per->had_vma = FALSE;
- per->initialized = TRUE;
- section->reloc_count = 0;
- section->flags = SEC_ALLOC;
- }
-
- dst_offset = H_GET_32 (abfd, record.data.addr);
- if (! per->had_vma)
- {
- /* Take the first vma we see as the base. */
- section->vma = dst_offset;
- per->had_vma = TRUE;
- }
-
- dst_offset -= section->vma;
-
- dst_base_ptr = oasys_per_section (section)->data;
- dst_ptr = oasys_per_section (section)->data +
- dst_offset;
-
- if (src < end_src)
- section->flags |= SEC_LOAD | SEC_HAS_CONTENTS;
-
- while (src < end_src)
- {
- unsigned char mod_byte = *src++;
- size_t gap = end_src - src;
-
- count = 8;
- if (mod_byte == 0 && gap >= 8)
- {
- dst_ptr[0] = src[0];
- dst_ptr[1] = src[1];
- dst_ptr[2] = src[2];
- dst_ptr[3] = src[3];
- dst_ptr[4] = src[4];
- dst_ptr[5] = src[5];
- dst_ptr[6] = src[6];
- dst_ptr[7] = src[7];
- dst_ptr += 8;
- src += 8;
- }
- else
- {
- for (relbit = 1; count-- != 0 && src < end_src; relbit <<= 1)
- {
- if (relbit & mod_byte)
- {
- unsigned char reloc = *src;
- /* This item needs to be relocated. */
- switch (reloc & RELOCATION_TYPE_BITS)
- {
- case RELOCATION_TYPE_ABS:
- break;
-
- case RELOCATION_TYPE_REL:
- {
- /* Relocate the item relative to the section. */
- oasys_reloc_type *r;
-
- amt = sizeof (oasys_reloc_type);
- r = bfd_alloc (abfd, amt);
- if (!r)
- return FALSE;
- *(per->reloc_tail_ptr) = r;
- per->reloc_tail_ptr = &r->next;
- r->next = NULL;
- /* Reference to undefined symbol. */
- src++;
- /* There is no symbol. */
- r->symbol = 0;
- /* Work out the howto. */
- abort ();
- r->relent.address = dst_ptr - dst_base_ptr;
- r->relent.howto = &howto_table[reloc >> 6];
- r->relent.sym_ptr_ptr = NULL;
- section->reloc_count++;
-
- /* Fake up the data to look like
- it's got the -ve pc in it, this
- makes it much easier to convert
- into other formats. This is done
- by hitting the addend. */
- if (r->relent.howto->pc_relative)
- r->relent.addend -= dst_ptr - dst_base_ptr;
- }
- break;
-
- case RELOCATION_TYPE_UND:
- {
- oasys_reloc_type *r;
-
- amt = sizeof (oasys_reloc_type);
- r = bfd_alloc (abfd, amt);
- if (!r)
- return FALSE;
- *(per->reloc_tail_ptr) = r;
- per->reloc_tail_ptr = &r->next;
- r->next = NULL;
- /* Reference to undefined symbol. */
- src++;
- /* Get symbol number. */
- r->symbol = (src[0] << 8) | src[1];
- /* Work out the howto. */
- abort ();
-
- r->relent.addend = 0;
- r->relent.address = dst_ptr - dst_base_ptr;
- r->relent.howto = &howto_table[reloc >> 6];
- r->relent.sym_ptr_ptr = NULL;
- section->reloc_count++;
-
- src += 2;
- /* Fake up the data to look like
- it's got the -ve pc in it, this
- makes it much easier to convert
- into other formats. This is done
- by hitting the addend. */
- if (r->relent.howto->pc_relative)
- r->relent.addend -= dst_ptr - dst_base_ptr;
- }
- break;
- case RELOCATION_TYPE_COM:
- BFD_FAIL ();
- }
- }
- *dst_ptr++ = *src++;
- }
- }
- }
- }
- break;
- case oasys_record_is_local_enum:
- case oasys_record_is_symbol_enum:
- case oasys_record_is_section_enum:
- break;
- default:
- loop = FALSE;
- }
- }
-
- return TRUE;
-
-}
-
-#define MAX_SECS 16
-
-static const bfd_target *
-oasys_object_p (bfd *abfd)
-{
- oasys_data_type *oasys;
- oasys_data_type *save = OASYS_DATA (abfd);
- bfd_boolean loop = TRUE;
- bfd_boolean had_usefull = FALSE;
-
- abfd->tdata.oasys_obj_data = 0;
- oasys_mkobject (abfd);
- oasys = OASYS_DATA (abfd);
- memset ((void *) oasys->sections, 0xff, sizeof (oasys->sections));
-
- /* Point to the start of the file. */
- if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
- goto fail;
- oasys->symbol_string_length = 0;
-
- /* Inspect the records, but only keep the section info -
- remember the size of the symbols. */
- oasys->first_data_record = 0;
- while (loop)
- {
- oasys_record_union_type record;
- if (! oasys_read_record (abfd, &record))
- goto fail;
- if ((size_t) record.header.length < (size_t) sizeof (record.header))
- goto fail;
-
- switch ((oasys_record_enum_type) (record.header.type))
- {
- case oasys_record_is_header_enum:
- had_usefull = TRUE;
- break;
- case oasys_record_is_symbol_enum:
- case oasys_record_is_local_enum:
- /* Count symbols and remember their size for a future malloc. */
- abfd->symcount++;
- oasys->symbol_string_length += 1 + oasys_string_length (&record);
- had_usefull = TRUE;
- break;
- case oasys_record_is_section_enum:
- {
- asection *s;
- char *buffer;
- unsigned int section_number;
-
- if (record.section.header.length != sizeof (record.section))
- goto fail;
-
- buffer = bfd_alloc (abfd, (bfd_size_type) 3);
- if (!buffer)
- goto fail;
- section_number = record.section.relb & RELOCATION_SECT_BITS;
- sprintf (buffer, "%u", section_number);
- s = bfd_make_section (abfd, buffer);
- oasys->sections[section_number] = s;
- switch (record.section.relb & RELOCATION_TYPE_BITS)
- {
- case RELOCATION_TYPE_ABS:
- case RELOCATION_TYPE_REL:
- break;
- case RELOCATION_TYPE_UND:
- case RELOCATION_TYPE_COM:
- BFD_FAIL ();
- }
-
- s->size = H_GET_32 (abfd, record.section.value);
- s->vma = H_GET_32 (abfd, record.section.vma);
- s->flags = 0;
- had_usefull = TRUE;
- }
- break;
- case oasys_record_is_data_enum:
- oasys->first_data_record = bfd_tell (abfd) - record.header.length;
- /* Fall through. */
- case oasys_record_is_debug_enum:
- case oasys_record_is_module_enum:
- case oasys_record_is_named_section_enum:
- case oasys_record_is_end_enum:
- if (! had_usefull)
- goto fail;
- loop = FALSE;
- break;
- default:
- goto fail;
- }
- }
- oasys->symbols = NULL;
-
- /* Oasys support several architectures, but I can't see a simple way
- to discover which one is in a particular file - we'll guess. */
- bfd_default_set_arch_mach (abfd, bfd_arch_m68k, 0);
- if (abfd->symcount != 0)
- abfd->flags |= HAS_SYMS;
-
- /* We don't know if a section has data until we've read it. */
- oasys_slurp_section_data (abfd);
-
- return abfd->xvec;
-
-fail:
- (void) bfd_release (abfd, oasys);
- abfd->tdata.oasys_obj_data = save;
- return NULL;
-}
-
-
-static void
-oasys_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED,
- asymbol *symbol,
- symbol_info *ret)
-{
- bfd_symbol_info (symbol, ret);
-
- if (!symbol->section)
- ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A';
-}
-
-static void
-oasys_print_symbol (bfd *abfd, void * afile, asymbol *symbol, bfd_print_symbol_type how)
-{
- FILE *file = (FILE *) afile;
-
- switch (how)
- {
- case bfd_print_symbol_name:
- case bfd_print_symbol_more:
- fprintf (file, "%s", symbol->name);
- break;
- case bfd_print_symbol_all:
- {
- const char *section_name = symbol->section == NULL ?
- (const char *) "*abs" : symbol->section->name;
-
- bfd_print_symbol_vandf (abfd, (void *) file, symbol);
-
- fprintf (file, " %-5s %s",
- section_name,
- symbol->name);
- }
- break;
- }
-}
-
-static bfd_boolean
-oasys_new_section_hook (bfd *abfd, asection *newsect)
-{
- if (!newsect->used_by_bfd)
- {
- newsect->used_by_bfd
- = bfd_alloc (abfd, (bfd_size_type) sizeof (oasys_per_section_type));
- if (!newsect->used_by_bfd)
- return FALSE;
- }
- oasys_per_section (newsect)->data = NULL;
- oasys_per_section (newsect)->section = newsect;
- oasys_per_section (newsect)->offset = 0;
- oasys_per_section (newsect)->initialized = FALSE;
- newsect->alignment_power = 1;
-
- /* Turn the section string into an index. */
- sscanf (newsect->name, "%u", &newsect->target_index);
-
- return _bfd_generic_new_section_hook (abfd, newsect);
-}
-
-
-static long
-oasys_get_reloc_upper_bound (bfd *abfd, sec_ptr asect)
-{
- if (! oasys_slurp_section_data (abfd))
- return -1;
- return (asect->reloc_count + 1) * sizeof (arelent *);
-}
-
-static bfd_boolean
-oasys_get_section_contents (bfd *abfd,
- sec_ptr section,
- void * location,
- file_ptr offset,
- bfd_size_type count)
-{
- oasys_per_section_type *p = oasys_per_section (section);
-
- oasys_slurp_section_data (abfd);
-
- if (! p->initialized)
- (void) memset (location, 0, (size_t) count);
- else
- (void) memcpy (location, (void *) (p->data + offset), (size_t) count);
-
- return TRUE;
-}
-
-static long
-oasys_canonicalize_reloc (bfd *ignore_abfd ATTRIBUTE_UNUSED,
- sec_ptr section,
- arelent **relptr,
- asymbol **symbols ATTRIBUTE_UNUSED)
-{
- unsigned int reloc_count = 0;
- oasys_reloc_type *src = (oasys_reloc_type *) (section->relocation);
-
- if (src != NULL)
- abort ();
-
- *relptr = NULL;
- return section->reloc_count = reloc_count;
-}
-
-
-/* Writing. */
-
-/* Calculate the checksum and write one record. */
-
-static bfd_boolean
-oasys_write_record (bfd *abfd,
- oasys_record_enum_type type,
- oasys_record_union_type *record,
- size_t size)
-{
- int checksum;
- size_t i;
- unsigned char *ptr;
-
- record->header.length = size;
- record->header.type = (int) type;
- record->header.check_sum = 0;
- record->header.fill = 0;
- ptr = (unsigned char *) &record->pad[0];
- checksum = 0;
- for (i = 0; i < size; i++)
- checksum += *ptr++;
- record->header.check_sum = 0xff & (-checksum);
- if (bfd_bwrite ((void *) record, (bfd_size_type) size, abfd) != size)
- return FALSE;
- return TRUE;
-}
-
-
-/* Write out all the symbols. */
-
-static bfd_boolean
-oasys_write_syms (bfd *abfd)
-{
- unsigned int count;
- asymbol **generic = bfd_get_outsymbols (abfd);
- unsigned int sym_index = 0;
-
- for (count = 0; count < bfd_get_symcount (abfd); count++)
- {
- oasys_symbol_record_type symbol;
- asymbol *const g = generic[count];
- const char *src = g->name;
- char *dst = symbol.name;
- unsigned int l = 0;
-
- if (bfd_is_com_section (g->section))
- {
- symbol.relb = RELOCATION_TYPE_COM;
- H_PUT_16 (abfd, sym_index, symbol.refno);
- sym_index++;
- }
- else if (bfd_is_abs_section (g->section))
- {
- symbol.relb = RELOCATION_TYPE_ABS;
- H_PUT_16 (abfd, 0, symbol.refno);
- }
- else if (bfd_is_und_section (g->section))
- {
- symbol.relb = RELOCATION_TYPE_UND;
- H_PUT_16 (abfd, sym_index, symbol.refno);
- /* Overload the value field with the output sym_index number */
- sym_index++;
- }
- else if (g->flags & BSF_DEBUGGING)
- /* Throw it away. */
- continue;
- else
- {
- if (g->section == NULL)
- /* Sometime, the oasys tools give out a symbol with illegal
- bits in it, we'll output it in the same broken way. */
- symbol.relb = RELOCATION_TYPE_REL | 0;
- else
- symbol.relb = RELOCATION_TYPE_REL | g->section->output_section->target_index;
-
- H_PUT_16 (abfd, 0, symbol.refno);
- }
-
-#ifdef UNDERSCORE_HACK
- if (src[l] == '_')
- dst[l++] = '.';
-#endif
- while (src[l])
- {
- dst[l] = src[l];
- l++;
- }
-
- H_PUT_32 (abfd, g->value, symbol.value);
-
- if (g->flags & BSF_LOCAL)
- {
- if (! oasys_write_record (abfd,
- oasys_record_is_local_enum,
- (oasys_record_union_type *) & symbol,
- offsetof (oasys_symbol_record_type,
- name[0]) + l))
- return FALSE;
- }
- else
- {
- if (! oasys_write_record (abfd,
- oasys_record_is_symbol_enum,
- (oasys_record_union_type *) & symbol,
- offsetof (oasys_symbol_record_type,
- name[0]) + l))
- return FALSE;
- }
- g->value = sym_index - 1;
- }
-
- return TRUE;
-}
-
-/* Write a section header for each section. */
-
-static bfd_boolean
-oasys_write_sections (bfd *abfd)
-{
- asection *s;
- static oasys_section_record_type out;
-
- for (s = abfd->sections; s != NULL; s = s->next)
- {
- if (!ISDIGIT (s->name[0]))
- {
- _bfd_error_handler
- /* xgettext:c-format */
- (_("%pB: can not represent section `%pA' in oasys"), abfd, s);
- bfd_set_error (bfd_error_nonrepresentable_section);
- return FALSE;
- }
- out.relb = RELOCATION_TYPE_REL | s->target_index;
- H_PUT_32 (abfd, s->size, out.value);
- H_PUT_32 (abfd, s->vma, out.vma);
-
- if (! oasys_write_record (abfd,
- oasys_record_is_section_enum,
- (oasys_record_union_type *) & out,
- sizeof (out)))
- return FALSE;
- }
- return TRUE;
-}
-
-static bfd_boolean
-oasys_write_header (bfd *abfd)
-{
- /* Create and write the header. */
- oasys_header_record_type r;
- size_t length = strlen (abfd->filename);
-
- if (length > (size_t) sizeof (r.module_name))
- length = sizeof (r.module_name);
- else if (length < (size_t) sizeof (r.module_name))
- (void) memset (r.module_name + length, ' ',
- sizeof (r.module_name) - length);
-
- (void) memcpy (r.module_name, abfd->filename, length);
-
- r.version_number = OASYS_VERSION_NUMBER;
- r.rev_number = OASYS_REV_NUMBER;
-
- return oasys_write_record (abfd, oasys_record_is_header_enum,
- (oasys_record_union_type *) & r,
- offsetof (oasys_header_record_type,
- description[0]));
-}
-
-static bfd_boolean
-oasys_write_end (bfd *abfd)
-{
- oasys_end_record_type end;
- unsigned char null = 0;
-
- end.relb = RELOCATION_TYPE_ABS;
- H_PUT_32 (abfd, abfd->start_address, end.entry);
- H_PUT_16 (abfd, 0, end.fill);
- end.zero = 0;
- if (! oasys_write_record (abfd,
- oasys_record_is_end_enum,
- (oasys_record_union_type *) & end,
- sizeof (end)))
- return FALSE;
-
- return bfd_bwrite ((void *) &null, (bfd_size_type) 1, abfd) == 1;
-}
-
-static int
-comp (const void * ap, const void * bp)
-{
- arelent *a = *((arelent **) ap);
- arelent *b = *((arelent **) bp);
-
- return a->address - b->address;
-}
-
-static bfd_boolean
-oasys_write_data (bfd *abfd)
-{
- asection *s;
-
- for (s = abfd->sections; s != NULL; s = s->next)
- {
- if (s->flags & SEC_LOAD)
- {
- bfd_byte *raw_data = oasys_per_section (s)->data;
- oasys_data_record_type processed_data;
- bfd_size_type current_byte_index = 0;
- unsigned int relocs_to_go = s->reloc_count;
- arelent **p = s->orelocation;
-
- if (s->reloc_count != 0)
- /* Sort the reloc records so it's easy to insert the relocs into the
- data. */
- qsort (s->orelocation, s->reloc_count, sizeof (arelent **), comp);
-
- current_byte_index = 0;
- processed_data.relb = s->target_index | RELOCATION_TYPE_REL;
-
- while (current_byte_index < s->size)
- {
- /* Scan forwards by eight bytes or however much is left and see if
- there are any relocations going on. */
- bfd_byte *mod = &processed_data.data[0];
- bfd_byte *dst = &processed_data.data[1];
-
- unsigned int i = 0;
- *mod = 0;
-
- H_PUT_32 (abfd, s->vma + current_byte_index,
- processed_data.addr);
-
- /* Don't start a relocation unless you're sure you can finish it
- within the same data record. The worst case relocation is a
- 4-byte relocatable value which is split across two modification
- bytes (1 relocation byte + 2 symbol reference bytes + 2 data +
- 1 modification byte + 2 data = 8 bytes total). That's where
- the magic number 8 comes from. */
- while (current_byte_index < s->size && dst <=
- & processed_data.data[sizeof (processed_data.data) - 8])
- {
- if (relocs_to_go != 0)
- {
- arelent *r = *p;
-
- /* There is a relocation, is it for this byte ? */
- if (r->address == current_byte_index)
- abort ();
- }
-
- /* If this is coming from an unloadable section then copy
- zeros. */
- if (raw_data == NULL)
- *dst++ = 0;
- else
- *dst++ = *raw_data++;
-
- if (++i >= 8)
- {
- i = 0;
- mod = dst++;
- *mod = 0;
- }
- current_byte_index++;
- }
-
- /* Don't write a useless null modification byte. */
- if (dst == mod + 1)
- --dst;
-
- if (! (oasys_write_record
- (abfd, oasys_record_is_data_enum,
- ((oasys_record_union_type *) &processed_data),
- (size_t) (dst - (bfd_byte *) &processed_data))))
- return FALSE;
- }
- }
- }
-
- return TRUE;
-}
-
-static bfd_boolean
-oasys_write_object_contents (bfd *abfd)
-{
- if (! oasys_write_header (abfd))
- return FALSE;
- if (! oasys_write_syms (abfd))
- return FALSE;
- if (! oasys_write_sections (abfd))
- return FALSE;
- if (! oasys_write_data (abfd))
- return FALSE;
- if (! oasys_write_end (abfd))
- return FALSE;
- return TRUE;
-}
-
-/* Set section contents is complicated with OASYS since the format is
- not a byte image, but a record stream. */
-
-static bfd_boolean
-oasys_set_section_contents (bfd *abfd,
- sec_ptr section,
- const void * location,
- file_ptr offset,
- bfd_size_type count)
-{
- if (count != 0)
- {
- if (oasys_per_section (section)->data == NULL)
- {
- oasys_per_section (section)->data = bfd_alloc (abfd, section->size);
- if (!oasys_per_section (section)->data)
- return FALSE;
- }
- (void) memcpy ((void *) (oasys_per_section (section)->data + offset),
- location, (size_t) count);
- }
- return TRUE;
-}
-
-
-
-/* Native-level interface to symbols. */
-
-/* We read the symbols into a buffer, which is discarded when this
- function exits. We read the strings into a buffer large enough to
- hold them all plus all the cached symbol entries. */
-
-static asymbol *
-oasys_make_empty_symbol (bfd *abfd)
-{
- bfd_size_type amt = sizeof (oasys_symbol_type);
- oasys_symbol_type *new_symbol_type = bfd_zalloc (abfd, amt);
-
- if (!new_symbol_type)
- return NULL;
- new_symbol_type->symbol.the_bfd = abfd;
- return &new_symbol_type->symbol;
-}
-
-/* User should have checked the file flags; perhaps we should return
- BFD_NO_MORE_SYMBOLS if there are none? */
-
-static bfd *
-oasys_openr_next_archived_file (bfd *arch, bfd *prev)
-{
- oasys_ar_data_type *ar = OASYS_AR_DATA (arch);
- oasys_module_info_type *p;
-
- /* Take the next one from the arch state, or reset. */
- if (prev == NULL)
- /* Reset the index - the first two entries are bogus. */
- ar->module_index = 0;
-
- p = ar->module + ar->module_index;
- ar->module_index++;
-
- if (ar->module_index <= ar->module_count)
- {
- if (p->abfd == NULL)
- {
- p->abfd = _bfd_create_empty_archive_element_shell (arch);
- p->abfd->origin = p->pos;
- p->abfd->filename = xstrdup (p->name);
-
- /* Fixup a pointer to this element for the member. */
- p->abfd->arelt_data = (void *) p;
- }
- return p->abfd;
- }
-
- bfd_set_error (bfd_error_no_more_archived_files);
- return NULL;
-}
-
-#define oasys_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define oasys_find_line _bfd_nosymbols_find_line
-#define oasys_find_inliner_info _bfd_nosymbols_find_inliner_info
-
-static int
-oasys_generic_stat_arch_elt (bfd *abfd, struct stat *buf)
-{
- oasys_module_info_type *mod = (oasys_module_info_type *) abfd->arelt_data;
-
- if (mod == NULL)
- {
- bfd_set_error (bfd_error_invalid_operation);
- return -1;
- }
-
- buf->st_size = mod->size;
- buf->st_mode = 0666;
- return 0;
-}
-
-static int
-oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
-#define oasys_close_and_cleanup _bfd_generic_close_and_cleanup
-#define oasys_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define oasys_slurp_armap _bfd_bool_bfd_true
-#define oasys_slurp_extended_name_table _bfd_bool_bfd_true
-#define oasys_construct_extended_name_table \
- _bfd_noarchive_construct_extended_name_table
-#define oasys_truncate_arname bfd_dont_truncate_arname
-#define oasys_write_armap _bfd_noarchive_write_armap
-#define oasys_read_ar_hdr _bfd_ptr_bfd_null_error
-#define oasys_write_ar_hdr _bfd_noarchive_write_ar_hdr
-#define oasys_get_elt_at_index _bfd_generic_get_elt_at_index
-#define oasys_update_armap_timestamp _bfd_bool_bfd_true
-#define oasys_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define oasys_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
-#define oasys_get_lineno _bfd_nosymbols_get_lineno
-#define oasys_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define oasys_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define oasys_read_minisymbols _bfd_generic_read_minisymbols
-#define oasys_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define oasys_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
-#define oasys_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
-#define oasys_set_arch_mach bfd_default_set_arch_mach
-#define oasys_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define oasys_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define oasys_bfd_relax_section bfd_generic_relax_section
-#define oasys_bfd_gc_sections bfd_generic_gc_sections
-#define oasys_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define oasys_bfd_merge_sections bfd_generic_merge_sections
-#define oasys_bfd_is_group_section bfd_generic_is_group_section
-#define oasys_bfd_discard_group bfd_generic_discard_group
-#define oasys_section_already_linked _bfd_generic_section_already_linked
-#define oasys_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define oasys_bfd_define_start_stop bfd_generic_define_start_stop
-#define oasys_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define oasys_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define oasys_bfd_link_just_syms _bfd_generic_link_just_syms
-#define oasys_bfd_copy_link_hash_symbol_type \
- _bfd_generic_copy_link_hash_symbol_type
-#define oasys_bfd_final_link _bfd_generic_final_link
-#define oasys_bfd_link_split_section _bfd_generic_link_split_section
-#define oasys_bfd_link_check_relocs _bfd_generic_link_check_relocs
-#define oasys_set_reloc _bfd_generic_set_reloc
-
-const bfd_target oasys_vec =
-{
- "oasys", /* Name. */
- bfd_target_oasys_flavour,
- BFD_ENDIAN_BIG, /* Target byte order. */
- BFD_ENDIAN_BIG, /* Target headers byte order. */
- (HAS_RELOC | EXEC_P | /* Object flags. */
- HAS_LINENO | HAS_DEBUG |
- HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
- (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
- | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
- 0, /* Leading underscore. */
- ' ', /* AR_pad_char. */
- 16, /* AR_max_namelen. */
- 0, /* match priority. */
- bfd_getb64, bfd_getb_signed_64, bfd_putb64,
- bfd_getb32, bfd_getb_signed_32, bfd_putb32,
- bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */
- bfd_getb64, bfd_getb_signed_64, bfd_putb64,
- bfd_getb32, bfd_getb_signed_32, bfd_putb32,
- bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */
-
- {_bfd_dummy_target,
- oasys_object_p, /* bfd_check_format. */
- oasys_archive_p,
- _bfd_dummy_target,
- },
- { /* bfd_set_format. */
- _bfd_bool_bfd_false_error,
- oasys_mkobject,
- _bfd_generic_mkarchive,
- _bfd_bool_bfd_false_error
- },
- { /* bfd_write_contents. */
- _bfd_bool_bfd_false_error,
- oasys_write_object_contents,
- _bfd_write_archive_contents,
- _bfd_bool_bfd_false_error,
- },
-
- BFD_JUMP_TABLE_GENERIC (oasys),
- BFD_JUMP_TABLE_COPY (_bfd_generic),
- BFD_JUMP_TABLE_CORE (_bfd_nocore),
- BFD_JUMP_TABLE_ARCHIVE (oasys),
- BFD_JUMP_TABLE_SYMBOLS (oasys),
- BFD_JUMP_TABLE_RELOCS (oasys),
- BFD_JUMP_TABLE_WRITE (oasys),
- BFD_JUMP_TABLE_LINK (oasys),
- BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
- NULL,
-
- NULL
-};
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index eae8e4a..339fa62 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -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;
@@ -699,17 +696,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
@@ -3762,8 +3748,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/peicode.h b/bfd/peicode.h
index 3b6afb8..25db010 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -1167,12 +1167,6 @@ pe_ILF_object_p (bfd * abfd)
#endif
break;
- case IMAGE_FILE_MACHINE_M68K:
-#ifdef MC68AGIC
- magic = MC68MAGIC;
-#endif
- break;
-
case IMAGE_FILE_MACHINE_R3000:
case IMAGE_FILE_MACHINE_R4000:
case IMAGE_FILE_MACHINE_R10000:
diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in
index bd42206..e3645bb 100644
--- a/bfd/po/SRC-POTFILES.in
+++ b/bfd/po/SRC-POTFILES.in
@@ -6,7 +6,6 @@ aout-ns32k.c
aout-sparcle.c
aout-target.h
aout-tic30.c
-aout0.c
aout32.c
aout64.c
aoutf1.h
@@ -24,24 +23,19 @@ cf-i386lynx.c
cf-sparclynx.c
cisco-core.c
coff-alpha.c
-coff-apollo.c
coff-arm.c
-coff-aux.c
coff-bfd.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-x86_64.c
coff-z80.c
coff-z8k.c
@@ -248,8 +242,6 @@ freebsd.h
genlink.h
go32stub.h
hash.c
-hp300bsd.c
-hp300hpux.c
hpux-core.c
i386aout.c
i386bsd.c
@@ -270,14 +262,10 @@ libbfd.h
libcoff.h
libecoff.h
libhppa.h
-liboasys.h
libpei.h
libxcoff.h
linker.c
lynx-core.c
-m68k4knetbsd.c
-m68klinux.c
-m68knetbsd.c
mach-o-aarch64.c
mach-o-arm.c
mach-o-i386.c
@@ -291,7 +279,6 @@ netbsd-core.c
netbsd.h
ns32k.h
ns32knetbsd.c
-oasys.c
opncls.c
osf-core.c
pc532-mach.c
@@ -342,7 +329,6 @@ trad-core.c
vax1knetbsd.c
vaxnetbsd.c
verilog.c
-versados.c
version.h
vms-alpha.c
vms-lib.c
diff --git a/bfd/riscix.c b/bfd/riscix.c
index b294df2..16e61ac 100644
--- a/bfd/riscix.c
+++ b/bfd/riscix.c
@@ -495,10 +495,7 @@ riscix_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;
diff --git a/bfd/targets.c b/bfd/targets.c
index 6f683f5..95b5ec9 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -151,7 +151,6 @@ DESCRIPTION
. 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,
@@ -595,7 +594,6 @@ extern const bfd_target alpha_elf64_fbsd_vec;
extern const bfd_target alpha_vms_vec;
extern const bfd_target alpha_vms_lib_txt_vec;
extern const bfd_target am33_elf32_linux_vec;
-extern const bfd_target aout0_be_vec;
extern const bfd_target aout64_vec;
extern const bfd_target aout_vec;
extern const bfd_target arc_elf32_be_vec;
@@ -700,18 +698,7 @@ extern const bfd_target m32r_elf32_linux_vec;
extern const bfd_target m32r_elf32_linux_le_vec;
extern const bfd_target m68hc11_elf32_vec;
extern const bfd_target m68hc12_elf32_vec;
-extern const bfd_target m68k_aout_4knbsd_vec;
-extern const bfd_target m68k_aout_hp300bsd_vec;
-extern const bfd_target m68k_aout_hp300hpux_vec;
-extern const bfd_target m68k_aout_linux_vec;
-extern const bfd_target m68k_aout_nbsd_vec;
-extern const bfd_target m68k_coff_vec;
-extern const bfd_target m68k_coff_apollo_vec;
-extern const bfd_target m68k_coff_aux_vec;
-extern const bfd_target m68k_coff_sysv_vec;
-extern const bfd_target m68k_coff_un_vec;
extern const bfd_target m68k_elf32_vec;
-extern const bfd_target m68k_versados_vec;
extern const bfd_target mach_o_be_vec;
extern const bfd_target mach_o_le_vec;
extern const bfd_target mach_o_fat_vec;
@@ -770,7 +757,6 @@ extern const bfd_target nios2_elf32_be_vec;
extern const bfd_target nios2_elf32_le_vec;
extern const bfd_target ns32k_aout_pc532mach_vec;
extern const bfd_target ns32k_aout_pc532nbsd_vec;
-extern const bfd_target oasys_vec;
extern const bfd_target or1k_elf32_vec;
extern const bfd_target pdp11_aout_vec;
extern const bfd_target pef_vec;
@@ -952,7 +938,6 @@ static const bfd_target * const _bfd_target_vector[] =
&am33_elf32_linux_vec,
- &aout0_be_vec,
#ifdef BFD64
&aout64_vec, /* Only compiled if host has long-long support. */
#endif
@@ -1114,27 +1099,7 @@ static const bfd_target * const _bfd_target_vector[] =
&m68hc11_elf32_vec,
&m68hc12_elf32_vec,
-#if 0
- &m68k_aout_4knbsd_vec,
- /* Clashes with sparc_aout_sunos_be_vec magic no. */
- &m68k_aout_hp300bsd_vec,
-#endif
- &m68k_aout_hp300hpux_vec,
-#if 0
- /* Since a.out files lack decent magic numbers, no way to recognize
- which kind of a.out file it is. */
- &m68k_aout_linux_vec,
-#endif
- &m68k_aout_nbsd_vec,
- &m68k_coff_vec,
-#if 0
- &m68k_coff_apollo_vec,
- &m68k_coff_aux_vec,
-#endif
- &m68k_coff_sysv_vec,
- &m68k_coff_un_vec,
&m68k_elf32_vec,
- &m68k_versados_vec,
&mach_o_be_vec,
&mach_o_le_vec,
@@ -1213,15 +1178,6 @@ static const bfd_target * const _bfd_target_vector[] =
&ns32k_aout_pc532mach_vec,
&ns32k_aout_pc532nbsd_vec,
-#if 0
- /* We have no oasys tools anymore, so we can't test any of this
- anymore. If you want to test the stuff yourself, go ahead...
- steve@cygnus.com
- Worse, since there is no magic number for archives, there
- can be annoying target mis-matches. */
- &oasys_vec,
-#endif
-
&or1k_elf32_vec,
&pdp11_aout_vec,
@@ -1804,7 +1760,6 @@ bfd_flavour_name (enum bfd_flavour flavour)
case bfd_target_ecoff_flavour: return "ECOFF";
case bfd_target_xcoff_flavour: return "XCOFF";
case bfd_target_elf_flavour: return "ELF";
- case bfd_target_oasys_flavour: return "Oasys";
case bfd_target_tekhex_flavour: return "Tekhex";
case bfd_target_srec_flavour: return "Srec";
case bfd_target_verilog_flavour: return "Verilog";
diff --git a/bfd/versados.c b/bfd/versados.c
deleted file mode 100644
index cfaba72..0000000
--- a/bfd/versados.c
+++ /dev/null
@@ -1,939 +0,0 @@
-/* BFD back-end for VERSAdos-E objects.
- Copyright (C) 1995-2018 Free Software Foundation, Inc.
- Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
-
- Versados is a Motorola trademark.
-
- 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. */
-
-/*
- SUBSECTION
- VERSAdos-E relocatable object file format
-
- DESCRIPTION
-
- This module supports reading of VERSAdos relocatable
- object files.
-
- A VERSAdos file looks like contains
-
- o Identification Record
- o External Symbol Definition Record
- o Object Text Record
- o End Record. */
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-#include "libiberty.h"
-
-
-#define VHEADER '1'
-#define VESTDEF '2'
-#define VOTR '3'
-#define VEND '4'
-
-#define ES_BASE 17 /* First symbol has esdid 17. */
-
-/* Per file target dependent information. */
-
-/* One for each section. */
-struct esdid
-{
- asection *section; /* Ptr to bfd version. */
- unsigned char *contents; /* Used to build image. */
- bfd_size_type content_size; /* The size of the contents buffer. */
- int pc;
- int relocs; /* Reloc count, valid end of pass 1. */
- int donerel; /* Have relocs been translated. */
-};
-
-typedef struct versados_data_struct
-{
- int es_done; /* Count of symbol index, starts at ES_BASE. */
- asymbol *symbols; /* Pointer to local symbols. */
- char *strings; /* Strings of all the above. */
- int stringlen; /* Len of string table (valid end of pass1). */
- int nsecsyms; /* Number of sections. */
-
- int ndefs; /* Number of exported symbols (they dont get esdids). */
- int nrefs; /* Number of imported symbols (valid end of pass1). */
-
- int ref_idx; /* Current processed value of the above. */
- int def_idx;
-
- int pass_2_done;
-
- struct esdid e[16]; /* Per section info. */
- int alert; /* To see if we're trampling. */
- asymbol *rest[256 - 16]; /* Per symbol info. */
-}
-tdata_type;
-
-#define VDATA(abfd) (abfd->tdata.versados_data)
-#define EDATA(abfd, n) (abfd->tdata.versados_data->e[(n) < 16 ? (n) : 0])
-#define RDATA(abfd, n) (abfd->tdata.versados_data->rest[(n) < 240 ? (n) : 0])
-
-struct ext_otr
-{
- unsigned char size;
- char type;
- unsigned char map[4];
- unsigned char esdid;
- unsigned char data[200];
-};
-
-struct ext_vheader
-{
- unsigned char size;
- char type; /* Record type. */
- char name[10]; /* Module name. */
- char rev; /* Module rev number. */
- char lang;
- char vol[4];
- char user[2];
- char cat[8];
- char fname[8];
- char ext[2];
- char time[3];
- char date[3];
- char rest[211];
-};
-
-struct ext_esd
-{
- unsigned char size;
- char type;
- unsigned char esd_entries[1];
-};
-
-#define ESD_ABS 0
-#define ESD_COMMON 1
-#define ESD_STD_REL_SEC 2
-#define ESD_SHRT_REL_SEC 3
-#define ESD_XDEF_IN_SEC 4
-#define ESD_XDEF_IN_ABS 5
-#define ESD_XREF_SEC 6
-#define ESD_XREF_SYM 7
-
-union ext_any
-{
- unsigned char size;
- struct ext_vheader header;
- struct ext_esd esd;
- struct ext_otr otr;
-};
-
-/* Initialize by filling in the hex conversion array. */
-
-/* Set up the tdata information. */
-
-static bfd_boolean
-versados_mkobject (bfd *abfd)
-{
- if (abfd->tdata.versados_data == NULL)
- {
- bfd_size_type amt = sizeof (tdata_type);
- tdata_type *tdata = bfd_zalloc (abfd, amt);
-
- if (tdata == NULL)
- return FALSE;
- abfd->tdata.versados_data = tdata;
- tdata->symbols = NULL;
- VDATA (abfd)->alert = 0x12345678;
- }
-
- bfd_default_set_arch_mach (abfd, bfd_arch_m68k, 0);
- return TRUE;
-}
-
-/* Report a problem in an S record file. FIXME: This probably should
- not call fprintf, but we really do need some mechanism for printing
- error messages. */
-
-static asymbol *
-versados_new_symbol (bfd *abfd,
- int snum,
- const char *name,
- bfd_vma val,
- asection *sec)
-{
- asymbol *n = VDATA (abfd)->symbols + snum;
- n->name = name;
- n->value = val;
- n->section = sec;
- n->the_bfd = abfd;
- n->flags = 0;
- return n;
-}
-
-static bfd_boolean
-get_record (bfd *abfd, union ext_any *ptr)
-{
- if (bfd_bread (&ptr->size, (bfd_size_type) 1, abfd) != 1
- || (bfd_bread ((char *) ptr + 1, (bfd_size_type) ptr->size, abfd)
- != ptr->size))
- return FALSE;
-
- {
- bfd_size_type amt = ptr->size + 1;
-
- if (amt < sizeof (* ptr))
- memset ((char *) ptr + amt, 0, sizeof (* ptr) - amt);
- }
-
- return TRUE;
-}
-
-static int
-get_4 (unsigned char **pp)
-{
- unsigned char *p = *pp;
-
- *pp += 4;
- return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3] << 0);
-}
-
-static void
-get_10 (unsigned char **pp, char *name)
-{
- char *p = (char *) *pp;
- int len = 10;
-
- *pp += len;
- while (*p != ' ' && len)
- {
- *name++ = *p++;
- len--;
- }
- *name = 0;
-}
-
-static char *
-new_symbol_string (bfd *abfd, const char *name)
-{
- char *n = VDATA (abfd)->strings;
-
- strcpy (VDATA (abfd)->strings, name);
- VDATA (abfd)->strings += strlen (VDATA (abfd)->strings) + 1;
- return n;
-}
-
-static void
-process_esd (bfd *abfd, struct ext_esd *esd, int pass)
-{
- /* Read through the ext def for the est entries. */
- int togo = esd->size - 2;
- bfd_vma size;
- bfd_vma start;
- asection *sec;
- char name[11];
- unsigned char *ptr = esd->esd_entries;
- unsigned char *end = ptr + togo;
-
- while (ptr < end)
- {
- int scn = *ptr & 0xf;
- int typ = (*ptr >> 4) & 0xf;
-
- /* Declare this section. */
- sprintf (name, "%d", scn);
- sec = bfd_make_section_old_way (abfd, strdup (name));
- sec->target_index = scn;
- EDATA (abfd, scn).section = sec;
- ptr++;
-
- switch (typ)
- {
- default:
- abort ();
- case ESD_XREF_SEC:
- case ESD_XREF_SYM:
- {
- int snum = VDATA (abfd)->ref_idx++;
- get_10 (&ptr, name);
- if (pass == 1)
- VDATA (abfd)->stringlen += strlen (name) + 1;
- else
- {
- int esidx;
- asymbol *s;
- char *n = new_symbol_string (abfd, name);
-
- s = versados_new_symbol (abfd, snum, n, (bfd_vma) 0,
- bfd_und_section_ptr);
- esidx = VDATA (abfd)->es_done++;
- RDATA (abfd, esidx - ES_BASE) = s;
- }
- }
- break;
-
- case ESD_ABS:
- size = get_4 (&ptr);
- (void) size;
- start = get_4 (&ptr);
- (void) start;
- break;
- case ESD_STD_REL_SEC:
- case ESD_SHRT_REL_SEC:
- sec->size = get_4 (&ptr);
- sec->flags |= SEC_ALLOC;
- break;
- case ESD_XDEF_IN_ABS:
- sec = bfd_abs_section_ptr;
- /* Fall through. */
- case ESD_XDEF_IN_SEC:
- {
- int snum = VDATA (abfd)->def_idx++;
- bfd_vma val;
-
- get_10 (&ptr, name);
- val = get_4 (&ptr);
- if (pass == 1)
- /* Just remember the symbol. */
- VDATA (abfd)->stringlen += strlen (name) + 1;
- else
- {
- asymbol *s;
- char *n = new_symbol_string (abfd, name);
-
- s = versados_new_symbol (abfd, snum + VDATA (abfd)->nrefs, n,
- val, sec);
- s->flags |= BSF_GLOBAL;
- }
- }
- break;
- }
- }
-}
-
-#define R_RELWORD 1
-#define R_RELLONG 2
-#define R_RELWORD_NEG 3
-#define R_RELLONG_NEG 4
-
-reloc_howto_type versados_howto_table[] =
-{
- HOWTO (R_RELWORD, 0, 1, 16, FALSE,
- 0, complain_overflow_dont, 0,
- "+v16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
- HOWTO (R_RELLONG, 0, 2, 32, FALSE,
- 0, complain_overflow_dont, 0,
- "+v32", TRUE, 0xffffffff, 0xffffffff, FALSE),
-
- HOWTO (R_RELWORD_NEG, 0, -1, 16, FALSE,
- 0, complain_overflow_dont, 0,
- "-v16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
- HOWTO (R_RELLONG_NEG, 0, -2, 32, FALSE,
- 0, complain_overflow_dont, 0,
- "-v32", TRUE, 0xffffffff, 0xffffffff, FALSE),
-};
-
-static int
-get_offset (unsigned int len, unsigned char *ptr)
-{
- int val = 0;
-
- if (len)
- {
- unsigned int i;
-
- val = *ptr++;
- if (val & 0x80)
- val |= ~0xff;
- for (i = 1; i < len; i++)
- val = (val << 8) | *ptr++;
- }
-
- return val;
-}
-
-static void
-process_otr (bfd *abfd, struct ext_otr *otr, int pass)
-{
- unsigned long shift;
- unsigned char *srcp = otr->data;
- unsigned char *endp = (unsigned char *) otr + otr->size;
- unsigned int bits = (otr->map[0] << 24)
- | (otr->map[1] << 16)
- | (otr->map[2] << 8)
- | (otr->map[3] << 0);
-
- struct esdid *esdid;
- unsigned char *contents;
- bfd_boolean need_contents = FALSE;
- unsigned int dst_idx;
-
- /* PR 17512: file: ac7da425. */
- if (otr->esdid == 0)
- return;
-
- esdid = &EDATA (abfd, otr->esdid - 1);
- contents = esdid->contents;
- dst_idx = esdid->pc;
-
- for (shift = ((unsigned long) 1 << 31); shift && srcp < endp; shift >>= 1)
- {
- if (bits & shift)
- {
- int flag = *srcp++;
- int esdids = (flag >> 5) & 0x7;
- int sizeinwords = ((flag >> 3) & 1) ? 2 : 1;
- unsigned int offsetlen = flag & 0x7;
- int j;
-
- /* PR 21591: Check for invalid lengths. */
- if (srcp + esdids + offsetlen >= endp)
- return;
-
- if (esdids == 0)
- {
- /* A zero esdid means the new pc is the offset given. */
- dst_idx += get_offset (offsetlen, srcp);
- srcp += offsetlen;
- }
- else
- {
- int val = get_offset (offsetlen, srcp + esdids);
-
- if (pass == 1)
- need_contents = TRUE;
- else if (contents && dst_idx < esdid->content_size - sizeinwords * 2)
- for (j = 0; j < sizeinwords * 2; j++)
- {
- contents[dst_idx + (sizeinwords * 2) - j - 1] = val;
- val >>= 8;
- }
-
- for (j = 0; j < esdids; j++)
- {
- int id = *srcp++;
-
- if (id)
- {
- int rn = EDATA (abfd, otr->esdid - 1).relocs++;
-
- if (pass == 1)
- {
- /* This is the first pass over the data,
- just remember that we need a reloc. */
- }
- else
- {
- arelent *n;
-
- /* PR 17512: file: 54f733e0. */
- if (EDATA (abfd, otr->esdid - 1).section == NULL)
- continue;
- n = EDATA (abfd, otr->esdid - 1).section->relocation + rn;
- n->address = dst_idx;
- n->sym_ptr_ptr = (asymbol **) (size_t) id;
- n->addend = 0;
- n->howto = versados_howto_table + ((j & 1) * 2) + (sizeinwords - 1);
- }
- }
- }
- srcp += offsetlen;
- dst_idx += sizeinwords * 2;
- }
- }
- else
- {
- need_contents = TRUE;
-
- if (esdid->section && contents && dst_idx < esdid->content_size - 1)
- if (pass == 2)
- {
- /* Absolute code, comes in 16 bit lumps. */
- contents[dst_idx] = srcp[0];
- contents[dst_idx + 1] = srcp[1];
- }
-
- dst_idx += 2;
- srcp += 2;
- }
- }
-
- EDATA (abfd, otr->esdid - 1).pc = dst_idx;
-
- if (!contents && need_contents)
- {
- if (esdid->section)
- {
- bfd_size_type size;
-
- size = esdid->section->size;
- esdid->contents = bfd_alloc (abfd, size);
- esdid->content_size = size;
- }
- else
- esdid->contents = NULL;
- }
-}
-
-static bfd_boolean
-versados_scan (bfd *abfd)
-{
- bfd_boolean loop = TRUE;
- int i;
- int j;
- int nsecs = 0;
- bfd_size_type amt;
-
- VDATA (abfd)->stringlen = 0;
- VDATA (abfd)->nrefs = 0;
- VDATA (abfd)->ndefs = 0;
- VDATA (abfd)->ref_idx = 0;
- VDATA (abfd)->def_idx = 0;
- VDATA (abfd)->pass_2_done = 0;
-
- while (loop)
- {
- union ext_any any;
-
- if (!get_record (abfd, &any))
- return FALSE;
- switch (any.header.type)
- {
- case VHEADER:
- break;
- case VEND:
- loop = FALSE;
- break;
- case VESTDEF:
- process_esd (abfd, &any.esd, 1);
- break;
- case VOTR:
- process_otr (abfd, &any.otr, 1);
- break;
- }
- }
-
- /* Now allocate space for the relocs and sections. */
- VDATA (abfd)->nrefs = VDATA (abfd)->ref_idx;
- VDATA (abfd)->ndefs = VDATA (abfd)->def_idx;
- VDATA (abfd)->ref_idx = 0;
- VDATA (abfd)->def_idx = 0;
-
- abfd->symcount = VDATA (abfd)->nrefs + VDATA (abfd)->ndefs;
-
- for (i = 0; i < 16; i++)
- {
- struct esdid *esdid = &EDATA (abfd, i);
-
- if (esdid->section)
- {
- amt = (bfd_size_type) esdid->relocs * sizeof (arelent);
- esdid->section->relocation = bfd_alloc (abfd, amt);
- esdid->pc = 0;
-
- if (esdid->contents)
- esdid->section->flags |= SEC_HAS_CONTENTS | SEC_LOAD;
-
- esdid->section->reloc_count = esdid->relocs;
- if (esdid->relocs)
- esdid->section->flags |= SEC_RELOC;
-
- esdid->relocs = 0;
-
- /* Add an entry into the symbol table for it. */
- nsecs++;
- VDATA (abfd)->stringlen += strlen (esdid->section->name) + 1;
- }
- }
-
- abfd->symcount += nsecs;
-
- amt = abfd->symcount;
- amt *= sizeof (asymbol);
- VDATA (abfd)->symbols = bfd_alloc (abfd, amt);
-
- amt = VDATA (abfd)->stringlen;
- VDATA (abfd)->strings = bfd_alloc (abfd, amt);
-
- if ((VDATA (abfd)->symbols == NULL && abfd->symcount > 0)
- || (VDATA (abfd)->strings == NULL && VDATA (abfd)->stringlen > 0))
- return FALSE;
-
- /* Actually fill in the section symbols,
- we stick them at the end of the table. */
- for (j = VDATA (abfd)->nrefs + VDATA (abfd)->ndefs, i = 0; i < 16; i++)
- {
- struct esdid *esdid = &EDATA (abfd, i);
- asection *sec = esdid->section;
-
- if (sec)
- {
- asymbol *s = VDATA (abfd)->symbols + j;
- s->name = new_symbol_string (abfd, sec->name);
- s->section = sec;
- s->flags = BSF_LOCAL;
- s->value = 0;
- s->the_bfd = abfd;
- j++;
- }
- }
-
- if (abfd->symcount)
- abfd->flags |= HAS_SYMS;
-
- /* Set this to nsecs - since we've already planted the section
- symbols. */
- VDATA (abfd)->nsecsyms = nsecs;
-
- VDATA (abfd)->ref_idx = 0;
-
- return TRUE;
-}
-
-/* Check whether an existing file is a versados file. */
-
-static const bfd_target *
-versados_object_p (bfd *abfd)
-{
- struct ext_vheader ext;
- unsigned char len;
- tdata_type *tdata_save;
-
- if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
- return NULL;
-
- if (bfd_bread (&len, (bfd_size_type) 1, abfd) != 1)
- {
- if (bfd_get_error () != bfd_error_system_call)
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
-
- /* PR 17512: file: 726-2128-0.004. */
- if (len < 13)
- {
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
-
- if (bfd_bread (&ext.type, (bfd_size_type) len, abfd) != len)
- {
- if (bfd_get_error () != bfd_error_system_call)
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
-
- /* We guess that the language field will never be larger than 10.
- In sample files, it is always either 0 or 1. Checking for this
- prevents confusion with Intel Hex files. */
- if (ext.type != VHEADER
- || ext.lang > 10)
- {
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
-
- /* OK, looks like a record, build the tdata and read in. */
- tdata_save = abfd->tdata.versados_data;
- if (!versados_mkobject (abfd) || !versados_scan (abfd))
- {
- abfd->tdata.versados_data = tdata_save;
- return NULL;
- }
-
- return abfd->xvec;
-}
-
-static bfd_boolean
-versados_pass_2 (bfd *abfd)
-{
- union ext_any any;
-
- if (VDATA (abfd)->pass_2_done)
- return 1;
-
- if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
- return 0;
-
- VDATA (abfd)->es_done = ES_BASE;
-
- /* Read records till we get to where we want to be. */
- while (1)
- {
- get_record (abfd, &any);
- switch (any.header.type)
- {
- case VEND:
- VDATA (abfd)->pass_2_done = 1;
- return 1;
- case VESTDEF:
- process_esd (abfd, &any.esd, 2);
- break;
- case VOTR:
- process_otr (abfd, &any.otr, 2);
- break;
- }
- }
-}
-
-static bfd_boolean
-versados_get_section_contents (bfd *abfd,
- asection *section,
- void * location,
- file_ptr offset,
- bfd_size_type count)
-{
- struct esdid *esdid;
-
- if (!versados_pass_2 (abfd))
- return FALSE;
-
- esdid = &EDATA (abfd, section->target_index);
-
- if (esdid->contents == NULL
- || offset < 0
- || (bfd_size_type) offset > esdid->content_size
- || offset + count > esdid->content_size)
- return FALSE;
-
- memcpy (location, esdid->contents + offset, (size_t) count);
-
- return TRUE;
-}
-
-#define versados_get_section_contents_in_window \
- _bfd_generic_get_section_contents_in_window
-
-static bfd_boolean
-versados_set_section_contents (bfd *abfd ATTRIBUTE_UNUSED,
- sec_ptr section ATTRIBUTE_UNUSED,
- const void * location ATTRIBUTE_UNUSED,
- file_ptr offset ATTRIBUTE_UNUSED,
- bfd_size_type bytes_to_do ATTRIBUTE_UNUSED)
-{
- return FALSE;
-}
-
-static int
-versados_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
-/* Return the amount of memory needed to read the symbol table. */
-
-static long
-versados_get_symtab_upper_bound (bfd *abfd)
-{
- return (bfd_get_symcount (abfd) + 1) * sizeof (asymbol *);
-}
-
-/* Return the symbol table. */
-
-static long
-versados_canonicalize_symtab (bfd *abfd, asymbol **alocation)
-{
- unsigned int symcount = bfd_get_symcount (abfd);
- unsigned int i;
- asymbol *s;
-
- versados_pass_2 (abfd);
-
- for (i = 0, s = VDATA (abfd)->symbols;
- i < symcount;
- s++, i++)
- *alocation++ = s;
-
- *alocation = NULL;
-
- return symcount;
-}
-
-static void
-versados_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED,
- asymbol *symbol,
- symbol_info *ret)
-{
- bfd_symbol_info (symbol, ret);
-}
-
-static void
-versados_print_symbol (bfd *abfd,
- void * afile,
- asymbol *symbol,
- bfd_print_symbol_type how)
-{
- FILE *file = (FILE *) afile;
-
- switch (how)
- {
- case bfd_print_symbol_name:
- fprintf (file, "%s", symbol->name);
- break;
- default:
- bfd_print_symbol_vandf (abfd, (void *) file, symbol);
- fprintf (file, " %-5s %s",
- symbol->section->name,
- symbol->name);
- }
-}
-
-static long
-versados_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED,
- sec_ptr asect)
-{
- return (asect->reloc_count + 1) * sizeof (arelent *);
-}
-
-static long
-versados_canonicalize_reloc (bfd *abfd,
- sec_ptr section,
- arelent **relptr,
- asymbol **symbols)
-{
- unsigned int count;
- arelent *src;
-
- versados_pass_2 (abfd);
- src = section->relocation;
-
- if (!EDATA (abfd, section->target_index).donerel)
- {
- EDATA (abfd, section->target_index).donerel = 1;
- /* Translate from indexes to symptr ptrs. */
- for (count = 0; count < section->reloc_count; count++)
- {
- int esdid = (int) (size_t) src[count].sym_ptr_ptr;
-
- if (esdid == 0)
- src[count].sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
- else if (esdid < ES_BASE)
- {
- /* Section relative thing. */
- struct esdid *e = &EDATA (abfd, esdid - 1);
-
- /* PR 17512: file:cd92277c. */
- if (e->section)
- src[count].sym_ptr_ptr = e->section->symbol_ptr_ptr;
- else
- src[count].sym_ptr_ptr = bfd_und_section_ptr->symbol_ptr_ptr;
- }
- /* PR 17512: file:3757-2936-0.004. */
- else if ((unsigned) (esdid - ES_BASE) >= bfd_get_symcount (abfd))
- src[count].sym_ptr_ptr = bfd_und_section_ptr->symbol_ptr_ptr;
- else
- src[count].sym_ptr_ptr = symbols + esdid - ES_BASE;
- }
- }
-
- for (count = 0; count < section->reloc_count; count++)
- *relptr++ = src++;
-
- *relptr = 0;
- return section->reloc_count;
-}
-
-#define versados_close_and_cleanup _bfd_generic_close_and_cleanup
-#define versados_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define versados_new_section_hook _bfd_generic_new_section_hook
-#define versados_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
-#define versados_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define versados_get_lineno _bfd_nosymbols_get_lineno
-#define versados_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define versados_find_line _bfd_nosymbols_find_line
-#define versados_find_inliner_info _bfd_nosymbols_find_inliner_info
-#define versados_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define versados_make_empty_symbol _bfd_generic_make_empty_symbol
-#define versados_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define versados_read_minisymbols _bfd_generic_read_minisymbols
-#define versados_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define versados_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
-#define versados_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
-#define versados_set_arch_mach bfd_default_set_arch_mach
-#define versados_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define versados_bfd_relax_section bfd_generic_relax_section
-#define versados_bfd_gc_sections bfd_generic_gc_sections
-#define versados_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define versados_bfd_merge_sections bfd_generic_merge_sections
-#define versados_bfd_is_group_section bfd_generic_is_group_section
-#define versados_bfd_discard_group bfd_generic_discard_group
-#define versados_section_already_linked _bfd_generic_section_already_linked
-#define versados_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define versados_bfd_define_start_stop bfd_generic_define_start_stop
-#define versados_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define versados_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define versados_bfd_link_just_syms _bfd_generic_link_just_syms
-#define versados_bfd_copy_link_hash_symbol_type \
- _bfd_generic_copy_link_hash_symbol_type
-#define versados_bfd_final_link _bfd_generic_final_link
-#define versados_bfd_link_split_section _bfd_generic_link_split_section
-#define versados_bfd_link_check_relocs _bfd_generic_link_check_relocs
-#define versados_set_reloc _bfd_generic_set_reloc
-
-const bfd_target m68k_versados_vec =
-{
- "versados", /* Name. */
- bfd_target_versados_flavour,
- BFD_ENDIAN_BIG, /* Target byte order. */
- BFD_ENDIAN_BIG, /* Target headers byte order. */
- (HAS_RELOC | EXEC_P | /* Object flags. */
- HAS_LINENO | HAS_DEBUG |
- HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
- (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
- | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
- 0, /* Leading underscore. */
- ' ', /* AR_pad_char. */
- 16, /* AR_max_namelen. */
- 0, /* match priority. */
- bfd_getb64, bfd_getb_signed_64, bfd_putb64,
- bfd_getb32, bfd_getb_signed_32, bfd_putb32,
- bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */
- bfd_getb64, bfd_getb_signed_64, bfd_putb64,
- bfd_getb32, bfd_getb_signed_32, bfd_putb32,
- bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */
-
- {
- _bfd_dummy_target,
- versados_object_p, /* bfd_check_format. */
- _bfd_dummy_target,
- _bfd_dummy_target,
- },
- {
- _bfd_bool_bfd_false_error,
- versados_mkobject,
- _bfd_generic_mkarchive,
- _bfd_bool_bfd_false_error,
- },
- { /* bfd_write_contents. */
- _bfd_bool_bfd_false_error,
- _bfd_bool_bfd_false_error,
- _bfd_write_archive_contents,
- _bfd_bool_bfd_false_error,
- },
-
- BFD_JUMP_TABLE_GENERIC (versados),
- BFD_JUMP_TABLE_COPY (_bfd_generic),
- BFD_JUMP_TABLE_CORE (_bfd_nocore),
- BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
- BFD_JUMP_TABLE_SYMBOLS (versados),
- BFD_JUMP_TABLE_RELOCS (versados),
- BFD_JUMP_TABLE_WRITE (versados),
- BFD_JUMP_TABLE_LINK (versados),
- BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
- NULL,
-
- NULL
-};