aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ObsoleteFiles.inc4
-rw-r--r--UPDATING4
-rw-r--r--gnu/usr.bin/Makefile2
-rw-r--r--gnu/usr.bin/binutils/Makefile13
-rw-r--r--gnu/usr.bin/binutils/Makefile.inc6
-rw-r--r--gnu/usr.bin/binutils/Makefile.inc052
-rw-r--r--gnu/usr.bin/binutils/doc/Makefile11
-rw-r--r--gnu/usr.bin/binutils/doc/Makefile.depend11
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile109
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.amd6429
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.arm21
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.depend13
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.depend.host11
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.i38621
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.mips38
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.powerpc19
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.powerpc6428
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.sparc6423
-rw-r--r--gnu/usr.bin/binutils/libbfd/bfd.h5410
-rw-r--r--gnu/usr.bin/binutils/libbfd/config.h.fbsd297
-rw-r--r--gnu/usr.bin/binutils/libbfd/elf-fbsd-brand.c30
-rw-r--r--gnu/usr.bin/binutils/libbinutils/Makefile33
-rw-r--r--gnu/usr.bin/binutils/libbinutils/Makefile.depend15
-rw-r--r--gnu/usr.bin/binutils/libbinutils/config.h215
-rw-r--r--gnu/usr.bin/binutils/libiberty/Makefile42
-rw-r--r--gnu/usr.bin/binutils/libiberty/Makefile.depend14
-rw-r--r--gnu/usr.bin/binutils/libiberty/config.h449
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile22
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile.amd644
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile.arm4
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile.depend13
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile.i3864
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile.m68k6
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile.mips4
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile.powerpc4
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile.sparc6
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile.sparc644
-rw-r--r--gnu/usr.bin/binutils/libopcodes/config.h70
-rwxr-xr-xgnu/usr.bin/binutils/update.sh47
-rw-r--r--gnu/usr.bin/gdb/Makefile7
-rw-r--r--gnu/usr.bin/gdb/Makefile.inc73
-rw-r--r--gnu/usr.bin/gdb/arch/amd64/Makefile24
-rw-r--r--gnu/usr.bin/gdb/arch/amd64/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/amd64/init.c234
-rw-r--r--gnu/usr.bin/gdb/arch/arm/Makefile20
-rw-r--r--gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c552
-rw-r--r--gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c68
-rw-r--r--gnu/usr.bin/gdb/arch/arm/config.h562
-rw-r--r--gnu/usr.bin/gdb/arch/arm/init.c228
-rw-r--r--gnu/usr.bin/gdb/arch/arm/nm-fbsd.h35
-rw-r--r--gnu/usr.bin/gdb/arch/arm/tm-fbsd.h28
-rw-r--r--gnu/usr.bin/gdb/arch/arm/xm-fbsd.h22
-rw-r--r--gnu/usr.bin/gdb/arch/i386/Makefile23
-rw-r--r--gnu/usr.bin/gdb/arch/i386/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/i386/init.c236
-rw-r--r--gnu/usr.bin/gdb/arch/mips/Makefile16
-rw-r--r--gnu/usr.bin/gdb/arch/mips/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/mips/init.c233
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc/Makefile14
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc/init.c230
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc64/Makefile14
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc64/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc64/init.c230
-rw-r--r--gnu/usr.bin/gdb/arch/sparc64/Makefile14
-rw-r--r--gnu/usr.bin/gdb/arch/sparc64/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/sparc64/init.c232
-rw-r--r--gnu/usr.bin/gdb/gdb/Makefile20
-rw-r--r--gnu/usr.bin/gdb/gdb/Makefile.depend25
-rw-r--r--gnu/usr.bin/gdb/gdb/gdb.1376
-rw-r--r--gnu/usr.bin/gdb/gdbserver/Makefile26
-rw-r--r--gnu/usr.bin/gdb/gdbserver/Makefile.depend18
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c213
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-arm-low.c146
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-i386-low.c176
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-low.c1265
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-low.h122
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c156
-rw-r--r--gnu/usr.bin/gdb/gdbserver/reg-amd64.c99
-rw-r--r--gnu/usr.bin/gdb/gdbserver/reg-arm.c68
-rw-r--r--gnu/usr.bin/gdb/gdbserver/reg-i386.c63
-rw-r--r--gnu/usr.bin/gdb/gdbserver/reg-powerpc.c113
-rw-r--r--gnu/usr.bin/gdb/kgdb/Makefile16
-rw-r--r--gnu/usr.bin/gdb/kgdb/Makefile.depend27
-rw-r--r--gnu/usr.bin/gdb/kgdb/kgdb.1150
-rw-r--r--gnu/usr.bin/gdb/kgdb/kgdb.h81
-rw-r--r--gnu/usr.bin/gdb/kgdb/kld.c515
-rw-r--r--gnu/usr.bin/gdb/kgdb/kthr.c252
-rw-r--r--gnu/usr.bin/gdb/kgdb/main.c481
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt.c395
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_amd64.c212
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_arm.c286
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_i386.c418
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_mips.c253
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_powerpc.c214
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c211
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_sparc64.c218
-rw-r--r--gnu/usr.bin/gdb/libgdb/Makefile80
-rw-r--r--gnu/usr.bin/gdb/libgdb/Makefile.depend19
-rw-r--r--gnu/usr.bin/gdb/libgdb/fbsd-threads.c1799
-rw-r--r--tools/build/mk/OptionalObsoleteFiles.inc5
101 files changed, 8 insertions, 22013 deletions
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 894e0b3d186a..f551bc759399 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -36,6 +36,10 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20201215: in-tree gdb removed
+OLD_FILES+=usr/libexec/gdb
+OLD_FILES+=usr/libexec/kgdb
+
# 20201211: hme(4) removed
OLD_FILES+=usr/share/man/man4/hme.4.gz
OLD_FILES+=usr/share/man/man4/if_hme.4.gz
diff --git a/UPDATING b/UPDATING
index bfd5434b9b4c..1e546ac38ab0 100644
--- a/UPDATING
+++ b/UPDATING
@@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
world, or to merely disable the most expensive debugging functionality
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20201215:
+ Obsolete in-tree GDB 6.1.1 has been removed. GDB (including kgdb)
+ may be installed from ports or packages.
+
20201124:
ping6 has been merged into ping. It can now be called as "ping -6".
See ping(8) for details.
diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile
index e669f3a36c9b..f0aff545ddc9 100644
--- a/gnu/usr.bin/Makefile
+++ b/gnu/usr.bin/Makefile
@@ -5,8 +5,6 @@
SUBDIR.${MK_DIALOG}+= dialog
SUBDIR.${MK_GNU_DIFF}+= diff3
SUBDIR.${MK_GNU_GREP}+= grep
-SUBDIR.${MK_GDB}+= binutils gdb
-SUBDIR_DEPEND_gdb= binutils
SUBDIR.${MK_TESTS}+= tests
SUBDIR_PARALLEL=
diff --git a/gnu/usr.bin/binutils/Makefile b/gnu/usr.bin/binutils/Makefile
deleted file mode 100644
index eccbf31ef925..000000000000
--- a/gnu/usr.bin/binutils/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# $FreeBSD$
-
-.include <src.opts.mk>
-
-SUBDIR= libiberty \
- libbfd \
- libopcodes
-
-.if !make(install)
-SUBDIR_PARALLEL=
-.endif
-
-.include <bsd.subdir.mk>
diff --git a/gnu/usr.bin/binutils/Makefile.inc b/gnu/usr.bin/binutils/Makefile.inc
deleted file mode 100644
index aba3cc7fa5eb..000000000000
--- a/gnu/usr.bin/binutils/Makefile.inc
+++ /dev/null
@@ -1,6 +0,0 @@
-# $FreeBSD$
-
-WARNS?= 3
-PACKAGE= binutils
-
-.include "../Makefile.inc"
diff --git a/gnu/usr.bin/binutils/Makefile.inc0 b/gnu/usr.bin/binutils/Makefile.inc0
deleted file mode 100644
index c624a1b9f2b1..000000000000
--- a/gnu/usr.bin/binutils/Makefile.inc0
+++ /dev/null
@@ -1,52 +0,0 @@
-# $FreeBSD$
-#
-# This is included explicitly at the top of each sub-Makefile. We can't
-# use the normal "Makefile.inc" mechanism, because we need some of these
-# definitions before the sub-Makefile is processed.
-
-VERSION= "2.17.50 [FreeBSD] 2007-07-03"
-
-.if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}}
-.else
-TARGET_CPUARCH=${MACHINE_CPUARCH}
-.endif
-TARGET_ARCH?= ${MACHINE_ARCH}
-TARGET_VENDOR?= unknown
-TARGET_OS?= freebsd
-BINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/}
-TARGET_TUPLE?= ${BINUTILS_ARCH}-${TARGET_VENDOR}-${TARGET_OS}
-.if ${TARGET_ARCH:Marm*eb} != "" || \
- (${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips*el*} == "")
-TARGET_BIG_ENDIAN=t
-.endif
-
-# GNURELTOP is the relative path to this point in the source or object
-# tree, from any subdirectory of same. It gets extra "../" prefixes
-# added to it as we descend into subdirectories.
-GNURELTOP:= ..
-
-RELSRC= ${GNURELTOP}/../../../contrib/binutils
-SRCDIR= ${.CURDIR}/${RELSRC}
-
-.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \
- ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpcspe" || \
- (${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips64*} == "")
-CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32
-.else
-CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64
-.endif
-
-CFLAGS+= -I.
-CFLAGS+= -I${.CURDIR}
-CFLAGS+= -I${.CURDIR}/${GNURELTOP}/libbfd
-CFLAGS+= -I${.OBJDIR}/${GNURELTOP}/libbfd
-CFLAGS+= -I${SRCDIR}/include
-
-ARCHS= ${TARGET_CPUARCH}
-
-.if exists(${.CURDIR}/Makefile.${TARGET_ARCH})
-.include "${.CURDIR}/Makefile.${TARGET_ARCH}"
-.elif exists(${.CURDIR}/Makefile.${TARGET_CPUARCH})
-.include "${.CURDIR}/Makefile.${TARGET_CPUARCH}"
-.endif
diff --git a/gnu/usr.bin/binutils/doc/Makefile b/gnu/usr.bin/binutils/doc/Makefile
deleted file mode 100644
index ba17ab997ae3..000000000000
--- a/gnu/usr.bin/binutils/doc/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# $FreeBSD$
-
-.include "../Makefile.inc0"
-
-.PATH: ${SRCDIR}/gas/doc \
- ${SRCDIR}/ld \
- ${SRCDIR}/binutils/doc
-
-MAN= ld.7 ldint.7 as.7 binutils.7
-
-.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/binutils/doc/Makefile.depend b/gnu/usr.bin/binutils/doc/Makefile.depend
deleted file mode 100644
index f80275d86ab1..000000000000
--- a/gnu/usr.bin/binutils/doc/Makefile.depend
+++ /dev/null
@@ -1,11 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile b/gnu/usr.bin/binutils/libbfd/Makefile
deleted file mode 100644
index 3132cd83acce..000000000000
--- a/gnu/usr.bin/binutils/libbfd/Makefile
+++ /dev/null
@@ -1,109 +0,0 @@
-# $FreeBSD$
-
-.include "../Makefile.inc0"
-
-.PATH: ${SRCDIR}/bfd ${SRCDIR}/opcodes
-
-LIB= bfd
-SRCS+= archive.c \
- archive64.c \
- archures.c \
- bfd.c \
- bfdio.c \
- bfdver.h \
- bfdwin.c \
- binary.c \
- cache.c \
- coffgen.c \
- config.h \
- corefile.c \
- dwarf1.c \
- dwarf2.c \
- elf-attrs.c \
- elf-eh-frame.c \
- elf-strtab.c \
- elf-vxworks.c \
- elf.c \
- format.c \
- hash.c \
- ihex.c \
- init.c \
- libbfd.c \
- linker.c \
- merge.c \
- opncls.c \
- reloc.c \
- section.c \
- simple.c \
- srec.c \
- stab-syms.c \
- stabs.c \
- syms.c \
- targets.c \
- targmatch.h \
- tekhex.c
-.if ${TARGET_ARCH} == "sparc64"
-WARNS?= 2
-.endif
-CFLAGS+= -D_GNU_SOURCE
-CFLAGS+= -I${SRCDIR}/bfd
-INTERNALLIB=
-CLEANFILES+= bfdver.h config.h targmatch.h
-
-SELARCH=
-.if ${TARGET_ARCH} == "amd64"
-SELARCH= &bfd_i386_arch
-.elif ${TARGET_ARCH} == "sparc64"
-SELARCH= &bfd_sparc_arch
-.else
-.for _a in ${ARCHS}
-.if ${SELARCH} == ""
-SELARCH+= &bfd_${_a}_arch
-.else
-SELARCH+= ,&bfd_${_a}_arch
-.endif
-.endfor
-.endif
-CFLAGS+= -DSELECT_ARCHITECTURES="${SELARCH}"
-
-SELVEC=
-.for _v in ${VECS}
-CFLAGS+= -DHAVE_${_v}
-.if ${SELVEC} == ""
-SELVEC+= &${_v}
-.else
-SELVEC+= ,&${_v}
-.endif
-.endfor
-CFLAGS+= -DSELECT_VECS="${SELVEC}"
-CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR}
-CFLAGS+= -DDEBUGDIR="NULL"
-
-# XXX:DEO should grab BFD_VERSION_DATE from ${VERSION}...
-bfdver.h: Makefile
- echo '#define BFD_VERSION 217500000' > ${.TARGET}
- echo '#define BFD_VERSION_DATE 20070703' >> ${.TARGET}
- echo '#define BFD_VERSION_STRING ${VERSION}' >> ${.TARGET}
- echo '#define REPORT_BUGS_TO "<http://www.freebsd.org/support.html>"' >> ${.TARGET}
-
-targmatch.h: targmatch.sed config.bfd
- sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} > ${.TARGET}
-
-config.h: config.h.fbsd
-.if ${TARGET_ARCH} == "i386"
- sed -e 's,!!TRAD_HEADER!!,"hosts/i386bsd.h",g' ${.ALLSRC} > ${.TARGET}
-.else
- sed -e 's,!!TRAD_HEADER!!,,g' ${.ALLSRC} > ${.TARGET}
-.endif
-
-CLEANFILES+= elf32-target.h elf64-target.h
-elf32-target.h: elfxx-target.h
- sed -e s/NN/32/g ${.ALLSRC} > ${.TARGET}
-
-elf64-target.h: elfxx-target.h
- sed -e s/NN/64/g ${.ALLSRC} > ${.TARGET}
-
-# avoid cicular dependency
-GENDIRDEPS_FILTER+= N*/nm
-
-.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.amd64 b/gnu/usr.bin/binutils/libbfd/Makefile.amd64
deleted file mode 100644
index 31ad0d9302be..000000000000
--- a/gnu/usr.bin/binutils/libbfd/Makefile.amd64
+++ /dev/null
@@ -1,29 +0,0 @@
-# $FreeBSD$
-
-.include "${.CURDIR}/Makefile.i386"
-
-# Get the i386 VECS.
-I386_VECS:= ${VECS}
-
-DEFAULT_VECTOR= bfd_elf64_x86_64_freebsd_vec
-
-SRCS+= elf64-x86-64.c \
- efi-app-x86_64.c \
- elf64.c \
- elf64-gen.c \
- elf64-target.h \
- pepigen.c \
- pex64igen.c
-
-VECS= ${DEFAULT_VECTOR} \
- bfd_elf64_x86_64_vec \
- bfd_efi_app_x86_64_vec \
- ${I386_VECS}
-
-CLEANFILES+= pepigen.c pex64igen.c
-
-pepigen.c: peXXigen.c
- sed -e s/XX/pep/g ${.ALLSRC} > ${.TARGET}
-
-pex64igen.c: peXXigen.c
- sed -e s/XX/pex64/g ${.ALLSRC} > ${.TARGET}
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.arm b/gnu/usr.bin/binutils/libbfd/Makefile.arm
deleted file mode 100644
index 9d0a12b26a45..000000000000
--- a/gnu/usr.bin/binutils/libbfd/Makefile.arm
+++ /dev/null
@@ -1,21 +0,0 @@
-# $FreeBSD$
-
-.if ${TARGET_ARCH:Marm*eb} != ""
-DEFAULT_VECTOR= bfd_elf32_bigarm_vec
-.else
-DEFAULT_VECTOR= bfd_elf32_littlearm_vec
-.endif
-
-SRCS+= cpu-arm.c \
- elf32.c \
- elf32-arm.c \
- elf32-gen.c \
- elf32-target.h \
- elflink.c
-
-VECS+= ${DEFAULT_VECTOR}
-.if ${TARGET_ARCH:Marm*eb} != ""
-VECS+= bfd_elf32_littlearm_vec
-.else
-VECS+= bfd_elf32_bigarm_vec
-.endif
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.depend b/gnu/usr.bin/binutils/libbfd/Makefile.depend
deleted file mode 100644
index 18be76b0cb6f..000000000000
--- a/gnu/usr.bin/binutils/libbfd/Makefile.depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- include \
- include/xlocale \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.depend.host b/gnu/usr.bin/binutils/libbfd/Makefile.depend.host
deleted file mode 100644
index f80275d86ab1..000000000000
--- a/gnu/usr.bin/binutils/libbfd/Makefile.depend.host
+++ /dev/null
@@ -1,11 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.i386 b/gnu/usr.bin/binutils/libbfd/Makefile.i386
deleted file mode 100644
index e41e30d4deab..000000000000
--- a/gnu/usr.bin/binutils/libbfd/Makefile.i386
+++ /dev/null
@@ -1,21 +0,0 @@
-# $FreeBSD$
-
-DEFAULT_VECTOR= bfd_elf32_i386_freebsd_vec
-
-SRCS+= cofflink.c \
- cpu-i386.c \
- efi-app-ia32.c \
- elf32-i386.c \
- elf32-target.h \
- elf32.c \
- elflink.c \
- peigen.c
-
-VECS= ${DEFAULT_VECTOR} \
- bfd_elf32_i386_vec \
- bfd_efi_app_ia32_vec
-
-peigen.c: peXXigen.c
- sed -e s/XX/pe/g ${.ALLSRC} > ${.TARGET}
-
-CLEANFILES+= peigen.c
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.mips b/gnu/usr.bin/binutils/libbfd/Makefile.mips
deleted file mode 100644
index 9a2781a410e2..000000000000
--- a/gnu/usr.bin/binutils/libbfd/Makefile.mips
+++ /dev/null
@@ -1,38 +0,0 @@
-# $FreeBSD$
-
-.if ${TARGET_ARCH:Mmips*el*} != ""
-_EMULATION_ENDIAN=little
-.else
-_EMULATION_ENDIAN=big
-.endif
-
-.if ${TARGET_ARCH:Mmips64*} != ""
-DEFAULT_VECTOR= bfd_elf64_trad${_EMULATION_ENDIAN}mips_vec
-.elif ${TARGET_ARCH:Mmipsn32*} != ""
-DEFAULT_VECTOR= bfd_elf32_ntrad${_EMULATION_ENDIAN}mips_vec
-.else
-DEFAULT_VECTOR=bfd_elf32_trad${_EMULATION_ENDIAN}mips_vec
-.endif
-
-SRCS+= coff-mips.c \
- cpu-mips.c \
- ecoff.c \
- ecofflink.c \
- elf32.c \
- elf64.c \
- elfn32-mips.c \
- elf32-mips.c \
- elf64-mips.c \
- elfxx-mips.c \
- elf32-target.h \
- elf64-target.h \
- elflink.c
-
-VECS= bfd_elf32_tradbigmips_vec \
- bfd_elf32_tradlittlemips_vec \
- bfd_elf32_ntradbigmips_vec \
- bfd_elf32_ntradlittlemips_vec \
- bfd_elf64_tradbigmips_vec \
- bfd_elf64_tradlittlemips_vec \
- ecoff_little_vec \
- ecoff_big_vec
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.powerpc b/gnu/usr.bin/binutils/libbfd/Makefile.powerpc
deleted file mode 100644
index aa3e4f477a0e..000000000000
--- a/gnu/usr.bin/binutils/libbfd/Makefile.powerpc
+++ /dev/null
@@ -1,19 +0,0 @@
-# $FreeBSD$
-
-ARCHS+= rs6000
-
-DEFAULT_VECTOR= bfd_elf32_powerpc_vec
-
-SRCS+= cpu-powerpc.c \
- cpu-rs6000.c \
- elf32.c \
- elf32-gen.c \
- elf32-ppc.c \
- elf32-target.h \
- elflink.c \
- ppcboot.c \
- xcofflink.c
-
-VECS+= ${DEFAULT_VECTOR} \
- bfd_elf32_powerpcle_vec \
- ppcboot_vec
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 b/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64
deleted file mode 100644
index a32e95dd3641..000000000000
--- a/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64
+++ /dev/null
@@ -1,28 +0,0 @@
-# $FreeBSD$
-
-ARCHS+= rs6000
-
-DEFAULT_VECTOR= bfd_elf64_powerpc_vec
-NO_WERROR.clang=
-
-SRCS+= cpu-powerpc.c \
- cpu-rs6000.c \
- elf32.c \
- elf32-gen.c \
- elf32-ppc.c \
- elf32-target.h \
- elflink.c \
- elf64.c \
- elf64-gen.c \
- elf64-ppc.c \
- elf64-target.h \
- elflink.c \
- ppcboot.c \
- xcofflink.c
-
-VECS+= ${DEFAULT_VECTOR} \
- bfd_elf64_powerpcle_vec \
- bfd_elf32_powerpc_vec \
- bfd_elf32_powerpcle_vec \
- ppcboot_vec
-
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.sparc64 b/gnu/usr.bin/binutils/libbfd/Makefile.sparc64
deleted file mode 100644
index f41c1eb1726a..000000000000
--- a/gnu/usr.bin/binutils/libbfd/Makefile.sparc64
+++ /dev/null
@@ -1,23 +0,0 @@
-# $FreeBSD$
-
-DEFAULT_VECTOR= bfd_elf64_sparc_freebsd_vec
-
-SRCS+= aout32.c \
- cpu-sparc.c \
- elf32.c \
- elf32-sparc.c \
- elf32-target.h \
- elf64.c \
- elf64-sparc.c \
- elf64-target.h \
- elflink.c \
- elfxx-sparc.c \
- elfxx-sparc.h \
- sparcnetbsd.c \
- sunos.c
-
-VECS= ${DEFAULT_VECTOR} \
- bfd_elf64_sparc_vec \
- bfd_elf32_sparc_vec \
- sparcnetbsd_vec \
- sunos_big_vec
diff --git a/gnu/usr.bin/binutils/libbfd/bfd.h b/gnu/usr.bin/binutils/libbfd/bfd.h
deleted file mode 100644
index c6fcc4780c44..000000000000
--- a/gnu/usr.bin/binutils/libbfd/bfd.h
+++ /dev/null
@@ -1,5410 +0,0 @@
-/* $FreeBSD$ */
-
-/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
- generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
- "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
- "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
- "linker.c" and "simple.c".
- Run "make headers" in your build bfd/ to regenerate. */
-
-/* Main header file for the bfd library -- portable access to object files.
-
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
-
- Contributed 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 2 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. */
-
-#ifndef __BFD_H_SEEN__
-#define __BFD_H_SEEN__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "ansidecl.h"
-#include "symcat.h"
-#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
-#ifndef SABER
-/* This hack is to avoid a problem with some strict ANSI C preprocessors.
- The problem is, "32_" is not a valid preprocessing token, and we don't
- want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
- cause the inner CONCAT2 macros to be evaluated first, producing
- still-valid pp-tokens. Then the final concatenation can be done. */
-#undef CONCAT4
-#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
-#endif
-#endif
-
-/* This is a utility macro to handle the situation where the code
- wants to place a constant string into the code, followed by a
- comma and then the length of the string. Doing this by hand
- is error prone, so using this macro is safer. The macro will
- also safely handle the case where a NULL is passed as the arg. */
-#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0)
-/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
- to create the arguments to another macro, since the preprocessor
- will mis-count the number of arguments to the outer macro (by not
- evaluating STRING_COMMA_LEN and so missing the comma). This is a
- problem for example when trying to use STRING_COMMA_LEN to build
- the arguments to the strncmp() macro. Hence this alternative
- definition of strncmp is provided here.
-
- Note - these macros do NOT work if STR2 is not a constant string. */
-#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
- /* strcpy() can have a similar problem, but since we know we are
- copying a constant string, we can use memcpy which will be faster
- since there is no need to check for a NUL byte inside STR. We
- can also save time if we do not need to copy the terminating NUL. */
-#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
-#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
-
-
-/* The word size used by BFD on the host. This may be 64 with a 32
- bit target if the host is 64 bit, or if other 64 bit targets have
- been selected with --enable-targets, or if --enable-64-bit-bfd. */
-#define BFD_ARCH_SIZE 64
-
-#if defined(__i386__) || defined(__powerpc__) || defined(__arm__) || defined(__mips__)
-#define BFD_HOST_64BIT_LONG 0
-#define BFD_HOST_64_BIT long long
-#define BFD_HOST_U_64_BIT unsigned long long
-#elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) || defined(__aarch64__)
-#define BFD_HOST_64BIT_LONG 1
-#define BFD_HOST_64_BIT long
-#define BFD_HOST_U_64_BIT unsigned long
-#else
-#error Unsupported architecture/platform.
-#endif /* 64-bit host */
-
-#define BFD_HOST_LONG_LONG 1
-typedef BFD_HOST_64_BIT bfd_int64_t;
-typedef BFD_HOST_U_64_BIT bfd_uint64_t;
-
-#if BFD_ARCH_SIZE >= 64
-#define BFD64
-#endif
-
-#ifndef INLINE
-#if __GNUC__ >= 2
-#define INLINE __inline__
-#else
-#define INLINE
-#endif
-#endif
-
-/* Forward declaration. */
-typedef struct bfd bfd;
-
-/* Boolean type used in bfd. Too many systems define their own
- versions of "boolean" for us to safely typedef a "boolean" of
- our own. Using an enum for "bfd_boolean" has its own set of
- problems, with strange looking casts required to avoid warnings
- on some older compilers. Thus we just use an int.
-
- General rule: Functions which are bfd_boolean return TRUE on
- success and FALSE on failure (unless they're a predicate). */
-
-typedef int bfd_boolean;
-#undef FALSE
-#undef TRUE
-#define FALSE 0
-#define TRUE 1
-
-#ifdef BFD64
-
-#ifndef BFD_HOST_64_BIT
- #error No 64 bit integer type available
-#endif /* ! defined (BFD_HOST_64_BIT) */
-
-typedef BFD_HOST_U_64_BIT bfd_vma;
-typedef BFD_HOST_64_BIT bfd_signed_vma;
-typedef BFD_HOST_U_64_BIT bfd_size_type;
-typedef BFD_HOST_U_64_BIT symvalue;
-
-#ifndef fprintf_vma
-#if BFD_HOST_64BIT_LONG
-#define sprintf_vma(s,x) sprintf (s, "%016lx", x)
-#define fprintf_vma(f,x) fprintf (f, "%016lx", x)
-#else
-#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
-#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
-#define fprintf_vma(s,x) \
- fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
-#define sprintf_vma(s,x) \
- sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
-#endif
-#endif
-
-#else /* not BFD64 */
-
-/* Represent a target address. Also used as a generic unsigned type
- which is guaranteed to be big enough to hold any arithmetic types
- we need to deal with. */
-typedef unsigned long bfd_vma;
-
-/* A generic signed type which is guaranteed to be big enough to hold any
- arithmetic types we need to deal with. Can be assumed to be compatible
- with bfd_vma in the same way that signed and unsigned ints are compatible
- (as parameters, in assignment, etc). */
-typedef long bfd_signed_vma;
-
-typedef unsigned long symvalue;
-typedef unsigned long bfd_size_type;
-
-/* Print a bfd_vma x on stream s. */
-#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
-#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
-
-#endif /* not BFD64 */
-
-#define HALF_BFD_SIZE_TYPE \
- (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
-
-#ifndef BFD_HOST_64_BIT
-/* Fall back on a 32 bit type. The idea is to make these types always
- available for function return types, but in the case that
- BFD_HOST_64_BIT is undefined such a function should abort or
- otherwise signal an error. */
-typedef bfd_signed_vma bfd_int64_t;
-typedef bfd_vma bfd_uint64_t;
-#endif
-
-/* An offset into a file. BFD always uses the largest possible offset
- based on the build time availability of fseek, fseeko, or fseeko64. */
-typedef BFD_HOST_64_BIT file_ptr;
-typedef unsigned BFD_HOST_64_BIT ufile_ptr;
-
-extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
-extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
-
-#define printf_vma(x) fprintf_vma(stdout,x)
-#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
-
-typedef unsigned int flagword; /* 32 bits of flags */
-typedef unsigned char bfd_byte;
-
-/* File formats. */
-
-typedef enum bfd_format
-{
- bfd_unknown = 0, /* File format is unknown. */
- bfd_object, /* Linker/assembler/compiler output. */
- bfd_archive, /* Object archive file. */
- bfd_core, /* Core dump. */
- bfd_type_end /* Marks the end; don't use it! */
-}
-bfd_format;
-
-/* Values that may appear in the flags field of a BFD. These also
- appear in the object_flags field of the bfd_target structure, where
- they indicate the set of flags used by that backend (not all flags
- are meaningful for all object file formats) (FIXME: at the moment,
- the object_flags values have mostly just been copied from backend
- to another, and are not necessarily correct). */
-
-/* No flags. */
-#define BFD_NO_FLAGS 0x00
-
-/* BFD contains relocation entries. */
-#define HAS_RELOC 0x01
-
-/* BFD is directly executable. */
-#define EXEC_P 0x02
-
-/* BFD has line number information (basically used for F_LNNO in a
- COFF header). */
-#define HAS_LINENO 0x04
-
-/* BFD has debugging information. */
-#define HAS_DEBUG 0x08
-
-/* BFD has symbols. */
-#define HAS_SYMS 0x10
-
-/* BFD has local symbols (basically used for F_LSYMS in a COFF
- header). */
-#define HAS_LOCALS 0x20
-
-/* BFD is a dynamic object. */
-#define DYNAMIC 0x40
-
-/* Text section is write protected (if D_PAGED is not set, this is
- like an a.out NMAGIC file) (the linker sets this by default, but
- clears it for -r or -N). */
-#define WP_TEXT 0x80
-
-/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
- linker sets this by default, but clears it for -r or -n or -N). */
-#define D_PAGED 0x100
-
-/* BFD is relaxable (this means that bfd_relax_section may be able to
- do something) (sometimes bfd_relax_section can do something even if
- this is not set). */
-#define BFD_IS_RELAXABLE 0x200
-
-/* This may be set before writing out a BFD to request using a
- traditional format. For example, this is used to request that when
- writing out an a.out object the symbols not be hashed to eliminate
- duplicates. */
-#define BFD_TRADITIONAL_FORMAT 0x400
-
-/* This flag indicates that the BFD contents are actually cached in
- memory. If this is set, iostream points to a bfd_in_memory struct. */
-#define BFD_IN_MEMORY 0x800
-
-/* The sections in this BFD specify a memory page. */
-#define HAS_LOAD_PAGE 0x1000
-
-/* This BFD has been created by the linker and doesn't correspond
- to any input file. */
-#define BFD_LINKER_CREATED 0x2000
-
-/* Symbols and relocation. */
-
-/* A count of carsyms (canonical archive symbols). */
-typedef unsigned long symindex;
-
-/* How to perform a relocation. */
-typedef const struct reloc_howto_struct reloc_howto_type;
-
-#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
-
-/* General purpose part of a symbol X;
- target specific parts are in libcoff.h, libaout.h, etc. */
-
-#define bfd_get_section(x) ((x)->section)
-#define bfd_get_output_section(x) ((x)->section->output_section)
-#define bfd_set_section(x,y) ((x)->section) = (y)
-#define bfd_asymbol_base(x) ((x)->section->vma)
-#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
-#define bfd_asymbol_name(x) ((x)->name)
-/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
-#define bfd_asymbol_bfd(x) ((x)->the_bfd)
-#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
-
-/* A canonical archive symbol. */
-/* This is a type pun with struct ranlib on purpose! */
-typedef struct carsym
-{
- char *name;
- file_ptr file_offset; /* Look here to find the file. */
-}
-carsym; /* To make these you call a carsymogen. */
-
-/* Used in generating armaps (archive tables of contents).
- Perhaps just a forward definition would do? */
-struct orl /* Output ranlib. */
-{
- char **name; /* Symbol name. */
- union
- {
- file_ptr pos;
- bfd *abfd;
- } u; /* bfd* or file position. */
- int namidx; /* Index into string table. */
-};
-
-/* Linenumber stuff. */
-typedef struct lineno_cache_entry
-{
- unsigned int line_number; /* Linenumber from start of function. */
- union
- {
- struct bfd_symbol *sym; /* Function name. */
- bfd_vma offset; /* Offset into section. */
- } u;
-}
-alent;
-
-/* Object and core file sections. */
-
-#define align_power(addr, align) \
- (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
-
-typedef struct bfd_section *sec_ptr;
-
-#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
-#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
-#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
-#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
-#define bfd_section_name(bfd, ptr) ((ptr)->name)
-#define bfd_section_size(bfd, ptr) ((ptr)->size)
-#define bfd_get_section_size(ptr) ((ptr)->size)
-#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
-#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
-#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
-#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
-#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
-
-#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
-
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
-/* Find the address one past the end of SEC. */
-#define bfd_get_section_limit(bfd, sec) \
- (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
- / bfd_octets_per_byte (bfd))
-
-/* Return TRUE if section has been discarded. */
-#define elf_discarded_section(sec) \
- (!bfd_is_abs_section (sec) \
- && bfd_is_abs_section ((sec)->output_section) \
- && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \
- && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
-
-/* Forward define. */
-struct stat;
-
-typedef enum bfd_print_symbol
-{
- bfd_print_symbol_name,
- bfd_print_symbol_more,
- bfd_print_symbol_all
-} bfd_print_symbol_type;
-
-/* Information about a symbol that nm needs. */
-
-typedef struct _symbol_info
-{
- symvalue value;
- char type;
- const char *name; /* Symbol name. */
- unsigned char stab_type; /* Stab type. */
- char stab_other; /* Stab other. */
- short stab_desc; /* Stab desc. */
- const char *stab_name; /* String for stab type. */
-} symbol_info;
-
-/* Get the name of a stabs type code. */
-
-extern const char *bfd_get_stab_name (int);
-
-/* Hash table routines. There is no way to free up a hash table. */
-
-/* An element in the hash table. Most uses will actually use a larger
- structure, and an instance of this will be the first field. */
-
-struct bfd_hash_entry
-{
- /* Next entry for this hash code. */
- struct bfd_hash_entry *next;
- /* String being hashed. */
- const char *string;
- /* Hash code. This is the full hash code, not the index into the
- table. */
- unsigned long hash;
-};
-
-/* A hash table. */
-
-struct bfd_hash_table
-{
- /* The hash array. */
- struct bfd_hash_entry **table;
- /* A function used to create new elements in the hash table. The
- first entry is itself a pointer to an element. When this
- function is first invoked, this pointer will be NULL. However,
- having the pointer permits a hierarchy of method functions to be
- built each of which calls the function in the superclass. Thus
- each function should be written to allocate a new block of memory
- only if the argument is NULL. */
- struct bfd_hash_entry *(*newfunc)
- (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
- /* An objalloc for this hash table. This is a struct objalloc *,
- but we use void * to avoid requiring the inclusion of objalloc.h. */
- void *memory;
- /* The number of slots in the hash table. */
- unsigned int size;
- /* The number of entries in the hash table. */
- unsigned int count;
- /* The size of elements. */
- unsigned int entsize;
- /* If non-zero, don't grow the hash table. */
- unsigned int frozen:1;
-};
-
-/* Initialize a hash table. */
-extern bfd_boolean bfd_hash_table_init
- (struct bfd_hash_table *,
- struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
- struct bfd_hash_table *,
- const char *),
- unsigned int);
-
-/* Initialize a hash table specifying a size. */
-extern bfd_boolean bfd_hash_table_init_n
- (struct bfd_hash_table *,
- struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
- struct bfd_hash_table *,
- const char *),
- unsigned int, unsigned int);
-
-/* Free up a hash table. */
-extern void bfd_hash_table_free
- (struct bfd_hash_table *);
-
-/* Look up a string in a hash table. If CREATE is TRUE, a new entry
- will be created for this string if one does not already exist. The
- COPY argument must be TRUE if this routine should copy the string
- into newly allocated memory when adding an entry. */
-extern struct bfd_hash_entry *bfd_hash_lookup
- (struct bfd_hash_table *, const char *, bfd_boolean create,
- bfd_boolean copy);
-
-/* Replace an entry in a hash table. */
-extern void bfd_hash_replace
- (struct bfd_hash_table *, struct bfd_hash_entry *old,
- struct bfd_hash_entry *nw);
-
-/* Base method for creating a hash table entry. */
-extern struct bfd_hash_entry *bfd_hash_newfunc
- (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
-
-/* Grab some space for a hash table entry. */
-extern void *bfd_hash_allocate
- (struct bfd_hash_table *, unsigned int);
-
-/* Traverse a hash table in a random order, calling a function on each
- element. If the function returns FALSE, the traversal stops. The
- INFO argument is passed to the function. */
-extern void bfd_hash_traverse
- (struct bfd_hash_table *,
- bfd_boolean (*) (struct bfd_hash_entry *, void *),
- void *info);
-
-/* Allows the default size of a hash table to be configured. New hash
- tables allocated using bfd_hash_table_init will be created with
- this size. */
-extern void bfd_hash_set_default_size (bfd_size_type);
-
-/* This structure is used to keep track of stabs in sections
- information while linking. */
-
-struct stab_info
-{
- /* A hash table used to hold stabs strings. */
- struct bfd_strtab_hash *strings;
- /* The header file hash table. */
- struct bfd_hash_table includes;
- /* The first .stabstr section. */
- struct bfd_section *stabstr;
-};
-
-#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
-
-/* User program access to BFD facilities. */
-
-/* Direct I/O routines, for programs which know more about the object
- file than BFD does. Use higher level routines if possible. */
-
-extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
-extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
-extern int bfd_seek (bfd *, file_ptr, int);
-extern file_ptr bfd_tell (bfd *);
-extern int bfd_flush (bfd *);
-extern int bfd_stat (bfd *, struct stat *);
-
-/* Deprecated old routines. */
-#if __GNUC__
-#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
- (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
- bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
- (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
- bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#else
-#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
- (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
- bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
- (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
- bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#endif
-extern void warn_deprecated (const char *, const char *, int, const char *);
-
-/* Cast from const char * to char * so that caller can assign to
- a char * without a warning. */
-#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
-#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
-#define bfd_get_format(abfd) ((abfd)->format)
-#define bfd_get_target(abfd) ((abfd)->xvec->name)
-#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
-#define bfd_family_coff(abfd) \
- (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
- bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
-#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
-#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
-#define bfd_header_big_endian(abfd) \
- ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
-#define bfd_header_little_endian(abfd) \
- ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
-#define bfd_get_file_flags(abfd) ((abfd)->flags)
-#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
-#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
-#define bfd_my_archive(abfd) ((abfd)->my_archive)
-#define bfd_has_map(abfd) ((abfd)->has_armap)
-
-#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
-#define bfd_usrdata(abfd) ((abfd)->usrdata)
-
-#define bfd_get_start_address(abfd) ((abfd)->start_address)
-#define bfd_get_symcount(abfd) ((abfd)->symcount)
-#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
-#define bfd_count_sections(abfd) ((abfd)->section_count)
-
-#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
-
-#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
-
-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
-
-extern bfd_boolean bfd_cache_close
- (bfd *abfd);
-/* NB: This declaration should match the autogenerated one in libbfd.h. */
-
-extern bfd_boolean bfd_cache_close_all (void);
-
-extern bfd_boolean bfd_record_phdr
- (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
- bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
-
-/* Byte swapping routines. */
-
-bfd_uint64_t bfd_getb64 (const void *);
-bfd_uint64_t bfd_getl64 (const void *);
-bfd_int64_t bfd_getb_signed_64 (const void *);
-bfd_int64_t bfd_getl_signed_64 (const void *);
-bfd_vma bfd_getb32 (const void *);
-bfd_vma bfd_getl32 (const void *);
-bfd_signed_vma bfd_getb_signed_32 (const void *);
-bfd_signed_vma bfd_getl_signed_32 (const void *);
-bfd_vma bfd_getb16 (const void *);
-bfd_vma bfd_getl16 (const void *);
-bfd_signed_vma bfd_getb_signed_16 (const void *);
-bfd_signed_vma bfd_getl_signed_16 (const void *);
-void bfd_putb64 (bfd_uint64_t, void *);
-void bfd_putl64 (bfd_uint64_t, void *);
-void bfd_putb32 (bfd_vma, void *);
-void bfd_putl32 (bfd_vma, void *);
-void bfd_putb16 (bfd_vma, void *);
-void bfd_putl16 (bfd_vma, void *);
-
-/* Byte swapping routines which take size and endiannes as arguments. */
-
-bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
-void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
-
-extern bfd_boolean bfd_section_already_linked_table_init (void);
-extern void bfd_section_already_linked_table_free (void);
-
-/* Externally visible ECOFF routines. */
-
-#if defined(__STDC__) || defined(ALMOST_STDC)
-struct ecoff_debug_info;
-struct ecoff_debug_swap;
-struct ecoff_extr;
-struct bfd_symbol;
-struct bfd_link_info;
-struct bfd_link_hash_entry;
-struct bfd_elf_version_tree;
-#endif
-extern bfd_vma bfd_ecoff_get_gp_value
- (bfd * abfd);
-extern bfd_boolean bfd_ecoff_set_gp_value
- (bfd *abfd, bfd_vma gp_value);
-extern bfd_boolean bfd_ecoff_set_regmasks
- (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
- unsigned long *cprmask);
-extern void *bfd_ecoff_debug_init
- (bfd *output_bfd, struct ecoff_debug_info *output_debug,
- const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
-extern void bfd_ecoff_debug_free
- (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
- const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
-extern bfd_boolean bfd_ecoff_debug_accumulate
- (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
- const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
- struct ecoff_debug_info *input_debug,
- const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
-extern bfd_boolean bfd_ecoff_debug_accumulate_other
- (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
- const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
- struct bfd_link_info *);
-extern bfd_boolean bfd_ecoff_debug_externals
- (bfd *abfd, struct ecoff_debug_info *debug,
- const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
- bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
- void (*set_index) (struct bfd_symbol *, bfd_size_type));
-extern bfd_boolean bfd_ecoff_debug_one_external
- (bfd *abfd, struct ecoff_debug_info *debug,
- const struct ecoff_debug_swap *swap, const char *name,
- struct ecoff_extr *esym);
-extern bfd_size_type bfd_ecoff_debug_size
- (bfd *abfd, struct ecoff_debug_info *debug,
- const struct ecoff_debug_swap *swap);
-extern bfd_boolean bfd_ecoff_write_debug
- (bfd *abfd, struct ecoff_debug_info *debug,
- const struct ecoff_debug_swap *swap, file_ptr where);
-extern bfd_boolean bfd_ecoff_write_accumulated_debug
- (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
- const struct ecoff_debug_swap *swap,
- struct bfd_link_info *info, file_ptr where);
-
-/* Externally visible ELF routines. */
-
-struct bfd_link_needed_list
-{
- struct bfd_link_needed_list *next;
- bfd *by;
- const char *name;
-};
-
-enum dynamic_lib_link_class {
- DYN_NORMAL = 0,
- DYN_AS_NEEDED = 1,
- DYN_DT_NEEDED = 2,
- DYN_NO_ADD_NEEDED = 4,
- DYN_NO_NEEDED = 8
-};
-
-enum notice_asneeded_action {
- notice_as_needed,
- notice_not_needed,
- notice_needed
-};
-
-extern bfd_boolean bfd_elf_record_link_assignment
- (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
- bfd_boolean);
-extern struct bfd_link_needed_list *bfd_elf_get_needed_list
- (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf_get_bfd_needed_list
- (bfd *, struct bfd_link_needed_list **);
-extern bfd_boolean bfd_elf_size_dynamic_sections
- (bfd *, const char *, const char *, const char *, const char * const *,
- struct bfd_link_info *, struct bfd_section **,
- struct bfd_elf_version_tree *);
-extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
- (bfd *, struct bfd_link_info *);
-extern void bfd_elf_set_dt_needed_name
- (bfd *, const char *);
-extern const char *bfd_elf_get_dt_soname
- (bfd *);
-extern void bfd_elf_set_dyn_lib_class
- (bfd *, enum dynamic_lib_link_class);
-extern int bfd_elf_get_dyn_lib_class
- (bfd *);
-extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
- (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf_discard_info
- (bfd *, struct bfd_link_info *);
-extern unsigned int _bfd_elf_default_action_discarded
- (struct bfd_section *);
-
-/* Return an upper bound on the number of bytes required to store a
- copy of ABFD's program header table entries. Return -1 if an error
- occurs; bfd_get_error will return an appropriate code. */
-extern long bfd_get_elf_phdr_upper_bound
- (bfd *abfd);
-
-/* Copy ABFD's program header table entries to *PHDRS. The entries
- will be stored as an array of Elf_Internal_Phdr structures, as
- defined in include/elf/internal.h. To find out how large the
- buffer needs to be, call bfd_get_elf_phdr_upper_bound.
-
- Return the number of program header table entries read, or -1 if an
- error occurs; bfd_get_error will return an appropriate code. */
-extern int bfd_get_elf_phdrs
- (bfd *abfd, void *phdrs);
-
-/* Create a new BFD as if by bfd_openr. Rather than opening a file,
- reconstruct an ELF file by reading the segments out of remote memory
- based on the ELF file header at EHDR_VMA and the ELF program headers it
- points to. If not null, *LOADBASEP is filled in with the difference
- between the VMAs from which the segments were read, and the VMAs the
- file headers (and hence BFD's idea of each section's VMA) put them at.
-
- The function TARGET_READ_MEMORY is called to copy LEN bytes from the
- remote memory at target address VMA into the local buffer at MYADDR; it
- should return zero on success or an `errno' code on failure. TEMPL must
- be a BFD for an ELF target with the word size and byte order found in
- the remote memory. */
-extern bfd *bfd_elf_bfd_from_remote_memory
- (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
-
-/* Return the arch_size field of an elf bfd, or -1 if not elf. */
-extern int bfd_get_arch_size
- (bfd *);
-
-/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */
-extern int bfd_get_sign_extend_vma
- (bfd *);
-
-extern struct bfd_section *_bfd_elf_tls_setup
- (bfd *, struct bfd_link_info *);
-
-extern void _bfd_fix_excluded_sec_syms
- (bfd *, struct bfd_link_info *);
-
-extern unsigned bfd_m68k_mach_to_features (int);
-
-extern int bfd_m68k_features_to_mach (unsigned);
-
-extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
- (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
- char **);
-
-extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
- (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
- char **);
-
-/* SunOS shared library support routines for the linker. */
-
-extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
- (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_sunos_record_link_assignment
- (bfd *, struct bfd_link_info *, const char *);
-extern bfd_boolean bfd_sunos_size_dynamic_sections
- (bfd *, struct bfd_link_info *, struct bfd_section **,
- struct bfd_section **, struct bfd_section **);
-
-/* Linux shared library support routines for the linker. */
-
-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 *);
-
-/* mmap hacks */
-
-struct _bfd_window_internal;
-typedef struct _bfd_window_internal bfd_window_internal;
-
-typedef struct _bfd_window
-{
- /* What the user asked for. */
- void *data;
- bfd_size_type size;
- /* The actual window used by BFD. Small user-requested read-only
- regions sharing a page may share a single window into the object
- file. Read-write versions shouldn't until I've fixed things to
- keep track of which portions have been claimed by the
- application; don't want to give the same region back when the
- application wants two writable copies! */
- struct _bfd_window_internal *i;
-}
-bfd_window;
-
-extern void bfd_init_window
- (bfd_window *);
-extern void bfd_free_window
- (bfd_window *);
-extern bfd_boolean bfd_get_file_window
- (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
-
-/* XCOFF support routines for the linker. */
-
-extern bfd_boolean bfd_xcoff_link_record_set
- (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
-extern bfd_boolean bfd_xcoff_import_symbol
- (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
- const char *, const char *, const char *, unsigned int);
-extern bfd_boolean bfd_xcoff_export_symbol
- (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
-extern bfd_boolean bfd_xcoff_link_count_reloc
- (bfd *, struct bfd_link_info *, const char *);
-extern bfd_boolean bfd_xcoff_record_link_assignment
- (bfd *, struct bfd_link_info *, const char *);
-extern bfd_boolean bfd_xcoff_size_dynamic_sections
- (bfd *, struct bfd_link_info *, const char *, const char *,
- unsigned long, unsigned long, unsigned long, bfd_boolean,
- int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean);
-extern bfd_boolean bfd_xcoff_link_generate_rtinit
- (bfd *, const char *, const char *, bfd_boolean);
-
-/* XCOFF support routines for ar. */
-extern bfd_boolean bfd_xcoff_ar_archive_set_magic
- (bfd *, char *);
-
-/* Externally visible COFF routines. */
-
-#if defined(__STDC__) || defined(ALMOST_STDC)
-struct internal_syment;
-union internal_auxent;
-#endif
-
-extern bfd_boolean bfd_coff_get_syment
- (bfd *, struct bfd_symbol *, struct internal_syment *);
-
-extern bfd_boolean bfd_coff_get_auxent
- (bfd *, struct bfd_symbol *, int, 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
-{
- BFD_ARM_VFP11_FIX_DEFAULT,
- BFD_ARM_VFP11_FIX_NONE,
- BFD_ARM_VFP11_FIX_SCALAR,
- BFD_ARM_VFP11_FIX_VECTOR
-} bfd_arm_vfp11_fix;
-
-extern void bfd_elf32_arm_init_maps
- (bfd *);
-
-extern void bfd_elf32_arm_set_vfp11_fix
- (bfd *, struct bfd_link_info *);
-
-extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
- (bfd *, struct bfd_link_info *);
-
-extern void bfd_elf32_arm_vfp11_fix_veneer_locations
- (bfd *, struct bfd_link_info *);
-
-/* ARM Interworking support. Called from linker. */
-extern bfd_boolean bfd_arm_allocate_interworking_sections
- (struct bfd_link_info *);
-
-extern bfd_boolean bfd_arm_process_before_allocation
- (bfd *, struct bfd_link_info *, int);
-
-extern bfd_boolean bfd_arm_get_bfd_for_interworking
- (bfd *, struct bfd_link_info *);
-
-/* PE ARM Interworking support. Called from linker. */
-extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
- (struct bfd_link_info *);
-
-extern bfd_boolean bfd_arm_pe_process_before_allocation
- (bfd *, struct bfd_link_info *, int);
-
-extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
- (bfd *, struct bfd_link_info *);
-
-/* ELF ARM Interworking support. Called from linker. */
-extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
- (struct bfd_link_info *);
-
-extern bfd_boolean bfd_elf32_arm_process_before_allocation
- (bfd *, struct bfd_link_info *);
-
-void bfd_elf32_arm_set_target_relocs
- (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
- int, int);
-
-extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
- (bfd *, struct bfd_link_info *);
-
-extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
- (bfd *, struct bfd_link_info *);
-
-/* ELF ARM mapping symbol support */
-#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
-#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
-#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
-#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
-extern bfd_boolean bfd_is_arm_special_symbol_name
- (const char * name, int type);
-
-extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int);
-
-/* ARM Note section processing. */
-extern bfd_boolean bfd_arm_merge_machines
- (bfd *, bfd *);
-
-extern bfd_boolean bfd_arm_update_notes
- (bfd *, const char *);
-
-extern unsigned int bfd_arm_get_mach_from_notes
- (bfd *, const char *);
-
-/* TI COFF load page support. */
-extern void bfd_ticoff_set_section_load_page
- (struct bfd_section *, int);
-
-extern int bfd_ticoff_get_section_load_page
- (struct bfd_section *);
-
-/* H8/300 functions. */
-extern bfd_vma bfd_h8300_pad_address
- (bfd *, bfd_vma);
-
-/* IA64 Itanium code generation. Called from linker. */
-extern void bfd_elf32_ia64_after_parse
- (int);
-
-extern void bfd_elf64_ia64_after_parse
- (int);
-
-/* This structure is used for a comdat section, as in PE. A comdat
- section is associated with a particular symbol. When the linker
- sees a comdat section, it keeps only one of the sections with a
- given name and associated with a given symbol. */
-
-struct coff_comdat_info
-{
- /* The name of the symbol associated with a comdat section. */
- const char *name;
-
- /* The local symbol table index of the symbol associated with a
- comdat section. This is only meaningful to the object file format
- specific code; it is not an index into the list returned by
- bfd_canonicalize_symtab. */
- long symbol;
-};
-
-extern struct coff_comdat_info *bfd_coff_get_comdat_section
- (bfd *, struct bfd_section *);
-
-/* Extracted from init.c. */
-void bfd_init (void);
-
-/* Extracted from opncls.c. */
-bfd *bfd_fopen (const char *filename, const char *target,
- const char *mode, int fd);
-
-bfd *bfd_openr (const char *filename, const char *target);
-
-bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
-
-bfd *bfd_openstreamr (const char *, const char *, void *);
-
-bfd *bfd_openr_iovec (const char *filename, const char *target,
- void *(*open) (struct bfd *nbfd,
- void *open_closure),
- void *open_closure,
- file_ptr (*pread) (struct bfd *nbfd,
- void *stream,
- void *buf,
- file_ptr nbytes,
- file_ptr offset),
- int (*close) (struct bfd *nbfd,
- void *stream),
- int (*stat) (struct bfd *abfd,
- void *stream,
- struct stat *sb));
-
-bfd *bfd_openw (const char *filename, const char *target);
-
-bfd_boolean bfd_close (bfd *abfd);
-
-bfd_boolean bfd_close_all_done (bfd *);
-
-bfd *bfd_create (const char *filename, bfd *templ);
-
-bfd_boolean bfd_make_writable (bfd *abfd);
-
-bfd_boolean bfd_make_readable (bfd *abfd);
-
-unsigned long bfd_calc_gnu_debuglink_crc32
- (unsigned long crc, const unsigned char *buf, bfd_size_type len);
-
-char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
-
-struct bfd_section *bfd_create_gnu_debuglink_section
- (bfd *abfd, const char *filename);
-
-bfd_boolean bfd_fill_in_gnu_debuglink_section
- (bfd *abfd, struct bfd_section *sect, const char *filename);
-
-/* Extracted from libbfd.c. */
-
-/* Byte swapping macros for user section data. */
-
-#define bfd_put_8(abfd, val, ptr) \
- ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
-#define bfd_put_signed_8 \
- bfd_put_8
-#define bfd_get_8(abfd, ptr) \
- (*(unsigned char *) (ptr) & 0xff)
-#define bfd_get_signed_8(abfd, ptr) \
- (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
-
-#define bfd_put_16(abfd, val, ptr) \
- BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
-#define bfd_put_signed_16 \
- bfd_put_16
-#define bfd_get_16(abfd, ptr) \
- BFD_SEND (abfd, bfd_getx16, (ptr))
-#define bfd_get_signed_16(abfd, ptr) \
- BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
-
-#define bfd_put_32(abfd, val, ptr) \
- BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
-#define bfd_put_signed_32 \
- bfd_put_32
-#define bfd_get_32(abfd, ptr) \
- BFD_SEND (abfd, bfd_getx32, (ptr))
-#define bfd_get_signed_32(abfd, ptr) \
- BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
-
-#define bfd_put_64(abfd, val, ptr) \
- BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
-#define bfd_put_signed_64 \
- bfd_put_64
-#define bfd_get_64(abfd, ptr) \
- BFD_SEND (abfd, bfd_getx64, (ptr))
-#define bfd_get_signed_64(abfd, ptr) \
- BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
-
-#define bfd_get(bits, abfd, ptr) \
- ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
- : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
- : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
- : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
- : (abort (), (bfd_vma) - 1))
-
-#define bfd_put(bits, abfd, val, ptr) \
- ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
- : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
- : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
- : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
- : (abort (), (void) 0))
-
-
-/* Byte swapping macros for file header data. */
-
-#define bfd_h_put_8(abfd, val, ptr) \
- bfd_put_8 (abfd, val, ptr)
-#define bfd_h_put_signed_8(abfd, val, ptr) \
- bfd_put_8 (abfd, val, ptr)
-#define bfd_h_get_8(abfd, ptr) \
- bfd_get_8 (abfd, ptr)
-#define bfd_h_get_signed_8(abfd, ptr) \
- bfd_get_signed_8 (abfd, ptr)
-
-#define bfd_h_put_16(abfd, val, ptr) \
- BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
-#define bfd_h_put_signed_16 \
- bfd_h_put_16
-#define bfd_h_get_16(abfd, ptr) \
- BFD_SEND (abfd, bfd_h_getx16, (ptr))
-#define bfd_h_get_signed_16(abfd, ptr) \
- BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
-
-#define bfd_h_put_32(abfd, val, ptr) \
- BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
-#define bfd_h_put_signed_32 \
- bfd_h_put_32
-#define bfd_h_get_32(abfd, ptr) \
- BFD_SEND (abfd, bfd_h_getx32, (ptr))
-#define bfd_h_get_signed_32(abfd, ptr) \
- BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
-
-#define bfd_h_put_64(abfd, val, ptr) \
- BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
-#define bfd_h_put_signed_64 \
- bfd_h_put_64
-#define bfd_h_get_64(abfd, ptr) \
- BFD_SEND (abfd, bfd_h_getx64, (ptr))
-#define bfd_h_get_signed_64(abfd, ptr) \
- BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
-
-/* Aliases for the above, which should eventually go away. */
-
-#define H_PUT_64 bfd_h_put_64
-#define H_PUT_32 bfd_h_put_32
-#define H_PUT_16 bfd_h_put_16
-#define H_PUT_8 bfd_h_put_8
-#define H_PUT_S64 bfd_h_put_signed_64
-#define H_PUT_S32 bfd_h_put_signed_32
-#define H_PUT_S16 bfd_h_put_signed_16
-#define H_PUT_S8 bfd_h_put_signed_8
-#define H_GET_64 bfd_h_get_64
-#define H_GET_32 bfd_h_get_32
-#define H_GET_16 bfd_h_get_16
-#define H_GET_8 bfd_h_get_8
-#define H_GET_S64 bfd_h_get_signed_64
-#define H_GET_S32 bfd_h_get_signed_32
-#define H_GET_S16 bfd_h_get_signed_16
-#define H_GET_S8 bfd_h_get_signed_8
-
-
-/* Extracted from bfdio.c. */
-long bfd_get_mtime (bfd *abfd);
-
-file_ptr bfd_get_size (bfd *abfd);
-
-/* Extracted from bfdwin.c. */
-/* Extracted from section.c. */
-typedef struct bfd_section
-{
- /* The name of the section; the name isn't a copy, the pointer is
- the same as that passed to bfd_make_section. */
- const char *name;
-
- /* A unique sequence number. */
- int id;
-
- /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
- int index;
-
- /* The next section in the list belonging to the BFD, or NULL. */
- struct bfd_section *next;
-
- /* The previous section in the list belonging to the BFD, or NULL. */
- struct bfd_section *prev;
-
- /* The field flags contains attributes of the section. Some
- flags are read in from the object file, and some are
- synthesized from other information. */
- flagword flags;
-
-#define SEC_NO_FLAGS 0x000
-
- /* Tells the OS to allocate space for this section when loading.
- This is clear for a section containing debug information only. */
-#define SEC_ALLOC 0x001
-
- /* Tells the OS to load the section from the file when loading.
- This is clear for a .bss section. */
-#define SEC_LOAD 0x002
-
- /* The section contains data still to be relocated, so there is
- some relocation information too. */
-#define SEC_RELOC 0x004
-
- /* A signal to the OS that the section contains read only data. */
-#define SEC_READONLY 0x008
-
- /* The section contains code only. */
-#define SEC_CODE 0x010
-
- /* The section contains data only. */
-#define SEC_DATA 0x020
-
- /* The section will reside in ROM. */
-#define SEC_ROM 0x040
-
- /* The section contains constructor information. This section
- type is used by the linker to create lists of constructors and
- destructors used by <<g++>>. When a back end sees a symbol
- which should be used in a constructor list, it creates a new
- section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
- the symbol to it, and builds a relocation. To build the lists
- of constructors, all the linker has to do is catenate all the
- sections called <<__CTOR_LIST__>> and relocate the data
- contained within - exactly the operations it would peform on
- standard data. */
-#define SEC_CONSTRUCTOR 0x080
-
- /* The section has contents - a data section could be
- <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
- <<SEC_HAS_CONTENTS>> */
-#define SEC_HAS_CONTENTS 0x100
-
- /* An instruction to the linker to not output the section
- even if it has information which would normally be written. */
-#define SEC_NEVER_LOAD 0x200
-
- /* The section contains thread local data. */
-#define SEC_THREAD_LOCAL 0x400
-
- /* The section has GOT references. This flag is only for the
- linker, and is currently only used by the elf32-hppa back end.
- It will be set if global offset table references were detected
- in this section, which indicate to the linker that the section
- contains PIC code, and must be handled specially when doing a
- static link. */
-#define SEC_HAS_GOT_REF 0x800
-
- /* The section contains common symbols (symbols may be defined
- multiple times, the value of a symbol is the amount of
- space it requires, and the largest symbol value is the one
- used). Most targets have exactly one of these (which we
- translate to bfd_com_section_ptr), but ECOFF has two. */
-#define SEC_IS_COMMON 0x1000
-
- /* The section contains only debugging information. For
- example, this is set for ELF .debug and .stab sections.
- strip tests this flag to see if a section can be
- discarded. */
-#define SEC_DEBUGGING 0x2000
-
- /* The contents of this section are held in memory pointed to
- by the contents field. This is checked by bfd_get_section_contents,
- and the data is retrieved from memory if appropriate. */
-#define SEC_IN_MEMORY 0x4000
-
- /* The contents of this section are to be excluded by the
- linker for executable and shared objects unless those
- objects are to be further relocated. */
-#define SEC_EXCLUDE 0x8000
-
- /* The contents of this section are to be sorted based on the sum of
- the symbol and addend values specified by the associated relocation
- entries. Entries without associated relocation entries will be
- appended to the end of the section in an unspecified order. */
-#define SEC_SORT_ENTRIES 0x10000
-
- /* When linking, duplicate sections of the same name should be
- discarded, rather than being combined into a single section as
- is usually done. This is similar to how common symbols are
- handled. See SEC_LINK_DUPLICATES below. */
-#define SEC_LINK_ONCE 0x20000
-
- /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
- should handle duplicate sections. */
-#define SEC_LINK_DUPLICATES 0x40000
-
- /* This value for SEC_LINK_DUPLICATES means that duplicate
- sections with the same name should simply be discarded. */
-#define SEC_LINK_DUPLICATES_DISCARD 0x0
-
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if there are any duplicate sections, although
- it should still only link one copy. */
-#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000
-
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if any duplicate sections are a different size. */
-#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000
-
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if any duplicate sections contain different
- contents. */
-#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
- (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
-
- /* This section was created by the linker as part of dynamic
- relocation or other arcane processing. It is skipped when
- going through the first-pass output, trusting that someone
- else up the line will take care of it later. */
-#define SEC_LINKER_CREATED 0x200000
-
- /* This section should not be subject to garbage collection.
- Also set to inform the linker that this section should not be
- listed in the link map as discarded. */
-#define SEC_KEEP 0x400000
-
- /* This section contains "short" data, and should be placed
- "near" the GP. */
-#define SEC_SMALL_DATA 0x800000
-
- /* Attempt to merge identical entities in the section.
- Entity size is given in the entsize field. */
-#define SEC_MERGE 0x1000000
-
- /* If given with SEC_MERGE, entities to merge are zero terminated
- strings where entsize specifies character size instead of fixed
- size entries. */
-#define SEC_STRINGS 0x2000000
-
- /* This section contains data about section groups. */
-#define SEC_GROUP 0x4000000
-
- /* The section is a COFF shared library section. This flag is
- only for the linker. If this type of section appears in
- the input file, the linker must copy it to the output file
- without changing the vma or size. FIXME: Although this
- was originally intended to be general, it really is COFF
- specific (and the flag was renamed to indicate this). It
- might be cleaner to have some more general mechanism to
- allow the back end to control what the linker does with
- sections. */
-#define SEC_COFF_SHARED_LIBRARY 0x10000000
-
- /* This section contains data which may be shared with other
- executables or shared objects. This is for COFF only. */
-#define SEC_COFF_SHARED 0x20000000
-
- /* When a section with this flag is being linked, then if the size of
- the input section is less than a page, it should not cross a page
- boundary. If the size of the input section is one page or more,
- it should be aligned on a page boundary. This is for TI
- TMS320C54X only. */
-#define SEC_TIC54X_BLOCK 0x40000000
-
- /* Conditionally link this section; do not link if there are no
- references found to any symbol in the section. This is for TI
- TMS320C54X only. */
-#define SEC_TIC54X_CLINK 0x80000000
-
- /* End of section flags. */
-
- /* Some internal packed boolean fields. */
-
- /* See the vma field. */
- unsigned int user_set_vma : 1;
-
- /* A mark flag used by some of the linker backends. */
- unsigned int linker_mark : 1;
-
- /* Another mark flag used by some of the linker backends. Set for
- output sections that have an input section. */
- unsigned int linker_has_input : 1;
-
- /* Mark flags used by some linker backends for garbage collection. */
- unsigned int gc_mark : 1;
- unsigned int gc_mark_from_eh : 1;
-
- /* The following flags are used by the ELF linker. */
-
- /* Mark sections which have been allocated to segments. */
- unsigned int segment_mark : 1;
-
- /* Type of sec_info information. */
- unsigned int sec_info_type:3;
-#define ELF_INFO_TYPE_NONE 0
-#define ELF_INFO_TYPE_STABS 1
-#define ELF_INFO_TYPE_MERGE 2
-#define ELF_INFO_TYPE_EH_FRAME 3
-#define ELF_INFO_TYPE_JUST_SYMS 4
-
- /* Nonzero if this section uses RELA relocations, rather than REL. */
- unsigned int use_rela_p:1;
-
- /* Bits used by various backends. The generic code doesn't touch
- these fields. */
-
- /* Nonzero if this section has TLS related relocations. */
- unsigned int has_tls_reloc:1;
-
- /* Nonzero if this section has a call to __tls_get_addr. */
- unsigned int has_tls_get_addr_call:1;
-
- /* Nonzero if this section has a gp reloc. */
- unsigned int has_gp_reloc:1;
-
- /* Nonzero if this section needs the relax finalize pass. */
- unsigned int need_finalize_relax:1;
-
- /* Whether relocations have been processed. */
- unsigned int reloc_done : 1;
-
- /* End of internal packed boolean fields. */
-
- /* The virtual memory address of the section - where it will be
- at run time. The symbols are relocated against this. The
- user_set_vma flag is maintained by bfd; if it's not set, the
- backend can assign addresses (for example, in <<a.out>>, where
- the default address for <<.data>> is dependent on the specific
- target and various flags). */
- bfd_vma vma;
-
- /* The load address of the section - where it would be in a
- rom image; really only used for writing section header
- information. */
- bfd_vma lma;
-
- /* The size of the section in octets, as it will be output.
- Contains a value even if the section has no contents (e.g., the
- size of <<.bss>>). */
- bfd_size_type size;
-
- /* For input sections, the original size on disk of the section, in
- octets. This field is used by the linker relaxation code. It is
- currently only set for sections where the linker relaxation scheme
- doesn't cache altered section and reloc contents (stabs, eh_frame,
- SEC_MERGE, some coff relaxing targets), and thus the original size
- needs to be kept to read the section multiple times.
- For output sections, rawsize holds the section size calculated on
- a previous linker relaxation pass. */
- bfd_size_type rawsize;
-
- /* If this section is going to be output, then this value is the
- offset in *bytes* into the output section of the first byte in the
- input section (byte ==> smallest addressable unit on the
- target). In most cases, if this was going to start at the
- 100th octet (8-bit quantity) in the output section, this value
- would be 100. However, if the target byte size is 16 bits
- (bfd_octets_per_byte is "2"), this value would be 50. */
- bfd_vma output_offset;
-
- /* The output section through which to map on output. */
- struct bfd_section *output_section;
-
- /* The alignment requirement of the section, as an exponent of 2 -
- e.g., 3 aligns to 2^3 (or 8). */
- unsigned int alignment_power;
-
- /* If an input section, a pointer to a vector of relocation
- records for the data in this section. */
- struct reloc_cache_entry *relocation;
-
- /* If an output section, a pointer to a vector of pointers to
- relocation records for the data in this section. */
- struct reloc_cache_entry **orelocation;
-
- /* The number of relocation records in one of the above. */
- unsigned reloc_count;
-
- /* Information below is back end specific - and not always used
- or updated. */
-
- /* File position of section data. */
- file_ptr filepos;
-
- /* File position of relocation info. */
- file_ptr rel_filepos;
-
- /* File position of line data. */
- file_ptr line_filepos;
-
- /* Pointer to data for applications. */
- void *userdata;
-
- /* If the SEC_IN_MEMORY flag is set, this points to the actual
- contents. */
- unsigned char *contents;
-
- /* Attached line number information. */
- alent *lineno;
-
- /* Number of line number records. */
- unsigned int lineno_count;
-
- /* Entity size for merging purposes. */
- unsigned int entsize;
-
- /* Points to the kept section if this section is a link-once section,
- and is discarded. */
- struct bfd_section *kept_section;
-
- /* When a section is being output, this value changes as more
- linenumbers are written out. */
- file_ptr moving_line_filepos;
-
- /* What the section number is in the target world. */
- int target_index;
-
- void *used_by_bfd;
-
- /* If this is a constructor section then here is a list of the
- relocations created to relocate items within it. */
- struct relent_chain *constructor_chain;
-
- /* The BFD which owns the section. */
- bfd *owner;
-
- /* A symbol which points at this section only. */
- struct bfd_symbol *symbol;
- struct bfd_symbol **symbol_ptr_ptr;
-
- /* Early in the link process, map_head and map_tail are used to build
- a list of input sections attached to an output section. Later,
- output sections use these fields for a list of bfd_link_order
- structs. */
- union {
- struct bfd_link_order *link_order;
- struct bfd_section *s;
- } map_head, map_tail;
-} asection;
-
-/* These sections are global, and are managed by BFD. The application
- and target back end are not permitted to change the values in
- these sections. New code should use the section_ptr macros rather
- than referring directly to the const sections. The const sections
- may eventually vanish. */
-#define BFD_ABS_SECTION_NAME "*ABS*"
-#define BFD_UND_SECTION_NAME "*UND*"
-#define BFD_COM_SECTION_NAME "*COM*"
-#define BFD_IND_SECTION_NAME "*IND*"
-
-/* The absolute section. */
-extern asection bfd_abs_section;
-#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
-#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
-/* Pointer to the undefined section. */
-extern asection bfd_und_section;
-#define bfd_und_section_ptr ((asection *) &bfd_und_section)
-#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
-/* Pointer to the common section. */
-extern asection bfd_com_section;
-#define bfd_com_section_ptr ((asection *) &bfd_com_section)
-/* Pointer to the indirect section. */
-extern asection bfd_ind_section;
-#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
-#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
-
-#define bfd_is_const_section(SEC) \
- ( ((SEC) == bfd_abs_section_ptr) \
- || ((SEC) == bfd_und_section_ptr) \
- || ((SEC) == bfd_com_section_ptr) \
- || ((SEC) == bfd_ind_section_ptr))
-
-/* Macros to handle insertion and deletion of a bfd's sections. These
- only handle the list pointers, ie. do not adjust section_count,
- target_index etc. */
-#define bfd_section_list_remove(ABFD, S) \
- do \
- { \
- asection *_s = S; \
- asection *_next = _s->next; \
- asection *_prev = _s->prev; \
- if (_prev) \
- _prev->next = _next; \
- else \
- (ABFD)->sections = _next; \
- if (_next) \
- _next->prev = _prev; \
- else \
- (ABFD)->section_last = _prev; \
- } \
- while (0)
-#define bfd_section_list_append(ABFD, S) \
- do \
- { \
- asection *_s = S; \
- bfd *_abfd = ABFD; \
- _s->next = NULL; \
- if (_abfd->section_last) \
- { \
- _s->prev = _abfd->section_last; \
- _abfd->section_last->next = _s; \
- } \
- else \
- { \
- _s->prev = NULL; \
- _abfd->sections = _s; \
- } \
- _abfd->section_last = _s; \
- } \
- while (0)
-#define bfd_section_list_prepend(ABFD, S) \
- do \
- { \
- asection *_s = S; \
- bfd *_abfd = ABFD; \
- _s->prev = NULL; \
- if (_abfd->sections) \
- { \
- _s->next = _abfd->sections; \
- _abfd->sections->prev = _s; \
- } \
- else \
- { \
- _s->next = NULL; \
- _abfd->section_last = _s; \
- } \
- _abfd->sections = _s; \
- } \
- while (0)
-#define bfd_section_list_insert_after(ABFD, A, S) \
- do \
- { \
- asection *_a = A; \
- asection *_s = S; \
- asection *_next = _a->next; \
- _s->next = _next; \
- _s->prev = _a; \
- _a->next = _s; \
- if (_next) \
- _next->prev = _s; \
- else \
- (ABFD)->section_last = _s; \
- } \
- while (0)
-#define bfd_section_list_insert_before(ABFD, B, S) \
- do \
- { \
- asection *_b = B; \
- asection *_s = S; \
- asection *_prev = _b->prev; \
- _s->prev = _prev; \
- _s->next = _b; \
- _b->prev = _s; \
- if (_prev) \
- _prev->next = _s; \
- else \
- (ABFD)->sections = _s; \
- } \
- while (0)
-#define bfd_section_removed_from_list(ABFD, S) \
- ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
-
-#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \
- /* name, id, index, next, prev, flags, user_set_vma, */ \
- { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
- \
- /* linker_mark, linker_has_input, gc_mark, gc_mark_from_eh, */ \
- 0, 0, 1, 0, \
- \
- /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc, */ \
- 0, 0, 0, 0, \
- \
- /* has_tls_get_addr_call, has_gp_reloc, need_finalize_relax, */ \
- 0, 0, 0, \
- \
- /* reloc_done, vma, lma, size, rawsize */ \
- 0, 0, 0, 0, 0, \
- \
- /* output_offset, output_section, alignment_power, */ \
- 0, (struct bfd_section *) &SEC, 0, \
- \
- /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
- NULL, NULL, 0, 0, 0, \
- \
- /* line_filepos, userdata, contents, lineno, lineno_count, */ \
- 0, NULL, NULL, NULL, 0, \
- \
- /* entsize, kept_section, moving_line_filepos, */ \
- 0, NULL, 0, \
- \
- /* target_index, used_by_bfd, constructor_chain, owner, */ \
- 0, NULL, NULL, NULL, \
- \
- /* symbol, symbol_ptr_ptr, */ \
- (struct bfd_symbol *) SYM, &SEC.symbol, \
- \
- /* map_head, map_tail */ \
- { NULL }, { NULL } \
- }
-
-void bfd_section_list_clear (bfd *);
-
-asection *bfd_get_section_by_name (bfd *abfd, const char *name);
-
-asection *bfd_get_section_by_name_if
- (bfd *abfd,
- const char *name,
- bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
- void *obj);
-
-char *bfd_get_unique_section_name
- (bfd *abfd, const char *templat, int *count);
-
-asection *bfd_make_section_old_way (bfd *abfd, const char *name);
-
-asection *bfd_make_section_anyway_with_flags
- (bfd *abfd, const char *name, flagword flags);
-
-asection *bfd_make_section_anyway (bfd *abfd, const char *name);
-
-asection *bfd_make_section_with_flags
- (bfd *, const char *name, flagword flags);
-
-asection *bfd_make_section (bfd *, const char *name);
-
-bfd_boolean bfd_set_section_flags
- (bfd *abfd, asection *sec, flagword flags);
-
-void bfd_map_over_sections
- (bfd *abfd,
- void (*func) (bfd *abfd, asection *sect, void *obj),
- void *obj);
-
-asection *bfd_sections_find_if
- (bfd *abfd,
- bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
- void *obj);
-
-bfd_boolean bfd_set_section_size
- (bfd *abfd, asection *sec, bfd_size_type val);
-
-bfd_boolean bfd_set_section_contents
- (bfd *abfd, asection *section, const void *data,
- file_ptr offset, bfd_size_type count);
-
-bfd_boolean bfd_get_section_contents
- (bfd *abfd, asection *section, void *location, file_ptr offset,
- bfd_size_type count);
-
-bfd_boolean bfd_malloc_and_get_section
- (bfd *abfd, asection *section, bfd_byte **buf);
-
-bfd_boolean bfd_copy_private_section_data
- (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
-
-#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
- BFD_SEND (obfd, _bfd_copy_private_section_data, \
- (ibfd, isection, obfd, osection))
-bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
-
-bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
-
-/* Extracted from archures.c. */
-enum bfd_architecture
-{
- bfd_arch_unknown, /* File arch not known. */
- bfd_arch_obscure, /* Arch known, not one of these. */
- bfd_arch_m68k, /* Motorola 68xxx */
-#define bfd_mach_m68000 1
-#define bfd_mach_m68008 2
-#define bfd_mach_m68010 3
-#define bfd_mach_m68020 4
-#define bfd_mach_m68030 5
-#define bfd_mach_m68040 6
-#define bfd_mach_m68060 7
-#define bfd_mach_cpu32 8
-#define bfd_mach_fido 9
-#define bfd_mach_mcf_isa_a_nodiv 10
-#define bfd_mach_mcf_isa_a 11
-#define bfd_mach_mcf_isa_a_mac 12
-#define bfd_mach_mcf_isa_a_emac 13
-#define bfd_mach_mcf_isa_aplus 14
-#define bfd_mach_mcf_isa_aplus_mac 15
-#define bfd_mach_mcf_isa_aplus_emac 16
-#define bfd_mach_mcf_isa_b_nousp 17
-#define bfd_mach_mcf_isa_b_nousp_mac 18
-#define bfd_mach_mcf_isa_b_nousp_emac 19
-#define bfd_mach_mcf_isa_b 20
-#define bfd_mach_mcf_isa_b_mac 21
-#define bfd_mach_mcf_isa_b_emac 22
-#define bfd_mach_mcf_isa_b_float 23
-#define bfd_mach_mcf_isa_b_float_mac 24
-#define bfd_mach_mcf_isa_b_float_emac 25
-#define bfd_mach_mcf_isa_c 26
-#define bfd_mach_mcf_isa_c_mac 27
-#define bfd_mach_mcf_isa_c_emac 28
- bfd_arch_vax, /* DEC Vax */
- bfd_arch_i960, /* Intel 960 */
- /* The order of the following is important.
- lower number indicates a machine type that
- only accepts a subset of the instructions
- available to machines with higher numbers.
- The exception is the "ca", which is
- incompatible with all other machines except
- "core". */
-
-#define bfd_mach_i960_core 1
-#define bfd_mach_i960_ka_sa 2
-#define bfd_mach_i960_kb_sb 3
-#define bfd_mach_i960_mc 4
-#define bfd_mach_i960_xa 5
-#define bfd_mach_i960_ca 6
-#define bfd_mach_i960_jx 7
-#define bfd_mach_i960_hx 8
-
- bfd_arch_or32, /* OpenRISC 32 */
-
- bfd_arch_sparc, /* SPARC */
-#define bfd_mach_sparc 1
-/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
-#define bfd_mach_sparc_sparclet 2
-#define bfd_mach_sparc_sparclite 3
-#define bfd_mach_sparc_v8plus 4
-#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
-#define bfd_mach_sparc_sparclite_le 6
-#define bfd_mach_sparc_v9 7
-#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
-#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
-#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
-/* Nonzero if MACH has the v9 instruction set. */
-#define bfd_mach_sparc_v9_p(mach) \
- ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
- && (mach) != bfd_mach_sparc_sparclite_le)
-/* Nonzero if MACH is a 64 bit sparc architecture. */
-#define bfd_mach_sparc_64bit_p(mach) \
- ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
- bfd_arch_spu, /* PowerPC SPU */
-#define bfd_mach_spu 256
- bfd_arch_mips, /* MIPS Rxxxx */
-#define bfd_mach_mips3000 3000
-#define bfd_mach_mips3900 3900
-#define bfd_mach_mips4000 4000
-#define bfd_mach_mips4010 4010
-#define bfd_mach_mips4100 4100
-#define bfd_mach_mips4111 4111
-#define bfd_mach_mips4120 4120
-#define bfd_mach_mips4300 4300
-#define bfd_mach_mips4400 4400
-#define bfd_mach_mips4600 4600
-#define bfd_mach_mips4650 4650
-#define bfd_mach_mips5000 5000
-#define bfd_mach_mips5400 5400
-#define bfd_mach_mips5500 5500
-#define bfd_mach_mips6000 6000
-#define bfd_mach_mips7000 7000
-#define bfd_mach_mips8000 8000
-#define bfd_mach_mips9000 9000
-#define bfd_mach_mips10000 10000
-#define bfd_mach_mips12000 12000
-#define bfd_mach_mips16 16
-#define bfd_mach_mips5 5
-#define bfd_mach_mips_octeon 6502
-#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
-#define bfd_mach_mipsisa32 32
-#define bfd_mach_mipsisa32r2 33
-#define bfd_mach_mipsisa64 64
-#define bfd_mach_mipsisa64r2 65
- bfd_arch_i386, /* Intel 386 */
-#define bfd_mach_i386_i386 1
-#define bfd_mach_i386_i8086 2
-#define bfd_mach_i386_i386_intel_syntax 3
-#define bfd_mach_x86_64 64
-#define bfd_mach_x86_64_intel_syntax 65
- bfd_arch_we32k, /* AT&T WE32xxx */
- bfd_arch_tahoe, /* CCI/Harris Tahoe */
- bfd_arch_i860, /* Intel 860 */
- bfd_arch_i370, /* IBM 360/370 Mainframes */
- bfd_arch_romp, /* IBM ROMP PC/RT */
- bfd_arch_convex, /* Convex */
- bfd_arch_m88k, /* Motorola 88xxx */
- bfd_arch_m98k, /* Motorola 98xxx */
- bfd_arch_pyramid, /* Pyramid Technology */
- bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */
-#define bfd_mach_h8300 1
-#define bfd_mach_h8300h 2
-#define bfd_mach_h8300s 3
-#define bfd_mach_h8300hn 4
-#define bfd_mach_h8300sn 5
-#define bfd_mach_h8300sx 6
-#define bfd_mach_h8300sxn 7
- bfd_arch_pdp11, /* DEC PDP-11 */
- bfd_arch_powerpc, /* PowerPC */
-#define bfd_mach_ppc 32
-#define bfd_mach_ppc64 64
-#define bfd_mach_ppc_403 403
-#define bfd_mach_ppc_403gc 4030
-#define bfd_mach_ppc_505 505
-#define bfd_mach_ppc_601 601
-#define bfd_mach_ppc_602 602
-#define bfd_mach_ppc_603 603
-#define bfd_mach_ppc_ec603e 6031
-#define bfd_mach_ppc_604 604
-#define bfd_mach_ppc_620 620
-#define bfd_mach_ppc_630 630
-#define bfd_mach_ppc_750 750
-#define bfd_mach_ppc_860 860
-#define bfd_mach_ppc_a35 35
-#define bfd_mach_ppc_rs64ii 642
-#define bfd_mach_ppc_rs64iii 643
-#define bfd_mach_ppc_7400 7400
-#define bfd_mach_ppc_e500 500
- bfd_arch_rs6000, /* IBM RS/6000 */
-#define bfd_mach_rs6k 6000
-#define bfd_mach_rs6k_rs1 6001
-#define bfd_mach_rs6k_rsc 6003
-#define bfd_mach_rs6k_rs2 6002
- bfd_arch_hppa, /* HP PA RISC */
-#define bfd_mach_hppa10 10
-#define bfd_mach_hppa11 11
-#define bfd_mach_hppa20 20
-#define bfd_mach_hppa20w 25
- bfd_arch_d10v, /* Mitsubishi D10V */
-#define bfd_mach_d10v 1
-#define bfd_mach_d10v_ts2 2
-#define bfd_mach_d10v_ts3 3
- bfd_arch_d30v, /* Mitsubishi D30V */
- bfd_arch_dlx, /* DLX */
- bfd_arch_m68hc11, /* Motorola 68HC11 */
- bfd_arch_m68hc12, /* Motorola 68HC12 */
-#define bfd_mach_m6812_default 0
-#define bfd_mach_m6812 1
-#define bfd_mach_m6812s 2
- bfd_arch_z8k, /* Zilog Z8000 */
-#define bfd_mach_z8001 1
-#define bfd_mach_z8002 2
- bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */
- bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */
-#define bfd_mach_sh 1
-#define bfd_mach_sh2 0x20
-#define bfd_mach_sh_dsp 0x2d
-#define bfd_mach_sh2a 0x2a
-#define bfd_mach_sh2a_nofpu 0x2b
-#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
-#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
-#define bfd_mach_sh2a_or_sh4 0x2a3
-#define bfd_mach_sh2a_or_sh3e 0x2a4
-#define bfd_mach_sh2e 0x2e
-#define bfd_mach_sh3 0x30
-#define bfd_mach_sh3_nommu 0x31
-#define bfd_mach_sh3_dsp 0x3d
-#define bfd_mach_sh3e 0x3e
-#define bfd_mach_sh4 0x40
-#define bfd_mach_sh4_nofpu 0x41
-#define bfd_mach_sh4_nommu_nofpu 0x42
-#define bfd_mach_sh4a 0x4a
-#define bfd_mach_sh4a_nofpu 0x4b
-#define bfd_mach_sh4al_dsp 0x4d
-#define bfd_mach_sh5 0x50
- bfd_arch_alpha, /* Dec Alpha */
-#define bfd_mach_alpha_ev4 0x10
-#define bfd_mach_alpha_ev5 0x20
-#define bfd_mach_alpha_ev6 0x30
- bfd_arch_arm, /* Advanced Risc Machines ARM. */
-#define bfd_mach_arm_unknown 0
-#define bfd_mach_arm_2 1
-#define bfd_mach_arm_2a 2
-#define bfd_mach_arm_3 3
-#define bfd_mach_arm_3M 4
-#define bfd_mach_arm_4 5
-#define bfd_mach_arm_4T 6
-#define bfd_mach_arm_5 7
-#define bfd_mach_arm_5T 8
-#define bfd_mach_arm_5TE 9
-#define bfd_mach_arm_XScale 10
-#define bfd_mach_arm_ep9312 11
-#define bfd_mach_arm_iWMMXt 12
-#define bfd_mach_arm_iWMMXt2 13
- bfd_arch_ns32k, /* National Semiconductors ns32000 */
- bfd_arch_w65, /* WDC 65816 */
- bfd_arch_tic30, /* Texas Instruments TMS320C30 */
- bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */
-#define bfd_mach_tic3x 30
-#define bfd_mach_tic4x 40
- bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
- bfd_arch_tic80, /* TI TMS320c80 (MVP) */
- bfd_arch_v850, /* NEC V850 */
-#define bfd_mach_v850 1
-#define bfd_mach_v850e 'E'
-#define bfd_mach_v850e1 '1'
- bfd_arch_arc, /* ARC Cores */
-#define bfd_mach_arc_5 5
-#define bfd_mach_arc_6 6
-#define bfd_mach_arc_7 7
-#define bfd_mach_arc_8 8
- bfd_arch_m32c, /* Renesas M16C/M32C. */
-#define bfd_mach_m16c 0x75
-#define bfd_mach_m32c 0x78
- bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */
-#define bfd_mach_m32r 1 /* For backwards compatibility. */
-#define bfd_mach_m32rx 'x'
-#define bfd_mach_m32r2 '2'
- bfd_arch_mn10200, /* Matsushita MN10200 */
- bfd_arch_mn10300, /* Matsushita MN10300 */
-#define bfd_mach_mn10300 300
-#define bfd_mach_am33 330
-#define bfd_mach_am33_2 332
- bfd_arch_fr30,
-#define bfd_mach_fr30 0x46523330
- bfd_arch_frv,
-#define bfd_mach_frv 1
-#define bfd_mach_frvsimple 2
-#define bfd_mach_fr300 300
-#define bfd_mach_fr400 400
-#define bfd_mach_fr450 450
-#define bfd_mach_frvtomcat 499 /* fr500 prototype */
-#define bfd_mach_fr500 500
-#define bfd_mach_fr550 550
- bfd_arch_mcore,
- bfd_arch_mep,
-#define bfd_mach_mep 1
-#define bfd_mach_mep_h1 0x6831
- bfd_arch_ia64, /* HP/Intel ia64 */
-#define bfd_mach_ia64_elf64 64
-#define bfd_mach_ia64_elf32 32
- bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
-#define bfd_mach_ip2022 1
-#define bfd_mach_ip2022ext 2
- bfd_arch_iq2000, /* Vitesse IQ2000. */
-#define bfd_mach_iq2000 1
-#define bfd_mach_iq10 2
- bfd_arch_mt,
-#define bfd_mach_ms1 1
-#define bfd_mach_mrisc2 2
-#define bfd_mach_ms2 3
- bfd_arch_pj,
- bfd_arch_avr, /* Atmel AVR microcontrollers. */
-#define bfd_mach_avr1 1
-#define bfd_mach_avr2 2
-#define bfd_mach_avr3 3
-#define bfd_mach_avr4 4
-#define bfd_mach_avr5 5
-#define bfd_mach_avr6 6
- bfd_arch_bfin, /* ADI Blackfin */
-#define bfd_mach_bfin 1
- bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
-#define bfd_mach_cr16 1
- bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
-#define bfd_mach_cr16c 1
- bfd_arch_crx, /* National Semiconductor CRX. */
-#define bfd_mach_crx 1
- bfd_arch_cris, /* Axis CRIS */
-#define bfd_mach_cris_v0_v10 255
-#define bfd_mach_cris_v32 32
-#define bfd_mach_cris_v10_v32 1032
- bfd_arch_s390, /* IBM s390 */
-#define bfd_mach_s390_31 31
-#define bfd_mach_s390_64 64
- bfd_arch_score, /* Sunplus score */
- bfd_arch_openrisc, /* OpenRISC */
- bfd_arch_mmix, /* Donald Knuth's educational processor. */
- bfd_arch_xstormy16,
-#define bfd_mach_xstormy16 1
- bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
-#define bfd_mach_msp11 11
-#define bfd_mach_msp110 110
-#define bfd_mach_msp12 12
-#define bfd_mach_msp13 13
-#define bfd_mach_msp14 14
-#define bfd_mach_msp15 15
-#define bfd_mach_msp16 16
-#define bfd_mach_msp21 21
-#define bfd_mach_msp31 31
-#define bfd_mach_msp32 32
-#define bfd_mach_msp33 33
-#define bfd_mach_msp41 41
-#define bfd_mach_msp42 42
-#define bfd_mach_msp43 43
-#define bfd_mach_msp44 44
- bfd_arch_xc16x, /* Infineon's XC16X Series. */
-#define bfd_mach_xc16x 1
-#define bfd_mach_xc16xl 2
-#define bfd_mach_xc16xs 3
- bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
-#define bfd_mach_xtensa 1
- bfd_arch_maxq, /* Dallas MAXQ 10/20 */
-#define bfd_mach_maxq10 10
-#define bfd_mach_maxq20 20
- bfd_arch_z80,
-#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
-#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
-#define bfd_mach_z80full 7 /* All undocumented instructions. */
-#define bfd_mach_r800 11 /* R800: successor with multiplication. */
- bfd_arch_last
- };
-
-typedef struct bfd_arch_info
-{
- int bits_per_word;
- int bits_per_address;
- int bits_per_byte;
- enum bfd_architecture arch;
- unsigned long mach;
- const char *arch_name;
- const char *printable_name;
- unsigned int section_align_power;
- /* TRUE if this is the default machine for the architecture.
- The default arch should be the first entry for an arch so that
- all the entries for that arch can be accessed via <<next>>. */
- bfd_boolean the_default;
- const struct bfd_arch_info * (*compatible)
- (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
-
- bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
-
- const struct bfd_arch_info *next;
-}
-bfd_arch_info_type;
-
-const char *bfd_printable_name (bfd *abfd);
-
-const bfd_arch_info_type *bfd_scan_arch (const char *string);
-
-const char **bfd_arch_list (void);
-
-const bfd_arch_info_type *bfd_arch_get_compatible
- (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
-
-void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
-
-enum bfd_architecture bfd_get_arch (bfd *abfd);
-
-unsigned long bfd_get_mach (bfd *abfd);
-
-unsigned int bfd_arch_bits_per_byte (bfd *abfd);
-
-unsigned int bfd_arch_bits_per_address (bfd *abfd);
-
-const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
-
-const bfd_arch_info_type *bfd_lookup_arch
- (enum bfd_architecture arch, unsigned long machine);
-
-const char *bfd_printable_arch_mach
- (enum bfd_architecture arch, unsigned long machine);
-
-unsigned int bfd_octets_per_byte (bfd *abfd);
-
-unsigned int bfd_arch_mach_octets_per_byte
- (enum bfd_architecture arch, unsigned long machine);
-
-/* Extracted from reloc.c. */
-typedef enum bfd_reloc_status
-{
- /* No errors detected. */
- bfd_reloc_ok,
-
- /* The relocation was performed, but there was an overflow. */
- bfd_reloc_overflow,
-
- /* The address to relocate was not within the section supplied. */
- bfd_reloc_outofrange,
-
- /* Used by special functions. */
- bfd_reloc_continue,
-
- /* Unsupported relocation size requested. */
- bfd_reloc_notsupported,
-
- /* Unused. */
- bfd_reloc_other,
-
- /* The symbol to relocate against was undefined. */
- bfd_reloc_undefined,
-
- /* The relocation was performed, but may not be ok - presently
- generated only when linking i960 coff files with i960 b.out
- symbols. If this type is returned, the error_message argument
- to bfd_perform_relocation will be set. */
- bfd_reloc_dangerous
- }
- bfd_reloc_status_type;
-
-
-typedef struct reloc_cache_entry
-{
- /* A pointer into the canonical table of pointers. */
- struct bfd_symbol **sym_ptr_ptr;
-
- /* offset in section. */
- bfd_size_type address;
-
- /* addend for relocation value. */
- bfd_vma addend;
-
- /* Pointer to how to perform the required relocation. */
- reloc_howto_type *howto;
-
-}
-arelent;
-
-enum complain_overflow
-{
- /* Do not complain on overflow. */
- complain_overflow_dont,
-
- /* Complain if the value overflows when considered as a signed
- number one bit larger than the field. ie. A bitfield of N bits
- is allowed to represent -2**n to 2**n-1. */
- complain_overflow_bitfield,
-
- /* Complain if the value overflows when considered as a signed
- number. */
- complain_overflow_signed,
-
- /* Complain if the value overflows when considered as an
- unsigned number. */
- complain_overflow_unsigned
-};
-
-struct reloc_howto_struct
-{
- /* The type field has mainly a documentary use - the back end can
- do what it wants with it, though normally the back end's
- external idea of what a reloc number is stored
- in this field. For example, a PC relative word relocation
- in a coff environment has the type 023 - because that's
- what the outside world calls a R_PCRWORD reloc. */
- unsigned int type;
-
- /* The value the final relocation is shifted right by. This drops
- unwanted data from the relocation. */
- unsigned int rightshift;
-
- /* The size of the item to be relocated. This is *not* a
- power-of-two measure. To get the number of bytes operated
- on by a type of relocation, use bfd_get_reloc_size. */
- int size;
-
- /* The number of bits in the item to be relocated. This is used
- when doing overflow checking. */
- unsigned int bitsize;
-
- /* Notes that the relocation is relative to the location in the
- data section of the addend. The relocation function will
- subtract from the relocation value the address of the location
- being relocated. */
- bfd_boolean pc_relative;
-
- /* The bit position of the reloc value in the destination.
- The relocated value is left shifted by this amount. */
- unsigned int bitpos;
-
- /* What type of overflow error should be checked for when
- relocating. */
- enum complain_overflow complain_on_overflow;
-
- /* If this field is non null, then the supplied function is
- called rather than the normal function. This allows really
- strange relocation methods to be accommodated (e.g., i960 callj
- instructions). */
- bfd_reloc_status_type (*special_function)
- (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
- bfd *, char **);
-
- /* The textual name of the relocation type. */
- char *name;
-
- /* Some formats record a relocation addend in the section contents
- rather than with the relocation. For ELF formats this is the
- distinction between USE_REL and USE_RELA (though the code checks
- for USE_REL == 1/0). The value of this field is TRUE if the
- addend is recorded with the section contents; when performing a
- partial link (ld -r) the section contents (the data) will be
- modified. The value of this field is FALSE if addends are
- recorded with the relocation (in arelent.addend); when performing
- a partial link the relocation will be modified.
- All relocations for all ELF USE_RELA targets should set this field
- to FALSE (values of TRUE should be looked on with suspicion).
- However, the converse is not true: not all relocations of all ELF
- USE_REL targets set this field to TRUE. Why this is so is peculiar
- to each particular target. For relocs that aren't used in partial
- links (e.g. GOT stuff) it doesn't matter what this is set to. */
- bfd_boolean partial_inplace;
-
- /* src_mask selects the part of the instruction (or data) to be used
- in the relocation sum. If the target relocations don't have an
- addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
- dst_mask to extract the addend from the section contents. If
- relocations do have an addend in the reloc, eg. ELF USE_RELA, this
- field should be zero. Non-zero values for ELF USE_RELA targets are
- bogus as in those cases the value in the dst_mask part of the
- section contents should be treated as garbage. */
- bfd_vma src_mask;
-
- /* dst_mask selects which parts of the instruction (or data) are
- replaced with a relocated value. */
- bfd_vma dst_mask;
-
- /* When some formats create PC relative instructions, they leave
- the value of the pc of the place being relocated in the offset
- slot of the instruction, so that a PC relative relocation can
- be made just by adding in an ordinary offset (e.g., sun3 a.out).
- Some formats leave the displacement part of an instruction
- empty (e.g., m88k bcs); this flag signals the fact. */
- bfd_boolean pcrel_offset;
-};
-
-#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
- { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
-#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
- HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
- NAME, FALSE, 0, 0, IN)
-
-#define EMPTY_HOWTO(C) \
- HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
- NULL, FALSE, 0, 0, FALSE)
-
-#define HOWTO_PREPARE(relocation, symbol) \
- { \
- if (symbol != NULL) \
- { \
- if (bfd_is_com_section (symbol->section)) \
- { \
- relocation = 0; \
- } \
- else \
- { \
- relocation = symbol->value; \
- } \
- } \
- }
-
-unsigned int bfd_get_reloc_size (reloc_howto_type *);
-
-typedef struct relent_chain
-{
- arelent relent;
- struct relent_chain *next;
-}
-arelent_chain;
-
-bfd_reloc_status_type bfd_check_overflow
- (enum complain_overflow how,
- unsigned int bitsize,
- unsigned int rightshift,
- unsigned int addrsize,
- bfd_vma relocation);
-
-bfd_reloc_status_type bfd_perform_relocation
- (bfd *abfd,
- arelent *reloc_entry,
- void *data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message);
-
-bfd_reloc_status_type bfd_install_relocation
- (bfd *abfd,
- arelent *reloc_entry,
- void *data, bfd_vma data_start,
- asection *input_section,
- char **error_message);
-
-enum bfd_reloc_code_real {
- _dummy_first_bfd_reloc_code_real,
-
-
-/* Basic absolute relocations of N bits. */
- BFD_RELOC_64,
- BFD_RELOC_32,
- BFD_RELOC_26,
- BFD_RELOC_24,
- BFD_RELOC_16,
- BFD_RELOC_14,
- BFD_RELOC_8,
-
-/* PC-relative relocations. Sometimes these are relative to the address
-of the relocation itself; sometimes they are relative to the start of
-the section containing the relocation. It depends on the specific target.
-
-The 24-bit relocation is used in some Intel 960 configurations. */
- BFD_RELOC_64_PCREL,
- BFD_RELOC_32_PCREL,
- BFD_RELOC_24_PCREL,
- BFD_RELOC_16_PCREL,
- BFD_RELOC_12_PCREL,
- BFD_RELOC_8_PCREL,
-
-/* Section relative relocations. Some targets need this for DWARF2. */
- BFD_RELOC_32_SECREL,
-
-/* For ELF. */
- BFD_RELOC_32_GOT_PCREL,
- BFD_RELOC_16_GOT_PCREL,
- BFD_RELOC_8_GOT_PCREL,
- BFD_RELOC_32_GOTOFF,
- BFD_RELOC_16_GOTOFF,
- BFD_RELOC_LO16_GOTOFF,
- BFD_RELOC_HI16_GOTOFF,
- BFD_RELOC_HI16_S_GOTOFF,
- BFD_RELOC_8_GOTOFF,
- BFD_RELOC_64_PLT_PCREL,
- BFD_RELOC_32_PLT_PCREL,
- BFD_RELOC_24_PLT_PCREL,
- BFD_RELOC_16_PLT_PCREL,
- BFD_RELOC_8_PLT_PCREL,
- BFD_RELOC_64_PLTOFF,
- BFD_RELOC_32_PLTOFF,
- BFD_RELOC_16_PLTOFF,
- BFD_RELOC_LO16_PLTOFF,
- BFD_RELOC_HI16_PLTOFF,
- BFD_RELOC_HI16_S_PLTOFF,
- BFD_RELOC_8_PLTOFF,
-
-/* Relocations used by 68K ELF. */
- BFD_RELOC_68K_GLOB_DAT,
- BFD_RELOC_68K_JMP_SLOT,
- BFD_RELOC_68K_RELATIVE,
-
-/* Linkage-table relative. */
- BFD_RELOC_32_BASEREL,
- BFD_RELOC_16_BASEREL,
- BFD_RELOC_LO16_BASEREL,
- BFD_RELOC_HI16_BASEREL,
- BFD_RELOC_HI16_S_BASEREL,
- BFD_RELOC_8_BASEREL,
- BFD_RELOC_RVA,
-
-/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
- BFD_RELOC_8_FFnn,
-
-/* These PC-relative relocations are stored as word displacements --
-i.e., byte displacements shifted right two bits. The 30-bit word
-displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
-SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
-signed 16-bit displacement is used on the MIPS, and the 23-bit
-displacement is used on the Alpha. */
- BFD_RELOC_32_PCREL_S2,
- BFD_RELOC_16_PCREL_S2,
- BFD_RELOC_23_PCREL_S2,
-
-/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
-the target word. These are used on the SPARC. */
- BFD_RELOC_HI22,
- BFD_RELOC_LO10,
-
-/* For systems that allocate a Global Pointer register, these are
-displacements off that register. These relocation types are
-handled specially, because the value the register will have is
-decided relatively late. */
- BFD_RELOC_GPREL16,
- BFD_RELOC_GPREL32,
-
-/* Reloc types used for i960/b.out. */
- BFD_RELOC_I960_CALLJ,
-
-/* SPARC ELF relocations. There is probably some overlap with other
-relocation types already defined. */
- BFD_RELOC_NONE,
- BFD_RELOC_SPARC_WDISP22,
- BFD_RELOC_SPARC22,
- BFD_RELOC_SPARC13,
- BFD_RELOC_SPARC_GOT10,
- BFD_RELOC_SPARC_GOT13,
- BFD_RELOC_SPARC_GOT22,
- BFD_RELOC_SPARC_PC10,
- BFD_RELOC_SPARC_PC22,
- BFD_RELOC_SPARC_WPLT30,
- BFD_RELOC_SPARC_COPY,
- BFD_RELOC_SPARC_GLOB_DAT,
- BFD_RELOC_SPARC_JMP_SLOT,
- BFD_RELOC_SPARC_RELATIVE,
- BFD_RELOC_SPARC_UA16,
- BFD_RELOC_SPARC_UA32,
- BFD_RELOC_SPARC_UA64,
-
-/* I think these are specific to SPARC a.out (e.g., Sun 4). */
- BFD_RELOC_SPARC_BASE13,
- BFD_RELOC_SPARC_BASE22,
-
-/* SPARC64 relocations */
-#define BFD_RELOC_SPARC_64 BFD_RELOC_64
- BFD_RELOC_SPARC_10,
- BFD_RELOC_SPARC_11,
- BFD_RELOC_SPARC_OLO10,
- BFD_RELOC_SPARC_HH22,
- BFD_RELOC_SPARC_HM10,
- BFD_RELOC_SPARC_LM22,
- BFD_RELOC_SPARC_PC_HH22,
- BFD_RELOC_SPARC_PC_HM10,
- BFD_RELOC_SPARC_PC_LM22,
- BFD_RELOC_SPARC_WDISP16,
- BFD_RELOC_SPARC_WDISP19,
- BFD_RELOC_SPARC_7,
- BFD_RELOC_SPARC_6,
- BFD_RELOC_SPARC_5,
-#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
- BFD_RELOC_SPARC_PLT32,
- BFD_RELOC_SPARC_PLT64,
- BFD_RELOC_SPARC_HIX22,
- BFD_RELOC_SPARC_LOX10,
- BFD_RELOC_SPARC_H44,
- BFD_RELOC_SPARC_M44,
- BFD_RELOC_SPARC_L44,
- BFD_RELOC_SPARC_REGISTER,
-
-/* SPARC little endian relocation */
- BFD_RELOC_SPARC_REV32,
-
-/* SPARC TLS relocations */
- BFD_RELOC_SPARC_TLS_GD_HI22,
- BFD_RELOC_SPARC_TLS_GD_LO10,
- BFD_RELOC_SPARC_TLS_GD_ADD,
- BFD_RELOC_SPARC_TLS_GD_CALL,
- BFD_RELOC_SPARC_TLS_LDM_HI22,
- BFD_RELOC_SPARC_TLS_LDM_LO10,
- BFD_RELOC_SPARC_TLS_LDM_ADD,
- BFD_RELOC_SPARC_TLS_LDM_CALL,
- BFD_RELOC_SPARC_TLS_LDO_HIX22,
- BFD_RELOC_SPARC_TLS_LDO_LOX10,
- BFD_RELOC_SPARC_TLS_LDO_ADD,
- BFD_RELOC_SPARC_TLS_IE_HI22,
- BFD_RELOC_SPARC_TLS_IE_LO10,
- BFD_RELOC_SPARC_TLS_IE_LD,
- BFD_RELOC_SPARC_TLS_IE_LDX,
- BFD_RELOC_SPARC_TLS_IE_ADD,
- BFD_RELOC_SPARC_TLS_LE_HIX22,
- BFD_RELOC_SPARC_TLS_LE_LOX10,
- BFD_RELOC_SPARC_TLS_DTPMOD32,
- BFD_RELOC_SPARC_TLS_DTPMOD64,
- BFD_RELOC_SPARC_TLS_DTPOFF32,
- BFD_RELOC_SPARC_TLS_DTPOFF64,
- BFD_RELOC_SPARC_TLS_TPOFF32,
- BFD_RELOC_SPARC_TLS_TPOFF64,
-
-/* SPU Relocations. */
- BFD_RELOC_SPU_IMM7,
- BFD_RELOC_SPU_IMM8,
- BFD_RELOC_SPU_IMM10,
- BFD_RELOC_SPU_IMM10W,
- BFD_RELOC_SPU_IMM16,
- BFD_RELOC_SPU_IMM16W,
- BFD_RELOC_SPU_IMM18,
- BFD_RELOC_SPU_PCREL9a,
- BFD_RELOC_SPU_PCREL9b,
- BFD_RELOC_SPU_PCREL16,
- BFD_RELOC_SPU_LO16,
- BFD_RELOC_SPU_HI16,
- BFD_RELOC_SPU_PPU32,
- BFD_RELOC_SPU_PPU64,
-
-/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
-"addend" in some special way.
-For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
-writing; when reading, it will be the absolute section symbol. The
-addend is the displacement in bytes of the "lda" instruction from
-the "ldah" instruction (which is at the address of this reloc). */
- BFD_RELOC_ALPHA_GPDISP_HI16,
-
-/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
-with GPDISP_HI16 relocs. The addend is ignored when writing the
-relocations out, and is filled in with the file's GP value on
-reading, for convenience. */
- BFD_RELOC_ALPHA_GPDISP_LO16,
-
-/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
-relocation except that there is no accompanying GPDISP_LO16
-relocation. */
- BFD_RELOC_ALPHA_GPDISP,
-
-/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
-the assembler turns it into a LDQ instruction to load the address of
-the symbol, and then fills in a register in the real instruction.
-
-The LITERAL reloc, at the LDQ instruction, refers to the .lita
-section symbol. The addend is ignored when writing, but is filled
-in with the file's GP value on reading, for convenience, as with the
-GPDISP_LO16 reloc.
-
-The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
-It should refer to the symbol to be referenced, as with 16_GOTOFF,
-but it generates output not based on the position within the .got
-section, but relative to the GP value chosen for the file during the
-final link stage.
-
-The LITUSE reloc, on the instruction using the loaded address, gives
-information to the linker that it might be able to use to optimize
-away some literal section references. The symbol is ignored (read
-as the absolute section symbol), and the "addend" indicates the type
-of instruction using the register:
-1 - "memory" fmt insn
-2 - byte-manipulation (byte offset reg)
-3 - jsr (target of branch) */
- BFD_RELOC_ALPHA_LITERAL,
- BFD_RELOC_ALPHA_ELF_LITERAL,
- BFD_RELOC_ALPHA_LITUSE,
-
-/* The HINT relocation indicates a value that should be filled into the
-"hint" field of a jmp/jsr/ret instruction, for possible branch-
-prediction logic which may be provided on some processors. */
- BFD_RELOC_ALPHA_HINT,
-
-/* The LINKAGE relocation outputs a linkage pair in the object file,
-which is filled by the linker. */
- BFD_RELOC_ALPHA_LINKAGE,
-
-/* The CODEADDR relocation outputs a STO_CA in the object file,
-which is filled by the linker. */
- BFD_RELOC_ALPHA_CODEADDR,
-
-/* The GPREL_HI/LO relocations together form a 32-bit offset from the
-GP register. */
- BFD_RELOC_ALPHA_GPREL_HI16,
- BFD_RELOC_ALPHA_GPREL_LO16,
-
-/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
-share a common GP, and the target address is adjusted for
-STO_ALPHA_STD_GPLOAD. */
- BFD_RELOC_ALPHA_BRSGP,
-
-/* Alpha thread-local storage relocations. */
- BFD_RELOC_ALPHA_TLSGD,
- BFD_RELOC_ALPHA_TLSLDM,
- BFD_RELOC_ALPHA_DTPMOD64,
- BFD_RELOC_ALPHA_GOTDTPREL16,
- BFD_RELOC_ALPHA_DTPREL64,
- BFD_RELOC_ALPHA_DTPREL_HI16,
- BFD_RELOC_ALPHA_DTPREL_LO16,
- BFD_RELOC_ALPHA_DTPREL16,
- BFD_RELOC_ALPHA_GOTTPREL16,
- BFD_RELOC_ALPHA_TPREL64,
- BFD_RELOC_ALPHA_TPREL_HI16,
- BFD_RELOC_ALPHA_TPREL_LO16,
- BFD_RELOC_ALPHA_TPREL16,
-
-/* Bits 27..2 of the relocation address shifted right 2 bits;
-simple reloc otherwise. */
- BFD_RELOC_MIPS_JMP,
-
-/* The MIPS16 jump instruction. */
- BFD_RELOC_MIPS16_JMP,
-
-/* MIPS16 GP relative reloc. */
- BFD_RELOC_MIPS16_GPREL,
-
-/* High 16 bits of 32-bit value; simple reloc. */
- BFD_RELOC_HI16,
-
-/* High 16 bits of 32-bit value but the low 16 bits will be sign
-extended and added to form the final result. If the low 16
-bits form a negative number, we need to add one to the high value
-to compensate for the borrow when the low bits are added. */
- BFD_RELOC_HI16_S,
-
-/* Low 16 bits. */
- BFD_RELOC_LO16,
-
-/* High 16 bits of 32-bit pc-relative value */
- BFD_RELOC_HI16_PCREL,
-
-/* High 16 bits of 32-bit pc-relative value, adjusted */
- BFD_RELOC_HI16_S_PCREL,
-
-/* Low 16 bits of pc-relative value */
- BFD_RELOC_LO16_PCREL,
-
-/* MIPS16 high 16 bits of 32-bit value. */
- BFD_RELOC_MIPS16_HI16,
-
-/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
-extended and added to form the final result. If the low 16
-bits form a negative number, we need to add one to the high value
-to compensate for the borrow when the low bits are added. */
- BFD_RELOC_MIPS16_HI16_S,
-
-/* MIPS16 low 16 bits. */
- BFD_RELOC_MIPS16_LO16,
-
-/* Relocation against a MIPS literal section. */
- BFD_RELOC_MIPS_LITERAL,
-
-/* MIPS ELF relocations. */
- BFD_RELOC_MIPS_GOT16,
- BFD_RELOC_MIPS_CALL16,
- BFD_RELOC_MIPS_GOT_HI16,
- BFD_RELOC_MIPS_GOT_LO16,
- BFD_RELOC_MIPS_CALL_HI16,
- BFD_RELOC_MIPS_CALL_LO16,
- BFD_RELOC_MIPS_SUB,
- BFD_RELOC_MIPS_GOT_PAGE,
- BFD_RELOC_MIPS_GOT_OFST,
- BFD_RELOC_MIPS_GOT_DISP,
- BFD_RELOC_MIPS_SHIFT5,
- BFD_RELOC_MIPS_SHIFT6,
- BFD_RELOC_MIPS_INSERT_A,
- BFD_RELOC_MIPS_INSERT_B,
- BFD_RELOC_MIPS_DELETE,
- BFD_RELOC_MIPS_HIGHEST,
- BFD_RELOC_MIPS_HIGHER,
- BFD_RELOC_MIPS_SCN_DISP,
- BFD_RELOC_MIPS_REL16,
- BFD_RELOC_MIPS_RELGOT,
- BFD_RELOC_MIPS_JALR,
- BFD_RELOC_MIPS_TLS_DTPMOD32,
- BFD_RELOC_MIPS_TLS_DTPREL32,
- BFD_RELOC_MIPS_TLS_DTPMOD64,
- BFD_RELOC_MIPS_TLS_DTPREL64,
- BFD_RELOC_MIPS_TLS_GD,
- BFD_RELOC_MIPS_TLS_LDM,
- BFD_RELOC_MIPS_TLS_DTPREL_HI16,
- BFD_RELOC_MIPS_TLS_DTPREL_LO16,
- BFD_RELOC_MIPS_TLS_GOTTPREL,
- BFD_RELOC_MIPS_TLS_TPREL32,
- BFD_RELOC_MIPS_TLS_TPREL64,
- BFD_RELOC_MIPS_TLS_TPREL_HI16,
- BFD_RELOC_MIPS_TLS_TPREL_LO16,
-
-
-/* MIPS ELF relocations (VxWorks extensions). */
- BFD_RELOC_MIPS_COPY,
- BFD_RELOC_MIPS_JUMP_SLOT,
-
-
-/* Fujitsu Frv Relocations. */
- BFD_RELOC_FRV_LABEL16,
- BFD_RELOC_FRV_LABEL24,
- BFD_RELOC_FRV_LO16,
- BFD_RELOC_FRV_HI16,
- BFD_RELOC_FRV_GPREL12,
- BFD_RELOC_FRV_GPRELU12,
- BFD_RELOC_FRV_GPREL32,
- BFD_RELOC_FRV_GPRELHI,
- BFD_RELOC_FRV_GPRELLO,
- BFD_RELOC_FRV_GOT12,
- BFD_RELOC_FRV_GOTHI,
- BFD_RELOC_FRV_GOTLO,
- BFD_RELOC_FRV_FUNCDESC,
- BFD_RELOC_FRV_FUNCDESC_GOT12,
- BFD_RELOC_FRV_FUNCDESC_GOTHI,
- BFD_RELOC_FRV_FUNCDESC_GOTLO,
- BFD_RELOC_FRV_FUNCDESC_VALUE,
- BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
- BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
- BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
- BFD_RELOC_FRV_GOTOFF12,
- BFD_RELOC_FRV_GOTOFFHI,
- BFD_RELOC_FRV_GOTOFFLO,
- BFD_RELOC_FRV_GETTLSOFF,
- BFD_RELOC_FRV_TLSDESC_VALUE,
- BFD_RELOC_FRV_GOTTLSDESC12,
- BFD_RELOC_FRV_GOTTLSDESCHI,
- BFD_RELOC_FRV_GOTTLSDESCLO,
- BFD_RELOC_FRV_TLSMOFF12,
- BFD_RELOC_FRV_TLSMOFFHI,
- BFD_RELOC_FRV_TLSMOFFLO,
- BFD_RELOC_FRV_GOTTLSOFF12,
- BFD_RELOC_FRV_GOTTLSOFFHI,
- BFD_RELOC_FRV_GOTTLSOFFLO,
- BFD_RELOC_FRV_TLSOFF,
- BFD_RELOC_FRV_TLSDESC_RELAX,
- BFD_RELOC_FRV_GETTLSOFF_RELAX,
- BFD_RELOC_FRV_TLSOFF_RELAX,
- BFD_RELOC_FRV_TLSMOFF,
-
-
-/* This is a 24bit GOT-relative reloc for the mn10300. */
- BFD_RELOC_MN10300_GOTOFF24,
-
-/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
-in the instruction. */
- BFD_RELOC_MN10300_GOT32,
-
-/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
-in the instruction. */
- BFD_RELOC_MN10300_GOT24,
-
-/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
-in the instruction. */
- BFD_RELOC_MN10300_GOT16,
-
-/* Copy symbol at runtime. */
- BFD_RELOC_MN10300_COPY,
-
-/* Create GOT entry. */
- BFD_RELOC_MN10300_GLOB_DAT,
-
-/* Create PLT entry. */
- BFD_RELOC_MN10300_JMP_SLOT,
-
-/* Adjust by program base. */
- BFD_RELOC_MN10300_RELATIVE,
-
-
-/* i386/elf relocations */
- BFD_RELOC_386_GOT32,
- BFD_RELOC_386_PLT32,
- BFD_RELOC_386_COPY,
- BFD_RELOC_386_GLOB_DAT,
- BFD_RELOC_386_JUMP_SLOT,
- BFD_RELOC_386_RELATIVE,
- BFD_RELOC_386_GOTOFF,
- BFD_RELOC_386_GOTPC,
- BFD_RELOC_386_TLS_TPOFF,
- BFD_RELOC_386_TLS_IE,
- BFD_RELOC_386_TLS_GOTIE,
- BFD_RELOC_386_TLS_LE,
- BFD_RELOC_386_TLS_GD,
- BFD_RELOC_386_TLS_LDM,
- BFD_RELOC_386_TLS_LDO_32,
- BFD_RELOC_386_TLS_IE_32,
- BFD_RELOC_386_TLS_LE_32,
- BFD_RELOC_386_TLS_DTPMOD32,
- BFD_RELOC_386_TLS_DTPOFF32,
- BFD_RELOC_386_TLS_TPOFF32,
- BFD_RELOC_386_TLS_GOTDESC,
- BFD_RELOC_386_TLS_DESC_CALL,
- BFD_RELOC_386_TLS_DESC,
-
-/* x86-64/elf relocations */
- BFD_RELOC_X86_64_GOT32,
- BFD_RELOC_X86_64_PLT32,
- BFD_RELOC_X86_64_COPY,
- BFD_RELOC_X86_64_GLOB_DAT,
- BFD_RELOC_X86_64_JUMP_SLOT,
- BFD_RELOC_X86_64_RELATIVE,
- BFD_RELOC_X86_64_GOTPCREL,
- BFD_RELOC_X86_64_32S,
- BFD_RELOC_X86_64_DTPMOD64,
- BFD_RELOC_X86_64_DTPOFF64,
- BFD_RELOC_X86_64_TPOFF64,
- BFD_RELOC_X86_64_TLSGD,
- BFD_RELOC_X86_64_TLSLD,
- BFD_RELOC_X86_64_DTPOFF32,
- BFD_RELOC_X86_64_GOTTPOFF,
- BFD_RELOC_X86_64_TPOFF32,
- BFD_RELOC_X86_64_GOTOFF64,
- BFD_RELOC_X86_64_GOTPC32,
- BFD_RELOC_X86_64_GOT64,
- BFD_RELOC_X86_64_GOTPCREL64,
- BFD_RELOC_X86_64_GOTPC64,
- BFD_RELOC_X86_64_GOTPLT64,
- BFD_RELOC_X86_64_PLTOFF64,
- BFD_RELOC_X86_64_GOTPC32_TLSDESC,
- BFD_RELOC_X86_64_TLSDESC_CALL,
- BFD_RELOC_X86_64_TLSDESC,
-
-/* ns32k relocations */
- BFD_RELOC_NS32K_IMM_8,
- BFD_RELOC_NS32K_IMM_16,
- BFD_RELOC_NS32K_IMM_32,
- BFD_RELOC_NS32K_IMM_8_PCREL,
- BFD_RELOC_NS32K_IMM_16_PCREL,
- BFD_RELOC_NS32K_IMM_32_PCREL,
- BFD_RELOC_NS32K_DISP_8,
- BFD_RELOC_NS32K_DISP_16,
- BFD_RELOC_NS32K_DISP_32,
- BFD_RELOC_NS32K_DISP_8_PCREL,
- BFD_RELOC_NS32K_DISP_16_PCREL,
- BFD_RELOC_NS32K_DISP_32_PCREL,
-
-/* PDP11 relocations */
- BFD_RELOC_PDP11_DISP_8_PCREL,
- BFD_RELOC_PDP11_DISP_6_PCREL,
-
-/* Picojava relocs. Not all of these appear in object files. */
- BFD_RELOC_PJ_CODE_HI16,
- BFD_RELOC_PJ_CODE_LO16,
- BFD_RELOC_PJ_CODE_DIR16,
- BFD_RELOC_PJ_CODE_DIR32,
- BFD_RELOC_PJ_CODE_REL16,
- BFD_RELOC_PJ_CODE_REL32,
-
-/* Power(rs6000) and PowerPC relocations. */
- BFD_RELOC_PPC_B26,
- BFD_RELOC_PPC_BA26,
- BFD_RELOC_PPC_TOC16,
- BFD_RELOC_PPC_B16,
- BFD_RELOC_PPC_B16_BRTAKEN,
- BFD_RELOC_PPC_B16_BRNTAKEN,
- BFD_RELOC_PPC_BA16,
- BFD_RELOC_PPC_BA16_BRTAKEN,
- BFD_RELOC_PPC_BA16_BRNTAKEN,
- BFD_RELOC_PPC_COPY,
- BFD_RELOC_PPC_GLOB_DAT,
- BFD_RELOC_PPC_JMP_SLOT,
- BFD_RELOC_PPC_RELATIVE,
- BFD_RELOC_PPC_LOCAL24PC,
- BFD_RELOC_PPC_EMB_NADDR32,
- BFD_RELOC_PPC_EMB_NADDR16,
- BFD_RELOC_PPC_EMB_NADDR16_LO,
- BFD_RELOC_PPC_EMB_NADDR16_HI,
- BFD_RELOC_PPC_EMB_NADDR16_HA,
- BFD_RELOC_PPC_EMB_SDAI16,
- BFD_RELOC_PPC_EMB_SDA2I16,
- BFD_RELOC_PPC_EMB_SDA2REL,
- BFD_RELOC_PPC_EMB_SDA21,
- BFD_RELOC_PPC_EMB_MRKREF,
- BFD_RELOC_PPC_EMB_RELSEC16,
- BFD_RELOC_PPC_EMB_RELST_LO,
- BFD_RELOC_PPC_EMB_RELST_HI,
- BFD_RELOC_PPC_EMB_RELST_HA,
- BFD_RELOC_PPC_EMB_BIT_FLD,
- BFD_RELOC_PPC_EMB_RELSDA,
- BFD_RELOC_PPC64_HIGHER,
- BFD_RELOC_PPC64_HIGHER_S,
- BFD_RELOC_PPC64_HIGHEST,
- BFD_RELOC_PPC64_HIGHEST_S,
- BFD_RELOC_PPC64_TOC16_LO,
- BFD_RELOC_PPC64_TOC16_HI,
- BFD_RELOC_PPC64_TOC16_HA,
- BFD_RELOC_PPC64_TOC,
- BFD_RELOC_PPC64_PLTGOT16,
- BFD_RELOC_PPC64_PLTGOT16_LO,
- BFD_RELOC_PPC64_PLTGOT16_HI,
- BFD_RELOC_PPC64_PLTGOT16_HA,
- BFD_RELOC_PPC64_ADDR16_DS,
- BFD_RELOC_PPC64_ADDR16_LO_DS,
- BFD_RELOC_PPC64_GOT16_DS,
- BFD_RELOC_PPC64_GOT16_LO_DS,
- BFD_RELOC_PPC64_PLT16_LO_DS,
- BFD_RELOC_PPC64_SECTOFF_DS,
- BFD_RELOC_PPC64_SECTOFF_LO_DS,
- BFD_RELOC_PPC64_TOC16_DS,
- BFD_RELOC_PPC64_TOC16_LO_DS,
- BFD_RELOC_PPC64_PLTGOT16_DS,
- BFD_RELOC_PPC64_PLTGOT16_LO_DS,
-
-/* PowerPC and PowerPC64 thread-local storage relocations. */
- BFD_RELOC_PPC_TLS,
- BFD_RELOC_PPC_TLSGD,
- BFD_RELOC_PPC_TLSLD,
- BFD_RELOC_PPC_DTPMOD,
- BFD_RELOC_PPC_TPREL16,
- BFD_RELOC_PPC_TPREL16_LO,
- BFD_RELOC_PPC_TPREL16_HI,
- BFD_RELOC_PPC_TPREL16_HA,
- BFD_RELOC_PPC_TPREL,
- BFD_RELOC_PPC_DTPREL16,
- BFD_RELOC_PPC_DTPREL16_LO,
- BFD_RELOC_PPC_DTPREL16_HI,
- BFD_RELOC_PPC_DTPREL16_HA,
- BFD_RELOC_PPC_DTPREL,
- BFD_RELOC_PPC_GOT_TLSGD16,
- BFD_RELOC_PPC_GOT_TLSGD16_LO,
- BFD_RELOC_PPC_GOT_TLSGD16_HI,
- BFD_RELOC_PPC_GOT_TLSGD16_HA,
- BFD_RELOC_PPC_GOT_TLSLD16,
- BFD_RELOC_PPC_GOT_TLSLD16_LO,
- BFD_RELOC_PPC_GOT_TLSLD16_HI,
- BFD_RELOC_PPC_GOT_TLSLD16_HA,
- BFD_RELOC_PPC_GOT_TPREL16,
- BFD_RELOC_PPC_GOT_TPREL16_LO,
- BFD_RELOC_PPC_GOT_TPREL16_HI,
- BFD_RELOC_PPC_GOT_TPREL16_HA,
- BFD_RELOC_PPC_GOT_DTPREL16,
- BFD_RELOC_PPC_GOT_DTPREL16_LO,
- BFD_RELOC_PPC_GOT_DTPREL16_HI,
- BFD_RELOC_PPC_GOT_DTPREL16_HA,
- BFD_RELOC_PPC64_TPREL16_DS,
- BFD_RELOC_PPC64_TPREL16_LO_DS,
- BFD_RELOC_PPC64_TPREL16_HIGHER,
- BFD_RELOC_PPC64_TPREL16_HIGHERA,
- BFD_RELOC_PPC64_TPREL16_HIGHEST,
- BFD_RELOC_PPC64_TPREL16_HIGHESTA,
- BFD_RELOC_PPC64_DTPREL16_DS,
- BFD_RELOC_PPC64_DTPREL16_LO_DS,
- BFD_RELOC_PPC64_DTPREL16_HIGHER,
- BFD_RELOC_PPC64_DTPREL16_HIGHERA,
- BFD_RELOC_PPC64_DTPREL16_HIGHEST,
- BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
-
-/* IBM 370/390 relocations */
- BFD_RELOC_I370_D12,
-
-/* The type of reloc used to build a constructor table - at the moment
-probably a 32 bit wide absolute relocation, but the target can choose.
-It generally does map to one of the other relocation types. */
- BFD_RELOC_CTOR,
-
-/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
-not stored in the instruction. */
- BFD_RELOC_ARM_PCREL_BRANCH,
-
-/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
-not stored in the instruction. The 2nd lowest bit comes from a 1 bit
-field in the instruction. */
- BFD_RELOC_ARM_PCREL_BLX,
-
-/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
-not stored in the instruction. The 2nd lowest bit comes from a 1 bit
-field in the instruction. */
- BFD_RELOC_THUMB_PCREL_BLX,
-
-/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
- BFD_RELOC_ARM_PCREL_CALL,
-
-/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
- BFD_RELOC_ARM_PCREL_JUMP,
-
-/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
-The lowest bit must be zero and is not stored in the instruction.
-Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
-"nn" one smaller in all cases. Note further that BRANCH23
-corresponds to R_ARM_THM_CALL. */
- BFD_RELOC_THUMB_PCREL_BRANCH7,
- BFD_RELOC_THUMB_PCREL_BRANCH9,
- BFD_RELOC_THUMB_PCREL_BRANCH12,
- BFD_RELOC_THUMB_PCREL_BRANCH20,
- BFD_RELOC_THUMB_PCREL_BRANCH23,
- BFD_RELOC_THUMB_PCREL_BRANCH25,
-
-/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
- BFD_RELOC_ARM_OFFSET_IMM,
-
-/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
- BFD_RELOC_ARM_THUMB_OFFSET,
-
-/* Pc-relative or absolute relocation depending on target. Used for
-entries in .init_array sections. */
- BFD_RELOC_ARM_TARGET1,
-
-/* Read-only segment base relative address. */
- BFD_RELOC_ARM_ROSEGREL32,
-
-/* Data segment base relative address. */
- BFD_RELOC_ARM_SBREL32,
-
-/* This reloc is used for references to RTTI data from exception handling
-tables. The actual definition depends on the target. It may be a
-pc-relative or some form of GOT-indirect relocation. */
- BFD_RELOC_ARM_TARGET2,
-
-/* 31-bit PC relative address. */
- BFD_RELOC_ARM_PREL31,
-
-/* Low and High halfword relocations for MOVW and MOVT instructions. */
- BFD_RELOC_ARM_MOVW,
- BFD_RELOC_ARM_MOVT,
- BFD_RELOC_ARM_MOVW_PCREL,
- BFD_RELOC_ARM_MOVT_PCREL,
- BFD_RELOC_ARM_THUMB_MOVW,
- BFD_RELOC_ARM_THUMB_MOVT,
- BFD_RELOC_ARM_THUMB_MOVW_PCREL,
- BFD_RELOC_ARM_THUMB_MOVT_PCREL,
-
-/* Relocations for setting up GOTs and PLTs for shared libraries. */
- BFD_RELOC_ARM_JUMP_SLOT,
- BFD_RELOC_ARM_GLOB_DAT,
- BFD_RELOC_ARM_GOT32,
- BFD_RELOC_ARM_PLT32,
- BFD_RELOC_ARM_RELATIVE,
- BFD_RELOC_ARM_GOTOFF,
- BFD_RELOC_ARM_GOTPC,
-
-/* ARM thread-local storage relocations. */
- BFD_RELOC_ARM_TLS_GD32,
- BFD_RELOC_ARM_TLS_LDO32,
- BFD_RELOC_ARM_TLS_LDM32,
- BFD_RELOC_ARM_TLS_DTPOFF32,
- BFD_RELOC_ARM_TLS_DTPMOD32,
- BFD_RELOC_ARM_TLS_TPOFF32,
- BFD_RELOC_ARM_TLS_IE32,
- BFD_RELOC_ARM_TLS_LE32,
-
-/* ARM group relocations. */
- BFD_RELOC_ARM_ALU_PC_G0_NC,
- BFD_RELOC_ARM_ALU_PC_G0,
- BFD_RELOC_ARM_ALU_PC_G1_NC,
- BFD_RELOC_ARM_ALU_PC_G1,
- BFD_RELOC_ARM_ALU_PC_G2,
- BFD_RELOC_ARM_LDR_PC_G0,
- BFD_RELOC_ARM_LDR_PC_G1,
- BFD_RELOC_ARM_LDR_PC_G2,
- BFD_RELOC_ARM_LDRS_PC_G0,
- BFD_RELOC_ARM_LDRS_PC_G1,
- BFD_RELOC_ARM_LDRS_PC_G2,
- BFD_RELOC_ARM_LDC_PC_G0,
- BFD_RELOC_ARM_LDC_PC_G1,
- BFD_RELOC_ARM_LDC_PC_G2,
- BFD_RELOC_ARM_ALU_SB_G0_NC,
- BFD_RELOC_ARM_ALU_SB_G0,
- BFD_RELOC_ARM_ALU_SB_G1_NC,
- BFD_RELOC_ARM_ALU_SB_G1,
- BFD_RELOC_ARM_ALU_SB_G2,
- BFD_RELOC_ARM_LDR_SB_G0,
- BFD_RELOC_ARM_LDR_SB_G1,
- BFD_RELOC_ARM_LDR_SB_G2,
- BFD_RELOC_ARM_LDRS_SB_G0,
- BFD_RELOC_ARM_LDRS_SB_G1,
- BFD_RELOC_ARM_LDRS_SB_G2,
- BFD_RELOC_ARM_LDC_SB_G0,
- BFD_RELOC_ARM_LDC_SB_G1,
- BFD_RELOC_ARM_LDC_SB_G2,
-
-/* These relocs are only used within the ARM assembler. They are not
-(at present) written to any object files. */
- BFD_RELOC_ARM_IMMEDIATE,
- BFD_RELOC_ARM_ADRL_IMMEDIATE,
- BFD_RELOC_ARM_T32_IMMEDIATE,
- BFD_RELOC_ARM_T32_ADD_IMM,
- BFD_RELOC_ARM_T32_IMM12,
- BFD_RELOC_ARM_T32_ADD_PC12,
- BFD_RELOC_ARM_SHIFT_IMM,
- BFD_RELOC_ARM_SMC,
- BFD_RELOC_ARM_SWI,
- BFD_RELOC_ARM_MULTI,
- BFD_RELOC_ARM_CP_OFF_IMM,
- BFD_RELOC_ARM_CP_OFF_IMM_S2,
- BFD_RELOC_ARM_T32_CP_OFF_IMM,
- BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
- BFD_RELOC_ARM_ADR_IMM,
- BFD_RELOC_ARM_LDR_IMM,
- BFD_RELOC_ARM_LITERAL,
- BFD_RELOC_ARM_IN_POOL,
- BFD_RELOC_ARM_OFFSET_IMM8,
- BFD_RELOC_ARM_T32_OFFSET_U8,
- BFD_RELOC_ARM_T32_OFFSET_IMM,
- BFD_RELOC_ARM_HWLITERAL,
- BFD_RELOC_ARM_THUMB_ADD,
- BFD_RELOC_ARM_THUMB_IMM,
- BFD_RELOC_ARM_THUMB_SHIFT,
-
-/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
- BFD_RELOC_SH_PCDISP8BY2,
- BFD_RELOC_SH_PCDISP12BY2,
- BFD_RELOC_SH_IMM3,
- BFD_RELOC_SH_IMM3U,
- BFD_RELOC_SH_DISP12,
- BFD_RELOC_SH_DISP12BY2,
- BFD_RELOC_SH_DISP12BY4,
- BFD_RELOC_SH_DISP12BY8,
- BFD_RELOC_SH_DISP20,
- BFD_RELOC_SH_DISP20BY8,
- BFD_RELOC_SH_IMM4,
- BFD_RELOC_SH_IMM4BY2,
- BFD_RELOC_SH_IMM4BY4,
- BFD_RELOC_SH_IMM8,
- BFD_RELOC_SH_IMM8BY2,
- BFD_RELOC_SH_IMM8BY4,
- BFD_RELOC_SH_PCRELIMM8BY2,
- BFD_RELOC_SH_PCRELIMM8BY4,
- BFD_RELOC_SH_SWITCH16,
- BFD_RELOC_SH_SWITCH32,
- BFD_RELOC_SH_USES,
- BFD_RELOC_SH_COUNT,
- BFD_RELOC_SH_ALIGN,
- BFD_RELOC_SH_CODE,
- BFD_RELOC_SH_DATA,
- BFD_RELOC_SH_LABEL,
- BFD_RELOC_SH_LOOP_START,
- BFD_RELOC_SH_LOOP_END,
- BFD_RELOC_SH_COPY,
- BFD_RELOC_SH_GLOB_DAT,
- BFD_RELOC_SH_JMP_SLOT,
- BFD_RELOC_SH_RELATIVE,
- BFD_RELOC_SH_GOTPC,
- BFD_RELOC_SH_GOT_LOW16,
- BFD_RELOC_SH_GOT_MEDLOW16,
- BFD_RELOC_SH_GOT_MEDHI16,
- BFD_RELOC_SH_GOT_HI16,
- BFD_RELOC_SH_GOTPLT_LOW16,
- BFD_RELOC_SH_GOTPLT_MEDLOW16,
- BFD_RELOC_SH_GOTPLT_MEDHI16,
- BFD_RELOC_SH_GOTPLT_HI16,
- BFD_RELOC_SH_PLT_LOW16,
- BFD_RELOC_SH_PLT_MEDLOW16,
- BFD_RELOC_SH_PLT_MEDHI16,
- BFD_RELOC_SH_PLT_HI16,
- BFD_RELOC_SH_GOTOFF_LOW16,
- BFD_RELOC_SH_GOTOFF_MEDLOW16,
- BFD_RELOC_SH_GOTOFF_MEDHI16,
- BFD_RELOC_SH_GOTOFF_HI16,
- BFD_RELOC_SH_GOTPC_LOW16,
- BFD_RELOC_SH_GOTPC_MEDLOW16,
- BFD_RELOC_SH_GOTPC_MEDHI16,
- BFD_RELOC_SH_GOTPC_HI16,
- BFD_RELOC_SH_COPY64,
- BFD_RELOC_SH_GLOB_DAT64,
- BFD_RELOC_SH_JMP_SLOT64,
- BFD_RELOC_SH_RELATIVE64,
- BFD_RELOC_SH_GOT10BY4,
- BFD_RELOC_SH_GOT10BY8,
- BFD_RELOC_SH_GOTPLT10BY4,
- BFD_RELOC_SH_GOTPLT10BY8,
- BFD_RELOC_SH_GOTPLT32,
- BFD_RELOC_SH_SHMEDIA_CODE,
- BFD_RELOC_SH_IMMU5,
- BFD_RELOC_SH_IMMS6,
- BFD_RELOC_SH_IMMS6BY32,
- BFD_RELOC_SH_IMMU6,
- BFD_RELOC_SH_IMMS10,
- BFD_RELOC_SH_IMMS10BY2,
- BFD_RELOC_SH_IMMS10BY4,
- BFD_RELOC_SH_IMMS10BY8,
- BFD_RELOC_SH_IMMS16,
- BFD_RELOC_SH_IMMU16,
- BFD_RELOC_SH_IMM_LOW16,
- BFD_RELOC_SH_IMM_LOW16_PCREL,
- BFD_RELOC_SH_IMM_MEDLOW16,
- BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
- BFD_RELOC_SH_IMM_MEDHI16,
- BFD_RELOC_SH_IMM_MEDHI16_PCREL,
- BFD_RELOC_SH_IMM_HI16,
- BFD_RELOC_SH_IMM_HI16_PCREL,
- BFD_RELOC_SH_PT_16,
- BFD_RELOC_SH_TLS_GD_32,
- BFD_RELOC_SH_TLS_LD_32,
- BFD_RELOC_SH_TLS_LDO_32,
- BFD_RELOC_SH_TLS_IE_32,
- BFD_RELOC_SH_TLS_LE_32,
- BFD_RELOC_SH_TLS_DTPMOD32,
- BFD_RELOC_SH_TLS_DTPOFF32,
- BFD_RELOC_SH_TLS_TPOFF32,
-
-/* ARC Cores relocs.
-ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
-not stored in the instruction. The high 20 bits are installed in bits 26
-through 7 of the instruction. */
- BFD_RELOC_ARC_B22_PCREL,
-
-/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not
-stored in the instruction. The high 24 bits are installed in bits 23
-through 0. */
- BFD_RELOC_ARC_B26,
-
-/* ADI Blackfin 16 bit immediate absolute reloc. */
- BFD_RELOC_BFIN_16_IMM,
-
-/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
- BFD_RELOC_BFIN_16_HIGH,
-
-/* ADI Blackfin 'a' part of LSETUP. */
- BFD_RELOC_BFIN_4_PCREL,
-
-/* ADI Blackfin. */
- BFD_RELOC_BFIN_5_PCREL,
-
-/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
- BFD_RELOC_BFIN_16_LOW,
-
-/* ADI Blackfin. */
- BFD_RELOC_BFIN_10_PCREL,
-
-/* ADI Blackfin 'b' part of LSETUP. */
- BFD_RELOC_BFIN_11_PCREL,
-
-/* ADI Blackfin. */
- BFD_RELOC_BFIN_12_PCREL_JUMP,
-
-/* ADI Blackfin Short jump, pcrel. */
- BFD_RELOC_BFIN_12_PCREL_JUMP_S,
-
-/* ADI Blackfin Call.x not implemented. */
- BFD_RELOC_BFIN_24_PCREL_CALL_X,
-
-/* ADI Blackfin Long Jump pcrel. */
- BFD_RELOC_BFIN_24_PCREL_JUMP_L,
-
-/* ADI Blackfin FD-PIC relocations. */
- BFD_RELOC_BFIN_GOT17M4,
- BFD_RELOC_BFIN_GOTHI,
- BFD_RELOC_BFIN_GOTLO,
- BFD_RELOC_BFIN_FUNCDESC,
- BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
- BFD_RELOC_BFIN_FUNCDESC_GOTHI,
- BFD_RELOC_BFIN_FUNCDESC_GOTLO,
- BFD_RELOC_BFIN_FUNCDESC_VALUE,
- BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
- BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
- BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
- BFD_RELOC_BFIN_GOTOFF17M4,
- BFD_RELOC_BFIN_GOTOFFHI,
- BFD_RELOC_BFIN_GOTOFFLO,
-
-/* ADI Blackfin GOT relocation. */
- BFD_RELOC_BFIN_GOT,
-
-/* ADI Blackfin PLTPC relocation. */
- BFD_RELOC_BFIN_PLTPC,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_PUSH,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_CONST,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_ADD,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_SUB,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_MULT,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_DIV,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_MOD,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_LSHIFT,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_RSHIFT,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_AND,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_OR,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_XOR,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_LAND,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_LOR,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_LEN,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_NEG,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_COMP,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_PAGE,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_HWPAGE,
-
-/* ADI Blackfin arithmetic relocation. */
- BFD_ARELOC_BFIN_ADDR,
-
-/* Mitsubishi D10V relocs.
-This is a 10-bit reloc with the right 2 bits
-assumed to be 0. */
- BFD_RELOC_D10V_10_PCREL_R,
-
-/* Mitsubishi D10V relocs.
-This is a 10-bit reloc with the right 2 bits
-assumed to be 0. This is the same as the previous reloc
-except it is in the left container, i.e.,
-shifted left 15 bits. */
- BFD_RELOC_D10V_10_PCREL_L,
-
-/* This is an 18-bit reloc with the right 2 bits
-assumed to be 0. */
- BFD_RELOC_D10V_18,
-
-/* This is an 18-bit reloc with the right 2 bits
-assumed to be 0. */
- BFD_RELOC_D10V_18_PCREL,
-
-/* Mitsubishi D30V relocs.
-This is a 6-bit absolute reloc. */
- BFD_RELOC_D30V_6,
-
-/* This is a 6-bit pc-relative reloc with
-the right 3 bits assumed to be 0. */
- BFD_RELOC_D30V_9_PCREL,
-
-/* This is a 6-bit pc-relative reloc with
-the right 3 bits assumed to be 0. Same
-as the previous reloc but on the right side
-of the container. */
- BFD_RELOC_D30V_9_PCREL_R,
-
-/* This is a 12-bit absolute reloc with the
-right 3 bitsassumed to be 0. */
- BFD_RELOC_D30V_15,
-
-/* This is a 12-bit pc-relative reloc with
-the right 3 bits assumed to be 0. */
- BFD_RELOC_D30V_15_PCREL,
-
-/* This is a 12-bit pc-relative reloc with
-the right 3 bits assumed to be 0. Same
-as the previous reloc but on the right side
-of the container. */
- BFD_RELOC_D30V_15_PCREL_R,
-
-/* This is an 18-bit absolute reloc with
-the right 3 bits assumed to be 0. */
- BFD_RELOC_D30V_21,
-
-/* This is an 18-bit pc-relative reloc with
-the right 3 bits assumed to be 0. */
- BFD_RELOC_D30V_21_PCREL,
-
-/* This is an 18-bit pc-relative reloc with
-the right 3 bits assumed to be 0. Same
-as the previous reloc but on the right side
-of the container. */
- BFD_RELOC_D30V_21_PCREL_R,
-
-/* This is a 32-bit absolute reloc. */
- BFD_RELOC_D30V_32,
-
-/* This is a 32-bit pc-relative reloc. */
- BFD_RELOC_D30V_32_PCREL,
-
-/* DLX relocs */
- BFD_RELOC_DLX_HI16_S,
-
-/* DLX relocs */
- BFD_RELOC_DLX_LO16,
-
-/* DLX relocs */
- BFD_RELOC_DLX_JMP26,
-
-/* Renesas M16C/M32C Relocations. */
- BFD_RELOC_M32C_HI8,
- BFD_RELOC_M32C_RL_JUMP,
- BFD_RELOC_M32C_RL_1ADDR,
- BFD_RELOC_M32C_RL_2ADDR,
-
-/* Renesas M32R (formerly Mitsubishi M32R) relocs.
-This is a 24 bit absolute address. */
- BFD_RELOC_M32R_24,
-
-/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
- BFD_RELOC_M32R_10_PCREL,
-
-/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
- BFD_RELOC_M32R_18_PCREL,
-
-/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
- BFD_RELOC_M32R_26_PCREL,
-
-/* This is a 16-bit reloc containing the high 16 bits of an address
-used when the lower 16 bits are treated as unsigned. */
- BFD_RELOC_M32R_HI16_ULO,
-
-/* This is a 16-bit reloc containing the high 16 bits of an address
-used when the lower 16 bits are treated as signed. */
- BFD_RELOC_M32R_HI16_SLO,
-
-/* This is a 16-bit reloc containing the lower 16 bits of an address. */
- BFD_RELOC_M32R_LO16,
-
-/* This is a 16-bit reloc containing the small data area offset for use in
-add3, load, and store instructions. */
- BFD_RELOC_M32R_SDA16,
-
-/* For PIC. */
- BFD_RELOC_M32R_GOT24,
- BFD_RELOC_M32R_26_PLTREL,
- BFD_RELOC_M32R_COPY,
- BFD_RELOC_M32R_GLOB_DAT,
- BFD_RELOC_M32R_JMP_SLOT,
- BFD_RELOC_M32R_RELATIVE,
- BFD_RELOC_M32R_GOTOFF,
- BFD_RELOC_M32R_GOTOFF_HI_ULO,
- BFD_RELOC_M32R_GOTOFF_HI_SLO,
- BFD_RELOC_M32R_GOTOFF_LO,
- BFD_RELOC_M32R_GOTPC24,
- BFD_RELOC_M32R_GOT16_HI_ULO,
- BFD_RELOC_M32R_GOT16_HI_SLO,
- BFD_RELOC_M32R_GOT16_LO,
- BFD_RELOC_M32R_GOTPC_HI_ULO,
- BFD_RELOC_M32R_GOTPC_HI_SLO,
- BFD_RELOC_M32R_GOTPC_LO,
-
-/* This is a 9-bit reloc */
- BFD_RELOC_V850_9_PCREL,
-
-/* This is a 22-bit reloc */
- BFD_RELOC_V850_22_PCREL,
-
-/* This is a 16 bit offset from the short data area pointer. */
- BFD_RELOC_V850_SDA_16_16_OFFSET,
-
-/* This is a 16 bit offset (of which only 15 bits are used) from the
-short data area pointer. */
- BFD_RELOC_V850_SDA_15_16_OFFSET,
-
-/* This is a 16 bit offset from the zero data area pointer. */
- BFD_RELOC_V850_ZDA_16_16_OFFSET,
-
-/* This is a 16 bit offset (of which only 15 bits are used) from the
-zero data area pointer. */
- BFD_RELOC_V850_ZDA_15_16_OFFSET,
-
-/* This is an 8 bit offset (of which only 6 bits are used) from the
-tiny data area pointer. */
- BFD_RELOC_V850_TDA_6_8_OFFSET,
-
-/* This is an 8bit offset (of which only 7 bits are used) from the tiny
-data area pointer. */
- BFD_RELOC_V850_TDA_7_8_OFFSET,
-
-/* This is a 7 bit offset from the tiny data area pointer. */
- BFD_RELOC_V850_TDA_7_7_OFFSET,
-
-/* This is a 16 bit offset from the tiny data area pointer. */
- BFD_RELOC_V850_TDA_16_16_OFFSET,
-
-/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
-data area pointer. */
- BFD_RELOC_V850_TDA_4_5_OFFSET,
-
-/* This is a 4 bit offset from the tiny data area pointer. */
- BFD_RELOC_V850_TDA_4_4_OFFSET,
-
-/* This is a 16 bit offset from the short data area pointer, with the
-bits placed non-contiguously in the instruction. */
- BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
-
-/* This is a 16 bit offset from the zero data area pointer, with the
-bits placed non-contiguously in the instruction. */
- BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
-
-/* This is a 6 bit offset from the call table base pointer. */
- BFD_RELOC_V850_CALLT_6_7_OFFSET,
-
-/* This is a 16 bit offset from the call table base pointer. */
- BFD_RELOC_V850_CALLT_16_16_OFFSET,
-
-/* Used for relaxing indirect function calls. */
- BFD_RELOC_V850_LONGCALL,
-
-/* Used for relaxing indirect jumps. */
- BFD_RELOC_V850_LONGJUMP,
-
-/* Used to maintain alignment whilst relaxing. */
- BFD_RELOC_V850_ALIGN,
-
-/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
-instructions. */
- BFD_RELOC_V850_LO16_SPLIT_OFFSET,
-
-/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
-instruction. */
- BFD_RELOC_MN10300_32_PCREL,
-
-/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
-instruction. */
- BFD_RELOC_MN10300_16_PCREL,
-
-/* This is a 8bit DP reloc for the tms320c30, where the most
-significant 8 bits of a 24 bit word are placed into the least
-significant 8 bits of the opcode. */
- BFD_RELOC_TIC30_LDP,
-
-/* This is a 7bit reloc for the tms320c54x, where the least
-significant 7 bits of a 16 bit word are placed into the least
-significant 7 bits of the opcode. */
- BFD_RELOC_TIC54X_PARTLS7,
-
-/* This is a 9bit DP reloc for the tms320c54x, where the most
-significant 9 bits of a 16 bit word are placed into the least
-significant 9 bits of the opcode. */
- BFD_RELOC_TIC54X_PARTMS9,
-
-/* This is an extended address 23-bit reloc for the tms320c54x. */
- BFD_RELOC_TIC54X_23,
-
-/* This is a 16-bit reloc for the tms320c54x, where the least
-significant 16 bits of a 23-bit extended address are placed into
-the opcode. */
- BFD_RELOC_TIC54X_16_OF_23,
-
-/* This is a reloc for the tms320c54x, where the most
-significant 7 bits of a 23-bit extended address are placed into
-the opcode. */
- BFD_RELOC_TIC54X_MS7_OF_23,
-
-/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
- BFD_RELOC_FR30_48,
-
-/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
-two sections. */
- BFD_RELOC_FR30_20,
-
-/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
-4 bits. */
- BFD_RELOC_FR30_6_IN_4,
-
-/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
-into 8 bits. */
- BFD_RELOC_FR30_8_IN_8,
-
-/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
-into 8 bits. */
- BFD_RELOC_FR30_9_IN_8,
-
-/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
-into 8 bits. */
- BFD_RELOC_FR30_10_IN_8,
-
-/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
-short offset into 8 bits. */
- BFD_RELOC_FR30_9_PCREL,
-
-/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
-short offset into 11 bits. */
- BFD_RELOC_FR30_12_PCREL,
-
-/* Motorola Mcore relocations. */
- BFD_RELOC_MCORE_PCREL_IMM8BY4,
- BFD_RELOC_MCORE_PCREL_IMM11BY2,
- BFD_RELOC_MCORE_PCREL_IMM4BY2,
- BFD_RELOC_MCORE_PCREL_32,
- BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
- BFD_RELOC_MCORE_RVA,
-
-/* Toshiba Media Processor Relocations. */
- BFD_RELOC_MEP_8,
- BFD_RELOC_MEP_16,
- BFD_RELOC_MEP_32,
- BFD_RELOC_MEP_PCREL8A2,
- BFD_RELOC_MEP_PCREL12A2,
- BFD_RELOC_MEP_PCREL17A2,
- BFD_RELOC_MEP_PCREL24A2,
- BFD_RELOC_MEP_PCABS24A2,
- BFD_RELOC_MEP_LOW16,
- BFD_RELOC_MEP_HI16U,
- BFD_RELOC_MEP_HI16S,
- BFD_RELOC_MEP_GPREL,
- BFD_RELOC_MEP_TPREL,
- BFD_RELOC_MEP_TPREL7,
- BFD_RELOC_MEP_TPREL7A2,
- BFD_RELOC_MEP_TPREL7A4,
- BFD_RELOC_MEP_UIMM24,
- BFD_RELOC_MEP_ADDR24A4,
- BFD_RELOC_MEP_GNU_VTINHERIT,
- BFD_RELOC_MEP_GNU_VTENTRY,
-
-
-/* These are relocations for the GETA instruction. */
- BFD_RELOC_MMIX_GETA,
- BFD_RELOC_MMIX_GETA_1,
- BFD_RELOC_MMIX_GETA_2,
- BFD_RELOC_MMIX_GETA_3,
-
-/* These are relocations for a conditional branch instruction. */
- BFD_RELOC_MMIX_CBRANCH,
- BFD_RELOC_MMIX_CBRANCH_J,
- BFD_RELOC_MMIX_CBRANCH_1,
- BFD_RELOC_MMIX_CBRANCH_2,
- BFD_RELOC_MMIX_CBRANCH_3,
-
-/* These are relocations for the PUSHJ instruction. */
- BFD_RELOC_MMIX_PUSHJ,
- BFD_RELOC_MMIX_PUSHJ_1,
- BFD_RELOC_MMIX_PUSHJ_2,
- BFD_RELOC_MMIX_PUSHJ_3,
- BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
-
-/* These are relocations for the JMP instruction. */
- BFD_RELOC_MMIX_JMP,
- BFD_RELOC_MMIX_JMP_1,
- BFD_RELOC_MMIX_JMP_2,
- BFD_RELOC_MMIX_JMP_3,
-
-/* This is a relocation for a relative address as in a GETA instruction or
-a branch. */
- BFD_RELOC_MMIX_ADDR19,
-
-/* This is a relocation for a relative address as in a JMP instruction. */
- BFD_RELOC_MMIX_ADDR27,
-
-/* This is a relocation for an instruction field that may be a general
-register or a value 0..255. */
- BFD_RELOC_MMIX_REG_OR_BYTE,
-
-/* This is a relocation for an instruction field that may be a general
-register. */
- BFD_RELOC_MMIX_REG,
-
-/* This is a relocation for two instruction fields holding a register and
-an offset, the equivalent of the relocation. */
- BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
-
-/* This relocation is an assertion that the expression is not allocated as
-a global register. It does not modify contents. */
- BFD_RELOC_MMIX_LOCAL,
-
-/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
-short offset into 7 bits. */
- BFD_RELOC_AVR_7_PCREL,
-
-/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
-short offset into 12 bits. */
- BFD_RELOC_AVR_13_PCREL,
-
-/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
-program memory address) into 16 bits. */
- BFD_RELOC_AVR_16_PM,
-
-/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
-data memory address) into 8 bit immediate value of LDI insn. */
- BFD_RELOC_AVR_LO8_LDI,
-
-/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
-of data memory address) into 8 bit immediate value of LDI insn. */
- BFD_RELOC_AVR_HI8_LDI,
-
-/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
-of program memory address) into 8 bit immediate value of LDI insn. */
- BFD_RELOC_AVR_HH8_LDI,
-
-/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
-of 32 bit value) into 8 bit immediate value of LDI insn. */
- BFD_RELOC_AVR_MS8_LDI,
-
-/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
-(usually data memory address) into 8 bit immediate value of SUBI insn. */
- BFD_RELOC_AVR_LO8_LDI_NEG,
-
-/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
-(high 8 bit of data memory address) into 8 bit immediate value of
-SUBI insn. */
- BFD_RELOC_AVR_HI8_LDI_NEG,
-
-/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
-(most high 8 bit of program memory address) into 8 bit immediate value
-of LDI or SUBI insn. */
- BFD_RELOC_AVR_HH8_LDI_NEG,
-
-/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
-of 32 bit value) into 8 bit immediate value of LDI insn. */
- BFD_RELOC_AVR_MS8_LDI_NEG,
-
-/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
-command address) into 8 bit immediate value of LDI insn. */
- BFD_RELOC_AVR_LO8_LDI_PM,
-
-/* This is a 16 bit reloc for the AVR that stores 8 bit value
-(command address) into 8 bit immediate value of LDI insn. If the address
-is beyond the 128k boundary, the linker inserts a jump stub for this reloc
-in the lower 128k. */
- BFD_RELOC_AVR_LO8_LDI_GS,
-
-/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
-of command address) into 8 bit immediate value of LDI insn. */
- BFD_RELOC_AVR_HI8_LDI_PM,
-
-/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
-of command address) into 8 bit immediate value of LDI insn. If the address
-is beyond the 128k boundary, the linker inserts a jump stub for this reloc
-below 128k. */
- BFD_RELOC_AVR_HI8_LDI_GS,
-
-/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
-of command address) into 8 bit immediate value of LDI insn. */
- BFD_RELOC_AVR_HH8_LDI_PM,
-
-/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
-(usually command address) into 8 bit immediate value of SUBI insn. */
- BFD_RELOC_AVR_LO8_LDI_PM_NEG,
-
-/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
-(high 8 bit of 16 bit command address) into 8 bit immediate value
-of SUBI insn. */
- BFD_RELOC_AVR_HI8_LDI_PM_NEG,
-
-/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
-(high 6 bit of 22 bit command address) into 8 bit immediate
-value of SUBI insn. */
- BFD_RELOC_AVR_HH8_LDI_PM_NEG,
-
-/* This is a 32 bit reloc for the AVR that stores 23 bit value
-into 22 bits. */
- BFD_RELOC_AVR_CALL,
-
-/* This is a 16 bit reloc for the AVR that stores all needed bits
-for absolute addressing with ldi with overflow check to linktime */
- BFD_RELOC_AVR_LDI,
-
-/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
-instructions */
- BFD_RELOC_AVR_6,
-
-/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
-instructions */
- BFD_RELOC_AVR_6_ADIW,
-
-/* Direct 12 bit. */
- BFD_RELOC_390_12,
-
-/* 12 bit GOT offset. */
- BFD_RELOC_390_GOT12,
-
-/* 32 bit PC relative PLT address. */
- BFD_RELOC_390_PLT32,
-
-/* Copy symbol at runtime. */
- BFD_RELOC_390_COPY,
-
-/* Create GOT entry. */
- BFD_RELOC_390_GLOB_DAT,
-
-/* Create PLT entry. */
- BFD_RELOC_390_JMP_SLOT,
-
-/* Adjust by program base. */
- BFD_RELOC_390_RELATIVE,
-
-/* 32 bit PC relative offset to GOT. */
- BFD_RELOC_390_GOTPC,
-
-/* 16 bit GOT offset. */
- BFD_RELOC_390_GOT16,
-
-/* PC relative 16 bit shifted by 1. */
- BFD_RELOC_390_PC16DBL,
-
-/* 16 bit PC rel. PLT shifted by 1. */
- BFD_RELOC_390_PLT16DBL,
-
-/* PC relative 32 bit shifted by 1. */
- BFD_RELOC_390_PC32DBL,
-
-/* 32 bit PC rel. PLT shifted by 1. */
- BFD_RELOC_390_PLT32DBL,
-
-/* 32 bit PC rel. GOT shifted by 1. */
- BFD_RELOC_390_GOTPCDBL,
-
-/* 64 bit GOT offset. */
- BFD_RELOC_390_GOT64,
-
-/* 64 bit PC relative PLT address. */
- BFD_RELOC_390_PLT64,
-
-/* 32 bit rel. offset to GOT entry. */
- BFD_RELOC_390_GOTENT,
-
-/* 64 bit offset to GOT. */
- BFD_RELOC_390_GOTOFF64,
-
-/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
- BFD_RELOC_390_GOTPLT12,
-
-/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
- BFD_RELOC_390_GOTPLT16,
-
-/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
- BFD_RELOC_390_GOTPLT32,
-
-/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
- BFD_RELOC_390_GOTPLT64,
-
-/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
- BFD_RELOC_390_GOTPLTENT,
-
-/* 16-bit rel. offset from the GOT to a PLT entry. */
- BFD_RELOC_390_PLTOFF16,
-
-/* 32-bit rel. offset from the GOT to a PLT entry. */
- BFD_RELOC_390_PLTOFF32,
-
-/* 64-bit rel. offset from the GOT to a PLT entry. */
- BFD_RELOC_390_PLTOFF64,
-
-/* s390 tls relocations. */
- BFD_RELOC_390_TLS_LOAD,
- BFD_RELOC_390_TLS_GDCALL,
- BFD_RELOC_390_TLS_LDCALL,
- BFD_RELOC_390_TLS_GD32,
- BFD_RELOC_390_TLS_GD64,
- BFD_RELOC_390_TLS_GOTIE12,
- BFD_RELOC_390_TLS_GOTIE32,
- BFD_RELOC_390_TLS_GOTIE64,
- BFD_RELOC_390_TLS_LDM32,
- BFD_RELOC_390_TLS_LDM64,
- BFD_RELOC_390_TLS_IE32,
- BFD_RELOC_390_TLS_IE64,
- BFD_RELOC_390_TLS_IEENT,
- BFD_RELOC_390_TLS_LE32,
- BFD_RELOC_390_TLS_LE64,
- BFD_RELOC_390_TLS_LDO32,
- BFD_RELOC_390_TLS_LDO64,
- BFD_RELOC_390_TLS_DTPMOD,
- BFD_RELOC_390_TLS_DTPOFF,
- BFD_RELOC_390_TLS_TPOFF,
-
-/* Long displacement extension. */
- BFD_RELOC_390_20,
- BFD_RELOC_390_GOT20,
- BFD_RELOC_390_GOTPLT20,
- BFD_RELOC_390_TLS_GOTIE20,
-
-/* Score relocations */
- BFD_RELOC_SCORE_DUMMY1,
-
-/* Low 16 bit for load/store */
- BFD_RELOC_SCORE_GPREL15,
-
-/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
- BFD_RELOC_SCORE_DUMMY2,
- BFD_RELOC_SCORE_JMP,
-
-/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
- BFD_RELOC_SCORE_BRANCH,
-
-/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
- BFD_RELOC_SCORE16_JMP,
-
-/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
- BFD_RELOC_SCORE16_BRANCH,
-
-/* Undocumented Score relocs */
- BFD_RELOC_SCORE_GOT15,
- BFD_RELOC_SCORE_GOT_LO16,
- BFD_RELOC_SCORE_CALL15,
- BFD_RELOC_SCORE_DUMMY_HI16,
-
-/* Scenix IP2K - 9-bit register number / data address */
- BFD_RELOC_IP2K_FR9,
-
-/* Scenix IP2K - 4-bit register/data bank number */
- BFD_RELOC_IP2K_BANK,
-
-/* Scenix IP2K - low 13 bits of instruction word address */
- BFD_RELOC_IP2K_ADDR16CJP,
-
-/* Scenix IP2K - high 3 bits of instruction word address */
- BFD_RELOC_IP2K_PAGE3,
-
-/* Scenix IP2K - ext/low/high 8 bits of data address */
- BFD_RELOC_IP2K_LO8DATA,
- BFD_RELOC_IP2K_HI8DATA,
- BFD_RELOC_IP2K_EX8DATA,
-
-/* Scenix IP2K - low/high 8 bits of instruction word address */
- BFD_RELOC_IP2K_LO8INSN,
- BFD_RELOC_IP2K_HI8INSN,
-
-/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
- BFD_RELOC_IP2K_PC_SKIP,
-
-/* Scenix IP2K - 16 bit word address in text section. */
- BFD_RELOC_IP2K_TEXT,
-
-/* Scenix IP2K - 7-bit sp or dp offset */
- BFD_RELOC_IP2K_FR_OFFSET,
-
-/* Scenix VPE4K coprocessor - data/insn-space addressing */
- BFD_RELOC_VPE4KMATH_DATA,
- BFD_RELOC_VPE4KMATH_INSN,
-
-/* These two relocations are used by the linker to determine which of
-the entries in a C++ virtual function table are actually used. When
-the --gc-sections option is given, the linker will zero out the entries
-that are not used, so that the code for those functions need not be
-included in the output.
-
-VTABLE_INHERIT is a zero-space relocation used to describe to the
-linker the inheritance tree of a C++ virtual function table. The
-relocation's symbol should be the parent class' vtable, and the
-relocation should be located at the child vtable.
-
-VTABLE_ENTRY is a zero-space relocation that describes the use of a
-virtual function table entry. The reloc's symbol should refer to the
-table of the class mentioned in the code. Off of that base, an offset
-describes the entry that is being used. For Rela hosts, this offset
-is stored in the reloc's addend. For Rel hosts, we are forced to put
-this offset in the reloc's section offset. */
- BFD_RELOC_VTABLE_INHERIT,
- BFD_RELOC_VTABLE_ENTRY,
-
-/* Intel IA64 Relocations. */
- BFD_RELOC_IA64_IMM14,
- BFD_RELOC_IA64_IMM22,
- BFD_RELOC_IA64_IMM64,
- BFD_RELOC_IA64_DIR32MSB,
- BFD_RELOC_IA64_DIR32LSB,
- BFD_RELOC_IA64_DIR64MSB,
- BFD_RELOC_IA64_DIR64LSB,
- BFD_RELOC_IA64_GPREL22,
- BFD_RELOC_IA64_GPREL64I,
- BFD_RELOC_IA64_GPREL32MSB,
- BFD_RELOC_IA64_GPREL32LSB,
- BFD_RELOC_IA64_GPREL64MSB,
- BFD_RELOC_IA64_GPREL64LSB,
- BFD_RELOC_IA64_LTOFF22,
- BFD_RELOC_IA64_LTOFF64I,
- BFD_RELOC_IA64_PLTOFF22,
- BFD_RELOC_IA64_PLTOFF64I,
- BFD_RELOC_IA64_PLTOFF64MSB,
- BFD_RELOC_IA64_PLTOFF64LSB,
- BFD_RELOC_IA64_FPTR64I,
- BFD_RELOC_IA64_FPTR32MSB,
- BFD_RELOC_IA64_FPTR32LSB,
- BFD_RELOC_IA64_FPTR64MSB,
- BFD_RELOC_IA64_FPTR64LSB,
- BFD_RELOC_IA64_PCREL21B,
- BFD_RELOC_IA64_PCREL21BI,
- BFD_RELOC_IA64_PCREL21M,
- BFD_RELOC_IA64_PCREL21F,
- BFD_RELOC_IA64_PCREL22,
- BFD_RELOC_IA64_PCREL60B,
- BFD_RELOC_IA64_PCREL64I,
- BFD_RELOC_IA64_PCREL32MSB,
- BFD_RELOC_IA64_PCREL32LSB,
- BFD_RELOC_IA64_PCREL64MSB,
- BFD_RELOC_IA64_PCREL64LSB,
- BFD_RELOC_IA64_LTOFF_FPTR22,
- BFD_RELOC_IA64_LTOFF_FPTR64I,
- BFD_RELOC_IA64_LTOFF_FPTR32MSB,
- BFD_RELOC_IA64_LTOFF_FPTR32LSB,
- BFD_RELOC_IA64_LTOFF_FPTR64MSB,
- BFD_RELOC_IA64_LTOFF_FPTR64LSB,
- BFD_RELOC_IA64_SEGREL32MSB,
- BFD_RELOC_IA64_SEGREL32LSB,
- BFD_RELOC_IA64_SEGREL64MSB,
- BFD_RELOC_IA64_SEGREL64LSB,
- BFD_RELOC_IA64_SECREL32MSB,
- BFD_RELOC_IA64_SECREL32LSB,
- BFD_RELOC_IA64_SECREL64MSB,
- BFD_RELOC_IA64_SECREL64LSB,
- BFD_RELOC_IA64_REL32MSB,
- BFD_RELOC_IA64_REL32LSB,
- BFD_RELOC_IA64_REL64MSB,
- BFD_RELOC_IA64_REL64LSB,
- BFD_RELOC_IA64_LTV32MSB,
- BFD_RELOC_IA64_LTV32LSB,
- BFD_RELOC_IA64_LTV64MSB,
- BFD_RELOC_IA64_LTV64LSB,
- BFD_RELOC_IA64_IPLTMSB,
- BFD_RELOC_IA64_IPLTLSB,
- BFD_RELOC_IA64_COPY,
- BFD_RELOC_IA64_LTOFF22X,
- BFD_RELOC_IA64_LDXMOV,
- BFD_RELOC_IA64_TPREL14,
- BFD_RELOC_IA64_TPREL22,
- BFD_RELOC_IA64_TPREL64I,
- BFD_RELOC_IA64_TPREL64MSB,
- BFD_RELOC_IA64_TPREL64LSB,
- BFD_RELOC_IA64_LTOFF_TPREL22,
- BFD_RELOC_IA64_DTPMOD64MSB,
- BFD_RELOC_IA64_DTPMOD64LSB,
- BFD_RELOC_IA64_LTOFF_DTPMOD22,
- BFD_RELOC_IA64_DTPREL14,
- BFD_RELOC_IA64_DTPREL22,
- BFD_RELOC_IA64_DTPREL64I,
- BFD_RELOC_IA64_DTPREL32MSB,
- BFD_RELOC_IA64_DTPREL32LSB,
- BFD_RELOC_IA64_DTPREL64MSB,
- BFD_RELOC_IA64_DTPREL64LSB,
- BFD_RELOC_IA64_LTOFF_DTPREL22,
-
-/* Motorola 68HC11 reloc.
-This is the 8 bit high part of an absolute address. */
- BFD_RELOC_M68HC11_HI8,
-
-/* Motorola 68HC11 reloc.
-This is the 8 bit low part of an absolute address. */
- BFD_RELOC_M68HC11_LO8,
-
-/* Motorola 68HC11 reloc.
-This is the 3 bit of a value. */
- BFD_RELOC_M68HC11_3B,
-
-/* Motorola 68HC11 reloc.
-This reloc marks the beginning of a jump/call instruction.
-It is used for linker relaxation to correctly identify beginning
-of instruction and change some branches to use PC-relative
-addressing mode. */
- BFD_RELOC_M68HC11_RL_JUMP,
-
-/* Motorola 68HC11 reloc.
-This reloc marks a group of several instructions that gcc generates
-and for which the linker relaxation pass can modify and/or remove
-some of them. */
- BFD_RELOC_M68HC11_RL_GROUP,
-
-/* Motorola 68HC11 reloc.
-This is the 16-bit lower part of an address. It is used for 'call'
-instruction to specify the symbol address without any special
-transformation (due to memory bank window). */
- BFD_RELOC_M68HC11_LO16,
-
-/* Motorola 68HC11 reloc.
-This is a 8-bit reloc that specifies the page number of an address.
-It is used by 'call' instruction to specify the page number of
-the symbol. */
- BFD_RELOC_M68HC11_PAGE,
-
-/* Motorola 68HC11 reloc.
-This is a 24-bit reloc that represents the address with a 16-bit
-value and a 8-bit page number. The symbol address is transformed
-to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
- BFD_RELOC_M68HC11_24,
-
-/* Motorola 68HC12 reloc.
-This is the 5 bits of a value. */
- BFD_RELOC_M68HC12_5B,
-
-/* NS CR16C Relocations. */
- BFD_RELOC_16C_NUM08,
- BFD_RELOC_16C_NUM08_C,
- BFD_RELOC_16C_NUM16,
- BFD_RELOC_16C_NUM16_C,
- BFD_RELOC_16C_NUM32,
- BFD_RELOC_16C_NUM32_C,
- BFD_RELOC_16C_DISP04,
- BFD_RELOC_16C_DISP04_C,
- BFD_RELOC_16C_DISP08,
- BFD_RELOC_16C_DISP08_C,
- BFD_RELOC_16C_DISP16,
- BFD_RELOC_16C_DISP16_C,
- BFD_RELOC_16C_DISP24,
- BFD_RELOC_16C_DISP24_C,
- BFD_RELOC_16C_DISP24a,
- BFD_RELOC_16C_DISP24a_C,
- BFD_RELOC_16C_REG04,
- BFD_RELOC_16C_REG04_C,
- BFD_RELOC_16C_REG04a,
- BFD_RELOC_16C_REG04a_C,
- BFD_RELOC_16C_REG14,
- BFD_RELOC_16C_REG14_C,
- BFD_RELOC_16C_REG16,
- BFD_RELOC_16C_REG16_C,
- BFD_RELOC_16C_REG20,
- BFD_RELOC_16C_REG20_C,
- BFD_RELOC_16C_ABS20,
- BFD_RELOC_16C_ABS20_C,
- BFD_RELOC_16C_ABS24,
- BFD_RELOC_16C_ABS24_C,
- BFD_RELOC_16C_IMM04,
- BFD_RELOC_16C_IMM04_C,
- BFD_RELOC_16C_IMM16,
- BFD_RELOC_16C_IMM16_C,
- BFD_RELOC_16C_IMM20,
- BFD_RELOC_16C_IMM20_C,
- BFD_RELOC_16C_IMM24,
- BFD_RELOC_16C_IMM24_C,
- BFD_RELOC_16C_IMM32,
- BFD_RELOC_16C_IMM32_C,
-
-/* NS CR16 Relocations. */
- BFD_RELOC_CR16_NUM8,
- BFD_RELOC_CR16_NUM16,
- BFD_RELOC_CR16_NUM32,
- BFD_RELOC_CR16_NUM32a,
- BFD_RELOC_CR16_REGREL0,
- BFD_RELOC_CR16_REGREL4,
- BFD_RELOC_CR16_REGREL4a,
- BFD_RELOC_CR16_REGREL14,
- BFD_RELOC_CR16_REGREL14a,
- BFD_RELOC_CR16_REGREL16,
- BFD_RELOC_CR16_REGREL20,
- BFD_RELOC_CR16_REGREL20a,
- BFD_RELOC_CR16_ABS20,
- BFD_RELOC_CR16_ABS24,
- BFD_RELOC_CR16_IMM4,
- BFD_RELOC_CR16_IMM8,
- BFD_RELOC_CR16_IMM16,
- BFD_RELOC_CR16_IMM20,
- BFD_RELOC_CR16_IMM24,
- BFD_RELOC_CR16_IMM32,
- BFD_RELOC_CR16_IMM32a,
- BFD_RELOC_CR16_DISP4,
- BFD_RELOC_CR16_DISP8,
- BFD_RELOC_CR16_DISP16,
- BFD_RELOC_CR16_DISP20,
- BFD_RELOC_CR16_DISP24,
- BFD_RELOC_CR16_DISP24a,
-
-/* NS CRX Relocations. */
- BFD_RELOC_CRX_REL4,
- BFD_RELOC_CRX_REL8,
- BFD_RELOC_CRX_REL8_CMP,
- BFD_RELOC_CRX_REL16,
- BFD_RELOC_CRX_REL24,
- BFD_RELOC_CRX_REL32,
- BFD_RELOC_CRX_REGREL12,
- BFD_RELOC_CRX_REGREL22,
- BFD_RELOC_CRX_REGREL28,
- BFD_RELOC_CRX_REGREL32,
- BFD_RELOC_CRX_ABS16,
- BFD_RELOC_CRX_ABS32,
- BFD_RELOC_CRX_NUM8,
- BFD_RELOC_CRX_NUM16,
- BFD_RELOC_CRX_NUM32,
- BFD_RELOC_CRX_IMM16,
- BFD_RELOC_CRX_IMM32,
- BFD_RELOC_CRX_SWITCH8,
- BFD_RELOC_CRX_SWITCH16,
- BFD_RELOC_CRX_SWITCH32,
-
-/* These relocs are only used within the CRIS assembler. They are not
-(at present) written to any object files. */
- BFD_RELOC_CRIS_BDISP8,
- BFD_RELOC_CRIS_UNSIGNED_5,
- BFD_RELOC_CRIS_SIGNED_6,
- BFD_RELOC_CRIS_UNSIGNED_6,
- BFD_RELOC_CRIS_SIGNED_8,
- BFD_RELOC_CRIS_UNSIGNED_8,
- BFD_RELOC_CRIS_SIGNED_16,
- BFD_RELOC_CRIS_UNSIGNED_16,
- BFD_RELOC_CRIS_LAPCQ_OFFSET,
- BFD_RELOC_CRIS_UNSIGNED_4,
-
-/* Relocs used in ELF shared libraries for CRIS. */
- BFD_RELOC_CRIS_COPY,
- BFD_RELOC_CRIS_GLOB_DAT,
- BFD_RELOC_CRIS_JUMP_SLOT,
- BFD_RELOC_CRIS_RELATIVE,
-
-/* 32-bit offset to symbol-entry within GOT. */
- BFD_RELOC_CRIS_32_GOT,
-
-/* 16-bit offset to symbol-entry within GOT. */
- BFD_RELOC_CRIS_16_GOT,
-
-/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
- BFD_RELOC_CRIS_32_GOTPLT,
-
-/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
- BFD_RELOC_CRIS_16_GOTPLT,
-
-/* 32-bit offset to symbol, relative to GOT. */
- BFD_RELOC_CRIS_32_GOTREL,
-
-/* 32-bit offset to symbol with PLT entry, relative to GOT. */
- BFD_RELOC_CRIS_32_PLT_GOTREL,
-
-/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
- BFD_RELOC_CRIS_32_PLT_PCREL,
-
-/* Intel i860 Relocations. */
- BFD_RELOC_860_COPY,
- BFD_RELOC_860_GLOB_DAT,
- BFD_RELOC_860_JUMP_SLOT,
- BFD_RELOC_860_RELATIVE,
- BFD_RELOC_860_PC26,
- BFD_RELOC_860_PLT26,
- BFD_RELOC_860_PC16,
- BFD_RELOC_860_LOW0,
- BFD_RELOC_860_SPLIT0,
- BFD_RELOC_860_LOW1,
- BFD_RELOC_860_SPLIT1,
- BFD_RELOC_860_LOW2,
- BFD_RELOC_860_SPLIT2,
- BFD_RELOC_860_LOW3,
- BFD_RELOC_860_LOGOT0,
- BFD_RELOC_860_SPGOT0,
- BFD_RELOC_860_LOGOT1,
- BFD_RELOC_860_SPGOT1,
- BFD_RELOC_860_LOGOTOFF0,
- BFD_RELOC_860_SPGOTOFF0,
- BFD_RELOC_860_LOGOTOFF1,
- BFD_RELOC_860_SPGOTOFF1,
- BFD_RELOC_860_LOGOTOFF2,
- BFD_RELOC_860_LOGOTOFF3,
- BFD_RELOC_860_LOPC,
- BFD_RELOC_860_HIGHADJ,
- BFD_RELOC_860_HAGOT,
- BFD_RELOC_860_HAGOTOFF,
- BFD_RELOC_860_HAPC,
- BFD_RELOC_860_HIGH,
- BFD_RELOC_860_HIGOT,
- BFD_RELOC_860_HIGOTOFF,
-
-/* OpenRISC Relocations. */
- BFD_RELOC_OPENRISC_ABS_26,
- BFD_RELOC_OPENRISC_REL_26,
-
-/* H8 elf Relocations. */
- BFD_RELOC_H8_DIR16A8,
- BFD_RELOC_H8_DIR16R8,
- BFD_RELOC_H8_DIR24A8,
- BFD_RELOC_H8_DIR24R8,
- BFD_RELOC_H8_DIR32A16,
-
-/* Sony Xstormy16 Relocations. */
- BFD_RELOC_XSTORMY16_REL_12,
- BFD_RELOC_XSTORMY16_12,
- BFD_RELOC_XSTORMY16_24,
- BFD_RELOC_XSTORMY16_FPTR16,
-
-/* Self-describing complex relocations. */
- BFD_RELOC_RELC,
-
-
-/* Infineon Relocations. */
- BFD_RELOC_XC16X_PAG,
- BFD_RELOC_XC16X_POF,
- BFD_RELOC_XC16X_SEG,
- BFD_RELOC_XC16X_SOF,
-
-/* Relocations used by VAX ELF. */
- BFD_RELOC_VAX_GLOB_DAT,
- BFD_RELOC_VAX_JMP_SLOT,
- BFD_RELOC_VAX_RELATIVE,
-
-/* Morpho MT - 16 bit immediate relocation. */
- BFD_RELOC_MT_PC16,
-
-/* Morpho MT - Hi 16 bits of an address. */
- BFD_RELOC_MT_HI16,
-
-/* Morpho MT - Low 16 bits of an address. */
- BFD_RELOC_MT_LO16,
-
-/* Morpho MT - Used to tell the linker which vtable entries are used. */
- BFD_RELOC_MT_GNU_VTINHERIT,
-
-/* Morpho MT - Used to tell the linker which vtable entries are used. */
- BFD_RELOC_MT_GNU_VTENTRY,
-
-/* Morpho MT - 8 bit immediate relocation. */
- BFD_RELOC_MT_PCINSN8,
-
-/* msp430 specific relocation codes */
- BFD_RELOC_MSP430_10_PCREL,
- BFD_RELOC_MSP430_16_PCREL,
- BFD_RELOC_MSP430_16,
- BFD_RELOC_MSP430_16_PCREL_BYTE,
- BFD_RELOC_MSP430_16_BYTE,
- BFD_RELOC_MSP430_2X_PCREL,
- BFD_RELOC_MSP430_RL_PCREL,
-
-/* IQ2000 Relocations. */
- BFD_RELOC_IQ2000_OFFSET_16,
- BFD_RELOC_IQ2000_OFFSET_21,
- BFD_RELOC_IQ2000_UHI16,
-
-/* Special Xtensa relocation used only by PLT entries in ELF shared
-objects to indicate that the runtime linker should set the value
-to one of its own internal functions or data structures. */
- BFD_RELOC_XTENSA_RTLD,
-
-/* Xtensa relocations for ELF shared objects. */
- BFD_RELOC_XTENSA_GLOB_DAT,
- BFD_RELOC_XTENSA_JMP_SLOT,
- BFD_RELOC_XTENSA_RELATIVE,
-
-/* Xtensa relocation used in ELF object files for symbols that may require
-PLT entries. Otherwise, this is just a generic 32-bit relocation. */
- BFD_RELOC_XTENSA_PLT,
-
-/* Xtensa relocations to mark the difference of two local symbols.
-These are only needed to support linker relaxation and can be ignored
-when not relaxing. The field is set to the value of the difference
-assuming no relaxation. The relocation encodes the position of the
-first symbol so the linker can determine whether to adjust the field
-value. */
- BFD_RELOC_XTENSA_DIFF8,
- BFD_RELOC_XTENSA_DIFF16,
- BFD_RELOC_XTENSA_DIFF32,
-
-/* Generic Xtensa relocations for instruction operands. Only the slot
-number is encoded in the relocation. The relocation applies to the
-last PC-relative immediate operand, or if there are no PC-relative
-immediates, to the last immediate operand. */
- BFD_RELOC_XTENSA_SLOT0_OP,
- BFD_RELOC_XTENSA_SLOT1_OP,
- BFD_RELOC_XTENSA_SLOT2_OP,
- BFD_RELOC_XTENSA_SLOT3_OP,
- BFD_RELOC_XTENSA_SLOT4_OP,
- BFD_RELOC_XTENSA_SLOT5_OP,
- BFD_RELOC_XTENSA_SLOT6_OP,
- BFD_RELOC_XTENSA_SLOT7_OP,
- BFD_RELOC_XTENSA_SLOT8_OP,
- BFD_RELOC_XTENSA_SLOT9_OP,
- BFD_RELOC_XTENSA_SLOT10_OP,
- BFD_RELOC_XTENSA_SLOT11_OP,
- BFD_RELOC_XTENSA_SLOT12_OP,
- BFD_RELOC_XTENSA_SLOT13_OP,
- BFD_RELOC_XTENSA_SLOT14_OP,
-
-/* Alternate Xtensa relocations. Only the slot is encoded in the
-relocation. The meaning of these relocations is opcode-specific. */
- BFD_RELOC_XTENSA_SLOT0_ALT,
- BFD_RELOC_XTENSA_SLOT1_ALT,
- BFD_RELOC_XTENSA_SLOT2_ALT,
- BFD_RELOC_XTENSA_SLOT3_ALT,
- BFD_RELOC_XTENSA_SLOT4_ALT,
- BFD_RELOC_XTENSA_SLOT5_ALT,
- BFD_RELOC_XTENSA_SLOT6_ALT,
- BFD_RELOC_XTENSA_SLOT7_ALT,
- BFD_RELOC_XTENSA_SLOT8_ALT,
- BFD_RELOC_XTENSA_SLOT9_ALT,
- BFD_RELOC_XTENSA_SLOT10_ALT,
- BFD_RELOC_XTENSA_SLOT11_ALT,
- BFD_RELOC_XTENSA_SLOT12_ALT,
- BFD_RELOC_XTENSA_SLOT13_ALT,
- BFD_RELOC_XTENSA_SLOT14_ALT,
-
-/* Xtensa relocations for backward compatibility. These have all been
-replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
- BFD_RELOC_XTENSA_OP0,
- BFD_RELOC_XTENSA_OP1,
- BFD_RELOC_XTENSA_OP2,
-
-/* Xtensa relocation to mark that the assembler expanded the
-instructions from an original target. The expansion size is
-encoded in the reloc size. */
- BFD_RELOC_XTENSA_ASM_EXPAND,
-
-/* Xtensa relocation to mark that the linker should simplify
-assembler-expanded instructions. This is commonly used
-internally by the linker after analysis of a
-BFD_RELOC_XTENSA_ASM_EXPAND. */
- BFD_RELOC_XTENSA_ASM_SIMPLIFY,
-
-/* 8 bit signed offset in (ix+d) or (iy+d). */
- BFD_RELOC_Z80_DISP8,
-
-/* DJNZ offset. */
- BFD_RELOC_Z8K_DISP7,
-
-/* CALR offset. */
- BFD_RELOC_Z8K_CALLR,
-
-/* 4 bit value. */
- BFD_RELOC_Z8K_IMM4L,
- BFD_RELOC_UNUSED };
-typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
-reloc_howto_type *bfd_reloc_type_lookup
- (bfd *abfd, bfd_reloc_code_real_type code);
-reloc_howto_type *bfd_reloc_name_lookup
- (bfd *abfd, const char *reloc_name);
-
-const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
-
-/* Extracted from syms.c. */
-
-typedef struct bfd_symbol
-{
- /* A pointer to the BFD which owns the symbol. This information
- is necessary so that a back end can work out what additional
- information (invisible to the application writer) is carried
- with the symbol.
-
- This field is *almost* redundant, since you can use section->owner
- instead, except that some symbols point to the global sections
- bfd_{abs,com,und}_section. This could be fixed by making
- these globals be per-bfd (or per-target-flavor). FIXME. */
- struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
-
- /* The text of the symbol. The name is left alone, and not copied; the
- application may not alter it. */
- const char *name;
-
- /* The value of the symbol. This really should be a union of a
- numeric value with a pointer, since some flags indicate that
- a pointer to another symbol is stored here. */
- symvalue value;
-
- /* Attributes of a symbol. */
-#define BSF_NO_FLAGS 0x00
-
- /* The symbol has local scope; <<static>> in <<C>>. The value
- is the offset into the section of the data. */
-#define BSF_LOCAL 0x01
-
- /* The symbol has global scope; initialized data in <<C>>. The
- value is the offset into the section of the data. */
-#define BSF_GLOBAL 0x02
-
- /* The symbol has global scope and is exported. The value is
- the offset into the section of the data. */
-#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
-
- /* A normal C symbol would be one of:
- <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
- <<BSF_GLOBAL>>. */
-
- /* The symbol is a debugging record. The value has an arbitrary
- meaning, unless BSF_DEBUGGING_RELOC is also set. */
-#define BSF_DEBUGGING 0x08
-
- /* The symbol denotes a function entry point. Used in ELF,
- perhaps others someday. */
-#define BSF_FUNCTION 0x10
-
- /* Used by the linker. */
-#define BSF_KEEP 0x20
-#define BSF_KEEP_G 0x40
-
- /* A weak global symbol, overridable without warnings by
- a regular global symbol of the same name. */
-#define BSF_WEAK 0x80
-
- /* This symbol was created to point to a section, e.g. ELF's
- STT_SECTION symbols. */
-#define BSF_SECTION_SYM 0x100
-
- /* The symbol used to be a common symbol, but now it is
- allocated. */
-#define BSF_OLD_COMMON 0x200
-
- /* The default value for common data. */
-#define BFD_FORT_COMM_DEFAULT_VALUE 0
-
- /* In some files the type of a symbol sometimes alters its
- location in an output file - ie in coff a <<ISFCN>> symbol
- which is also <<C_EXT>> symbol appears where it was
- declared and not at the end of a section. This bit is set
- by the target BFD part to convey this information. */
-#define BSF_NOT_AT_END 0x400
-
- /* Signal that the symbol is the label of constructor section. */
-#define BSF_CONSTRUCTOR 0x800
-
- /* Signal that the symbol is a warning symbol. The name is a
- warning. The name of the next symbol is the one to warn about;
- if a reference is made to a symbol with the same name as the next
- symbol, a warning is issued by the linker. */
-#define BSF_WARNING 0x1000
-
- /* Signal that the symbol is indirect. This symbol is an indirect
- pointer to the symbol with the same name as the next symbol. */
-#define BSF_INDIRECT 0x2000
-
- /* BSF_FILE marks symbols that contain a file name. This is used
- for ELF STT_FILE symbols. */
-#define BSF_FILE 0x4000
-
- /* Symbol is from dynamic linking information. */
-#define BSF_DYNAMIC 0x8000
-
- /* The symbol denotes a data object. Used in ELF, and perhaps
- others someday. */
-#define BSF_OBJECT 0x10000
-
- /* This symbol is a debugging symbol. The value is the offset
- into the section of the data. BSF_DEBUGGING should be set
- as well. */
-#define BSF_DEBUGGING_RELOC 0x20000
-
- /* This symbol is thread local. Used in ELF. */
-#define BSF_THREAD_LOCAL 0x40000
-
- /* This symbol represents a complex relocation expression,
- with the expression tree serialized in the symbol name. */
-#define BSF_RELC 0x80000
-
- /* This symbol represents a signed complex relocation expression,
- with the expression tree serialized in the symbol name. */
-#define BSF_SRELC 0x100000
-
- flagword flags;
-
- /* A pointer to the section to which this symbol is
- relative. This will always be non NULL, there are special
- sections for undefined and absolute symbols. */
- struct bfd_section *section;
-
- /* Back end special data. */
- union
- {
- void *p;
- bfd_vma i;
- }
- udata;
-}
-asymbol;
-
-#define bfd_get_symtab_upper_bound(abfd) \
- BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
-
-bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
-
-bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
-
-#define bfd_is_local_label_name(abfd, name) \
- BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
-
-bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
-
-#define bfd_is_target_special_symbol(abfd, sym) \
- BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
-
-#define bfd_canonicalize_symtab(abfd, location) \
- BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
-
-bfd_boolean bfd_set_symtab
- (bfd *abfd, asymbol **location, unsigned int count);
-
-void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
-
-#define bfd_make_empty_symbol(abfd) \
- BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
-
-asymbol *_bfd_generic_make_empty_symbol (bfd *);
-
-#define bfd_make_debug_symbol(abfd,ptr,size) \
- BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
-
-int bfd_decode_symclass (asymbol *symbol);
-
-bfd_boolean bfd_is_undefined_symclass (int symclass);
-
-void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
-
-bfd_boolean bfd_copy_private_symbol_data
- (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
-
-#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
- BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
- (ibfd, isymbol, obfd, osymbol))
-
-/* Extracted from bfd.c. */
-struct bfd
-{
- /* A unique identifier of the BFD */
- unsigned int id;
-
- /* The filename the application opened the BFD with. */
- const char *filename;
-
- /* A pointer to the target jump table. */
- const struct bfd_target *xvec;
-
- /* The IOSTREAM, and corresponding IO vector that provide access
- to the file backing the BFD. */
- void *iostream;
- const struct bfd_iovec *iovec;
-
- /* Is the file descriptor being cached? That is, can it be closed as
- needed, and re-opened when accessed later? */
- bfd_boolean cacheable;
-
- /* Marks whether there was a default target specified when the
- BFD was opened. This is used to select which matching algorithm
- to use to choose the back end. */
- bfd_boolean target_defaulted;
-
- /* The caching routines use these to maintain a
- least-recently-used list of BFDs. */
- struct bfd *lru_prev, *lru_next;
-
- /* When a file is closed by the caching routines, BFD retains
- state information on the file here... */
- ufile_ptr where;
-
- /* ... and here: (``once'' means at least once). */
- bfd_boolean opened_once;
-
- /* Set if we have a locally maintained mtime value, rather than
- getting it from the file each time. */
- bfd_boolean mtime_set;
-
- /* File modified time, if mtime_set is TRUE. */
- long mtime;
-
- /* Reserved for an unimplemented file locking extension. */
- int ifd;
-
- /* The format which belongs to the BFD. (object, core, etc.) */
- bfd_format format;
-
- /* The direction with which the BFD was opened. */
- enum bfd_direction
- {
- no_direction = 0,
- read_direction = 1,
- write_direction = 2,
- both_direction = 3
- }
- direction;
-
- /* Format_specific flags. */
- flagword flags;
-
- /* Currently my_archive is tested before adding origin to
- anything. I believe that this can become always an add of
- origin, with origin set to 0 for non archive files. */
- ufile_ptr origin;
-
- /* Remember when output has begun, to stop strange things
- from happening. */
- bfd_boolean output_has_begun;
-
- /* A hash table for section names. */
- struct bfd_hash_table section_htab;
-
- /* Pointer to linked list of sections. */
- struct bfd_section *sections;
-
- /* The last section on the section list. */
- struct bfd_section *section_last;
-
- /* The number of sections. */
- unsigned int section_count;
-
- /* Stuff only useful for object files:
- The start address. */
- bfd_vma start_address;
-
- /* Used for input and output. */
- unsigned int symcount;
-
- /* Symbol table for output BFD (with symcount entries). */
- struct bfd_symbol **outsymbols;
-
- /* Used for slurped dynamic symbol tables. */
- unsigned int dynsymcount;
-
- /* Pointer to structure which contains architecture information. */
- const struct bfd_arch_info *arch_info;
-
- /* Flag set if symbols from this BFD should not be exported. */
- bfd_boolean no_export;
-
- /* Stuff only useful for archives. */
- void *arelt_data;
- struct bfd *my_archive; /* The containing archive BFD. */
- struct bfd *archive_next; /* The next BFD in the archive. */
- struct bfd *archive_head; /* The first BFD in the archive. */
- bfd_boolean has_armap;
-
- /* A chain of BFD structures involved in a link. */
- struct bfd *link_next;
-
- /* A field used by _bfd_generic_link_add_archive_symbols. This will
- be used only for archive elements. */
- int archive_pass;
-
- /* Used by the back end to hold private data. */
- union
- {
- 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;
- struct ecoff_tdata *ecoff_obj_data;
- struct ieee_data_struct *ieee_data;
- struct ieee_ar_data_struct *ieee_ar_data;
- struct srec_data_struct *srec_data;
- struct ihex_data_struct *ihex_data;
- struct tekhex_data_struct *tekhex_data;
- struct elf_obj_tdata *elf_obj_data;
- struct nlm_obj_tdata *nlm_obj_data;
- struct bout_data_struct *bout_data;
- struct mmo_data_struct *mmo_data;
- struct sun_core_struct *sun_core_data;
- struct sco5_core_struct *sco5_core_data;
- struct trad_core_struct *trad_core_data;
- struct som_data_struct *som_data;
- struct hpux_core_struct *hpux_core_data;
- struct hppabsd_core_struct *hppabsd_core_data;
- struct sgi_core_struct *sgi_core_data;
- struct lynx_core_struct *lynx_core_data;
- struct osf_core_struct *osf_core_data;
- struct cisco_core_struct *cisco_core_data;
- struct versados_data_struct *versados_data;
- struct netbsd_core_struct *netbsd_core_data;
- struct mach_o_data_struct *mach_o_data;
- struct mach_o_fat_data_struct *mach_o_fat_data;
- struct bfd_pef_data_struct *pef_data;
- struct bfd_pef_xlib_data_struct *pef_xlib_data;
- struct bfd_sym_data_struct *sym_data;
- void *any;
- }
- tdata;
-
- /* Used by the application to hold private data. */
- void *usrdata;
-
- /* Where all the allocated stuff under this BFD goes. This is a
- struct objalloc *, but we use void * to avoid requiring the inclusion
- of objalloc.h. */
- void *memory;
-};
-
-typedef enum bfd_error
-{
- bfd_error_no_error = 0,
- bfd_error_system_call,
- bfd_error_invalid_target,
- bfd_error_wrong_format,
- bfd_error_wrong_object_format,
- bfd_error_invalid_operation,
- bfd_error_no_memory,
- bfd_error_no_symbols,
- bfd_error_no_armap,
- bfd_error_no_more_archived_files,
- bfd_error_malformed_archive,
- bfd_error_file_not_recognized,
- bfd_error_file_ambiguously_recognized,
- bfd_error_no_contents,
- bfd_error_nonrepresentable_section,
- bfd_error_no_debug_section,
- bfd_error_bad_value,
- bfd_error_file_truncated,
- bfd_error_file_too_big,
- bfd_error_on_input,
- bfd_error_invalid_error_code
-}
-bfd_error_type;
-
-bfd_error_type bfd_get_error (void);
-
-void bfd_set_error (bfd_error_type error_tag, ...);
-
-const char *bfd_errmsg (bfd_error_type error_tag);
-
-void bfd_perror (const char *message);
-
-typedef void (*bfd_error_handler_type) (const char *, ...);
-
-bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
-
-void bfd_set_error_program_name (const char *);
-
-bfd_error_handler_type bfd_get_error_handler (void);
-
-long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
-
-long bfd_canonicalize_reloc
- (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
-
-void bfd_set_reloc
- (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
-
-bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
-
-int bfd_get_arch_size (bfd *abfd);
-
-int bfd_get_sign_extend_vma (bfd *abfd);
-
-bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
-
-unsigned int bfd_get_gp_size (bfd *abfd);
-
-void bfd_set_gp_size (bfd *abfd, unsigned int i);
-
-bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
-
-bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
-
-#define bfd_copy_private_header_data(ibfd, obfd) \
- BFD_SEND (obfd, _bfd_copy_private_header_data, \
- (ibfd, obfd))
-bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
-
-#define bfd_copy_private_bfd_data(ibfd, obfd) \
- BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
- (ibfd, obfd))
-bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
-
-#define bfd_merge_private_bfd_data(ibfd, obfd) \
- BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
- (ibfd, obfd))
-bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
-
-#define bfd_set_private_flags(abfd, flags) \
- BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
-#define bfd_sizeof_headers(abfd, info) \
- BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
-
-#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
- BFD_SEND (abfd, _bfd_find_nearest_line, \
- (abfd, sec, syms, off, file, func, line))
-
-#define bfd_find_line(abfd, syms, sym, file, line) \
- BFD_SEND (abfd, _bfd_find_line, \
- (abfd, syms, sym, file, line))
-
-#define bfd_find_inliner_info(abfd, file, func, line) \
- BFD_SEND (abfd, _bfd_find_inliner_info, \
- (abfd, file, func, line))
-
-#define bfd_debug_info_start(abfd) \
- BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
-
-#define bfd_debug_info_end(abfd) \
- BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
-
-#define bfd_debug_info_accumulate(abfd, section) \
- BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
-
-#define bfd_stat_arch_elt(abfd, stat) \
- BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
-
-#define bfd_update_armap_timestamp(abfd) \
- BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
-
-#define bfd_set_arch_mach(abfd, arch, mach)\
- BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
-
-#define bfd_relax_section(abfd, section, link_info, again) \
- BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
-
-#define bfd_gc_sections(abfd, link_info) \
- BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
-
-#define bfd_merge_sections(abfd, link_info) \
- BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
-
-#define bfd_is_group_section(abfd, sec) \
- BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
-
-#define bfd_discard_group(abfd, sec) \
- BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
-
-#define bfd_link_hash_table_create(abfd) \
- BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
-
-#define bfd_link_hash_table_free(abfd, hash) \
- BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
-
-#define bfd_link_add_symbols(abfd, info) \
- BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
-
-#define bfd_link_just_syms(abfd, sec, info) \
- BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
-
-#define bfd_final_link(abfd, info) \
- BFD_SEND (abfd, _bfd_final_link, (abfd, info))
-
-#define bfd_free_cached_info(abfd) \
- BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
-
-#define bfd_get_dynamic_symtab_upper_bound(abfd) \
- BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
-
-#define bfd_print_private_bfd_data(abfd, file)\
- BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
-
-#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
- BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
-
-#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
- BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
- dyncount, dynsyms, ret))
-
-#define bfd_get_dynamic_reloc_upper_bound(abfd) \
- BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
-
-#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
- BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
-
-extern bfd_byte *bfd_get_relocated_section_contents
- (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
- bfd_boolean, asymbol **);
-
-bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
-
-struct bfd_preserve
-{
- void *marker;
- void *tdata;
- flagword flags;
- const struct bfd_arch_info *arch_info;
- struct bfd_section *sections;
- struct bfd_section *section_last;
- unsigned int section_count;
- struct bfd_hash_table section_htab;
-};
-
-bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
-
-void bfd_preserve_restore (bfd *, struct bfd_preserve *);
-
-void bfd_preserve_finish (bfd *, struct bfd_preserve *);
-
-bfd_vma bfd_emul_get_maxpagesize (const char *);
-
-void bfd_emul_set_maxpagesize (const char *, bfd_vma);
-
-bfd_vma bfd_emul_get_commonpagesize (const char *);
-
-void bfd_emul_set_commonpagesize (const char *, bfd_vma);
-
-char *bfd_demangle (bfd *, const char *, int);
-
-/* Extracted from archive.c. */
-symindex bfd_get_next_mapent
- (bfd *abfd, symindex previous, carsym **sym);
-
-bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
-
-bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
-
-/* Extracted from corefile.c. */
-const char *bfd_core_file_failing_command (bfd *abfd);
-
-int bfd_core_file_failing_signal (bfd *abfd);
-
-bfd_boolean core_file_matches_executable_p
- (bfd *core_bfd, bfd *exec_bfd);
-
-bfd_boolean generic_core_file_matches_executable_p
- (bfd *core_bfd, bfd *exec_bfd);
-
-/* Extracted from targets.c. */
-#define BFD_SEND(bfd, message, arglist) \
- ((*((bfd)->xvec->message)) arglist)
-
-#ifdef DEBUG_BFD_SEND
-#undef BFD_SEND
-#define BFD_SEND(bfd, message, arglist) \
- (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
- ((*((bfd)->xvec->message)) arglist) : \
- (bfd_assert (__FILE__,__LINE__), NULL))
-#endif
-#define BFD_SEND_FMT(bfd, message, arglist) \
- (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
-
-#ifdef DEBUG_BFD_SEND
-#undef BFD_SEND_FMT
-#define BFD_SEND_FMT(bfd, message, arglist) \
- (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
- (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
- (bfd_assert (__FILE__,__LINE__), NULL))
-#endif
-
-enum bfd_flavour
-{
- bfd_target_unknown_flavour,
- bfd_target_aout_flavour,
- bfd_target_coff_flavour,
- bfd_target_ecoff_flavour,
- bfd_target_xcoff_flavour,
- bfd_target_elf_flavour,
- bfd_target_ieee_flavour,
- bfd_target_nlm_flavour,
- bfd_target_oasys_flavour,
- bfd_target_tekhex_flavour,
- bfd_target_srec_flavour,
- bfd_target_ihex_flavour,
- bfd_target_som_flavour,
- bfd_target_os9k_flavour,
- bfd_target_versados_flavour,
- bfd_target_msdos_flavour,
- bfd_target_ovax_flavour,
- bfd_target_evax_flavour,
- bfd_target_mmo_flavour,
- bfd_target_mach_o_flavour,
- bfd_target_pef_flavour,
- bfd_target_pef_xlib_flavour,
- bfd_target_sym_flavour
-};
-
-enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
-
-/* Forward declaration. */
-typedef struct bfd_link_info _bfd_link_info;
-
-typedef struct bfd_target
-{
- /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
- char *name;
-
- /* The "flavour" of a back end is a general indication about
- the contents of a file. */
- enum bfd_flavour flavour;
-
- /* The order of bytes within the data area of a file. */
- enum bfd_endian byteorder;
-
- /* The order of bytes within the header parts of a file. */
- enum bfd_endian header_byteorder;
-
- /* A mask of all the flags which an executable may have set -
- from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
- flagword object_flags;
-
- /* A mask of all the flags which a section may have set - from
- the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
- flagword section_flags;
-
- /* The character normally found at the front of a symbol.
- (if any), perhaps `_'. */
- char symbol_leading_char;
-
- /* The pad character for file names within an archive header. */
- char ar_pad_char;
-
- /* The maximum number of characters in an archive header. */
- unsigned short ar_max_namelen;
-
- /* Entries for byte swapping for data. These are different from the
- other entry points, since they don't take a BFD as the first argument.
- Certain other handlers could do the same. */
- bfd_uint64_t (*bfd_getx64) (const void *);
- bfd_int64_t (*bfd_getx_signed_64) (const void *);
- void (*bfd_putx64) (bfd_uint64_t, void *);
- bfd_vma (*bfd_getx32) (const void *);
- bfd_signed_vma (*bfd_getx_signed_32) (const void *);
- void (*bfd_putx32) (bfd_vma, void *);
- bfd_vma (*bfd_getx16) (const void *);
- bfd_signed_vma (*bfd_getx_signed_16) (const void *);
- void (*bfd_putx16) (bfd_vma, void *);
-
- /* Byte swapping for the headers. */
- bfd_uint64_t (*bfd_h_getx64) (const void *);
- bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
- void (*bfd_h_putx64) (bfd_uint64_t, void *);
- bfd_vma (*bfd_h_getx32) (const void *);
- bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
- void (*bfd_h_putx32) (bfd_vma, void *);
- bfd_vma (*bfd_h_getx16) (const void *);
- bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
- void (*bfd_h_putx16) (bfd_vma, void *);
-
- /* Format dependent routines: these are vectors of entry points
- within the target vector structure, one for each format to check. */
-
- /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
- const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
-
- /* Set the format of a file being written. */
- bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
-
- /* Write cached information into a file being written, at <<bfd_close>>. */
- bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
-
-
- /* Generic entry points. */
-#define BFD_JUMP_TABLE_GENERIC(NAME) \
- NAME##_close_and_cleanup, \
- NAME##_bfd_free_cached_info, \
- NAME##_new_section_hook, \
- NAME##_get_section_contents, \
- NAME##_get_section_contents_in_window
-
- /* Called when the BFD is being closed to do any necessary cleanup. */
- bfd_boolean (*_close_and_cleanup) (bfd *);
- /* Ask the BFD to free all cached information. */
- bfd_boolean (*_bfd_free_cached_info) (bfd *);
- /* Called when a new section is created. */
- bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
- /* Read the contents of a section. */
- bfd_boolean (*_bfd_get_section_contents)
- (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
- bfd_boolean (*_bfd_get_section_contents_in_window)
- (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
-
- /* Entry points to copy private data. */
-#define BFD_JUMP_TABLE_COPY(NAME) \
- NAME##_bfd_copy_private_bfd_data, \
- NAME##_bfd_merge_private_bfd_data, \
- _bfd_generic_init_private_section_data, \
- NAME##_bfd_copy_private_section_data, \
- NAME##_bfd_copy_private_symbol_data, \
- NAME##_bfd_copy_private_header_data, \
- NAME##_bfd_set_private_flags, \
- NAME##_bfd_print_private_bfd_data
-
- /* Called to copy BFD general private data from one object file
- to another. */
- bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
- /* Called to merge BFD general private data from one object file
- to a common output file when linking. */
- bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
- /* Called to initialize BFD private section data from one object file
- to another. */
-#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
- BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
- bfd_boolean (*_bfd_init_private_section_data)
- (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
- /* Called to copy BFD private section data from one object file
- to another. */
- bfd_boolean (*_bfd_copy_private_section_data)
- (bfd *, sec_ptr, bfd *, sec_ptr);
- /* Called to copy BFD private symbol data from one symbol
- to another. */
- bfd_boolean (*_bfd_copy_private_symbol_data)
- (bfd *, asymbol *, bfd *, asymbol *);
- /* Called to copy BFD private header data from one object file
- to another. */
- bfd_boolean (*_bfd_copy_private_header_data)
- (bfd *, bfd *);
- /* Called to set private backend flags. */
- bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
-
- /* Called to print private BFD data. */
- bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
-
- /* Core file entry points. */
-#define BFD_JUMP_TABLE_CORE(NAME) \
- NAME##_core_file_failing_command, \
- NAME##_core_file_failing_signal, \
- NAME##_core_file_matches_executable_p
-
- char * (*_core_file_failing_command) (bfd *);
- int (*_core_file_failing_signal) (bfd *);
- bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
-
- /* Archive entry points. */
-#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
- NAME##_slurp_armap, \
- NAME##_slurp_extended_name_table, \
- NAME##_construct_extended_name_table, \
- NAME##_truncate_arname, \
- NAME##_write_armap, \
- NAME##_read_ar_hdr, \
- NAME##_openr_next_archived_file, \
- NAME##_get_elt_at_index, \
- NAME##_generic_stat_arch_elt, \
- NAME##_update_armap_timestamp
-
- bfd_boolean (*_bfd_slurp_armap) (bfd *);
- bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
- bfd_boolean (*_bfd_construct_extended_name_table)
- (bfd *, char **, bfd_size_type *, const char **);
- void (*_bfd_truncate_arname) (bfd *, const char *, char *);
- bfd_boolean (*write_armap)
- (bfd *, unsigned int, struct orl *, unsigned int, int);
- void * (*_bfd_read_ar_hdr_fn) (bfd *);
- bfd * (*openr_next_archived_file) (bfd *, bfd *);
-#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
- bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
- int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
- bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
-
- /* Entry points used for symbols. */
-#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
- NAME##_get_symtab_upper_bound, \
- NAME##_canonicalize_symtab, \
- NAME##_make_empty_symbol, \
- NAME##_print_symbol, \
- NAME##_get_symbol_info, \
- NAME##_bfd_is_local_label_name, \
- NAME##_bfd_is_target_special_symbol, \
- NAME##_get_lineno, \
- NAME##_find_nearest_line, \
- _bfd_generic_find_line, \
- NAME##_find_inliner_info, \
- NAME##_bfd_make_debug_symbol, \
- NAME##_read_minisymbols, \
- NAME##_minisymbol_to_symbol
-
- long (*_bfd_get_symtab_upper_bound) (bfd *);
- long (*_bfd_canonicalize_symtab)
- (bfd *, struct bfd_symbol **);
- struct bfd_symbol *
- (*_bfd_make_empty_symbol) (bfd *);
- void (*_bfd_print_symbol)
- (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
-#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
- void (*_bfd_get_symbol_info)
- (bfd *, struct bfd_symbol *, symbol_info *);
-#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
- bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
- bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
- alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
- bfd_boolean (*_bfd_find_nearest_line)
- (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
- const char **, const char **, unsigned int *);
- bfd_boolean (*_bfd_find_line)
- (bfd *, struct bfd_symbol **, struct bfd_symbol *,
- const char **, unsigned int *);
- bfd_boolean (*_bfd_find_inliner_info)
- (bfd *, const char **, const char **, unsigned int *);
- /* Back-door to allow format-aware applications to create debug symbols
- while using BFD for everything else. Currently used by the assembler
- when creating COFF files. */
- asymbol * (*_bfd_make_debug_symbol)
- (bfd *, void *, unsigned long size);
-#define bfd_read_minisymbols(b, d, m, s) \
- BFD_SEND (b, _read_minisymbols, (b, d, m, s))
- long (*_read_minisymbols)
- (bfd *, bfd_boolean, void **, unsigned int *);
-#define bfd_minisymbol_to_symbol(b, d, m, f) \
- BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
- asymbol * (*_minisymbol_to_symbol)
- (bfd *, bfd_boolean, const void *, asymbol *);
-
- /* Routines for relocs. */
-#define BFD_JUMP_TABLE_RELOCS(NAME) \
- NAME##_get_reloc_upper_bound, \
- NAME##_canonicalize_reloc, \
- NAME##_bfd_reloc_type_lookup, \
- NAME##_bfd_reloc_name_lookup
-
- long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
- long (*_bfd_canonicalize_reloc)
- (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
- /* See documentation on reloc types. */
- reloc_howto_type *
- (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
- reloc_howto_type *
- (*reloc_name_lookup) (bfd *, const char *);
-
-
- /* Routines used when writing an object file. */
-#define BFD_JUMP_TABLE_WRITE(NAME) \
- NAME##_set_arch_mach, \
- NAME##_set_section_contents
-
- bfd_boolean (*_bfd_set_arch_mach)
- (bfd *, enum bfd_architecture, unsigned long);
- bfd_boolean (*_bfd_set_section_contents)
- (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
-
- /* Routines used by the linker. */
-#define BFD_JUMP_TABLE_LINK(NAME) \
- NAME##_sizeof_headers, \
- NAME##_bfd_get_relocated_section_contents, \
- NAME##_bfd_relax_section, \
- NAME##_bfd_link_hash_table_create, \
- NAME##_bfd_link_hash_table_free, \
- NAME##_bfd_link_add_symbols, \
- NAME##_bfd_link_just_syms, \
- NAME##_bfd_final_link, \
- NAME##_bfd_link_split_section, \
- NAME##_bfd_gc_sections, \
- NAME##_bfd_merge_sections, \
- NAME##_bfd_is_group_section, \
- NAME##_bfd_discard_group, \
- NAME##_section_already_linked \
-
- int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
- bfd_byte * (*_bfd_get_relocated_section_contents)
- (bfd *, struct bfd_link_info *, struct bfd_link_order *,
- bfd_byte *, bfd_boolean, struct bfd_symbol **);
-
- bfd_boolean (*_bfd_relax_section)
- (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
-
- /* Create a hash table for the linker. Different backends store
- different information in this table. */
- struct bfd_link_hash_table *
- (*_bfd_link_hash_table_create) (bfd *);
-
- /* Release the memory associated with the linker hash table. */
- void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
-
- /* Add symbols from this object file into the hash table. */
- bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
-
- /* Indicate that we are only retrieving symbol values from this section. */
- void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
-
- /* Do a link based on the link_order structures attached to each
- section of the BFD. */
- bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
-
- /* Should this section be split up into smaller pieces during linking. */
- bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
-
- /* Remove sections that are not referenced from the output. */
- bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
-
- /* Attempt to merge SEC_MERGE sections. */
- bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
-
- /* Is this section a member of a group? */
- bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
-
- /* Discard members of a group. */
- bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
-
- /* Check if SEC has been already linked during a reloceatable or
- final link. */
- void (*_section_already_linked) (bfd *, struct bfd_section *,
- struct bfd_link_info *);
-
- /* Routines to handle dynamic symbols and relocs. */
-#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
- NAME##_get_dynamic_symtab_upper_bound, \
- NAME##_canonicalize_dynamic_symtab, \
- NAME##_get_synthetic_symtab, \
- NAME##_get_dynamic_reloc_upper_bound, \
- NAME##_canonicalize_dynamic_reloc
-
- /* Get the amount of memory required to hold the dynamic symbols. */
- long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
- /* Read in the dynamic symbols. */
- long (*_bfd_canonicalize_dynamic_symtab)
- (bfd *, struct bfd_symbol **);
- /* Create synthetized symbols. */
- long (*_bfd_get_synthetic_symtab)
- (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
- struct bfd_symbol **);
- /* Get the amount of memory required to hold the dynamic relocs. */
- long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
- /* Read in the dynamic relocs. */
- long (*_bfd_canonicalize_dynamic_reloc)
- (bfd *, arelent **, struct bfd_symbol **);
-
- /* Opposite endian version of this target. */
- const struct bfd_target * alternative_target;
-
- /* Data for use by back-end routines, which isn't
- generic enough to belong in this structure. */
- const void *backend_data;
-
-} bfd_target;
-
-bfd_boolean bfd_set_default_target (const char *name);
-
-const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
-
-const char ** bfd_target_list (void);
-
-const bfd_target *bfd_search_for_target
- (int (*search_func) (const bfd_target *, void *),
- void *);
-
-/* Extracted from format.c. */
-bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
-
-bfd_boolean bfd_check_format_matches
- (bfd *abfd, bfd_format format, char ***matching);
-
-bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
-
-const char *bfd_format_string (bfd_format format);
-
-/* Extracted from linker.c. */
-bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
-
-#define bfd_link_split_section(abfd, sec) \
- BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
-
-void bfd_section_already_linked (bfd *abfd, asection *sec,
- struct bfd_link_info *info);
-
-#define bfd_section_already_linked(abfd, sec, info) \
- BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
-
-/* Extracted from simple.c. */
-bfd_byte *bfd_simple_get_relocated_section_contents
- (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/gnu/usr.bin/binutils/libbfd/config.h.fbsd b/gnu/usr.bin/binutils/libbfd/config.h.fbsd
deleted file mode 100644
index e1c1cf660f4f..000000000000
--- a/gnu/usr.bin/binutils/libbfd/config.h.fbsd
+++ /dev/null
@@ -1,297 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated by configure. */
-/* config.in. Generated from configure.in by autoheader. */
-
-/* Define to 1 if translation of program messages to the user's native
- language is requested. */
-/* #undef ENABLE_NLS */
-
-/* Define to 1 if you have the declaration of `basename', and to 0 if you
- don't. */
-#define HAVE_DECL_BASENAME 0
-
-/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
-#define HAVE_DECL_FFS 1
-
-/* Define to 1 if you have the declaration of `free', and to 0 if you don't.
- */
-#define HAVE_DECL_FREE 1
-
-/* Define to 1 if you have the declaration of `fseeko', and to 0 if you don't.
- */
-#define HAVE_DECL_FSEEKO 1
-
-/* Define to 1 if you have the declaration of `fseeko64', and to 0 if you
- don't. */
-#define HAVE_DECL_FSEEKO64 0
-
-/* Define to 1 if you have the declaration of `ftello', and to 0 if you don't.
- */
-#define HAVE_DECL_FTELLO 1
-
-/* Define to 1 if you have the declaration of `ftello64', and to 0 if you
- don't. */
-#define HAVE_DECL_FTELLO64 0
-
-/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
- */
-#define HAVE_DECL_GETENV 1
-
-/* Define to 1 if you have the declaration of `malloc', and to 0 if you don't.
- */
-#define HAVE_DECL_MALLOC 1
-
-/* Define to 1 if you have the declaration of `realloc', and to 0 if you
- don't. */
-#define HAVE_DECL_REALLOC 1
-
-/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
- don't. */
-#define HAVE_DECL_SNPRINTF 1
-
-/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
- */
-#define HAVE_DECL_STPCPY 1
-
-/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
- */
-#define HAVE_DECL_STRSTR 1
-
-/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
- don't. */
-#define HAVE_DECL_VSNPRINTF 1
-
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
- */
-#define HAVE_DIRENT_H 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the `fcntl' function. */
-#define HAVE_FCNTL 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the `fdopen' function. */
-#define HAVE_FDOPEN 1
-
-/* Define to 1 if you have the `fopen64' function. */
-/* #undef HAVE_FOPEN64 */
-
-/* Define to 1 if you have the `fseeko' function. */
-#define HAVE_FSEEKO 1
-
-/* Define to 1 if you have the `fseeko64' function. */
-/* #undef HAVE_FSEEKO64 */
-
-/* Define to 1 if you have the `ftello' function. */
-#define HAVE_FTELLO 1
-
-/* Define to 1 if you have the `ftello64' function. */
-/* #undef HAVE_FTELLO64 */
-
-/* Define to 1 if you have the `getgid' function. */
-#define HAVE_GETGID 1
-
-/* Define to 1 if you have the `getpagesize' function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define to 1 if you have the `getuid' function. */
-#define HAVE_GETUID 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define if <sys/procfs.h> has lwpstatus_t. */
-/* #undef HAVE_LWPSTATUS_T */
-
-/* Define if <sys/procfs.h> has lwpstatus_t.pr_context. */
-/* #undef HAVE_LWPSTATUS_T_PR_CONTEXT */
-
-/* Define if <sys/procfs.h> has lwpstatus_t.pr_reg. */
-/* #undef HAVE_LWPSTATUS_T_PR_REG */
-
-/* Define if <sys/procfs.h> has lwpxstatus_t. */
-/* #undef HAVE_LWPXSTATUS_T */
-
-/* Define to 1 if you have the `madvise' function. */
-#define HAVE_MADVISE 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define to 1 if you have the `mprotect' function. */
-#define HAVE_MPROTECT 1
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if <sys/procfs.h> has prpsinfo32_t. */
-/* #undef HAVE_PRPSINFO32_T */
-
-/* Define if <sys/procfs.h> has prpsinfo_t. */
-#define HAVE_PRPSINFO_T 1
-
-/* Define if <sys/procfs.h> has prstatus32_t. */
-/* #undef HAVE_PRSTATUS32_T */
-
-/* Define if <sys/procfs.h> has prstatus32_t.pr_who. */
-/* #undef HAVE_PRSTATUS32_T_PR_WHO */
-
-/* Define if <sys/procfs.h> has prstatus_t. */
-#define HAVE_PRSTATUS_T 1
-
-/* Define if <sys/procfs.h> has prstatus_t.pr_who. */
-/* #undef HAVE_PRSTATUS_T_PR_WHO */
-
-/* Define if <sys/procfs.h> has psinfo32_t. */
-/* #undef HAVE_PSINFO32_T */
-
-/* Define if <sys/procfs.h> has psinfo_t. */
-/* #undef HAVE_PSINFO_T */
-
-/* Define if <sys/procfs.h> has pstatus32_t. */
-/* #undef HAVE_PSTATUS32_T */
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has pxstatus_t. */
-/* #undef HAVE_PXSTATUS_T */
-
-/* Define to 1 if you have the `setitimer' function. */
-#define HAVE_SETITIMER 1
-
-/* Define to 1 if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the `strtoull' function. */
-#define HAVE_STRTOULL 1
-
-/* Define if struct core_dumpx has member c_impl */
-/* #undef HAVE_ST_C_IMPL */
-
-/* Define to 1 if you have the `sysconf' function. */
-#define HAVE_SYSCONF 1
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
- */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
- */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define to 1 if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if <sys/procfs.h> has win32_pstatus_t. */
-/* #undef HAVE_WIN32_PSTATUS_T */
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#define LT_OBJDIR ".libs/"
-
-/* Name of package */
-#define PACKAGE "bfd"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME ""
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING ""
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION ""
-
-/* The size of a `char', as computed by sizeof. */
-/* #undef SIZEOF_CHAR */
-
-/* The size of a `int', as computed by sizeof. */
-/* #undef SIZEOF_INT */
-
-/* The size of a `long', as computed by sizeof. */
-/* #define SIZEOF_LONG 4 */
-
-/* The size of a `long long', as computed by sizeof. */
-/* #define SIZEOF_LONG_LONG 8 */
-
-/* The size of a `off_t', as computed by sizeof. */
-/* #define SIZEOF_OFF_T 8 */
-
-/* The size of a `short', as computed by sizeof. */
-/* #undef SIZEOF_SHORT */
-
-/* The size of a `void *', as computed by sizeof. */
-/* #undef SIZEOF_VOID_P */
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if you can safely include both <string.h> and <strings.h>. */
-#define STRING_WITH_STRINGS 1
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
-
-/* Name of host specific header file to include in trad-core.c. */
-#define TRAD_HEADER !!TRAD_HEADER!!
-
-/* Use b modifier when opening binary files? */
-/* #undef USE_BINARY_FOPEN */
-
-/* Use mmap if it's available? */
-/* #undef USE_MMAP */
-
-/* Define if we should default to creating read-only plt entries */
-/* #undef USE_SECUREPLT */
-
-/* Version number of package */
-/* #define VERSION "2.17.50" */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
diff --git a/gnu/usr.bin/binutils/libbfd/elf-fbsd-brand.c b/gnu/usr.bin/binutils/libbfd/elf-fbsd-brand.c
deleted file mode 100644
index b8ba60e5f7d9..000000000000
--- a/gnu/usr.bin/binutils/libbfd/elf-fbsd-brand.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*-
- * Copyright (c) 2002, 2003 David E. O'Brien
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#define ELF_OSABI ELFOSABI_FREEBSD
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
diff --git a/gnu/usr.bin/binutils/libbinutils/Makefile b/gnu/usr.bin/binutils/libbinutils/Makefile
deleted file mode 100644
index d6518a55be6c..000000000000
--- a/gnu/usr.bin/binutils/libbinutils/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-# $FreeBSD$
-
-.include "../Makefile.inc0"
-
-.PATH: ${SRCDIR}/binutils
-
-LIB= binutils
-SRCS+= arlex.l \
- arparse.y \
- arsup.c \
- binemul.c \
- bucomm.c \
- debug.c \
- dwarf.c \
- emul_vanilla.c \
- filemode.c \
- ieee.c \
- rdcoff.c \
- rddbg.c \
- rename.c \
- stabs.c \
- unwind-ia64.c \
- version.c \
- wrstabs.c
-CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
-CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
-CFLAGS+= -D_GNU_SOURCE
-CFLAGS+= -DYY_NO_INPUT
-CFLAGS+= -I${SRCDIR}/binutils
-CFLAGS+= -I${SRCDIR}/bfd
-INTERNALLIB=
-
-.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/binutils/libbinutils/Makefile.depend b/gnu/usr.bin/binutils/libbinutils/Makefile.depend
deleted file mode 100644
index 89b90452da80..000000000000
--- a/gnu/usr.bin/binutils/libbinutils/Makefile.depend
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/usr.bin/binutils/libbfd \
- include \
- include/xlocale \
- usr.bin/yacc.host \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/binutils/libbinutils/config.h b/gnu/usr.bin/binutils/libbinutils/config.h
deleted file mode 100644
index 5c457f1eeaff..000000000000
--- a/gnu/usr.bin/binutils/libbinutils/config.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/* $FreeBSD$ */
-
-/* FreeBSD isn't any form of AIX. */
-#define bin_dummy_emulation bin_vanilla_emulation
-
-/* config.h. Generated by configure. */
-/* config.in. Generated from configure.in by autoheader. */
-
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
- systems. This function is required for `alloca.c' support on those systems.
- */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define to 1 if using `alloca.c'. */
-/* #undef C_ALLOCA */
-
-/* Define to 1 if translation of program messages to the user's native
- language is requested. */
-/* #undef ENABLE_NLS */
-
-/* Suffix used for executables, if any. */
-#define EXECUTABLE_SUFFIX ""
-
-/* Define to 1 if you have `alloca', as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
- */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define to 1 if you have the declaration of `environ', and to 0 if you
- don't. */
-#define HAVE_DECL_ENVIRON 0
-
-/* Define to 1 if you have the declaration of `fprintf', and to 0 if you
- don't. */
-#define HAVE_DECL_FPRINTF 1
-
-/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
- don't. */
-#define HAVE_DECL_GETC_UNLOCKED 1
-
-/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
- */
-#define HAVE_DECL_GETENV 1
-
-/* Is the prototype for getopt in <unistd.h> in the expected format? */
-#define HAVE_DECL_GETOPT 1
-
-/* Define to 1 if you have the declaration of `sbrk', and to 0 if you don't.
- */
-#define HAVE_DECL_SBRK 1
-
-/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
- don't. */
-#define HAVE_DECL_SNPRINTF 1
-
-/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
- */
-#define HAVE_DECL_STPCPY 1
-
-/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
- */
-#define HAVE_DECL_STRSTR 1
-
-/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
- don't. */
-#define HAVE_DECL_VSNPRINTF 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Does the platform use an executable suffix? */
-/* #undef HAVE_EXECUTABLE_SUFFIX */
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Is fopen64 available? */
-/* #undef HAVE_FOPEN64 */
-
-/* Define to 1 if you have the `getc_unlocked' function. */
-#define HAVE_GETC_UNLOCKED 1
-
-/* Does <utime.h> define struct utimbuf? */
-#define HAVE_GOOD_UTIME_H 1
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `mkdtemp' function. */
-#define HAVE_MKDTEMP 1
-
-/* Define to 1 if you have the `mkstemp' function. */
-#define HAVE_MKSTEMP 1
-
-/* Define to 1 if you have the `sbrk' function. */
-/* #undef HAVE_SBRK */
-
-/* Define to 1 if you have the `setmode' function. */
-#define HAVE_SETMODE 1
-
-/* Is stat64 available? */
-/* #undef HAVE_STAT64 */
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `strcoll' function. */
-#define HAVE_STRCOLL 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Is the type time_t defined in <time.h>? */
-#define HAVE_TIME_T_IN_TIME_H 1
-
-/* Is the type time_t defined in <sys/types.h>? */
-#define HAVE_TIME_T_IN_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if you have the `utimes' function. */
-#define HAVE_UTIMES 1
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#define LT_OBJDIR ".libs/"
-
-/* Name of package */
-#define PACKAGE "binutils"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME ""
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING ""
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION ""
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-/* #undef STACK_DIRECTION */
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Configured target name. */
-/* #define TARGET "i386-unknown-freebsd9.0" */
-
-/* Define to 1 if user symbol names have a leading underscore, 0 if not. */
-#define TARGET_PREPENDS_UNDERSCORE 0
-
-/* Use b modifier when opening binary files? */
-/* #undef USE_BINARY_FOPEN */
-
-/* Version number of package */
-/* #define VERSION "2.17.50" */
-
-/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
- `char[]'. */
-#define YYTEXT_POINTER 1
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Enable LFS */
-/* #undef _LARGEFILE64_SOURCE */
diff --git a/gnu/usr.bin/binutils/libiberty/Makefile b/gnu/usr.bin/binutils/libiberty/Makefile
deleted file mode 100644
index 973154718d4b..000000000000
--- a/gnu/usr.bin/binutils/libiberty/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-# $FreeBSD$
-
-.include "../Makefile.inc0"
-
-.PATH: ${SRCDIR}/libiberty
-
-LIB= iberty
-SRCS= argv.c \
- concat.c \
- choose-temp.c \
- cp-demangle.c \
- cp-demint.c \
- cplus-dem.c \
- dyn-string.c \
- getpwd.c \
- getruntime.c \
- filename_cmp.c \
- floatformat.c \
- hashtab.c \
- hex.c \
- lbasename.c \
- lrealpath.c \
- make-relative-prefix.c \
- make-temp-file.c \
- objalloc.c \
- obstack.c \
- safe-ctype.c \
- unlink-if-ordinary.c \
- xatexit.c \
- xexit.c \
- xmalloc.c \
- xstrdup.c \
- xstrerror.c
-
-# The following files are needed by gdb(1)
-SRCS+= splay-tree.c
-
-WARNS?= 2
-CFLAGS+= -DHAVE_CONFIG_H
-INTERNALLIB=
-
-.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/binutils/libiberty/Makefile.depend b/gnu/usr.bin/binutils/libiberty/Makefile.depend
deleted file mode 100644
index c210061155d2..000000000000
--- a/gnu/usr.bin/binutils/libiberty/Makefile.depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- include \
- include/xlocale \
- lib/msun \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/binutils/libiberty/config.h b/gnu/usr.bin/binutils/libiberty/config.h
deleted file mode 100644
index 4361330c7f1f..000000000000
--- a/gnu/usr.bin/binutils/libiberty/config.h
+++ /dev/null
@@ -1,449 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated by configure. */
-/* config.in. Generated from configure.ac by autoheader. */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define to 1 if you have the <alloca.h> header file. */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define to 1 if you have the `asprintf' function. */
-#define HAVE_ASPRINTF 1
-
-/* Define to 1 if you have the `atexit' function. */
-#define HAVE_ATEXIT 1
-
-/* Define to 1 if you have the `basename' function. */
-#define HAVE_BASENAME 1
-
-/* Define to 1 if you have the `bcmp' function. */
-#define HAVE_BCMP 1
-
-/* Define to 1 if you have the `bcopy' function. */
-#define HAVE_BCOPY 1
-
-/* Define to 1 if you have the `bsearch' function. */
-#define HAVE_BSEARCH 1
-
-/* Define to 1 if you have the `bzero' function. */
-#define HAVE_BZERO 1
-
-/* Define to 1 if you have the `calloc' function. */
-#define HAVE_CALLOC 1
-
-/* Define to 1 if you have the `canonicalize_file_name' function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define to 1 if you have the `clock' function. */
-#define HAVE_CLOCK 1
-
-/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
- don't. */
-#define HAVE_DECL_ASPRINTF 1
-
-/* Define to 1 if you have the declaration of `basename', and to 0 if you
- don't. */
-#define HAVE_DECL_BASENAME 0
-
-/* Define to 1 if you have the declaration of `calloc', and to 0 if you don't.
- */
-#define HAVE_DECL_CALLOC 1
-
-/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
-#define HAVE_DECL_FFS 1
-
-/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
- */
-#define HAVE_DECL_GETENV 1
-
-/* Define to 1 if you have the declaration of `getopt', and to 0 if you don't.
- */
-#define HAVE_DECL_GETOPT 1
-
-/* Define to 1 if you have the declaration of `malloc', and to 0 if you don't.
- */
-#define HAVE_DECL_MALLOC 1
-
-/* Define to 1 if you have the declaration of `realloc', and to 0 if you
- don't. */
-#define HAVE_DECL_REALLOC 1
-
-/* Define to 1 if you have the declaration of `sbrk', and to 0 if you don't.
- */
-#define HAVE_DECL_SBRK 1
-
-/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
- don't. */
-#define HAVE_DECL_SNPRINTF 1
-
-/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
- don't. */
-#define HAVE_DECL_STRVERSCMP 0
-
-/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
- don't. */
-#define HAVE_DECL_VASPRINTF 1
-
-/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
- don't. */
-#define HAVE_DECL_VSNPRINTF 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the `ffs' function. */
-#define HAVE_FFS 1
-
-/* Define to 1 if you have the `fork' function. */
-#define HAVE_FORK 1
-
-/* Define to 1 if you have the `getcwd' function. */
-#define HAVE_GETCWD 1
-
-/* Define to 1 if you have the `getpagesize' function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define to 1 if you have the `getrusage' function. */
-#define HAVE_GETRUSAGE 1
-
-/* Define to 1 if you have the `getsysinfo' function. */
-/* #undef HAVE_GETSYSINFO */
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#define HAVE_GETTIMEOFDAY 1
-
-/* Define to 1 if you have the `index' function. */
-#define HAVE_INDEX 1
-
-/* Define to 1 if you have the `insque' function. */
-#define HAVE_INSQUE 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define to 1 if you have the <machine/hal_sysinfo.h> header file. */
-/* #undef HAVE_MACHINE_HAL_SYSINFO_H */
-
-/* Define to 1 if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define to 1 if you have the `memchr' function. */
-#define HAVE_MEMCHR 1
-
-/* Define to 1 if you have the `memcmp' function. */
-#define HAVE_MEMCMP 1
-
-/* Define to 1 if you have the `memcpy' function. */
-#define HAVE_MEMCPY 1
-
-/* Define to 1 if you have the `memmove' function. */
-#define HAVE_MEMMOVE 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `mempcpy' function. */
-/* #undef HAVE_MEMPCPY */
-
-/* Define to 1 if you have the `memset' function. */
-#define HAVE_MEMSET 1
-
-/* Define to 1 if you have the `mkstemps' function. */
-#define HAVE_MKSTEMPS 1
-
-/* Define to 1 if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define to 1 if you have the `on_exit' function. */
-/* #undef HAVE_ON_EXIT */
-
-/* Define to 1 if you have the `psignal' function. */
-#define HAVE_PSIGNAL 1
-
-/* Define to 1 if you have the `pstat_getdynamic' function. */
-/* #undef HAVE_PSTAT_GETDYNAMIC */
-
-/* Define to 1 if you have the `pstat_getstatic' function. */
-/* #undef HAVE_PSTAT_GETSTATIC */
-
-/* Define to 1 if you have the `putenv' function. */
-#define HAVE_PUTENV 1
-
-/* Define to 1 if you have the `random' function. */
-#define HAVE_RANDOM 1
-
-/* Define to 1 if you have the `realpath' function. */
-#define HAVE_REALPATH 1
-
-/* Define to 1 if you have the `rename' function. */
-#define HAVE_RENAME 1
-
-/* Define to 1 if you have the `rindex' function. */
-#define HAVE_RINDEX 1
-
-/* Define to 1 if you have the `sbrk' function. */
-/* #undef HAVE_SBRK */
-
-/* Define to 1 if you have the `setenv' function. */
-#define HAVE_SETENV 1
-
-/* Define to 1 if you have the `sigsetmask' function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define to 1 if you have the `snprintf' function. */
-#define HAVE_SNPRINTF 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdio_ext.h> header file. */
-/* #undef HAVE_STDIO_EXT_H */
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `stpcpy' function. */
-#define HAVE_STPCPY 1
-
-/* Define to 1 if you have the `stpncpy' function. */
-#define HAVE_STPNCPY 1
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#define HAVE_STRCASECMP 1
-
-/* Define to 1 if you have the `strchr' function. */
-#define HAVE_STRCHR 1
-
-/* Define to 1 if you have the `strdup' function. */
-#define HAVE_STRDUP 1
-
-/* Define to 1 if you have the `strerror' function. */
-#define HAVE_STRERROR 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the `strncasecmp' function. */
-#define HAVE_STRNCASECMP 1
-
-/* Define to 1 if you have the `strndup' function. */
-#define HAVE_STRNDUP 1
-
-/* Define to 1 if you have the `strrchr' function. */
-#define HAVE_STRRCHR 1
-
-/* Define to 1 if you have the `strsignal' function. */
-#define HAVE_STRSIGNAL 1
-
-/* Define to 1 if you have the `strstr' function. */
-#define HAVE_STRSTR 1
-
-/* Define to 1 if you have the `strtod' function. */
-#define HAVE_STRTOD 1
-
-/* Define to 1 if you have the `strtol' function. */
-#define HAVE_STRTOL 1
-
-/* Define to 1 if you have the `strtoul' function. */
-#define HAVE_STRTOUL 1
-
-/* Define to 1 if you have the `strverscmp' function. */
-/* #undef HAVE_STRVERSCMP */
-
-/* Define to 1 if you have the `sysconf' function. */
-#define HAVE_SYSCONF 1
-
-/* Define to 1 if you have the `sysctl' function. */
-#define HAVE_SYSCTL 1
-
-/* Define to 1 if you have the `sysmp' function. */
-/* #undef HAVE_SYSMP */
-
-/* Define if you have the sys_errlist variable. */
-#define HAVE_SYS_ERRLIST 1
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#define HAVE_SYS_MMAN_H 1
-
-/* Define if you have the sys_nerr variable. */
-#define HAVE_SYS_NERR 1
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define to 1 if you have the <sys/pstat.h> header file. */
-/* #undef HAVE_SYS_PSTAT_H */
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#define HAVE_SYS_RESOURCE_H 1
-
-/* Define if you have the sys_siglist variable. */
-#define HAVE_SYS_SIGLIST 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/sysctl.h> header file. */
-#define HAVE_SYS_SYSCTL_H 1
-
-/* Define to 1 if you have the <sys/sysinfo.h> header file. */
-/* #undef HAVE_SYS_SYSINFO_H */
-
-/* Define to 1 if you have the <sys/sysmp.h> header file. */
-/* #undef HAVE_SYS_SYSMP_H */
-
-/* Define to 1 if you have the <sys/systemcfg.h> header file. */
-/* #undef HAVE_SYS_SYSTEMCFG_H */
-
-/* Define to 1 if you have the <sys/table.h> header file. */
-/* #undef HAVE_SYS_TABLE_H */
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define to 1 if you have the `table' function. */
-/* #undef HAVE_TABLE */
-
-/* Define to 1 if you have the `times' function. */
-#define HAVE_TIMES 1
-
-/* Define to 1 if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define to 1 if you have the `tmpnam' function. */
-#define HAVE_TMPNAM 1
-
-/* Define if you have the \`uintptr_t' type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if you have the `vasprintf' function. */
-#define HAVE_VASPRINTF 1
-
-/* Define to 1 if you have the `vfork' function. */
-#define HAVE_VFORK 1
-
-/* Define to 1 if you have the <vfork.h> header file. */
-/* #undef HAVE_VFORK_H */
-
-/* Define to 1 if you have the `vfprintf' function. */
-#define HAVE_VFPRINTF 1
-
-/* Define to 1 if you have the `vprintf' function. */
-#define HAVE_VPRINTF 1
-
-/* Define to 1 if you have the `vsnprintf' function. */
-#define HAVE_VSNPRINTF 1
-
-/* Define to 1 if you have the `vsprintf' function. */
-#define HAVE_VSPRINTF 1
-
-/* Define to 1 if you have the `wait3' function. */
-#define HAVE_WAIT3 1
-
-/* Define to 1 if you have the `wait4' function. */
-#define HAVE_WAIT4 1
-
-/* Define to 1 if you have the `waitpid' function. */
-#define HAVE_WAITPID 1
-
-/* Define to 1 if `fork' works. */
-#define HAVE_WORKING_FORK 1
-
-/* Define to 1 if `vfork' works. */
-#define HAVE_WORKING_VFORK 1
-
-/* Define to 1 if you have the `_doprnt' function. */
-/* #undef HAVE__DOPRNT */
-
-/* Define if you have the _system_configuration variable. */
-/* #undef HAVE__SYSTEM_CONFIGURATION */
-
-/* Define to 1 if you have the `__fsetlocking' function. */
-/* #undef HAVE___FSETLOCKING */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if errno must be declared even when <errno.h> is included. */
-/* #undef NEED_DECLARATION_ERRNO */
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-/* #undef NO_MINUS_C_MINUS_O */
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME ""
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING ""
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME ""
-
-/* Define to the version of this package. */
-/* #define PACKAGE_VERSION "" */
-
-/* The size of a `int', as computed by sizeof. */
-/* #define SIZEOF_INT 4 */
-
-/* Define if you know the direction of stack growth for your system; otherwise
- it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows
- toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#define STACK_DIRECTION -1
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
-
-/* Define to an unsigned 64-bit type available in the compiler. */
-#define UNSIGNED_64BIT_TYPE uint64_t
-
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-#if defined(__powerpc__) || defined(__sparc64__)
-# define WORDS_BIGENDIAN 1
-#endif
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-/* #undef inline */
-#endif
-
-/* Define to `int' if <sys/types.h> does not define. */
-/* #undef pid_t */
-
-/* Define to `unsigned long' if <sys/types.h> does not define. */
-/* #undef uintptr_t */
-
-/* Define as `fork' if `vfork' does not work. */
-/* #undef vfork */
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile b/gnu/usr.bin/binutils/libopcodes/Makefile
deleted file mode 100644
index eb6f273bc80a..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# $FreeBSD$
-
-.include "../Makefile.inc0"
-
-.PATH: ${SRCDIR}/opcodes
-
-LIB= opcodes
-SRCS+= dis-buf.c dis-init.c disassemble.c i386-opc.c
-CFLAGS+= -D_GNU_SOURCE
-CFLAGS+= -I${SRCDIR}/opcodes -I${SRCDIR}/bfd
-INTERNALLIB=
-
-# If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
-# binutils release. FreeBSD only distributes the bits that are required to
-# build native architectures. BINUTILSDISTDIR is needed to build cross tools.
-.if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
-.PATH: ${BINUTILSDISTDIR}/bfd ${BINUTILSDISTDIR}/opcodes
-CFLAGS+= -I${BINUTILSDISTDIR}/opcodes -I${BINUTILSDISTDIR}/bfd
-CFLAGS+= -I${BINUTILSDISTDIR}/include
-.endif
-
-.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile.amd64 b/gnu/usr.bin/binutils/libopcodes/Makefile.amd64
deleted file mode 100644
index 5b1ce3a96896..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/Makefile.amd64
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-SRCS+= i386-dis.c
-CFLAGS+= -DARCH_i386
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile.arm b/gnu/usr.bin/binutils/libopcodes/Makefile.arm
deleted file mode 100644
index 67bb751db477..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/Makefile.arm
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-SRCS+= arm-dis.c
-CFLAGS+= -DARCH_arm
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile.depend b/gnu/usr.bin/binutils/libopcodes/Makefile.depend
deleted file mode 100644
index 18be76b0cb6f..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/Makefile.depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- include \
- include/xlocale \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile.i386 b/gnu/usr.bin/binutils/libopcodes/Makefile.i386
deleted file mode 100644
index 5b1ce3a96896..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/Makefile.i386
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-SRCS+= i386-dis.c
-CFLAGS+= -DARCH_i386
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile.m68k b/gnu/usr.bin/binutils/libopcodes/Makefile.m68k
deleted file mode 100644
index 927e2a1ea5cb..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/Makefile.m68k
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# $FreeBSD$
-#
-
-SRCS+= m68k-dis.c m68k-opc.c
-CFLAGS+= -DARCH_m68k
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile.mips b/gnu/usr.bin/binutils/libopcodes/Makefile.mips
deleted file mode 100644
index 4265de008753..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/Makefile.mips
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-SRCS+= mips-dis.c mips-opc.c mips16-opc.c
-CFLAGS+= -DARCH_mips
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc b/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc
deleted file mode 100644
index cc010ec4a306..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-SRCS+= ppc-dis.c ppc-opc.c
-CFLAGS+= -DARCH_powerpc -DARCH_rs6000
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile.sparc b/gnu/usr.bin/binutils/libopcodes/Makefile.sparc
deleted file mode 100644
index 190b76621cc0..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/Makefile.sparc
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# $FreeBSD$
-#
-
-SRCS+= sparc-dis.c sparc-opc.c
-CFLAGS+= -DARCH_sparc
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile.sparc64 b/gnu/usr.bin/binutils/libopcodes/Makefile.sparc64
deleted file mode 100644
index e795ad494bba..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/Makefile.sparc64
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-SRCS+= sparc-dis.c sparc-opc.c
-CFLAGS+= -DARCH_sparc
diff --git a/gnu/usr.bin/binutils/libopcodes/config.h b/gnu/usr.bin/binutils/libopcodes/config.h
deleted file mode 100644
index f77d5e0a4256..000000000000
--- a/gnu/usr.bin/binutils/libopcodes/config.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated by configure. */
-/* config.in. Generated from configure.in by autoheader. */
-
-/* Define to 1 if translation of program messages to the user's native
- language is requested. */
-/* #undef ENABLE_NLS */
-
-/* Define to 1 if you have the declaration of `basename', and to 0 if you
- don't. */
-#define HAVE_DECL_BASENAME 0
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#define LT_OBJDIR ".libs/"
-
-/* Name of package */
-#define PACKAGE "opcodes"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME ""
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING ""
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION ""
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-/* #define VERSION "2.17.50" */
diff --git a/gnu/usr.bin/binutils/update.sh b/gnu/usr.bin/binutils/update.sh
deleted file mode 100755
index 976cf3ec61c6..000000000000
--- a/gnu/usr.bin/binutils/update.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#! /bin/sh
-#
-# $FreeBSD$
-#
-# This script installs the main files generated by the binutils
-# "configure" scripts and makefiles. It can be used for upgrading to
-# a new version of binutils.
-#
-# Don't forget to change the VERSION definition in the top level
-# "Makefile.inc0".
-
-gnudir=$(pwd)
-contribdir="${gnudir}/../../../contrib/binutils"
-platform="`uname -m`"
-
-rm -rf build
-mkdir build
-
-echo "binutils elf configuration for $platform"
-
-(cd build
- ${contribdir}/configure $platform-unknown-freebsd || exit
- (cd gas
- echo "Updating as"
- make config.h || exit
- cp config.h ${gnudir}/as/$platform/config.h || exit
- )
- (cd ld
- echo "Updating ld"
- make config.h ldemul-list.h || exit
- cp config.h ${gnudir}/ld || exit
- cp ldemul-list.h ${gnudir}/ld/$platform || exit
- )
- (cd bfd
- echo "Updating libbfd"
- make bfd.h config.h || exit
- cp bfd.h ${gnudir}/libbfd/$platform || exit
- cp config.h ${gnudir}/libbfd/$platform || exit
- )
- (cd binutils
- echo "Updating libbinutils"
- make config.h || exit
- cp config.h ${gnudir}/libbinutils/config.h || exit
- )
- )
-
-rm -rf build
diff --git a/gnu/usr.bin/gdb/Makefile b/gnu/usr.bin/gdb/Makefile
deleted file mode 100644
index 114c335fd0fd..000000000000
--- a/gnu/usr.bin/gdb/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# $FreeBSD$
-
-.include <src.opts.mk>
-
-SUBDIR= libgdb gdb kgdb
-
-.include <bsd.subdir.mk>
diff --git a/gnu/usr.bin/gdb/Makefile.inc b/gnu/usr.bin/gdb/Makefile.inc
deleted file mode 100644
index a668a487d218..000000000000
--- a/gnu/usr.bin/gdb/Makefile.inc
+++ /dev/null
@@ -1,73 +0,0 @@
-# $FreeBSD$
-
-.include <src.opts.mk>
-
-WARNS?= 0
-
-VERSION= "6.1.1 [FreeBSD]"
-VENDOR= marcel
-
-PACKAGE= gdb
-
-BMAKE_GDB= ${.CURDIR:H}
-BMAKE_ROOT= ${BMAKE_GDB:H}
-BMAKE_BU= ${BMAKE_ROOT}/binutils
-
-CNTRB_BU= ${SRCTOP}/contrib/binutils
-CNTRB_GDB= ${SRCTOP}/contrib/gdb
-
-OBJ_BU= ${OBJTOP}/gnu/usr.bin/binutils
-OBJ_GDB= ${OBJTOP}/gnu/usr.bin/gdb
-
-# These assignments duplicate much of the functionality of
-# MACHINE_CPUARCH, but there's no easy way to export make functions...
-
-.if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}}
-.else
-TARGET_CPUARCH=${MACHINE_CPUARCH}
-.endif
-TARGET_ARCH?= ${MACHINE_ARCH}
-TARGET_SUBDIR= ${BMAKE_GDB}/arch/${TARGET_CPUARCH}
-
-.if ${TARGET_ARCH} != ${MACHINE_ARCH}
-GDB_CROSS_DEBUGGER=
-.endif
-
-.PATH: ${CNTRB_GDB}/gdb ${CNTRB_GDB}/gdb/cli ${CNTRB_GDB}/gdb/mi \
- ${CNTRB_GDB}/gdb/signals ${CNTRB_GDB}/gdb/tui ${TARGET_SUBDIR}
-
-CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1
-CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\"
-CFLAGS+= -I.
-CFLAGS+= -I${TARGET_SUBDIR}
-CFLAGS+= -I${BMAKE_BU}/libbfd -I${BMAKE_BU}/libbfd/${TARGET_CPUARCH}
-CFLAGS+= -I${CNTRB_GDB}/gdb
-CFLAGS+= -I${CNTRB_GDB}/gdb/config
-CFLAGS+= -I${CNTRB_BU}/include
-CFLAGS+= -I${CNTRB_GDB}/include
-CFLAGS+= -I${CNTRB_BU}/bfd
-CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
-
-# Some bits here currently rely on some of the linker-merging magic that happens
-# with -fcommon. While this is the default right now, explicitly set -fcommon
-# so that it continues to build when the default flips.
-CFCOMMONFLAG= -fcommon
-
-GENSRCS+= nm.h tm.h
-
-.if defined(GDB_CROSS_DEBUGGER)
-CFLAGS+= -DCROSS_DEBUGGER -I${BMAKE_ROOT:H:H}
-GDB_SUFFIX= -${TARGET_ARCH}
-MAN=
-.else
-BINDIR?= /usr/libexec
-MAN=
-.endif
-
-.include "${TARGET_SUBDIR}/Makefile"
-
-SRCS+= ${GENSRCS}
-CLEANFILES+= ${GENSRCS}
-
-.include "../Makefile.inc"
diff --git a/gnu/usr.bin/gdb/arch/amd64/Makefile b/gnu/usr.bin/gdb/arch/amd64/Makefile
deleted file mode 100644
index a43e894e749c..000000000000
--- a/gnu/usr.bin/gdb/arch/amd64/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-# $FreeBSD$
-
-GENSRCS+= xm.h
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
-LIBSRCS+= amd64-nat.c amd64bsd-nat.c amd64fbsd-nat.c
-.endif
-LIBSRCS+= solib.c solib-svr4.c
-LIBSRCS+= amd64-tdep.c amd64fbsd-tdep.c i386-tdep.c i386bsd-tdep.c \
- i386fbsd-tdep-fixed.c i387-tdep.c
-
-nm.h:
- echo '#include "i386/nm-fbsd64.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "i386/tm-fbsd.h"' > ${.TARGET}
-
-xm.h:
- echo '#include "i386/xm-i386.h"' > ${.TARGET}
-
-# Fix source static/extern mismatch nits that GCC 4.2 warns about.
-CLEANFILES+= i386fbsd-tdep-fixed.c
-i386fbsd-tdep-fixed.c: i386fbsd-tdep.c
- sed -e '48s/^static //' ${.ALLSRC} > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/amd64/config.h b/gnu/usr.bin/gdb/arch/amd64/config.h
deleted file mode 100644
index 6908c793ece9..000000000000
--- a/gnu/usr.bin/gdb/arch/amd64/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #undef HAVE_STRUCT_REG_R_FS */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #undef HAVE_STRUCT_REG_R_GS */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-#define GDB_XM_FILE config/i386/xm-i386.h
-
-/* targetfile */
-#define GDB_TM_FILE config/i386/tm-fbsd.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/i386/nm-fbsd64.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_i386_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf64_x86_64_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/amd64/init.c b/gnu/usr.bin/gdb/arch/amd64/init.c
deleted file mode 100644
index 1b296f4a9406..000000000000
--- a/gnu/usr.bin/gdb/arch/amd64/init.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_amd64fbsd_tdep;
-extern initialize_file_ftype _initialize_i386_tdep;
-extern initialize_file_ftype _initialize_i386bsd_tdep;
-extern initialize_file_ftype _initialize_i386fbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_amd64fbsd_nat;
-extern initialize_file_ftype _initialize_gcore;
-extern initialize_file_ftype _initialize_fbsd_proc;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_amd64fbsd_tdep ();
- _initialize_i386_tdep ();
- _initialize_i386bsd_tdep ();
- _initialize_i386fbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_amd64fbsd_nat ();
- _initialize_gcore ();
- _initialize_fbsd_proc ();
- _initialize_thread_db ();
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/arm/Makefile b/gnu/usr.bin/gdb/arch/arm/Makefile
deleted file mode 100644
index 22aee06a7bf4..000000000000
--- a/gnu/usr.bin/gdb/arch/arm/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# $FreeBSD$
-
-GENSRCS+= xm.h
-LIBSRCS+= armfbsd-nat.c
-LIBSRCS+= arm-tdep.c armfbsd-tdep.c solib.c solib-svr4.c
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-threads.c
-.endif
-
-nm.h:
-#XXX this should be arm/nm-fbsd.h but won't until it's merged into the gdb repo
- echo '#include "nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
-#XXX this should be arm/tm-fbsd.h
- echo '#include "tm-fbsd.h"' > ${.TARGET}
-
-xm.h:
-#XXX this should be arm/xm-fbsd.h
- echo '#include "xm-fbsd.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c b/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c
deleted file mode 100644
index 674deffaa3f5..000000000000
--- a/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c
+++ /dev/null
@@ -1,552 +0,0 @@
-/* $FreeBSD$ */
-
- /* Native-dependent code for BSD Unix running on ARM's, for GDB.
- Copyright 1988, 1989, 1991, 1992, 1994, 1996, 1999, 2002
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-
-#ifndef FETCH_INFERIOR_REGISTERS
-#ifndef CROSS_DEBUGGER
-#error Not FETCH_INFERIOR_REGISTERS
-#endif
-#endif /* !FETCH_INFERIOR_REGISTERS */
-
-#include "arm-tdep.h"
-
-#include <sys/types.h>
-#ifndef CROSS_DEBUGGER
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-#include <machine/frame.h>
-#endif
-#include "inferior.h"
-#include "regcache.h"
-#include "gdbcore.h"
-
-extern int arm_apcs_32;
-
-#ifdef CROSS_DEBUGGER
-struct reg {
- unsigned int r[13];
- unsigned int r_sp;
- unsigned int r_lr;
- unsigned int r_pc;
- unsigned int r_cpsr;
-};
-
-typedef struct fp_extended_precision {
- u_int32_t fp_exponent;
- u_int32_t fp_mantissa_hi;
- u_int32_t fp_mantissa_lo;
-} fp_extended_precision_t;
-
-typedef struct fp_extended_precision fp_reg_t;
-
-struct fpreg {
- unsigned int fpr_fpsr;
- fp_reg_t fpr[8];
-};
-#endif
-
-void
-supply_gregset (struct reg *gregset)
-{
- int regno;
- CORE_ADDR r_pc;
-
- /* Integer registers. */
- for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++)
- supply_register (regno, (char *) &gregset->r[regno]);
-
- supply_register (ARM_SP_REGNUM, (char *) &gregset->r_sp);
- supply_register (ARM_LR_REGNUM, (char *) &gregset->r_lr);
- supply_register (ARM_PC_REGNUM, (char *) &gregset->r_pc);
-
- if (arm_apcs_32)
- supply_register (ARM_PS_REGNUM, (char *) &gregset->r_cpsr);
- else
- supply_register (ARM_PS_REGNUM, (char *) &gregset->r_pc);
-}
-
-/* Fill register REGNO (if it is a general-purpose register) in
- *GREGSETPS with the value in GDB's register array. If REGNO is -1,
- do this for all registers. */
-
-void
-fill_gregset (struct reg *gregset, int regno)
-{
- int i;
-
- for (i = ARM_A1_REGNUM; i < ARM_SP_REGNUM; i++)
- if ((regno == -1 || regno == i))
- regcache_collect (i, &gregset->r[i]);
- if (regno == -1 || regno == ARM_SP_REGNUM)
- regcache_collect (ARM_SP_REGNUM, &gregset->r_sp);
- if (regno == -1 || regno == ARM_LR_REGNUM)
- regcache_collect (ARM_LR_REGNUM, &gregset->r_lr);
- if (regno == -1 || regno == ARM_PC_REGNUM)
- regcache_collect (ARM_PC_REGNUM, &gregset->r_pc);
- if (regno == -1 || regno == ARM_PS_REGNUM)
- regcache_collect (ARM_PS_REGNUM, &gregset->r_cpsr);
-}
-
-void
-supply_fpregset (struct fpreg *fparegset)
-{
- int regno;
-
- for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
- supply_register
- (regno, (char *) &fparegset->fpr[regno - ARM_F0_REGNUM]);
-
- supply_register (ARM_FPS_REGNUM, (char *) &fparegset->fpr_fpsr);
-}
-
-void
-fill_fpregset (struct fpreg *fparegset, int regno)
-{
- int i;
-
- for (i = ARM_F0_REGNUM; i <= ARM_F7_REGNUM; i++)
- if (regno == -1 || regno == i)
- regcache_raw_supply(current_regcache, i,
- &fparegset->fpr[i - ARM_F0_REGNUM]);
- if (regno == -1 || regno == ARM_FPS_REGNUM)
- regcache_raw_supply(current_regcache, ARM_FPS_REGNUM,
- &fparegset->fpr_fpsr);
-}
-
-static void
-fetch_register (int regno)
-{
- struct reg inferior_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-
- ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch general register");
- return;
- }
-#endif
-
- switch (regno)
- {
- case ARM_SP_REGNUM:
- supply_register (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
- break;
-
- case ARM_LR_REGNUM:
- supply_register (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
- break;
-
- case ARM_PC_REGNUM:
- /* This is ok: we're running native... */
- inferior_registers.r_pc = ADDR_BITS_REMOVE (inferior_registers.r_pc);
- supply_register (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
- break;
-
- case ARM_PS_REGNUM:
- if (arm_apcs_32)
- supply_register (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr);
- else
- supply_register (ARM_PS_REGNUM, (char *) &inferior_registers.r_pc);
- break;
-
- default:
- supply_register (regno, (char *) &inferior_registers.r[regno]);
- break;
- }
-}
-
-static void
-fetch_regs (void)
-{
- struct reg inferior_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-#endif
- int regno;
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch general registers");
- return;
- }
-#endif
-
- supply_gregset (&inferior_registers);
-}
-
-static void
-fetch_fp_register (int regno)
-{
- struct fpreg inferior_fp_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-
- ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch floating-point register");
- return;
- }
-#endif
-
- switch (regno)
- {
- case ARM_FPS_REGNUM:
- supply_register (ARM_FPS_REGNUM,
- (char *) &inferior_fp_registers.fpr_fpsr);
- break;
-
- default:
- supply_register
- (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
- break;
- }
-}
-
-static void
-fetch_fp_regs (void)
-{
- struct fpreg inferior_fp_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-#endif
- int regno;
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch general registers");
- return;
- }
-#endif
-
- supply_fpregset (&inferior_fp_registers);
-}
-
-void
-fetch_inferior_registers (int regno)
-{
- if (regno >= 0)
- {
- if (regno < ARM_F0_REGNUM || regno > ARM_FPS_REGNUM)
- fetch_register (regno);
- else
- fetch_fp_register (regno);
- }
- else
- {
- fetch_regs ();
- fetch_fp_regs ();
- }
-}
-
-
-static void
-store_register (int regno)
-{
- struct reg inferior_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-
- ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch general registers");
- return;
- }
-#endif
-
- switch (regno)
- {
- case ARM_SP_REGNUM:
- regcache_collect (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
- break;
-
- case ARM_LR_REGNUM:
- regcache_collect (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
- break;
-
- case ARM_PC_REGNUM:
- if (arm_apcs_32)
- regcache_collect (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
- else
- {
- unsigned pc_val;
-
- regcache_collect (ARM_PC_REGNUM, (char *) &pc_val);
-
- pc_val = ADDR_BITS_REMOVE (pc_val);
- inferior_registers.r_pc
- ^= ADDR_BITS_REMOVE (inferior_registers.r_pc);
- inferior_registers.r_pc |= pc_val;
- }
- break;
-
- case ARM_PS_REGNUM:
- if (arm_apcs_32)
- regcache_collect (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr);
- else
- {
- unsigned psr_val;
-
- regcache_collect (ARM_PS_REGNUM, (char *) &psr_val);
-
- psr_val ^= ADDR_BITS_REMOVE (psr_val);
- inferior_registers.r_pc = ADDR_BITS_REMOVE (inferior_registers.r_pc);
- inferior_registers.r_pc |= psr_val;
- }
- break;
-
- default:
- regcache_collect (regno, (char *) &inferior_registers.r[regno]);
- break;
- }
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-
- if (ret < 0)
- warning ("unable to write register %d to inferior", regno);
-#endif
-}
-
-static void
-store_regs (void)
-{
- struct reg inferior_registers;
- int ret;
- int regno;
-
-
- for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++)
- regcache_collect (regno, (char *) &inferior_registers.r[regno]);
-
- regcache_collect (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
- regcache_collect (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
-
- if (arm_apcs_32)
- {
- regcache_collect (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
- regcache_collect (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr);
- }
- else
- {
- unsigned pc_val;
- unsigned psr_val;
-
- regcache_collect (ARM_PC_REGNUM, (char *) &pc_val);
- regcache_collect (ARM_PS_REGNUM, (char *) &psr_val);
-
- pc_val = ADDR_BITS_REMOVE (pc_val);
- psr_val ^= ADDR_BITS_REMOVE (psr_val);
-
- inferior_registers.r_pc = pc_val | psr_val;
- }
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-
- if (ret < 0)
- warning ("unable to store general registers");
-#endif
-}
-
-static void
-store_fp_register (int regno)
-{
- struct fpreg inferior_fp_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-
- ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch floating-point registers");
- return;
- }
-#endif
-
- switch (regno)
- {
- case ARM_FPS_REGNUM:
- regcache_collect (ARM_FPS_REGNUM,
- (char *) &inferior_fp_registers.fpr_fpsr);
- break;
-
- default:
- regcache_collect
- (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
- break;
- }
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-
- if (ret < 0)
- warning ("unable to write register %d to inferior", regno);
-#endif
-}
-
-static void
-store_fp_regs (void)
-{
- struct fpreg inferior_fp_registers;
- int ret;
- int regno;
-
-
- for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
- regcache_collect
- (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
-
- regcache_collect (ARM_FPS_REGNUM, (char *) &inferior_fp_registers.fpr_fpsr);
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-
- if (ret < 0)
- warning ("unable to store floating-point registers");
-#endif
-}
-
-void
-store_inferior_registers (int regno)
-{
- if (regno >= 0)
- {
- if (regno < ARM_F0_REGNUM || regno > ARM_FPS_REGNUM)
- store_register (regno);
- else
- store_fp_register (regno);
- }
- else
- {
- store_regs ();
- store_fp_regs ();
- }
-}
-
-
-struct md_core
-{
- struct reg intreg;
- struct fpreg freg;
-};
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
- int which, CORE_ADDR ignore)
-{
- struct md_core *core_reg = (struct md_core *) core_reg_sect;
- int regno;
- CORE_ADDR r_pc;
-
- supply_gregset (&core_reg->intreg);
- supply_fpregset (&core_reg->freg);
-}
-
-static void
-fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
- int which, CORE_ADDR ignore)
-{
- struct reg gregset;
- struct fpreg fparegset;
-
- switch (which)
- {
- case 0: /* Integer registers. */
- if (core_reg_size != sizeof (struct reg))
- warning ("wrong size of register set in core file");
- else
- {
- /* The memcpy may be unnecessary, but we can't really be sure
- of the alignment of the data in the core file. */
- memcpy (&gregset, core_reg_sect, sizeof (gregset));
- supply_gregset (&gregset);
- }
- break;
-
- case 2:
- if (core_reg_size != sizeof (struct fpreg))
- warning ("wrong size of FPA register set in core file");
- else
- {
- /* The memcpy may be unnecessary, but we can't really be sure
- of the alignment of the data in the core file. */
- memcpy (&fparegset, core_reg_sect, sizeof (fparegset));
- supply_fpregset (&fparegset);
- }
- break;
-
- default:
- /* Don't know what kind of register request this is; just ignore it. */
- break;
- }
-}
-
-static struct core_fns arm_freebsd_core_fns =
-{
- bfd_target_unknown_flavour, /* core_flovour. */
- default_check_format, /* check_format. */
- default_core_sniffer, /* core_sniffer. */
- fetch_core_registers, /* core_read_registers. */
- NULL
-};
-
-static struct core_fns arm_freebsd_elfcore_fns =
-{
- bfd_target_elf_flavour, /* core_flovour. */
- default_check_format, /* check_format. */
- default_core_sniffer, /* core_sniffer. */
- fetch_elfcore_registers, /* core_read_registers. */
- NULL
-};
-
-void
-_initialize_arm_fbsdnat (void)
-{
- add_core_fns (&arm_freebsd_core_fns);
- add_core_fns (&arm_freebsd_elfcore_fns);
-}
diff --git a/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c b/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c
deleted file mode 100644
index 785897dad344..000000000000
--- a/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $FreeBSD$ */
-
-/* Target-specific functions for ARM running under NetBSD.
- Copyright 2002, 2003 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "osabi.h"
-
-#include "arch-utils.h"
-#include "arm-tdep.h"
-#include "solib-svr4.h"
-
-/* Description of the longjmp buffer. */
-#define ARM_FBSD_JB_PC 24
-#define ARM_FBSD_JB_ELEMENT_SIZE INT_REGISTER_SIZE
-
-static void
-arm_freebsd_init_abi_common (struct gdbarch_info info,
- struct gdbarch *gdbarch)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
- tdep->lowest_pc = 0x8000;
-
- tdep->jb_pc = ARM_FBSD_JB_PC;
- tdep->jb_elt_size = ARM_FBSD_JB_ELEMENT_SIZE;
-}
-
-static void
-arm_freebsd_elf_init_abi (struct gdbarch_info info,
- struct gdbarch *gdbarch)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
- arm_freebsd_init_abi_common (info, gdbarch);
-
- /* FreeBSD ELF uses SVR4-style shared libraries. */
- set_gdbarch_in_solib_call_trampoline
- (gdbarch, generic_in_solib_call_trampoline);
- set_solib_svr4_fetch_link_map_offsets
- (gdbarch, svr4_ilp32_fetch_link_map_offsets);
-
- tdep->fp_model = ARM_FLOAT_SOFT_VFP;
-}
-
-void
-_initialize_armfbsd_tdep (void)
-{
- gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_FREEBSD_ELF,
- arm_freebsd_elf_init_abi);
-}
diff --git a/gnu/usr.bin/gdb/arch/arm/config.h b/gnu/usr.bin/gdb/arch/arm/config.h
deleted file mode 100644
index 863f2d9c701b..000000000000
--- a/gnu/usr.bin/gdb/arch/arm/config.h
+++ /dev/null
@@ -1,562 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #define HAVE_STRUCT_REG_R_FS 1 */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #define HAVE_STRUCT_REG_R_GS 1 */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-#if 0
-#define GDB_XM_FILE config/arm/xm-fbsd.h
-#else
-#define GDB_XM_FILE xm-fbsd.h
-#endif
-
-/* targetfile */
-#if 0
-#define GDB_TM_FILE config/arm/tm-fbsd.h
-#else
-#define GDB_TM_FILE tm-fbsd.h
-#endif
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#if 0
-#define GDB_NM_FILE config/arm/nm-fbsd.h
-#else
-#define GDB_NM_FILE nm-fbsd.h
-#endif
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_arm_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf32_littlearm_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/arm/init.c b/gnu/usr.bin/gdb/arch/arm/init.c
deleted file mode 100644
index d4064dadd4ab..000000000000
--- a/gnu/usr.bin/gdb/arch/arm/init.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_arm_tdep;
-extern initialize_file_ftype _initialize_armfbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-#ifndef CROSS_DEBUGGER
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-#endif
-extern initialize_file_ftype _initialize_arm_fbsdnat;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_arm_tdep ();
- _initialize_armfbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_thread_db ();
-#endif
- _initialize_arm_fbsdnat ();
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/arm/nm-fbsd.h b/gnu/usr.bin/gdb/arch/arm/nm-fbsd.h
deleted file mode 100644
index 8134b1a5d88c..000000000000
--- a/gnu/usr.bin/gdb/arch/arm/nm-fbsd.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $FreeBSD$ */
-
-/* Native-dependent definitions for ARM running NetBSD, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1994, 1999 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef NM_FBSD_H
-#define NM_FBSD_H
-
-/* Type of the third argument to the `ptrace' system call. */
-#define PTRACE_ARG3_TYPE caddr_t
-
-/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
-#define FETCH_INFERIOR_REGISTERS
-
-/* We can attach and detach. */
-#define ATTACH_DETACH
-
-#endif /* NM_FBSD_H */
diff --git a/gnu/usr.bin/gdb/arch/arm/tm-fbsd.h b/gnu/usr.bin/gdb/arch/arm/tm-fbsd.h
deleted file mode 100644
index b010a969acf8..000000000000
--- a/gnu/usr.bin/gdb/arch/arm/tm-fbsd.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* $FreeBSD$ */
-
-/* Macro definitions for ARM running under NetBSD.
- Copyright 2003 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_FBSD_H
-#define TM_FBSD_H
-
-#include "solib.h"
-
-#endif /* TM_FBSD_H */
diff --git a/gnu/usr.bin/gdb/arch/arm/xm-fbsd.h b/gnu/usr.bin/gdb/arch/arm/xm-fbsd.h
deleted file mode 100644
index 75f8077564c2..000000000000
--- a/gnu/usr.bin/gdb/arch/arm/xm-fbsd.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* $FreeBSD$ */
-
-/* Parameters for execution on an ARM running NetBSD, for GDB.
- Copyright 1994 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
diff --git a/gnu/usr.bin/gdb/arch/i386/Makefile b/gnu/usr.bin/gdb/arch/i386/Makefile
deleted file mode 100644
index 3d9627890827..000000000000
--- a/gnu/usr.bin/gdb/arch/i386/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-# $FreeBSD$
-
-GENSRCS+= xm.h
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
-LIBSRCS+= i386-nat.c i386bsd-nat.c i386fbsd-nat.c
-.endif
-LIBSRCS+= solib.c solib-svr4.c
-LIBSRCS+= i386-tdep.c i386bsd-tdep.c i386fbsd-tdep-fixed.c i387-tdep.c
-
-nm.h:
- echo '#include "i386/nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "i386/tm-fbsd.h"' > ${.TARGET}
-
-xm.h:
- echo '#include "i386/xm-i386.h"' > ${.TARGET}
-
-# Fix source static/extern mismatch nits that GCC 4.2 warns about.
-CLEANFILES += i386fbsd-tdep-fixed.c
-i386fbsd-tdep-fixed.c: i386fbsd-tdep.c
- sed -e '48s/^static\ //' ${.ALLSRC} > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/i386/config.h b/gnu/usr.bin/gdb/arch/i386/config.h
deleted file mode 100644
index 3f7f579433d5..000000000000
--- a/gnu/usr.bin/gdb/arch/i386/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-#define HAVE_STRUCT_REG_R_FS 1
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-#define HAVE_STRUCT_REG_R_GS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-#define HAVE_PT_GETXMMREGS
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-#define GDB_XM_FILE config/i386/xm-i386.h
-
-/* targetfile */
-#define GDB_TM_FILE config/i386/tm-fbsd.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/i386/nm-fbsd.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_i386_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf32_i386_freebsd_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/i386/init.c b/gnu/usr.bin/gdb/arch/i386/init.c
deleted file mode 100644
index 7675d8e688ce..000000000000
--- a/gnu/usr.bin/gdb/arch/i386/init.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_i386_tdep;
-extern initialize_file_ftype _initialize_i386bsd_tdep;
-extern initialize_file_ftype _initialize_i386fbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_i386_nat;
-extern initialize_file_ftype _initialize_i386bsd_nat;
-extern initialize_file_ftype _initialize_i386fbsd_nat;
-extern initialize_file_ftype _initialize_gcore;
-extern initialize_file_ftype _initialize_fbsd_proc;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_i386_tdep ();
- _initialize_i386bsd_tdep ();
- _initialize_i386fbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_i386_nat ();
- _initialize_i386bsd_nat ();
- _initialize_i386fbsd_nat ();
- _initialize_gcore ();
- _initialize_fbsd_proc ();
- _initialize_thread_db ();
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/mips/Makefile b/gnu/usr.bin/gdb/arch/mips/Makefile
deleted file mode 100644
index 24e9cfce25e5..000000000000
--- a/gnu/usr.bin/gdb/arch/mips/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# $FreeBSD$
-
-#
-# XXX Should set DEFAULT_BFD_VEC based on target.
-#
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= mipsfbsd-nat.c fbsd-threads.c
-.endif
-LIBSRCS+= solib.c solib-svr4.c
-LIBSRCS+= mips-tdep.c mipsfbsd-tdep.c fbsd-proc.c
-
-nm.h:
- echo '#include "mips/nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "mips/tm-fbsd.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/mips/config.h b/gnu/usr.bin/gdb/arch/mips/config.h
deleted file mode 100644
index c0b04cc5e550..000000000000
--- a/gnu/usr.bin/gdb/arch/mips/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #undef HAVE_STRUCT_REG_R_FS */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #undef HAVE_STRUCT_REG_R_GS */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-/* #undef GDB_XM_FILE */
-
-/* targetfile */
-#define GDB_TM_FILE config/mips/tm-fbsd.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/mips/nm-fbsd.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_mips_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf32_littlemips_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/mips/init.c b/gnu/usr.bin/gdb/arch/mips/init.c
deleted file mode 100644
index 491b2b3ee396..000000000000
--- a/gnu/usr.bin/gdb/arch/mips/init.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_mips_tdep;
-extern initialize_file_ftype _initialize_mipsfbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_mipsfbsd_nat;
-extern initialize_file_ftype _initialize_mips_nat;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_svr4_lm;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_mips_tdep ();
- _initialize_mipsfbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
-#if 0
- _initialize_mipsfbsd_nat ();
- _initialize_mips_nat ();
-#endif
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_thread_db ();
-#if 0
- _initialize_svr4_lm ();
-#endif
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/powerpc/Makefile b/gnu/usr.bin/gdb/arch/powerpc/Makefile
deleted file mode 100644
index fa41a237d1f7..000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
-LIBSRCS+= ppcfbsd-nat.c
-.endif
-LIBSRCS+= solib.c solib-svr4.c
-LIBSRCS+= ppc-sysv-tdep.c ppcfbsd-tdep.c rs6000-tdep.c
-
-nm.h:
- echo '#include "powerpc/nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "powerpc/tm-ppc-eabi.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/powerpc/config.h b/gnu/usr.bin/gdb/arch/powerpc/config.h
deleted file mode 100644
index 8686a99d1f56..000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #undef HAVE_STRUCT_REG_R_FS */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #undef HAVE_STRUCT_REG_R_GS */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-/* #undef GDB_XM_FILE */
-
-/* targetfile */
-#define GDB_TM_FILE config/powerpc/tm-ppc-eabi.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/powerpc/nm-fbsd.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_rs6000_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf32_powerpc_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/powerpc/init.c b/gnu/usr.bin/gdb/arch/powerpc/init.c
deleted file mode 100644
index 5b96bd5137a2..000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc/init.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_rs6000_tdep;
-extern initialize_file_ftype _initialize_ppcfbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_fbsd_proc;
-extern initialize_file_ftype _initialize_gcore;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_ppcfbsd_nat;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_rs6000_tdep ();
- _initialize_ppcfbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_fbsd_proc ();
- _initialize_gcore ();
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_ppcfbsd_nat ();
- _initialize_thread_db ();
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/powerpc64/Makefile b/gnu/usr.bin/gdb/arch/powerpc64/Makefile
deleted file mode 100644
index fa41a237d1f7..000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc64/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
-LIBSRCS+= ppcfbsd-nat.c
-.endif
-LIBSRCS+= solib.c solib-svr4.c
-LIBSRCS+= ppc-sysv-tdep.c ppcfbsd-tdep.c rs6000-tdep.c
-
-nm.h:
- echo '#include "powerpc/nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "powerpc/tm-ppc-eabi.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/powerpc64/config.h b/gnu/usr.bin/gdb/arch/powerpc64/config.h
deleted file mode 100644
index 6ec6560e4200..000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc64/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #undef HAVE_STRUCT_REG_R_FS */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #undef HAVE_STRUCT_REG_R_GS */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-/* #undef GDB_XM_FILE */
-
-/* targetfile */
-#define GDB_TM_FILE config/powerpc/tm-ppc-eabi.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/ia64/nm-fbsd.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_rs6000_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf64_powerpc_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/powerpc64/init.c b/gnu/usr.bin/gdb/arch/powerpc64/init.c
deleted file mode 100644
index 5b96bd5137a2..000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc64/init.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_rs6000_tdep;
-extern initialize_file_ftype _initialize_ppcfbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_fbsd_proc;
-extern initialize_file_ftype _initialize_gcore;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_ppcfbsd_nat;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_rs6000_tdep ();
- _initialize_ppcfbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_fbsd_proc ();
- _initialize_gcore ();
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_ppcfbsd_nat ();
- _initialize_thread_db ();
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/sparc64/Makefile b/gnu/usr.bin/gdb/arch/sparc64/Makefile
deleted file mode 100644
index 9d771727e902..000000000000
--- a/gnu/usr.bin/gdb/arch/sparc64/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-threads.c
-LIBSRCS+= solib.c solib-legacy.c solib-svr4.c
-LIBSRCS+= sparc-nat.c sparc64-nat.c sparc64fbsd-nat.c
-.endif
-LIBSRCS+= sparc-tdep.c sparc64-tdep.c sparc64fbsd-tdep.c
-
-nm.h:
- echo '#include "sparc/nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "sparc/tm-fbsd.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/sparc64/config.h b/gnu/usr.bin/gdb/arch/sparc64/config.h
deleted file mode 100644
index 8bcfdb28c8f5..000000000000
--- a/gnu/usr.bin/gdb/arch/sparc64/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #undef HAVE_STRUCT_REG_R_FS */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #undef HAVE_STRUCT_REG_R_GS */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-/* #undef GDB_XM_FILE */
-
-/* targetfile */
-#define GDB_TM_FILE config/sparc/tm-fbsd.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/sparc/nm-fbsd.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_sparc_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf64_sparc_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/sparc64/init.c b/gnu/usr.bin/gdb/arch/sparc64/init.c
deleted file mode 100644
index d2cf24e98079..000000000000
--- a/gnu/usr.bin/gdb/arch/sparc64/init.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_sparc_tdep;
-extern initialize_file_ftype _initialize_sparc64fbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_sparc64fbsd_nat;
-extern initialize_file_ftype _initialize_sparc64_nat;
-extern initialize_file_ftype _initialize_sparc_nat;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_svr4_lm;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_sparc_tdep ();
- _initialize_sparc64fbsd_tdep ();
- _initialize_corelow ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_thread_db ();
- _initialize_sparc64fbsd_nat ();
- _initialize_sparc64_nat ();
- _initialize_sparc_nat ();
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_svr4_lm ();
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/gdb/Makefile b/gnu/usr.bin/gdb/gdb/Makefile
deleted file mode 100644
index 3cf15f6a24a1..000000000000
--- a/gnu/usr.bin/gdb/gdb/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# $FreeBSD$
-
-PROG= gdb${GDB_SUFFIX}
-SRCS= gdb.c
-
-BULIBS= ${OBJ_BU}/libbfd/libbfd${PIE_SUFFIX}.a \
- ${OBJ_BU}/libopcodes/libopcodes${PIE_SUFFIX}.a \
- ${OBJ_BU}/libiberty/libiberty${PIE_SUFFIX}.a
-GDBLIBS= ${OBJ_GDB}/libgdb/libgdb${PIE_SUFFIX}.a
-
-# libthread_db.so calls back into gdb for the proc services. Make all the
-# global symbols visible.
-LDFLAGS+= -Wl,-E
-
-DPADD= ${GDBLIBS} ${BULIBS}
-LDADD= ${GDBLIBS} ${BULIBS}
-LIBADD+= m edit ncursesw gnuregex
-
-.include <bsd.prog.mk>
-CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\"
diff --git a/gnu/usr.bin/gdb/gdb/Makefile.depend b/gnu/usr.bin/gdb/gdb/Makefile.depend
deleted file mode 100644
index ee6269e741a7..000000000000
--- a/gnu/usr.bin/gdb/gdb/Makefile.depend
+++ /dev/null
@@ -1,25 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/csu \
- gnu/lib/libreadline/readline \
- gnu/lib/libregex \
- gnu/usr.bin/binutils/libbfd \
- gnu/usr.bin/binutils/libiberty \
- gnu/usr.bin/binutils/libopcodes \
- gnu/usr.bin/gdb/libgdb \
- include \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
- lib/msun \
- lib/ncurses/ncursesw \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/gdb/gdb/gdb.1 b/gnu/usr.bin/gdb/gdb/gdb.1
deleted file mode 100644
index 635e5c311882..000000000000
--- a/gnu/usr.bin/gdb/gdb/gdb.1
+++ /dev/null
@@ -1,376 +0,0 @@
-.\" Copyright (c) 1991 Free Software Foundation
-.\" See section COPYING for conditions for redistribution
-.\" $FreeBSD$
-.TH gdb 1 "4nov1991" "GNU Tools" "GNU Tools"
-.SH NAME
-gdb \- The GNU Debugger
-.SH SYNOPSIS
-.na
-.TP
-.B gdb
-.RB "[\|" \-help "\|]"
-.RB "[\|" \-nx "\|]"
-.RB "[\|" \-q "\|]"
-.RB "[\|" \-batch "\|]"
-.RB "[\|" \-cd=\c
-.I dir\c
-\|]
-.RB "[\|" \-f "\|]"
-.RB "[\|" "\-b\ "\c
-.IR bps "\|]"
-.RB "[\|" "\-tty="\c
-.IR dev "\|]"
-.RB "[\|" "\-s "\c
-.I symfile\c
-\&\|]
-.RB "[\|" "\-e "\c
-.I prog\c
-\&\|]
-.RB "[\|" "\-se "\c
-.I prog\c
-\&\|]
-.RB "[\|" "\-c "\c
-.I core\c
-\&\|]
-.RB "[\|" "\-x "\c
-.I cmds\c
-\&\|]
-.RB "[\|" "\-d "\c
-.I dir\c
-\&\|]
-.RB "[\|" \c
-.I prog\c
-.RB "[\|" \c
-.IR core \||\| procID\c
-\&\|]\&\|]
-.ad b
-.SH DEPRECATION NOTICE
-This version of gdb is deprecated and will be removed from future versions
-of the FreeBSD base system.
-A newer version of gdb is available from ports or packages
-(devel/gdb).
-.SH DESCRIPTION
-The purpose of a debugger such as GDB is to allow you to see what is
-going on ``inside'' another program while it executes\(em\&or what another
-program was doing at the moment it crashed.
-
-GDB can do four main kinds of things (plus other things in support of
-these) to help you catch bugs in the act:
-
-.TP
-\ \ \ \(bu
-Start your program, specifying anything that might affect its behavior.
-
-.TP
-\ \ \ \(bu
-Make your program stop on specified conditions.
-
-.TP
-\ \ \ \(bu
-Examine what has happened, when your program has stopped.
-
-.TP
-\ \ \ \(bu
-Change things in your program, so you can experiment with correcting the
-effects of one bug and go on to learn about another.
-.PP
-
-You can use GDB to debug programs written in C, C++, and Modula-2.
-Fortran support will be added when a GNU Fortran compiler is ready.
-
-GDB is invoked with the shell command \c
-.B gdb\c
-\&. Once started, it reads
-commands from the terminal until you tell it to exit with the GDB
-command \c
-.B quit\c
-\&. You can get online help from \c
-.B gdb\c
-\& itself
-by using the command \c
-.B help\c
-\&.
-
-You can run \c
-.B gdb\c
-\& with no arguments or options; but the most
-usual way to start GDB is with one argument or two, specifying an
-executable program as the argument:
-.sp
-.br
-gdb\ program
-.br
-.sp
-
-You can also start with both an executable program and a core file specified:
-.sp
-.br
-gdb\ program\ core
-.br
-.sp
-
-You can, instead, specify a process ID as a second argument, if you want
-to debug a running process:
-.sp
-.br
-gdb\ program\ 1234
-.br
-.sp
-
-would attach GDB to process \c
-.B 1234\c
-\& (unless you also have a file
-named `\|\c
-.B 1234\c
-\&\|'; GDB does check for a core file first).
-
-Here are some of the most frequently needed GDB commands:
-.TP
-.B break \fR[\|\fIfile\fB:\fR\|]\fIfunction
-\&
-Set a breakpoint at \c
-.I function\c
-\& (in \c
-.I file\c
-\&).
-.TP
-.B run \fR[\|\fIarglist\fR\|]
-Start your program (with \c
-.I arglist\c
-\&, if specified).
-.TP
-.B bt
-Backtrace: display the program stack.
-.TP
-.BI print " expr"\c
-\&
-Display the value of an expression.
-.TP
-.B c
-Continue running your program (after stopping, e.g. at a breakpoint).
-.TP
-.B next
-Execute next program line (after stopping); step \c
-.I over\c
-\& any
-function calls in the line.
-.TP
-.B step
-Execute next program line (after stopping); step \c
-.I into\c
-\& any
-function calls in the line.
-.TP
-.B help \fR[\|\fIname\fR\|]
-Show information about GDB command \c
-.I name\c
-\&, or general information
-about using GDB.
-.TP
-.B quit
-Exit from GDB.
-.PP
-For full details on GDB, see \c
-.I
-Using GDB: A Guide to the GNU Source-Level Debugger\c
-\&, by Richard M. Stallman and Roland H. Pesch. The same text is available online
-as the \c
-.B gdb\c
-\& entry in the \c
-.B info\c
-\& program.
-.SH OPTIONS
-Any arguments other than options specify an executable
-file and core file (or process ID); that is, the first argument
-encountered with no
-associated option flag is equivalent to a `\|\c
-.B \-se\c
-\&\|' option, and the
-second, if any, is equivalent to a `\|\c
-.B \-c\c
-\&\|' option if it's the name of a file. Many options have
-both long and short forms; both are shown here. The long forms are also
-recognized if you truncate them, so long as enough of the option is
-present to be unambiguous. (If you prefer, you can flag option
-arguments with `\|\c
-.B +\c
-\&\|' rather than `\|\c
-.B \-\c
-\&\|', though we illustrate the
-more usual convention.)
-
-All the options and command line arguments you give are processed
-in sequential order. The order makes a difference when the
-`\|\c
-.B \-x\c
-\&\|' option is used.
-
-.TP
-.B \-help
-.TP
-.B \-h
-List all options, with brief explanations.
-
-.TP
-.BI "\-symbols=" "file"\c
-.TP
-.BI "\-s " "file"\c
-\&
-Read symbol table from file \c
-.I file\c
-\&.
-
-.TP
-.BI "\-exec=" "file"\c
-.TP
-.BI "\-e " "file"\c
-\&
-Use file \c
-.I file\c
-\& as the executable file to execute when
-appropriate, and for examining pure data in conjunction with a core
-dump.
-
-.TP
-.BI "\-se=" "file"\c
-\&
-Read symbol table from file \c
-.I file\c
-\& and use it as the executable
-file.
-
-.TP
-.BI "\-core=" "file"\c
-.TP
-.BI "\-c " "file"\c
-\&
-Use file \c
-.I file\c
-\& as a core dump to examine.
-
-.TP
-.BI "\-command=" "file"\c
-.TP
-.BI "\-x " "file"\c
-\&
-Execute GDB commands from file \c
-.I file\c
-\&.
-
-.TP
-.BI "\-directory=" "directory"\c
-.TP
-.BI "\-d " "directory"\c
-\&
-Add \c
-.I directory\c
-\& to the path to search for source files.
-.PP
-
-.TP
-.B \-nx
-.TP
-.B \-n
-Do not execute commands from any `\|\c
-.B .gdbinit\c
-\&\|' initialization files.
-Normally, the commands in these files are executed after all the
-command options and arguments have been processed.
-
-
-.TP
-.B \-quiet
-.TP
-.B \-q
-``Quiet''. Do not print the introductory and copyright messages. These
-messages are also suppressed in batch mode.
-
-.TP
-.B \-batch
-Run in batch mode. Exit with status \c
-.B 0\c
-\& after processing all the command
-files specified with `\|\c
-.B \-x\c
-\&\|' (and `\|\c
-.B .gdbinit\c
-\&\|', if not inhibited).
-Exit with nonzero status if an error occurs in executing the GDB
-commands in the command files.
-
-Batch mode may be useful for running GDB as a filter, for example to
-download and run a program on another computer; in order to make this
-more useful, the message
-.sp
-.br
-Program\ exited\ normally.
-.br
-.sp
-
-(which is ordinarily issued whenever a program running under GDB control
-terminates) is not issued when running in batch mode.
-
-.TP
-.BI "\-cd=" "directory"\c
-\&
-Run GDB using \c
-.I directory\c
-\& as its working directory,
-instead of the current directory.
-
-.TP
-.B \-fullname
-.TP
-.B \-f
-Emacs sets this option when it runs GDB as a subprocess. It tells GDB
-to output the full file name and line number in a standard,
-recognizable fashion each time a stack frame is displayed (which
-includes each time the program stops). This recognizable format looks
-like two `\|\c
-.B \e032\c
-\&\|' characters, followed by the file name, line number
-and character position separated by colons, and a newline. The
-Emacs-to-GDB interface program uses the two `\|\c
-.B \e032\c
-\&\|' characters as
-a signal to display the source code for the frame.
-
-.TP
-.BI "\-b " "bps"\c
-\&
-Set the line speed (baud rate or bits per second) of any serial
-interface used by GDB for remote debugging.
-
-.TP
-.BI "\-tty=" "device"\c
-\&
-Run using \c
-.I device\c
-\& for your program's standard input and output.
-.PP
-
-.SH "SEE ALSO"
-.RB "`\|" gdb "\|'"
-entry in
-.B info\c
-\&;
-.I
-Using GDB: A Guide to the GNU Source-Level Debugger\c
-, Richard M. Stallman and Roland H. Pesch, July 1991.
-.SH COPYING
-Copyright (c) 1991 Free Software Foundation, Inc.
-.PP
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-.PP
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
diff --git a/gnu/usr.bin/gdb/gdbserver/Makefile b/gnu/usr.bin/gdb/gdbserver/Makefile
deleted file mode 100644
index fa46e6de14fa..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# $FreeBSD$
-
-# Not elf specific so don't install in /usr/libexec/elf
-BINDIR=/usr/bin
-
-GDBDIR= ${SRCTOP}/contrib/gdb
-.PATH: ${GDBDIR}/gdb/signals
-.PATH: ${GDBDIR}/gdb/gdbserver
-.PATH: ${GDBDIR}/gdb
-
-PROG= gdbserver
-
-SRCS= inferiors.c mem-break.c regcache.c remote-utils.c \
- server.c signals.c target.c utils.c
-SRCS+= fbsd-low.c
-
-SRCS+= fbsd-${MACHINE_CPUARCH}-low.c reg-${MACHINE_CPUARCH}.c
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-SRCS+= i387-fp.c
-.endif
-#CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH}
-CFLAGS+= -I${GDBDIR}/gdb/gdbserver
-CFLAGS+= -I${GDBDIR}/gdb/regformats
-CFLAGS+= -DNO_MMALLOC -DGDBSERVER
-
-.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/gdb/gdbserver/Makefile.depend b/gnu/usr.bin/gdb/gdbserver/Makefile.depend
deleted file mode 100644
index d5ed563ecfc8..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/Makefile.depend
+++ /dev/null
@@ -1,18 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/csu \
- include \
- include/arpa \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c
deleted file mode 100644
index 82a8c93f3dfb..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/* GNU/FreeBSD/amd64 specific low level interface, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "server.h"
-#include "fbsd-low.h"
-#include "i387-fp.h"
-
-#include <sys/stddef.h>
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-
-/* Mapping between the general-purpose registers in `struct user'
- format and GDB's register array layout. */
-static int amd64_regmap[] = {
- offsetof(struct reg, r_rax),
- offsetof(struct reg, r_rbx),
- offsetof(struct reg, r_rcx),
- offsetof(struct reg, r_rdx),
- offsetof(struct reg, r_rsi),
- offsetof(struct reg, r_rdi),
- offsetof(struct reg, r_rbp),
- offsetof(struct reg, r_rsp),
- offsetof(struct reg, r_r8),
- offsetof(struct reg, r_r9),
- offsetof(struct reg, r_r10),
- offsetof(struct reg, r_r11),
- offsetof(struct reg, r_r12),
- offsetof(struct reg, r_r13),
- offsetof(struct reg, r_r14),
- offsetof(struct reg, r_r15),
- offsetof(struct reg, r_rip),
- offsetof(struct reg, r_rflags), /* XXX 64-bit */
- offsetof(struct reg, r_cs),
- offsetof(struct reg, r_ss),
- offsetof(struct reg, r_ds),
- offsetof(struct reg, r_es),
- offsetof(struct reg, r_fs),
- offsetof(struct reg, r_gs),
-};
-#define AMD64_NUM_REGS (sizeof(amd64_regmap) / sizeof(amd64_regmap[0]))
-
-static const char amd64_breakpoint[] = { 0xCC };
-#define AMD64_BP_LEN 1
-
-extern int debug_threads;
-
-static int
-amd64_cannot_store_register(int regno)
-{
-
- return (regno >= AMD64_NUM_REGS);
-}
-
-static int
-amd64_cannot_fetch_register(int regno)
-{
-
- return (regno >= AMD64_NUM_REGS);
-}
-
-static void
-amd64_fill_gregset(void *buf)
-{
- int i;
-
- for (i = 0; i < AMD64_NUM_REGS; i++)
- collect_register(i, ((char *)buf) + amd64_regmap[i]);
-}
-
-static void
-amd64_store_gregset(const void *buf)
-{
- int i;
-
- for (i = 0; i < AMD64_NUM_REGS; i++)
- supply_register(i, ((char *)buf) + amd64_regmap[i]);
-}
-
-static void
-amd64_fill_fpregset(void *buf)
-{
-
- i387_cache_to_fsave(buf);
-}
-
-static void
-amd64_store_fpregset(const void *buf)
-{
-
- i387_fsave_to_cache(buf);
-}
-
-static void
-amd64_fill_fpxregset(void *buf)
-{
-
- i387_cache_to_fxsave(buf);
-}
-
-static void
-amd64_store_fpxregset(const void *buf)
-{
-
- i387_fxsave_to_cache(buf);
-}
-
-
-struct regset_info target_regsets[] = {
- {
- PT_GETREGS,
- PT_SETREGS,
- sizeof(struct reg),
- GENERAL_REGS,
- amd64_fill_gregset,
- amd64_store_gregset,
- },
-#ifdef HAVE_PTRACE_GETFPXREGS
- {
- PTRACE_GETFPXREGS,
- PTRACE_SETFPXREGS,
- sizeof(elf_fpxregset_t),
- EXTENDED_REGS,
- amd64_fill_fpxregset,
- amd64_store_fpxregset,
- },
-#endif
- {
- PT_GETFPREGS,
- PT_SETFPREGS,
- sizeof(struct fpreg),
- FP_REGS,
- amd64_fill_fpregset,
- amd64_store_fpregset,
- },
- {
- 0,
- 0,
- -1,
- -1,
- NULL,
- NULL,
- }
-};
-
-static CORE_ADDR
-amd64_get_pc(void)
-{
- unsigned long pc;
-
- collect_register_by_name("rip", &pc);
-
- if (debug_threads)
- fprintf(stderr, "stop pc (before any decrement) is %016lx\n", pc);
-
- return (pc);
-}
-
-static void
-amd64_set_pc(CORE_ADDR newpc)
-{
-
- if (debug_threads)
- fprintf(stderr, "set pc to %016lx\n", (long)newpc);
- supply_register_by_name("rip", &newpc);
-}
-
-static int
-amd64_breakpoint_at(CORE_ADDR pc)
-{
- unsigned char c;
-
- read_inferior_memory(pc, &c, 1);
- if (c == 0xCC)
- return (1);
-
- return (0);
-}
-
-struct fbsd_target_ops the_low_target = {
- AMD64_NUM_REGS,
- amd64_regmap,
- amd64_cannot_fetch_register,
- amd64_cannot_store_register,
- amd64_get_pc,
- amd64_set_pc,
- amd64_breakpoint,
- AMD64_BP_LEN,
- NULL,
- 1,
- amd64_breakpoint_at,
-};
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-arm-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-arm-low.c
deleted file mode 100644
index faea705f94ff..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-arm-low.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/* FreeBSD/ARM specific low level interface, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "server.h"
-#include "fbsd-low.h"
-
-#ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
-#endif
-
-#include <sys/procfs.h>
-#include <sys/ptrace.h>
-
-#define arm_num_regs 26
-
-static int arm_regmap[] = {
- 0, 4, 8, 12, 16, 20, 24, 28,
- 32, 36, 40, 44, 48, 52, 56, 60,
- -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 64
-};
-
-static int
-arm_cannot_store_register (int regno)
-{
- return (regno >= arm_num_regs);
-}
-
-static int
-arm_cannot_fetch_register (int regno)
-{
- return (regno >= arm_num_regs);
-}
-
-extern int debug_threads;
-
-static CORE_ADDR
-arm_get_pc ()
-{
- unsigned long pc;
- collect_register_by_name ("pc", &pc);
- if (debug_threads)
- fprintf (stderr, "stop pc is %08lx\n", pc);
- return pc;
-}
-
-static void
-arm_set_pc (CORE_ADDR pc)
-{
- unsigned long newpc = pc;
- supply_register_by_name ("pc", &newpc);
-}
-
-/* Correct in either endianness. We do not support Thumb yet. */
-static const unsigned long arm_breakpoint = 0xef9f0001;
-#define arm_breakpoint_len 4
-
-static int
-arm_breakpoint_at (CORE_ADDR where)
-{
- unsigned long insn;
-
- (*the_target->read_memory) (where, (char *) &insn, 4);
- if (insn == arm_breakpoint)
- return 1;
-
- /* If necessary, recognize more trap instructions here. GDB only uses the
- one. */
- return 0;
-}
-
-/* We only place breakpoints in empty marker functions, and thread locking
- is outside of the function. So rather than importing software single-step,
- we can just run until exit. */
-static CORE_ADDR
-arm_reinsert_addr ()
-{
- unsigned long pc;
- collect_register_by_name ("lr", &pc);
- return pc;
-}
-
-static void
-arm_fill_gregset (void *buf)
-{
- int i;
-
- for (i = 0; i < arm_num_regs; i++)
- if (arm_regmap[i] != -1)
- collect_register (i, ((char *) buf) + arm_regmap[i]);
-
-}
-
-static void
-arm_store_gregset (const void *buf)
-{
- int i;
-
- for (i = 0; i < arm_num_regs; i++)
- if (arm_regmap[i] != -1)
- supply_register (i, ((char *) buf) + arm_regmap[i]);
-
-}
-
-
-struct regset_info target_regsets[] = {
- {PT_GETREGS, PT_SETREGS, sizeof (struct reg),
- GENERAL_REGS,
- arm_fill_gregset, arm_store_gregset },
- { 0, 0, -1, -1, NULL, NULL }
-};
-
-struct fbsd_target_ops the_low_target = {
- arm_num_regs,
- arm_regmap,
- arm_cannot_fetch_register,
- arm_cannot_store_register,
- arm_get_pc,
- arm_set_pc,
- (const char *) &arm_breakpoint,
- arm_breakpoint_len,
- arm_reinsert_addr,
- 0,
- arm_breakpoint_at,
-};
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-i386-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-i386-low.c
deleted file mode 100644
index cd296f9b6655..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-i386-low.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/* GNU/Linux/i386 specific low level interface, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "server.h"
-#include "fbsd-low.h"
-#include "i387-fp.h"
-
-#ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
-#else
-#include <machine/reg.h>
-#endif
-
-/* This module only supports access to the general purpose registers. */
-
-#define i386_num_regs 16
-
-/* This stuff comes from i386-fbsd-nat.c. */
-
-/* Mapping between the general-purpose registers in `struct user'
- format and GDB's register array layout. */
-static int i386_regmap[] =
-{
- tEAX * 4, tECX * 4, tEDX * 4, tEBX * 4,
- tESP * 4, tEBP * 4, tESI * 4, tEDI * 4,
- tEIP * 4, tEFLAGS * 4, tCS * 4, tSS * 4,
- tDS * 4, tES * 4, tFS * 4, tGS * 4
-};
-
-static int
-i386_cannot_store_register (int regno)
-{
- return (regno >= i386_num_regs);
-}
-
-static int
-i386_cannot_fetch_register (int regno)
-{
- return (regno >= i386_num_regs);
-}
-
-
-#include <sys/procfs.h>
-#include <sys/ptrace.h>
-
-static void
-i386_fill_gregset (void *buf)
-{
- int i;
-
- for (i = 0; i < i386_num_regs; i++)
- collect_register (i, ((char *) buf) + i386_regmap[i]);
-
-}
-
-static void
-i386_store_gregset (const void *buf)
-{
- int i;
-
- for (i = 0; i < i386_num_regs; i++)
- supply_register (i, ((char *) buf) + i386_regmap[i]);
-
-}
-
-static void
-i386_fill_fpregset (void *buf)
-{
- i387_cache_to_fsave (buf);
-}
-
-static void
-i386_store_fpregset (const void *buf)
-{
- i387_fsave_to_cache (buf);
-}
-
-static void
-i386_fill_fpxregset (void *buf)
-{
- i387_cache_to_fxsave (buf);
-}
-
-static void
-i386_store_fpxregset (const void *buf)
-{
- i387_fxsave_to_cache (buf);
-}
-
-
-struct regset_info target_regsets[] = {
- { PT_GETREGS, PT_SETREGS, sizeof (struct reg),
- GENERAL_REGS,
- i386_fill_gregset, i386_store_gregset },
-#ifdef HAVE_PTRACE_GETFPXREGS
- { PTRACE_GETFPXREGS, PTRACE_SETFPXREGS, sizeof (elf_fpxregset_t),
- EXTENDED_REGS,
- i386_fill_fpxregset, i386_store_fpxregset },
-#endif
- { PT_GETFPREGS, PT_SETFPREGS, sizeof (struct fpreg),
- FP_REGS,
- i386_fill_fpregset, i386_store_fpregset },
- { 0, 0, -1, -1, NULL, NULL }
-};
-
-static const char i386_breakpoint[] = { 0xCC };
-#define i386_breakpoint_len 1
-
-extern int debug_threads;
-
-static CORE_ADDR
-i386_get_pc ()
-{
- unsigned long pc;
-
- collect_register_by_name ("eip", &pc);
-
- if (debug_threads)
- fprintf (stderr, "stop pc (before any decrement) is %08lx\n", pc);
- return pc;
-}
-
-static void
-i386_set_pc (CORE_ADDR newpc)
-{
- if (debug_threads)
- fprintf (stderr, "set pc to %08lx\n", (long) newpc);
- supply_register_by_name ("eip", &newpc);
-}
-
-static int
-i386_breakpoint_at (CORE_ADDR pc)
-{
- unsigned char c;
-
- read_inferior_memory (pc, &c, 1);
- if (c == 0xCC)
- return 1;
-
- return 0;
-}
-
-struct fbsd_target_ops the_low_target = {
- i386_num_regs,
- i386_regmap,
- i386_cannot_fetch_register,
- i386_cannot_store_register,
- i386_get_pc,
- i386_set_pc,
- i386_breakpoint,
- i386_breakpoint_len,
- NULL,
- 1,
- i386_breakpoint_at,
-};
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-low.c
deleted file mode 100644
index ab6ff2f30731..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-low.c
+++ /dev/null
@@ -1,1265 +0,0 @@
-/* Low level interface to ptrace, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "server.h"
-#include "fbsd-low.h"
-
-#include <sys/wait.h>
-#include <sys/param.h>
-#include <sys/ptrace.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-/* ``all_threads'' is keyed by the LWP ID - it should be the thread ID instead,
- however. This requires changing the ID in place when we go from !using_threads
- to using_threads, immediately.
-
- ``all_processes'' is keyed by the process ID - which on Linux is (presently)
- the same as the LWP ID. */
-
-struct inferior_list all_processes;
-
-/* FIXME this is a bit of a hack, and could be removed. */
-int stopping_threads;
-
-/* FIXME make into a target method? */
-int using_threads;
-
-static void fbsd_resume_one_process (struct inferior_list_entry *entry,
- int step, int signal);
-static void fbsd_resume (struct thread_resume *resume_info);
-static void stop_all_processes (void);
-static int fbsd_wait_for_event (struct thread_info *child);
-
-struct pending_signals
-{
- int signal;
- struct pending_signals *prev;
-};
-
-#define PTRACE_ARG3_TYPE caddr_t
-#define PTRACE_XFER_TYPE int
-
-int debug_threads = 0;
-
-#define pid_of(proc) ((proc)->head.id)
-
-/* FIXME: Delete eventually. */
-#define inferior_pid (pid_of (get_thread_process (current_inferior)))
-
-/* This function should only be called if the process got a SIGTRAP.
- The SIGTRAP could mean several things.
-
- On i386, where decr_pc_after_break is non-zero:
- If we were single-stepping this process using PT_STEP,
- we will get only the one SIGTRAP (even if the instruction we
- stepped over was a breakpoint). The value of $eip will be the
- next instruction.
- If we continue the process using PTRACE_CONT, we will get a
- SIGTRAP when we hit a breakpoint. The value of $eip will be
- the instruction after the breakpoint (i.e. needs to be
- decremented). If we report the SIGTRAP to GDB, we must also
- report the undecremented PC. If we cancel the SIGTRAP, we
- must resume at the decremented PC.
-
- (Presumably, not yet tested) On a non-decr_pc_after_break machine
- with hardware or kernel single-step:
- If we single-step over a breakpoint instruction, our PC will
- point at the following instruction. If we continue and hit a
- breakpoint instruction, our PC will point at the breakpoint
- instruction. */
-
-static CORE_ADDR
-get_stop_pc (void)
-{
- CORE_ADDR stop_pc = (*the_low_target.get_pc) ();
-
- if (get_thread_process (current_inferior)->stepping)
- return stop_pc;
- else
- return stop_pc - the_low_target.decr_pc_after_break;
-}
-
-static void *
-add_process (int pid)
-{
- struct process_info *process;
-
- process = (struct process_info *) malloc (sizeof (*process));
- memset (process, 0, sizeof (*process));
-
- process->head.id = pid;
-
- /* Default to tid == lwpid == pid. */
- process->tid = pid;
- process->lwpid = pid;
-
- add_inferior_to_list (&all_processes, &process->head);
-
- return process;
-}
-
-/* Start an inferior process and returns its pid.
- ALLARGS is a vector of program-name and args. */
-
-static int
-fbsd_create_inferior (char *program, char **allargs)
-{
- void *new_process;
- int pid;
-
- pid = vfork ();
- if (pid < 0)
- perror_with_name ("vfork");
-
- if (pid == 0)
- {
- ptrace (PT_TRACE_ME, 0, 0, 0);
-
- setpgid (0, 0);
-
- execv (program, allargs);
-
- fprintf (stderr, "Cannot exec %s: %s.\n", program,
- strerror (errno));
- fflush (stderr);
- _exit (0177);
- }
-
- new_process = add_process (pid);
- add_thread (pid, new_process);
-
- return pid;
-}
-
-/* Attach to an inferior process. */
-
-void
-fbsd_attach_lwp (int pid, int tid)
-{
- struct process_info *new_process;
-
- if (ptrace (PT_ATTACH, pid, 0, 0) != 0)
- {
- fprintf (stderr, "Cannot attach to process %d: %s (%d)\n", pid,
- strerror (errno), errno);
- fflush (stderr);
-
- /* If we fail to attach to an LWP, just return. */
- if (!using_threads)
- _exit (0177);
- return;
- }
-
- new_process = (struct process_info *) add_process (pid);
- add_thread (tid, new_process);
-
- /* The next time we wait for this LWP we'll see a SIGSTOP as PTRACE_ATTACH
- brings it to a halt. We should ignore that SIGSTOP and resume the process
- (unless this is the first process, in which case the flag will be cleared
- in fbsd_attach).
-
- On the other hand, if we are currently trying to stop all threads, we
- should treat the new thread as if we had sent it a SIGSTOP. This works
- because we are guaranteed that add_process added us to the end of the
- list, and so the new thread has not yet reached wait_for_sigstop (but
- will). */
- if (! stopping_threads)
- new_process->stop_expected = 1;
-}
-
-int
-fbsd_attach (int pid)
-{
- struct process_info *process;
-
- fbsd_attach_lwp (pid, pid);
-
- /* Don't ignore the initial SIGSTOP if we just attached to this process. */
- process = (struct process_info *) find_inferior_id (&all_processes, pid);
- process->stop_expected = 0;
-
- return 0;
-}
-
-/* Kill the inferior process. Make us have no inferior. */
-
-static void
-fbsd_kill_one_process (struct inferior_list_entry *entry)
-{
- struct thread_info *thread = (struct thread_info *) entry;
- struct process_info *process = get_thread_process (thread);
- int wstat;
-
- do
- {
- ptrace (PT_KILL, pid_of (process), 0, 0);
-
- /* Make sure it died. The loop is most likely unnecessary. */
- wstat = fbsd_wait_for_event (thread);
- } while (WIFSTOPPED (wstat));
-}
-
-static void
-fbsd_kill (void)
-{
- for_each_inferior (&all_threads, fbsd_kill_one_process);
-}
-
-static void
-fbsd_detach_one_process (struct inferior_list_entry *entry)
-{
- struct thread_info *thread = (struct thread_info *) entry;
- struct process_info *process = get_thread_process (thread);
-
- ptrace (PT_DETACH, pid_of (process), 0, 0);
-}
-
-static void
-fbsd_detach (void)
-{
- for_each_inferior (&all_threads, fbsd_detach_one_process);
-}
-
-/* Return nonzero if the given thread is still alive. */
-static int
-fbsd_thread_alive (int tid)
-{
- if (find_inferior_id (&all_threads, tid) != NULL)
- return 1;
- else
- return 0;
-}
-
-/* Return nonzero if this process stopped at a breakpoint which
- no longer appears to be inserted. Also adjust the PC
- appropriately to resume where the breakpoint used to be. */
-static int
-check_removed_breakpoint (struct process_info *event_child)
-{
- CORE_ADDR stop_pc;
- struct thread_info *saved_inferior;
-
- if (event_child->pending_is_breakpoint == 0)
- return 0;
-
- if (debug_threads)
- fprintf (stderr, "Checking for breakpoint.\n");
-
- saved_inferior = current_inferior;
- current_inferior = get_process_thread (event_child);
-
- stop_pc = get_stop_pc ();
-
- /* If the PC has changed since we stopped, then we shouldn't do
- anything. This happens if, for instance, GDB handled the
- decr_pc_after_break subtraction itself. */
- if (stop_pc != event_child->pending_stop_pc)
- {
- if (debug_threads)
- fprintf (stderr, "Ignoring, PC was changed.\n");
-
- event_child->pending_is_breakpoint = 0;
- current_inferior = saved_inferior;
- return 0;
- }
-
- /* If the breakpoint is still there, we will report hitting it. */
- if ((*the_low_target.breakpoint_at) (stop_pc))
- {
- if (debug_threads)
- fprintf (stderr, "Ignoring, breakpoint is still present.\n");
- current_inferior = saved_inferior;
- return 0;
- }
-
- if (debug_threads)
- fprintf (stderr, "Removed breakpoint.\n");
-
- /* For decr_pc_after_break targets, here is where we perform the
- decrement. We go immediately from this function to resuming,
- and can not safely call get_stop_pc () again. */
- if (the_low_target.set_pc != NULL)
- (*the_low_target.set_pc) (stop_pc);
-
- /* We consumed the pending SIGTRAP. */
- event_child->pending_is_breakpoint = 0;
- event_child->status_pending_p = 0;
- event_child->status_pending = 0;
-
- current_inferior = saved_inferior;
- return 1;
-}
-
-/* Return 1 if this process has an interesting status pending. This function
- may silently resume an inferior process. */
-static int
-status_pending_p (struct inferior_list_entry *entry, void *dummy)
-{
- struct process_info *process = (struct process_info *) entry;
-
- if (process->status_pending_p)
- if (check_removed_breakpoint (process))
- {
- /* This thread was stopped at a breakpoint, and the breakpoint
- is now gone. We were told to continue (or step...) all threads,
- so GDB isn't trying to single-step past this breakpoint.
- So instead of reporting the old SIGTRAP, pretend we got to
- the breakpoint just after it was removed instead of just
- before; resume the process. */
- fbsd_resume_one_process (&process->head, 0, 0);
- return 0;
- }
-
- return process->status_pending_p;
-}
-
-static void
-fbsd_wait_for_process (struct process_info **childp, int *wstatp)
-{
- int ret;
- int to_wait_for = -1;
-
- if (*childp != NULL)
- to_wait_for = (*childp)->lwpid;
-
- while (1)
- {
- ret = waitpid (to_wait_for, wstatp, WNOHANG);
-
- if (ret == -1)
- {
- if (errno != ECHILD)
- perror_with_name ("waitpid");
- }
- else if (ret > 0)
- break;
-
- usleep (1000);
- }
-
- if (debug_threads
- && (!WIFSTOPPED (*wstatp)
- || (WSTOPSIG (*wstatp) != 32
- && WSTOPSIG (*wstatp) != 33)))
- fprintf (stderr, "Got an event from %d (%x)\n", ret, *wstatp);
-
- if (to_wait_for == -1)
- *childp = (struct process_info *) find_inferior_id (&all_processes, ret);
-
- (*childp)->stopped = 1;
- (*childp)->pending_is_breakpoint = 0;
-
- if (debug_threads
- && WIFSTOPPED (*wstatp))
- {
- current_inferior = (struct thread_info *)
- find_inferior_id (&all_threads, (*childp)->tid);
- /* For testing only; i386_stop_pc prints out a diagnostic. */
- if (the_low_target.get_pc != NULL)
- get_stop_pc ();
- }
-}
-
-static int
-fbsd_wait_for_event (struct thread_info *child)
-{
- CORE_ADDR stop_pc;
- struct process_info *event_child;
- int wstat;
-
- /* Check for a process with a pending status. */
- /* It is possible that the user changed the pending task's registers since
- it stopped. We correctly handle the change of PC if we hit a breakpoint
- (in check_removed_breakpoint); signals should be reported anyway. */
- if (child == NULL)
- {
- event_child = (struct process_info *)
- find_inferior (&all_processes, status_pending_p, NULL);
- if (debug_threads && event_child)
- fprintf (stderr, "Got a pending child %d\n", event_child->lwpid);
- }
- else
- {
- event_child = get_thread_process (child);
- if (event_child->status_pending_p
- && check_removed_breakpoint (event_child))
- event_child = NULL;
- }
-
- if (event_child != NULL)
- {
- if (event_child->status_pending_p)
- {
- if (debug_threads)
- fprintf (stderr, "Got an event from pending child %d (%04x)\n",
- event_child->lwpid, event_child->status_pending);
- wstat = event_child->status_pending;
- event_child->status_pending_p = 0;
- event_child->status_pending = 0;
- current_inferior = get_process_thread (event_child);
- return wstat;
- }
- }
-
- /* We only enter this loop if no process has a pending wait status. Thus
- any action taken in response to a wait status inside this loop is
- responding as soon as we detect the status, not after any pending
- events. */
- while (1)
- {
- if (child == NULL)
- event_child = NULL;
- else
- event_child = get_thread_process (child);
-
- fbsd_wait_for_process (&event_child, &wstat);
-
- if (event_child == NULL)
- error ("event from unknown child");
-
- current_inferior = (struct thread_info *)
- find_inferior_id (&all_threads, event_child->tid);
-
- if (using_threads)
- {
- /* Check for thread exit. */
- if (! WIFSTOPPED (wstat))
- {
- if (debug_threads)
- fprintf (stderr, "Thread %d (LWP %d) exiting\n",
- event_child->tid, event_child->head.id);
-
- /* If the last thread is exiting, just return. */
- if (all_threads.head == all_threads.tail)
- return wstat;
-
- dead_thread_notify (event_child->tid);
-
- remove_inferior (&all_processes, &event_child->head);
- free (event_child);
- remove_thread (current_inferior);
- current_inferior = (struct thread_info *) all_threads.head;
-
- /* If we were waiting for this particular child to do something...
- well, it did something. */
- if (child != NULL)
- return wstat;
-
- /* Wait for a more interesting event. */
- continue;
- }
-
- if (WIFSTOPPED (wstat)
- && WSTOPSIG (wstat) == SIGSTOP
- && event_child->stop_expected)
- {
- if (debug_threads)
- fprintf (stderr, "Expected stop.\n");
- event_child->stop_expected = 0;
- fbsd_resume_one_process (&event_child->head,
- event_child->stepping, 0);
- continue;
- }
-
- /* FIXME drow/2002-06-09: Get signal numbers from the inferior's
- thread library? */
- if (WIFSTOPPED (wstat))
- {
- if (debug_threads)
- fprintf (stderr, "Ignored signal %d for %d (LWP %d).\n",
- WSTOPSIG (wstat), event_child->tid,
- event_child->head.id);
- fbsd_resume_one_process (&event_child->head,
- event_child->stepping,
- WSTOPSIG (wstat));
- continue;
- }
- }
-
- /* If this event was not handled above, and is not a SIGTRAP, report
- it. */
- if (!WIFSTOPPED (wstat) || WSTOPSIG (wstat) != SIGTRAP)
- return wstat;
-
- /* If this target does not support breakpoints, we simply report the
- SIGTRAP; it's of no concern to us. */
- if (the_low_target.get_pc == NULL)
- return wstat;
-
- stop_pc = get_stop_pc ();
-
- /* bp_reinsert will only be set if we were single-stepping.
- Notice that we will resume the process after hitting
- a gdbserver breakpoint; single-stepping to/over one
- is not supported (yet). */
- if (event_child->bp_reinsert != 0)
- {
- if (debug_threads)
- fprintf (stderr, "Reinserted breakpoint.\n");
- reinsert_breakpoint (event_child->bp_reinsert);
- event_child->bp_reinsert = 0;
-
- /* Clear the single-stepping flag and SIGTRAP as we resume. */
- fbsd_resume_one_process (&event_child->head, 0, 0);
- continue;
- }
-
- if (debug_threads)
- fprintf (stderr, "Hit a (non-reinsert) breakpoint.\n");
-
- if (check_breakpoints (stop_pc) != 0)
- {
- /* We hit one of our own breakpoints. We mark it as a pending
- breakpoint, so that check_removed_breakpoint () will do the PC
- adjustment for us at the appropriate time. */
- event_child->pending_is_breakpoint = 1;
- event_child->pending_stop_pc = stop_pc;
-
- /* Now we need to put the breakpoint back. We continue in the event
- loop instead of simply replacing the breakpoint right away,
- in order to not lose signals sent to the thread that hit the
- breakpoint. Unfortunately this increases the window where another
- thread could sneak past the removed breakpoint. For the current
- use of server-side breakpoints (thread creation) this is
- acceptable; but it needs to be considered before this breakpoint
- mechanism can be used in more general ways. For some breakpoints
- it may be necessary to stop all other threads, but that should
- be avoided where possible.
-
- If breakpoint_reinsert_addr is NULL, that means that we can
- use PT_STEP on this platform. Uninsert the breakpoint,
- mark it for reinsertion, and single-step.
-
- Otherwise, call the target function to figure out where we need
- our temporary breakpoint, create it, and continue executing this
- process. */
- if (the_low_target.breakpoint_reinsert_addr == NULL)
- {
- event_child->bp_reinsert = stop_pc;
- uninsert_breakpoint (stop_pc);
- fbsd_resume_one_process (&event_child->head, 1, 0);
- }
- else
- {
- reinsert_breakpoint_by_bp
- (stop_pc, (*the_low_target.breakpoint_reinsert_addr) ());
- fbsd_resume_one_process (&event_child->head, 0, 0);
- }
-
- continue;
- }
-
- /* If we were single-stepping, we definitely want to report the
- SIGTRAP. The single-step operation has completed, so also
- clear the stepping flag; in general this does not matter,
- because the SIGTRAP will be reported to the client, which
- will give us a new action for this thread, but clear it for
- consistency anyway. It's safe to clear the stepping flag
- because the only consumer of get_stop_pc () after this point
- is check_removed_breakpoint, and pending_is_breakpoint is not
- set. It might be wiser to use a step_completed flag instead. */
- if (event_child->stepping)
- {
- event_child->stepping = 0;
- return wstat;
- }
-
- /* A SIGTRAP that we can't explain. It may have been a breakpoint.
- Check if it is a breakpoint, and if so mark the process information
- accordingly. This will handle both the necessary fiddling with the
- PC on decr_pc_after_break targets and suppressing extra threads
- hitting a breakpoint if two hit it at once and then GDB removes it
- after the first is reported. Arguably it would be better to report
- multiple threads hitting breakpoints simultaneously, but the current
- remote protocol does not allow this. */
- if ((*the_low_target.breakpoint_at) (stop_pc))
- {
- event_child->pending_is_breakpoint = 1;
- event_child->pending_stop_pc = stop_pc;
- }
-
- return wstat;
- }
-
- /* NOTREACHED */
- return 0;
-}
-
-/* Wait for process, returns status. */
-
-static unsigned char
-fbsd_wait (char *status)
-{
- int w;
- struct thread_info *child = NULL;
-
-retry:
- /* If we were only supposed to resume one thread, only wait for
- that thread - if it's still alive. If it died, however - which
- can happen if we're coming from the thread death case below -
- then we need to make sure we restart the other threads. We could
- pick a thread at random or restart all; restarting all is less
- arbitrary. */
- if (cont_thread > 0)
- {
- child = (struct thread_info *) find_inferior_id (&all_threads,
- cont_thread);
-
- /* No stepping, no signal - unless one is pending already, of course. */
- if (child == NULL)
- {
- struct thread_resume resume_info;
- resume_info.thread = -1;
- resume_info.step = resume_info.sig = resume_info.leave_stopped = 0;
- fbsd_resume (&resume_info);
- }
- }
-
- enable_async_io ();
- unblock_async_io ();
- w = fbsd_wait_for_event (child);
- stop_all_processes ();
- disable_async_io ();
-
- /* If we are waiting for a particular child, and it exited,
- fbsd_wait_for_event will return its exit status. Similarly if
- the last child exited. If this is not the last child, however,
- do not report it as exited until there is a 'thread exited' response
- available in the remote protocol. Instead, just wait for another event.
- This should be safe, because if the thread crashed we will already
- have reported the termination signal to GDB; that should stop any
- in-progress stepping operations, etc.
-
- Report the exit status of the last thread to exit. This matches
- LinuxThreads' behavior. */
-
- if (all_threads.head == all_threads.tail)
- {
- if (WIFEXITED (w))
- {
- fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
- *status = 'W';
- clear_inferiors ();
- free (all_processes.head);
- all_processes.head = all_processes.tail = NULL;
- return ((unsigned char) WEXITSTATUS (w));
- }
- else if (!WIFSTOPPED (w))
- {
- fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
- *status = 'X';
- clear_inferiors ();
- free (all_processes.head);
- all_processes.head = all_processes.tail = NULL;
- return ((unsigned char) WTERMSIG (w));
- }
- }
- else
- {
- if (!WIFSTOPPED (w))
- goto retry;
- }
-
- *status = 'T';
- return ((unsigned char) WSTOPSIG (w));
-}
-
-static void
-send_sigstop (struct inferior_list_entry *entry)
-{
- struct process_info *process = (struct process_info *) entry;
-
- if (process->stopped)
- return;
-
- /* If we already have a pending stop signal for this process, don't
- send another. */
- if (process->stop_expected)
- {
- process->stop_expected = 0;
- return;
- }
-
- if (debug_threads)
- fprintf (stderr, "Sending sigstop to process %d\n", process->head.id);
-
- kill (process->head.id, SIGSTOP);
- process->sigstop_sent = 1;
-}
-
-static void
-wait_for_sigstop (struct inferior_list_entry *entry)
-{
- struct process_info *process = (struct process_info *) entry;
- struct thread_info *saved_inferior, *thread;
- int wstat, saved_tid;
-
- if (process->stopped)
- return;
-
- saved_inferior = current_inferior;
- saved_tid = ((struct inferior_list_entry *) saved_inferior)->id;
- thread = (struct thread_info *) find_inferior_id (&all_threads,
- process->tid);
- wstat = fbsd_wait_for_event (thread);
-
- /* If we stopped with a non-SIGSTOP signal, save it for later
- and record the pending SIGSTOP. If the process exited, just
- return. */
- if (WIFSTOPPED (wstat)
- && WSTOPSIG (wstat) != SIGSTOP)
- {
- if (debug_threads)
- fprintf (stderr, "Stopped with non-sigstop signal\n");
- process->status_pending_p = 1;
- process->status_pending = wstat;
- process->stop_expected = 1;
- }
-
- if (fbsd_thread_alive (saved_tid))
- current_inferior = saved_inferior;
- else
- {
- if (debug_threads)
- fprintf (stderr, "Previously current thread died.\n");
-
- /* Set a valid thread as current. */
- set_desired_inferior (0);
- }
-}
-
-static void
-stop_all_processes (void)
-{
- stopping_threads = 1;
- for_each_inferior (&all_processes, send_sigstop);
- for_each_inferior (&all_processes, wait_for_sigstop);
- stopping_threads = 0;
-}
-
-/* Resume execution of the inferior process.
- If STEP is nonzero, single-step it.
- If SIGNAL is nonzero, give it that signal. */
-
-static void
-fbsd_resume_one_process (struct inferior_list_entry *entry,
- int step, int signal)
-{
- struct process_info *process = (struct process_info *) entry;
- struct thread_info *saved_inferior;
-
- if (process->stopped == 0)
- return;
-
- /* If we have pending signals or status, and a new signal, enqueue the
- signal. Also enqueue the signal if we are waiting to reinsert a
- breakpoint; it will be picked up again below. */
- if (signal != 0
- && (process->status_pending_p || process->pending_signals != NULL
- || process->bp_reinsert != 0))
- {
- struct pending_signals *p_sig;
- p_sig = malloc (sizeof (*p_sig));
- p_sig->prev = process->pending_signals;
- p_sig->signal = signal;
- process->pending_signals = p_sig;
- }
-
- if (process->status_pending_p && !check_removed_breakpoint (process))
- return;
-
- saved_inferior = current_inferior;
- current_inferior = get_process_thread (process);
-
- if (debug_threads)
- fprintf (stderr, "Resuming process %d (%s, signal %d, stop %s)\n", inferior_pid,
- step ? "step" : "continue", signal,
- process->stop_expected ? "expected" : "not expected");
-
- /* This bit needs some thinking about. If we get a signal that
- we must report while a single-step reinsert is still pending,
- we often end up resuming the thread. It might be better to
- (ew) allow a stack of pending events; then we could be sure that
- the reinsert happened right away and not lose any signals.
-
- Making this stack would also shrink the window in which breakpoints are
- uninserted (see comment in fbsd_wait_for_process) but not enough for
- complete correctness, so it won't solve that problem. It may be
- worthwhile just to solve this one, however. */
- if (process->bp_reinsert != 0)
- {
- if (debug_threads)
- fprintf (stderr, " pending reinsert at %08lx", (long)process->bp_reinsert);
- if (step == 0)
- fprintf (stderr, "BAD - reinserting but not stepping.\n");
- step = 1;
-
- /* Postpone any pending signal. It was enqueued above. */
- signal = 0;
- }
-
- check_removed_breakpoint (process);
-
- if (debug_threads && the_low_target.get_pc != NULL)
- {
- fprintf (stderr, " ");
- (long) (*the_low_target.get_pc) ();
- }
-
- /* If we have pending signals, consume one unless we are trying to reinsert
- a breakpoint. */
- if (process->pending_signals != NULL && process->bp_reinsert == 0)
- {
- struct pending_signals **p_sig;
-
- p_sig = &process->pending_signals;
- while ((*p_sig)->prev != NULL)
- p_sig = &(*p_sig)->prev;
-
- signal = (*p_sig)->signal;
- free (*p_sig);
- *p_sig = NULL;
- }
-
- regcache_invalidate_one ((struct inferior_list_entry *)
- get_process_thread (process));
- errno = 0;
- process->stopped = 0;
- process->stepping = step;
- ptrace (step ? PT_STEP : PT_CONTINUE, process->lwpid, (PTRACE_ARG3_TYPE) 1, signal);
-
- current_inferior = saved_inferior;
- if (errno)
- perror_with_name ("ptrace");
-}
-
-static struct thread_resume *resume_ptr;
-
-/* This function is called once per thread. We look up the thread
- in RESUME_PTR, and mark the thread with a pointer to the appropriate
- resume request.
-
- This algorithm is O(threads * resume elements), but resume elements
- is small (and will remain small at least until GDB supports thread
- suspension). */
-static void
-fbsd_set_resume_request (struct inferior_list_entry *entry)
-{
- struct process_info *process;
- struct thread_info *thread;
- int ndx;
-
- thread = (struct thread_info *) entry;
- process = get_thread_process (thread);
-
- ndx = 0;
- while (resume_ptr[ndx].thread != -1 && resume_ptr[ndx].thread != entry->id)
- ndx++;
-
- process->resume = &resume_ptr[ndx];
-}
-
-/* This function is called once per thread. We check the thread's resume
- request, which will tell us whether to resume, step, or leave the thread
- stopped; and what signal, if any, it should be sent. For threads which
- we aren't explicitly told otherwise, we preserve the stepping flag; this
- is used for stepping over gdbserver-placed breakpoints. */
-
-static void
-fbsd_continue_one_thread (struct inferior_list_entry *entry)
-{
- struct process_info *process;
- struct thread_info *thread;
- int step;
-
- thread = (struct thread_info *) entry;
- process = get_thread_process (thread);
-
- if (process->resume->leave_stopped)
- return;
-
- if (process->resume->thread == -1)
- step = process->stepping || process->resume->step;
- else
- step = process->resume->step;
-
- fbsd_resume_one_process (&process->head, step, process->resume->sig);
-
- process->resume = NULL;
-}
-
-/* This function is called once per thread. We check the thread's resume
- request, which will tell us whether to resume, step, or leave the thread
- stopped; and what signal, if any, it should be sent. We queue any needed
- signals, since we won't actually resume. We already have a pending event
- to report, so we don't need to preserve any step requests; they should
- be re-issued if necessary. */
-
-static void
-fbsd_queue_one_thread (struct inferior_list_entry *entry)
-{
- struct process_info *process;
- struct thread_info *thread;
-
- thread = (struct thread_info *) entry;
- process = get_thread_process (thread);
-
- if (process->resume->leave_stopped)
- return;
-
- /* If we have a new signal, enqueue the signal. */
- if (process->resume->sig != 0)
- {
- struct pending_signals *p_sig;
- p_sig = malloc (sizeof (*p_sig));
- p_sig->prev = process->pending_signals;
- p_sig->signal = process->resume->sig;
- process->pending_signals = p_sig;
- }
-
- process->resume = NULL;
-}
-
-/* Set DUMMY if this process has an interesting status pending. */
-static int
-resume_status_pending_p (struct inferior_list_entry *entry, void *flag_p)
-{
- struct process_info *process = (struct process_info *) entry;
-
- /* Processes which will not be resumed are not interesting, because
- we might not wait for them next time through fbsd_wait. */
- if (process->resume->leave_stopped)
- return 0;
-
- /* If this thread has a removed breakpoint, we won't have any
- events to report later, so check now. check_removed_breakpoint
- may clear status_pending_p. We avoid calling check_removed_breakpoint
- for any thread that we are not otherwise going to resume - this
- lets us preserve stopped status when two threads hit a breakpoint.
- GDB removes the breakpoint to single-step a particular thread
- past it, then re-inserts it and resumes all threads. We want
- to report the second thread without resuming it in the interim. */
- if (process->status_pending_p)
- check_removed_breakpoint (process);
-
- if (process->status_pending_p)
- * (int *) flag_p = 1;
-
- return 0;
-}
-
-static void
-fbsd_resume (struct thread_resume *resume_info)
-{
- int pending_flag;
-
- /* Yes, the use of a global here is rather ugly. */
- resume_ptr = resume_info;
-
- for_each_inferior (&all_threads, fbsd_set_resume_request);
-
- /* If there is a thread which would otherwise be resumed, which
- has a pending status, then don't resume any threads - we can just
- report the pending status. Make sure to queue any signals
- that would otherwise be sent. */
- pending_flag = 0;
- find_inferior (&all_processes, resume_status_pending_p, &pending_flag);
-
- if (debug_threads)
- {
- if (pending_flag)
- fprintf (stderr, "Not resuming, pending status\n");
- else
- fprintf (stderr, "Resuming, no pending status\n");
- }
-
- if (pending_flag)
- for_each_inferior (&all_threads, fbsd_queue_one_thread);
- else
- {
- block_async_io ();
- enable_async_io ();
- for_each_inferior (&all_threads, fbsd_continue_one_thread);
- }
-}
-
-
-static int
-regsets_fetch_inferior_registers ()
-{
- struct regset_info *regset;
-
- regset = target_regsets;
-
- while (regset->size >= 0)
- {
- void *buf;
- int res;
-
- if (regset->size == 0)
- {
- regset ++;
- continue;
- }
-
- buf = malloc (regset->size);
- res = ptrace (regset->get_request, inferior_pid, (PTRACE_ARG3_TYPE) buf, 0);
- if (res < 0)
- {
- char s[256];
- sprintf (s, "ptrace(regsets_fetch_inferior_registers) PID=%d",
- inferior_pid);
- perror (s);
- }
- regset->store_function (buf);
- regset ++;
- }
- return 0;
-}
-
-static int
-regsets_store_inferior_registers ()
-{
- struct regset_info *regset;
-
- regset = target_regsets;
-
- while (regset->size >= 0)
- {
- void *buf;
- int res;
-
- if (regset->size == 0)
- {
- regset ++;
- continue;
- }
-
- buf = malloc (regset->size);
- regset->fill_function (buf);
- res = ptrace (regset->set_request, inferior_pid, (PTRACE_ARG3_TYPE) buf, 0);
- if (res < 0)
- {
- perror ("Warning: ptrace(regsets_store_inferior_registers)");
- }
- regset ++;
- free (buf);
- }
- return 0;
-}
-
-void
-fbsd_fetch_registers (int regno)
-{
- regsets_fetch_inferior_registers ();
-}
-
-void
-fbsd_store_registers (int regno)
-{
- regsets_store_inferior_registers ();
-}
-
-
-/* Copy LEN bytes from inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. */
-
-static int
-fbsd_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
- / sizeof (PTRACE_XFER_TYPE);
- /* Allocate buffer of that many longwords. */
- register PTRACE_XFER_TYPE *buffer
- = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
-
- /* Read all the longwords */
- for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
- {
- errno = 0;
- buffer[i] = ptrace (PT_READ_D, inferior_pid, (PTRACE_ARG3_TYPE) (intptr_t)addr, 0);
- if (errno)
- return errno;
- }
-
- /* Copy appropriate bytes out of the buffer. */
- memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), len);
-
- return 0;
-}
-
-/* Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR.
- On failure (cannot write the inferior)
- returns the value of errno. */
-
-static int
-fbsd_write_memory (CORE_ADDR memaddr, const char *myaddr, int len)
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE);
- /* Allocate buffer of that many longwords. */
- register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
- extern int errno;
-
- if (debug_threads)
- {
- fprintf (stderr, "Writing %02x to %08lx\n", (unsigned)myaddr[0], (long)memaddr);
- }
-
- /* Fill start and end extra bytes of buffer with existing memory data. */
-
- buffer[0] = ptrace (PT_READ_D, inferior_pid,
- (PTRACE_ARG3_TYPE) (intptr_t)addr, 0);
-
- if (count > 1)
- {
- buffer[count - 1]
- = ptrace (PT_READ_D, inferior_pid,
- (PTRACE_ARG3_TYPE) (intptr_t) (addr + (count - 1)
- * sizeof (PTRACE_XFER_TYPE)),
- 0);
- }
-
- /* Copy data to be written over corresponding part of buffer */
-
- memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), myaddr, len);
-
- /* Write the entire buffer. */
-
- for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
- {
- errno = 0;
- ptrace (PT_WRITE_D, inferior_pid, (PTRACE_ARG3_TYPE) (intptr_t)addr, buffer[i]);
- if (errno)
- return errno;
- }
-
- return 0;
-}
-
-static void
-fbsd_look_up_symbols (void)
-{
-#ifdef USE_THREAD_DB
- if (using_threads)
- return;
-
- using_threads = thread_db_init ();
-#endif
-}
-
-static void
-fbsd_send_signal (int signum)
-{
- extern int signal_pid;
-
- if (cont_thread > 0)
- {
- struct process_info *process;
-
- process = get_thread_process (current_inferior);
- kill (process->lwpid, signum);
- }
- else
- kill (signal_pid, signum);
-}
-
-/* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET
- to debugger memory starting at MYADDR. */
-
-static int
-fbsd_read_auxv (CORE_ADDR offset, char *myaddr, unsigned int len)
-{
- char filename[PATH_MAX];
- int fd, n;
-
- snprintf (filename, sizeof filename, "/proc/%d/auxv", inferior_pid);
-
- fd = open (filename, O_RDONLY);
- if (fd < 0)
- return -1;
-
- if (offset != (CORE_ADDR) 0
- && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset)
- n = -1;
- else
- n = read (fd, myaddr, len);
-
- close (fd);
-
- return n;
-}
-
-
-static struct target_ops fbsd_target_ops = {
- fbsd_create_inferior,
- fbsd_attach,
- fbsd_kill,
- fbsd_detach,
- fbsd_thread_alive,
- fbsd_resume,
- fbsd_wait,
- fbsd_fetch_registers,
- fbsd_store_registers,
- fbsd_read_memory,
- fbsd_write_memory,
- fbsd_look_up_symbols,
- fbsd_send_signal,
- fbsd_read_auxv,
-};
-
-static void
-fbsd_init_signals ()
-{
-}
-
-void
-initialize_low (void)
-{
- using_threads = 0;
- set_target_ops (&fbsd_target_ops);
- set_breakpoint_data (the_low_target.breakpoint,
- the_low_target.breakpoint_len);
- init_registers ();
- fbsd_init_signals ();
-}
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-low.h b/gnu/usr.bin/gdb/gdbserver/fbsd-low.h
deleted file mode 100644
index 310368c9b2c1..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-low.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Internal interfaces for the GNU/Linux specific target code for gdbserver.
- Copyright 2002, 2004 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*
- * $FreeBSD$
- */
-
-typedef void (*regset_fill_func) (void *);
-typedef void (*regset_store_func) (const void *);
-enum regset_type {
- GENERAL_REGS,
- FP_REGS,
- EXTENDED_REGS,
-};
-
-struct regset_info
-{
- int get_request, set_request;
- int size;
- enum regset_type type;
- regset_fill_func fill_function;
- regset_store_func store_function;
-};
-extern struct regset_info target_regsets[];
-
-struct fbsd_target_ops
-{
- int num_regs;
- int *regmap;
- int (*cannot_fetch_register) (int);
-
- /* Returns 0 if we can store the register, 1 if we can not
- store the register, and 2 if failure to store the register
- is acceptable. */
- int (*cannot_store_register) (int);
- CORE_ADDR (*get_pc) (void);
- void (*set_pc) (CORE_ADDR newpc);
- const char *breakpoint;
- int breakpoint_len;
- CORE_ADDR (*breakpoint_reinsert_addr) (void);
-
-
- int decr_pc_after_break;
- int (*breakpoint_at) (CORE_ADDR pc);
-};
-
-extern struct fbsd_target_ops the_low_target;
-
-#define get_process(inf) ((struct process_info *)(inf))
-#define get_thread_process(thr) (get_process (inferior_target_data (thr)))
-#define get_process_thread(proc) ((struct thread_info *) \
- find_inferior_id (&all_threads, \
- get_process (proc)->tid))
-
-struct process_info
-{
- struct inferior_list_entry head;
- int thread_known;
- int lwpid;
- int tid;
-
- /* If this flag is set, the next SIGSTOP will be ignored (the process will
- be immediately resumed). */
- int stop_expected;
-
- /* If this flag is set, the process is known to be stopped right now (stop
- event already received in a wait()). */
- int stopped;
-
- /* If this flag is set, we have sent a SIGSTOP to this process and are
- waiting for it to stop. */
- int sigstop_sent;
-
- /* If this flag is set, STATUS_PENDING is a waitstatus that has not yet
- been reported. */
- int status_pending_p;
- int status_pending;
-
- /* If this flag is set, the pending status is a (GDB-placed) breakpoint. */
- int pending_is_breakpoint;
- CORE_ADDR pending_stop_pc;
-
- /* If this is non-zero, it is a breakpoint to be reinserted at our next
- stop (SIGTRAP stops only). */
- CORE_ADDR bp_reinsert;
-
- /* If this flag is set, the last continue operation on this process
- was a single-step. */
- int stepping;
-
- /* If this is non-zero, it points to a chain of signals which need to
- be delivered to this process. */
- struct pending_signals *pending_signals;
-
- /* A link used when resuming. It is initialized from the resume request,
- and then processed and cleared in fbsd_resume_one_process. */
-
- struct thread_resume *resume;
-};
-
-extern struct inferior_list all_processes;
-
-void fbsd_attach_lwp (int pid, int tid);
-
-int thread_db_init (void);
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c
deleted file mode 100644
index 35f7ac650928..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/* FreeBSD/PowerPC specific low level interface, for the remote server for
- GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "server.h"
-#include "fbsd-low.h"
-
-#include <sys/procfs.h>
-#include <sys/ptrace.h>
-
-#define ppc_num_regs 71
-
-/* Currently, don't check/send MQ. */
-static int ppc_regmap[] =
- { 0, 4, 8, 12, 16, 20, 24, 28,
- 32, 36, 40, 44, 48, 52, 56, 60,
- 64, 68, 72, 76, 80, 84, 88, 92,
- 96, 100, 104, 108, 112, 116, 120, 124,
-#if 0
- /*
- * XXX on FreeBSD the gdbserver for PowerPC was only tested with FPU-less
- * cores i.e. e500. Let's leave the original FPR references around in case
- * someone picks up and brings support for AIM-like FPU machines.
- */
- PT_FPR0*4, PT_FPR0*4 + 8, PT_FPR0*4+16, PT_FPR0*4+24,
- PT_FPR0*4+32, PT_FPR0*4+40, PT_FPR0*4+48, PT_FPR0*4+56,
- PT_FPR0*4+64, PT_FPR0*4+72, PT_FPR0*4+80, PT_FPR0*4+88,
- PT_FPR0*4+96, PT_FPR0*4+104, PT_FPR0*4+112, PT_FPR0*4+120,
- PT_FPR0*4+128, PT_FPR0*4+136, PT_FPR0*4+144, PT_FPR0*4+152,
- PT_FPR0*4+160, PT_FPR0*4+168, PT_FPR0*4+176, PT_FPR0*4+184,
- PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216,
- PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248,
-#endif
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 144, -1, 132, 128, 140, 136, -1
- };
-
-static int
-ppc_cannot_store_register (int regno)
-{
- /* Some kernels do not allow us to store fpscr. */
- if (regno == find_regno ("fpscr"))
- return 2;
-
- return 0;
-}
-
-static int
-ppc_cannot_fetch_register (int regno)
-{
- return 0;
-}
-
-static CORE_ADDR
-ppc_get_pc (void)
-{
- unsigned long pc;
-
- collect_register_by_name ("pc", &pc);
- return (CORE_ADDR) pc;
-}
-
-static void
-ppc_set_pc (CORE_ADDR pc)
-{
- unsigned long newpc = pc;
-
- supply_register_by_name ("pc", &newpc);
-}
-
-/* Correct in either endianness. Note that this file is
- for PowerPC only, not PowerPC64.
- This instruction is "twge r2, r2", which GDB uses as a software
- breakpoint. */
-static const unsigned long ppc_breakpoint = 0x7d821008;
-#define ppc_breakpoint_len 4
-
-static int
-ppc_breakpoint_at (CORE_ADDR where)
-{
- unsigned long insn;
-
- (*the_target->read_memory) (where, (char *) &insn, 4);
- if (insn == ppc_breakpoint)
- return 1;
- /* If necessary, recognize more trap instructions here. GDB only uses the
- one. */
- return 0;
-}
-
-static void
-ppc_fill_gregset (void *buf)
-{
- int i;
-
- for (i = 0; i < ppc_num_regs; i++)
- if (ppc_regmap[i] != -1)
- collect_register (i, ((char *) buf) + ppc_regmap[i]);
-
-}
-
-static void
-ppc_store_gregset (const void *buf)
-{
- int i;
-
- for (i = 0; i < ppc_num_regs; i++)
- if (ppc_regmap[i] != -1)
- supply_register (i, ((char *) buf) + ppc_regmap[i]);
-
-}
-
-struct regset_info target_regsets[] = {
- { PT_GETREGS, PT_SETREGS, sizeof (struct reg),
- GENERAL_REGS,
- ppc_fill_gregset, ppc_store_gregset },
- { 0, 0, -1, -1, NULL, NULL }
-};
-
-struct fbsd_target_ops the_low_target = {
- ppc_num_regs,
- ppc_regmap,
- ppc_cannot_fetch_register,
- ppc_cannot_store_register,
- ppc_get_pc,
- ppc_set_pc,
- (const char *) &ppc_breakpoint,
- ppc_breakpoint_len,
- NULL,
- 0,
- ppc_breakpoint_at,
-};
diff --git a/gnu/usr.bin/gdb/gdbserver/reg-amd64.c b/gnu/usr.bin/gdb/gdbserver/reg-amd64.c
deleted file mode 100644
index 7b0534f0d569..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/reg-amd64.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
-
-/* A register protocol for GDB, the GNU debugger.
- Copyright 2001, 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This file was created with the aid of ``regdat.sh'' and ``../../../../contrib/gdb/gdb/regformats/reg-x86-64.dat''. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "regdef.h"
-#include "regcache.h"
-
-struct reg regs_x86_64[] = {
- { "rax", 0, 64 },
- { "rbx", 64, 64 },
- { "rcx", 128, 64 },
- { "rdx", 192, 64 },
- { "rsi", 256, 64 },
- { "rdi", 320, 64 },
- { "rbp", 384, 64 },
- { "rsp", 448, 64 },
- { "r8", 512, 64 },
- { "r9", 576, 64 },
- { "r10", 640, 64 },
- { "r11", 704, 64 },
- { "r12", 768, 64 },
- { "r13", 832, 64 },
- { "r14", 896, 64 },
- { "r15", 960, 64 },
- { "rip", 1024, 64 },
- { "eflags", 1088, 32 },
- { "cs", 1120, 32 },
- { "ss", 1152, 32 },
- { "ds", 1184, 32 },
- { "es", 1216, 32 },
- { "fs", 1248, 32 },
- { "gs", 1280, 32 },
- { "st0", 1312, 80 },
- { "st1", 1392, 80 },
- { "st2", 1472, 80 },
- { "st3", 1552, 80 },
- { "st4", 1632, 80 },
- { "st5", 1712, 80 },
- { "st6", 1792, 80 },
- { "st7", 1872, 80 },
- { "fctrl", 1952, 32 },
- { "fstat", 1984, 32 },
- { "ftag", 2016, 32 },
- { "fiseg", 2048, 32 },
- { "fioff", 2080, 32 },
- { "foseg", 2112, 32 },
- { "fooff", 2144, 32 },
- { "fop", 2176, 32 },
- { "xmm0", 2208, 128 },
- { "xmm1", 2336, 128 },
- { "xmm2", 2464, 128 },
- { "xmm3", 2592, 128 },
- { "xmm4", 2720, 128 },
- { "xmm5", 2848, 128 },
- { "xmm6", 2976, 128 },
- { "xmm7", 3104, 128 },
- { "xmm8", 3232, 128 },
- { "xmm9", 3360, 128 },
- { "xmm10", 3488, 128 },
- { "xmm11", 3616, 128 },
- { "xmm12", 3744, 128 },
- { "xmm13", 3872, 128 },
- { "xmm14", 4000, 128 },
- { "xmm15", 4128, 128 },
- { "mxcsr", 4256, 32 },
-};
-
-const char *expedite_regs_x86_64[] = { "rbp", "rsp", "rip", 0 };
-
-void
-init_registers ()
-{
- set_register_cache (regs_x86_64,
- sizeof (regs_x86_64) / sizeof (regs_x86_64[0]));
- gdbserver_expedite_regs = expedite_regs_x86_64;
-}
diff --git a/gnu/usr.bin/gdb/gdbserver/reg-arm.c b/gnu/usr.bin/gdb/gdbserver/reg-arm.c
deleted file mode 100644
index 50379bfed756..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/reg-arm.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
-
-/* A register protocol for GDB, the GNU debugger.
- Copyright 2001, 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This file was created with the aid of ``regdat.sh'' and ``reg-arm.dat''. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "regdef.h"
-#include "regcache.h"
-
-struct reg regs_arm[] = {
- { "r0", 0, 32 },
- { "r1", 32, 32 },
- { "r2", 64, 32 },
- { "r3", 96, 32 },
- { "r4", 128, 32 },
- { "r5", 160, 32 },
- { "r6", 192, 32 },
- { "r7", 224, 32 },
- { "r8", 256, 32 },
- { "r9", 288, 32 },
- { "r10", 320, 32 },
- { "r11", 352, 32 },
- { "r12", 384, 32 },
- { "sp", 416, 32 },
- { "lr", 448, 32 },
- { "pc", 480, 32 },
- { "f0", 512, 96 },
- { "f1", 608, 96 },
- { "f2", 704, 96 },
- { "f3", 800, 96 },
- { "f4", 896, 96 },
- { "f5", 992, 96 },
- { "f6", 1088, 96 },
- { "f7", 1184, 96 },
- { "fps", 1280, 32 },
- { "cpsr", 1312, 32 },
-};
-
-const char *expedite_regs_arm[] = { "r11", "sp", "pc", 0 };
-
-void
-init_registers ()
-{
- set_register_cache (regs_arm,
- sizeof (regs_arm) / sizeof (regs_arm[0]));
- gdbserver_expedite_regs = expedite_regs_arm;
-}
diff --git a/gnu/usr.bin/gdb/gdbserver/reg-i386.c b/gnu/usr.bin/gdb/gdbserver/reg-i386.c
deleted file mode 100644
index 3307ea933c45..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/reg-i386.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
-
-/* This file was created with the aid of ``regdat.sh'' and ``../../../../contrib/gdb/gdb/regformats/reg-i386.dat''. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "regdef.h"
-#include "regcache.h"
-
-struct reg regs_i386[] = {
- { "eax", 0, 32 },
- { "ecx", 32, 32 },
- { "edx", 64, 32 },
- { "ebx", 96, 32 },
- { "esp", 128, 32 },
- { "ebp", 160, 32 },
- { "esi", 192, 32 },
- { "edi", 224, 32 },
- { "eip", 256, 32 },
- { "eflags", 288, 32 },
- { "cs", 320, 32 },
- { "ss", 352, 32 },
- { "ds", 384, 32 },
- { "es", 416, 32 },
- { "fs", 448, 32 },
- { "gs", 480, 32 },
- { "st0", 512, 80 },
- { "st1", 592, 80 },
- { "st2", 672, 80 },
- { "st3", 752, 80 },
- { "st4", 832, 80 },
- { "st5", 912, 80 },
- { "st6", 992, 80 },
- { "st7", 1072, 80 },
- { "fctrl", 1152, 32 },
- { "fstat", 1184, 32 },
- { "ftag", 1216, 32 },
- { "fiseg", 1248, 32 },
- { "fioff", 1280, 32 },
- { "foseg", 1312, 32 },
- { "fooff", 1344, 32 },
- { "fop", 1376, 32 },
- { "xmm0", 1408, 128 },
- { "xmm1", 1536, 128 },
- { "xmm2", 1664, 128 },
- { "xmm3", 1792, 128 },
- { "xmm4", 1920, 128 },
- { "xmm5", 2048, 128 },
- { "xmm6", 2176, 128 },
- { "xmm7", 2304, 128 },
- { "mxcsr", 2432, 32 },
-};
-
-const char *expedite_regs_i386[] = { "ebp", "esp", "eip", 0 };
-
-void
-init_registers ()
-{
- set_register_cache (regs_i386,
- sizeof (regs_i386) / sizeof (regs_i386[0]));
- gdbserver_expedite_regs = expedite_regs_i386;
-}
diff --git a/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c b/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c
deleted file mode 100644
index 47046631d52e..000000000000
--- a/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
-
-/* A register protocol for GDB, the GNU debugger.
- Copyright 2001, 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This file was created with the aid of ``regdat.sh'' and ``../../../../contrib/gdb/gdb/regformats/reg-ppc.dat''. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "regdef.h"
-#include "regcache.h"
-
-struct reg regs_ppc[] = {
- { "r0", 0, 32 },
- { "r1", 32, 32 },
- { "r2", 64, 32 },
- { "r3", 96, 32 },
- { "r4", 128, 32 },
- { "r5", 160, 32 },
- { "r6", 192, 32 },
- { "r7", 224, 32 },
- { "r8", 256, 32 },
- { "r9", 288, 32 },
- { "r10", 320, 32 },
- { "r11", 352, 32 },
- { "r12", 384, 32 },
- { "r13", 416, 32 },
- { "r14", 448, 32 },
- { "r15", 480, 32 },
- { "r16", 512, 32 },
- { "r17", 544, 32 },
- { "r18", 576, 32 },
- { "r19", 608, 32 },
- { "r20", 640, 32 },
- { "r21", 672, 32 },
- { "r22", 704, 32 },
- { "r23", 736, 32 },
- { "r24", 768, 32 },
- { "r25", 800, 32 },
- { "r26", 832, 32 },
- { "r27", 864, 32 },
- { "r28", 896, 32 },
- { "r29", 928, 32 },
- { "r30", 960, 32 },
- { "r31", 992, 32 },
- { "f0", 1024, 64 },
- { "f1", 1088, 64 },
- { "f2", 1152, 64 },
- { "f3", 1216, 64 },
- { "f4", 1280, 64 },
- { "f5", 1344, 64 },
- { "f6", 1408, 64 },
- { "f7", 1472, 64 },
- { "f8", 1536, 64 },
- { "f9", 1600, 64 },
- { "f10", 1664, 64 },
- { "f11", 1728, 64 },
- { "f12", 1792, 64 },
- { "f13", 1856, 64 },
- { "f14", 1920, 64 },
- { "f15", 1984, 64 },
- { "f16", 2048, 64 },
- { "f17", 2112, 64 },
- { "f18", 2176, 64 },
- { "f19", 2240, 64 },
- { "f20", 2304, 64 },
- { "f21", 2368, 64 },
- { "f22", 2432, 64 },
- { "f23", 2496, 64 },
- { "f24", 2560, 64 },
- { "f25", 2624, 64 },
- { "f26", 2688, 64 },
- { "f27", 2752, 64 },
- { "f28", 2816, 64 },
- { "f29", 2880, 64 },
- { "f30", 2944, 64 },
- { "f31", 3008, 64 },
- { "pc", 3072, 32 },
- { "ps", 3104, 32 },
- { "cr", 3136, 32 },
- { "lr", 3168, 32 },
- { "ctr", 3200, 32 },
- { "xer", 3232, 32 },
- { "fpscr", 3264, 32 },
-};
-
-const char *expedite_regs_ppc[] = { "r1", "pc", 0 };
-
-void
-init_registers ()
-{
- set_register_cache (regs_ppc,
- sizeof (regs_ppc) / sizeof (regs_ppc[0]));
- gdbserver_expedite_regs = expedite_regs_ppc;
-}
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile b/gnu/usr.bin/gdb/kgdb/Makefile
deleted file mode 100644
index 8fb781eca917..000000000000
--- a/gnu/usr.bin/gdb/kgdb/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# $FreeBSD$
-
-PROG= kgdb${GDB_SUFFIX}
-SRCS= main.c kld.c kthr.c trgt.c trgt_${TARGET_CPUARCH}.c
-WARNS?= 2
-
-BULIBS= ${OBJ_BU}/libbfd/libbfd${PIE_SUFFIX}.a \
- ${OBJ_BU}/libopcodes/libopcodes${PIE_SUFFIX}.a \
- ${OBJ_BU}/libiberty/libiberty${PIE_SUFFIX}.a
-GDBLIBS= ${OBJ_GDB}/libgdb/libgdb${PIE_SUFFIX}.a
-
-DPADD= ${GDBLIBS} ${BULIBS}
-LDADD= ${GDBLIBS} ${BULIBS}
-LIBADD+= m edit ncursesw gnuregex kvm
-
-.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile.depend b/gnu/usr.bin/gdb/kgdb/Makefile.depend
deleted file mode 100644
index ed1b03ca732f..000000000000
--- a/gnu/usr.bin/gdb/kgdb/Makefile.depend
+++ /dev/null
@@ -1,27 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/csu \
- gnu/lib/libreadline/readline \
- gnu/lib/libregex \
- gnu/usr.bin/binutils/libbfd \
- gnu/usr.bin/binutils/libiberty \
- gnu/usr.bin/binutils/libopcodes \
- gnu/usr.bin/gdb/libgdb \
- include \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
- lib/libelf \
- lib/libkvm \
- lib/msun \
- lib/ncurses/ncursesw \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/gdb/kgdb/kgdb.1 b/gnu/usr.bin/gdb/kgdb/kgdb.1
deleted file mode 100644
index 8ebfbf55ce9f..000000000000
--- a/gnu/usr.bin/gdb/kgdb/kgdb.1
+++ /dev/null
@@ -1,150 +0,0 @@
-.\" Copyright (c) 2004 Marcel Moolenaar
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd July 5, 2017
-.Dt KGDB 1
-.Os
-.Sh NAME
-.Nm kgdb
-.Nd "kernel debugger"
-.Sh SYNOPSIS
-.Nm
-.Op Fl a | Fl f | Fl fullname
-.Op Fl b Ar rate
-.Op Fl q | Fl quiet
-.Op Fl v
-.Op Fl w
-.Op Fl d Ar crashdir
-.Op Fl c Ar core | Fl n Ar dumpnr | Fl r Ar device
-.Op Ar kernel Op Ar core
-.Sh DEPRECATION NOTICE
-This version of
-.Nm
-is deprecated and will be removed from future versions of the
-.Fx
-base system.
-A newer version of
-.Nm
-is available from ports or packages
-(devel/gdb).
-.Sh DESCRIPTION
-The
-.Nm
-utility is a debugger based on
-.Xr gdb 1
-that allows debugging of kernel core files.
-.Pp
-The options are as follows:
-.Bl -tag -width ".Fl d Ar crashdir"
-.It Fl a
-Increase the annotation level.
-An annotation level of 1 features the historical
-.Fl fullname
-option of
-.Xr gdb 1 .
-This is useful when running
-.Nm
-in Emacs.
-The
-.Fl f
-or
-.Fl fullname
-options are supported for backward compatibility as well.
-.It Fl b Ar rate
-Set the baudrate to
-.Ar rate .
-.It Fl q
-Suppress printing of the banner when the debugger starts.
-The
-.Fl quiet
-form is supported for compatibility as well.
-.It Fl v
-Increase verbosity.
-.It Fl w
-Opens kmem-based targets in read-write mode.
-(This is identical to what
-.Fl -wcore
-used to do in previous
-gdb versions for
-.Fx . )
-.It Fl d Ar crashdir
-Use
-.Ar crashdir
-instead of the default,
-.Pa /var/crash
-to locate kernel core dump files in.
-The name
-.Pa vmcore.
-plus the dump number will be appended to determine
-the actual dump file name.
-.It Fl c Ar core
-Explicitly use
-.Ar core
-as the core dump file.
-.It Fl n Ar dumpnr
-Use the kernel core dump file numbered
-.Ar dumpnr
-for debugging.
-.It Fl r Ar device
-Use
-.Ar device
-to connect
-.Nm
-to for a remote debugging session.
-.El
-.Pp
-The
-.Fl c , n ,
-and
-.Fl r
-options are mutually exclusive.
-.Pp
-Optionally, the name of the kernel symbol file and
-the name of the core dump file can be supplied on the
-command-line as positional arguments.
-If no kernel symbol file name has been given, the
-symbol file of the currently running kernel will be
-used.
-If no core dump file has been specified through either
-of the options or the last command-line argument,
-.Pa /dev/mem
-will be opened to allow debugging the currently running
-kernel.
-.Sh FILES
-.Bl -tag -width ".Pa /var/crash"
-.It Pa /dev/mem
-Default memory image to open if no core dump file
-has been specified.
-.It Pa /var/crash
-Default directory to locate kernel core dump files.
-.El
-.Sh SEE ALSO
-.Xr gdb 1
-.Sh HISTORY
-The
-.Nm
-utility first appeared in its current form in
-.Fx 5.3 .
diff --git a/gnu/usr.bin/gdb/kgdb/kgdb.h b/gnu/usr.bin/gdb/kgdb/kgdb.h
deleted file mode 100644
index 8e5d2baf40b4..000000000000
--- a/gnu/usr.bin/gdb/kgdb/kgdb.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _KGDB_H_
-#define _KGDB_H_
-
-struct thread_info;
-
-extern kvm_t *kvm;
-
-struct kthr {
- struct kthr *next;
- uintptr_t paddr;
- uintptr_t kaddr;
- uintptr_t kstack;
- uintptr_t pcb;
- int tid;
- int pid;
- int cpu;
-};
-
-extern struct kthr *curkthr;
-
-void initialize_kld_target(void);
-void initialize_kgdb_target(void);
-void kgdb_dmesg(void);
-CORE_ADDR kgdb_trgt_core_pcb(u_int);
-CORE_ADDR kgdb_trgt_stop_pcb(u_int, u_int);
-void kgdb_trgt_new_objfile(struct objfile *);
-void kgdb_trgt_fetch_registers(int);
-void kgdb_trgt_store_registers(int);
-void kld_init(void);
-void kld_new_objfile(struct objfile *);
-
-frame_unwind_sniffer_ftype kgdb_trgt_trapframe_sniffer;
-
-struct kthr *kgdb_thr_first(void);
-struct kthr *kgdb_thr_init(void);
-struct kthr *kgdb_thr_lookup_tid(int);
-struct kthr *kgdb_thr_lookup_pid(int);
-struct kthr *kgdb_thr_lookup_paddr(uintptr_t);
-struct kthr *kgdb_thr_lookup_taddr(uintptr_t);
-struct kthr *kgdb_thr_next(struct kthr *);
-struct kthr *kgdb_thr_select(struct kthr *);
-char *kgdb_thr_extra_thread_info(int);
-
-CORE_ADDR kgdb_lookup(const char *sym);
-CORE_ADDR kgdb_parse_1(const char *, int);
-
-#define kgdb_parse(exp) kgdb_parse_1((exp), 0)
-#define kgdb_parse_quiet(exp) kgdb_parse_1((exp), 1)
-
-extern int (*arm_tdep_pc_fixup)(CORE_ADDR *pc);
-int kgdb_trgt_pc_fixup(CORE_ADDR *pc);
-
-#endif /* _KGDB_H_ */
diff --git a/gnu/usr.bin/gdb/kgdb/kld.c b/gnu/usr.bin/gdb/kgdb/kld.c
deleted file mode 100644
index 50f0797c4cf4..000000000000
--- a/gnu/usr.bin/gdb/kgdb/kld.c
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <kvm.h>
-#include <libgen.h>
-
-#include <defs.h>
-#include <command.h>
-#include <completer.h>
-#include <environ.h>
-#include <exec.h>
-#include <frame-unwind.h>
-#include <inferior.h>
-#include <objfiles.h>
-#include <gdbcore.h>
-#include <language.h>
-#include <solist.h>
-
-#include "kgdb.h"
-
-struct lm_info {
- CORE_ADDR base_address;
-};
-
-/* Offsets of fields in linker_file structure. */
-static CORE_ADDR off_address, off_filename, off_pathname, off_next;
-
-/* KVA of 'linker_path' which corresponds to the kern.module_path sysctl .*/
-static CORE_ADDR module_path_addr;
-static CORE_ADDR linker_files_addr;
-static CORE_ADDR kernel_file_addr;
-
-static struct target_so_ops kld_so_ops;
-
-static int
-kld_ok (char *path)
-{
- struct stat sb;
-
- if (stat(path, &sb) == 0 && S_ISREG(sb.st_mode))
- return (1);
- return (0);
-}
-
-/*
- * Look for a matching file checking for debug suffixes before the raw file:
- * - filename + ".debug" (e.g. foo.ko.debug)
- * - filename (e.g. foo.ko)
- */
-static const char *kld_suffixes[] = {
- ".debug",
- ".symbols",
- "",
- NULL
-};
-
-static int
-check_kld_path (char *path, size_t path_size)
-{
- const char **suffix;
- char *ep;
-
- ep = path + strlen(path);
- suffix = kld_suffixes;
- while (*suffix != NULL) {
- if (strlcat(path, *suffix, path_size) < path_size) {
- if (kld_ok(path))
- return (1);
- }
-
- /* Restore original path to remove suffix. */
- *ep = '\0';
- suffix++;
- }
- return (0);
-}
-
-/*
- * Try to find the path for a kld by looking in the kernel's directory and
- * in the various paths in the module path.
- */
-static int
-find_kld_path (char *filename, char *path, size_t path_size)
-{
- char *module_path;
- char *kernel_dir, *module_dir, *cp;
- int error;
-
- if (exec_bfd) {
- kernel_dir = dirname(bfd_get_filename(exec_bfd));
- if (kernel_dir != NULL) {
- snprintf(path, path_size, "%s/%s", kernel_dir,
- filename);
- if (check_kld_path(path, path_size))
- return (1);
- }
- }
- if (module_path_addr != 0) {
- target_read_string(module_path_addr, &module_path, PATH_MAX,
- &error);
- if (error == 0) {
- make_cleanup(xfree, module_path);
- cp = module_path;
- while ((module_dir = strsep(&cp, ";")) != NULL) {
- snprintf(path, path_size, "%s/%s", module_dir,
- filename);
- if (check_kld_path(path, path_size))
- return (1);
- }
- }
- }
- return (0);
-}
-
-/*
- * Read a kernel pointer given a KVA in 'address'.
- */
-static CORE_ADDR
-read_pointer (CORE_ADDR address)
-{
- CORE_ADDR value;
-
- if (target_read_memory(address, (char *)&value, TARGET_PTR_BIT / 8) !=
- 0)
- return (0);
- return (extract_unsigned_integer(&value, TARGET_PTR_BIT / 8));
-}
-
-/*
- * Try to find this kld in the kernel linker's list of linker files.
- */
-static int
-find_kld_address (char *arg, CORE_ADDR *address)
-{
- CORE_ADDR kld;
- char *kld_filename;
- char *filename;
- int error;
-
- if (linker_files_addr == 0 || off_address == 0 || off_filename == 0 ||
- off_next == 0)
- return (0);
-
- filename = basename(arg);
- for (kld = read_pointer(linker_files_addr); kld != 0;
- kld = read_pointer(kld + off_next)) {
- /* Try to read this linker file's filename. */
- target_read_string(read_pointer(kld + off_filename),
- &kld_filename, PATH_MAX, &error);
- if (error)
- continue;
-
- /* Compare this kld's filename against our passed in name. */
- if (strcmp(kld_filename, filename) != 0) {
- xfree(kld_filename);
- continue;
- }
- xfree(kld_filename);
-
- /*
- * We found a match, use its address as the base
- * address if we can read it.
- */
- *address = read_pointer(kld + off_address);
- if (*address == 0)
- return (0);
- return (1);
- }
- return (0);
-}
-
-static void
-adjust_section_address (struct section_table *sec, CORE_ADDR *curr_base)
-{
- struct bfd_section *asect = sec->the_bfd_section;
- bfd *abfd = sec->bfd;
-
- if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) {
- sec->addr += *curr_base;
- sec->endaddr += *curr_base;
- return;
- }
-
- *curr_base = align_power(*curr_base,
- bfd_get_section_alignment(abfd, asect));
- sec->addr = *curr_base;
- sec->endaddr = sec->addr + bfd_section_size(abfd, asect);
- *curr_base = sec->endaddr;
-}
-
-static void
-load_kld (char *path, CORE_ADDR base_addr, int from_tty)
-{
- struct section_addr_info *sap;
- struct section_table *sections = NULL, *sections_end = NULL, *s;
- struct cleanup *cleanup;
- bfd *bfd;
- CORE_ADDR curr_addr;
- int i;
-
- /* Open the kld. */
- bfd = bfd_openr(path, gnutarget);
- if (bfd == NULL)
- error("\"%s\": can't open: %s", path,
- bfd_errmsg(bfd_get_error()));
- cleanup = make_cleanup_bfd_close(bfd);
-
- if (!bfd_check_format(bfd, bfd_object))
- error("\%s\": not an object file", path);
-
- /* Make sure we have a .text section. */
- if (bfd_get_section_by_name (bfd, ".text") == NULL)
- error("\"%s\": can't find text section", path);
-
- /* Build a section table from the bfd and relocate the sections. */
- if (build_section_table (bfd, &sections, &sections_end))
- error("\"%s\": can't find file sections", path);
- cleanup = make_cleanup(xfree, sections);
- curr_addr = base_addr;
- for (s = sections; s < sections_end; s++)
- adjust_section_address(s, &curr_addr);
-
- /* Build a section addr info to pass to symbol_file_add(). */
- sap = build_section_addr_info_from_section_table (sections,
- sections_end);
- cleanup = make_cleanup((make_cleanup_ftype *)free_section_addr_info,
- sap);
-
- printf_unfiltered("add symbol table from file \"%s\" at\n", path);
- for (i = 0; i < sap->num_sections; i++)
- printf_unfiltered("\t%s_addr = %s\n", sap->other[i].name,
- local_hex_string(sap->other[i].addr));
-
- if (from_tty && (!query("%s", "")))
- error("Not confirmed.");
-
- symbol_file_add(path, from_tty, sap, 0, OBJF_USERLOADED);
-
- do_cleanups(cleanup);
-}
-
-static void
-kgdb_add_kld_cmd (char *arg, int from_tty)
-{
- char path[PATH_MAX];
- CORE_ADDR base_addr;
-
- if (!exec_bfd)
- error("No kernel symbol file");
-
- /* Try to open the raw path to handle absolute paths first. */
- snprintf(path, sizeof(path), "%s", arg);
- if (!check_kld_path(path, sizeof(path))) {
-
- /*
- * If that didn't work, look in the various possible
- * paths for the module.
- */
- if (!find_kld_path(arg, path, sizeof(path))) {
- error("Unable to locate kld");
- return;
- }
- }
-
- if (!find_kld_address(arg, &base_addr)) {
- error("Unable to find kld in kernel");
- return;
- }
-
- load_kld(path, base_addr, from_tty);
-
- reinit_frame_cache();
-}
-
-static void
-kld_relocate_section_addresses (struct so_list *so, struct section_table *sec)
-{
- static CORE_ADDR curr_addr;
-
- if (sec == so->sections)
- curr_addr = so->lm_info->base_address;
-
- adjust_section_address(sec, &curr_addr);
-}
-
-static void
-kld_free_so (struct so_list *so)
-{
-
- xfree(so->lm_info);
-}
-
-static void
-kld_clear_solib (void)
-{
-}
-
-static void
-kld_solib_create_inferior_hook (void)
-{
-}
-
-static void
-kld_special_symbol_handling (void)
-{
-}
-
-static struct so_list *
-kld_current_sos (void)
-{
- struct so_list *head, **prev, *new;
- CORE_ADDR kld, kernel;
- char *path;
- int error;
-
- if (linker_files_addr == 0 || kernel_file_addr == 0 ||
- off_address == 0 || off_filename == 0 || off_next == 0)
- return (NULL);
-
- head = NULL;
- prev = &head;
-
- /*
- * Walk the list of linker files creating so_list entries for
- * each non-kernel file.
- */
- kernel = read_pointer(kernel_file_addr);
- for (kld = read_pointer(linker_files_addr); kld != 0;
- kld = read_pointer(kld + off_next)) {
- /* Skip the main kernel file. */
- if (kld == kernel)
- continue;
-
- new = xmalloc(sizeof(*new));
- memset(new, 0, sizeof(*new));
-
- new->lm_info = xmalloc(sizeof(*new->lm_info));
- new->lm_info->base_address = 0;
-
- /* Read the base filename and store it in so_original_name. */
- target_read_string(read_pointer(kld + off_filename),
- &path, sizeof(new->so_original_name), &error);
- if (error != 0) {
- warning("kld_current_sos: Can't read filename: %s\n",
- safe_strerror(error));
- free_so(new);
- continue;
- }
- strlcpy(new->so_original_name, path,
- sizeof(new->so_original_name));
- xfree(path);
-
- /*
- * Try to read the pathname (if it exists) and store
- * it in so_name.
- */
- if (find_kld_path(new->so_original_name, new->so_name,
- sizeof(new->so_name))) {
- /* we found the kld */;
- } else if (off_pathname != 0) {
- target_read_string(read_pointer(kld + off_pathname),
- &path, sizeof(new->so_name), &error);
- if (error != 0) {
- warning(
- "kld_current_sos: Can't read pathname for \"%s\": %s\n",
- new->so_original_name,
- safe_strerror(error));
- strlcpy(new->so_name, new->so_original_name,
- sizeof(new->so_name));
- } else {
- strlcpy(new->so_name, path,
- sizeof(new->so_name));
- xfree(path);
- }
- } else
- strlcpy(new->so_name, new->so_original_name,
- sizeof(new->so_name));
-
- /* Read this kld's base address. */
- new->lm_info->base_address = read_pointer(kld + off_address);
- if (new->lm_info->base_address == 0) {
- warning(
- "kld_current_sos: Invalid address for kld \"%s\"",
- new->so_original_name);
- free_so(new);
- continue;
- }
-
- /* Append to the list. */
- *prev = new;
- prev = &new->next;
- }
-
- return (head);
-}
-
-static int
-kld_open_symbol_file_object (void *from_ttyp)
-{
-
- return (0);
-}
-
-static int
-kld_in_dynsym_resolve_code (CORE_ADDR pc)
-{
-
- return (0);
-}
-
-static int
-kld_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
-{
- char path[PATH_MAX];
- int fd;
-
- *temp_pathname = NULL;
- if (!find_kld_path(solib, path, sizeof(path))) {
- errno = ENOENT;
- return (-1);
- }
- fd = open(path, o_flags, 0);
- if (fd >= 0)
- *temp_pathname = xstrdup(path);
- return (fd);
-}
-
-void
-kld_new_objfile (struct objfile *objfile)
-{
-
- if (!have_partial_symbols())
- return;
-
- /*
- * Compute offsets of relevant members in struct linker_file
- * and the addresses of global variables. Don't warn about
- * kernels that don't have 'pathname' in the linker_file
- * struct since 6.x kernels don't have it.
- */
- off_address = kgdb_parse("&((struct linker_file *)0)->address");
- off_filename = kgdb_parse("&((struct linker_file *)0)->filename");
- off_pathname = kgdb_parse_quiet("&((struct linker_file *)0)->pathname");
- off_next = kgdb_parse("&((struct linker_file *)0)->link.tqe_next");
- module_path_addr = kgdb_parse("linker_path");
- linker_files_addr = kgdb_parse("&linker_files.tqh_first");
- kernel_file_addr = kgdb_parse("&linker_kernel_file");
-}
-
-static int
-load_klds_stub (void *arg)
-{
-
- SOLIB_ADD(NULL, 1, &current_target, auto_solib_add);
- return (0);
-}
-
-void
-kld_init (void)
-{
-
- catch_errors(load_klds_stub, NULL, NULL, RETURN_MASK_ALL);
-}
-
-void
-initialize_kld_target(void)
-{
- struct cmd_list_element *c;
-
- kld_so_ops.relocate_section_addresses = kld_relocate_section_addresses;
- kld_so_ops.free_so = kld_free_so;
- kld_so_ops.clear_solib = kld_clear_solib;
- kld_so_ops.solib_create_inferior_hook = kld_solib_create_inferior_hook;
- kld_so_ops.special_symbol_handling = kld_special_symbol_handling;
- kld_so_ops.current_sos = kld_current_sos;
- kld_so_ops.open_symbol_file_object = kld_open_symbol_file_object;
- kld_so_ops.in_dynsym_resolve_code = kld_in_dynsym_resolve_code;
- kld_so_ops.find_and_open_solib = kld_find_and_open_solib;
-
- current_target_so_ops = &kld_so_ops;
-
- c = add_com("add-kld", class_files, kgdb_add_kld_cmd,
- "Usage: add-kld FILE\n\
-Load the symbols from the kernel loadable module FILE.");
- set_cmd_completer(c, filename_completer);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/kthr.c b/gnu/usr.bin/gdb/kgdb/kthr.c
deleted file mode 100644
index 1bc95cb18b36..000000000000
--- a/gnu/usr.bin/gdb/kgdb/kthr.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/cpuset.h>
-#include <sys/proc.h>
-#include <sys/types.h>
-#include <sys/signal.h>
-#include <err.h>
-#include <inttypes.h>
-#include <kvm.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <defs.h>
-#include <frame-unwind.h>
-
-#include "kgdb.h"
-
-static CORE_ADDR dumppcb;
-static int dumptid;
-
-static cpuset_t stopped_cpus;
-
-static struct kthr *first;
-struct kthr *curkthr;
-
-CORE_ADDR
-kgdb_lookup(const char *sym)
-{
- CORE_ADDR addr;
- char *name;
-
- asprintf(&name, "&%s", sym);
- addr = kgdb_parse(name);
- free(name);
- return (addr);
-}
-
-struct kthr *
-kgdb_thr_first(void)
-{
- return (first);
-}
-
-static void
-kgdb_thr_add_procs(uintptr_t paddr)
-{
- struct proc p;
- struct thread td;
- struct kthr *kt;
- CORE_ADDR addr;
-
- while (paddr != 0) {
- if (kvm_read(kvm, paddr, &p, sizeof(p)) != sizeof(p)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- break;
- }
- addr = (uintptr_t)TAILQ_FIRST(&p.p_threads);
- while (addr != 0) {
- if (kvm_read(kvm, addr, &td, sizeof(td)) !=
- sizeof(td)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- break;
- }
- kt = malloc(sizeof(*kt));
- kt->next = first;
- kt->kaddr = addr;
- if (td.td_tid == dumptid)
- kt->pcb = dumppcb;
- else if (td.td_oncpu != NOCPU &&
- CPU_ISSET(td.td_oncpu, &stopped_cpus))
- kt->pcb = kgdb_trgt_core_pcb(td.td_oncpu);
- else
- kt->pcb = (uintptr_t)td.td_pcb;
- kt->kstack = td.td_kstack;
- kt->tid = td.td_tid;
- kt->pid = p.p_pid;
- kt->paddr = paddr;
- kt->cpu = td.td_oncpu;
- first = kt;
- addr = (uintptr_t)TAILQ_NEXT(&td, td_plist);
- }
- paddr = (uintptr_t)LIST_NEXT(&p, p_list);
- }
-}
-
-struct kthr *
-kgdb_thr_init(void)
-{
- long cpusetsize;
- struct kthr *kt;
- CORE_ADDR addr;
- uintptr_t paddr;
-
- while (first != NULL) {
- kt = first;
- first = kt->next;
- free(kt);
- }
-
- addr = kgdb_lookup("allproc");
- if (addr == 0)
- return (NULL);
- kvm_read(kvm, addr, &paddr, sizeof(paddr));
-
- dumppcb = kgdb_lookup("dumppcb");
- if (dumppcb == 0)
- return (NULL);
-
- addr = kgdb_lookup("dumptid");
- if (addr != 0)
- kvm_read(kvm, addr, &dumptid, sizeof(dumptid));
- else
- dumptid = -1;
-
- addr = kgdb_lookup("stopped_cpus");
- CPU_ZERO(&stopped_cpus);
- cpusetsize = sysconf(_SC_CPUSET_SIZE);
- if (cpusetsize != -1 && (u_long)cpusetsize <= sizeof(cpuset_t) &&
- addr != 0)
- kvm_read(kvm, addr, &stopped_cpus, cpusetsize);
-
- kgdb_thr_add_procs(paddr);
- addr = kgdb_lookup("zombproc");
- if (addr != 0) {
- kvm_read(kvm, addr, &paddr, sizeof(paddr));
- kgdb_thr_add_procs(paddr);
- }
- curkthr = kgdb_thr_lookup_tid(dumptid);
- if (curkthr == NULL)
- curkthr = first;
- return (first);
-}
-
-struct kthr *
-kgdb_thr_lookup_tid(int tid)
-{
- struct kthr *kt;
-
- kt = first;
- while (kt != NULL && kt->tid != tid)
- kt = kt->next;
- return (kt);
-}
-
-struct kthr *
-kgdb_thr_lookup_taddr(uintptr_t taddr)
-{
- struct kthr *kt;
-
- kt = first;
- while (kt != NULL && kt->kaddr != taddr)
- kt = kt->next;
- return (kt);
-}
-
-struct kthr *
-kgdb_thr_lookup_pid(int pid)
-{
- struct kthr *kt;
-
- kt = first;
- while (kt != NULL && kt->pid != pid)
- kt = kt->next;
- return (kt);
-}
-
-struct kthr *
-kgdb_thr_lookup_paddr(uintptr_t paddr)
-{
- struct kthr *kt;
-
- kt = first;
- while (kt != NULL && kt->paddr != paddr)
- kt = kt->next;
- return (kt);
-}
-
-struct kthr *
-kgdb_thr_next(struct kthr *kt)
-{
- return (kt->next);
-}
-
-struct kthr *
-kgdb_thr_select(struct kthr *kt)
-{
- struct kthr *pcur;
-
- pcur = curkthr;
- curkthr = kt;
- return (pcur);
-}
-
-char *
-kgdb_thr_extra_thread_info(int tid)
-{
- char comm[MAXCOMLEN + 1];
- char td_name[MAXCOMLEN + 1];
- struct kthr *kt;
- struct proc *p;
- struct thread *t;
- static char buf[64];
-
- kt = kgdb_thr_lookup_tid(tid);
- if (kt == NULL)
- return (NULL);
- snprintf(buf, sizeof(buf), "PID=%d", kt->pid);
- p = (struct proc *)kt->paddr;
- if (kvm_read(kvm, (uintptr_t)&p->p_comm[0], &comm, sizeof(comm)) !=
- sizeof(comm))
- return (buf);
- strlcat(buf, ": ", sizeof(buf));
- strlcat(buf, comm, sizeof(buf));
- t = (struct thread *)kt->kaddr;
- if (kvm_read(kvm, (uintptr_t)&t->td_name[0], &td_name,
- sizeof(td_name)) == sizeof(td_name) &&
- strcmp(comm, td_name) != 0) {
- strlcat(buf, "/", sizeof(buf));
- strlcat(buf, td_name, sizeof(buf));
- }
- return (buf);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/main.c b/gnu/usr.bin/gdb/kgdb/main.c
deleted file mode 100644
index a1da89314a0e..000000000000
--- a/gnu/usr.bin/gdb/kgdb/main.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/resource.h>
-#include <sys/select.h>
-#include <sys/time.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <err.h>
-#include <inttypes.h>
-#include <kvm.h>
-#include <limits.h>
-#include <paths.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-/* libgdb stuff. */
-#include <defs.h>
-#include <frame.h>
-#include <frame-unwind.h>
-#include <inferior.h>
-#include <interps.h>
-#include <cli-out.h>
-#include <main.h>
-#include <objfiles.h>
-#include <target.h>
-#include <top.h>
-#include <ui-file.h>
-#include <bfd.h>
-#include <gdbcore.h>
-#include <wrapper.h>
-
-extern frame_unwind_sniffer_ftype *kgdb_sniffer_kluge;
-
-#include "kgdb.h"
-
-static int dumpnr;
-static int quiet;
-static int verbose;
-
-static char crashdir[PATH_MAX];
-static char *kernel;
-static char *remote;
-static char *vmcore;
-static struct ui_file *parse_gdberr;
-
-static void (*kgdb_new_objfile_chain)(struct objfile * objfile);
-
-static void
-usage(void)
-{
-
- fprintf(stderr,
- "usage: %s [-afqvw] [-b rate] [-d crashdir] [-c core | -n dumpnr | -r device]\n"
- "\t[kernel [core]]\n", getprogname());
- exit(1);
-}
-
-static void
-kernel_from_dumpnr(int nr)
-{
- char path[PATH_MAX];
- FILE *info;
- char *s;
- struct stat st;
- int l;
-
- /*
- * If there's a kernel image right here in the crash directory, then
- * use it. The kernel image is either called kernel.<nr> or is in a
- * subdirectory kernel.<nr> and called kernel. The latter allows us
- * to collect the modules in the same place.
- */
- snprintf(path, sizeof(path), "%s/kernel.%d", crashdir, nr);
- if (stat(path, &st) == 0) {
- if (S_ISREG(st.st_mode)) {
- kernel = strdup(path);
- return;
- }
- if (S_ISDIR(st.st_mode)) {
- snprintf(path, sizeof(path), "%s/kernel.%d/kernel",
- crashdir, nr);
- if (stat(path, &st) == 0 && S_ISREG(st.st_mode)) {
- kernel = strdup(path);
- return;
- }
- }
- }
-
- /*
- * No kernel image here. Parse the dump header. The kernel object
- * directory can be found there and we probably have the kernel
- * image still in it. The object directory may also have a kernel
- * with debugging info (called kernel.debug). If we have a debug
- * kernel, use it.
- */
- snprintf(path, sizeof(path), "%s/info.%d", crashdir, nr);
- info = fopen(path, "r");
- if (info == NULL) {
- warn("%s", path);
- return;
- }
- while (fgets(path, sizeof(path), info) != NULL) {
- l = strlen(path);
- if (l > 0 && path[l - 1] == '\n')
- path[--l] = '\0';
- if (strncmp(path, " ", 4) == 0) {
- s = strchr(path, ':');
- s = (s == NULL) ? path + 4 : s + 1;
- l = snprintf(path, sizeof(path), "%s/kernel.debug", s);
- if (stat(path, &st) == -1 || !S_ISREG(st.st_mode)) {
- path[l - 6] = '\0';
- if (stat(path, &st) == -1 ||
- !S_ISREG(st.st_mode))
- break;
- }
- kernel = strdup(path);
- break;
- }
- }
- fclose(info);
-}
-
-static void
-kgdb_new_objfile(struct objfile *objfile)
-{
- static int once = 1;
-
- kld_new_objfile(objfile);
- kgdb_trgt_new_objfile(objfile);
-
- if (kgdb_new_objfile_chain != NULL)
- kgdb_new_objfile_chain(objfile);
-
- if (once && objfile != NULL && objfile == symfile_objfile) {
- /*
- * The initial kernel has just been loaded. Start the
- * remote target if we have one.
- */
- once = 0;
- if (remote != NULL)
- push_remote_target (remote, 0);
- }
-}
-
-/*
- * Parse an expression and return its value. If 'quiet' is true, then
- * any error messages from the parser are masked.
- */
-CORE_ADDR
-kgdb_parse_1(const char *exp, int quiet)
-{
- struct ui_file *old_stderr;
- struct cleanup *old_chain;
- struct expression *expr;
- struct value *val;
- char *s;
- CORE_ADDR n;
-
- old_stderr = gdb_stderr;
- if (quiet)
- gdb_stderr = parse_gdberr;
- n = 0;
- s = xstrdup(exp);
- old_chain = make_cleanup(xfree, s);
- if (gdb_parse_exp_1(&s, NULL, 0, &expr) && *s == '\0') {
- make_cleanup(free_current_contents, &expr);
- if (gdb_evaluate_expression(expr, &val))
- n = value_as_address(val);
- }
- do_cleanups(old_chain);
- gdb_stderr = old_stderr;
- return (n);
-}
-
-#define MSGBUF_SEQ_TO_POS(size, seq) ((seq) % (size))
-
-void
-kgdb_dmesg(void)
-{
- CORE_ADDR bufp;
- int size, rseq, wseq;
- char c;
-
- /*
- * Display the unread portion of the message buffer. This gives the
- * user a some initial data to work from.
- */
- if (quiet)
- return;
- bufp = kgdb_parse("msgbufp->msg_ptr");
- size = (int)kgdb_parse("msgbufp->msg_size");
- if (bufp == 0 || size == 0)
- return;
- rseq = (int)kgdb_parse("msgbufp->msg_rseq");
- wseq = (int)kgdb_parse("msgbufp->msg_wseq");
- rseq = MSGBUF_SEQ_TO_POS(size, rseq);
- wseq = MSGBUF_SEQ_TO_POS(size, wseq);
- if (rseq == wseq)
- return;
-
- printf("\nUnread portion of the kernel message buffer:\n");
- while (rseq < wseq) {
- read_memory(bufp + rseq, &c, 1);
- putchar(c);
- rseq++;
- if (rseq == size)
- rseq = 0;
- }
- if (c != '\n')
- putchar('\n');
- putchar('\n');
-}
-
-static void
-kgdb_init(char *argv0 __unused)
-{
-
- parse_gdberr = mem_fileopen();
- set_prompt("(kgdb) ");
- initialize_kgdb_target();
- initialize_kld_target();
- kgdb_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = kgdb_new_objfile;
-}
-
-/*
- * Remote targets can support any number of syntaxes and we want to
- * support them all with one addition: we support specifying a device
- * node for a serial device without the "/dev/" prefix.
- *
- * What we do is to stat(2) the existing remote target first. If that
- * fails, we try it with "/dev/" prepended. If that succeeds we use
- * the resulting path, otherwise we use the original target. If
- * either stat(2) succeeds make sure the file is either a character
- * device or a FIFO.
- */
-static void
-verify_remote(void)
-{
- char path[PATH_MAX];
- struct stat st;
-
- if (stat(remote, &st) != 0) {
- snprintf(path, sizeof(path), "/dev/%s", remote);
- if (stat(path, &st) != 0)
- return;
- free(remote);
- remote = strdup(path);
- }
- if (!S_ISCHR(st.st_mode) && !S_ISFIFO(st.st_mode))
- errx(1, "%s: not a special file, FIFO or socket", remote);
-}
-
-static void
-add_arg(struct captured_main_args *args, char *arg)
-{
-
- args->argc++;
- args->argv = reallocf(args->argv, (args->argc + 1) * sizeof(char *));
- if (args->argv == NULL)
- err(1, "Out of memory building argument list");
- args->argv[args->argc] = arg;
-}
-
-int
-main(int argc, char *argv[])
-{
- char path[PATH_MAX];
- struct stat st;
- struct captured_main_args args;
- char *s;
- int a, ch;
-
- dumpnr = -1;
-
- strlcpy(crashdir, "/var/crash", sizeof(crashdir));
- s = getenv("KGDB_CRASH_DIR");
- if (s != NULL)
- strlcpy(crashdir, s, sizeof(crashdir));
-
- /* Convert long options into short options. */
- for (a = 1; a < argc; a++) {
- s = argv[a];
- if (s[0] == '-') {
- s++;
- /* Long options take either 1 or 2 dashes. */
- if (s[0] == '-')
- s++;
- if (strcmp(s, "quiet") == 0)
- argv[a] = "-q";
- else if (strcmp(s, "fullname") == 0)
- argv[a] = "-f";
- }
- }
-
- quiet = 0;
- memset (&args, 0, sizeof args);
- args.use_windows = 0;
- args.interpreter_p = INTERP_CONSOLE;
- args.argv = malloc(sizeof(char *));
- args.argv[0] = argv[0];
-
- while ((ch = getopt(argc, argv, "ab:c:d:fn:qr:vw")) != -1) {
- switch (ch) {
- case 'a':
- annotation_level++;
- break;
- case 'b': {
- int i;
- char *p;
-
- i = strtol(optarg, &p, 0);
- if (*p != '\0' || p == optarg)
- warnx("warning: could not set baud rate to `%s'.\n",
- optarg);
- else
- baud_rate = i;
- break;
- }
- case 'c': /* use given core file. */
- if (vmcore != NULL) {
- warnx("option %c: can only be specified once",
- optopt);
- usage();
- /* NOTREACHED */
- }
- vmcore = strdup(optarg);
- break;
- case 'd': /* lookup dumps in given directory. */
- strlcpy(crashdir, optarg, sizeof(crashdir));
- break;
- case 'f':
- annotation_level = 1;
- break;
- case 'n': /* use dump with given number. */
- dumpnr = strtol(optarg, &s, 0);
- if (dumpnr < 0 || *s != '\0') {
- warnx("option %c: invalid kernel dump number",
- optopt);
- usage();
- /* NOTREACHED */
- }
- break;
- case 'q':
- quiet = 1;
- add_arg(&args, "-q");
- break;
- case 'r': /* use given device for remote session. */
- if (remote != NULL) {
- warnx("option %c: can only be specified once",
- optopt);
- usage();
- /* NOTREACHED */
- }
- remote = strdup(optarg);
- break;
- case 'v': /* increase verbosity. */
- verbose++;
- break;
- case 'w': /* core file is writeable. */
- add_arg(&args, "--write");
- break;
- case '?':
- default:
- usage();
- }
- }
-
- if (((vmcore != NULL) ? 1 : 0) + ((dumpnr >= 0) ? 1 : 0) +
- ((remote != NULL) ? 1 : 0) > 1) {
- warnx("options -c, -n and -r are mutually exclusive");
- usage();
- /* NOTREACHED */
- }
-
- if (verbose > 1)
- warnx("using %s as the crash directory", crashdir);
-
- if (argc > optind)
- kernel = strdup(argv[optind++]);
-
- if (argc > optind && (dumpnr >= 0 || remote != NULL)) {
- warnx("options -n and -r do not take a core file. Ignored");
- optind = argc;
- }
-
- if (dumpnr >= 0) {
- snprintf(path, sizeof(path), "%s/vmcore.%d", crashdir, dumpnr);
- if (stat(path, &st) == -1)
- err(1, "%s", path);
- if (!S_ISREG(st.st_mode))
- errx(1, "%s: not a regular file", path);
- vmcore = strdup(path);
- } else if (remote != NULL) {
- verify_remote();
- } else if (argc > optind) {
- if (vmcore == NULL)
- vmcore = strdup(argv[optind++]);
- if (argc > optind)
- warnx("multiple core files specified. Ignored");
- } else if (vmcore == NULL && kernel == NULL) {
- vmcore = strdup(_PATH_MEM);
- kernel = strdup(getbootfile());
- }
-
- if (verbose) {
- if (vmcore != NULL)
- warnx("core file: %s", vmcore);
- if (remote != NULL)
- warnx("device file: %s", remote);
- if (kernel != NULL)
- warnx("kernel image: %s", kernel);
- }
-
- /* A remote target requires an explicit kernel argument. */
- if (remote != NULL && kernel == NULL) {
- warnx("remote debugging requires a kernel");
- usage();
- /* NOTREACHED */
- }
-
- /* If we don't have a kernel image yet, try to find one. */
- if (kernel == NULL) {
- if (dumpnr >= 0)
- kernel_from_dumpnr(dumpnr);
-
- if (kernel == NULL)
- errx(1, "couldn't find a suitable kernel image");
- if (verbose)
- warnx("kernel image: %s", kernel);
- }
- add_arg(&args, kernel);
-
- if (vmcore != NULL)
- add_arg(&args, vmcore);
-
- /* The libgdb code uses optind too. Reset it... */
- optind = 0;
-
- /* Terminate argv list. */
- add_arg(&args, NULL);
-
- init_ui_hook = kgdb_init;
- frame_tdep_pc_fixup = kgdb_trgt_pc_fixup;
- kgdb_sniffer_kluge = kgdb_trgt_trapframe_sniffer;
-
- return (gdb_main(&args));
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt.c b/gnu/usr.bin/gdb/kgdb/trgt.c
deleted file mode 100644
index 56c64b8fe47b..000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <err.h>
-#include <fcntl.h>
-#include <kvm.h>
-
-#include <defs.h>
-#include <readline/readline.h>
-#include <command.h>
-#include <exec.h>
-#include <frame-unwind.h>
-#include <gdb.h>
-#include <gdbcore.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <language.h>
-#include <regcache.h>
-#include <solib.h>
-#include <target.h>
-#include <ui-out.h>
-
-#include "kgdb.h"
-
-#ifdef CROSS_DEBUGGER
-/*
- * We suppress the call to add_target() of core_ops in corelow.c because if
- * there are multiple core_stratum targets, the find_core_target() function
- * won't know which one to return and returns none. We need it to return
- * our target. We only have to do that when we're building a cross-debugger
- * because fbsd-threads.c is part of a native debugger and it too defines
- * coreops_suppress_target with 1 as the initializer.
- */
-int coreops_suppress_target = 1;
-#endif
-
-static CORE_ADDR stoppcbs;
-
-static void kgdb_core_cleanup(void *);
-
-static char *vmcore;
-static struct target_ops kgdb_trgt_ops;
-
-kvm_t *kvm;
-static char kvm_err[_POSIX2_LINE_MAX];
-
-#define KERNOFF (kgdb_kernbase ())
-#define PINKERNEL(x) ((x) >= KERNOFF)
-
-static int
-kgdb_resolve_symbol(const char *name, kvaddr_t *kva)
-{
- struct minimal_symbol *ms;
-
- ms = lookup_minimal_symbol (name, NULL, NULL);
- if (ms == NULL)
- return (1);
-
- *kva = SYMBOL_VALUE_ADDRESS (ms);
- return (0);
-}
-
-static CORE_ADDR
-kgdb_kernbase (void)
-{
- static CORE_ADDR kernbase;
- struct minimal_symbol *sym;
-
- if (kernbase == 0) {
- sym = lookup_minimal_symbol ("kernbase", NULL, NULL);
- if (sym == NULL) {
- kernbase = KERNBASE;
- } else {
- kernbase = SYMBOL_VALUE_ADDRESS (sym);
- }
- }
- return kernbase;
-}
-
-static void
-kgdb_trgt_open(char *filename, int from_tty)
-{
- struct cleanup *old_chain;
- struct thread_info *ti;
- struct kthr *kt;
- kvm_t *nkvm;
- char *temp;
- int ontop;
-
- target_preopen (from_tty);
- if (!filename)
- error ("No vmcore file specified.");
- if (!exec_bfd)
- error ("Can't open a vmcore without a kernel");
-
- filename = tilde_expand (filename);
- if (filename[0] != '/') {
- temp = concat (current_directory, "/", filename, NULL);
- xfree(filename);
- filename = temp;
- }
-
- old_chain = make_cleanup (xfree, filename);
-
- nkvm = kvm_open2(bfd_get_filename(exec_bfd), filename,
- write_files ? O_RDWR : O_RDONLY, kvm_err, kgdb_resolve_symbol);
- if (nkvm == NULL)
- error ("Failed to open vmcore: %s", kvm_err);
-
- /* Don't free the filename now and close any previous vmcore. */
- discard_cleanups(old_chain);
- unpush_target(&kgdb_trgt_ops);
-
- kvm = nkvm;
- vmcore = filename;
- old_chain = make_cleanup(kgdb_core_cleanup, NULL);
-
- ontop = !push_target (&kgdb_trgt_ops);
- discard_cleanups (old_chain);
-
- kgdb_dmesg();
-
- init_thread_list();
- kt = kgdb_thr_init();
- while (kt != NULL) {
- ti = add_thread(pid_to_ptid(kt->tid));
- kt = kgdb_thr_next(kt);
- }
- if (curkthr != 0)
- inferior_ptid = pid_to_ptid(curkthr->tid);
-
- if (ontop) {
- /* XXX: fetch registers? */
- kld_init();
- flush_cached_frames();
- select_frame (get_current_frame());
- print_stack_frame(get_selected_frame(),
- frame_relative_level(get_selected_frame()), 1);
- } else
- warning(
- "you won't be able to access this vmcore until you terminate\n\
-your %s; do ``info files''", target_longname);
-}
-
-static void
-kgdb_trgt_close(int quitting)
-{
-
- if (kvm != NULL) {
- inferior_ptid = null_ptid;
- CLEAR_SOLIB();
- if (kvm_close(kvm) != 0)
- warning("cannot close \"%s\": %s", vmcore,
- kvm_geterr(kvm));
- kvm = NULL;
- xfree(vmcore);
- vmcore = NULL;
- if (kgdb_trgt_ops.to_sections) {
- xfree(kgdb_trgt_ops.to_sections);
- kgdb_trgt_ops.to_sections = NULL;
- kgdb_trgt_ops.to_sections_end = NULL;
- }
- }
-}
-
-static void
-kgdb_core_cleanup(void *arg)
-{
-
- kgdb_trgt_close(0);
-}
-
-static void
-kgdb_trgt_detach(char *args, int from_tty)
-{
-
- if (args)
- error ("Too many arguments");
- unpush_target(&kgdb_trgt_ops);
- reinit_frame_cache();
- if (from_tty)
- printf_filtered("No vmcore file now.\n");
-}
-
-static char *
-kgdb_trgt_extra_thread_info(struct thread_info *ti)
-{
-
- return (kgdb_thr_extra_thread_info(ptid_get_pid(ti->ptid)));
-}
-
-static void
-kgdb_trgt_files_info(struct target_ops *target)
-{
-
- printf_filtered ("\t`%s', ", vmcore);
- wrap_here (" ");
- printf_filtered ("file type %s.\n", "FreeBSD kernel vmcore");
-}
-
-static void
-kgdb_trgt_find_new_threads(void)
-{
- struct target_ops *tb;
-
- if (kvm != NULL)
- return;
-
- tb = find_target_beneath(&kgdb_trgt_ops);
- if (tb->to_find_new_threads != NULL)
- tb->to_find_new_threads();
-}
-
-static char *
-kgdb_trgt_pid_to_str(ptid_t ptid)
-{
- static char buf[33];
-
- snprintf(buf, sizeof(buf), "Thread %d", ptid_get_pid(ptid));
- return (buf);
-}
-
-static int
-kgdb_trgt_thread_alive(ptid_t ptid)
-{
- return (kgdb_thr_lookup_tid(ptid_get_pid(ptid)) != NULL);
-}
-
-static int
-kgdb_trgt_xfer_memory(CORE_ADDR memaddr, char *myaddr, int len, int write,
- struct mem_attrib *attrib, struct target_ops *target)
-{
- struct target_ops *tb;
-
- if (kvm != NULL) {
- if (len == 0)
- return (0);
- if (!write)
- return (kvm_read2(kvm, memaddr, myaddr, len));
- else
- return (kvm_write(kvm, memaddr, myaddr, len));
- }
- tb = find_target_beneath(target);
- return (tb->to_xfer_memory(memaddr, myaddr, len, write, attrib, tb));
-}
-
-static int
-kgdb_trgt_ignore_breakpoints(CORE_ADDR addr, char *contents)
-{
-
- return 0;
-}
-
-static void
-kgdb_switch_to_thread(int tid)
-{
- char buf[16];
- int thread_id;
-
- thread_id = pid_to_thread_id(pid_to_ptid(tid));
- if (thread_id == 0)
- error ("invalid tid");
- snprintf(buf, sizeof(buf), "%d", thread_id);
- gdb_thread_select(uiout, buf);
-}
-
-static void
-kgdb_set_proc_cmd (char *arg, int from_tty)
-{
- CORE_ADDR addr;
- struct kthr *thr;
-
- if (!arg)
- error_no_arg ("proc address for the new context");
-
- if (kvm == NULL)
- error ("only supported for core file target");
-
- addr = (CORE_ADDR) parse_and_eval_address (arg);
-
- if (!PINKERNEL (addr)) {
- thr = kgdb_thr_lookup_pid((int)addr);
- if (thr == NULL)
- error ("invalid pid");
- } else {
- thr = kgdb_thr_lookup_paddr(addr);
- if (thr == NULL)
- error("invalid proc address");
- }
- kgdb_switch_to_thread(thr->tid);
-}
-
-static void
-kgdb_set_tid_cmd (char *arg, int from_tty)
-{
- CORE_ADDR addr;
- struct kthr *thr;
-
- if (!arg)
- error_no_arg ("TID or thread address for the new context");
-
- addr = (CORE_ADDR) parse_and_eval_address (arg);
-
- if (kvm != NULL && PINKERNEL (addr)) {
- thr = kgdb_thr_lookup_taddr(addr);
- if (thr == NULL)
- error("invalid thread address");
- addr = thr->tid;
- }
- kgdb_switch_to_thread(addr);
-}
-
-int fbsdcoreops_suppress_target = 1;
-
-void
-initialize_kgdb_target(void)
-{
-
- kgdb_trgt_ops.to_magic = OPS_MAGIC;
- kgdb_trgt_ops.to_shortname = "kernel";
- kgdb_trgt_ops.to_longname = "kernel core dump file";
- kgdb_trgt_ops.to_doc =
- "Use a vmcore file as a target. Specify the filename of the vmcore file.";
- kgdb_trgt_ops.to_stratum = core_stratum;
- kgdb_trgt_ops.to_has_memory = 1;
- kgdb_trgt_ops.to_has_registers = 1;
- kgdb_trgt_ops.to_has_stack = 1;
-
- kgdb_trgt_ops.to_open = kgdb_trgt_open;
- kgdb_trgt_ops.to_close = kgdb_trgt_close;
- kgdb_trgt_ops.to_attach = find_default_attach;
- kgdb_trgt_ops.to_detach = kgdb_trgt_detach;
- kgdb_trgt_ops.to_extra_thread_info = kgdb_trgt_extra_thread_info;
- kgdb_trgt_ops.to_fetch_registers = kgdb_trgt_fetch_registers;
- kgdb_trgt_ops.to_files_info = kgdb_trgt_files_info;
- kgdb_trgt_ops.to_find_new_threads = kgdb_trgt_find_new_threads;
- kgdb_trgt_ops.to_pid_to_str = kgdb_trgt_pid_to_str;
- kgdb_trgt_ops.to_store_registers = kgdb_trgt_store_registers;
- kgdb_trgt_ops.to_thread_alive = kgdb_trgt_thread_alive;
- kgdb_trgt_ops.to_xfer_memory = kgdb_trgt_xfer_memory;
- kgdb_trgt_ops.to_insert_breakpoint = kgdb_trgt_ignore_breakpoints;
- kgdb_trgt_ops.to_remove_breakpoint = kgdb_trgt_ignore_breakpoints;
-
- add_target(&kgdb_trgt_ops);
-
- add_com ("proc", class_obscure, kgdb_set_proc_cmd,
- "Set current process context");
- add_com ("tid", class_obscure, kgdb_set_tid_cmd,
- "Set current thread context");
-}
-
-CORE_ADDR
-kgdb_trgt_stop_pcb(u_int cpuid, u_int pcbsz)
-{
- static int once = 0;
-
- if (stoppcbs == 0 && !once) {
- once = 1;
- stoppcbs = kgdb_lookup("stoppcbs");
- }
- if (stoppcbs == 0)
- return 0;
-
- return (stoppcbs + pcbsz * cpuid);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_amd64.c b/gnu/usr.bin/gdb/kgdb/trgt_amd64.c
deleted file mode 100644
index ec0ac0180338..000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_amd64.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <amd64-tdep.h>
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
- struct kthr *kt;
- struct pcb pcb;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
-
- supply_register(AMD64_RBX_REGNUM, (char *)&pcb.pcb_rbx);
- supply_register(AMD64_RBP_REGNUM, (char *)&pcb.pcb_rbp);
- supply_register(AMD64_RSP_REGNUM, (char *)&pcb.pcb_rsp);
- supply_register(AMD64_R8_REGNUM + 4, (char *)&pcb.pcb_r12);
- supply_register(AMD64_R8_REGNUM + 5, (char *)&pcb.pcb_r13);
- supply_register(AMD64_R8_REGNUM + 6, (char *)&pcb.pcb_r14);
- supply_register(AMD64_R15_REGNUM, (char *)&pcb.pcb_r15);
- supply_register(AMD64_RIP_REGNUM, (char *)&pcb.pcb_rip);
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-struct kgdb_frame_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
-};
-
-static int kgdb_trgt_frame_offset[20] = {
- offsetof(struct trapframe, tf_rax),
- offsetof(struct trapframe, tf_rbx),
- offsetof(struct trapframe, tf_rcx),
- offsetof(struct trapframe, tf_rdx),
- offsetof(struct trapframe, tf_rsi),
- offsetof(struct trapframe, tf_rdi),
- offsetof(struct trapframe, tf_rbp),
- offsetof(struct trapframe, tf_rsp),
- offsetof(struct trapframe, tf_r8),
- offsetof(struct trapframe, tf_r9),
- offsetof(struct trapframe, tf_r10),
- offsetof(struct trapframe, tf_r11),
- offsetof(struct trapframe, tf_r12),
- offsetof(struct trapframe, tf_r13),
- offsetof(struct trapframe, tf_r14),
- offsetof(struct trapframe, tf_r15),
- offsetof(struct trapframe, tf_rip),
- offsetof(struct trapframe, tf_rflags),
- offsetof(struct trapframe, tf_cs),
- offsetof(struct trapframe, tf_ss)
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- ofs = (regnum >= AMD64_RAX_REGNUM && regnum <= AMD64_EFLAGS_REGNUM + 2)
- ? kgdb_trgt_frame_offset[regnum] : -1;
- if (ofs == -1)
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *addrp = cache->sp + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if (strcmp(pname, "calltrap") == 0 ||
- strcmp(pname, "fast_syscall_common") == 0 ||
- strcmp(pname, "mchk_calltrap") == 0 ||
- strcmp(pname, "nmi_calltrap") == 0 ||
- (pname[0] == 'X' && pname[1] != '_'))
- return (&kgdb_trgt_trapframe_unwind);
- /* printf("%s: %lx =%s\n", __func__, pc, pname); */
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_arm.c b/gnu/usr.bin/gdb/kgdb/trgt_arm.c
deleted file mode 100644
index 13111bc43469..000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_arm.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#ifndef CROSS_DEBUGGER
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <machine/armreg.h>
-#endif
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <arm-tdep.h>
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
-#ifndef CROSS_DEBUGGER
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-#else
- return -1;
-#endif
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
-#ifndef CROSS_DEBUGGER
- struct kthr *kt;
- struct pcb pcb;
- int i;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
- for (i = ARM_A1_REGNUM + 4; i <= ARM_SP_REGNUM; i++) {
- supply_register(i, (char *)&pcb.pcb_regs.sf_r4 +
- (i - (ARM_A1_REGNUM + 4 )) * 4);
- }
- supply_register(ARM_PC_REGNUM, (char *)&pcb.pcb_regs.sf_pc);
- supply_register(ARM_LR_REGNUM, (char *)&pcb.pcb_regs.sf_lr);
-#endif
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-#ifndef CROSS_DEBUGGER
-struct kgdb_frame_cache {
- CORE_ADDR fp;
- CORE_ADDR sp;
- CORE_ADDR pc;
-};
-
-static int kgdb_trgt_frame_offset[26] = {
- offsetof(struct trapframe, tf_r0),
- offsetof(struct trapframe, tf_r1),
- offsetof(struct trapframe, tf_r2),
- offsetof(struct trapframe, tf_r3),
- offsetof(struct trapframe, tf_r4),
- offsetof(struct trapframe, tf_r5),
- offsetof(struct trapframe, tf_r6),
- offsetof(struct trapframe, tf_r7),
- offsetof(struct trapframe, tf_r8),
- offsetof(struct trapframe, tf_r9),
- offsetof(struct trapframe, tf_r10),
- offsetof(struct trapframe, tf_r11),
- offsetof(struct trapframe, tf_r12),
- offsetof(struct trapframe, tf_svc_sp),
- offsetof(struct trapframe, tf_svc_lr),
- offsetof(struct trapframe, tf_pc),
- -1, -1, -1, -1, -1, -1, -1, -1, -1,
- offsetof(struct trapframe, tf_spsr)
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- frame_unwind_register(next_frame, ARM_SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, ARM_SP_REGNUM));
- frame_unwind_register(next_frame, ARM_FP_REGNUM, buf);
- cache->fp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, ARM_FP_REGNUM));
- cache->pc = frame_func_unwind(next_frame);
- }
- return (cache);
-}
-
-static int is_undef;
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
- CORE_ADDR sp;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- ofs = (regnum >= 0 && regnum <= ARM_PS_REGNUM)
- ? kgdb_trgt_frame_offset[regnum] : -1;
- if (ofs == -1)
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- sp = cache->sp;
-
- ofs = kgdb_trgt_frame_offset[regnum];
- *addrp = sp + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-#endif
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
-#ifndef CROSS_DEBUGGER
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL) {
- is_undef = 0;
- return (NULL);
- }
- if (!strcmp(pname, "undefinedinstruction"))
- is_undef = 1;
- if (strcmp(pname, "Laddress_exception_entry") == 0 ||
- strcmp(pname, "undefined_entry") == 0 ||
- strcmp(pname, "exception_exit") == 0 ||
- strcmp(pname, "Laddress_exception_msg") == 0 ||
- strcmp(pname, "irq_entry") == 0)
- return (&kgdb_trgt_trapframe_unwind);
- if (!strcmp(pname, "undefinedinstruction"))
- is_undef = 1;
- else
- is_undef = 0;
-#endif
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc)
-{
-#ifndef CROSS_DEBUGGER
- struct minimal_symbol *msymbol;
- int valpc;
-
- /*
- * exception_exit and swi_exit are special. These functions
- * are artificially injected into the stack to be executed
- * as the last entry in calling chain when all functions exit.
- * Treat them differently.
- */
- msymbol = lookup_minimal_symbol_by_pc(*pc);
- if (msymbol != NULL) {
- if (strcmp(DEPRECATED_SYMBOL_NAME(msymbol), "exception_exit") == 0)
- return (0);
- if (strcmp(DEPRECATED_SYMBOL_NAME(msymbol), "swi_exit") == 0)
- return (0);
- }
-
- /*
- * kdb_enter contains an invalid instruction which is supposed
- * to generate a trap. BFD does not understand it and treats
- * this part of function as a separate function. Move PC
- * two instruction earlier to be inside kdb_enter section.
- */
- target_read_memory(*pc - 4, (char*)&valpc, 4);
- if (valpc == 0xe7ffffff) {
- *pc = *pc - 8;
- return (0);
- }
-
- /*
- * When the panic/vpanic is the last (noreturn) function,
- * the bottom of the calling function looks as below.
- * mov lr, pc
- * b panic
- * Normally, GDB is not able to detect function boundaries,
- * so move the PC two instruction earlier where it can deal
- * with it.
- * Match this pair of instructions: mov lr, pc followed with
- * non-linked branch.
- */
- if ((valpc & 0xff000000) == 0xea000000) {
- target_read_memory(*pc - 8, (char*)&valpc, 4);
- if (valpc == 0xe1a0e00f) {
- *pc -= 8;
- return (0);
- }
- }
-#endif
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_i386.c b/gnu/usr.bin/gdb/kgdb/trgt_i386.c
deleted file mode 100644
index b90eebaaf35e..000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_i386.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <machine/segments.h>
-#include <machine/tss.h>
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <i386-tdep.h>
-
-#include "kgdb.h"
-
-static int ofs_fix;
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
- struct kthr *kt;
- struct pcb pcb;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
- supply_register(I386_EBX_REGNUM, (char *)&pcb.pcb_ebx);
- supply_register(I386_ESP_REGNUM, (char *)&pcb.pcb_esp);
- supply_register(I386_EBP_REGNUM, (char *)&pcb.pcb_ebp);
- supply_register(I386_ESI_REGNUM, (char *)&pcb.pcb_esi);
- supply_register(I386_EDI_REGNUM, (char *)&pcb.pcb_edi);
- supply_register(I386_EIP_REGNUM, (char *)&pcb.pcb_eip);
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-
- /*
- * In revision 1.117 of i386/i386/exception.S trap handlers
- * were changed to pass trapframes by reference rather than
- * by value. Detect this by seeing if the first instruction
- * at the 'calltrap' label is a "push %esp" which has the
- * opcode 0x54.
- */
- if (kgdb_parse("((char *)calltrap)[0]") == 0x54)
- ofs_fix = 4;
- else
- ofs_fix = 0;
-}
-
-struct kgdb_tss_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
- CORE_ADDR tss;
-};
-
-static int kgdb_trgt_tss_offset[15] = {
- offsetof(struct i386tss, tss_eax),
- offsetof(struct i386tss, tss_ecx),
- offsetof(struct i386tss, tss_edx),
- offsetof(struct i386tss, tss_ebx),
- offsetof(struct i386tss, tss_esp),
- offsetof(struct i386tss, tss_ebp),
- offsetof(struct i386tss, tss_esi),
- offsetof(struct i386tss, tss_edi),
- offsetof(struct i386tss, tss_eip),
- offsetof(struct i386tss, tss_eflags),
- offsetof(struct i386tss, tss_cs),
- offsetof(struct i386tss, tss_ss),
- offsetof(struct i386tss, tss_ds),
- offsetof(struct i386tss, tss_es),
- offsetof(struct i386tss, tss_fs)
-};
-
-/*
- * If the current thread is executing on a CPU, fetch the common_tss
- * for that CPU.
- *
- * This is painful because 'struct pcpu' is variant sized, so we can't
- * use it. Instead, we lookup the GDT selector for this CPU and
- * extract the base of the TSS from there.
- */
-static CORE_ADDR
-kgdb_trgt_fetch_tss(void)
-{
- struct kthr *kt;
- struct segment_descriptor sd;
- uintptr_t addr, cpu0prvpage, tss;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL || kt->cpu == NOCPU || kt->cpu < 0)
- return (0);
-
- addr = kgdb_lookup("gdt");
- if (addr == 0)
- return (0);
- addr += (kt->cpu * NGDT + GPROC0_SEL) * sizeof(sd);
- if (kvm_read(kvm, addr, &sd, sizeof(sd)) != sizeof(sd)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- return (0);
- }
- if (sd.sd_type != SDT_SYS386BSY) {
- warnx("descriptor is not a busy TSS");
- return (0);
- }
- tss = sd.sd_hibase << 24 | sd.sd_lobase;
-
- /*
- * In SMP kernels, the TSS is stored as part of the per-CPU
- * data. On older kernels, the CPU0's private page
- * is stored at an address that isn't mapped in minidumps.
- * However, the data is mapped at the alternate cpu0prvpage
- * address. Thus, if the TSS is at the invalid address,
- * change it to be relative to cpu0prvpage instead.
- */
- if (trunc_page(tss) == 0xffc00000) {
- addr = kgdb_lookup("cpu0prvpage");
- if (addr == 0)
- return (0);
- if (kvm_read(kvm, addr, &cpu0prvpage, sizeof(cpu0prvpage)) !=
- sizeof(cpu0prvpage)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- return (0);
- }
- tss = cpu0prvpage + (tss & PAGE_MASK);
- }
- return ((CORE_ADDR)tss);
-}
-
-static struct kgdb_tss_cache *
-kgdb_trgt_tss_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_tss_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_tss_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- cache->tss = kgdb_trgt_fetch_tss();
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_dblfault_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_tss_cache *cache;
-
- cache = kgdb_trgt_tss_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_dblfault_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_tss_cache *cache;
- int ofs, regsz;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- ofs = (regnum >= I386_EAX_REGNUM && regnum <= I386_FS_REGNUM)
- ? kgdb_trgt_tss_offset[regnum] : -1;
- if (ofs == -1)
- return;
-
- cache = kgdb_trgt_tss_cache(next_frame, this_cache);
- if (cache->tss == 0)
- return;
- *addrp = cache->tss + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_dblfault_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_dblfault_this_id,
- &kgdb_trgt_dblfault_prev_register
-};
-
-struct kgdb_frame_cache {
- int frame_type;
- CORE_ADDR pc;
- CORE_ADDR sp;
-};
-#define FT_NORMAL 1
-#define FT_INTRFRAME 2
-#define FT_INTRTRAPFRAME 3
-#define FT_TIMERFRAME 4
-
-static int kgdb_trgt_frame_offset[15] = {
- offsetof(struct trapframe, tf_eax),
- offsetof(struct trapframe, tf_ecx),
- offsetof(struct trapframe, tf_edx),
- offsetof(struct trapframe, tf_ebx),
- offsetof(struct trapframe, tf_esp),
- offsetof(struct trapframe, tf_ebp),
- offsetof(struct trapframe, tf_esi),
- offsetof(struct trapframe, tf_edi),
- offsetof(struct trapframe, tf_eip),
- offsetof(struct trapframe, tf_eflags),
- offsetof(struct trapframe, tf_cs),
- offsetof(struct trapframe, tf_ss),
- offsetof(struct trapframe, tf_ds),
- offsetof(struct trapframe, tf_es),
- offsetof(struct trapframe, tf_fs)
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- char *pname;
- CORE_ADDR pcx;
- uintptr_t addr, setidt_disp;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- pcx = frame_pc_unwind(next_frame);
- if (pcx >= PMAP_TRM_MIN_ADDRESS) {
- addr = kgdb_lookup("setidt_disp");
- if (addr != 0) {
- if (kvm_read(kvm, addr, &setidt_disp,
- sizeof(setidt_disp)) !=
- sizeof(setidt_disp))
- warnx("kvm_read: %s", kvm_geterr(kvm));
- else
- pcx -= setidt_disp;
- }
- }
- cache->pc = pcx;
- find_pc_partial_function(cache->pc, &pname, NULL, NULL);
- if (pname[0] != 'X')
- cache->frame_type = FT_NORMAL;
- else if (strcmp(pname, "Xtimerint") == 0)
- cache->frame_type = FT_TIMERFRAME;
- else if (strcmp(pname, "Xcpustop") == 0 ||
- strcmp(pname, "Xrendezvous") == 0 ||
- strcmp(pname, "Xipi_intr_bitmap_handler") == 0 ||
- strcmp(pname, "Xlazypmap") == 0)
- cache->frame_type = FT_INTRTRAPFRAME;
- else
- cache->frame_type = FT_INTRFRAME;
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- ofs = (regnum >= I386_EAX_REGNUM && regnum <= I386_FS_REGNUM)
- ? kgdb_trgt_frame_offset[regnum] + ofs_fix : -1;
- if (ofs == -1)
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- switch (cache->frame_type) {
- case FT_NORMAL:
- break;
- case FT_INTRFRAME:
- ofs += 4;
- break;
- case FT_TIMERFRAME:
- break;
- case FT_INTRTRAPFRAME:
- ofs -= ofs_fix;
- break;
- default:
- fprintf_unfiltered(gdb_stderr, "Correct FT_XXX frame offsets "
- "for %d\n", cache->frame_type);
- break;
- }
- *addrp = cache->sp + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- if (pc >= PMAP_TRM_MIN_ADDRESS)
- return (&kgdb_trgt_trapframe_unwind);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if (strcmp(pname, "dblfault_handler") == 0)
- return (&kgdb_trgt_dblfault_unwind);
- if (strcmp(pname, "calltrap") == 0 ||
- (pname[0] == 'X' && pname[1] != '_'))
- return (&kgdb_trgt_trapframe_unwind);
- /* printf("%s: %llx =%s\n", __func__, pc, pname); */
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_mips.c b/gnu/usr.bin/gdb/kgdb/trgt_mips.c
deleted file mode 100644
index 17ea6fe4ca1a..000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_mips.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 2007 Juniper Networks, Inc.
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * from: src/gnu/usr.bin/gdb/kgdb/trgt_alpha.c,v 1.2.2.1 2005/09/15 05:32:10 marcel
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/asm.h>
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <mips-tdep.h>
-
-#ifndef CROSS_DEBUGGER
-#include <machine/pcb.h>
-#endif
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
-#ifndef CROSS_DEBUGGER
- struct kthr *kt;
- struct pcb pcb;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
-
- supply_register(MIPS_S0_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S0]);
- supply_register(MIPS_S1_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S1]);
- supply_register(MIPS_S2_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S2]);
- supply_register(MIPS_S3_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S3]);
- supply_register(MIPS_S4_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S4]);
- supply_register(MIPS_S5_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S5]);
- supply_register(MIPS_S6_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S6]);
- supply_register(MIPS_S7_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S7]);
- supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_SP]);
- supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_GP]);
- supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[PCB_REG_RA]);
- supply_register(MIPS_EMBED_PC_REGNUM, (char *)&pcb.pcb_context[PCB_REG_PC]);
-#endif
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
-
- fprintf_unfiltered(gdb_stderr, "Unimplemented function: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-#ifndef CROSS_DEBUGGER
-struct kgdb_frame_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
-};
-
-static int kgdb_trgt_frame_offset[] = {
- offsetof(struct trapframe, zero),
- offsetof(struct trapframe, ast),
- offsetof(struct trapframe, v0),
- offsetof(struct trapframe, v1),
- offsetof(struct trapframe, a0),
- offsetof(struct trapframe, a1),
- offsetof(struct trapframe, a2),
- offsetof(struct trapframe, a3),
-#if defined(__mips_n32) || defined(__mips_n64)
- offsetof(struct trapframe, a4),
- offsetof(struct trapframe, a5),
- offsetof(struct trapframe, a6),
- offsetof(struct trapframe, a7),
- offsetof(struct trapframe, t0),
- offsetof(struct trapframe, t1),
- offsetof(struct trapframe, t2),
- offsetof(struct trapframe, t3),
-#else
- offsetof(struct trapframe, t0),
- offsetof(struct trapframe, t1),
- offsetof(struct trapframe, t2),
- offsetof(struct trapframe, t3),
- offsetof(struct trapframe, t4),
- offsetof(struct trapframe, t5),
- offsetof(struct trapframe, t6),
- offsetof(struct trapframe, t7),
-#endif
- offsetof(struct trapframe, s0),
- offsetof(struct trapframe, s1),
- offsetof(struct trapframe, s2),
- offsetof(struct trapframe, s3),
- offsetof(struct trapframe, s4),
- offsetof(struct trapframe, s5),
- offsetof(struct trapframe, s6),
- offsetof(struct trapframe, s7),
- offsetof(struct trapframe, t8),
- offsetof(struct trapframe, t9),
- offsetof(struct trapframe, k0),
- offsetof(struct trapframe, k1),
- offsetof(struct trapframe, gp),
- offsetof(struct trapframe, sp),
- offsetof(struct trapframe, s8),
- offsetof(struct trapframe, ra),
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame __unused,
- void **this_cache __unused, int regnum __unused, int *optimizedp __unused,
- enum lval_type *lvalp __unused, CORE_ADDR *addrp __unused,
- int *realnump __unused, void *valuep __unused)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- ofs = (regnum >= 0 && regnum <= MIPS_RA_REGNUM) ?
- kgdb_trgt_frame_offset[regnum] : -1;
- if (ofs == -1)
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *addrp = cache->sp + ofs * 8;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-#endif
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
-#ifndef CROSS_DEBUGGER
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if ((strcmp(pname, "MipsKernIntr") == 0) ||
- (strcmp(pname, "MipsKernGenException") == 0) ||
- (strcmp(pname, "MipsUserIntr") == 0) ||
- (strcmp(pname, "MipsUserGenException") == 0))
- return (&kgdb_trgt_trapframe_unwind);
-#endif
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c b/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c
deleted file mode 100644
index 703cc0f716f9..000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*-
- * Copyright (c) 2006 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#ifdef CROSS_DEBUGGER
-#include <sys/powerpc/include/pcb.h>
-#include <sys/powerpc/include/frame.h>
-#else
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#endif
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <ppc-tdep.h>
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
- struct kthr *kt;
- struct pcb pcb;
- struct gdbarch_tdep *tdep;
- int i;
-
- tdep = gdbarch_tdep (current_gdbarch);
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
-
- /*
- * r14-r31 are saved in the pcb
- */
- for (i = 14; i <= 31; i++) {
- supply_register(tdep->ppc_gp0_regnum + i,
- (char *)&pcb.pcb_context[i]);
- }
-
- /* r1 is saved in the sp field */
- supply_register(tdep->ppc_gp0_regnum + 1, (char *)&pcb.pcb_sp);
-
- supply_register(tdep->ppc_lr_regnum, (char *)&pcb.pcb_lr);
- supply_register(tdep->ppc_cr_regnum, (char *)&pcb.pcb_cr);
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-struct kgdb_frame_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct gdbarch_tdep *tdep;
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- tdep = gdbarch_tdep(current_gdbarch);
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- if (regnum >= tdep->ppc_gp0_regnum &&
- regnum <= tdep->ppc_gplast_regnum)
- ofs = offsetof(struct trapframe,
- fixreg[regnum - tdep->ppc_gp0_regnum]);
- else if (regnum == tdep->ppc_lr_regnum)
- ofs = offsetof(struct trapframe, lr);
- else if (regnum == tdep->ppc_cr_regnum)
- ofs = offsetof(struct trapframe, cr);
- else if (regnum == tdep->ppc_xer_regnum)
- ofs = offsetof(struct trapframe, xer);
- else if (regnum == tdep->ppc_ctr_regnum)
- ofs = offsetof(struct trapframe, ctr);
- else if (regnum == PC_REGNUM)
- ofs = offsetof(struct trapframe, srr0);
- else
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *addrp = cache->sp + 8 + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if (strcmp(pname, "asttrapexit") == 0 ||
- strcmp(pname, "trapexit") == 0)
- return (&kgdb_trgt_trapframe_unwind);
- /* printf("%s: %llx =%s\n", __func__, pc, pname); */
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c b/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c
deleted file mode 100644
index bfb0d7eed875..000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*-
- * Copyright (c) 2006 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <ppc-tdep.h>
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
- struct kthr *kt;
- struct pcb pcb;
- struct gdbarch_tdep *tdep;
- int i;
-
- tdep = gdbarch_tdep (current_gdbarch);
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
-
- /*
- * r14-r31 are saved in the pcb
- */
- for (i = 14; i <= 31; i++) {
- supply_register(tdep->ppc_gp0_regnum + i,
- (char *)&pcb.pcb_context[i]);
- }
-
- /* r1 is saved in the sp field */
- supply_register(tdep->ppc_gp0_regnum + 1, (char *)&pcb.pcb_sp);
- /* r2 is saved in the toc field */
- supply_register(tdep->ppc_gp0_regnum + 2, (char *)&pcb.pcb_toc);
-
- supply_register(tdep->ppc_lr_regnum, (char *)&pcb.pcb_lr);
- supply_register(tdep->ppc_cr_regnum, (char *)&pcb.pcb_cr);
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-struct kgdb_frame_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct gdbarch_tdep *tdep;
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- tdep = gdbarch_tdep(current_gdbarch);
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- if (regnum >= tdep->ppc_gp0_regnum &&
- regnum <= tdep->ppc_gplast_regnum)
- ofs = offsetof(struct trapframe,
- fixreg[regnum - tdep->ppc_gp0_regnum]);
- else if (regnum == tdep->ppc_lr_regnum)
- ofs = offsetof(struct trapframe, lr);
- else if (regnum == tdep->ppc_cr_regnum)
- ofs = offsetof(struct trapframe, cr);
- else if (regnum == tdep->ppc_xer_regnum)
- ofs = offsetof(struct trapframe, xer);
- else if (regnum == tdep->ppc_ctr_regnum)
- ofs = offsetof(struct trapframe, ctr);
- else if (regnum == PC_REGNUM)
- ofs = offsetof(struct trapframe, srr0);
- else
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *addrp = cache->sp + 48 + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if (strcmp(pname, "asttrapexit") == 0 ||
- strcmp(pname, "trapexit") == 0)
- return (&kgdb_trgt_trapframe_unwind);
- /* printf("%s: %llx =%s\n", __func__, pc, pname); */
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c b/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c
deleted file mode 100644
index b39299f40918..000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/asm.h>
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <sparc-tdep.h>
-#include <sparc64-tdep.h>
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
- struct kthr *kt;
- struct pcb pcb;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
-
- supply_register(SPARC_SP_REGNUM, (char *)&pcb.pcb_sp);
- sparc_supply_rwindow(current_regcache, pcb.pcb_sp, -1);
- supply_register(SPARC64_PC_REGNUM, (char *)&pcb.pcb_pc);
- pcb.pcb_pc += 4;
- supply_register(SPARC64_NPC_REGNUM, (char *)&pcb.pcb_pc);
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-struct kgdb_frame_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
- CORE_ADDR fp;
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SPARC_SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SPARC_SP_REGNUM));
- frame_unwind_register(next_frame, SPARC_FP_REGNUM, buf);
- cache->fp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SPARC_FP_REGNUM));
- cache->fp += BIAS - sizeof(struct trapframe);
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
-
- switch (regnum) {
- case SPARC_SP_REGNUM:
- ofs = offsetof(struct trapframe, tf_sp);
- break;
- case SPARC64_PC_REGNUM:
- ofs = offsetof(struct trapframe, tf_tpc);
- break;
- case SPARC64_NPC_REGNUM:
- ofs = offsetof(struct trapframe, tf_tnpc);
- break;
- case SPARC_O0_REGNUM:
- case SPARC_O1_REGNUM:
- case SPARC_O2_REGNUM:
- case SPARC_O3_REGNUM:
- case SPARC_O4_REGNUM:
- case SPARC_O5_REGNUM:
- case SPARC_O7_REGNUM:
- ofs = offsetof(struct trapframe, tf_out) +
- (regnum - SPARC_O0_REGNUM) * 8;
- break;
- default:
- if (regnum >= SPARC_L0_REGNUM && regnum <= SPARC_I7_REGNUM) {
- ofs = (regnum - SPARC_L0_REGNUM) * 8;
- *addrp = cache->sp + BIAS + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
- }
- return;
- }
-
- *addrp = cache->fp + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_func_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if (strcmp(pname, "tl0_intr") == 0 ||
- strcmp(pname, "tl0_trap") == 0 ||
- strcmp(pname, "tl1_intr") == 0 ||
- strcmp(pname, "tl1_trap") == 0)
- return (&kgdb_trgt_trapframe_unwind);
- /* printf("%s: %lx =%s\n", __func__, pc, pname); */
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/libgdb/Makefile b/gnu/usr.bin/gdb/libgdb/Makefile
deleted file mode 100644
index 8c27c58907ed..000000000000
--- a/gnu/usr.bin/gdb/libgdb/Makefile
+++ /dev/null
@@ -1,80 +0,0 @@
-# $FreeBSD$
-
-# These assignments duplicate much of the functionality of
-# MACHINE_CPUARCH, but there's no easy way to export make functions...
-
-.if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}}
-.else
-TARGET_CPUARCH=${MACHINE_CPUARCH}
-.endif
-TARGET_ARCH?= ${MACHINE_ARCH}
-
-LIB= gdb
-INTERNALLIB=
-SRCS= annotate.c arch-utils.c auxv.c ax-gdb.c ax-general.c \
- bcache.c bfd-target.c block.c blockframe.c breakpoint.c \
- buildsym.c \
- c-exp.y c-lang.c c-typeprint.c c-valprint.c charset.c \
- cli-cmds.c cli-decode.c cli-dump.c cli-interp.c cli-logging.c \
- cli-out.c cli-script.c cli-setshow.c cli-utils.c coff-pe-read.c \
- coffread.c complaints.c completer.c copying.c corefile.c \
- corelow.c cp-abi.c cp-namespace.c cp-support.c cp-valprint.c \
- dbxread.c dcache.c demangle.c dictionary.c disasm.c doublest.c \
- dummy-frame.c dwarf2-frame.c dwarf2expr.c dwarf2loc.c \
- dwarf2read.c dwarfread.c \
- elfread.c environ.c eval.c event-loop.c event-top.c exec.c \
- expprint.c \
- f-exp.y f-lang.c f-typeprint.c f-valprint.c findvar.c \
- ${_fork_child} frame-base.c frame-unwind.c frame.c \
- gdb-events.c gdbarch.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \
- hpacc-abi.c \
- inf-loop.c infcall.c infcmd.c inflow.c ${_infptrace} infrun.c \
- ${_inftarg} init.c interps.c \
- jv-exp.y jv-lang.c jv-typeprint.c jv-valprint.c \
- kod-cisco.c kod.c \
- language.c linespec.c \
- m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c macrocmd.c \
- macroexp.c macroscope.c macrotab.c main.c maint.c mdebugread.c \
- mem-break.c memattr.c mi-cmd-break.c mi-cmd-disas.c \
- mi-cmd-env.c mi-cmd-file.c mi-cmd-stack.c mi-cmd-var.c \
- mi-cmds.c mi-console.c mi-getopt.c mi-interp.c mi-main.c \
- mi-out.c mi-parse.c mi-symbol-cmds.c minsyms.c mipsread.c \
- nlmread.c \
- objc-exp.y objc-lang.c objfiles.c observer.c osabi.c \
- p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c printcmd.c \
- regcache.c reggroups.c remote-fileio.c remote-utils.c remote.c \
- scm-exp.c scm-lang.c scm-valprint.c sentinel-frame.c ser-pipe.c \
- ser-tcp.c ser-unix.c serial.c signals.c source.c stabsread.c \
- stack.c std-regs.c symfile.c symmisc.c symtab.c \
- target.c thread.c top.c tracepoint.c trad-frame.c tui-command.c \
- tui-data.c tui-disasm.c tui-file.c tui-hooks.c tui-interp.c \
- tui-io.c tui-layout.c tui-out.c tui-regs.c tui-source.c \
- tui-stack.c tui-win.c tui-windata.c tui-wingeneral.c \
- tui-winsource.c tui.c typeprint.c \
- ui-file.c ui-out.c user-regs.c utils.c \
- valarith.c valops.c valprint.c values.c varobj.c \
- wrapper.c ${LIBSRCS}
-
-.for stupid_gnu in \
-xregcomp xre_exec xregexec xre_search xre_compile_fastmap xregerror xre_comp xre_set_syntax
-CFLAGS+= -D${stupid_gnu}=${stupid_gnu:S/^x//}
-.endfor
-
-.if ${TARGET_ARCH} == ${MACHINE_ARCH}
-_fork_child= fork-child.c
-_infptrace= infptrace.c
-_inftarg= inftarg.c
-.endif
-
-GENSRCS= version.c
-
-version.c:
- echo '#include "version.h"' > ${.TARGET}
- echo 'const char version[] = ${VERSION};' >> ${.TARGET}
- echo 'const char host_name[] = "${MACHINE_ARCH}-${VENDOR}-freebsd";' \
- >> ${.TARGET}
- echo 'const char target_name[] = "${TARGET_ARCH}-${VENDOR}-freebsd";' \
- >> ${.TARGET}
-
-.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/gdb/libgdb/Makefile.depend b/gnu/usr.bin/gdb/libgdb/Makefile.depend
deleted file mode 100644
index 80f12f7059aa..000000000000
--- a/gnu/usr.bin/gdb/libgdb/Makefile.depend
+++ /dev/null
@@ -1,19 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/libreadline/readline \
- include \
- include/arpa \
- include/xlocale \
- lib/libthread_db \
- lib/msun \
- lib/ncurses/ncursesw \
- usr.bin/yacc.host \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c b/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
deleted file mode 100644
index 78819a743e51..000000000000
--- a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
+++ /dev/null
@@ -1,1799 +0,0 @@
-/* $FreeBSD$ */
-/* FreeBSD libthread_db assisted debugging support.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <dlfcn.h>
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <signal.h>
-
-#include "proc_service.h"
-#include "thread_db.h"
-
-#include "defs.h"
-#include "bfd.h"
-#include "elf-bfd.h"
-#include "gdb_assert.h"
-#include "gdbcore.h"
-#include "gdbthread.h"
-#include "inferior.h"
-#include "objfiles.h"
-#include "regcache.h"
-#include "symfile.h"
-#include "symtab.h"
-#include "target.h"
-#include "gdbcmd.h"
-#include "solib-svr4.h"
-
-#include "gregset.h"
-#ifdef PT_GETXMMREGS
-#include "i387-tdep.h"
-#endif
-
-#define LIBTHREAD_DB_SO "libthread_db.so"
-
-struct ps_prochandle
-{
- pid_t pid;
-};
-
-extern int child_suppress_run;
-
-extern struct target_ops child_ops;
-
-/* This module's target vectors. */
-static struct target_ops fbsd_thread_ops;
-static struct target_ops fbsd_core_ops;
-
-/* Saved copy of orignal core_ops. */
-static struct target_ops orig_core_ops;
-extern struct target_ops core_ops;
-
-/* Pointer to the next function on the objfile event chain. */
-static void (*target_new_objfile_chain) (struct objfile *objfile);
-
-/* Non-zero if there is a thread module */
-static int fbsd_thread_present;
-
-/* Non-zero if we're using this module's target vector. */
-static int fbsd_thread_active;
-
-/* Non-zero if core_open is called */
-static int fbsd_thread_core = 0;
-
-/* Non-zero if we have to keep this module's target vector active
- across re-runs. */
-static int keep_thread_db;
-
-/* Structure that identifies the child process for the
- <proc_service.h> interface. */
-static struct ps_prochandle proc_handle;
-
-/* Connection to the libthread_db library. */
-static td_thragent_t *thread_agent;
-
-/* The last thread we are single stepping */
-static ptid_t last_single_step_thread;
-
-/* Pointers to the libthread_db functions. */
-
-static td_err_e (*td_init_p) (void);
-
-static td_err_e (*td_ta_new_p) (struct ps_prochandle *ps, td_thragent_t **ta);
-static td_err_e (*td_ta_delete_p) (td_thragent_t *);
-static td_err_e (*td_ta_map_id2thr_p) (const td_thragent_t *ta, thread_t pt,
- td_thrhandle_t *__th);
-static td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta, lwpid_t lwpid,
- td_thrhandle_t *th);
-static td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta,
- td_thr_iter_f *callback,
- void *cbdata_p, td_thr_state_e state,
- int ti_pri, sigset_t *ti_sigmask_p,
- unsigned int ti_user_flags);
-static td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta,
- td_event_e event, td_notify_t *ptr);
-static td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta,
- td_thr_events_t *event);
-static td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta,
- td_event_msg_t *msg);
-static td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th,
- td_thrinfo_t *infop);
-#ifdef PT_GETXMMREGS
-static td_err_e (*td_thr_getxmmregs_p) (const td_thrhandle_t *th,
- char *regset);
-#endif
-static td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th,
- prfpregset_t *regset);
-static td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th,
- prgregset_t gregs);
-#ifdef PT_GETXMMREGS
-static td_err_e (*td_thr_setxmmregs_p) (const td_thrhandle_t *th,
- const char *fpregs);
-#endif
-static td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th,
- const prfpregset_t *fpregs);
-static td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th,
- prgregset_t gregs);
-static td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, int event);
-
-static td_err_e (*td_thr_sstep_p) (td_thrhandle_t *th, int step);
-
-static td_err_e (*td_ta_tsd_iter_p) (const td_thragent_t *ta,
- td_key_iter_f *func, void *data);
-static td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th,
- void *map_address,
- size_t offset, void **address);
-static td_err_e (*td_thr_dbsuspend_p) (const td_thrhandle_t *);
-static td_err_e (*td_thr_dbresume_p) (const td_thrhandle_t *);
-
-static CORE_ADDR td_create_bp_addr;
-
-/* Location of the thread death event breakpoint. */
-static CORE_ADDR td_death_bp_addr;
-
-/* Prototypes for local functions. */
-static void fbsd_thread_find_new_threads (void);
-static int fbsd_thread_alive (ptid_t ptid);
-static void attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
- const td_thrinfo_t *ti_p, int verbose);
-static void fbsd_thread_detach (char *args, int from_tty);
-
-/* Building process ids. */
-
-#define GET_PID(ptid) ptid_get_pid (ptid)
-#define GET_LWP(ptid) ptid_get_lwp (ptid)
-#define GET_THREAD(ptid) ptid_get_tid (ptid)
-
-#define IS_LWP(ptid) (GET_LWP (ptid) != 0)
-#define IS_THREAD(ptid) (GET_THREAD (ptid) != 0)
-
-#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0)
-#define BUILD_THREAD(tid, pid) ptid_build (pid, 0, tid)
-
-static char *
-thread_db_err_str (td_err_e err)
-{
- static char buf[64];
-
- switch (err)
- {
- case TD_OK:
- return "generic 'call succeeded'";
- case TD_ERR:
- return "generic error";
- case TD_NOTHR:
- return "no thread to satisfy query";
- case TD_NOSV:
- return "no sync handle to satisfy query";
- case TD_NOLWP:
- return "no LWP to satisfy query";
- case TD_BADPH:
- return "invalid process handle";
- case TD_BADTH:
- return "invalid thread handle";
- case TD_BADSH:
- return "invalid synchronization handle";
- case TD_BADTA:
- return "invalid thread agent";
- case TD_BADKEY:
- return "invalid key";
- case TD_NOMSG:
- return "no event message for getmsg";
- case TD_NOFPREGS:
- return "FPU register set not available";
- case TD_NOLIBTHREAD:
- return "application not linked with libthread";
- case TD_NOEVENT:
- return "requested event is not supported";
- case TD_NOCAPAB:
- return "capability not available";
- case TD_DBERR:
- return "debugger service failed";
- case TD_NOAPLIC:
- return "operation not applicable to";
- case TD_NOTSD:
- return "no thread-specific data for this thread";
- case TD_MALLOC:
- return "malloc failed";
- case TD_PARTIALREG:
- return "only part of register set was written/read";
- case TD_NOXREGS:
- return "X register set not available for this thread";
- default:
- snprintf (buf, sizeof (buf), "unknown thread_db error '%d'", err);
- return buf;
- }
-}
-
-static char *
-thread_db_state_str (td_thr_state_e state)
-{
- static char buf[64];
-
- switch (state)
- {
- case TD_THR_STOPPED:
- return "stopped by debugger";
- case TD_THR_RUN:
- return "runnable";
- case TD_THR_ACTIVE:
- return "active";
- case TD_THR_ZOMBIE:
- return "zombie";
- case TD_THR_SLEEP:
- return "sleeping";
- case TD_THR_STOPPED_ASLEEP:
- return "stopped by debugger AND blocked";
- default:
- snprintf (buf, sizeof (buf), "unknown thread_db state %d", state);
- return buf;
- }
-}
-
-/* Convert LWP to user-level thread id. */
-static ptid_t
-thread_from_lwp (ptid_t ptid, td_thrhandle_t *th, td_thrinfo_t *ti)
-{
- td_err_e err;
-
- gdb_assert (IS_LWP (ptid));
-
- if (fbsd_thread_active)
- {
- err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), th);
- if (err == TD_OK)
- {
- err = td_thr_get_info_p (th, ti);
- if (err != TD_OK)
- error ("Cannot get thread info: %s", thread_db_err_str (err));
- return BUILD_THREAD (ti->ti_tid, GET_PID (ptid));
- }
- }
-
- /* the LWP is not mapped to user thread */
- return BUILD_LWP (GET_LWP (ptid), GET_PID (ptid));
-}
-
-static void
-fbsd_core_get_first_lwp (bfd *abfd, asection *asect, void *obj)
-{
- if (strncmp (bfd_section_name (abfd, asect), ".reg/", 5) != 0)
- return;
-
- if (*(lwpid_t *)obj != 0)
- return;
-
- *(lwpid_t *)obj = atoi (bfd_section_name (abfd, asect) + 5);
-}
-
-static long
-get_current_lwp (int pid)
-{
- struct ptrace_lwpinfo pl;
- lwpid_t lwpid;
-
- if (!target_has_execution)
- {
- lwpid = 0;
- bfd_map_over_sections (core_bfd, fbsd_core_get_first_lwp, &lwpid);
- return lwpid;
- }
- if (ptrace (PT_LWPINFO, pid, (caddr_t)&pl, sizeof(pl)))
- perror_with_name("PT_LWPINFO");
-
- return (long)pl.pl_lwpid;
-}
-
-static void
-get_current_thread ()
-{
- td_thrhandle_t th;
- td_thrinfo_t ti;
- long lwp;
- ptid_t tmp, ptid;
-
- lwp = get_current_lwp (proc_handle.pid);
- tmp = BUILD_LWP (lwp, proc_handle.pid);
- ptid = thread_from_lwp (tmp, &th, &ti);
- if (!in_thread_list (ptid))
- {
- attach_thread (ptid, &th, &ti, 1);
- }
- inferior_ptid = ptid;
-}
-
-static td_err_e
-enable_thread_event (td_thragent_t *thread_agent, int event, CORE_ADDR *bp)
-{
- td_notify_t notify;
- td_err_e err;
-
- /* Get the breakpoint address for thread EVENT. */
- err = td_ta_event_addr_p (thread_agent, event, &notify);
- if (err != TD_OK)
- return err;
-
- /* Set up the breakpoint. */
- (*bp) = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
- extract_typed_address(&notify.u.bptaddr, builtin_type_void_func_ptr),
- &current_target);
- create_thread_event_breakpoint ((*bp));
-
- return TD_OK;
-}
-
-static void
-enable_thread_event_reporting (void)
-{
- td_thr_events_t events;
- td_notify_t notify;
- td_err_e err;
-
- /* We cannot use the thread event reporting facility if these
- functions aren't available. */
- if (td_ta_event_addr_p == NULL || td_ta_set_event_p == NULL
- || td_ta_event_getmsg_p == NULL || td_thr_event_enable_p == NULL)
- return;
-
- /* Set the process wide mask saying which events we're interested in. */
- td_event_emptyset (&events);
- td_event_addset (&events, TD_CREATE);
- td_event_addset (&events, TD_DEATH);
-
- err = td_ta_set_event_p (thread_agent, &events);
- if (err != TD_OK)
- {
- warning ("Unable to set global thread event mask: %s",
- thread_db_err_str (err));
- return;
- }
-
- /* Delete previous thread event breakpoints, if any. */
- remove_thread_event_breakpoints ();
- td_create_bp_addr = 0;
- td_death_bp_addr = 0;
-
- /* Set up the thread creation event. */
- err = enable_thread_event (thread_agent, TD_CREATE, &td_create_bp_addr);
- if (err != TD_OK)
- {
- warning ("Unable to get location for thread creation breakpoint: %s",
- thread_db_err_str (err));
- return;
- }
-
- /* Set up the thread death event. */
- err = enable_thread_event (thread_agent, TD_DEATH, &td_death_bp_addr);
- if (err != TD_OK)
- {
- warning ("Unable to get location for thread death breakpoint: %s",
- thread_db_err_str (err));
- return;
- }
-}
-
-static void
-disable_thread_event_reporting (void)
-{
- td_thr_events_t events;
-
- /* Set the process wide mask saying we aren't interested in any
- events anymore. */
- td_event_emptyset (&events);
- td_ta_set_event_p (thread_agent, &events);
-
- /* Delete thread event breakpoints, if any. */
- remove_thread_event_breakpoints ();
- td_create_bp_addr = 0;
- td_death_bp_addr = 0;
-}
-
-static void
-fbsd_thread_activate (void)
-{
- fbsd_thread_active = 1;
- init_thread_list();
- if (fbsd_thread_core == 0)
- enable_thread_event_reporting ();
- fbsd_thread_find_new_threads ();
- get_current_thread ();
-}
-
-static void
-fbsd_thread_deactivate (void)
-{
- if (fbsd_thread_core == 0)
- disable_thread_event_reporting();
- td_ta_delete_p (thread_agent);
-
- inferior_ptid = pid_to_ptid (proc_handle.pid);
- proc_handle.pid = 0;
- fbsd_thread_active = 0;
- fbsd_thread_present = 0;
- init_thread_list ();
-}
-
-static char *
-fbsd_thread_get_name (lwpid_t lwpid)
-{
- static char last_thr_name[MAXCOMLEN + 1];
- char section_name[32];
- struct ptrace_lwpinfo lwpinfo;
- bfd_size_type size;
- struct bfd_section *section;
-
- if (target_has_execution)
- {
- if (ptrace (PT_LWPINFO, lwpid, (caddr_t)&lwpinfo, sizeof (lwpinfo)) == -1)
- goto fail;
- strncpy (last_thr_name, lwpinfo.pl_tdname, sizeof (last_thr_name) - 1);
- }
- else
- {
- snprintf (section_name, sizeof (section_name), ".tname/%u", lwpid);
- section = bfd_get_section_by_name (core_bfd, section_name);
- if (! section)
- goto fail;
-
- /* Section size fix-up. */
- size = bfd_section_size (core_bfd, section);
- if (size > sizeof (last_thr_name))
- size = sizeof (last_thr_name);
-
- if (! bfd_get_section_contents (core_bfd, section, last_thr_name,
- (file_ptr)0, size))
- goto fail;
- if (last_thr_name[0] == '\0')
- goto fail;
- }
- last_thr_name[sizeof (last_thr_name) - 1] = '\0';
- return last_thr_name;
-fail:
- strcpy (last_thr_name, "<unknown>");
- return last_thr_name;
-}
-
-static void
-fbsd_thread_new_objfile (struct objfile *objfile)
-{
- td_err_e err;
-
- if (objfile == NULL)
- {
- /* All symbols have been discarded. If the thread_db target is
- active, deactivate it now. */
- if (fbsd_thread_active)
- {
- gdb_assert (proc_handle.pid == 0);
- fbsd_thread_active = 0;
- }
-
- goto quit;
- }
-
- if (!child_suppress_run)
- goto quit;
-
- /* Nothing to do. The thread library was already detected and the
- target vector was already activated. */
- if (fbsd_thread_active)
- goto quit;
-
- /* Initialize the structure that identifies the child process. Note
- that at this point there is no guarantee that we actually have a
- child process. */
- proc_handle.pid = GET_PID (inferior_ptid);
-
- /* Now attempt to open a connection to the thread library. */
- err = td_ta_new_p (&proc_handle, &thread_agent);
- switch (err)
- {
- case TD_NOLIBTHREAD:
- /* No thread library was detected. */
- break;
-
- case TD_OK:
- /* The thread library was detected. Activate the thread_db target. */
- fbsd_thread_present = 1;
-
- /* We can only poke around if there actually is a child process.
- If there is no child process alive, postpone the steps below
- until one has been created. */
- if (fbsd_thread_core == 0 && proc_handle.pid != 0)
- {
- push_target(&fbsd_thread_ops);
- fbsd_thread_activate();
- }
- else
- {
- td_ta_delete_p(thread_agent);
- thread_agent = NULL;
- }
- break;
-
- default:
- warning ("Cannot initialize thread debugging library: %s",
- thread_db_err_str (err));
- break;
- }
-
- quit:
- if (target_new_objfile_chain)
- target_new_objfile_chain (objfile);
-}
-
-static void
-fbsd_thread_attach (char *args, int from_tty)
-{
- fbsd_thread_core = 0;
-
- child_ops.to_attach (args, from_tty);
-
- /* Must get symbols from solibs before libthread_db can run! */
- SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0, auto_solib_add);
-
- if (fbsd_thread_present && !fbsd_thread_active)
- push_target(&fbsd_thread_ops);
-}
-
-static void
-fbsd_thread_post_attach (int pid)
-{
- child_ops.to_post_attach (pid);
-
- if (fbsd_thread_present && !fbsd_thread_active)
- {
- proc_handle.pid = GET_PID (inferior_ptid);
- fbsd_thread_activate ();
- }
-}
-
-static void
-fbsd_thread_detach (char *args, int from_tty)
-{
- fbsd_thread_deactivate ();
- unpush_target (&fbsd_thread_ops);
-
- /* Clear gdb solib information and symbol file
- cache, so that after detach and re-attach, new_objfile
- hook will be called */
-
- clear_solib();
- symbol_file_clear(0);
- proc_handle.pid = 0;
- child_ops.to_detach (args, from_tty);
-}
-
-static int
-suspend_thread_callback (const td_thrhandle_t *th_p, void *data)
-{
- int err = td_thr_dbsuspend_p (th_p);
- if (err != 0)
- fprintf_filtered(gdb_stderr, "%s %s\n", __func__, thread_db_err_str (err));
- return (err);
-}
-
-static int
-resume_thread_callback (const td_thrhandle_t *th_p, void *data)
-{
- int err = td_thr_dbresume_p (th_p);
- if (err != 0)
- fprintf_filtered(gdb_stderr, "%s %s\n", __func__, thread_db_err_str (err));
- return (err);
-}
-
-static void
-fbsd_thread_resume (ptid_t ptid, int step, enum target_signal signo)
-{
- td_thrhandle_t th;
- td_thrinfo_t ti;
- ptid_t work_ptid;
- int resume_all, ret;
- long lwp, thvalid = 0;
-
- if (!fbsd_thread_active)
- {
- child_ops.to_resume (ptid, step, signo);
- return;
- }
-
- if (GET_PID(ptid) != -1 && step != 0)
- {
- resume_all = 0;
- work_ptid = ptid;
- }
- else
- {
- resume_all = 1;
- work_ptid = inferior_ptid;
- }
-
- lwp = GET_LWP (work_ptid);
- if (lwp == 0)
- {
- /* check user thread */
- ret = td_ta_map_id2thr_p (thread_agent, GET_THREAD(work_ptid), &th);
- if (ret)
- error (thread_db_err_str (ret));
-
- /* For M:N thread, we need to tell UTS to set/unset single step
- flag at context switch time, the flag will be written into
- thread mailbox. This becauses some architecture may not have
- machine single step flag in ucontext, so we put the flag in mailbox,
- when the thread switches back, kse_switchin restores the single step
- state. */
- ret = td_thr_sstep_p (&th, step);
- if (ret)
- error (thread_db_err_str (ret));
- ret = td_thr_get_info_p (&th, &ti);
- if (ret)
- error (thread_db_err_str (ret));
- thvalid = 1;
- lwp = ti.ti_lid;
- }
-
- if (lwp)
- {
- int req = step ? PT_SETSTEP : PT_CLEARSTEP;
- if (ptrace (req, (pid_t) lwp, (caddr_t) 1, target_signal_to_host(signo)))
- perror_with_name ("PT_SETSTEP/PT_CLEARSTEP");
- }
-
- if (!ptid_equal (last_single_step_thread, null_ptid))
- {
- ret = td_ta_thr_iter_p (thread_agent, resume_thread_callback, NULL,
- TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
- TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
- if (ret != TD_OK)
- error ("resume error: %s", thread_db_err_str (ret));
- }
-
- if (!resume_all)
- {
- ret = td_ta_thr_iter_p (thread_agent, suspend_thread_callback, NULL,
- TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
- TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
- if (ret != TD_OK)
- error ("suspend error: %s", thread_db_err_str (ret));
- last_single_step_thread = work_ptid;
- }
- else
- last_single_step_thread = null_ptid;
-
- if (thvalid)
- {
- ret = td_thr_dbresume_p (&th);
- if (ret != TD_OK)
- error ("resume error: %s", thread_db_err_str (ret));
- }
- else
- {
- /* it is not necessary, put it here for completness */
- ret = ptrace(PT_RESUME, lwp, 0, 0);
- }
-
- /* now continue the process, suspended thread wont run */
- if (ptrace (PT_CONTINUE, proc_handle.pid , (caddr_t)1,
- target_signal_to_host(signo)))
- perror_with_name ("PT_CONTINUE");
-}
-
-static void
-attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
- const td_thrinfo_t *ti_p, int verbose)
-{
- td_err_e err;
-
- /* Add the thread to GDB's thread list. */
- if (!in_thread_list (ptid)) {
- add_thread (ptid);
- if (verbose)
- printf_unfiltered ("[New %s]\n", target_pid_to_str (ptid));
- }
-
- if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
- return; /* A zombie thread -- do not attach. */
-
- if (! IS_THREAD(ptid))
- return;
- if (fbsd_thread_core != 0)
- return;
- /* Enable thread event reporting for this thread. */
- err = td_thr_event_enable_p (th_p, 1);
- if (err != TD_OK)
- error ("Cannot enable thread event reporting for %s: %s",
- target_pid_to_str (ptid), thread_db_err_str (err));
-}
-
-static void
-detach_thread (ptid_t ptid, int verbose)
-{
- if (verbose)
- printf_unfiltered ("[%s exited]\n", target_pid_to_str (ptid));
-}
-
-static void
-check_event (ptid_t ptid)
-{
- td_event_msg_t msg;
- td_thrinfo_t ti;
- td_err_e err;
- CORE_ADDR stop_pc;
- int loop = 0;
-
- /* Bail out early if we're not at a thread event breakpoint. */
- stop_pc = read_pc_pid (ptid) - DECR_PC_AFTER_BREAK;
- if (stop_pc != td_create_bp_addr && stop_pc != td_death_bp_addr)
- return;
- loop = 1;
-
- do
- {
- err = td_ta_event_getmsg_p (thread_agent, &msg);
- if (err != TD_OK)
- {
- if (err == TD_NOMSG)
- return;
- error ("Cannot get thread event message: %s",
- thread_db_err_str (err));
- }
- err = td_thr_get_info_p ((void *)(uintptr_t)msg.th_p, &ti);
- if (err != TD_OK)
- error ("Cannot get thread info: %s", thread_db_err_str (err));
- ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid));
- switch (msg.event)
- {
- case TD_CREATE:
- /* We may already know about this thread, for instance when the
- user has issued the `info threads' command before the SIGTRAP
- for hitting the thread creation breakpoint was reported. */
- attach_thread (ptid, (void *)(uintptr_t)msg.th_p, &ti, 1);
- break;
- case TD_DEATH:
- if (!in_thread_list (ptid))
- error ("Spurious thread death event.");
- detach_thread (ptid, 1);
- break;
- default:
- error ("Spurious thread event.");
- }
- }
- while (loop);
-}
-
-static ptid_t
-fbsd_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
-{
- ptid_t ret;
- long lwp;
- CORE_ADDR stop_pc;
- td_thrhandle_t th;
- td_thrinfo_t ti;
-
- ret = child_ops.to_wait (ptid, ourstatus);
- if (GET_PID(ret) >= 0 && ourstatus->kind == TARGET_WAITKIND_STOPPED)
- {
- lwp = get_current_lwp (GET_PID(ret));
- ret = thread_from_lwp (BUILD_LWP(lwp, GET_PID(ret)),
- &th, &ti);
- if (!in_thread_list(ret)) {
- /*
- * We have to enable event reporting for initial thread
- * which was not mapped before.
- */
- attach_thread(ret, &th, &ti, 1);
- }
- if (ourstatus->value.sig == TARGET_SIGNAL_TRAP)
- check_event(ret);
- /* this is a hack, if an event won't cause gdb to stop, for example,
- SIGARLM, gdb resumes the process immediatly without setting
- inferior_ptid to the new thread returned here, this is a bug
- because inferior_ptid may already not exist there, and passing
- a none existing thread to fbsd_thread_resume causes error. */
- if (!fbsd_thread_alive (inferior_ptid))
- {
- delete_thread (inferior_ptid);
- inferior_ptid = ret;
- }
- }
-
- return (ret);
-}
-
-static int
-fbsd_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
- struct mem_attrib *attrib, struct target_ops *target)
-{
- int err;
-
- if (target_has_execution)
- err = child_ops.to_xfer_memory (memaddr, myaddr, len, write, attrib,
- target);
- else
- err = orig_core_ops.to_xfer_memory (memaddr, myaddr, len, write, attrib,
- target);
-
- return (err);
-}
-
-static void
-fbsd_lwp_fetch_registers (int regno)
-{
- gregset_t gregs;
- fpregset_t fpregs;
- lwpid_t lwp;
-#ifdef PT_GETXMMREGS
- char xmmregs[512];
-#endif
-
- if (!target_has_execution)
- {
- orig_core_ops.to_fetch_registers (-1);
- return;
- }
-
- /* XXX: We've replaced the pid with the lwpid for GDB's benefit. */
- lwp = GET_PID (inferior_ptid);
-
- if (ptrace (PT_GETREGS, lwp, (caddr_t) &gregs, 0) == -1)
- error ("Cannot get lwp %d registers: %s\n", lwp, safe_strerror (errno));
- supply_gregset (&gregs);
-
-#ifdef PT_GETXMMREGS
- if (ptrace (PT_GETXMMREGS, lwp, xmmregs, 0) == 0)
- {
- i387_supply_fxsave (current_regcache, -1, xmmregs);
- }
- else
- {
-#endif
- if (ptrace (PT_GETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
- error ("Cannot get lwp %d registers: %s\n ", lwp, safe_strerror (errno));
- supply_fpregset (&fpregs);
-#ifdef PT_GETXMMREGS
- }
-#endif
-}
-
-static void
-fbsd_thread_fetch_registers (int regno)
-{
- prgregset_t gregset;
- prfpregset_t fpregset;
- td_thrhandle_t th;
- td_err_e err;
-#ifdef PT_GETXMMREGS
- char xmmregs[512];
-#endif
-
- if (!IS_THREAD (inferior_ptid))
- {
- fbsd_lwp_fetch_registers (regno);
- return;
- }
-
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
- if (err != TD_OK)
- error ("Cannot find thread %d: Thread ID=%ld, %s",
- pid_to_thread_id (inferior_ptid),
- GET_THREAD (inferior_ptid), thread_db_err_str (err));
-
- err = td_thr_getgregs_p (&th, gregset);
- if (err != TD_OK)
- error ("Cannot fetch general-purpose registers for thread %d: Thread ID=%ld, %s",
- pid_to_thread_id (inferior_ptid),
- GET_THREAD (inferior_ptid), thread_db_err_str (err));
-#ifdef PT_GETXMMREGS
- err = td_thr_getxmmregs_p (&th, xmmregs);
- if (err == TD_OK)
- {
- i387_supply_fxsave (current_regcache, -1, xmmregs);
- }
- else
- {
-#endif
- err = td_thr_getfpregs_p (&th, &fpregset);
- if (err != TD_OK)
- error ("Cannot get floating-point registers for thread %d: Thread ID=%ld, %s",
- pid_to_thread_id (inferior_ptid),
- GET_THREAD (inferior_ptid), thread_db_err_str (err));
- supply_fpregset (&fpregset);
-#ifdef PT_GETXMMREGS
- }
-#endif
-
- supply_gregset (gregset);
-}
-
-static void
-fbsd_lwp_store_registers (int regno)
-{
- gregset_t gregs;
- fpregset_t fpregs;
- lwpid_t lwp;
-#ifdef PT_GETXMMREGS
- char xmmregs[512];
-#endif
-
- /* FIXME, is it possible ? */
- if (!IS_LWP (inferior_ptid))
- {
- child_ops.to_store_registers (regno);
- return ;
- }
-
- lwp = GET_LWP (inferior_ptid);
- if (regno != -1)
- if (ptrace (PT_GETREGS, lwp, (caddr_t) &gregs, 0) == -1)
- error ("Cannot get lwp %d registers: %s\n", lwp, safe_strerror (errno));
-
- fill_gregset (&gregs, regno);
- if (ptrace (PT_SETREGS, lwp, (caddr_t) &gregs, 0) == -1)
- error ("Cannot set lwp %d registers: %s\n", lwp, safe_strerror (errno));
-
-#ifdef PT_GETXMMREGS
- if (regno != -1)
- if (ptrace (PT_GETXMMREGS, lwp, xmmregs, 0) == -1)
- goto noxmm;
-
- i387_fill_fxsave (xmmregs, regno);
- if (ptrace (PT_SETXMMREGS, lwp, xmmregs, 0) == -1)
- goto noxmm;
-
- return;
-
-noxmm:
-#endif
-
- if (regno != -1)
- if (ptrace (PT_GETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
- error ("Cannot get lwp %d float registers: %s\n", lwp,
- safe_strerror (errno));
-
- fill_fpregset (&fpregs, regno);
- if (ptrace (PT_SETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
- error ("Cannot set lwp %d float registers: %s\n", lwp,
- safe_strerror (errno));
-}
-
-static void
-fbsd_thread_store_registers (int regno)
-{
- prgregset_t gregset;
- prfpregset_t fpregset;
- td_thrhandle_t th;
- td_err_e err;
-#ifdef PT_GETXMMREGS
- char xmmregs[512];
-#endif
-
- if (!IS_THREAD (inferior_ptid))
- {
- fbsd_lwp_store_registers (regno);
- return;
- }
-
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
- if (err != TD_OK)
- error ("Cannot find thread %d: Thread ID=%ld, %s",
- pid_to_thread_id (inferior_ptid),
- GET_THREAD (inferior_ptid),
- thread_db_err_str (err));
-
- if (regno != -1)
- {
- char old_value[MAX_REGISTER_SIZE];
-
- regcache_collect (regno, old_value);
- err = td_thr_getgregs_p (&th, gregset);
- if (err != TD_OK)
- error ("%s: td_thr_getgregs %s", __func__, thread_db_err_str (err));
-#ifdef PT_GETXMMREGS
- err = td_thr_getxmmregs_p (&th, xmmregs);
- if (err != TD_OK)
- {
-#endif
- err = td_thr_getfpregs_p (&th, &fpregset);
- if (err != TD_OK)
- error ("%s: td_thr_getfpgregs %s", __func__, thread_db_err_str (err));
-#ifdef PT_GETXMMREGS
- }
-#endif
- supply_register (regno, old_value);
- }
-
- fill_gregset (gregset, regno);
- err = td_thr_setgregs_p (&th, gregset);
- if (err != TD_OK)
- error ("Cannot store general-purpose registers for thread %d: Thread ID=%d, %s",
- pid_to_thread_id (inferior_ptid), GET_THREAD (inferior_ptid),
- thread_db_err_str (err));
-
-#ifdef PT_GETXMMREGS
- i387_fill_fxsave (xmmregs, regno);
- err = td_thr_setxmmregs_p (&th, xmmregs);
- if (err == TD_OK)
- return;
-#endif
-
- fill_fpregset (&fpregset, regno);
- err = td_thr_setfpregs_p (&th, &fpregset);
- if (err != TD_OK)
- error ("Cannot store floating-point registers for thread %d: Thread ID=%d, %s",
- pid_to_thread_id (inferior_ptid), GET_THREAD (inferior_ptid),
- thread_db_err_str (err));
-}
-
-static void
-fbsd_thread_kill (void)
-{
- child_ops.to_kill();
-}
-
-static int
-fbsd_thread_can_run (void)
-{
- return child_suppress_run;
-}
-
-static void
-fbsd_thread_create_inferior (char *exec_file, char *allargs, char **env)
-{
- if (fbsd_thread_present && !fbsd_thread_active)
- push_target(&fbsd_thread_ops);
-
- child_ops.to_create_inferior (exec_file, allargs, env);
-}
-
-static void
-fbsd_thread_post_startup_inferior (ptid_t ptid)
-{
- if (fbsd_thread_present && !fbsd_thread_active)
- {
- /* The child process is now the actual multi-threaded
- program. Snatch its process ID... */
- proc_handle.pid = GET_PID (ptid);
- td_ta_new_p (&proc_handle, &thread_agent);
- fbsd_thread_activate();
- }
-}
-
-static void
-fbsd_thread_mourn_inferior (void)
-{
- if (fbsd_thread_active)
- fbsd_thread_deactivate ();
-
- unpush_target (&fbsd_thread_ops);
-
- child_ops.to_mourn_inferior ();
-}
-
-static void
-fbsd_core_check_lwp (bfd *abfd, asection *asect, void *obj)
-{
- lwpid_t lwp;
-
- if (strncmp (bfd_section_name (abfd, asect), ".reg/", 5) != 0)
- return;
-
- /* already found */
- if (*(lwpid_t *)obj == 0)
- return;
-
- lwp = atoi (bfd_section_name (abfd, asect) + 5);
- if (*(lwpid_t *)obj == lwp)
- *(lwpid_t *)obj = 0;
-}
-
-static int
-fbsd_thread_alive (ptid_t ptid)
-{
- td_thrhandle_t th;
- td_thrinfo_t ti;
- td_err_e err;
- gregset_t gregs;
- lwpid_t lwp;
-
- if (IS_THREAD (ptid))
- {
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
- if (err != TD_OK)
- return 0;
-
- err = td_thr_get_info_p (&th, &ti);
- if (err != TD_OK)
- return 0;
-
- /* A zombie thread. */
- if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
- return 0;
-
- return 1;
- }
- else if (GET_LWP (ptid) == 0)
- {
- /* we sometimes are called with lwp == 0 */
- return 1;
- }
-
- if (fbsd_thread_active)
- {
- err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th);
-
- /*
- * if the lwp was already mapped to user thread, don't use it
- * directly, please use user thread id instead.
- */
- if (err == TD_OK)
- return 0;
- }
-
- if (!target_has_execution)
- {
- lwp = GET_LWP (ptid);
- bfd_map_over_sections (core_bfd, fbsd_core_check_lwp, &lwp);
- return (lwp == 0);
- }
-
- /* check lwp in kernel */
- return ptrace (PT_GETREGS, GET_LWP (ptid), (caddr_t)&gregs, 0) == 0;
-}
-
-static void
-fbsd_thread_files_info (struct target_ops *ignore)
-{
- child_ops.to_files_info (ignore);
-}
-
-static int
-find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
-{
- td_thrinfo_t ti;
- td_err_e err;
- ptid_t ptid;
-
- err = td_thr_get_info_p (th_p, &ti);
- if (err != TD_OK)
- error ("Cannot get thread info: %s", thread_db_err_str (err));
-
- /* Ignore zombie */
- if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
- return 0;
-
- ptid = BUILD_THREAD (ti.ti_tid, proc_handle.pid);
- attach_thread (ptid, th_p, &ti, 1);
- return 0;
-}
-
-static void
-fbsd_thread_find_new_threads (void)
-{
- td_err_e err;
-
- if (!fbsd_thread_active)
- return;
-
- /* Iterate over all user-space threads to discover new threads. */
- err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL,
- TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
- TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
- if (err != TD_OK)
- error ("Cannot find new threads: %s", thread_db_err_str (err));
-}
-
-static char *
-fbsd_thread_pid_to_str (ptid_t ptid)
-{
- static char buf[64 + MAXCOMLEN];
-
- if (IS_THREAD (ptid))
- {
- td_thrhandle_t th;
- td_thrinfo_t ti;
- td_err_e err;
-
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
- if (err != TD_OK)
- error ("Cannot find thread, Thread ID=%ld, %s",
- GET_THREAD (ptid), thread_db_err_str (err));
-
- err = td_thr_get_info_p (&th, &ti);
- if (err != TD_OK)
- error ("Cannot get thread info, Thread ID=%ld, %s",
- GET_THREAD (ptid), thread_db_err_str (err));
-
- if (ti.ti_lid != 0)
- {
- snprintf (buf, sizeof (buf), "Thread %llx (LWP %d/%s)",
- (unsigned long long)th.th_thread, ti.ti_lid,
- fbsd_thread_get_name (ti.ti_lid));
- }
- else
- {
- snprintf (buf, sizeof (buf), "Thread %llx (%s)",
- (unsigned long long)th.th_thread,
- thread_db_state_str (ti.ti_state));
- }
-
- return buf;
- }
- else if (IS_LWP (ptid))
- {
- snprintf (buf, sizeof (buf), "LWP %d", (int) GET_LWP (ptid));
- return buf;
- }
- return normal_pid_to_str (ptid);
-}
-
-CORE_ADDR
-fbsd_thread_get_local_address(ptid_t ptid, struct objfile *objfile,
- CORE_ADDR offset)
-{
- td_thrhandle_t th;
- void *address;
- CORE_ADDR lm;
- void *lm2;
- int ret, is_library = (objfile->flags & OBJF_SHARED);
-
- if (IS_THREAD (ptid))
- {
- if (!td_thr_tls_get_addr_p)
- error ("Cannot find thread-local interface in thread_db library.");
-
- /* Get the address of the link map for this objfile. */
- lm = svr4_fetch_objfile_link_map (objfile);
-
- /* Couldn't find link map. Bail out. */
- if (!lm)
- {
- if (is_library)
- error ("Cannot find shared library `%s' link_map in dynamic"
- " linker's module list", objfile->name);
- else
- error ("Cannot find executable file `%s' link_map in dynamic"
- " linker's module list", objfile->name);
- }
-
- ret = td_ta_map_id2thr_p (thread_agent, GET_THREAD(ptid), &th);
-
- /* get the address of the variable. */
- store_typed_address(&lm2, builtin_type_void_data_ptr, lm);
- ret = td_thr_tls_get_addr_p (&th, lm2, offset, &address);
-
- if (ret != TD_OK)
- {
- if (is_library)
- error ("Cannot find thread-local storage for thread %ld, "
- "shared library %s:\n%s",
- (long) GET_THREAD (ptid),
- objfile->name, thread_db_err_str (ret));
- else
- error ("Cannot find thread-local storage for thread %ld, "
- "executable file %s:\n%s",
- (long) GET_THREAD (ptid),
- objfile->name, thread_db_err_str (ret));
- }
-
- /* Cast assuming host == target. */
- return extract_typed_address(&address, builtin_type_void_data_ptr);
- }
- return (0);
-}
-
-static int
-tsd_cb (thread_key_t key, void (*destructor)(void *), void *ignore)
-{
- struct minimal_symbol *ms;
- char *name;
-
- ms = lookup_minimal_symbol_by_pc (
- extract_typed_address(&destructor, builtin_type_void_func_ptr));
- if (!ms)
- name = "???";
- else
- name = DEPRECATED_SYMBOL_NAME (ms);
-
- printf_filtered ("Key %d, destructor %p <%s>\n", key, destructor, name);
- return 0;
-}
-
-static void
-fbsd_thread_tsd_cmd (char *exp, int from_tty)
-{
- if (fbsd_thread_active)
- td_ta_tsd_iter_p (thread_agent, tsd_cb, NULL);
-}
-
-static void
-fbsd_print_sigset (sigset_t *set)
-{
- int i;
-
- for (i = 1; i <= _SIG_MAXSIG; ++i) {
- if (sigismember(set, i)) {
- if (i < sizeof(sys_signame)/sizeof(sys_signame[0]))
- printf_filtered("%s ", sys_signame[i]);
- else
- printf_filtered("sig%d ", i);
- }
- }
- printf_filtered("\n");
-}
-
-static void
-fbsd_thread_signal_cmd (char *exp, int from_tty)
-{
- td_thrhandle_t th;
- td_thrinfo_t ti;
- td_err_e err;
- const char *code;
-
- if (!fbsd_thread_active || !IS_THREAD(inferior_ptid))
- return;
-
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
- if (err != TD_OK)
- return;
-
- err = td_thr_get_info_p (&th, &ti);
- if (err != TD_OK)
- return;
-
- printf_filtered("signal mask:\n");
- fbsd_print_sigset(&ti.ti_sigmask);
- printf_filtered("signal pending:\n");
- fbsd_print_sigset(&ti.ti_pending);
- if (ti.ti_siginfo.si_signo != 0) {
- printf_filtered("si_signo %d si_errno %d", ti.ti_siginfo.si_signo,
- ti.ti_siginfo.si_errno);
- if (ti.ti_siginfo.si_errno != 0)
- printf_filtered(" (%s)", strerror(ti.ti_siginfo.si_errno));
- printf_filtered("\n");
- switch (ti.ti_siginfo.si_code) {
- case SI_NOINFO:
- code = "NOINFO";
- break;
- case SI_USER:
- code = "USER";
- break;
- case SI_QUEUE:
- code = "QUEUE";
- break;
- case SI_TIMER:
- code = "TIMER";
- break;
- case SI_ASYNCIO:
- code = "ASYNCIO";
- break;
- case SI_MESGQ:
- code = "MESGQ";
- break;
- case SI_KERNEL:
- code = "KERNEL";
- break;
- default:
- code = "UNKNOWN";
- break;
- }
- printf_filtered("si_code %s (%d) si_pid %d si_uid %d si_status %x "
- "si_addr %p\n",
- code, ti.ti_siginfo.si_code, ti.ti_siginfo.si_pid, ti.ti_siginfo.si_uid,
- ti.ti_siginfo.si_status, ti.ti_siginfo.si_addr);
- }
-}
-
-static int
-ignore (CORE_ADDR addr, char *contents)
-{
- return 0;
-}
-
-static void
-fbsd_core_open (char *filename, int from_tty)
-{
- int err;
-
- fbsd_thread_core = 1;
-
- orig_core_ops.to_open (filename, from_tty);
-
- if (fbsd_thread_present)
- {
- err = td_ta_new_p (&proc_handle, &thread_agent);
- if (err == TD_OK)
- {
- proc_handle.pid = elf_tdata (core_bfd)->core_pid;
- fbsd_thread_activate ();
- }
- else
- error ("fbsd_core_open: td_ta_new: %s", thread_db_err_str (err));
- }
-}
-
-static void
-fbsd_core_close (int quitting)
-{
- orig_core_ops.to_close (quitting);
-}
-
-static void
-fbsd_core_detach (char *args, int from_tty)
-{
- if (fbsd_thread_active)
- fbsd_thread_deactivate ();
- unpush_target (&fbsd_thread_ops);
- orig_core_ops.to_detach (args, from_tty);
-
- /* Clear gdb solib information and symbol file
- cache, so that after detach and re-attach, new_objfile
- hook will be called */
- clear_solib();
- symbol_file_clear(0);
-}
-
-static void
-fbsd_core_files_info (struct target_ops *ignore)
-{
- orig_core_ops.to_files_info (ignore);
-}
-
-static void
-init_fbsd_core_ops (void)
-{
- fbsd_core_ops.to_shortname = "FreeBSD-core";
- fbsd_core_ops.to_longname = "FreeBSD multithreaded core dump file";
- fbsd_core_ops.to_doc =
- "Use a core file as a target. Specify the filename of the core file.";
- fbsd_core_ops.to_open = fbsd_core_open;
- fbsd_core_ops.to_close = fbsd_core_close;
- fbsd_core_ops.to_attach = 0;
- fbsd_core_ops.to_post_attach = 0;
- fbsd_core_ops.to_detach = fbsd_core_detach;
- /* fbsd_core_ops.to_resume = 0; */
- /* fbsd_core_ops.to_wait = 0; */
- fbsd_core_ops.to_fetch_registers = fbsd_thread_fetch_registers;
- /* fbsd_core_ops.to_store_registers = 0; */
- /* fbsd_core_ops.to_prepare_to_store = 0; */
- fbsd_core_ops.to_xfer_memory = fbsd_thread_xfer_memory;
- fbsd_core_ops.to_files_info = fbsd_core_files_info;
- fbsd_core_ops.to_insert_breakpoint = ignore;
- fbsd_core_ops.to_remove_breakpoint = ignore;
- /* fbsd_core_ops.to_lookup_symbol = 0; */
- fbsd_core_ops.to_create_inferior = fbsd_thread_create_inferior;
- fbsd_core_ops.to_stratum = core_stratum;
- fbsd_core_ops.to_has_all_memory = 0;
- fbsd_core_ops.to_has_memory = 1;
- fbsd_core_ops.to_has_stack = 1;
- fbsd_core_ops.to_has_registers = 1;
- fbsd_core_ops.to_has_execution = 0;
- fbsd_core_ops.to_has_thread_control = tc_none;
- fbsd_core_ops.to_thread_alive = fbsd_thread_alive;
- fbsd_core_ops.to_pid_to_str = fbsd_thread_pid_to_str;
- fbsd_core_ops.to_find_new_threads = fbsd_thread_find_new_threads;
- fbsd_core_ops.to_sections = 0;
- fbsd_core_ops.to_sections_end = 0;
- fbsd_core_ops.to_magic = OPS_MAGIC;
-}
-
-static void
-init_fbsd_thread_ops (void)
-{
- fbsd_thread_ops.to_shortname = "freebsd-threads";
- fbsd_thread_ops.to_longname = "FreeBSD multithreaded child process.";
- fbsd_thread_ops.to_doc = "FreeBSD threads support.";
- fbsd_thread_ops.to_attach = fbsd_thread_attach;
- fbsd_thread_ops.to_detach = fbsd_thread_detach;
- fbsd_thread_ops.to_post_attach = fbsd_thread_post_attach;
- fbsd_thread_ops.to_resume = fbsd_thread_resume;
- fbsd_thread_ops.to_wait = fbsd_thread_wait;
- fbsd_thread_ops.to_fetch_registers = fbsd_thread_fetch_registers;
- fbsd_thread_ops.to_store_registers = fbsd_thread_store_registers;
- fbsd_thread_ops.to_xfer_memory = fbsd_thread_xfer_memory;
- fbsd_thread_ops.to_files_info = fbsd_thread_files_info;
- fbsd_thread_ops.to_kill = fbsd_thread_kill;
- fbsd_thread_ops.to_create_inferior = fbsd_thread_create_inferior;
- fbsd_thread_ops.to_post_startup_inferior = fbsd_thread_post_startup_inferior;
- fbsd_thread_ops.to_mourn_inferior = fbsd_thread_mourn_inferior;
- fbsd_thread_ops.to_can_run = fbsd_thread_can_run;
- fbsd_thread_ops.to_thread_alive = fbsd_thread_alive;
- fbsd_thread_ops.to_find_new_threads = fbsd_thread_find_new_threads;
- fbsd_thread_ops.to_pid_to_str = fbsd_thread_pid_to_str;
- fbsd_thread_ops.to_stratum = thread_stratum;
- fbsd_thread_ops.to_has_thread_control = tc_none;
- fbsd_thread_ops.to_has_all_memory = 1;
- fbsd_thread_ops.to_has_memory = 1;
- fbsd_thread_ops.to_has_stack = 1;
- fbsd_thread_ops.to_has_registers = 1;
- fbsd_thread_ops.to_has_execution = 1;
- fbsd_thread_ops.to_insert_breakpoint = memory_insert_breakpoint;
- fbsd_thread_ops.to_remove_breakpoint = memory_remove_breakpoint;
- fbsd_thread_ops.to_get_thread_local_address = fbsd_thread_get_local_address;
- fbsd_thread_ops.to_magic = OPS_MAGIC;
-}
-
-static int
-thread_db_load (void)
-{
- void *handle;
- td_err_e err;
-
- handle = dlopen (LIBTHREAD_DB_SO, RTLD_NOW);
- if (handle == NULL)
- return 0;
-
-#define resolve(X) \
- if (!(X##_p = dlsym (handle, #X))) \
- return 0;
-
- resolve(td_init);
- resolve(td_ta_new);
- resolve(td_ta_delete);
- resolve(td_ta_map_id2thr);
- resolve(td_ta_map_lwp2thr);
- resolve(td_ta_thr_iter);
- resolve(td_thr_get_info);
-#ifdef PT_GETXMMREGS
- resolve(td_thr_getxmmregs);
-#endif
- resolve(td_thr_getfpregs);
- resolve(td_thr_getgregs);
-#ifdef PT_GETXMMREGS
- resolve(td_thr_setxmmregs);
-#endif
- resolve(td_thr_setfpregs);
- resolve(td_thr_setgregs);
- resolve(td_thr_sstep);
- resolve(td_ta_tsd_iter);
- resolve(td_thr_dbsuspend);
- resolve(td_thr_dbresume);
- resolve(td_thr_tls_get_addr);
-
- /* Initialize the library. */
- err = td_init_p ();
- if (err != TD_OK)
- {
- warning ("Cannot initialize libthread_db: %s", thread_db_err_str (err));
- return 0;
- }
-
- /* These are not essential. */
- td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr");
- td_ta_set_event_p = dlsym (handle, "td_ta_set_event");
- td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg");
- td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable");
- td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr");
-
- return 1;
-}
-
-/* we suppress the call to add_target of core_ops in corelow because
- if there are two targets in the stratum core_stratum, find_core_target
- won't know which one to return. see corelow.c for an additonal
- comment on coreops_suppress_target. */
-
-int coreops_suppress_target = 1;
-
-/* similarly we allow this target to be completely skipped. This is used
- by kgdb which uses its own core target. */
-
-int fbsdcoreops_suppress_target;
-
-void
-_initialize_thread_db (void)
-{
-
- if (fbsdcoreops_suppress_target)
- return;
- init_fbsd_thread_ops ();
- init_fbsd_core_ops ();
-
- if (thread_db_load ())
- {
- add_target (&fbsd_thread_ops);
-
- /* "thread tsd" command */
- add_cmd ("tsd", class_run, fbsd_thread_tsd_cmd,
- "Show the thread-specific data keys and destructors "
- "for the process.\n",
- &thread_cmd_list);
-
- add_cmd ("signal", class_run, fbsd_thread_signal_cmd,
- "Show the thread signal info.\n",
- &thread_cmd_list);
-
- memcpy (&orig_core_ops, &core_ops, sizeof (struct target_ops));
- memcpy (&core_ops, &fbsd_core_ops, sizeof (struct target_ops));
- add_target (&core_ops);
-
- /* Add ourselves to objfile event chain. */
- target_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = fbsd_thread_new_objfile;
-
- child_suppress_run = 1;
- }
- else
- {
- fprintf_unfiltered (gdb_stderr,
- "[GDB will not be able to debug user-mode threads: %s]\n", dlerror());
-
- /* allow the user to debug non-threaded core files */
- add_target (&core_ops);
- }
-}
-
-/* proc service functions */
-void
-ps_plog (const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- vfprintf_filtered (gdb_stderr, fmt, args);
- va_end (args);
-}
-
-ps_err_e
-ps_pglobal_lookup (struct ps_prochandle *ph, const char *obj,
- const char *name, psaddr_t *sym_addr)
-{
- struct minimal_symbol *ms;
- CORE_ADDR addr;
-
- ms = lookup_minimal_symbol (name, NULL, NULL);
- if (ms == NULL)
- return PS_NOSYM;
-
- addr = SYMBOL_VALUE_ADDRESS (ms);
- store_typed_address(sym_addr, builtin_type_void_data_ptr, addr);
- return PS_OK;
-}
-
-ps_err_e
-ps_pread (struct ps_prochandle *ph, psaddr_t addr, void *buf, size_t len)
-{
- int err = target_read_memory (
- extract_typed_address(&addr, builtin_type_void_data_ptr), buf, len);
- return (err == 0 ? PS_OK : PS_ERR);
-}
-
-ps_err_e
-ps_pwrite (struct ps_prochandle *ph, psaddr_t addr, const void *buf,
- size_t len)
-{
- int err = target_write_memory (
- extract_typed_address(&addr, builtin_type_void_data_ptr), (void *)buf, len);
- return (err == 0 ? PS_OK : PS_ERR);
-}
-
-ps_err_e
-ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
-
- /* XXX: Target operation isn't lwp aware: replace pid with lwp */
- inferior_ptid = BUILD_LWP (0, lwpid);
-
- target_fetch_registers (-1);
- fill_gregset (gregset, -1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-
-ps_err_e
-ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, const prgregset_t gregset)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
- inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- supply_gregset ((gdb_gregset_t *) gregset);
- target_store_registers (-1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-
-ps_err_e
-ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, prfpregset_t *fpregset)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
- inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- target_fetch_registers (-1);
- fill_fpregset (fpregset, -1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-
-ps_err_e
-ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
- const prfpregset_t *fpregset)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
- inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- supply_fpregset ((gdb_fpregset_t *) fpregset);
- target_store_registers (-1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-
-#ifdef PT_GETXMMREGS
-ps_err_e
-ps_lgetxmmregs (struct ps_prochandle *ph, lwpid_t lwpid, char *xmmregs)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
- inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- target_fetch_registers (-1);
- i387_fill_fxsave (xmmregs, -1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-
-ps_err_e
-ps_lsetxmmregs (struct ps_prochandle *ph, lwpid_t lwpid,
- const char *xmmregs)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
- inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- i387_supply_fxsave (current_regcache, -1, xmmregs);
- target_store_registers (-1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-#endif
-
-ps_err_e
-ps_lstop(struct ps_prochandle *ph, lwpid_t lwpid)
-{
- if (ptrace (PT_SUSPEND, lwpid, 0, 0) == -1)
- return PS_ERR;
- return PS_OK;
-}
-
-ps_err_e
-ps_lcontinue(struct ps_prochandle *ph, lwpid_t lwpid)
-{
- if (ptrace (PT_RESUME, lwpid, 0, 0) == -1)
- return PS_ERR;
- return PS_OK;
-}
-
-ps_err_e
-ps_linfo(struct ps_prochandle *ph, lwpid_t lwpid, void *info)
-{
- if (fbsd_thread_core) {
- /* XXX should verify lwpid and make a pseudo lwp info */
- memset(info, 0, sizeof(struct ptrace_lwpinfo));
- return PS_OK;
- }
-
- if (ptrace (PT_LWPINFO, lwpid, info, sizeof(struct ptrace_lwpinfo)) == -1)
- return PS_ERR;
- return PS_OK;
-}
diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index 69065a9c4a3b..a3e353e5574b 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -2143,11 +2143,6 @@ OLD_FILES+=usr/share/man/man1/llvm-cov.1.gz
OLD_FILES+=usr/share/man/man1/llvm-profdata.1.gz
.endif
-.if ${MK_GDB} == no
-OLD_FILES+=usr/libexec/gdb
-OLD_FILES+=usr/libexec/kgdb
-.endif
-
.if ${MK_GOOGLETEST} == no
OLD_FILES+=usr/include/gmock/gmock-actions.h
OLD_FILES+=usr/include/gmock/gmock-cardinalities.h