This commit was manufactured by cvs2svn to create tag 'binu_ss_19990721'.

Sprout from cygnus 1999-05-03 07:29:11 UTC Richard Henderson <rth@redhat.com> '19990502 sourceware import'
Cherrypick from master 1999-07-20 22:27:31 UTC Doug Evans <dje@google.com> '	* ldlang.c (lang_gc_sections): Only handle the start symbol':
    ChangeLog
    Makefile.in
    bfd/ChangeLog
    bfd/Makefile.am
    bfd/Makefile.in
    bfd/aclocal.m4
    bfd/aix386-core.c
    bfd/aout-adobe.c
    bfd/aout-arm.c
    bfd/aout-ns32k.c
    bfd/aout-target.h
    bfd/aout-tic30.c
    bfd/aoutx.h
    bfd/archive.c
    bfd/archures.c
    bfd/bfd-in.h
    bfd/bfd-in2.h
    bfd/bfd.c
    bfd/binary.c
    bfd/bout.c
    bfd/cisco-core.c
    bfd/coff-a29k.c
    bfd/coff-alpha.c
    bfd/coff-apollo.c
    bfd/coff-arm.c
    bfd/coff-h8300.c
    bfd/coff-h8500.c
    bfd/coff-i386.c
    bfd/coff-i860.c
    bfd/coff-i960.c
    bfd/coff-m68k.c
    bfd/coff-m88k.c
    bfd/coff-mcore.c
    bfd/coff-mips.c
    bfd/coff-ppc.c
    bfd/coff-rs6000.c
    bfd/coff-sh.c
    bfd/coff-sparc.c
    bfd/coff-stgo32.c
    bfd/coff-tic30.c
    bfd/coff-tic80.c
    bfd/coff-w65.c
    bfd/coff-we32k.c
    bfd/coff-z8k.c
    bfd/coffcode.h
    bfd/coffgen.c
    bfd/cofflink.c
    bfd/coffswap.h
    bfd/config.bfd
    bfd/config.in
    bfd/configure
    bfd/configure.host
    bfd/configure.in
    bfd/cpu-arm.c
    bfd/cpu-h8500.c
    bfd/cpu-ns32k.c
    bfd/cpu-w65.c
    bfd/dwarf1.c
    bfd/dwarf2.c
    bfd/ecoff.c
    bfd/ecofflink.c
    bfd/elf-bfd.h
    bfd/elf-hppa.h
    bfd/elf-m10200.c
    bfd/elf-m10300.c
    bfd/elf.c
    bfd/elf32-arc.c
    bfd/elf32-arm.h
    bfd/elf32-d10v.c
    bfd/elf32-d30v.c
    bfd/elf32-fr30.c
    bfd/elf32-gen.c
    bfd/elf32-hppa.c
    bfd/elf32-hppa.h
    bfd/elf32-i386.c
    bfd/elf32-i860.c
    bfd/elf32-i960.c
    bfd/elf32-m32r.c
    bfd/elf32-m68k.c
    bfd/elf32-m88k.c
    bfd/elf32-mcore.c
    bfd/elf32-mips.c
    bfd/elf32-ppc.c
    bfd/elf32-sh.c
    bfd/elf32-sparc.c
    bfd/elf32-v850.c
    bfd/elf64-alpha.c
    bfd/elf64-gen.c
    bfd/elf64-mips.c
    bfd/elf64-sparc.c
    bfd/elfarm-nabi.c
    bfd/elfarm-oabi.c
    bfd/elfcode.h
    bfd/elflink.c
    bfd/elflink.h
    bfd/elfxx-target.h
    bfd/epoc-pe-arm.c
    bfd/epoc-pei-arm.c
    bfd/hash.c
    bfd/hosts/alphalinux.h
    bfd/hp300hpux.c
    bfd/hppabsd-core.c
    bfd/hpux-core.c
    bfd/i386linux.c
    bfd/i386lynx.c
    bfd/i386msdos.c
    bfd/i386os9k.c
    bfd/ieee.c
    bfd/ihex.c
    bfd/irix-core.c
    bfd/libbfd-in.h
    bfd/libbfd.c
    bfd/libbfd.h
    bfd/libhppa.h
    bfd/linker.c
    bfd/m68klinux.c
    bfd/mipsbsd.c
    bfd/netbsd-core.c
    bfd/nlm-target.h
    bfd/nlm32-ppc.c
    bfd/nlm32-sparc.c
    bfd/nlmcode.h
    bfd/oasys.c
    bfd/osf-core.c
    bfd/pe-arm.c
    bfd/pei-arm.c
    bfd/peicode.h
    bfd/po/POTFILES.in
    bfd/po/bfd.pot
    bfd/ppcboot.c
    bfd/ptrace-core.c
    bfd/reloc.c
    bfd/riscix.c
    bfd/sco5-core.c
    bfd/section.c
    bfd/som.c
    bfd/sparclinux.c
    bfd/srec.c
    bfd/stabs.c
    bfd/sunos.c
    bfd/syms.c
    bfd/targets.c
    bfd/tekhex.c
    bfd/trad-core.c
    bfd/versados.c
    bfd/vms-gsd.c
    bfd/vms-hdr.c
    bfd/vms-misc.c
    bfd/vms-tir.c
    bfd/vms.c
    bfd/vms.h
    bfd/xcofflink.c
    binutils/ChangeLog
    binutils/Makefile.am
    binutils/Makefile.in
    binutils/NEWS
    binutils/addr2line.c
    binutils/ar.c
    binutils/arparse.y
    binutils/arsup.c
    binutils/binutils.texi
    binutils/config.in
    binutils/configure
    binutils/configure.in
    binutils/debug.c
    binutils/deflex.l
    binutils/defparse.y
    binutils/dlltool.c
    binutils/dllwrap.c
    binutils/filemode.c
    binutils/ieee.c
    binutils/nm.c
    binutils/objcopy.1
    binutils/objcopy.c
    binutils/objdump.c
    binutils/po/POTFILES.in
    binutils/po/binutils.pot
    binutils/prdbg.c
    binutils/rclex.l
    binutils/rcparse.y
    binutils/rdcoff.c
    binutils/readelf.c
    binutils/rename.c
    binutils/rescoff.c
    binutils/resrc.c
    binutils/size.c
    binutils/stabs.c
    binutils/testsuite/ChangeLog
    binutils/testsuite/binutils-all/objdump.exp
    binutils/testsuite/binutils-all/readelf.h
    binutils/testsuite/binutils-all/readelf.r
    binutils/testsuite/binutils-all/readelf.wi
    binutils/windres.c
    binutils/windres.h
    binutils/wrstabs.c
    config.guess
    config.sub
    configure
    configure.in
    gas/ChangeLog
    gas/Makefile.am
    gas/Makefile.in
    gas/NEWS
    gas/aclocal.m4
    gas/app.c
    gas/as.c
    gas/as.h
    gas/atof-generic.c
    gas/cgen.c
    gas/cond.c
    gas/config/atof-ieee.c
    gas/config/m68k-parse.h
    gas/config/obj-aout.c
    gas/config/obj-aout.h
    gas/config/obj-bout.c
    gas/config/obj-coff.c
    gas/config/obj-coff.h
    gas/config/obj-ecoff.c
    gas/config/obj-ecoff.h
    gas/config/obj-elf.c
    gas/config/obj-elf.h
    gas/config/obj-multi.h
    gas/config/obj-vms.h
    gas/config/tc-alpha.c
    gas/config/tc-alpha.h
    gas/config/tc-arc.c
    gas/config/tc-arc.h
    gas/config/tc-arm.c
    gas/config/tc-arm.h
    gas/config/tc-d10v.c
    gas/config/tc-d30v.c
    gas/config/tc-d30v.h
    gas/config/tc-fr30.c
    gas/config/tc-hppa.c
    gas/config/tc-hppa.h
    gas/config/tc-i386.c
    gas/config/tc-i386.h
    gas/config/tc-i860.c
    gas/config/tc-i960.c
    gas/config/tc-i960.h
    gas/config/tc-m32r.c
    gas/config/tc-m68k.c
    gas/config/tc-m68k.h
    gas/config/tc-m88k.c
    gas/config/tc-mcore.c
    gas/config/tc-mcore.h
    gas/config/tc-mips.c
    gas/config/tc-mips.h
    gas/config/tc-mn10200.c
    gas/config/tc-mn10300.c
    gas/config/tc-ns32k.c
    gas/config/tc-ns32k.h
    gas/config/tc-ppc.c
    gas/config/tc-ppc.h
    gas/config/tc-sh.c
    gas/config/tc-sh.h
    gas/config/tc-sparc.c
    gas/config/tc-sparc.h
    gas/config/tc-tahoe.c
    gas/config/tc-tic30.c
    gas/config/tc-v850.c
    gas/config/tc-vax.c
    gas/config/tc-w65.c
    gas/config/tc-z8k.c
    gas/configure
    gas/configure.in
    gas/dep-in.sed
    gas/doc/Makefile.in
    gas/doc/c-arm.texi
    gas/doc/c-sparc.texi
    gas/doc/internals.texi
    gas/dwarf2dbg.c
    gas/dwarf2dbg.h
    gas/ecoff.c
    gas/ecoff.h
    gas/expr.c
    gas/expr.h
    gas/frags.h
    gas/gasp.c
    gas/hash.c
    gas/hash.h
    gas/input-file.c
    gas/itbl-ops.c
    gas/itbl-ops.h
    gas/listing.c
    gas/macro.c
    gas/po/POTFILES.in
    gas/po/gas.pot
    gas/read.c
    gas/read.h
    gas/stabs.c
    gas/struc-symbol.h
    gas/subsegs.c
    gas/symbols.c
    gas/symbols.h
    gas/testsuite/ChangeLog
    gas/testsuite/gas/all/itbl-test.c
    gas/testsuite/gas/arm/arm7t.d
    gas/testsuite/gas/arm/inst.d
    gas/testsuite/gas/elf/elf.exp
    gas/testsuite/gas/elf/section0.d
    gas/testsuite/gas/elf/section0.s
    gas/testsuite/gas/elf/section1.d
    gas/testsuite/gas/elf/section1.s
    gas/testsuite/gas/i386/amd.d
    gas/testsuite/gas/i386/amd.s
    gas/testsuite/gas/i386/i386.exp
    gas/testsuite/gas/i386/katmai.d
    gas/testsuite/gas/i386/katmai.s
    gas/testsuite/gas/i386/opcode.d
    gas/testsuite/gas/i386/prefix.d
    gas/testsuite/gas/i386/prefix.s
    gas/testsuite/gas/i386/reloc.d
    gas/testsuite/gas/i386/reloc.s
    gas/testsuite/gas/macros/irp.d
    gas/testsuite/gas/macros/irp.s
    gas/testsuite/gas/macros/rept.d
    gas/testsuite/gas/macros/rept.s
    gas/testsuite/gas/macros/test2.d
    gas/testsuite/gas/macros/test2.s
    gas/testsuite/gas/macros/test3.d
    gas/testsuite/gas/macros/test3.s
    gas/testsuite/gas/mcore/allinsn.d
    gas/testsuite/gas/mips/elf_e_flags.c
    gas/testsuite/gas/mips/elf_e_flags.s
    gas/testsuite/gas/mips/elf_e_flags1.d
    gas/testsuite/gas/mips/elf_e_flags2.d
    gas/testsuite/gas/mips/elf_e_flags3.d
    gas/testsuite/gas/mips/elf_e_flags4.d
    gas/testsuite/gas/mips/sync.d
    gas/testsuite/gas/sparc/prefetch.d
    gas/testsuite/gas/sparc/rdpr.d
    gas/testsuite/gas/sparc/reloc64.d
    gas/testsuite/gas/sparc/set64.d
    gas/testsuite/gas/sparc/set64.s
    gas/testsuite/gas/sparc/sparc.exp
    gas/testsuite/gas/sparc/synth64.d
    gas/testsuite/gas/sparc/synth64.s
    gas/testsuite/gas/sparc/wrpr.d
    gas/testsuite/gas/vtable/vtable.exp
    gas/write.c
    gprof/ChangeLog
    gprof/Makefile.am
    gprof/Makefile.in
    gprof/alpha.c
    gprof/basic_blocks.c
    gprof/call_graph.c
    gprof/cg_dfn.c
    gprof/configure
    gprof/configure.in
    gprof/corefile.c
    gprof/gmon_io.c
    gprof/gprof.texi
    gprof/hist.c
    gprof/i386.c
    gprof/po/POTFILES.in
    gprof/po/gprof.pot
    gprof/sparc.c
    gprof/sym_ids.c
    gprof/symtab.c
    gprof/tahoe.c
    gprof/vax.c
    include/ChangeLog
    include/ansidecl.h
    include/aout/ChangeLog
    include/aout/aout64.h
    include/bfdlink.h
    include/coff/ChangeLog
    include/coff/arm.h
    include/coff/internal.h
    include/coff/mcore.h
    include/dis-asm.h
    include/elf/ChangeLog
    include/elf/arm.h
    include/elf/common.h
    include/elf/dwarf.h
    include/elf/dwarf2.h
    include/elf/hppa.h
    include/elf/i960.h
    include/elf/m68k.h
    include/elf/mcore.h
    include/elf/mips.h
    include/elf/reloc-macros.h
    include/elf/sparc.h
    include/opcode/ChangeLog
    include/opcode/hppa.h
    include/opcode/i386.h
    include/opcode/m68k.h
    include/opcode/ppc.h
    ld/ChangeLog
    ld/Makefile.am
    ld/Makefile.in
    ld/NEWS
    ld/configure
    ld/configure.host
    ld/configure.in
    ld/configure.tgt
    ld/emulparams/armelf.sh
    ld/emulparams/armelf_linux.sh
    ld/emulparams/armelf_oabi.sh
    ld/emulparams/elf32_i960.sh
    ld/emulparams/elf32bmipn32.sh
    ld/emulparams/elf32mcore.sh
    ld/emulparams/elf32ppclinux.sh
    ld/emulparams/elf64_sparc.sh
    ld/emulparams/elf64bmip.sh
    ld/emulparams/mcorepe.sh
    ld/emultempl/armcoff.em
    ld/emultempl/armelf.em
    ld/emultempl/armelf_oabi.em
    ld/emultempl/elf32.em
    ld/emultempl/linux.em
    ld/emultempl/pe.em
    ld/emultempl/sunos.em
    ld/genscripts.sh
    ld/ld.texinfo
    ld/ldcref.c
    ld/ldemul.c
    ld/ldexp.c
    ld/ldfile.c
    ld/ldgram.y
    ld/ldlang.c
    ld/ldlang.h
    ld/ldmain.c
    ld/lexsup.c
    ld/pe-dll.c
    ld/po/POTFILES.in
    ld/po/ld.pot
    ld/scripttempl/armcoff.sc
    ld/scripttempl/elf.sc
    ld/scripttempl/mcorepe.sc
    ld/scripttempl/pe.sc
    ld/scripttempl/v850.sc
    ld/testsuite/ChangeLog
    ld/testsuite/ld-cdtest/cdtest-main.cc
    ld/testsuite/ld-checks/asm.s
    ld/testsuite/ld-checks/checks.exp
    ld/testsuite/ld-elfvers/vers.exp
    ld/testsuite/ld-elfvers/vers17.c
    ld/testsuite/ld-elfvers/vers17.dsym
    ld/testsuite/ld-elfvers/vers17.map
    ld/testsuite/ld-elfvers/vers17.ver
    ld/testsuite/ld-elfvers/vers18.c
    ld/testsuite/ld-elfvers/vers18.dsym
    ld/testsuite/ld-elfvers/vers18.map
    ld/testsuite/ld-elfvers/vers18.sym
    ld/testsuite/ld-elfvers/vers18.ver
    ld/testsuite/ld-elfvers/vers19.c
    ld/testsuite/ld-elfvers/vers19.dsym
    ld/testsuite/ld-elfvers/vers19.ver
    ld/testsuite/ld-scripts/phdrs.exp
    ld/testsuite/ld-scripts/weak.exp
    ld/testsuite/ld-shared/sh1.c
    ld/testsuite/ld-shared/shared.exp
    ld/testsuite/ld-srec/srec.exp
    ld/testsuite/ld-undefined/undefined.exp
    ld/testsuite/lib/ld-lib.exp
    libiberty/ChangeLog
    libiberty/argv.c
    libiberty/choose-temp.c
    libiberty/configure
    libiberty/configure.in
    libiberty/cplus-dem.c
    libiberty/getruntime.c
    libiberty/splay-tree.c
    opcodes/ChangeLog
    opcodes/Makefile.am
    opcodes/Makefile.in
    opcodes/alpha-dis.c
    opcodes/arm-dis.c
    opcodes/dis-buf.c
    opcodes/disassemble.c
    opcodes/i386-dis.c
    opcodes/m68k-dis.c
    opcodes/m68k-opc.c
    opcodes/mcore-dis.c
    opcodes/mcore-opc.h
    opcodes/po/POTFILES.in
    opcodes/po/opcodes.pot
    opcodes/sparc-dis.c
    opcodes/sparc-opc.c
    opcodes/tic30-dis.c
    texinfo/texinfo.tex
Delete:
    intl/ChangeLog.Cygnus
diff --git a/ChangeLog b/ChangeLog
index 2604b21..1ab9336 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+1999-07-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* configure: Add -W -Wall to the default CFLAGS when compiling with
+	gcc.
+
+Thu Jul  8 12:32:23 1999  John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+	* configure.in: Build ld, binutils & gas for hppa*-*-linux-gnu*.
+
+1999-06-30  Mark Mitchell  <mark@codesourcery.com>
+
+	* configure.in: Build ld on IRIX6.
+
+1999-06-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* Makefile.in: Change distribution targets to use bzip2 instead of
+	gzip.
+	(TEXINFO_SUPPORT): Set to just texinfo/texinfo.tex.
+	(taz): Don't use texinfo/gpl.texinfo or texinfo/lgpl.texinfo.
+
+1999-06-04  Nick Clifton  <nickc@cygnus.com>
+
+	* config.sub: Add mcore target.
+
+Sun May 30 16:03:16 1999  Cort Dougan  <cort@cs.nmt.edu>
+
+	* config.guess (ppc-*-linux-gnu): Also use ld emul elf32ppclinux.
+
+1999-05-24  Nick Clifton  <nickc@cygnus.com>
+
+	* config.sub: Updated to match latest EGCS version.
+
 1999-04-30  Tom Tromey  <tromey@cygnus.com>
 
 	* ltmain.sh: [mode link] Always use CC given by ltconfig.
diff --git a/Makefile.in b/Makefile.in
index 7f1bb8c..18e88b4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -109,8 +109,7 @@
 
 LD = ld
 
-# Not plain GZIP, since gzip looks there for extra command-line options.
-GZIPPROG = gzip
+BZIPPROG = bzip2
 
 # These values are substituted by configure.
 DEFAULT_YACC = yacc
@@ -1691,8 +1690,7 @@
 
 .PHONY: taz
 
-taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
-  texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
+taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
 	# Take out texinfo from a few places.
 	sed -e '/^all\.normal: /s/\all-texinfo //' \
 	    -e '/^	install-texinfo /d' \
@@ -1737,8 +1735,6 @@
 	#
 	mkdir proto-toplev/texinfo
 	ln -s ../../texinfo/texinfo.tex		proto-toplev/texinfo/
-	ln -s ../../texinfo/gpl.texinfo		proto-toplev/texinfo/
-	ln -s ../../texinfo/lgpl.texinfo	proto-toplev/texinfo/
 	if test -r texinfo/util/tex3patch ; then \
 	  mkdir proto-toplev/texinfo/util && \
 	  ln -s ../../../texinfo/util/tex3patch	proto-toplev/texinfo/util ; \
@@ -1749,55 +1745,55 @@
 	else \
 	  ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
 	fi; \
-	$(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver
+	$(MAKE) -f Makefile.in do-tar-bz2 TOOL=$(TOOL) VER=$$ver
 
-do-tar-gz:
-	echo "==> Making $(TOOL)-$(VER).tar.gz"
+do-tar-bz2:
+	echo "==> Making $(TOOL)-$(VER).tar.bz2"
 	-rm -f $(TOOL)-$(VER)
 	ln -s proto-toplev $(TOOL)-$(VER)
 	tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
-	$(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
+	$(BZIPPROG) -v -9 $(TOOL)-$(VER).tar
 
-TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
+TEXINFO_SUPPORT= texinfo/texinfo.tex
 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
 
-.PHONY: gas.tar.gz
+.PHONY: gas.tar.bz2
 GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms
-gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
+gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
 	$(MAKE) -f Makefile.in taz TOOL=gas \
 		SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
 
 # The FSF "binutils" release includes gprof and ld.
-.PHONY: binutils.tar.gz
+.PHONY: binutils.tar.bz2
 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms
-binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
+binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
 	$(MAKE) -f Makefile.in taz TOOL=binutils \
 		SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
 
-.PHONY: gas+binutils.tar.gz
+.PHONY: gas+binutils.tar.bz2
 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
-gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
+gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
 	$(MAKE) -f Makefile.in taz TOOL=gas \
 		SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
 
-.PHONY: libg++.tar.gz
+.PHONY: libg++.tar.bz2
 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
-libg++.tar.gz: $(DIST_SUPPORT) libg++
+libg++.tar.bz2: $(DIST_SUPPORT) libg++
 	$(MAKE) -f Makefile.in taz TOOL=libg++ \
 		SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
 
 GNATS_SUPPORT_DIRS=include libiberty send-pr
-gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
+gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
 	$(MAKE) -f  Makefile.in taz TOOL=gnats \
 		SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
 
-.PHONY: gdb.tar.gz
+.PHONY: gdb.tar.bz2
 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
-gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
+gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
 	$(MAKE) -f Makefile.in taz TOOL=gdb \
 		SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
 
-.PHONY: newlib.tar.gz
+.PHONY: newlib.tar.bz2
 NEWLIB_SUPPORT_DIRS=libgloss
 # taz configures for the sun4 target which won't configure newlib.
 # We need newlib configured so that the .info files are made.
@@ -1810,7 +1806,7 @@
 # the make distclean.  For now punt on the issue of shipping newlib info files
 # with newlib net releases and wait for a day when some native target (sun4?)
 # supports newlib (if only minimally).
-newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
+newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
 	$(MAKE) -f Makefile.in taz TOOL=newlib \
 		SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
 		DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 66a5b24..7c958e8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,1341 @@
+1999-07-20  Nick Clifton  <nickc@cygnus.com>
+
+	* coff-m88k.c: Use CREATE_BIG_COFF_TARGET_VEC.
+
+Mon Jul 19 14:03:44 1999  Mark P. Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (_bfd_mips_elf_final_link): Restore setting of GP
+ 	removed in previous change.
+	(_bfd_mips_elf_relocate_section): Adjust GP relative relocations
+ 	in relocateable output.
+
+1999-07-19  Ian Lance Taylor  <ian@zembu.com>
+
+	* coff-m88k.c (m88kbcs_vec): Initialize new field of bfd_target
+	structure.
+
+	* elflink.h (elf_merge_symbol): Do merge symbols from the same BFD
+	if they appear to be specially created by the linker.
+
+1999-07-19  Nick Clifton  <nickc@cygnus.com>
+
+	* targets.c (alternative_target): New field in bfd_target
+	structure.
+	(bfd_search_for_target): New function:  Find a target that
+	satisifies a search function.
+	* bfd-in2.h: Regenerate.
+
+	* elfxx-target.h: Initialise the alternative_target field of
+	the bfd_target structures to point to the other target (if
+	defined).
+	* nlm-target.h: Initialise the alternative_target field of
+	the bfd_target structures to point to the other target (if
+	defined).
+	
+	* coffcode.h (CREATE_BIG_COFF_TARGET_VEC): New macro.
+	(CREATE_LITTLE_COFF_TARGET_VEC): New macro.
+	
+	* aix386-core.c: Initialise new field of bfd_target structure. 
+	* aout-adobe.c: Initialise new field of bfd_target structure. 
+	* aout-arm.c: Initialise new field of bfd_target structure. 
+	* aout-target.h: Initialise new field of bfd_target structure. 
+	* aout-tic30.c: Initialise new field of bfd_target structure. 
+	* binary.c: Initialise new field of bfd_target structure. 
+	* bout.c: Initialise new field of bfd_target structure. 
+	* cisco-core.c: Initialise new field of bfd_target structure. 
+	* coff-a29k.c: Use CREATE_BIG_COFF_TARGET_VEC.
+	* coff-alpha.c: Initialise new field of bfd_target structure. 
+	* coff-apollo.c: Use CREATE_BIG_COFF_TARGET_VEC.
+	* coff-arm.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC.
+	* coff-h8300.c: Use CREATE_BIG_COFF_TARGET_VEC.
+	* coff-h8500.c: Use CREATE_BIG_COFF_TARGET_VEC.
+	* coff-i386.c: Initialise new field of bfd_target structure. 
+	* coff-i860.c: Initialise new field of bfd_target structure. 
+	* coff-i960.c: Use CREATE_LITTLE_COFF_TARGET_VEC.
+	* coff-m68k.c: Use CREATE_BIG_COFF_TARGET_VEC.
+	* coff-mcore.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC.
+	* coff-mips.c: Initialise new field of bfd_target structure. 
+	* coff-ppc.c: Initialise new field of bfd_target structure. 
+	* coff-rs6000.c: Initialise new field of bfd_target structure. 
+	* coff-sh.c:  Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC.
+	* coff-sparc.c: Use CREATE_BIG_COFF_TARGET_VEC.
+	* coff-tic30.c: Initialise new field of bfd_target structure. 
+	* coff-tic80.c: Use CREATE_LITTLE_COFF_TARGET_VEC.
+	* coff-w65.c:   Use CREATE_LITTLE_COFF_TARGET_VEC.
+	* coff-we32k.c: Use CREATE_BIG_COFF_TARGET_VEC.
+	* coff-z8k.c:   Use CREATE_BIG_COFF_TARGET_VEC.
+	* hppabsd-core.c: Initialise new field of bfd_target structure. 
+	* hpux-core.c: Initialise new field of bfd_target structure. 
+	* i386msdos.c: Initialise new field of bfd_target structure. 
+	* i386os9k.c: Initialise new field of bfd_target structure. 
+	* ieee.c: Initialise new field of bfd_target structure. 
+	* ihex.c: Initialise new field of bfd_target structure. 
+	* irix-core.c: Initialise new field of bfd_target structure. 
+	* mipsbsd.c: Initialise new field of bfd_target structure. 
+	* netbsd-core.c: Initialise new field of bfd_target structure. 
+	* oasys.c: Initialise new field of bfd_target structure. 
+	* osf-core.c: Initialise new field of bfd_target structure. 
+	* ppcboot.c: Initialise new field of bfd_target structure. 
+	* ptrace-core.c: Initialise new field of bfd_target structure. 
+	* sco5-core.c: Initialise new field of bfd_target structure. 
+	* som.c: Initialise new field of bfd_target structure. 
+	* srec.c: Initialise new field of bfd_target structure. 
+	* tekhex.c: Initialise new field of bfd_target structure. 
+	* trad-core.c: Initialise new field of bfd_target structure. 
+	* versados.c: Initialise new field of bfd_target structure. 
+	* vms.c: Initialise new field of bfd_target structure. 
+
+1999-07-19  Andreas Schwab  <schwab@suse.de>
+
+	* elflink.h (elf_bfd_final_link): Remove unused variables rel_hash
+	and rel_hdr.
+
+Sat Jul 17 02:28:28 1999  Mark P. Mitchell  <mark@codesourcery.com>
+
+	* elflink.h (elf_link_adjust_relocs): New function.
+	(elf_bfd_final_link): Use it.
+	(elf_link_input_bfd): Deal with the fact that there can be 
+	two relocation sections for a single section.
+	(elf_reloc_link_order): Likewise.
+
+	* elf32-mips.c (_bfd_mips_elf_final_link): Don't set GP for 
+	a relocateable object.
+	(_bfd_mips_elf_relocate_section): Handle relocateable links.
+
+1999-07-16  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* elf64-sparc.c (sparc64_elf_info_to_howto): Use ELF64_R_TYPE_ID.
+	(sparc64_elf_get_reloc_upper_bound,
+	sparc64_elf_get_dynamic_reloc_upper_bound,
+	sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
+	sparc64_elf_canonicalize_dynamic_reloc, sparc64_elf_write_relocs):
+	New functions.
+	(sparc64_elf_check_relocs, sparc64_elf_relocate_section): Use
+	ELF64_R_TYPE_ID/DATA where appropriate.
+
+1999-07-16  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* elf64-sparc.c (sparc64_elf_size_dynamic_sections): Remove
+	DT_SPARC_PLTFMT.
+
+1999-07-16  Ian Lance Taylor  <ian@zembu.com>
+
+	* elf32-mips.c (mips_elf_local_relocation_p): New static
+	function.
+	(mips_elf_next_lo16_addend): Call bfd_set_error on failure.
+	(mips_elf_calculate_relocation): Use mips_elf_local_relocation_p.
+	Always set *require_jalxp.
+	(mips_elf_stub_section_p): Mark abfd parameter as unused.
+	(_bfd_mips_elf_relocate_section): Only look for LO16 following
+	GOT16 if the GOT16 is against a local symbol.  Don't return false
+	for an undefined symbol.  If there is an overflow, assert that we
+	have a name.
+
+1999-07-16  Andreas Schwab  <schwab@suse.de>
+
+	* elflink.h (elf_link_record_local_dynamic_symbol): Remove unused
+	variables `link' and `elfsec'.
+	(elf_bfd_final_link): Remove unused variable `os'.
+
+Thu Jul 15 17:55:31 1999  Mark P. Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (_bfd_mips_elf_modify_segment_map): Don't require
+	a PT_PHDR program headers.
+	(_bfd_mips_elf_final_link): Don't assume there are going to be
+	section symbols when we're not building a shared object.
+	(_bfd_mips_elf_check_relocs): Make sure we have a GOT when
+	we need one.
+
+1999-07-15  J.T. Conklin  <jtc@redback.com>
+
+	* config.bfd (i[3456]86-*-vxworks*): New target.
+
+1999-07-15  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (mips_elf_stub_section_p): New function.
+	(mips_elf_calculate_relocation): Handle MIPS16 stub functions.
+	(mips_elf_relocate_section): Adjust calling sequence for
+	mips_elf_calculate_relocation and mips_elf_perform_relocation.
+	(mips_elf_perform_relocation): Turn `jal' into `jalx' where
+	required.
+
+1999-07-15  Ian Lance Taylor  <ian@zembu.com>
+
+	* configure.in: Bump version number to 2.9.5.
+	* configure: Rebuild.
+
+Thu Jul 15 02:56:15 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case R_HPPA): Handle
+	64bit format.
+	(_bfd_elf_hppa_gen_reloc_type, case R_GOTOFF): Use base reloc type
+	to derive final type instead of hardwiring a selection.
+
+1999-07-14  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (mips_elf_obtain_contents): Swap 16-bit halves of
+	things relocated by R_MIPS16_GPREL.
+	(mips_elf_perform_relocation): Likewise.
+
+Wed Jul 14 15:23:19 1999  Jim Wilson  <wilson@cygnus.com>
+
+	* elfxx-target.h (elfNN_bed): Add elf_backend_want_dynbss.
+
+1999-07-14  Richard Henderson  <rth@cygnus.com>
+
+	* elf32-mips.c (struct mips_got_info): Add global_gotno.
+	(_bfd_mips_elf_size_dynamic_sections): Set it.
+	(_bfd_mips_elf_final_link): Re-sort; verify the got did not grow.
+	(mips_elf_sort_hash_table): Set max_non_got_dynindex based off
+	new argument max_local.
+
+1999-07-14  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (mips_elf_obtain_contents): Swap the 16-bit
+	subwords when handling an R_MIPS16_26 relocation.
+	(mips_elf_perform_relocation): Don't be paranoid abour right-shift
+	semantics.
+	
+	* elf32-mips.c (elf_mips16_gprel_howto): Adjust src_mask and
+	dst_mask to match reality.
+	(_bfd_mips_elf_calculate_relocation): Handle R_MIPS16_GPREL.
+	(mips_elf_obtain_contents): Use bfd_get.
+	(mips_elf_perform_relocation): Handle R_MIPS16_GPREL.
+	(mips_elf_relocate_section): Likewise.
+
+1999-07-13  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (mips_elf_calculate_relocation): Handle R_MIPS16_26.
+	(mips_elf_relocate_section): Adjust calling sequence for 
+	mips_elf_perform_relocation.
+	(mips_elf_perform_relocation): Take additional argument.  Handle
+	R_MIPS16_26.  Use bfd_put for convenience.
+
+1999-07-13  Richard Henderson  <rth@cygnus.com>
+
+	* elf.c (assign_file_positions_for_segments): Thinko last change.
+	Always overwrite p_flags.
+
+1999-07-13  Richard Henderson  <rth@cygnus.com>
+
+	* elf-bfd.h (struct elf_backend_data): Add want_dynbss.
+	* elflink.c (_bfd_elf_create_dynamic_sections): Only create
+	.dynbss and .rel[a].bss if want_dynbss.
+	* elfxx-target.h (elf_backend_want_dynbss): Provide default.
+
+1999-07-13  Richard Henderson  <rth@cygnus.com>
+
+	* elf.c (assign_file_positions_for_segments): Don't overwrite p_flags.
+
+1999-07-13  Richard Henderson  <rth@cygnus.com>
+
+	* elf-bfd.h (struct elf_link_local_dynamic_entry): New.
+	(struct elf_link_hash_table): Add dynlocal.
+	(_bfd_elf_link_lookup_local_dynindx): Prototype.
+	(_bfd_elf_link_adjust_dynindx): Delete.
+	(_bfd_elf_link_renumber_dynsyms): Prototype.
+	(_bfd_elf,link_record_local_dynamic_symbol): Prototype.
+	* elfcode.h (elf_link_record_local_dynamic_symbol): New alias.
+	* elflink.c (_bfd_elf_link_adjust_dynindx): Delete.
+	(_bfd_elf_link_lookup_local_dynindx): New function.
+	(elf_link_renumber_hash_table_dynsyms): New function.
+	(_bfd_elf_link_renumber_dynsyms): New function.
+	* elflink.h (elf_link_record_local_dynamic_symbol): New function.
+	(struct elf_assign_sym_version_info): Delete removed_dynamic.
+	(bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output
+	instead of elf_link_remove_section_and_adjust_dynindices.
+	Remove removed_dynamic code.  Use _bfd_elf_link_renumber_dynsyms.
+	(elf_link_assign_sym_version): Remove removed_dynamic code.
+	(elf_link_renumber_dynsyms): Delete.
+	(elf_bfd_final_link): Install section and local symbols into .dynsym.
+
+	* elf32-m68k.c (elf_m68k_adjust_dynindx): Delete.
+	(elf_m68k_size_dynamic_sections): Don't set section dynindicies.
+	(elf_m68k_finish_dynamic_sections): Don't write section dynsyms.
+	* elf32-mips.c: Similarly.
+	* elf32-ppc.c: Similarly.
+	* elf32-sparc.c: Similarly.
+	* elf64-alpha.c: Similarly.
+	* elf64-sparc.c: Similarly.
+
+1999-07-13  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (mips_elf_calculate_relocation): Do not complain
+	when _gp_disp is undefined.  Do not check R_MIPS_LO16 for overflow
+	when the relocation is against _gp_disp.
+
+1999-07-12  Mark Mitchell  <mark@codesourcery.com>
+
+	* dwarf2.c (read_attribute): Support DW_FORM_ref8.
+	* elf32-mips.c (mips_elf_link_hash_entry): Change mips_32_relocs
+	to possibly_dynamic_relocs.  Adjust usage throughout code.
+	(elf_mips_howto_table): Handle R_MIPS_64 correctly.
+	(elf_mips_ctor64_howto): Likewise.
+	(mips_elf_calculate_relocation): Handle R_MIPS_64 like R_MIPS_32.
+	Adjust indentation.
+	(mips_elf_relocate_section): Handle R_MIPS_64 in 32-bit mode.
+	(_bfd_mips_elf_check_relocs): Handle R_MIPS_64 like R_MIPS_32.
+	Use MIPS_ELF_GOT_SIZE to calculate the size of GOT entries.
+	* elf64-mips.c (elf_backend_may_use_rel_p): Define.
+
+1999-07-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* Makefile.am: Rebuild dependencies.
+	* Makefile.in: Rebuild.
+
+	* bfd-in.h: Remove tests of COFF_IMAGE_WITH_PE.
+	* bfd-in2.h: Rebuild.
+
+	* Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
+	as appropriate.  Use EMPTY_HOWTO as appropriate.  Fill in
+	structure initializations.  Add casts.
+	* reloc.c (EMPTY_HOWTO): Define.
+	* bfd-in2.h: Rebuild.
+	* coff-h8300.c (h8300_reloc16_extra_cases): Remove useless
+	comparisons against 0.
+	* elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Change
+	previous_ibfd_e_flags to unsigned long.
+	* vms.h (struct vms_private_data_struct): Change section_count to
+	unsigned.
+	* vms-gsd.c (_bfd_vms_slurp_gsd): Change psect_idx to unsigned.
+	(_bfd_vms_write_gsd): Change symnum to unsigned.
+	* vms-hdr.c (_bfd_vms_write_hdr): Change symnum to unsigned.
+	* vms-tir.c (etir_sta): Change psect to unsigned.
+	(alloc_section): Change idx to unsigned.
+	(tir_sta, tir_ctl): Change psect to unsigned.
+	(_bfd_vms_write_tir): Change len and before to bfd_size_type.
+	* vms.c (priv_section_count): Change to unsigned.
+
+1999-07-12  Andreas Schwab  <schwab@suse.de>
+
+	* elf32-m68k.c: Add some ATTRIBUTE_UNUSED.
+	* m68klinux.c: Likewise.
+
+1999-07-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* Many files: Changes to avoid gcc warnings: Remove unused local
+	variables.  Add default case to enum switches.
+	* coff-arm.c (bfd_arm_allocate_interworking_sections): Only
+	compile if not COFF_IMAGE_WITH_PE.
+	(record_arm_to_thumb_glue, record_thumb_to_arm_glue): Likewise.
+	(bfd_arm_get_bfd_for_interworking): Likewise.
+	(bfd_arm_process_before_allocation): Likewise.
+	* epoc-pei-arm.c: Don't rename bfd_arm functions.
+	* pei-arm.c: Likewise.
+	* elf32-mips.c (mips_elf_link_hash_table_create): Don't declare.
+	(MIPS_ELF_ADD_DYNAMIC_ENTRY): Correct last change.
+	(mips_elf_got16_entry): Put parens around & in body of ==.
+	(mips_elf_calculate_relocation): Correct test for empty string.
+	* vms-gsd.c: Use _bfd_error_handler rather than fprintf to
+	stderr.
+	* vms-misc.c (_bfd_vms_length_hash_symbol): Correct sprintf
+	format.
+
+1999-07-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
+	as appropriate.  Fill in structure initializations.  Add variable
+	initializations.  Add casts.
+	* dwarf1.c (parse_line_table): Change eachLine to unsigned long.
+	(dwarf1_unit_find_nearest_line): Change i to unsigned long.
+
+	* elf.c (bfd_elf_hash): Change parameter from unsigned char * to
+	char *.
+	* elf-bfd.h (bfd_elf_hash): Update declaration.
+	* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove casts
+	when calling bfd_elf_hash.
+
+1999-07-11  Mark Mitchell  <mark@codesourcery.com>
+
+	* libbfd.c (bfd_put_8): Make it of type `void'.
+	* bfd-in2.h: Regenerated.
+	* elf32-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Conditionalize
+	for 32-bit hosts.
+	(_bfd_mips_elf_final_link): Likewise.
+
+	* elflink.h (elf_link_read_relocs_from_section): Be type-correct.
+
+Thu Jul  8 12:32:23 1999  John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+	* config.bfd (hppa*-*-linux-gnu*): New target
+
+1999-07-07  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf-bfd.h (_bfd_mips_elf_section_from_shdr): Constify.
+	(_bfd_mips_elf_create_dynamic_sections): New function.
+	(_bfd_mips_elf_add_symbol_hook): Likewise.
+	(_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
+	(_bfd_mips_elf_finish_dynamic_symbol): Likewise.	
+	(_bfd_mips_elf_finish_dynamic_sections): Likewise.
+	(_bfd_mips_elf_gc_mark_hook): Likewise.
+	(_bfd_mips_elf_gc_sweep_hook): Likewise.
+	(_bfd_mips_elf_always_size_sections): Likewise.
+	(_bfd_mips_elf_size_dynamic_sections): Likewise.
+	(_bfd_mips_elf_check_relocs): Likewise.
+	(_bfd_mips_elf_link_hash_table_create): Likewise.
+	(_bfd_mips_elf_print_private_data): Likewise.
+	(_bfd_mips_elf_link_output_symbol_hook): Likewise.
+	(_bfd_mips_elf_final_link): Likewise.
+	(_bfd_mips_elf_additional_program_headers): Likewise.
+	(_bfd_mips_elf_modify_segment_map): Likewise.
+	(_bfd_mips_elf_relocate_section): Likewise.
+	* elf32-mips.c (mips_elf32_object_p): Move contents into
+	_bfd_mips_elf_object_p.
+	(mips_elf_additional_program_headers): Rename to
+	_bfd_mips_elf_additional_program_headers.
+	(mips_elf_modify_segment_map): Rename to
+	_bfd_mips_elf_modify_segment_map.
+	(elf_mips_abi_name): Change prototype.
+	(mips_elf32_section_from_shdr): Merge into
+	_bfd_mips_elf_section_from_shdr.
+	(mips_elf32_section_processing): Merge into
+	_bfd_mips_elf_section_processing.
+	(mips_elf_final_link): Rename to _bfd_mips_elf_final_link.  Invoke
+	the right back-end ELF linker.
+	(mips_elf_relocate_section): Rename to
+	_bfd_mips_elf_relocate_section.  Clean up.  Adjust for 64-bit code.
+	(mips_elf_link_output_symbol_hook): Rename to
+	_bfd_mips_elf_link_output_symbol_hook.
+	(mips_elf_create_dynamic_section): Rename to
+	_bfd_mips_elf_create_dynamic_section.
+	(mips_elf_check_relocs): Rename to _bfd_mips_elf_check_relocs.
+	Adjust for 64-bit code.  Use mips_elf_got_section.
+	(mips_elf_adjust_dynamic_symbol): Rename to
+	_bfd_mips_elf_adjust_dynamic_symbol.  Use
+	mips_elf_allocate_dynamic_relocations.
+	(mips_elf_finish_dynamic_symbol): Rename to
+	_bfd_mips_elf_finish_dynamic_symbol.  Use mips_elf_got_section.
+	Adjust for 64-bit code.
+	(mips_elf_finish_dynamic_sections): Rename to
+	_bfd_mips_elf_finish_dynamic_sections.  Adjust for 64-bit code.
+	(mips_elf_always_size_sections): Rename to
+	_bfd_mips_elf_always_size_sections.
+	(mips_elf_add_symbol_hook): Rename to
+	_bfd_mips_elf_add_symbol_hook.
+	(mips_elf_next_lo16_addend): Constify.
+	(mips_elf_calculate_relocation): Likewise.
+	(mips_elf_obtain_contents): Likewise.
+	(mips_elf_perform_relocation): Likewise.
+	(mips_elf_create_dynamic_relocation): Likewise.
+	(mips_elf_allocate_dynamic_relocations): New function.
+	(MIPS_ELF_REL_DYN_SECTION_NAME): New macro.
+	(MIPS_ELF_REL_SIZE): Likewise.
+	(MIPS_ELF_DYN_SIZE): Likewise.
+	(MIPS_ELF_GOT_SIZE): Likewise.
+	(MIPS_ELF_SYM_SIZE): Likewise.
+	(MIPS_ELF_LOG_FILE_ALIGN): Likewise.
+	(MIPS_ELF_GET_WORD): Likewise.
+	(MIPS_ELF_PUT_WORD): Likewise.
+	(MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise.
+	(STUB_LW): Conditionalize for 64-bit value.
+	(elf_mips_howto_table): Add R_MIPS_HIGHER and R_MIPS_HIGHEST
+	entries.
+	(_bfd_mips_elf_merge_private_bfd_data): Merge e_ident[EI_CLASS].
+	Check it for inconsistency.
+	(_bfd_mips_elf_print_private_bfd_data): Print ABI=64 for 64-bit
+	ABI.
+	(_bfd_mips_elf_fake_sections): Remove duplicate handling of
+	.msym. 
+	(mips_elf_global_got_index): Use MIPS_ELF_GOT_SIZE.
+	(mips_elf_got_offset_from_index): Use misp_elf_got_section.
+	(mips_elf_create_local_got_entry): Use MIPS_ELF_GOT_SIZE.
+	(mips_elf_local_got_index): Likewise.
+	(mips_elf_got_page): Likewise.
+	(mips_elf_got_info): Likewise.
+	(mips_elf_create_dynamic_relocation): Handle 32-bit/64-bit split.
+	(ELF_DYNAMIC_INTERPRETER): Handle 64-bit code.
+	(mips_elf_create_dynamic_sections): Use MIPS_ELF_LOG_FILE_ALIGN,
+	instead of constant `2'.
+	(mips_elf_create_got_section): Tidy.  Use MIPS_ELF_GOT_SIZE.
+	(mips_elf_create_msym_section): Use MIPS_ELF_LOG_FILE_ALIGN.
+	(mips_elf_size_dynamic_sections): Use
+	MIPS_ELF_REL_DYN_SECTION_NAME, MIPS_ELF_GOT_SIZE,
+	MIPS_ELF_ADD_DYNAMIC_ENTRY.  Remove #if 0'd code.
+	Adjust all releveant entries in elf backend table.
+	* elf64-mips.c (mips_elf64_section_from_shdr): Remove.
+	(mips_elf64_section_processing): Likewise.
+	Adjust elf backend entries to use _bfd_mips_elf variants now
+	publicly available.
+	
+	* elflink.h (elf_link_create_dynamic_sections): Handle non-standard
+	hash-entry sizes.
+	(size_dynamic_sections): Likewise.
+	(elf_link_output_extsym): Likewise.
+	* elf.c: (elf_fake_sections): Likewise.
+	* libbfd.c (bfd_get): New macro.
+	(bfd_put): Likewise.
+	* bfd-in2.h: Regenerated.
+
+1999-07-07  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf-bfd.h (elf_size_info): Add hash_entry_size,
+	int_rels_per_ext_rel, swap_dyn_out, swap_reloc_in, swap_reloc_out,
+	wap_reloca_in, and swap_reloca_out. 
+	* elflink.h (elf_link_read_relocs_from_section): Adjust to handle
+	multiple internal relocations per external relocation.
+	(link_read_relocs): Likewise.
+	(elf_bfd_final_link): Likewise.
+	(elf_link_input_bfd): Likewise.
+	(elf_gc_mark): Likewise.
+	(elf_gc_smash_unused_vtentry_relocs): Likewise.
+	* elfcode.h (elf_swap_dyn_out): Adjust type to match
+	elf_swap_dyn_in.
+	(size_info): Add entries for new fields.
+	* elf64-mips.c (mips_elf64_swap_reloc_out): Enable.
+	(mips_elf64_be_swap_reloc_in): New function.
+	(mips_elf64_be_swap_reloc_out): Likewise.
+	(mips_elf64_be_swap_reloca_in): Likewise.
+	(mips_elf64_be_swap_reloca_out): Likewise.
+	(mips_elf64_size_info): Add entries for new fields.
+	
+1999-07-07  Ian Lance Taylor  <ian@zembu.com>
+
+	* elflink.h (elf_bfd_final_link): Assert that section reloc_count
+	field equals the new rel_count field.
+	(elf_link_input_bfd): When doing a relocateable link, use the new
+	rel_count field rather than the reloc_count field.
+	(elf_reloc_link_order): Likewise.
+	(elf_finish_pointer_linker_section): Likewise.
+
+	Based on patch from H.J. Lu <hjl@gnu.org>:
+	* elflink.h (elf_merge_symbol): Permit a non-weak definition in a
+	shared library to override a weak definition in a regular object.
+
+Tue Jul  6 10:23:39 1999  Jeffrey A Law  (law@cygnus.com)
+
+        * libhppa.h: Revert July 2, 1999 patch.
+
+	* elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): T mode selectors
+	need to generate DLTIND relocations, not DLTREL relocations.
+
+1999-07-05  Nick Clifton  <nickc@cygnus.com>
+
+	* coffcode.h (coff_set_arch_mach_hook): Recognise arm 5
+	architectures. 
+	(coff_set_flags): Recognise arm 5 architectures.
+
+	* cpu-arm.c: Add support for strongarm and arm9 cpus.
+	Add support for armv5 architecture.
+
+	* archures.c: Add bfd_mach_arm_5 and bfd_mach_arm_5T.
+	
+	* reloc.c: Add new, assembler only, ARM reloc:
+	BFD_RELOC_ARM_ADRL_IMMEDIATE.
+	
+	* bfd-in2.h: Regenerate.
+
+1999-07-02  Mark Mitchell  <mark@codesourcery.com>
+
+	* dwarf2.c (parse_comp_unit): Add ABBREV_LENGTH parameter.
+	(_bfd_dwarf2_find_nearest_line): Add ADDR_SIZE parameter.
+	* elf.c (_bfd_elf_find_nearest_line): Pass it.
+	* elf32-arm.h (elf32_arm_find_nearest_line): Likewise.
+	* elf32-mips.c (ABI_64_P): New macro.
+	(IRIX_COMPAT): We are IRIX6-compatible if ABI_64_P.
+	(_bfd_mips_elf_find_nearest_line): Adjust call to
+	_bfd_dwarf2_find_nearest_line.
+	* libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype.
+	* libbfd.h: Regenerated.
+
+1999-07-02  Ian Lance Taylor  <ian@zembu.com>
+
+	* config.bfd: Add * at the end of i[3456]86-*-unixware.
+
+Fri Jul  2 12:21:10 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* libhppa.h (HPPA_R_ARG_RELOC): Delete.
+	(HPPA_R_CONSTANT, HPPA_R_ADDEND): Likewise.
+
+1999-07-01  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf-bfd.h (bfd_elf_section_data): Add rel_count and rel_count2
+	fields.
+	(_bfd_elf_init_reloc_shdr): New function.
+	* elf.c (_bfd_elf_new_section_hook): Use bfd_zalloc, rather than
+	bfd_alloc followed by memset.
+	(_bfd_elf_init_reloc_shdr): New function, split out from ...
+	(elf_fake_sections): Here.
+	(assign_section_numbers): Assign section numbers for the second
+	relocation section, if required.
+	* elflink.h (elf_link_output_relocs): New function.
+	(elf_link_size_reloc_section): Likewise.
+	(elf_bfd_final_link): Use elf_link_size_reloc_section.
+	(elf_link_input_bfd): Use elf_link_output_relocs.
+	
+	* elf32-mips.c (_bfd_mips_elf_fake_sections): Use
+	_bfd_elf_init_reloc_shdr to initialize rel_hdr2.
+
+Thu Jul  1 13:58:48 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle R_PCREL_CALL
+	with 22bit format.
+
+1999-06-28  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (mips_elf_got_info): Move declaration before
+	prototypes.  Change global_gotsym to be a pointer to a hash entry,
+	rather than a number index.
+	(mips_elf_link_hash_entry): Move declaration before prototypes.
+	(mips_elf_irix6_finish_dynamic_symbol): New function.
+	(mips_elf_sign_extend): Likewise.
+	(mips_elf_high): Likewise.
+	(mips_elf_higher): Likewise.
+	(mips_elf_highest): Likewise.
+	(mips_elf_global_got_index): Likewise.
+	(mips_elf_local_got_index): Likewise.
+	(mips_elf_got_offset_from_index): Likeiwse.
+	(mips_elf_record_global_got_symbol): Likewise.
+	(mips_elf_got_page): Likewise.
+	(mips_elf_next_lo16_addend): Likewise.
+	(mips_elf_calculate_relocation): Likewise.
+	(mips_elf_obtain_contents): Likewise.
+	(mips_elf_perform_relocation): Likewise.
+	(mips_elf_assign_gp): Likewise.
+	(mips_elf_sort_hash_table_f): Likewise.
+	(mips_elf_sort_hash_table): Likewise.
+	(mips_elf_got_section): Likewise.
+	(mips_elf_got_info): Likewise.
+	(mips_elf_create_local_got_entry): Likewise.
+	(mips_elf_got16_entry): Likewise.
+	(mips_elf_create_dynamic_relocation): Likewise.
+	(elf_mips_howto_table): Add description of R_MIPS_SCN_DISP.
+	(mips_elf_final_gp): Use mips_elf_assign_gp.
+	(_bfd_mips_elf_symbol_processing): Don't move SHN_COMMON symbols
+	into SHN_SCOMMON automatically on IRIX6.
+	(mips_elf_add_symbol_hook): Likewise.
+	(mips_elf_relocate_section): Rewrite, using
+	mips_elf_calculate_relocation and mips_elf_perform_relocation.
+	(mips_elf_create_dynamic_section): Use MIPS_ELF_STUB_SECTION_NAME.
+	Don't deal with .rld_map on IRIX6.
+	(mips_elf_create_got_section): Adjust use of global_gotsym.  Set
+	section flags appropriately for .got.
+	(mips_elf_check_relocs): Handle IRIX6 relocations making use of
+	the got.  Call mips_elf_record_global_got_symbol and allocate
+	local got space appropriately.
+	(mips_elf_size_dynamic_sections): Use bfd_byte *, not unsigned
+	char *.  Rework calculation of GOT size.  Sort dynamic symbol
+	table entries so entries that do not require GOT entries appear at
+	the beginning.  Don't use DT_MIPS_HIPAGENO on IRIX6.  Remove dead
+	code dealing with DT_INIT and DT_FINI.  Remove fiddling with
+	global_gotsym.
+	(mips_elf_finish_dynamic_symbol): Adjust creation of global GOT
+	entries.
+	(mips_elf_finish_dynamic_symbol): Use
+	mips_elf_irix6_finish_dynamic_symbol.
+	(mips_elf_finish_dynamic_sections): Correct off-by-one error
+	setting DT_MIPS_UNREFEXTNO.  Adjust setting of DT_MIPS_GOTSYM for
+	change to global_gotsym.  Set DT_MIPS_OPTIONS on IRIX6.
+		
+1999-06-30  Ian Lance Taylor  <ian@zembu.com>
+
+	* elf32-mips.c (mips_elf_final_link): Don't set CPIC when doing a
+	relocateable link.  From Ralf Baechle <ralf@uni-koblenz.de>.
+
+1999-06-04  Philip Blundell  <philb@gnu.org>
+
+	* elf32-arm.h (elf_backend_got_header_size): Define.
+	(elf_backend_plt_header_size): Likewise.
+
+1999-06-28  Jim Pick  <jim@jimpick.com>
+
+	* elf32-arm.h (elf32_arm_relocate_section): Mind no_undefined
+
+Tue Jun 29 02:25:03 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* elf-hppa.c (elf_hppa_howto_table): Use bfd_elf_generic_reloc as
+	relocation function.
+	* elf32-hppa.c (hppa_elf_reloc): Kill unused/unwanted function.
+
+1999-06-27  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (MIPS_ELF_SRDATA_SECTION_NAME): New macro.
+	(MIPS_ELF_OPTIONS_SECTION_NAME): Likewise.
+	(MIPS_ELF_STUB_SECTION_NAME): Likewise.
+	(_bfd_mips_elf_section_from_shdr): Use them.
+	(_bfd_mips_elf_fake_sections): Likewise.  Add .srdata to the list
+	of GP-relative sections.
+	(_bfd_mips_elf_set_section_contents): Use them.
+	(_bfd_mips_elf_section_processing): Share code between .sdata and
+	.lit4/.lit8 sections.  Set appropriate flags for .srdata.
+	(mips_elf_additional_program_headers): Add handling for
+	PT_MIPS_OPTIONS segment on IRIX6.
+	(mips_elf_modify_segment_map): Likeiwse.
+	(mips_elf_final_link): Set EF_MIPS_CPIC when required by the ABI.
+	Include the options sections on IRIX6.  Don't look for GP-relative
+	sections by name; use SHF_MIPS_GPREL instead.
+	(ELF_DYNAMIC_INTERPRETER): Adjust to use /usr/lib32/libc.so.1 for
+	the N32 ABI.
+	(mips_elf_create_dynamic_sections): Don't muck about with section
+	alignments and such on IRIX6.
+	(mips_elf_adjust_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME.
+	(mips_elf_size_dynamic_sections): Likewise. Adjust to handle the
+	fact that ELF_DYNAMIC_INTERPRETER is no longer a constant.  Use
+	bfd_zalloc rather than bfd_alloc and memset.
+	(mips_elf_finish_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME.
+	Don't assert the existence of .rld_map on IRIX6.
+	(mips_elf_finish_dynamic_sections): Use MIPS_ELF_STUB_SECTION_NAME.
+		
+	* elf32-mips.c (mips_elf_adjust_dynindx): Remove.
+	(mips_elf_size_dynamic_sections): Use _bfd_elf_link_adjust_dynindx
+	instead.
+
+1999-06-26  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (mips_elf_swap_msym_in): New function.
+	(mips_elf_swap_msym_out): New function.
+	(mips_elf_create_msym_section): Likewise.
+	(MIPS_ELF_MSYM_SECTION_NAME): New macro.
+	(_bfd_mips_elf_final_write_processing): Set sh_link for .msym.
+	(_bfd_mips_elf_section_from_shdr): Reject an SHT_MIPS_MSYM
+	section not named .msym.
+	(_bfd_mips_elf_fake_sections): Use MIPS_ELF_MSYM_SECTION_NAME, not
+	.msym directly.  Set appropriate attributes for the .msym
+	section.
+	(mips_elf_link_hash_entry): Add min_dyn_reloc_index field.
+	(mips_elf_link_hash_newfunc): Clear it.
+	(mips_elf_create_dynamic_sections): Create the .msym section
+	on IRIX6.
+	(mips_elf_size_dynamic_sections):  Allocate space for the
+	.msym section.  Add a DT_MIPS_MSYM entry.
+	(mips_elf_finish_dynamic_symbol): Write out a .msym entry for
+	the symbol.
+	(mips_elf_finish_dynamic_sections): Assign a value for
+	DT_MIPS_MSYM.  Add .msym entries for the section symbols as well.
+
+	* elf32-mips.c (irix_compat_t): New enumeration.
+	(ABI_N32_P): New macro.
+	(IRIX_COMPAT): Likewise.
+	(SGI_COMPAT): Implement in terms of IRIX_COMPAT.
+	(mips_elf_relocate_section): Fix typo.
+	
+1999-06-26  Mumit Khan  <khan@xraylith.wisc.edu>
+
+	* peicode.h (coff_swap_scnhdr_out): Mark non readonly BFD sections
+	as writable PE sections.
+
+1999-06-26  David Mosberger  <davidm@hpl.hp.com>
+
+	* dwarf2.c (struct arange): New type.
+	(struct comp_unit): Replace LOW and HIGH by member ARANGE.
+	(arange_add): New function.
+	(decode_line_info): Keep track of address ranges that a compilation
+	unit covers.
+	(comp_unit_contains_address): Return true if address is contained
+	in _any_ of the address ranges associated with a compilation unit.
+	(_bfd_dwarf2_find_nearest_line): Call comp_unit_find_nearest_line
+	on the first comp_unit that contains the address.
+
+1999-06-26  David Mosberger  <davidm@hpl.hp.com>
+
+	* dwarf2.c (struct dwarf2_debug): Add member dwarf_line_buffer.
+	(decode_line_info): Add variable STASH and initialize it to point
+	to the per-bfd dwarf2_debug info.  Remove static variable
+	dwarf_line_buffer and use stash->dwarf_line_buffer in its place.
+
+1999-06-26  Ian Lance Taylor  <ian@zembu.com>
+
+	* elflink.h (elf_link_output_extsym): It's OK for a -Bsymbolic
+	shared library to have an undefined symbol.
+
+	From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>:
+	* elf32-ppc.c (ppc_elf_relocate_section): Fix last patch.
+
+Thu Jun 24 20:59:11 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* elf-hppa.c (elf_hppa_final_write_processing): New function.
+	* elf32-hppa.c: Remove everything related to symbol extension
+	sections & records.  Use the common elf_hppa_final_write_processing.
+
+1999-06-22  Mark Mitchell  <mark@codesourcery.com>
+
+	* elflink.h (size_dynamic_sections): Use user-specified init/fini
+	functions instead of _init/_fini if requested.
+
+1999-06-23  Ian Lance Taylor  <ian@zembu.com>
+
+	* elf.c (bfd_section_from_shdr): Avoid crashing on a bogus sh_link
+	field.
+
+1999-06-22  Ian Lance Taylor  <ian@zembu.com>
+
+	From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>:
+	* elf32-ppc.c (ppc_elf_size_dynamic_sections): Set unused dynindx
+	field to 0, not -1.
+	(ppc_elf_finish_dynamic_sections): Check for positive section
+	dynindx field, rather than comparing against -1.
+	(ppc_elf_relocate_section): Only return false if undefined_symbol
+	or reloc_overflow fail, not always upon encountering an error.
+
+1999-06-22  Mark Mitchell  <mark@codesourcery.com>
+
+	* elflink.h (link_read_relocs): Explicitly cast external_relocs to
+	bfd_byte * before performing pointer arithmetic.
+
+Tue Jun 22 13:06:25 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* elf-hppa.h: New file.  Common stuff for elf32 and elf64 PA
+	support.
+	* elf32-hppa.c: Include elf-hppa.h.
+	(ARCH_SIZE): Define.
+	(elf_hppa_reloc_type_lookup): Delete.  Found in the common code
+	now.
+	(elf32_hppa_info_to_howto): Similarly.
+	(elf_hppa_howto_table): Similarly.
+	(elf_hppa_reloc_type_lookup): Similarly.
+	(hppa_elf_gen_reloc_type): Similarly.
+	* elf32-hppa.h (ELF_HOWTO_TALBE, N_PARISC_RELOCS): Delete.
+
+1999-06-22  Nick Clifton  <nickc@cygnus.com>
+
+	* elf32-v850.c (v850_elf_final_link_relocate): Catch overflow
+	handling R_V850_22_PCREL relocation.
+
+1999-06-21  Ian Lance Taylor  <ian@zembu.com>
+
+	* coff-arm.c (arm_emit_base_file_entry): Explicitly declare return
+	type.
+
+Sun Jun 20 14:13:57 1999  Richard Henderson  <rth@cygnus.com>
+
+	* section.c (_bfd_strip_section_from_output): Ignore sections
+	DISCARDed by the link script.
+
+1999-06-19  Ian Lance Taylor  <ian@zembu.com>
+
+	* elflink.h (elf_link_remove_section_and_adjust_dynindices):
+	Remove unused local variable spp.
+
+	* xcofflink.c (bfd_xcoff_size_dynamic_sections): Don't crash if
+	the entry symbol is not set.
+
+Fri Jun 18 04:24:57 1999  Richard Henderson  <rth@cygnus.com>
+
+	* elf64-alpha.c (elf64_alpha_relocate_section): Don't adjust
+	GPDISP or LITUSE in a relocatable link.
+
+Thu Jun 17 21:24:43 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+	* dwarf1.c (alloc_dwarf1_unit): Allocate using bfd_zalloc.
+	* (alloc_dwarf1_func): Likewise.
+
+Wed Jun 16 03:09:57 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* libhppa.h: Fix various formatting errors.
+	(assemble_3); Rewrite using CATENATE.
+	(assemble_17): Fix various bugs.
+
+1999-06-16  Nick Clifton  <nickc@cygnus.com>
+
+	* elf32-mcore.c (R_MCORE_RAW): Fix definition.
+
+1999-06-15  Richard Henderson  <rth@cygnus.com>
+
+	* section.c (SEC_SHORT): Define.
+	* bfd-in2.h: Rebuild.
+
+1999-06-13  Mark Mitchell  <mark@codesourcery.com>
+
+	* elflink.h (elf_link_remove_section_and_adjust_dynindices):
+	Remove abfd parameter.  Use _bfd_strip_section_from_output.
+	(bfd_elf_size_dynamic_sections): Adjust callers accordingly.
+	
+	* elf-bfd.h (_bfd_elf_link_adjust_dynindx): New function.
+	* elflink.c (_bfd_elf_link_adjust_dynindx): Define it.
+	* elflink.h (elf_link_remove_section_and_adjust_dynindices): New
+	function.
+	(bfd_elf_size_dynamic_sections): Use it.
+
+1999-06-13  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* elf32-i386.c (elf_howto_table): Change R_386_PC8 from
+	complain_overflow_bitfield to complain_overflow_signed.
+
+1999-06-13  Mark Mitchell  <mark@codesourcery.com>
+
+	* elflink.h (elf_link_read_relocs_from_section): New function,
+	split out from ...
+	(elf_link_read_relocs): Here.  Use it for both relocation
+	sections.
+
+1999-06-12  Mark Mitchell  <mark@codesourcery.com>
+
+	* elfcode.h (elf_slurp_reloc_table_from_section): Don't assume
+	asect->reloc_count is valid.
+
+1999-06-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* elf32-mips.c (mips_elf32_section_processing): Permit a
+	SHT_MIPS_REGINFO section to have a size of 0.
+
+1999-06-12  David O'Brien  <obrien@freebsd.org>
+
+	* config.bfd (alpha*-*-freebsd*): New target.
+	(i[3456]86-*-freebsd*): Now defaults to ELF.
+
+1999-06-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* reloc.c (_bfd_relocate_contents): Permit bitfield relocations to
+	wrap if the relocation covers the high bit of an address.
+
+	* dwarf2.c (decode_line_info): Remove unused variable first_time.
+
+1999-06-10  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* elf64_sparc.c (sparc64_elf_relocate_section): Use R_SPARC_max_std
+	instead of R_SPARC_max.
+	(sparc64_elf_info_to_howto): Likewise.
+	* elf32_sparc.c (elf32_sparc_relocate_section): Likewise.
+	(elf32_sparc_info_to_howto): Likewise; handle vtable relocations.
+
+1999-06-07  Richard Henderson  <rth@cygnus.com>
+
+	* section.c (_bfd_strip_section_from_output): Remove output
+	sections with no initial link_order.
+
+1999-06-07  Nick Clifton  <nickc@cygnus.com>
+
+	* elf32-m88k.c (ELF_MAXPAGESIZE): Define.
+
+Mon Jun  7 11:49:43 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* Makefile.am (SOURCE_HFILES): Add missing headers.
+	* Makefile.in: Regenerated.
+
+1999-06-06  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf32-mips.c (_bfd_mips_elf_print_private_data): Recognize
+	the N32 ABI.
+
+1999-06-04  Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+	* elf32-ppc.c (ppc_elf_relocate_section): Don't barf on out of
+	range undefweak symbols.
+	* hash.c: Add missing comma after @xref{}
+	* linker.c: Likewise.
+
+1999-06-04  Nick Clifton  <nickc@cygnus.com>
+
+	* elfxx-target.h (ELF_MAXPAGESIZE): Produce an error message
+	if not defined.
+	* elf32-gen.c (ELF_MAXPAGESIZE): Define.
+	* elf32-i860.c (ELF_MAXPAGESIZE): Define.
+	* elf32-i960.c (ELF_MAXPAGESIZE): Define.
+	* elf64-gen.c (ELF_MAXPAGESIZE): Define.
+
+1999-06-04  Ian Lance Taylor  <ian@zembu.com>
+
+	* Makefile.am: Rebuild dependencies.
+	(BFD32_BACKENDS): Add dwarf1.lo.
+	(BFD32_BACKENDS_CFILES): Add dwarf1.c.
+	* Makefile.in: Rebuild.
+
+1999-06-04  Nick Clifton  <nickc@cygnus.com>
+
+	* Makefile.am: Add epoc-arm-pe target.
+	* Makefile.in: Regenerate.
+	* pe-arm.c: Only redefine interworking function names if they have
+	not already been redefined.
+	* pei-arm.c: Only redefine interworking function names if they have
+	not already been redefined.
+	* epoc-pe-arm.c: Redefine interworking function names to avoid a
+	name space clash.
+	* epoc-pei-arm.c: Redefine interworking function names to avoid a
+	name space clash.
+
+1999-06-03  Nick Clifton  <nickc@cygnus.com>
+
+	* elfxx-target.h (ELF_MAXPAGESIZE): Default to 0x1000 not 1.
+
+Fri Jun  4 10:05:11 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* elf.c (elf_fake_sections): Undo change of 1999-05-10.
+
+Fri Jun  4 03:10:49 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+	* elf32-sh.c (sh_elf_relax_delete_bytes): Fix setting of
+	start / stop for recalculating of r_addend of R_SH_SWITCH*.
+
+Fri Jun  4 02:53:13 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+	* elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH32
+	in other text sections.
+
+Fri Jun  4 02:29:34 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+	* libbfd.c (_bfd_generic_verify_endian_match): New function.
+	* libbfd-in.h (_bfd_generic_verify_endian_match): Declare.
+	* libbfd.h: Regenerate.
+	* coff-sh.c (sh_merge_private_data): Delete.
+	(coff_bfd_merge_private_bfd_data): Change to
+	_bfd_generic_verify_endian_match.
+	(elf32-sh.c): bfd_elf32_bfd_merge_private_bfd_data: Define.
+
+1999-06-03  Ulrich Drepper  <drepper@cygnus.com>
+
+	* elf32-arm.h: Fix typo: change ELF_MAXPAGE_SIZE to ELF_MAXPAGESIZE.
+
+1999-06-03  Ian Lance Taylor  <ian@zembu.com>
+
+	* bfd-in.h (bfd_elf32_arm_allocate_interworking_sections): Correct
+	prototype.
+	(bfd_elf32_arm_process_before_allocation): Likewise.
+	* bfd-in2.h: Rebuild.
+
+1999-06-03  David Mosberger  <davidm@hpl.hp.com>
+
+	* dwarf2.c (struct line_info): Add member END_SEQUENCE to keep
+	track of end_sequence markers.
+	(add_line_info): Add END_SEQUENCE arg.
+	(decode_line_info): Don't try to infer lo_pc and hi_pc from the
+	debug-line info---it doesn't work right if a compilation unit
+	consists of multiple discontiguous code-sequences.  It would be
+	worthwhile to optimize for the common case where a compilation
+	unit results in a contiguous set of code sequences, but this is
+	quite tricky to get right for arbitrary DWARF2 files.
+	(lookup_address_in_line_info_table): Don't use the last line entry
+	for a compilation unit for anything with an address higher than
+	this line entry.  Also, check for end_sequence markers to
+	correctly handle discontinuities.
+	(_bfd_dwarf2_find_nearest_line): When checking previously loaded
+	compilation units, check all compilation units with each->high==0
+	just like when reading compilation units.
+
+	* dwarf2.c (decode_line_info): Initialize table->files and
+	table->last_line to NULL to avoid segfaults due to random
+	values in these members.
+	(concat_filename): Check for out-of-range file number before
+	indexing filename table.  Segfaults suck.
+
+	* dwarf2.c (decode_line_info): Don't truncate address to least
+	significant 32 bits (breaks 64 bit targets).
+	(lookup_address_in_function_table): Ditto.
+	(comp_unit_contains_address): Ditto.
+
+1999-06-02  Mark Mitchell  <Mark Mitchell <mark@codesourcery.com>>
+
+	* elf32-mips.c (elf_mips_howto_table): Add R_MIPS_JALR.
+	* elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
+	(mips_elf64_howto_table_rela): Likewise.
+
+	* elfcode.h (elf_slurp_reloc_table_from_section): New function,
+	split out from ...
+	(elf_slurp_reloc_table): Here.  Use it to handle the case where a
+	single section has two associated relocation sections.
+
+1999-06-02  Mark Salter  <msalter@cygnus.com>
+
+	* coffcode.h (coff_set_alignment_hook): Set lma from s_vaddr if
+	COFF_WITH_PE defined.
+
+1999-06-02  Nick Clifton  <nickc@cygnus.com>
+
+	* pe-arm.c: Rename global arm interworking functions to avoid name
+	collision when all targets BFD is built.
+	* pei-arm.c: Ditto.
+
+1999-05-31  Mark Mitchell  <mark@codesourcery.com>
+
+	* elf-bfd.h (elf_backend_data): Remove use_rela_p.  Add
+	may_use_rel_p, may_use_rela_p, default_use_rela_p.
+	(bfd_elf_section_data): Add use_rela_p.
+	* elf.c (bfd_section_from_shdr): Set use_rela_p appropriately.
+	(_bfd_elf_new_section_hook): Likewise.
+	(elf_fake_sections): Use may_use_rela_p, etc., instead of
+	use_rela_p.
+	(_bfd_elf_copy_private_section_data): Copy use_rela_p.
+	* elfcode.h (write_relocs): Determine whether or not use rela
+	relocs based on the relocation section header.
+	* elflink.c (_bfd_elf_create_dynamic_sections): Use default_use_rela_p
+	instead of use_rela_p.
+	* elfxx-target.h (elf_backend_may_use_relp): New macro.
+	(elf_backend_may_use_rela_p): Likewise.
+	(elf_backend_default_use_rela_p): Likewise.
+	(elfNN_bed): Use them.
+
+Wed Jun  2 12:38:49 1999  Miodrag Vallat <miodrag@multimania.com>
+
+	* hosts/alphalinux.h (TRAD_CORE_EXTRA_SIZE_ALLOWED): Expand to 4096.
+
+Tue Jun  1 17:57:58 1999  Mark P. Mitchell  <mitchell@n02.acl.lanl.gov>
+
+	* reloc.c (BFD_RELOC_MIPS_SUB): New relocation.
+	(BFD_RELOC_MIPS_GOT_PAGE): Likewise.
+	(BFD_RELOC_MIPS_GOT_OFST): Likewise.
+	(BFD_RELOC_MIPS_GOT_DISP): Likewise.
+	* bfd-in2.h: Regenerated.
+	* libbfd.h: Likewise.
+	* elf32-mips.c (mips_info_to_howto_rela): New function.
+	(USE_REL): Adjust for new conventions.
+	(MINUS_ONE): New macro.
+	(elf_mips_howto_table): Add R_MIPS_SUB.
+	(mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, MIPS_GOT_OFST,
+	and MIPS_GOT_DISP.
+	(mips_elf_final_write_processing): Set sh_link, not sh_info, for a
+	.MIPS.content section.
+	(_bfd_mips_elf_fake_sections): Treat all sections that begin
+	with .MIPS.content as .MIPS.content sections.  Set
+	SHF_MNIPS_NOSTRIP for such section.
+	(elf_info_to_howto): Define to mips_info_to_howto_rela.
+	* elf64-mips.c (mips_r):  Add entries for MIPS_SUB, MIPS_GOT_PAGE,
+	MIPS_GOT_OFST, and MIPS_GOT_DISP.
+
+Wed Jun  2 11:51:12 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* vms-misc.c (_bfd_vms_hash_newfunc): Fix use of uninitialized
+	variable.
+
+	* elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Avoid ambigous
+	`else'.
+
+1999-05-30  Philip Blundell  <philb@gnu.org>
+
+	* elf32-arm.h (elf32_arm_relocate_section): Reinstate change of
+	1993-03-25 (!!).  Take into account the bitmasks for the reloc so
+	the addend does not overflow into the rest of the word.
+
+1999-05-29  Nick Clifton  <nickc@cygnus.com>
+
+	* bfd-in.h: Amend prototype for
+	bfd_elf32_arm_process_before_allocation .
+	* bfd-in.h: Regenerate.
+
+	* elfarm-oabi.c (NUM_ELEM): New macro: Compute the number of
+	elements in a fixed sized array.
+	(ARM_ELF_ABI_VERSION): Define.
+	(ARM_ELF_OS_ABI_VERSION): Define.
+	(R_ARM_THM_ABS5): Fix rightshift and size.
+	(R_ARM_THM_PC22): Fix size.
+	(R_ARM_PLT32): Define Howto.
+	(find_howto): New function: Locate a howto based on a reloc
+	number.
+	(elf32_arm_info_to_howto): Use find_howto if necessary.
+	(elf32_arm_reloc_map): Change type of field bfd_reloc_val to
+	bfd_reloc_code_real_type.
+	(elf32_arm_reloc_map[]): Add entries for BFD_RELOC_VTABLE_INHERIT
+	and BFD_RELOC_VTABLE_ENTRY.
+	(elf32_arm_reloc_type_lookup): Use find_howto if necessary.
+
+	* elfarm-nabi.c (NUM_ELEM): New macro: Compute the number of
+	elements in a fixed sized array.
+	(ARM_ELF_ABI_VERSION): Define.
+	(ARM_ELF_OS_ABI_VERSION): Define.
+	(R_ARM_THM_ABS5): Fix rightshift and size.
+	(R_ARM_THM_PC22): Fix size.
+	(elf32_arm_info_to_howto_rel): Rename to elf32_arm_info_to_howto.
+	(elf32_arm_reloc_map): Change type of field bfd_reloc_val to
+	bfd_reloc_code_real_type.
+
+	* elf32-arm.h (struct elf32_arm_link_hash_table): Add new field:
+	no_pipeline_knowledge.
+	(elf32_arm_link_hash_create): Initialise new field to zero.
+	(bfd_elf32_arm_process_before_allocation): Add new paraemter:
+	no_pipeline_knowledge.  Use this parameter to initialise the field
+	in the globals data structure.
+	(elf32_arm_final_link_relocate): Only add in pipeline offset if
+	no_pipeline_knowledge is false and the binary is from an old
+	toolchain.
+	(elf32_arm_merge_private_data): Generate an error if an attempt is
+	made to linl together big endian and little endian code.
+	(elf32_arm_post_process_headers): New function:  Initialise the
+	EI_OSABI and EI_ABIVERSION fields of the newly created ELF program
+	header.
+	(elf_backend_post_process_headers): Define.
+
+1999-05-28  Nick Clifton  <nickc@cygnus.com>
+
+	* elf-bfd.h (struct elf_backend_data): Add new field:
+	elf_backend_post_process_headers.
+
+	* elfxx-target.h (elf_backend_post_process_headers): Define to
+	NULL if not already defined.
+	(elfNN_bed): Initialise elf_backend_post_process_headers field.
+
+	* elf.c (prep_headers): Set the EI_OSABI and EI_ABIVERSION fields
+	to zero.
+	(_bfd_elf_compute_section_file_positions): Call
+	elf_backend_post_process_headers if defined.
+
+1999-05-28  Ian Lance Taylor  <ian@zembu.com>
+
+	* configure.in: Check whether getuid and getgid exist.
+	* archive.c: Define getuid and getgid as macros if HAVE_GETUID or
+	HAVE_GETGID are not defined, respectively.
+	(bfd_write_armap): Don't special case on _WIN32 for getuid and
+	getgid.
+	* configure.host: Set ac_cv_func_get{ug}id for *-*-windows*.
+	* configure, config.in: Rebuild.
+
+1999-05-28  Martin Dorey  <mdorey@madge.com>
+
+	* elf32-i960.c: New file.
+	* elf.c (prep_headers): Handle bfd_arch_i960.
+	* targets.c (bfd_target_vector): Add &bfd_elf32_i960_vec.
+	* config.bfd (i960-*-elf*): New target.
+	* configure.in (bfd_elf32_i960_vec): New target vector.
+	* Makefile.am (BFD32_BACKENDS): Add elf32-i960.lo.
+	(BFD32_BACKENDS_CFILES): Add elf32-i960.c.
+	* Makefile.in, aclocal.m4, configure: Rebuild.
+
+1999-05-27  Nick Clifton  <nickc@cygnus.com>
+
+	* elfarm-oabi.c (elf32_arm_howto_table): Add entry for
+	R_ARM_PLT32.
+	(find_howto): New function: Find entries in the
+	elf32_arm_howto_table.
+	(elf32_arm_info_to_howto): Use find_howto if the entry cannot be
+	computed simply.
+	(elf32_arm_reloc_type_lookup): Add lookup for
+	BFD_RELOC_ARM_PLT32.
+
+1999-05-25  Philip Blundell  <pb@nexus.co.uk>
+
+	* bfd/elf32-arm.h (elf32_arm_link_hash_newfunc): New function.
+	(elf32_arm_link_hash_table_create): Use above function as the
+	constructor for hash table entries.
+	(elf32_arm_relocate_section): Avoid crash when there is no output
+	section.
+	(elf32_arm_final_link_relocate): New parameter h.
+	(elf32_arm_relocate_section): Pass symbol hash entry to above
+ 	routine.
+	(elf32_arm_gc_sweep_hook, elf32_arm_check relocs): Correct
+	comments.
+
+1999-05-25  Catherine Moore  <clm@cygnus.com>
+
+        * coff-arm.c (coff_arm_relocate_section): Don't emit
+        base file entries for pc-relative values.
+
+1999-05-25  DJ Delorie  <dj@cygnus.com>
+
+	* peicode.h (coff_swap_sym_in): When we create the actual section
+	to reflect the not-there section C_SECTION symbols refer to,
+	change the symbol class to C_STAT as the section is now really
+	there.
+
+1999-05-24  Philip Blundell  <pb@nexus.co.uk>
+
+	* elf32-arm.h (elf32_arm_relocate_section): Undo change of
+ 	1999-03-25.
+
+Mon May 17 13:35:35 1999  Stan Cox  <scox@cygnus.com>
+
+	* coff-arm.c (_bfd_coff_arm_set_private_flags): Changed
+	F_PIC_INT to F_PIC.
+	* coffcode.h (coff_set_arch_mach_hook): Added F_ARM_2a, and
+	F_ARM_3M labels.  Changed F_PIC_INT to F_PIC.
+
+1999-05-16  Nick Clifton  <nickc@cygnus.com>
+
+	* coff-mcore.c (in_reloc_p): Reinstate.
+
+1999-05-15  Nick Clifton  <nickc@cygnus.com>
+
+	* reloc.c (BFD_RELOC_MCORE_RVA): Define.
+	* bfd-in2.h: Regenerate.
+	* coff-mcore.c (in_reloc_p): Remove defintion.
+	(mcore_coff_howto): Add IMAGE_REL_MCORE_RVA.
+	(mcore_coff_reloc_type_lookup): Map BFD_RELOC_RVA to
+	IMAGE_REL_MCORE_RVA.
+	(coff_mcore_rtype_to_howto): Add special processing for
+	IMAGE_REL_MCORE_RVA.
+	(coff_mcore_relocate_section): Add support for
+	IMAGE_REL_MCORE_RVA.
+	* elf32-mcore (mcore_elf_howto_): Add R_MCORE_RELATIVE.
+	(mcore_elf_reloc_type_lookup): Map BFD_RELOC_RVA to
+	R_MCORE_RELATIVE.
+	(mcore_elf_relocate_section): Delete redundant case labels.
+
+Fri May 14 10:59:55 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* elf32-arm.h (elf32_arm_relocate_section): Fix operator
+ 	precedence between bit-and and comparison.
+
+Thu May 13 09:45:23 1999  Joel Sherrill (joel@OARcorp.com)
+
+	* config.bfd (i[3456]86*-*-rtems*, m68k*-*-rtems*): Added to
+	list of target formats (targ_selvecs).
+	(i[3456]86*-*-rtemself*, mips*el-*-rtems*): New targets.
+	(powerpcle*-*rtems*, sh-*-rtemself*): New targets.
+
+1999-05-10  DJ Delorie  <dj@cygnus.com>
+
+	* ecoff.c (_bfd_ecoff_write_armap): give the symtab element a
+	reasonable mode until "ar x" is smart enough to skip it (fixes
+	gcc/libgcc.a builds on mips-ecoff targets
+
+	* coffcode.h (styp_to_sec_flags): Explain how COMDATs are supposed
+	to work.  Hack to support MS import libraries, which use different
+	COMDAT types than GNU.
+	(coff_slurp_symbol_table): C_SECTION symbols are local; they refer
+	to implied zero-length sections (see peicode below)
+	* coffgen.c (coff_get_normalized_symtab): Properly read long MS
+	filename symbols, which use one *or more* auxents.
+	* coffswap.h (coff_swap_aux_in): ditto
+	* peicode.h (coff_swap_sym_in): Build the implied zero-length
+	sections
+
+Tue May 11 15:51:58 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* elf32-v850.c (v850_elf_howto_table): Make partial_inplace false
+	for all relocations.
+
+1999-05-10  Catherine Moore  <clm@cygnus.com>
+
+        * bfd-in.h (bfd_arm_allocate_interworking_sections):  Static
+        if COFF_IMAGE_WITH_PE.
+        (bfd_arm_process_before_allocation): Likewise.
+        (bfd_arm_get_bfd_for_interworking): Likewise.
+        * coff-arm.c: Likewise.
+        * bfd-in2.h: Regenerate.
+        * configure.in (armpe_little_vec): Remove coff-arm.lo.
+        (armpe_big_vec): Likewise.
+        * configure: Rebuild.
+
+1999-05-10  Nick Clifton  <nickc@cygnus.com>
+
+	* elf.c (elf_fake_sections): Check for .rel. as start of rel
+	section, not just .rel.  Same for .rela.
+
+1999-05-07  Nick Clifton  <nickc@cygnus.com>
+
+	* coff-mcore.c (coff_mcore_relocate_section): Replace assert about
+	endianism with an error message.
+
+Thu May  6 17:09:09 1999  Fred Fish  <fnf@be.com>
+
+	* dwarf2.c (read_abbrevs): Change cast of dwarf_abbrev_buffer
+	assignment from "unsigned char *" to "char *".
+	(decode_line_info): Likewise for dwarf_line_buffer assignment.
+
+1999-05-05  Catherine Moore  <clm@cygnus.com>
+
+        * coff-arm.c (coff_arm_relocate_section):  Add one to
+        address of ARM_RVA32 thumb functions.
+
+1999-05-05  Catherine Moore  <clm@cygnus.com>
+
+        * elf32-m68k.c (elf32_m68k_set_private_flags): New.
+        (elf32_m68k_copy_private_bfd_data): New.
+        (elf32_m68k_merge_private_bfd_data): New.
+        (elf32_m68k_print_private_bfd_data): New.
+        (CPU32_FLAG): Define.
+        (PLT_CPU32_ENTRY_SIZE): Define.
+        (elf_cpu32_plt0_entry): Declare.
+        (elf_cpu32_plt_entry): Declare.
+        (elf_m68k_adjust_dynamic_symbol): Generate cpu32 plt entries.
+        (elf_m68k_finish_dynamic_symbol): Likewise.
+        (elf_m68k_finish_dynamic_sections): Likewise.
+        (elf_backend_plt_header_size): Remove definition.
+        (bfd_elf32_bfd_copy_private_bfd_data): Define.
+        (bfd_elf32_bfd_merge_private_bfd_data): Define.
+        (bfd_elf32_bfd_set_private_flags): Define.
+        (bfd_elf32_bfd_print_private_bfd_data): Define.
+
+Mon May  3 09:24:49 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* som.c (som_fixup_formats): Fix comments for R_SHORT_PCREL_MODE
+	and R_LONG_PCREL_MODE.
+
 1999-04-29  Nick Clifton  <nickc@cygnus.com>
 
 	* coff-mcore.c (coff_mcore_relocate_section): Fix typos.
@@ -29,7 +1367,7 @@
 	* libbfd.h: Rebuild.
 
 Sat Apr 17 20:55:15 1999  Catherine Moore  <clm@cygnus.com>
- 
+
 	* coff-arm.c (coff_arm_rtype_to_howto): Remove ARM26D transform.
 	(coff_arm_relocate_section):  Add ARM26D transform.  Only
 	change to ARM26D for relocateable links.
@@ -127,7 +1465,7 @@
 	* configure.in: Add support for MCore targets.
 	* configure: Regenerate.
 	* archures.c: Add support for MCore architecture.
-	* bfd-in2.h: Regenerate. 
+	* bfd-in2.h: Regenerate.
 	* coffcode.h: Add support for mcore-pe targets.
 	* elf.c: Add support for mcore-elf target.
 	* reloc.c: Add support for MCore relocs.
@@ -197,11 +1535,11 @@
 	TARGET_UNDERSCORE and USER_LABEL_PREFIX.
 	* pe-arm.h: Allow previous header files to override definition of
 	TARGET_LITTLE_SYM and TARGET_BIG_SYM.
-	* pei-arm.h: Allow previous header files to override definition of 
+	* pei-arm.h: Allow previous header files to override definition of
 	TARGET_LITTLE_SYM and TARGET_BIG_SYM.
 	* epoc-pe-arm.c: New file.  Support arm-epoc-pe target.
 	* epoc-pei-arm.c: New file.  Support arm-epoc-pei target.
-	
+
 1999-03-30  Nick Clifton  <nickc@cygnus.com>
 
 	* elf.c (elf_map_symbols): Handle the case where section
@@ -217,8 +1555,8 @@
 1999-03-25  Philip Blundell  <pb@nexus.co.uk>
 
 	* config.bfd: Eliminate redundancy in checks for Linux/ARM.
-	
-	* elf32-arm.h (elf32_arm_relocate_section): Take the rightshift into 
+
+	* elf32-arm.h (elf32_arm_relocate_section): Take the rightshift into
 	account when adjusting section symbols during a partial link.
 
 1999-03-24  Nick Clifton  <nickc@cygnus.com>
@@ -312,7 +1650,7 @@
 
 	The following patches are from: Scott Bambrough
 	<scottb@corelcomputer.com>
-	
+
 	* libaout.h (M_ARM6_NETBSD): Set to 143.
 
 	* reloc.c: Add ARM PIC relocs:   BFD_RELOC_ARM_GOT12,
@@ -331,7 +1669,7 @@
 	(elf32_arm_final_link_relocate): Change parameters so that entire
 	reloc is passed.  Add support for PIC relocs.
 	(elf32_arm_relocate_section): Pass entire reloc to
-	elf32_arm_final_link_relocate. 
+	elf32_arm_final_link_relocate.
 	(elf32_arm_check_relocs): Handle new PIC relocs.
 	(elf32_arm_adjust_dynamic_symbol): New function.
 	(elf32_arm_size_dynamic_sections): New function.
@@ -349,7 +1687,7 @@
 	(elf_backend_plt_readonly): Define.
 	(elf_backend_want_got_plt): Define.
 	(elf_backend_want_plt_sym): Define.
-	
+
 Wed Feb 17 12:02:26 1999  Stan Cox  <scox@cygnus.com>
 
 	* elf32-mips.c (_bfd_mips_elf_section_from_shdr): Make reginfo
@@ -357,12 +1695,12 @@
 	(_bfd_mips_elf_fake_sections): Likewise.
 
 Wed Feb 17 12:07:23 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
- 
+
         * elfarm-oabi.c (bfd_elf32_arm_allocate_interworking_sections,
         bfd_elf32_arm_get_bfd_for_interworking,
         bfd_elf32_arm_process_before_allocation): Define to avoid clash
         with elfarm-nabi.c.
- 
+
         * elf32-arm.h: Don't declare elf32_arm_info_to_howto.
         (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub,
         elf32_arm_find_nearest_line): Make them static.
@@ -446,7 +1784,7 @@
         * Makefile.am:  Use new files.
         * Makefile.in:  Regenerate.
         * configure.in:  Use new files.
-        * configure:  Regenerate.       
+        * configure:  Regenerate.
 
 1999-02-01  Nick Clifton  <nickc@cygnus.com>
 
@@ -519,13 +1857,13 @@
 	to F_PIC_INT.
 	* coffcode.h (coff_set_arch_mach_hook): Removed F_ARM_2a and
 	F_ARM_3M labels.  Changed F_PIC to F_PIC_INT.
-	
+
 1999-01-27  Nick Clifton  <nickc@cygnus.com>
 
 	* elf32-fr30.c (fr30_elf_howto_table): Fix name of R_FR30_48
-	relocation. 
+	relocation.
 	(fr30_final_link_relocate): Use computed value as result of
-	relocation. 
+	relocation.
 
 1999-01-26  Frank Ch. Eigler  <fche@cygnus.com>
 
@@ -553,7 +1891,7 @@
 	* archures.c,bfd-in2.h (bfd_mach_mips4111): New.
 	* cpu-mips.c: Add support for and independent 4111.
 	* elf32-mips.c (elf_mips_mach): E_MIPS_MACH_4111 -> bfd_mach_mips4111.
-	(_bfd_mips_elf_final_write_processing): 
+	(_bfd_mips_elf_final_write_processing):
 	bfd_mach_mips4111 -> E_MIPS_ARCH_3 | E_MIPS_MACH_4111.
 
 1998-12-15  Gavin Romig-Koch  <gavin@cygnus.com>
@@ -563,7 +1901,7 @@
 
 1998-12-12  Gavin Romig-Koch  <gavin@cygnus.com>
 
-	* elf32-mips.c (_bfd_mips_elf_final_write_processing): 
+	* elf32-mips.c (_bfd_mips_elf_final_write_processing):
 	Handle bfd_mach_mips4300.
 
 1998-12-11  Ulrich Drepper  <drepper@cygnus.com>
@@ -2839,7 +4177,7 @@
 	* elf32-v850.c (v850_elf_merge_private_bfd_data): Do not complain
 	when merging v850 code into v850e/v850ea code.  Do not initialise
 	output flags if the input is the default architecture.
-	
+
 Fri Feb  6 11:50:22 1998  Jeffrey A Law  (law@cygnus.com)
 
 	* elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): For BFD_RELOC_CTOR
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index a155311..834cf92 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -144,6 +144,7 @@
 	coff-w65.lo \
 	coff-z8k.lo \
 	cofflink.lo \
+	dwarf1.lo \
 	dwarf2.lo \
 	ecoff.lo \
 	ecofflink.lo \
@@ -158,6 +159,7 @@
 	elf32-hppa.lo \
 	elf32-i386.lo \
 	elf32-i860.lo \
+	elf32-i960.lo \
 	elf32-m32r.lo \
 	elf32-m68k.lo \
 	elf32-m88k.lo \
@@ -171,6 +173,8 @@
 	elf32-v850.lo \
 	elf32.lo \
 	elflink.lo \
+	epoc-pe-arm.lo \
+	epoc-pei-arm.lo \
 	hp300bsd.lo \
 	hp300hpux.lo \
 	som.lo \
@@ -262,6 +266,7 @@
 	coff-w65.c \
 	coff-z8k.c \
 	cofflink.c \
+	dwarf1.c \
 	dwarf2.c \
 	ecoff.c \
 	ecofflink.c \
@@ -276,6 +281,7 @@
 	elf32-hppa.c \
 	elf32-i386.c \
 	elf32-i860.c \
+	elf32-i960.c \
 	elf32-m32r.c \
 	elf32-m68k.c \
 	elf32-m88k.c \
@@ -289,6 +295,8 @@
 	elf32-v850.c \
 	elf32.c \
 	elflink.c \
+	epoc-pe-arm.c \
+	epoc-pei-arm.c \
 	hp300bsd.c \
 	hp300hpux.c \
 	som.c \
@@ -409,11 +417,11 @@
 ## This is a list of all .h files which are in the source tree.
 SOURCE_HFILES = \
 	aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
-	ecoffswap.h elf32-hppa.h \
-	elfcode.h genlink.h go32stub.h hppa_stubs.h libaout.h \
+	ecoffswap.h elf32-arm.h elf32-hppa.h elfcode.h elfcore.h \
+	elflink.h freebsd.h genlink.h go32stub.h hppa_stubs.h libaout.h \
 	libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
-	libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h \
-	som.h vms.h
+	libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h nlmswap.h \
+	ns32k.h peicode.h som.h vms.h
 
 HFILES = \
 	elf32-target.h elf64-target.h targmatch.h \
@@ -792,6 +800,9 @@
   $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
 cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
   libcoff.h
+dwarf1.lo: dwarf1.c $(INCDIR)/libiberty.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h
 dwarf2.lo: dwarf2.c $(INCDIR)/libiberty.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
@@ -829,16 +840,19 @@
 elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   elf32-target.h
-elf32-hppa.lo: elf32-hppa.c $(INCDIR)/bfdlink.h elf-bfd.h \
-  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  elf32-hppa.h libhppa.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \
-  hppa_stubs.h elf32-target.h
+elf32-hppa.lo: elf32-hppa.c elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+  $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h libhppa.h \
+  elf32-hppa.h elf-hppa.h hppa_stubs.h elf32-target.h
 elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
 elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   elf32-target.h
+elf32-i960.lo: elf32-i960.c elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+  $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
 elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
@@ -883,6 +897,12 @@
   elfcore.h elflink.h
 elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
+epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
+  $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+  $(INCDIR)/bfdlink.h coffcode.h peicode.h
+epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c coff-arm.c \
+  $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
+  libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h
 hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \
   aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
   $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 9258df1..72b5e81 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -104,6 +104,7 @@
 TDEFINES = @TDEFINES@
 USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
 USE_NLS = @USE_NLS@
+USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
 VERSION = @VERSION@
 WIN32LDFLAGS = @WIN32LDFLAGS@
 WIN32LIBADD = @WIN32LIBADD@
@@ -262,6 +263,7 @@
 	coff-w65.lo \
 	coff-z8k.lo \
 	cofflink.lo \
+	dwarf1.lo \
 	dwarf2.lo \
 	ecoff.lo \
 	ecofflink.lo \
@@ -276,6 +278,7 @@
 	elf32-hppa.lo \
 	elf32-i386.lo \
 	elf32-i860.lo \
+	elf32-i960.lo \
 	elf32-m32r.lo \
 	elf32-m68k.lo \
 	elf32-m88k.lo \
@@ -289,6 +292,8 @@
 	elf32-v850.lo \
 	elf32.lo \
 	elflink.lo \
+	epoc-pe-arm.lo \
+	epoc-pei-arm.lo \
 	hp300bsd.lo \
 	hp300hpux.lo \
 	som.lo \
@@ -381,6 +386,7 @@
 	coff-w65.c \
 	coff-z8k.c \
 	cofflink.c \
+	dwarf1.c \
 	dwarf2.c \
 	ecoff.c \
 	ecofflink.c \
@@ -395,6 +401,7 @@
 	elf32-hppa.c \
 	elf32-i386.c \
 	elf32-i860.c \
+	elf32-i960.c \
 	elf32-m32r.c \
 	elf32-m68k.c \
 	elf32-m88k.c \
@@ -408,6 +415,8 @@
 	elf32-v850.c \
 	elf32.c \
 	elflink.c \
+	epoc-pe-arm.c \
+	epoc-pei-arm.c \
 	hp300bsd.c \
 	hp300hpux.c \
 	som.c \
@@ -533,11 +542,11 @@
 
 SOURCE_HFILES = \
 	aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
-	ecoffswap.h elf32-hppa.h \
-	elfcode.h genlink.h go32stub.h hppa_stubs.h libaout.h \
+	ecoffswap.h elf32-arm.h elf32-hppa.h elfcode.h elfcore.h \
+	elflink.h freebsd.h genlink.h go32stub.h hppa_stubs.h libaout.h \
 	libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
-	libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h \
-	som.h vms.h
+	libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h nlmswap.h \
+	ns32k.h peicode.h som.h vms.h
 
 
 HFILES = \
@@ -613,7 +622,7 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = tar
+TAR = gtar
 GZIP_ENV = --best
 SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
 OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
@@ -1150,7 +1159,6 @@
 config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
 	$(SHELL) ./config.status --recheck
 
-
 elfarm-oabi.lo: elfarm-oabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
@@ -1322,6 +1330,9 @@
   $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
 cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
   libcoff.h
+dwarf1.lo: dwarf1.c $(INCDIR)/libiberty.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h
 dwarf2.lo: dwarf2.c $(INCDIR)/libiberty.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
@@ -1359,16 +1370,19 @@
 elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   elf32-target.h
-elf32-hppa.lo: elf32-hppa.c $(INCDIR)/bfdlink.h elf-bfd.h \
-  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  elf32-hppa.h libhppa.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \
-  hppa_stubs.h elf32-target.h
+elf32-hppa.lo: elf32-hppa.c elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+  $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h libhppa.h \
+  elf32-hppa.h elf-hppa.h hppa_stubs.h elf32-target.h
 elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
 elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   elf32-target.h
+elf32-i960.lo: elf32-i960.c elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+  $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
 elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
@@ -1413,6 +1427,12 @@
   elfcore.h elflink.h
 elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
+epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
+  $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+  $(INCDIR)/bfdlink.h coffcode.h peicode.h
+epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c coff-arm.c \
+  $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
+  libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h
 hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \
   aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
   $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4
index 4358000..39df10e 100644
--- a/bfd/aclocal.m4
+++ b/bfd/aclocal.m4
@@ -208,26 +208,58 @@
 AC_SUBST($1)])
 
 
-# serial 25 AM_PROG_LIBTOOL
-AC_DEFUN(AM_PROG_LIBTOOL,
-[AC_REQUIRE([AM_ENABLE_SHARED])dnl
-AC_REQUIRE([AM_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_RANLIB])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AM_PROG_LD])dnl
-AC_REQUIRE([AM_PROG_NM])dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-dnl
+# serial 35 AC_PROG_LIBTOOL
+AC_DEFUN(AC_PROG_LIBTOOL,
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+
+# Save cache, so that ltconfig can load it
+AC_CACHE_SAVE
+
+# Actually configure libtool.  ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+DLLTOOL="$DLLTOOL" AS="$AS" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+
+# Reload cache, that may have been modified by ltconfig
+AC_CACHE_LOAD
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 AC_SUBST(LIBTOOL)dnl
 
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+AC_DEFUN(AC_LIBTOOL_SETUP,
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_RANLIB])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_SYS_NM_PARSE])dnl
+AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+dnl
+
 # Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
@@ -256,37 +288,46 @@
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
   ;;
 
 *-*-cygwin*)
-  AM_SYS_LIBTOOL_CYGWIN
+  AC_SYS_LIBTOOL_CYGWIN
   ;;
 
 esac
 
-# Actually configure libtool.  ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
-DLLTOOL="$DLLTOOL" AS="$AS" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
-|| AC_MSG_ERROR([libtool configure failed])
+# enable the --disable-libtool-lock switch
 
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
+AC_ARG_ENABLE(libtool-lock,
+[  --disable-libtool-lock  force libtool not to do file locking],
+need_locks=$enableval,
+need_locks=yes)
+
+if test x"$need_locks" = xno; then
+  libtool_flags="$libtool_flags --disable-lock"
+fi
 ])
 
-# AM_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# AC_LIBTOOL_DLOPEN - check for dlopen support
+AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
 #   `yes'.
-AC_DEFUN(AM_ENABLE_SHARED,
-[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_SHARED,
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
 AC_ARG_ENABLE(shared,
 changequote(<<, >>)dnl
-<<  --enable-shared[=PKGS]  build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
+<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
 changequote([, ])dnl
 [p=${PACKAGE-default}
 case "$enableval" in
@@ -304,26 +345,22 @@
   IFS="$ac_save_ifs"
   ;;
 esac],
-enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
 ])
 
-# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN(AM_DISABLE_SHARED,
-[AM_ENABLE_SHARED(no)])
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AC_DISABLE_SHARED,
+[AC_ENABLE_SHARED(no)])
 
-# AM_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AM_DISABLE_STATIC,
-[AM_ENABLE_STATIC(no)])
-
-# AM_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
 #   `yes'.
-AC_DEFUN(AM_ENABLE_STATIC,
-[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_STATIC,
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
 AC_ARG_ENABLE(static,
 changequote(<<, >>)dnl
-<<  --enable-static[=PKGS]  build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
+<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
 changequote([, ])dnl
 [p=${PACKAGE-default}
 case "$enableval" in
@@ -341,28 +378,74 @@
   IFS="$ac_save_ifs"
   ;;
 esac],
-enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
 ])
 
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AC_DISABLE_STATIC,
+[AC_ENABLE_STATIC(no)])
 
-# AM_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN(AM_PROG_LD,
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN(AC_ENABLE_FAST_INSTALL,
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+  enable_fast_install=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+])
+
+# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN(AC_DISABLE_FAST_INSTALL,
+[AC_ENABLE_FAST_INSTALL(no)])
+
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AC_PROG_LD,
 [AC_ARG_WITH(gnu-ld,
 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   AC_MSG_CHECKING([for ld used by GCC])
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
-  # Accept absolute paths.
+    # Accept absolute paths.
 changequote(,)dnl
-  /* | [A-Za-z]:\\*)
+    /* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
 changequote([,])dnl
-    test -z "$LD" && LD="$ac_prog"
-    ;;
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
   "")
     # If it fails, then pretend we aren't using GCC.
     ac_prog=ld
@@ -390,7 +473,7 @@
       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
 	test "$with_gnu_ld" != no && break
       else
-        test "$with_gnu_ld" != yes && break
+	test "$with_gnu_ld" != yes && break
       fi
     fi
   done
@@ -406,10 +489,10 @@
 fi
 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 AC_SUBST(LD)
-AM_PROG_LD_GNU
+AC_PROG_LD_GNU
 ])
 
-AC_DEFUN(AM_PROG_LD_GNU,
+AC_DEFUN(AC_PROG_LD_GNU,
 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
@@ -419,8 +502,8 @@
 fi])
 ])
 
-# AM_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN(AM_PROG_NM,
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AC_PROG_NM,
 [AC_MSG_CHECKING([for BSD-compatible nm])
 AC_CACHE_VAL(ac_cv_path_NM,
 [if test -n "$NM"; then
@@ -428,20 +511,22 @@
   ac_cv_path_NM="$NM"
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/nm; then
       # Check to see if the nm accepts a BSD-compat flag.
       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
       #   nm: unknown option "B" ignored
       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-        ac_cv_path_NM="$ac_dir/nm -B"
+	ac_cv_path_NM="$ac_dir/nm -B"
+	break
       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-        ac_cv_path_NM="$ac_dir/nm -p"
+	ac_cv_path_NM="$ac_dir/nm -p"
+	break
       else
-        ac_cv_path_NM="$ac_dir/nm"
+	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+	continue # so that we can try to find one that supports BSD flags
       fi
-      break
     fi
   done
   IFS="$ac_save_ifs"
@@ -452,12 +537,280 @@
 AC_SUBST(NM)
 ])
 
-# AM_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
-AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN,
+# AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
+# by C symbol name from nm.
+AC_DEFUN(AC_SYS_NM_PARSE,
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output])
+AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
+[# These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix.  What could be older than Ultrix?!! ;)}
+
+changequote(,)dnl
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+  ac_symcode='[BCDT]'
+  ;;
+cygwin* | mingw*)
+  ac_symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+  ;;
+irix*)
+  ac_symcode='[BCDEGRST]'
+  ;;
+solaris*)
+  ac_symcode='[BDT]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+  ac_symcode='[ABCDGISTW]'
+fi
+changequote([,])dnl
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($ac_symcode\)[ 	][ 	]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  ac_pipe_works=no
+  rm -f conftest.$ac_ext
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    ac_nlist=conftest.nm
+  
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+
+      # Try sorting and uniquifying the output.
+      if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+	mv -f "$ac_nlist"T "$ac_nlist"
+      else
+	rm -f "$ac_nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+	if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+	  cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+	  cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+changequote(,)dnl
+lt_preloaded_symbols[] =
+changequote([,])dnl
+{
+EOF
+	sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+	cat <<\EOF >> conftest.c
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftestm.$ac_objext
+	  ac_save_LIBS="$LIBS"
+	  ac_save_CFLAGS="$CFLAGS"
+	  LIBS="conftestm.$ac_objext"
+	  CFLAGS="$CFLAGS$no_builtin_flag"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest; then
+	    ac_pipe_works=yes
+	  else
+	    echo "configure: failed program was:" >&AC_FD_CC
+	    cat conftest.c >&AC_FD_CC
+	  fi
+	  LIBS="$ac_save_LIBS"
+	  CFLAGS="$ac_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+	fi
+      else
+	echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
+      fi
+    else
+      echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+    fi
+  else
+    echo "$progname: failed program was:" >&AC_FD_CC
+    cat conftest.c >&AC_FD_CC
+  fi
+  rm -rf conftest*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$ac_pipe_works" = yes; then
+    if test x"$ac_symprfx" = x"_"; then
+      ac_cv_sys_symbol_underscore=yes
+    else
+      ac_cv_sys_symbol_underscore=no
+    fi
+    break
+  else
+    ac_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+   ac_result=no
+fi
+AC_MSG_RESULT($ac_result)
+])
+
+# AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
+AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
 AC_CHECK_TOOL(AS, as, false)
 ])
 
+# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
+#                            with an underscore?
+AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
+[AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_SYS_NM_PARSE])dnl
+AC_MSG_CHECKING([for _ prefix in compiled symbols])
+AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
+[ac_cv_sys_symbol_underscore=no
+cat > conftest.$ac_ext <<EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+EOF
+if AC_TRY_EVAL(ac_compile); then
+  # Now try to grab the symbols.
+  ac_nlist=conftest.nm
+  if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+    # See whether the symbols have a leading underscore.
+    if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+      ac_cv_sys_symbol_underscore=yes
+    else
+      if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+	:
+      else
+	echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+      fi
+    fi
+  else
+    echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+  fi
+else
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat conftest.c >&AC_FD_CC
+fi
+rm -rf conftest*
+])
+AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
+USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
+AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
+])
+
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN(AC_CHECK_LIBM, [
+AC_CHECK_LIB(mw, _mwvalidcheckl)
+AC_CHECK_LIB(m, cos)
+])
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library, adds --enable-ltdl-convenience to
+# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
+  case "$enable_ltdl_convenience" in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+])
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library, and adds --enable-ltdl-install to
+# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
+  AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
+    case "$enable_ltdl_install" in
+    no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
+    "") enable_ltdl_install=yes
+        ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
+    esac
+  ])
+  if test x"$enable_ltdl_install" != x"no"; then
+    LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+  fi
+])
+
+dnl old names
+AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
+AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
+AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
+AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
+AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
+
 # Like AC_CONFIG_HEADER, but automatically create stamp file.
 
 AC_DEFUN(AM_CONFIG_HEADER,
diff --git a/bfd/aix386-core.c b/bfd/aix386-core.c
index a75fa94..fb67b17 100644
--- a/bfd/aix386-core.c
+++ b/bfd/aix386-core.c
@@ -279,5 +279,7 @@
      BFD_JUMP_TABLE_LINK (_bfd_nolink),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+    NULL,
+    
     (PTR) 0
 };
diff --git a/bfd/aout-adobe.c b/bfd/aout-adobe.c
index 2c11ffe..8216c7e 100644
--- a/bfd/aout-adobe.c
+++ b/bfd/aout-adobe.c
@@ -1,5 +1,6 @@
 /* BFD back-end for a.out.adobe binaries.
-   Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 98, 1999
+   Free Software Foundation, Inc.
    Written by Cygnus Support.  Based on bout.c.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -372,8 +373,8 @@
 
 static void
 aout_adobe_write_section (abfd, sect)
-     bfd *abfd;
-     sec_ptr sect;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     sec_ptr sect ATTRIBUTE_UNUSED;
 {
   /* FIXME XXX */
 }
@@ -450,8 +451,8 @@
 
 static int 
 aout_adobe_sizeof_headers (ignore_abfd, ignore)
-     bfd *ignore_abfd;
-     boolean ignore;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
+     boolean ignore ATTRIBUTE_UNUSED;
 {
   return sizeof(struct internal_exec);
 }
@@ -523,5 +524,7 @@
      BFD_JUMP_TABLE_LINK (aout_32),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0
 };
diff --git a/bfd/aout-arm.c b/bfd/aout-arm.c
index beb900b..7365f9d 100644
--- a/bfd/aout-arm.c
+++ b/bfd/aout-arm.c
@@ -1,5 +1,5 @@
 /* BFD back-end for raw ARM a.out binaries.
-   Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
    
 This file is part of BFD, the Binary File Descriptor library.
@@ -87,7 +87,7 @@
   HOWTO (7, 2, 2, 26, false, 0, complain_overflow_signed,
 	 MY(fix_pcrel_26_done), "ARM26D", true, 0x0, 0x0,
 	 false),
-  {-1},
+  EMPTY_HOWTO (-1),
   HOWTO (9, 0, -1, 16, false, 0, complain_overflow_bitfield, 0, "NEG16", true,
 	 0x0000ffff, 0x0000ffff, false),
   HOWTO (10, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "NEG32", true,
@@ -230,13 +230,13 @@
 static bfd_reloc_status_type
 MY(fix_pcrel_26_done) (abfd, reloc_entry, symbol, data, input_section,
 		       output_bfd, error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   /* This is dead simple at present.  */
   return bfd_reloc_ok;
@@ -251,7 +251,7 @@
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma relocation;
   bfd_size_type addr = reloc_entry->address;
@@ -343,7 +343,7 @@
      struct reloc_std_external *bytes;
      arelent *cache_ptr;
      asymbol **symbols;
-     bfd_size_type symcount;
+     bfd_size_type symcount ATTRIBUTE_UNUSED;
 {
   int r_index;
   int r_extern;
@@ -467,6 +467,8 @@
 
 #include "aout-target.h"
 
+extern const bfd_target aout_arm_big_vec;
+
 const bfd_target aout_arm_little_vec =
 {
   "a.out-arm-little",           /* name */
@@ -503,6 +505,8 @@
      BFD_JUMP_TABLE_LINK (MY),
      BFD_JUMP_TABLE_DYNAMIC (MY),
 
+  & aout_arm_big_vec,
+  
   (PTR) MY_backend_data,
 };
 
@@ -542,5 +546,7 @@
      BFD_JUMP_TABLE_LINK (MY),
      BFD_JUMP_TABLE_DYNAMIC (MY),
 
+  & aout_arm_little_vec,
+  
   (PTR) MY_backend_data,
 };
diff --git a/bfd/aout-ns32k.c b/bfd/aout-ns32k.c
index c1335aa..05ac84e 100644
--- a/bfd/aout-ns32k.c
+++ b/bfd/aout-ns32k.c
@@ -156,7 +156,7 @@
 
 reloc_howto_type *
 MY(reloc_howto)(abfd, rel, r_index, r_extern, r_pcrel)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      struct reloc_std_external *rel;
      int *r_index;
      int *r_extern;
@@ -266,7 +266,7 @@
      struct reloc_std_external *bytes;
      arelent *cache_ptr;
      asymbol **symbols;
-     bfd_size_type symcount;
+     bfd_size_type symcount ATTRIBUTE_UNUSED;
 {
   int r_index;
   int r_extern;
diff --git a/bfd/aout-target.h b/bfd/aout-target.h
index 1aee07a..5ca50ac 100644
--- a/bfd/aout-target.h
+++ b/bfd/aout-target.h
@@ -1,5 +1,5 @@
 /* Define a target vector and some small routines for a variant of a.out.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -234,9 +234,9 @@
 static boolean
 MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
      bfd *ibfd;
-     asection *isec;
+     asection *isec ATTRIBUTE_UNUSED;
      bfd *obfd;
-     asection *osec;
+     asection *osec ATTRIBUTE_UNUSED;
 {
   if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour
       && bfd_get_flavour (obfd) == bfd_target_aout_flavour)
@@ -645,6 +645,9 @@
      BFD_JUMP_TABLE_LINK (MY),
      BFD_JUMP_TABLE_DYNAMIC (MY),
 
-  (PTR) MY_backend_data,
+  /* Alternative_target */
+  NULL,
+  
+  (PTR) MY_backend_data
 };
 #endif /* MY_BFD_TARGET */
diff --git a/bfd/aout-tic30.c b/bfd/aout-tic30.c
index eae6cb7..0dcae0c 100644
--- a/bfd/aout-tic30.c
+++ b/bfd/aout-tic30.c
@@ -1,5 +1,5 @@
 /* BFD back-end for TMS320C30 a.out binaries.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -131,7 +131,7 @@
    it. */
 reloc_howto_type tic30_aout_howto_table[] =
 {
-  {-1},
+  EMPTY_HOWTO (-1),
   HOWTO (1, 2, 1, 16, false, 0, 0, tic30_aout_fix_16,
 	 "16", false, 0x0000FFFF, 0x0000FFFF, false),
   HOWTO (2, 2, 2, 24, false, 0, complain_overflow_bitfield, NULL,
@@ -142,18 +142,18 @@
 	 "32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
   HOWTO (5, 2, 1, 16, true, 0, complain_overflow_signed,
 	 tic30_aout_fix_pcrel_16, "PCREL", true, 0x0000FFFF, 0x0000FFFF, true),
-  {-1},
-  {-1},
-  {-1},
-  {-1},
-  {-1}
+  EMPTY_HOWTO (-1),
+  EMPTY_HOWTO (-1),
+  EMPTY_HOWTO (-1),
+  EMPTY_HOWTO (-1),
+  EMPTY_HOWTO (-1)
 };
 
 extern reloc_howto_type *NAME (aout, reloc_type_lookup) ();
 
 reloc_howto_type *
 tic30_aout_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   switch (code)
@@ -218,9 +218,9 @@
      arelent *reloc_entry;
      asymbol *symbol;
      PTR data;
-     asection *input_section;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma relocation;
 
@@ -245,9 +245,9 @@
      arelent *reloc_entry;
      asymbol *symbol;
      PTR data;
-     asection *input_section;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma relocation;
 
@@ -274,11 +274,11 @@
 			 output_bfd, error_message)
      bfd *abfd;
      arelent *reloc_entry;
-     asymbol *symbol;
+     asymbol *symbol ATTRIBUTE_UNUSED;
      PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
+     asection *input_section ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma relocation = 1;
   bfd_byte offset_data = bfd_get_8 (abfd, (bfd_byte *) data + reloc_entry->address - 1);
@@ -590,9 +590,9 @@
 static boolean
 MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
      bfd *ibfd;
-     asection *isec;
+     asection *isec ATTRIBUTE_UNUSED;
      bfd *obfd;
-     asection *osec;
+     asection *osec ATTRIBUTE_UNUSED;
 {
   if (bfd_get_flavour (obfd) == bfd_target_aout_flavour)
     obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
@@ -779,7 +779,7 @@
 enum machine_type
 tic30_aout_machine_type (arch, machine, unknown)
      enum bfd_architecture arch;
-     unsigned long machine;
+     unsigned long machine ATTRIBUTE_UNUSED;
      boolean *unknown;
 {
   enum machine_type arch_flags;
@@ -1060,6 +1060,8 @@
   BFD_JUMP_TABLE_LINK (MY),
   BFD_JUMP_TABLE_DYNAMIC (MY),
 
-  (PTR) MY_backend_data,
+  NULL,
+  
+  (PTR) MY_backend_data
 };
 #endif /* MY_BFD_TARGET */
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 2704eec..895a321 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -1,5 +1,5 @@
 /* BFD semi-generic back-end for a.out binaries.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -228,28 +228,35 @@
 HOWTO( 8,	       0,  2,    0, false, 0, complain_overflow_bitfield,0,"GOT_REL",	false,         0,0x00000000, false),
 HOWTO( 9,	       0,  1,   16, false, 0, complain_overflow_bitfield,0,"BASE16",	false,0xffffffff,0xffffffff, false),
 HOWTO(10,	       0,  2,   32, false, 0, complain_overflow_bitfield,0,"BASE32",	false,0xffffffff,0xffffffff, false),
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
   HOWTO(16,	       0,  2,	 0, false, 0, complain_overflow_bitfield,0,"JMP_TABLE", false,         0,0x00000000, false),
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 },
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
   HOWTO(32,	       0,  2,	 0, false, 0, complain_overflow_bitfield,0,"RELATIVE",  false,         0,0x00000000, false),
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
   HOWTO(40,	       0,  2,	 0, false, 0, complain_overflow_bitfield,0,"BASEREL",   false,         0,0x00000000, false),
 };
 
@@ -1072,7 +1079,7 @@
 NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end)
      bfd *abfd;
      bfd_size_type *text_size;
-     file_ptr *text_end;
+     file_ptr *text_end ATTRIBUTE_UNUSED;
 {
   struct internal_exec *execp = exec_hdr (abfd);
 
@@ -2531,16 +2538,16 @@
 /*ARGSUSED*/
  alent *
 NAME(aout,get_lineno) (ignore_abfd, ignore_symbol)
-     bfd *ignore_abfd;
-     asymbol *ignore_symbol;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
+     asymbol *ignore_symbol ATTRIBUTE_UNUSED;
 {
-return (alent *)NULL;
+  return (alent *)NULL;
 }
 
 /*ARGSUSED*/
 void
 NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -2568,7 +2575,7 @@
 /*ARGSUSED*/
 void
 NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      PTR afile;
      asymbol *symbol;
      bfd_print_symbol_type how;
@@ -2878,7 +2885,7 @@
 int
 NAME(aout,sizeof_headers) (abfd, execable)
      bfd *abfd;
-     boolean execable;
+     boolean execable ATTRIBUTE_UNUSED;
 {
   return adata(abfd).exec_bytes_size;
 }
@@ -4719,6 +4726,8 @@
     default:
       abort ();
     }
+  /*NOTREACHED*/
+  return NULL;
 }
 
 /* Relocate an a.out section using standard a.out relocs.  */
@@ -5493,7 +5502,7 @@
   int r_index;
   int r_extern;
   reloc_howto_type *howto;
-  file_ptr *reloff_ptr;
+  file_ptr *reloff_ptr = NULL;
   struct reloc_std_external srel;
   struct reloc_ext_external erel;
   PTR rel_ptr;
diff --git a/bfd/archive.c b/bfd/archive.c
index 8ac5aa4..19293af 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -1,5 +1,5 @@
 /* BFD back-end for archive files (libraries).
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.  Mostly Gumby Henkel-Wallace's fault.
 
@@ -1178,7 +1178,7 @@
 #else
 static const char *
 normalize (abfd, file)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      const char *file;
 {
   const char *filename = strrchr (file, '/');
@@ -1340,6 +1340,14 @@
 
 /** A couple of functions for creating ar_hdrs */
 
+#ifndef HAVE_GETUID
+#define getuid() 0
+#endif
+
+#ifndef HAVE_GETGID
+#define getgid() 0
+#endif
+
 /* Takes a filename, returns an arelt_data for it, or NULL if it can't
    make one.  The filename must refer to a filename in the filesystem.
    The filename field of the ar_hdr will NOT be initialized.  If member
@@ -1901,13 +1909,8 @@
   bfd_ardata (arch)->armap_datepos = (SARMAG
 				      + offsetof (struct ar_hdr, ar_date[0]));
   sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp);
-#ifndef _WIN32
   sprintf (hdr.ar_uid, "%ld", (long) getuid ());
   sprintf (hdr.ar_gid, "%ld", (long) getgid ());
-#else
-  sprintf (hdr.ar_uid, "%ld", (long) 666);
-  sprintf (hdr.ar_gid, "%ld", (long) 42);
-#endif
   sprintf (hdr.ar_size, "%-10d", (int) mapsize);
   strncpy (hdr.ar_fmag, ARFMAG, 2);
   for (i = 0; i < sizeof (struct ar_hdr); i++)
diff --git a/bfd/archures.c b/bfd/archures.c
index f243862..7f2c5f7 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -162,11 +162,13 @@
 .#define bfd_mach_alpha_ev6  0x30
 .  bfd_arch_arm,       {* Advanced Risc Machines ARM *}
 .#define bfd_mach_arm_2		1
-.#define bfd_mach_arm_2a		2
+.#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_4 	5
 .#define bfd_mach_arm_4T 	6
+.#define bfd_mach_arm_5 	7
+.#define bfd_mach_arm_5T	8
 .  bfd_arch_ns32k,     {* National Semiconductors ns32000 *}
 .  bfd_arch_w65,       {* WDC 65816 *}
 .  bfd_arch_tic30,     {* Texas Instruments TMS320C30 *}
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 8bdbf80..b5ff7dd 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -715,13 +715,13 @@
   PARAMS ((bfd *, struct bfd_link_info *));
 
 /* ELF ARM Interworking support.  Called from linker.  */
-  extern boolean bfd_elf32_arm_allocate_interworking_sections
-    PARAMS ((struct bfd_link_info *));
- 
-  extern boolean bfd_elf32_arm_process_before_allocation
-    PARAMS ((bfd *, struct bfd_link_info *));
- 
-  extern boolean bfd_elf32_arm_get_bfd_for_interworking
-    PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean bfd_elf32_arm_allocate_interworking_sections
+  PARAMS ((struct bfd_link_info *));
+
+extern boolean bfd_elf32_arm_process_before_allocation
+  PARAMS ((bfd *, struct bfd_link_info *, int));
+
+extern boolean bfd_elf32_arm_get_bfd_for_interworking
+  PARAMS ((bfd *, struct bfd_link_info *));
 
 /* And more from the source.  */
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 8e86304..fa3c42e 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -715,14 +715,14 @@
   PARAMS ((bfd *, struct bfd_link_info *));
 
 /* ELF ARM Interworking support.  Called from linker.  */
-  extern boolean bfd_elf32_arm_allocate_interworking_sections
-    PARAMS ((struct bfd_link_info *));
- 
-  extern boolean bfd_elf32_arm_process_before_allocation
-    PARAMS ((bfd *, struct bfd_link_info *));
- 
-  extern boolean bfd_elf32_arm_get_bfd_for_interworking
-    PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean bfd_elf32_arm_allocate_interworking_sections
+  PARAMS ((struct bfd_link_info *));
+
+extern boolean bfd_elf32_arm_process_before_allocation
+  PARAMS ((bfd *, struct bfd_link_info *, int));
+
+extern boolean bfd_elf32_arm_get_bfd_for_interworking
+  PARAMS ((bfd *, struct bfd_link_info *));
 
 /* And more from the source.  */
 void 
@@ -759,7 +759,7 @@
  /* Byte swapping macros for user section data.  */
 
 #define bfd_put_8(abfd, val, ptr) \
-                (*((unsigned char *)(ptr)) = (unsigned char)(val))
+                ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val)))
 #define bfd_put_signed_8 \
                bfd_put_8
 #define bfd_get_8(abfd, ptr) \
@@ -794,6 +794,20 @@
 #define bfd_get_signed_64(abfd, ptr) \
                 BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
 
+#define bfd_get(bits, abfd, ptr)                               \
+                ((bits) == 8 ? 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.  */
 
@@ -990,6 +1004,10 @@
         /* This section should not be subject to garbage collection.  */
 #define SEC_KEEP 0x1000000
 
+        /* This section contains "short" data, and should be placed
+          "near" the GP.  */
+#define SEC_SHORT 0x2000000
+
         /*  End of section flags.  */
 
         /* Some internal packed boolean fields.  */
@@ -1303,11 +1321,13 @@
 #define bfd_mach_alpha_ev6  0x30
   bfd_arch_arm,        /* Advanced Risc Machines ARM */
 #define bfd_mach_arm_2         1
-#define bfd_mach_arm_2a                2
+#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_4         5
 #define bfd_mach_arm_4T        6
+#define bfd_mach_arm_5         7
+#define bfd_mach_arm_5T        8
   bfd_arch_ns32k,      /* National Semiconductors ns32000 */
   bfd_arch_w65,        /* WDC 65816 */
   bfd_arch_tic30,      /* Texas Instruments TMS320C30 */
@@ -1541,6 +1561,9 @@
   {(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 != (asymbol *)NULL) {             \
@@ -1828,6 +1851,10 @@
   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,
 
 
 /* i386/elf relocations */
@@ -1898,6 +1925,7 @@
 /* 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_OFFSET_IMM,
   BFD_RELOC_ARM_SHIFT_IMM,
   BFD_RELOC_ARM_SWI,
@@ -2162,6 +2190,7 @@
   BFD_RELOC_MCORE_PCREL_IMM4BY2,
   BFD_RELOC_MCORE_PCREL_32,
   BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
+  BFD_RELOC_MCORE_RVA,
 
 /* These two relocations are used by the linker to determine which of 
 the entries in a C++ virtual function table are actually used.  When
@@ -2973,8 +3002,12 @@
    /* Read in the dynamic relocs.  */
   long  (*_bfd_canonicalize_dynamic_reloc)
     PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
-
+    
+ /* Opposite endian version of this target.  */
+ const struct bfd_target * alternative_target;
+ 
  PTR backend_data;
+ 
 } bfd_target;
 boolean 
 bfd_set_default_target  PARAMS ((const char *name));
@@ -2985,6 +3018,9 @@
 const char **
 bfd_target_list PARAMS ((void));
 
+const bfd_target *
+bfd_search_for_target PARAMS ((int (* search_func)(const bfd_target *, void *), void *));
+
 boolean 
 bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
 
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 597e8f0..c6809d7 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1,5 +1,5 @@
 /* Generic BFD library interface and support routines.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -618,7 +618,7 @@
 /*ARGSUSED*/
 void
 bfd_set_reloc (ignore_abfd, asect, location, count)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      sec_ptr asect;
      arelent **location;
      unsigned int count;
diff --git a/bfd/binary.c b/bfd/binary.c
index 6c63fff..c2980b0 100644
--- a/bfd/binary.c
+++ b/bfd/binary.c
@@ -58,7 +58,7 @@
 
 static boolean
 binary_mkobject (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
   return true;
 }
@@ -112,7 +112,7 @@
 static boolean
 binary_get_section_contents (abfd, section, location, offset, count)
      bfd *abfd;
-     asection *section;
+     asection *section ATTRIBUTE_UNUSED;
      PTR location;
      file_ptr offset;
      bfd_size_type count;
@@ -127,7 +127,7 @@
 
 static long
 binary_get_symtab_upper_bound (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
   return (BIN_SYMS + 1) * sizeof (asymbol *);
 }
@@ -222,7 +222,7 @@
 
 static void
 binary_get_symbol_info (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -318,8 +318,8 @@
 
 static int
 binary_sizeof_headers (abfd, exec)
-     bfd *abfd;
-     boolean exec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean exec ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -382,5 +382,7 @@
   BFD_JUMP_TABLE_LINK (binary),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   NULL
 };
diff --git a/bfd/bout.c b/bfd/bout.c
index 4ef10f5..dd1754a 100644
--- a/bfd/bout.c
+++ b/bfd/bout.c
@@ -1,5 +1,6 @@
 /* BFD back-end for Intel 960 b.out binaries.
-   Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -494,7 +495,7 @@
 
 static reloc_howto_type *
 b_out_bfd_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   switch (code)
@@ -1001,8 +1002,8 @@
 
 static int
 b_out_sizeof_headers (ignore_abfd, ignore)
-     bfd *ignore_abfd;
-     boolean ignore;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
+     boolean ignore ATTRIBUTE_UNUSED;
 {
   return sizeof(struct internal_exec);
 }
@@ -1452,6 +1453,8 @@
 #define aout_32_get_section_contents_in_window \
   _bfd_generic_get_section_contents_in_window
 
+extern const bfd_target b_out_vec_little_host;
+
 const bfd_target b_out_vec_big_host =
 {
   "b.out.big",			/* name */
@@ -1489,6 +1492,8 @@
      BFD_JUMP_TABLE_LINK (b_out),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  & b_out_vec_little_host,
+  
   (PTR) 0,
 };
 
@@ -1530,5 +1535,7 @@
      BFD_JUMP_TABLE_LINK (b_out),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  & b_out_vec_big_host,
+  
   (PTR) 0
 };
diff --git a/bfd/cisco-core.c b/bfd/cisco-core.c
index 11c9bbd..e1fa177 100644
--- a/bfd/cisco-core.c
+++ b/bfd/cisco-core.c
@@ -323,5 +323,7 @@
        BFD_JUMP_TABLE_LINK (_bfd_nolink),
        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+    NULL,
+    
     (PTR) 0			/* backend_data */
 };
diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c
index bbf23ee..9eb6844 100644
--- a/bfd/coff-a29k.c
+++ b/bfd/coff-a29k.c
@@ -1,5 +1,6 @@
 /* BFD back-end for AMD 29000 COFF binaries.
-   Copyright 1990, 91, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 97, 98, 1999
+   Free Software Foundation, Inc.
    Contributed by David Wood at New York University 7/8/91.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -235,9 +236,29 @@
 static reloc_howto_type howto_table[] = 
 {
   {R_ABS,     0, 3, 32, false, 0, complain_overflow_bitfield,a29k_reloc,"ABS",     true, 0xffffffff,0xffffffff, false},
-  {1},  {2},  {3},   {4},  {5},  {6},  {7},  {8},  {9}, {10},
-  {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {20},
-  {21}, {22}, {23},
+  EMPTY_HOWTO (1),
+  EMPTY_HOWTO (2),
+  EMPTY_HOWTO (3),
+  EMPTY_HOWTO (4),
+  EMPTY_HOWTO (5),
+  EMPTY_HOWTO (6),
+  EMPTY_HOWTO (7),
+  EMPTY_HOWTO (8),
+  EMPTY_HOWTO (9),
+  EMPTY_HOWTO (10),
+  EMPTY_HOWTO (11),
+  EMPTY_HOWTO (12),
+  EMPTY_HOWTO (13),
+  EMPTY_HOWTO (14),
+  EMPTY_HOWTO (15),
+  EMPTY_HOWTO (16),
+  EMPTY_HOWTO (17),
+  EMPTY_HOWTO (18),
+  EMPTY_HOWTO (19),
+  EMPTY_HOWTO (20),
+  EMPTY_HOWTO (21),
+  EMPTY_HOWTO (22),
+  EMPTY_HOWTO (23),
   {R_IREL,    0, 3, 32, true,  0, complain_overflow_signed,a29k_reloc,"IREL",    true, 0xffffffff,0xffffffff, false},
   {R_IABS,    0, 3, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"IABS",    true, 0xffffffff,0xffffffff, false},
   {R_ILOHALF, 0, 3, 16, true,  0, complain_overflow_signed, a29k_reloc,"ILOHALF", true, 0x0000ffff,0x0000ffff, false},
@@ -311,7 +332,7 @@
 static boolean
 coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
 			    contents, relocs, syms, sections)
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
      bfd *input_bfd;
      asection *input_section;
@@ -562,10 +583,10 @@
 /*ARGSUSED*/
 static boolean
 coff_a29k_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
-     bfd *obfd;
-     struct bfd_link_info *info;
-     bfd *ibfd;
-     asection *sec;
+     bfd *obfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     bfd *ibfd ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
      struct internal_reloc *irel;
      boolean *adjustedp;
 {
@@ -580,61 +601,4 @@
 
 #include "coffcode.h"
 
-const bfd_target a29kcoff_big_vec =
-{
-  "coff-a29k-big",		/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC /* section flags */
-   | SEC_LOAD | SEC_RELOC  
-   | SEC_READONLY ),
-  '_',				/* leading underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  /* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32,   bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16,
-  /* hdrs */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32,   bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16,
-
- {
-	    
-   _bfd_dummy_target,
-   coff_object_p,
-   bfd_generic_archive_p,
-   _bfd_dummy_target
-  },
- {
-   bfd_false,
-   coff_mkobject,
-   _bfd_generic_mkarchive,
-   bfd_false
-  },
- {
-   bfd_false,
-   coff_write_object_contents,
-   _bfd_write_archive_contents,
-   bfd_false
-  },
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE
- };
+CREATE_BIG_COFF_TARGET_VEC (a29kcoff_big_vec, "coff-a29k-big", 0, SEC_READONLY, '_', NULL)
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index d841663..5d7187f 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -2398,5 +2398,7 @@
      BFD_JUMP_TABLE_LINK (_bfd_ecoff),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) &alpha_ecoff_backend_data
 };
diff --git a/bfd/coff-apollo.c b/bfd/coff-apollo.c
index 253ec89..6075d52 100644
--- a/bfd/coff-apollo.c
+++ b/bfd/coff-apollo.c
@@ -105,57 +105,16 @@
 
 #include "coffcode.h"
 
-const bfd_target 
-#ifdef TARGET_SYM
-  TARGET_SYM =
-#else
-  apollocoff_vec =
+#ifndef TARGET_SYM
+#define TARGET_SYM apollocoff_vec
 #endif
-{
-#ifdef TARGET_NAME
-  TARGET_NAME,
-#else
-  "apollo-m68k",			/* name */
+
+#ifndef TARGET_NAME
+#define TARGET_NAME "apollo-m68k"
 #endif
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
 
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
 #ifdef NAMES_HAVE_UNDERSCORE
-  '_',
+CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, 0, 0, '_', NULL)
 #else
-  0,				/* leading underscore */
+CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, 0, 0, 0, NULL)
 #endif
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
-
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
- {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-   bfd_false},
- {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE
- };
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index d478ce5..2af1a94 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -1,5 +1,5 @@
 /* BFD back-end for ARM COFF files.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -89,10 +89,12 @@
   PARAMS ((struct bfd_link_info *, CONST char *, bfd *));
 static struct coff_link_hash_entry * find_arm_glue
   PARAMS ((struct bfd_link_info *, CONST char *, bfd *));
+#ifndef COFF_IMAGE_WITH_PE
 static void record_arm_to_thumb_glue
   PARAMS ((struct bfd_link_info *, struct coff_link_hash_entry *));
 static void record_thumb_to_arm_glue
   PARAMS ((struct bfd_link_info *, struct coff_link_hash_entry *));
+#endif
 static boolean coff_arm_merge_private_bfd_data
   PARAMS ((bfd *, bfd *));
 static boolean coff_arm_print_private_bfd_data
@@ -126,11 +128,11 @@
 		 error_message)
      bfd *abfd;
      arelent *reloc_entry;
-     asymbol *symbol;
+     asymbol *symbol ATTRIBUTE_UNUSED;
      PTR data;
-     asection *input_section;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   symvalue diff;
   if (output_bfd == (bfd *) NULL)
@@ -319,7 +321,7 @@
 	0x0,
 	false),
   /* 8 is unused */
-  {-1},
+  EMPTY_HOWTO (-1),
   HOWTO( ARM_NEG16,
 	0,
 	-1,
@@ -406,7 +408,7 @@
 
 static boolean
 in_reloc_p (abfd, howto)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      reloc_howto_type * howto;
 {
   return !howto->pc_relative && howto->type != ARM_RVA32;
@@ -421,11 +423,11 @@
 
 static reloc_howto_type *
 coff_arm_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      struct internal_reloc *rel;
-     struct coff_link_hash_entry *h;
-     struct internal_syment *sym;
+     struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
+     struct internal_syment *sym ATTRIBUTE_UNUSED;
      bfd_vma *addendp;
 {
   reloc_howto_type *howto;
@@ -445,13 +447,13 @@
 static bfd_reloc_status_type
 aoutarm_fix_pcrel_26_done (abfd, reloc_entry, symbol, data, input_section,
 			  output_bfd, error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   /* This is dead simple at present.  */
   return bfd_reloc_ok;
@@ -468,7 +470,7 @@
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma relocation;
   bfd_size_type addr = reloc_entry->address;
@@ -528,7 +530,7 @@
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
      thumb_pcrel_branchtype btype;
 {
   bfd_vma relocation = 0;
@@ -783,7 +785,7 @@
   return & ret->root.root;
 }
 
-static
+static void
 arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset)
       struct bfd_link_info *info;
       bfd *output_bfd;
@@ -934,8 +936,6 @@
 static const insn32 a2t2_bx_r12_insn    = 0xe12fff1c;
 static const insn32 a2t3_func_addr_insn = 0x00000001;
 
-#define A2T3_OFFSET 8
-
 /*
    Thumb->ARM:				Thumb->(non-interworking aware) ARM
 
@@ -959,8 +959,6 @@
 static const insn16 t2a2_noop_insn  = 0x46c0;
 static const insn32 t2a3_b_insn     = 0xea000000;
 
-#define T2A3_OFFSET 8
-
 static const insn16 t2a1_push_insn  = 0xb540;
 static const insn16 t2a2_ldr_insn   = 0x4e03;
 static const insn16 t2a3_mov_insn   = 0x46fe;
@@ -1211,7 +1209,8 @@
 				      s->contents + my_offset + 8);
 
                           if (info->base_file)
-                            arm_emit_base_file_entry (info, output_bfd, s, A2T3_OFFSET);
+                            arm_emit_base_file_entry (info, output_bfd, s, 
+                                                            my_offset + 8);
 
 			}
 
@@ -1236,7 +1235,6 @@
 		      
 		      bfd_put_32 (output_bfd, tmp, contents + rel->r_vaddr
 				  - input_section->vma);
-		      
 		      done = 1;
 		    }
                 }
@@ -1319,6 +1317,9 @@
 			      /* Store the address of the function in the last word of the stub.  */
 			      bfd_put_32 (output_bfd, h_val,
 					  s->contents + my_offset + 16);
+
+                              if (info->base_file)
+                                arm_emit_base_file_entry (info, output_bfd, s, my_offset + 16);
 			    }
 			  else
 			    {
@@ -1341,8 +1342,6 @@
 					  t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF),
 					  s->contents + my_offset + 4);
 
-                              if (info->base_file)
-                                arm_emit_base_file_entry (info, output_bfd, s, T2A3_OFFSET);
 			    }
 			}
 
@@ -1365,9 +1364,6 @@
 				  contents + rel->r_vaddr
 				  - input_section->vma);
 		      
-                      if (info->base_file)
-                        arm_emit_base_file_entry (info, output_bfd, input_section, rel->r_vaddr);
-
 		      done = 1;
                     }
                 }
@@ -1537,7 +1533,7 @@
 	 Probably not, but it works, and if it works it don't need fixing!  nickc@cygnus.com */
       /* Only perform this fix during the final link, not a relocatable link.  nickc@cygnus.com  */
       if (! info->relocateable
-	  && rel->r_type == ARM_32)
+	  && (rel->r_type == ARM_32 || rel->r_type == ARM_RVA32))
 	{
 	  /* Determine if we need to set the bottom bit of a relocated address
 	     because the address is the address of a Thumb code symbol.  */
@@ -1610,7 +1606,8 @@
   return true;
 }
 
-#ifndef COFF_WITH_PE
+#ifndef COFF_IMAGE_WITH_PE
+
 boolean
 bfd_arm_allocate_interworking_sections (info) 
      struct bfd_link_info * info;
@@ -1797,6 +1794,7 @@
 /* Select a BFD to be used to hold the sections used by the glue code.
    This function is called from the linker scripts in ld/emultempl/
    {armcoff/pe}.em  */
+
 boolean
 bfd_arm_get_bfd_for_interworking (abfd, info)
      bfd * 		    abfd;
@@ -1959,7 +1957,7 @@
   return true;
 }
 
-#endif /* ! COFF_WITH_PE */
+#endif /* ! defined (COFF_IMAGE_WITH_PE) */
 
 #define coff_bfd_reloc_type_lookup 		coff_arm_reloc_type_lookup
 #define coff_relocate_section 			coff_arm_relocate_section
@@ -1979,8 +1977,8 @@
 
 static boolean
 coff_arm_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
-     bfd *obfd;
-     struct bfd_link_info *info;
+     bfd *obfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      bfd *ibfd;
      asection *sec;
      struct internal_reloc *irel;
@@ -2183,7 +2181,7 @@
   if (APCS_SET (abfd)
       && (   (APCS_26_FLAG    (abfd) != flag)
 	  || (APCS_FLOAT_FLAG (abfd) != (flags & F_APCS_FLOAT))
-	  || (PIC_FLAG        (abfd) != (flags & F_PIC_INT ? F_PIC : 0))
+	  || (PIC_FLAG        (abfd) != (flags & F_PIC))
 	  ))
     return false;
 
@@ -2291,7 +2289,7 @@
 
 static boolean
 coff_arm_is_local_label_name (abfd, name)
-     bfd *        abfd;
+     bfd *        abfd ATTRIBUTE_UNUSED;
      const char * name;
 {
 #ifdef LOCAL_LABEL_PREFIX
@@ -2344,7 +2342,7 @@
 
 static boolean
 coff_arm_final_link_postscript (abfd, pfinfo)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      struct coff_final_link_info * pfinfo;
 {
   struct coff_arm_link_hash_table * globals;
@@ -2430,128 +2428,33 @@
 
 #include "coffcode.h"
 
-const bfd_target
-#ifdef TARGET_LITTLE_SYM
-TARGET_LITTLE_SYM =
-#else
-armcoff_little_vec =
+#ifndef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM armcoff_little_vec
 #endif
-{
-#ifdef TARGET_LITTLE_NAME
-  TARGET_LITTLE_NAME,
-#else
-  "coff-arm-little",
+#ifndef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "coff-arm-little"
 #endif
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_LITTLE,		/* data byte order is little */
-  BFD_ENDIAN_LITTLE,		/* header byte order is little */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
-
-#ifndef COFF_WITH_PE
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
-#else
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
-   | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
+#ifndef TARGET_BIG_SYM
+#define TARGET_BIG_SYM armcoff_big_vec
+#endif
+#ifndef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "coff-arm-big"
 #endif
 
-#ifdef TARGET_UNDERSCORE
-  TARGET_UNDERSCORE,		/* leading underscore */
-#else
-  0,				/* leading underscore */
-#endif
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
-
-/* Note that we allow an object file to be treated as a core file as well. */
-    {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-       bfd_generic_archive_p, coff_object_p},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-       bfd_false},
-    {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-       _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  (PTR) & bfd_coff_std_swap_table,
-};
-
-const bfd_target
-#ifdef TARGET_BIG_SYM
-TARGET_BIG_SYM =
-#else
-armcoff_big_vec =
-#endif
-{
-#ifdef TARGET_BIG_NAME
-  TARGET_BIG_NAME,
-#else
-  "coff-arm-big",
-#endif
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
-
-#ifndef COFF_WITH_PE
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
-#else
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
-   | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
+#ifndef TARGET_UNDERSCORE
+#define TARGET_UNDERSCORE 0
 #endif
 
-#ifdef TARGET_UNDERSCORE
-  TARGET_UNDERSCORE,		/* leading underscore */
+#ifdef COFF_WITH_PE
+#define EXTRA_S_FLAGS (SEC_LINK_ONCE | SEC_LINK_DUPLICATES)
 #else
-  0,				/* leading underscore */
+#define EXTRA_S_FLAGS 0
 #endif
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
 
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+/* Forward declaration for use initialising alternative_target field.  */
+extern const bfd_target TARGET_BIG_SYM ;
 
-/* Note that we allow an object file to be treated as a core file as well. */
-    {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-       bfd_generic_archive_p, coff_object_p},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-       bfd_false},
-    {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-       _bfd_write_archive_contents, bfd_false},
+/* Target vectors.  */
+CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_BIG_SYM)
+CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_LITTLE_SYM)
 
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  (PTR) & bfd_coff_std_swap_table,
-};
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index 74a4ec3..3c1125c 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -1,5 +1,6 @@
 /* BFD back-end for Hitachi H8/300 COFF binaries.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Steve Chamberlain, <sac@cygnus.com>.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -203,13 +204,13 @@
 static bfd_reloc_status_type
 special (abfd, reloc_entry, symbol, data, input_section, output_bfd,
 		 error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   if (output_bfd == (bfd *) NULL)
     return bfd_reloc_continue;
@@ -1060,13 +1061,13 @@
 	symbol = *(reloc->sym_ptr_ptr);
 	value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
 	if (symbol == bfd_abs_section_ptr->symbol
-	    || (value >= 0 && value <= 0xff))
+	    || value <= 0xff)
 	  {
 	    /* This should be handled in a manner very similar to
 	       R_RELBYTES.   If the value is in range, then just slam
 	       the value into the right location.  Else trigger a
 	       reloc overflow callback.  */
-	    if (value >= 0 && value <= 0xff)
+	    if (value <= 0xff)
 	      {
 		bfd_put_8 (abfd, value, data + dst_address);
 		dst_address += 1;
@@ -1345,44 +1346,4 @@
 #define coff_bfd_relax_section bfd_coff_reloc16_relax_section
 
 
-
-const bfd_target h8300coff_vec =
-{
-  "coff-h8300",			/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE ),
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC),	/* section flags */
-  '_',				/* leading char */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-  bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-  bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-  bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-  bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
-
-  {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-   bfd_false},
-  {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
+CREATE_BIG_COFF_TARGET_VEC (h8300coff_vec, "coff-h8300", BFD_IS_RELAXABLE, 0, '_', NULL)
diff --git a/bfd/coff-h8500.c b/bfd/coff-h8500.c
index 91109ea..22eeaa5 100644
--- a/bfd/coff-h8500.c
+++ b/bfd/coff-h8500.c
@@ -311,44 +311,4 @@
   bfd_coff_reloc16_get_relocated_section_contents
 #define coff_bfd_relax_section bfd_coff_reloc16_relax_section
 
-const bfd_target h8500coff_vec =
-{
-  "coff-h8500",			/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC),	/* section flags */
-  '_',				/* leading symbol underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
-
-  {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-   bfd_false},
-  {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
+CREATE_BIG_COFF_TARGET_VEC (h8500coff_vec, "coff-h8500", 0, 0, '_', NULL)
diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c
index 7898cc1..0d10fe2 100644
--- a/bfd/coff-i386.c
+++ b/bfd/coff-i386.c
@@ -1,5 +1,5 @@
 /* BFD back-end for Intel 386 COFF files.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -66,9 +66,9 @@
      arelent *reloc_entry;
      asymbol *symbol;
      PTR data;
-     asection *input_section;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   symvalue diff;
 
@@ -158,7 +158,7 @@
    appear in the output .reloc section. */
 
 static boolean in_reloc_p(abfd, howto)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      reloc_howto_type *howto;
 {
   return ! howto->pc_relative && howto->type != R_IMAGEBASE;
@@ -171,12 +171,12 @@
 
 static reloc_howto_type howto_table[] = 
 {
-  {0},
-  {1},
-  {2},
-  {3},
-  {4},
-  {5},
+  EMPTY_HOWTO (0),
+  EMPTY_HOWTO (1),
+  EMPTY_HOWTO (2),
+  EMPTY_HOWTO (3),
+  EMPTY_HOWTO (4),
+  EMPTY_HOWTO (5),
   HOWTO (R_DIR32,               /* type */                                 
 	 0,	                /* rightshift */                           
 	 2,	                /* size (0 = byte, 1 = short, 2 = long) */ 
@@ -204,13 +204,13 @@
 	 0xffffffff,            /* src_mask */                             
 	 0xffffffff,            /* dst_mask */                             
 	 false),                /* pcrel_offset */
-  {010},
-  {011},
-  {012},
-  {013},
-  {014},
-  {015},
-  {016},
+  EMPTY_HOWTO (010),
+  EMPTY_HOWTO (011),
+  EMPTY_HOWTO (012),
+  EMPTY_HOWTO (013),
+  EMPTY_HOWTO (014),
+  EMPTY_HOWTO (015),
+  EMPTY_HOWTO (016),
   HOWTO (R_RELBYTE,		/* type */                                 
 	 0,			/* rightshift */                           
 	 0,			/* size (0 = byte, 1 = short, 2 = long) */ 
@@ -385,7 +385,7 @@
 
 static reloc_howto_type *
 coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      struct internal_reloc *rel;
      struct coff_link_hash_entry *h;
@@ -464,7 +464,7 @@
 
 static reloc_howto_type *
 coff_i386_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   switch (code)
@@ -633,5 +633,7 @@
      BFD_JUMP_TABLE_LINK (coff),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
-  COFF_SWAP_TABLE,
+  NULL,
+  
+  COFF_SWAP_TABLE
 };
diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c
index 929fa42..ab3bb5f 100644
--- a/bfd/coff-i860.c
+++ b/bfd/coff-i860.c
@@ -1,5 +1,5 @@
 /* BFD back-end for Intel 860 COFF files.
-   Copyright 1990, 91, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 97, 1999 Free Software Foundation, Inc.
    Created mostly by substituting "860" for "386" in coff-i386.c
    Harry Dolan <dolan@ssd.intel.com>, October 1995
 
@@ -57,9 +57,9 @@
      arelent *reloc_entry;
      asymbol *symbol;
      PTR data;
-     asection *input_section;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   symvalue diff;
 
@@ -141,12 +141,12 @@
 
 static reloc_howto_type howto_table[] = 
 {
-  {0},
-  {1},
-  {2},
-  {3},
-  {4},
-  {5},
+  EMPTY_HOWTO (0),
+  EMPTY_HOWTO (1),
+  EMPTY_HOWTO (2),
+  EMPTY_HOWTO (3),
+  EMPTY_HOWTO (4),
+  EMPTY_HOWTO (5),
   HOWTO (R_DIR32,               /* type */                                 
 	 0,	                /* rightshift */                           
 	 2,	                /* size (0 = byte, 1 = short, 2 = long) */ 
@@ -174,13 +174,13 @@
 	 0xffffffff,            /* src_mask */                             
 	 0xffffffff,            /* dst_mask */                             
 	 false),                /* pcrel_offset */
-  {010},
-  {011},
-  {012},
-  {013},
-  {014},
-  {015},
-  {016},
+  EMPTY_HOWTO (010),
+  EMPTY_HOWTO (011),
+  EMPTY_HOWTO (012),
+  EMPTY_HOWTO (013),
+  EMPTY_HOWTO (014),
+  EMPTY_HOWTO (015),
+  EMPTY_HOWTO (016),
   HOWTO (R_RELBYTE,		/* type */                                 
 	 0,			/* rightshift */                           
 	 0,			/* size (0 = byte, 1 = short, 2 = long) */ 
@@ -313,7 +313,7 @@
 
 static reloc_howto_type *
 coff_i860_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      struct internal_reloc *rel;
      struct coff_link_hash_entry *h;
@@ -418,5 +418,7 @@
      BFD_JUMP_TABLE_LINK (coff),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
-  COFF_SWAP_TABLE,
+  NULL,
+  
+  COFF_SWAP_TABLE
 };
diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c
index 25455d9..2a7ebfb 100644
--- a/bfd/coff-i960.c
+++ b/bfd/coff-i960.c
@@ -1,5 +1,6 @@
 /* BFD back-end for Intel 960 COFF files.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -60,7 +61,7 @@
 
 static boolean
 coff_i960_is_local_label_name (abfd, name)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      const char *name;
 {
   return (name[0] == 'L'
@@ -106,7 +107,7 @@
      asymbol *symbol_in;
      PTR data;
      asection *input_section;
-     bfd *ignore_bfd;
+     bfd *ignore_bfd ATTRIBUTE_UNUSED;
      char **error_message;
 {
   /* This item has already been relocated correctly, but we may be
@@ -193,10 +194,10 @@
      bfd *abfd;
      arelent *reloc_entry;
      asymbol *symbol;
-     PTR data;
-     asection *input_section;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   asection *osec;
 
@@ -277,7 +278,7 @@
 
 static reloc_howto_type *
 coff_i960_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   switch (code)
@@ -368,7 +369,7 @@
 static boolean
 coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
 			    contents, relocs, syms, sections)
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
      bfd *input_bfd;
      asection *input_section;
@@ -580,10 +581,10 @@
 /*ARGSUSED*/
 static boolean
 coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
-     bfd *obfd;
-     struct bfd_link_info *info;
+     bfd *obfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      bfd *ibfd;
-     asection *sec;
+     asection *sec ATTRIBUTE_UNUSED;
      struct internal_reloc *irel;
      boolean *adjustedp;
 {
@@ -615,49 +616,9 @@
 
 #include "coffcode.h"
 
-const bfd_target icoff_little_vec =
-{
-  "coff-Intel-little",		/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_LITTLE,		/* data byte order is little */
-  BFD_ENDIAN_LITTLE,		/* header byte order is little */
+extern const bfd_target icoff_big_vec;
 
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
-  '_',				/* leading underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
-
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
- {bfd_false, coff_mkobject,	/* bfd_set_format */
-   _bfd_generic_mkarchive, bfd_false},
- {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
-
+CREATE_LITTLE_COFF_TARGET_VEC (icoff_little_vec, "coff-Intel-little", 0, 0, '_', & icoff_big_vec)
 
 const bfd_target icoff_big_vec =
 {
@@ -699,5 +660,7 @@
      BFD_JUMP_TABLE_LINK (coff),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
-  COFF_SWAP_TABLE,
+  & icoff_little_vec,
+  
+  COFF_SWAP_TABLE
 };
diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c
index 5a06b17..d7138c0 100644
--- a/bfd/coff-m68k.c
+++ b/bfd/coff-m68k.c
@@ -1,5 +1,6 @@
 /* BFD back-end for Motorola 68000 COFF binaries.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1999
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -174,7 +175,7 @@
 #endif
 reloc_howto_type *
 m68k_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   switch (code)
@@ -215,11 +216,11 @@
 /*ARGSUSED*/
 static reloc_howto_type *
 m68kcoff_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      struct internal_reloc *rel;
-     struct coff_link_hash_entry *h;
-     struct internal_syment *sym;
+     struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
+     struct internal_syment *sym ATTRIBUTE_UNUSED;
      bfd_vma *addendp;
 {
   arelent relent;
@@ -257,9 +258,9 @@
      arelent *reloc_entry;
      asymbol *symbol;
      PTR data;
-     asection *input_section;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   symvalue diff;
 
@@ -376,7 +377,7 @@
 /*ARGSUSED*/
 static reloc_howto_type *
 m68kcoff_common_addend_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      struct internal_reloc *rel;
      struct coff_link_hash_entry *h;
@@ -433,48 +434,8 @@
 #define TARGET_NAME "coff-m68k"
 #endif
 
-const bfd_target TARGET_SYM =
-{
-  TARGET_NAME,
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
 #ifdef NAMES_HAVE_UNDERSCORE
-  '_',
+CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL)
 #else
-  0,				/* leading underscore */
+CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, 0, NULL)
 #endif
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
-
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
- {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-   bfd_false},
- {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE
-};
diff --git a/bfd/coff-m88k.c b/bfd/coff-m88k.c
index 8da0b05..f78377a 100644
--- a/bfd/coff-m88k.c
+++ b/bfd/coff-m88k.c
@@ -1,5 +1,6 @@
 /* BFD back-end for Motorola 88000 COFF "Binary Compatability Standard" files.
-   Copyright 1990, 91, 92, 93, 94, 95, 97, 1998 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -44,7 +45,7 @@
 
 static boolean
 m88k_is_local_label_name (abfd, name)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      const char *name;
 {
   return name[0] == '@';
@@ -59,7 +60,7 @@
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   reloc_howto_type *howto = reloc_entry->howto;
 
@@ -287,44 +288,4 @@
 
 #undef coff_write_armap
 
-const bfd_target m88kbcs_vec =
-{
-  "coff-m88kbcs",		/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
-  '_',				/* leading underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
-
-    {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-       bfd_generic_archive_p, _bfd_dummy_target},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-       bfd_false},
-    {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-       _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
+CREATE_BIG_COFF_TARGET_VEC (m88kbcs_vec, "coff-m88kbcs", 0, 0, '_', NULL)
diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c
index d787096..199a5ab 100644
--- a/bfd/coff-mcore.c
+++ b/bfd/coff-mcore.c
@@ -1,6 +1,5 @@
 /* BFD back-end for Motorolla MCore COFF/PE
-   Copyright 1999
-   Free Software Foundation, Inc.
+   Copyright 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -45,8 +44,6 @@
   PARAMS ((bfd *));
 static bfd_reloc_status_type        mcore_coff_unsupported_reloc 
   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static boolean                      in_reloc_p
-  PARAMS ((bfd *, reloc_howto_type *));
 static boolean                      coff_mcore_relocate_section
   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
 	   struct internal_reloc *, struct internal_syment *, asection **));
@@ -84,7 +81,7 @@
 	 false,	                 /* pc_relative */                          
 	 0,	                 /* bitpos */                               
 	 complain_overflow_dont, /* dont complain_on_overflow */
-	 0,		         /* special_function */                     
+	 NULL,		         /* special_function */                     
 	 "ABSOLUTE",             /* name */
 	 false,	                 /* partial_inplace */                      
 	 0x00,	 	         /* src_mask */                             
@@ -98,7 +95,7 @@
 	 false,	                /* pc_relative */                          
 	 0,	                /* bitpos */                               
 	 complain_overflow_bitfield, /* complain_on_overflow */
-	 0,		        /* special_function */                     
+	 NULL,		        /* special_function */                     
 	 "ADDR32",              /* name */
 	 true,	                /* partial_inplace */                      
 	 0xffffffff,            /* src_mask */                             
@@ -114,7 +111,7 @@
 	 true,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_bitfield, /* complain_on_overflow */
-	 mcore_coff_unsupported_reloc,	/* special_function */
+	 mcore_coff_unsupported_reloc, /* special_function */
 	 "IMM8BY4",             /* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
@@ -146,7 +143,7 @@
 	 true,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_bitfield, /* complain_on_overflow */
-	 mcore_coff_unsupported_reloc,/* special_function */
+	 mcore_coff_unsupported_reloc, /* special_function */
 	 "IMM4BY2",              /* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
@@ -187,6 +184,20 @@
 	 false,			/* partial_inplace */
 	 0x0,			/* src_mask */
 	 0x7ff,			/* dst_mask */
+	 true),			/* pcrel_offset */
+  
+  HOWTO (IMAGE_REL_MCORE_RVA,   /* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 NULL,                  /* special_function */
+	 "MCORE_RVA",           /* name */
+	 true,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
 	 true)			/* pcrel_offset */
 };
 
@@ -243,11 +254,11 @@
 			   output_bfd, error_message)
      bfd * abfd;
      arelent * reloc_entry;
-     asymbol * symbol;
-     PTR data;
-     asection * input_section;
-     bfd * output_bfd;
-     char ** error_message;
+     asymbol * symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection * input_section ATTRIBUTE_UNUSED;
+     bfd * output_bfd ATTRIBUTE_UNUSED;
+     char ** error_message ATTRIBUTE_UNUSED;
 {
   BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
   
@@ -266,7 +277,7 @@
 
 static reloc_howto_type *
 mcore_coff_reloc_type_lookup (abfd, code)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   switch (code)
@@ -277,6 +288,7 @@
       HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM4BY2,      IMAGE_REL_MCORE_PCREL_IMM4BY2);
       HOW2MAP (BFD_RELOC_32_PCREL,                 IMAGE_REL_MCORE_PCREL_32);
       HOW2MAP (BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2);
+      HOW2MAP (BFD_RELOC_RVA,                      IMAGE_REL_MCORE_RVA);
    default: 
       return NULL;
     }
@@ -290,10 +302,10 @@
 
 static reloc_howto_type *
 coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      asection * sec;
      struct internal_reloc * rel;
-     struct coff_link_hash_entry * h;
+     struct coff_link_hash_entry * h ATTRIBUTE_UNUSED;
      struct internal_syment * sym;
      bfd_vma * addendp;
 {
@@ -304,6 +316,9 @@
     return NULL;
   
   howto = mcore_coff_howto_table + rel->r_type;
+
+  if (rel->r_type == IMAGE_REL_MCORE_RVA)
+    * addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
   
   if (howto->pc_relative)
     {
@@ -323,16 +338,18 @@
   
   return howto;
 }
-
-/* Return true if this relocation should
-   appear in the output .reloc section. */
-static boolean in_reloc_p (abfd, howto)
-     bfd * abfd;
+
+/* Return true if this relocation should appear in the output .reloc section.
+   This function is referenced in pe_mkobject in peicode.h.  */
+static boolean
+in_reloc_p (abfd, howto)
+     bfd * abfd ATTRIBUTE_UNUSED;
      reloc_howto_type * howto;
 {
-  return ! howto->pc_relative;
+  return ! howto->pc_relative && howto->type != IMAGE_REL_MCORE_RVA;
 }     
 
+
 /* The reloc processing routine for the optimized COFF linker.  */
 static boolean
 coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
@@ -357,8 +374,19 @@
   if (info->relocateable)
     return true;
   
-  BFD_ASSERT (input_bfd->xvec->byteorder
-	      == output_bfd->xvec->byteorder);
+  /* Check if we have the same endianess */
+  if (   input_bfd->xvec->byteorder != output_bfd->xvec->byteorder
+      && output_bfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
+    {
+      (*_bfd_error_handler)
+	(_("%s: compiled for a %s endian system and target is %s endian.\n"),
+	 bfd_get_filename (input_bfd),
+         bfd_big_endian (input_bfd) ? "big" : "little",
+         bfd_big_endian (output_bfd) ? "big" : "little");
+
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
 
   hihalf = false;
   hihalf_val = 0;
@@ -368,8 +396,6 @@
   
   for (; rel < relend; rel++)
     {
-      asection *                     toc_section = NULL;
-      bfd_vma                        relocation;
       long                           symndx;
       struct internal_syment *       sym;
       bfd_vma                        val;
@@ -481,6 +507,7 @@
 	case IMAGE_REL_MCORE_PCREL_32:
 	case IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2:
 	case IMAGE_REL_MCORE_ADDR32:
+	case IMAGE_REL_MCORE_RVA:
 	  rstat = _bfd_relocate_contents (howto, input_bfd, val, loc);
 	  break;
 	}
@@ -583,121 +610,9 @@
   return coff_object_p (abfd);
 }
 
+/* Forward declaration to initialise alterbative_target field.  */
+extern const bfd_target TARGET_LITTLE_SYM;
+
 /* The transfer vectors that lead the outside world to all of the above. */
-
-const bfd_target
-TARGET_BIG_SYM =
-{
-  TARGET_BIG_NAME,
-  bfd_target_coff_flavour,	
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
-   | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
-
-  0,				/* leading char */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-  bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-  bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
-
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-  bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-  bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
-
-  { _bfd_dummy_target,
-    pe_object_p, 		/* bfd_check_format */
-    bfd_generic_archive_p, 	/* _bfd_dummy_target */
-    pe_object_p
-  },
-  { bfd_false,
-    coff_mkobject,
-    _bfd_generic_mkarchive, 	/* bfd_set_format */
-    bfd_false
-  },
-  { bfd_false,
-    coff_write_object_contents,	/* bfd_write_contents */
-    _bfd_write_archive_contents,
-    bfd_false
-  },
-
-  BFD_JUMP_TABLE_GENERIC (coff),
-  BFD_JUMP_TABLE_COPY (coff),
-  BFD_JUMP_TABLE_CORE (_bfd_nocore),
-  BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-  BFD_JUMP_TABLE_SYMBOLS (coff),
-  BFD_JUMP_TABLE_RELOCS (coff),
-  BFD_JUMP_TABLE_WRITE (coff),
-  BFD_JUMP_TABLE_LINK (coff),
-  BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
-
-const bfd_target
-TARGET_LITTLE_SYM =
-{
-  TARGET_LITTLE_NAME,
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_LITTLE,		/* data byte order is little */
-  BFD_ENDIAN_LITTLE,		/* header byte order is little */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
-   | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
-  
-  0,				/* leading underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-  bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-  bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
-  
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-  bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-  bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
-
-/* Note that we allow an object file to be treated as a core file as well. */
-  {
-    _bfd_dummy_target,
-    pe_object_p, 		/* bfd_check_format */
-    bfd_generic_archive_p,
-    pe_object_p
-  },
-  {
-    bfd_false,
-    coff_mkobject,
-    _bfd_generic_mkarchive, 	/* bfd_set_format */
-    bfd_false
-  },
-  {
-    bfd_false,
-    coff_write_object_contents, /* bfd_write_contents */
-    _bfd_write_archive_contents,
-    bfd_false
-  },
-
-  BFD_JUMP_TABLE_GENERIC (coff),
-  BFD_JUMP_TABLE_COPY (coff),
-  BFD_JUMP_TABLE_CORE (_bfd_nocore),
-  BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-  BFD_JUMP_TABLE_SYMBOLS (coff),
-  BFD_JUMP_TABLE_RELOCS (coff),
-  BFD_JUMP_TABLE_WRITE (coff),
-  BFD_JUMP_TABLE_LINK (coff),
-  BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
-
+CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, (SEC_LINK_ONCE | SEC_LINK_DUPLICATES), 0, & TARGET_LITTLE_SYM)
+CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, (SEC_LINK_ONCE | SEC_LINK_DUPLICATES), 0, & TARGET_BIG_SYM)
diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c
index 051eb86..9ca395b 100644
--- a/bfd/coff-mips.c
+++ b/bfd/coff-mips.c
@@ -1,5 +1,5 @@
 /* BFD back-end for MIPS Extended-Coff files.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Original version by Per Bothner.
    Full support added by Ian Lance Taylor, ian@cygnus.com.
@@ -273,10 +273,10 @@
 	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
-  { 8 },
-  { 9 },
-  { 10 },
-  { 11 },
+  EMPTY_HOWTO (8),
+  EMPTY_HOWTO (9),
+  EMPTY_HOWTO (10),
+  EMPTY_HOWTO (11),
 
   /* This reloc is a Cygnus extension used when generating position
      independent code for embedded systems.  It represents a 16 bit PC
@@ -334,13 +334,13 @@
 	 0xffff,		/* dst_mask */
 	 true),			/* pcrel_offset */
 
-  { 15 },
-  { 16 },
-  { 17 },
-  { 18 },
-  { 19 },
-  { 20 },
-  { 21 },
+  EMPTY_HOWTO (15),
+  EMPTY_HOWTO (16),
+  EMPTY_HOWTO (17),
+  EMPTY_HOWTO (18),
+  EMPTY_HOWTO (19),
+  EMPTY_HOWTO (20),
+  EMPTY_HOWTO (21),
 
   /* This reloc is a Cygnus extension used when generating position
      independent code for embedded systems.  It represents an entry in
@@ -569,7 +569,7 @@
 
 static void
 mips_adjust_reloc_out (abfd, rel, intern)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      const arelent *rel;
      struct internal_reloc *intern;
 {
@@ -604,13 +604,13 @@
 		    input_section,
 		    output_bfd,
 		    error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
-     PTR data;
+     PTR data ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   if (output_bfd != (bfd *) NULL
       && (symbol->flags & BSF_SECTION_SYM) == 0
@@ -651,13 +651,13 @@
 		  input_section,
 		  output_bfd,
 		  error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_reloc_status_type ret;
   bfd_vma relocation;
@@ -933,13 +933,13 @@
 		  input_section,
 		  output_bfd,
 		  error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_reloc_status_type ret;
   bfd_vma relocation;
@@ -1109,13 +1109,13 @@
 		   input_section,
 		   output_bfd,
 		   error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   return bfd_reloc_ok;
 }
@@ -1124,7 +1124,7 @@
 
 static reloc_howto_type *
 mips_bfd_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   int mips_type;
@@ -2329,9 +2329,9 @@
 
 static boolean
 mips_relax_pcrel16 (info, input_bfd, input_section, h, location, address)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      bfd *input_bfd;
-     asection *input_section;
+     asection *input_section ATTRIBUTE_UNUSED;
      struct ecoff_link_hash_entry *h;
      bfd_byte *location;
      bfd_vma address;
@@ -2511,7 +2511,8 @@
     mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
     _bfd_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags,
     _bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table,
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL
   },
   /* Supported architecture.  */
   bfd_arch_mips,
@@ -2600,6 +2601,8 @@
 /* GC of sections is not done.  */
 #define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections
 
+extern const bfd_target ecoff_big_vec;
+
 const bfd_target ecoff_little_vec =
 {
   "ecoff-littlemips",		/* name */
@@ -2639,6 +2642,8 @@
      BFD_JUMP_TABLE_LINK (_bfd_ecoff),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  & ecoff_big_vec,
+  
   (PTR) &mips_ecoff_backend_data
 };
 
@@ -2680,6 +2685,8 @@
      BFD_JUMP_TABLE_LINK (_bfd_ecoff),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  & ecoff_little_vec,
+  
   (PTR) &mips_ecoff_backend_data
 };
 
@@ -2722,5 +2729,7 @@
      BFD_JUMP_TABLE_LINK (_bfd_ecoff),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) &mips_ecoff_backend_data
 };
diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c
index cf45044..6d5e781 100644
--- a/bfd/coff-ppc.c
+++ b/bfd/coff-ppc.c
@@ -1,5 +1,5 @@
 /* BFD back-end for PowerPC Microsoft Portable Executable files.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    Original version pieced together by Kim Knuttila (krk@cygnus.com)
@@ -906,10 +906,10 @@
 static boolean
 ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
      bfd *abfd;
-     struct bfd_link_info *info;
-     asection *sec;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
      int sym;
-     enum toc_type toc_kind;
+     enum toc_type toc_kind ATTRIBUTE_UNUSED;
 {
   struct ppc_coff_link_hash_entry *h;
   const char *name;
@@ -1007,7 +1007,7 @@
    appear in the output .reloc section. */
 
 static boolean in_reloc_p(abfd, howto)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      reloc_howto_type *howto;
 {
   return 
@@ -1700,7 +1700,7 @@
 
 boolean
 ppc_allocate_toc_section (info) 
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
 {
   asection *s;
   bfd_byte *foo;
@@ -1806,13 +1806,13 @@
 		 input_section,
 		 output_bfd,
 		 error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   UN_IMPL("REFHI");
   DUMP_RELOC("REFHI",reloc_entry);
@@ -1860,13 +1860,13 @@
 		input_section,
 		output_bfd,
 		error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   UN_IMPL("PAIR");
   DUMP_RELOC("PAIR",reloc_entry);
@@ -1886,13 +1886,13 @@
 		 input_section,
 		 output_bfd,
 		 error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   UN_IMPL("TOCREL16");
   DUMP_RELOC("TOCREL16",reloc_entry);
@@ -1945,13 +1945,13 @@
 		  input_section,
 		  output_bfd,
 		  error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   UN_IMPL("SECREL");
   DUMP_RELOC("SECREL",reloc_entry);
@@ -1970,13 +1970,13 @@
 		   input_section,
 		   output_bfd,
 		   error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   UN_IMPL("SECTION");
   DUMP_RELOC("SECTION",reloc_entry);
@@ -1995,13 +1995,13 @@
 		  input_section,
 		  output_bfd,
 		  error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   UN_IMPL("IMGLUE");
   DUMP_RELOC("IMGLUE",reloc_entry);
@@ -2093,11 +2093,11 @@
 
 static reloc_howto_type *
 coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      struct internal_reloc *rel;
-     struct coff_link_hash_entry *h;
-     struct internal_syment *sym;
+     struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
+     struct internal_syment *sym ATTRIBUTE_UNUSED;
      bfd_vma *addendp;
 {
   reloc_howto_type *howto;
@@ -2175,7 +2175,7 @@
 
 static reloc_howto_type *
 ppc_coff_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   switch (code)
@@ -2245,7 +2245,7 @@
 static void
 ppc_coff_swap_sym_in_hook (abfd, ext1, in1)
      bfd            *abfd;
-     PTR ext1;
+     PTR ext1 ATTRIBUTE_UNUSED;
      PTR in1;
 {
   struct internal_syment      *in = (struct internal_syment *)in1;
@@ -2824,11 +2824,15 @@
 #endif
 
 
+/* Forward declaration for use by alternative_target field.  */
+#ifdef TARGET_BIG_SYM
+extern const bfd_target TARGET_BIG_SYM;
+#endif
+
 /* The transfer vectors that lead the outside world to all of the above. */
 
 #ifdef TARGET_LITTLE_SYM
-const bfd_target
-TARGET_LITTLE_SYM =
+const bfd_target TARGET_LITTLE_SYM =
 {
   TARGET_LITTLE_NAME,		/* name or coff-arm-little */
   bfd_target_coff_flavour,
@@ -2874,14 +2878,20 @@
   BFD_JUMP_TABLE_WRITE (coff),
   BFD_JUMP_TABLE_LINK (coff),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+  /* Alternative_target.  */
+#ifdef TARGET_BIG_SYM
+  & TARGET_BIG_SYM,
+#else
+  NULL,
+#endif
   
-  COFF_SWAP_TABLE,
+  COFF_SWAP_TABLE
 };
 #endif
 
 #ifdef TARGET_BIG_SYM
-const bfd_target
-TARGET_BIG_SYM =
+const bfd_target TARGET_BIG_SYM =
 {
   TARGET_BIG_NAME,
   bfd_target_coff_flavour,	
@@ -2928,7 +2938,15 @@
   BFD_JUMP_TABLE_LINK (coff),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
-  COFF_SWAP_TABLE,
+
+  /* Alternative_target.  */
+#ifdef TARGET_LITTLE_SYM
+  & TARGET_LITTLE_SYM,
+#else
+  NULL,
+#endif
+  
+  COFF_SWAP_TABLE
 };
 
 #endif
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index 6b4cd44..6923000 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -1,5 +1,6 @@
 /* BFD back-end for IBM RS/6000 "XCOFF" files.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    FIXME: Can someone provide a transliteration of this name into ASCII?
    Using the following chars caused a compiler warning on HIUX (so I replaced
    them with octal escapes), and isn't useful without an understanding of what
@@ -139,8 +140,8 @@
 
 static boolean
 xcoff_is_local_label_name (abfd, name)
-     bfd *abfd;
-     const char *name;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
 {
   return false;
 }
@@ -258,7 +259,7 @@
 	 0xffff,        	/* dst_mask */                             
 	 false),                /* pcrel_offset */
   
-  { 7 },
+  EMPTY_HOWTO (7),
   
   /* Non modifiable absolute branch.  */
   HOWTO (8,	                /* type */                                 
@@ -275,7 +276,7 @@
 	 0x3fffffc,        	/* dst_mask */                             
 	 false),                /* pcrel_offset */
   
-  { 9 },
+  EMPTY_HOWTO (9),
 
   /* Non modifiable relative branch.  */
   HOWTO (0xa,	                /* type */                                 
@@ -292,7 +293,7 @@
 	 0x3fffffc,        	/* dst_mask */                             
 	 false),                /* pcrel_offset */
   
-  { 0xb },
+  EMPTY_HOWTO (0xb),
 
   /* Indirect load.  */
   HOWTO (0xc,	                /* type */                                 
@@ -324,7 +325,7 @@
 	 0xffff,        	/* dst_mask */                             
 	 false),                /* pcrel_offset */
   
-  { 0xe },
+  EMPTY_HOWTO (0xe),
   
   /* Non-relocating reference.  */
   HOWTO (0xf,	                /* type */                                 
@@ -341,8 +342,8 @@
 	 0,     	   	/* dst_mask */                             
 	 false),                /* pcrel_offset */
   
-  { 0x10 },
-  { 0x11 },
+  EMPTY_HOWTO (0x10),
+  EMPTY_HOWTO (0x11),
   
   /* TOC relative indirect load.  */
   HOWTO (0x12,	                /* type */                                 
@@ -518,7 +519,7 @@
 
 static reloc_howto_type *
 xcoff_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   switch (code)
@@ -956,7 +957,7 @@
 static boolean
 xcoff_write_armap (abfd, elength, map, orl_count, stridx)
      bfd *abfd;
-     unsigned int elength;
+     unsigned int elength ATTRIBUTE_UNUSED;
      struct orl *map;
      unsigned int orl_count;
      int stridx;
@@ -1293,7 +1294,7 @@
 static int
 _bfd_xcoff_sizeof_headers (abfd, reloc)
      bfd *abfd;
-     boolean reloc;
+     boolean reloc ATTRIBUTE_UNUSED;
 {
   int size;
 
@@ -1414,5 +1415,7 @@
      BFD_JUMP_TABLE_LINK (_bfd_xcoff),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff),
 
-  COFF_SWAP_TABLE,
+  NULL,
+  
+  COFF_SWAP_TABLE
 };
diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c
index e3d6eec..cd54216 100644
--- a/bfd/coff-sh.c
+++ b/bfd/coff-sh.c
@@ -1,5 +1,5 @@
 /* BFD back-end for Hitachi Super-H COFF binaries.
-   Copyright 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    Written by Steve Chamberlain, <sac@cygnus.com>.
    Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
@@ -32,7 +32,6 @@
 static bfd_reloc_status_type sh_reloc
   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
 static long get_symbol_value PARAMS ((asymbol *));
-static boolean sh_merge_private_data PARAMS ((bfd *, bfd *));
 static boolean sh_relax_section
   PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
 static boolean sh_relax_delete_bytes
@@ -59,16 +58,16 @@
    in coff/internal.h which we do not expect to ever see.  */
 static reloc_howto_type sh_coff_howtos[] =
 {
-  { 0 },
-  { 1 },
-  { 2 },
-  { 3 }, /* R_SH_PCREL8 */
-  { 4 }, /* R_SH_PCREL16 */
-  { 5 }, /* R_SH_HIGH8 */
-  { 6 }, /* R_SH_IMM24 */
-  { 7 }, /* R_SH_LOW16 */
-  { 8 },
-  { 9 }, /* R_SH_PCDISP8BY4 */
+  EMPTY_HOWTO (0),
+  EMPTY_HOWTO (1),
+  EMPTY_HOWTO (2),
+  EMPTY_HOWTO (3), /* R_SH_PCREL8 */
+  EMPTY_HOWTO (4), /* R_SH_PCREL16 */
+  EMPTY_HOWTO (5), /* R_SH_HIGH8 */
+  EMPTY_HOWTO (6), /* R_SH_IMM24 */
+  EMPTY_HOWTO (7), /* R_SH_LOW16 */
+  EMPTY_HOWTO (8),
+  EMPTY_HOWTO (9), /* R_SH_PCDISP8BY4 */
 
   HOWTO (R_SH_PCDISP8BY2,	/* type */
 	 1,			/* rightshift */
@@ -84,7 +83,7 @@
 	 0xff,			/* dst_mask */
 	 true),			/* pcrel_offset */
 
-  { 11 }, /* R_SH_PCDISP8 */
+  EMPTY_HOWTO (11), /* R_SH_PCDISP8 */
 
   HOWTO (R_SH_PCDISP,		/* type */
 	 1,			/* rightshift */
@@ -100,7 +99,7 @@
 	 0xfff,			/* dst_mask */
 	 true),			/* pcrel_offset */
 
-  { 13 },
+  EMPTY_HOWTO (13),
 
   HOWTO (R_SH_IMM32,		/* type */
 	 0,			/* rightshift */
@@ -116,13 +115,13 @@
 	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
-  { 15 },
-  { 16 }, /* R_SH_IMM8 */
-  { 17 }, /* R_SH_IMM8BY2 */
-  { 18 }, /* R_SH_IMM8BY4 */
-  { 19 }, /* R_SH_IMM4 */
-  { 20 }, /* R_SH_IMM4BY2 */
-  { 21 }, /* R_SH_IMM4BY4 */
+  EMPTY_HOWTO (15),
+  EMPTY_HOWTO (16), /* R_SH_IMM8 */
+  EMPTY_HOWTO (17), /* R_SH_IMM8BY2 */
+  EMPTY_HOWTO (18), /* R_SH_IMM8BY4 */
+  EMPTY_HOWTO (19), /* R_SH_IMM4 */
+  EMPTY_HOWTO (20), /* R_SH_IMM4BY2 */
+  EMPTY_HOWTO (21), /* R_SH_IMM4BY4 */
 
   HOWTO (R_SH_PCRELIMM8BY2,	/* type */
 	 1,			/* rightshift */
@@ -382,7 +381,7 @@
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   unsigned long insn;
   bfd_vma sym_value;
@@ -442,31 +441,7 @@
   return bfd_reloc_ok;
 }
 
-/* This routine checks for linking big and little endian objects
-   together.  */
-
-static boolean
-sh_merge_private_data (ibfd, obfd)
-     bfd *ibfd;
-     bfd *obfd;
-{
-  if (ibfd->xvec->byteorder != obfd->xvec->byteorder
-      && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
-    {
-      (*_bfd_error_handler)
-	("%s: compiled for a %s endian system and target is %s endian",
-	 bfd_get_filename (ibfd),
-	 bfd_big_endian (ibfd) ? "big" : "little",
-	 bfd_big_endian (obfd) ? "big" : "little");
-
-      bfd_set_error (bfd_error_wrong_format);
-      return false;
-    }
-
-  return true;
-}
-
-#define coff_bfd_merge_private_bfd_data sh_merge_private_data
+#define coff_bfd_merge_private_bfd_data _bfd_generic_verify_endian_match
 
 /* We can do relaxing.  */
 #define coff_bfd_relax_section sh_relax_section
@@ -2437,7 +2412,7 @@
 static boolean
 sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
 		     relocs, syms, sections)
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
      bfd *input_bfd;
      asection *input_section;
@@ -2704,89 +2679,20 @@
 
 /* The target vectors.  */
 
-const bfd_target shcoff_vec =
-{
-  "coff-sh",			/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
+CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NULL)
 
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE),
+#ifdef TARGET_SHL_SYM
+#define TARGET_SYM TARGET_SHL_SYM
+#else
+#define TARGET_SYM shlcoff_vec
+#endif
+     
+#ifndef TARGET_SHL_NAME
+#define TARGET_SHL_NAME "coff-shl"
+#endif
 
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC),
-  '_',				/* leading symbol underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-  bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-  bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-  bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-  bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
-
-  {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-     bfd_false},
-  {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
-
-  BFD_JUMP_TABLE_GENERIC (coff),
-  BFD_JUMP_TABLE_COPY (coff),
-  BFD_JUMP_TABLE_CORE (_bfd_nocore),
-  BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-  BFD_JUMP_TABLE_SYMBOLS (coff),
-  BFD_JUMP_TABLE_RELOCS (coff),
-  BFD_JUMP_TABLE_WRITE (coff),
-  BFD_JUMP_TABLE_LINK (coff),
-  BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
-
-const bfd_target shlcoff_vec =
-{
-  "coff-shl",			/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_LITTLE,		/* data byte order is little */
-  BFD_ENDIAN_LITTLE,		/* header byte order is little endian too*/
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC),
-  '_',				/* leading symbol underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-  bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-  bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-  bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-  bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
-
-  {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},   
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-     bfd_false},
-  {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
-
-  BFD_JUMP_TABLE_GENERIC (coff),
-  BFD_JUMP_TABLE_COPY (coff),
-  BFD_JUMP_TABLE_CORE (_bfd_nocore),
-  BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-  BFD_JUMP_TABLE_SYMBOLS (coff),
-  BFD_JUMP_TABLE_RELOCS (coff),
-  BFD_JUMP_TABLE_WRITE (coff),
-  BFD_JUMP_TABLE_LINK (coff),
-  BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
+CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE, 0, '_', NULL)
+     
 
 /* Some people want versions of the SH COFF target which do not align
    to 16 byte boundaries.  We implement that by adding a couple of new
@@ -2874,6 +2780,8 @@
 #define coff_small_get_section_contents_in_window \
   coff_get_section_contents_in_window
 
+extern const bfd_target shlcoff_small_vec;
+
 const bfd_target shcoff_small_vec =
 {
   "coff-sh-small",		/* name */
@@ -2913,6 +2821,8 @@
   BFD_JUMP_TABLE_LINK (coff),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  & shlcoff_small_vec,
+  
   (PTR) &bfd_coff_small_swap_table
 };
 
@@ -2955,5 +2865,7 @@
   BFD_JUMP_TABLE_LINK (coff),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  & shcoff_small_vec,
+  
   (PTR) &bfd_coff_small_swap_table
 };
diff --git a/bfd/coff-sparc.c b/bfd/coff-sparc.c
index bc2cf15..5e919da 100644
--- a/bfd/coff-sparc.c
+++ b/bfd/coff-sparc.c
@@ -1,5 +1,6 @@
 /* BFD back-end for Sparc COFF files.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -77,13 +78,13 @@
 static bfd_reloc_status_type
 bfd_coff_generic_reloc (abfd, reloc_entry, symbol, data, input_section,
 			output_bfd, error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
-     PTR data;
+     PTR data ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   if (output_bfd != (bfd *) NULL
       && (symbol->flags & BSF_SECTION_SYM) == 0)
@@ -158,7 +159,7 @@
 
 static reloc_howto_type *
 coff_sparc_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -202,55 +203,12 @@
 
 #include "coffcode.h"
 
-const bfd_target
-#ifdef TARGET_SYM
-  TARGET_SYM =
-#else
-  sparccoff_vec =
+#ifndef TARGET_SYM
+#define TARGET_SYM sparccoff_vec
 #endif
-{
-#ifdef TARGET_NAME
-  TARGET_NAME,
-#else
-  "coff-sparc",			/* name */
+
+#ifndef TARGET_NAME
+#define TARGET_NAME "coff-sparc"
 #endif
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,	/* data byte order is big */
-  BFD_ENDIAN_BIG,	/* header byte order is big */
 
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
-  '_',				/* leading underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
-
-/* Note that we allow an object file to be treated as a core file as well. */
-    {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-       bfd_generic_archive_p, coff_object_p},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-       bfd_false},
-    {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-       _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
+CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL)
diff --git a/bfd/coff-stgo32.c b/bfd/coff-stgo32.c
index 21724fe..f1d38ba 100644
--- a/bfd/coff-stgo32.c
+++ b/bfd/coff-stgo32.c
@@ -1,5 +1,5 @@
 /* BFD back-end for Intel 386 COFF files (go32 variant with a stub).
-   Copyright 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Robert Hoehne.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -223,9 +223,9 @@
 
 static void
 adjust_filehdr_out_post  (abfd, in, out)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      PTR in;
-     PTR out;
+     PTR out ATTRIBUTE_UNUSED;
 {
   struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
   /* undo the above change */
@@ -234,8 +234,8 @@
 
 static void
 adjust_scnhdr_in_post  (abfd, ext, in)
-     bfd *abfd;
-     PTR ext;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     PTR ext ATTRIBUTE_UNUSED;
      PTR in;
 {
   struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
@@ -247,9 +247,9 @@
 
 static void
 adjust_scnhdr_out_pre  (abfd, in, out)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      PTR in;
-     PTR out;
+     PTR out ATTRIBUTE_UNUSED;
 {
   struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
 
@@ -260,9 +260,9 @@
 
 static void
 adjust_scnhdr_out_post (abfd, in, out)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      PTR in;
-     PTR out;
+     PTR out ATTRIBUTE_UNUSED;
 {
   struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
 
@@ -273,12 +273,12 @@
 
 static void
 adjust_aux_in_post  (abfd, ext1, type, class, indx, numaux, in1)
-     bfd *abfd;
-     PTR ext1;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     PTR ext1 ATTRIBUTE_UNUSED;
      int type;
      int class;
-     int indx;
-     int numaux;
+     int indx ATTRIBUTE_UNUSED;
+     int numaux ATTRIBUTE_UNUSED;
      PTR in1;
 {
   union internal_auxent *in = (union internal_auxent *) in1;
@@ -291,13 +291,13 @@
 
 static void
 adjust_aux_out_pre  (abfd, inp, type, class, indx, numaux, extp)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      PTR inp;
      int type;
      int class;
-     int indx;
-     int numaux;
-     PTR extp;
+     int indx ATTRIBUTE_UNUSED;
+     int numaux ATTRIBUTE_UNUSED;
+     PTR extp ATTRIBUTE_UNUSED;
 {
   union internal_auxent *in = (union internal_auxent *) inp;
 
@@ -309,13 +309,13 @@
 
 static void
 adjust_aux_out_post (abfd, inp, type, class, indx, numaux, extp)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      PTR inp;
      int type;
      int class;
-     int indx;
-     int numaux;
-     PTR extp;
+     int indx ATTRIBUTE_UNUSED;
+     int numaux ATTRIBUTE_UNUSED;
+     PTR extp ATTRIBUTE_UNUSED;
 {
   union internal_auxent *in = (union internal_auxent *) inp;
 
diff --git a/bfd/coff-tic30.c b/bfd/coff-tic30.c
index 3ff8c59..a971f76 100644
--- a/bfd/coff-tic30.c
+++ b/bfd/coff-tic30.c
@@ -1,5 +1,5 @@
 /* BFD back-end for TMS320C30 coff binaries.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -41,7 +41,7 @@
 	 "32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
   HOWTO (R_TIC30_PC16, 2, 1, 16, true, 0, complain_overflow_signed, NULL,
 	 "PCREL", false, 0x0000FFFF, 0x0000FFFF, false),
-  {-1}
+  EMPTY_HOWTO (-1)
 };
 
 #ifndef coff_bfd_reloc_type_lookup
@@ -52,7 +52,7 @@
    and coff implementations. */
 reloc_howto_type *
 tic30_coff_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   switch (code)
@@ -202,5 +202,7 @@
   BFD_JUMP_TABLE_LINK (coff),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   COFF_SWAP_TABLE
 };
diff --git a/bfd/coff-tic80.c b/bfd/coff-tic80.c
index 043c8a0..1132ea6 100644
--- a/bfd/coff-tic80.c
+++ b/bfd/coff-tic80.c
@@ -1,5 +1,5 @@
 /* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP).
-   Copyright 1996, 1997, 1999 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
    Written by Fred Fish (fnf@cygnus.com)
 
@@ -359,13 +359,13 @@
 static bfd_reloc_status_type
 ppbase_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
 	      error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol_in;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol_in ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   /* FIXME.  */
   abort ();
@@ -376,13 +376,13 @@
 static bfd_reloc_status_type
 glob15_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
 	      error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol_in;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol_in ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   /* FIXME.  */
   abort ();
@@ -393,13 +393,13 @@
 static bfd_reloc_status_type
 glob16_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
 	      error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol_in;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol_in ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   /* FIXME.  */
   abort ();
@@ -410,13 +410,13 @@
 static bfd_reloc_status_type
 local16_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
 	      error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol_in;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol_in ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   /* FIXME.  */
   abort ();
@@ -452,11 +452,11 @@
 
 static reloc_howto_type *
 coff_tic80_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      struct internal_reloc *rel;
-     struct coff_link_hash_entry *h;
-     struct internal_syment *sym;
+     struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
+     struct internal_syment *sym ATTRIBUTE_UNUSED;
      bfd_vma *addendp;
 {
   arelent genrel;
@@ -715,45 +715,4 @@
 #undef C_LASTENT		/* Clashes with TIc80's C_STATLAB */
 #include "coffcode.h"
 
-const bfd_target 
-  tic80coff_vec =
-{
-  "coff-tic80",			/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_LITTLE,		/* data byte order is little (arch supports both) */
-  BFD_ENDIAN_LITTLE,		/* header byte order is little */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
-  '_',				/* leading underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
-
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
- {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-   bfd_false},
- {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE
- };
+CREATE_LITTLE_COFF_TARGET_VEC (tic80coff_vec, "coff-tic80", D_PAGED, 0, '_', NULL)
diff --git a/bfd/coff-w65.c b/bfd/coff-w65.c
index 28d68c3..0379bfb 100644
--- a/bfd/coff-w65.c
+++ b/bfd/coff-w65.c
@@ -401,45 +401,4 @@
   bfd_coff_reloc16_get_relocated_section_contents
 #define coff_bfd_relax_section bfd_coff_reloc16_relax_section
 
-
-
-bfd_target w65_vec =
-{
-  "coff-w65",			/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_LITTLE,		/* data byte order is little */
-  BFD_ENDIAN_LITTLE,		/* header byte order is little */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE ),
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC),	/* section flags */
-  '_',				/* leading char */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-  bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-  bfd_getl16, bfd_getl_signed_16, bfd_putl16,	/* data */
-  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
-  bfd_getl32, bfd_getl_signed_32, bfd_putl32,
-  bfd_getl16, bfd_getl_signed_16, bfd_putl16,	/* hdrs */
-
-  {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-   bfd_false},
-  {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
+CREATE_LITTLE_COFF_TARGET_VEC (w65_vec, "coff-w95", BFD_IS_RELAXABLE, 0, '_', NULL)
diff --git a/bfd/coff-we32k.c b/bfd/coff-we32k.c
index 826bbe3..c559ad7 100644
--- a/bfd/coff-we32k.c
+++ b/bfd/coff-we32k.c
@@ -1,5 +1,5 @@
 /* BFD back-end for we32k COFF files.
-   Copyright (C) 1992, 93, 94, 95, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 97, 1999 Free Software Foundation, Inc.
    Contributed by Brendan Kehoe (brendan@cs.widener.edu).
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -29,21 +29,21 @@
 
 static reloc_howto_type howto_table[] = 
 {
-    {0},
-    {1},
-    {2},
-    {3},
-    {4},
-    {5},
+    EMPTY_HOWTO (0),
+    EMPTY_HOWTO (1),
+    EMPTY_HOWTO (2),
+    EMPTY_HOWTO (3),
+    EMPTY_HOWTO (4),
+    EMPTY_HOWTO (5),
   HOWTO(R_DIR32,	       0,  2, 	32, false, 0,complain_overflow_bitfield, 0, "dir32",	true, 0xffffffff,0xffffffff, false),
-    {7},
-    {010},
-    {011},
-    {012},
-    {013},
-    {014},
-    {015},
-    {016},
+    EMPTY_HOWTO (7),
+    EMPTY_HOWTO (010),
+    EMPTY_HOWTO (011),
+    EMPTY_HOWTO (012),
+    EMPTY_HOWTO (013),
+    EMPTY_HOWTO (014),
+    EMPTY_HOWTO (015),
+    EMPTY_HOWTO (016),
   HOWTO(R_RELBYTE,	       0,  0,  	8,  false, 0, complain_overflow_bitfield, 0, "8",	true, 0x000000ff,0x000000ff, false),
   HOWTO(R_RELWORD,	       0,  1, 	16, false, 0, complain_overflow_bitfield, 0, "16",	true, 0x0000ffff,0x0000ffff, false),
   HOWTO(R_RELLONG,	       0,  2, 	32, false, 0, complain_overflow_bitfield, 0, "32",	true, 0xffffffff,0xffffffff, false),
@@ -65,45 +65,4 @@
 
 #define coff_write_armap bsd_write_armap
 
-const bfd_target we32kcoff_vec =
-{
-  "coff-we32k",			/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
-  0,				/* leading underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
-
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
- {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-   bfd_false},
- {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
+CREATE_BIG_COFF_TARGET_VEC (we32kcoff_vec, "coff-we32k", 0, 0, 0, NULL)
diff --git a/bfd/coff-z8k.c b/bfd/coff-z8k.c
index 04049e89..21f29a8 100644
--- a/bfd/coff-z8k.c
+++ b/bfd/coff-z8k.c
@@ -237,44 +237,4 @@
   bfd_coff_reloc16_get_relocated_section_contents
 #define coff_bfd_relax_section bfd_coff_reloc16_relax_section
 
-const bfd_target z8kcoff_vec =
-{
-  "coff-z8k",			/* name */
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,		/* data byte order is big */
-  BFD_ENDIAN_BIG,		/* header byte order is big */
-
-  (HAS_RELOC | EXEC_P |		/* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT),
-
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC),	/* section flags */
-  '_',				/* leading symbol underscore */
-  '/',				/* ar_pad_char */
-  15,				/* ar_max_namelen */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
-
-  {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-   bfd_false},
-  {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
-  COFF_SWAP_TABLE,
-};
+CREATE_BIG_COFF_TARGET_VEC (z8kcoff_vec, "coff-z8k", 0, 0, '_', NULL)
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 383719c..f905c94 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1,5 +1,5 @@
 /* Support for the generic parts of most COFF variants, for BFD.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -456,7 +456,7 @@
  */
 static flagword
 styp_to_sec_flags (abfd, hdr, name)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      PTR hdr;
      const char *name;
 {
@@ -588,6 +588,12 @@
          can't call slurp_symtab, because the linker doesn't want the
          swapped symbols.  */
 
+      /* COMDAT sections are special.  The first symbol is the section
+	 symbol, which tells what kind of COMDAT section it is.  The
+	 *second* symbol is the "comdat symbol" - the one with the
+	 unique name.  GNU uses the section symbol for the unique
+	 name; MS uses ".text" for every comdat section.  Sigh.  - DJ */
+
       if (_bfd_coff_get_external_symbols (abfd))
 	{
 	  bfd_byte *esym, *esymend;
@@ -629,10 +635,23 @@
 					    isym.n_type, isym.n_sclass,
 					    0, isym.n_numaux, (PTR) &aux);
 
+		      /* FIXME: Microsoft uses NODUPLICATES and
+			 ASSOCIATIVE, but gnu uses ANY and SAME_SIZE.
+			 Unfortunately, gnu doesn't do the comdat
+			 symbols right.  So, until we can fix it to do
+			 the right thing, we are temporarily disabling
+			 comdats for the MS types (they're used in
+			 DLLs and C++, but we don't support *their*
+			 C++ libraries anyway - DJ */
+
 		      switch (aux.x_scn.x_comdat)
 			{
 			case IMAGE_COMDAT_SELECT_NODUPLICATES:
+#if 0
 			  sec_flags |= SEC_LINK_DUPLICATES_ONE_ONLY;
+#else
+			  sec_flags &= ~SEC_LINK_ONCE;
+#endif
 			  break;
 
 			default:
@@ -649,8 +668,12 @@
 			  break;
 
 			case IMAGE_COMDAT_SELECT_ASSOCIATIVE:
+#if 0
 			  /* FIXME: This is not currently implemented.  */
 			  sec_flags |= SEC_LINK_DUPLICATES_DISCARD;
+#else
+			  sec_flags &= ~SEC_LINK_ONCE;
+#endif
 			  break;
 			}
 
@@ -994,7 +1017,7 @@
 
 static boolean
 coff_bad_format_hook (abfd, filehdr)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      PTR filehdr;
 {
   struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
@@ -1091,7 +1114,7 @@
 
 static void
 coff_set_alignment_hook (abfd, section, scnhdr)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      asection * section;
      PTR scnhdr;
 {
@@ -1131,7 +1154,7 @@
 
 static void
 coff_set_alignment_hook (abfd, section, scnhdr)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      asection * section;
      PTR scnhdr;
 {
@@ -1205,6 +1228,9 @@
     }
 #endif
 
+#ifdef COFF_WITH_PE
+  section->lma = hdr->s_vaddr;
+#endif
 }
 #undef ALIGN_SET
 #undef ELIFALIGN_SET
@@ -1290,7 +1316,7 @@
 coff_mkobject_hook (abfd, filehdr, aouthdr)
      bfd * abfd;
      PTR filehdr;
-     PTR aouthdr;
+     PTR aouthdr ATTRIBUTE_UNUSED;
 {
   struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
   coff_data_type *coff;
@@ -1396,11 +1422,14 @@
       arch = bfd_arch_arm;
       switch (internal_f->f_flags & F_ARM_ARCHITECTURE_MASK)
 	{
-	case F_ARM_2:  machine = bfd_mach_arm_2;  break;
-	case F_ARM_3:  machine = bfd_mach_arm_3;  break;
-	default:
-	case F_ARM_4:  machine = bfd_mach_arm_4;  break;
-	case F_ARM_4T: machine = bfd_mach_arm_4T; break;
+        case F_ARM_2:  machine = bfd_mach_arm_2;  break;
+        case F_ARM_2a: machine = bfd_mach_arm_2a; break;
+        case F_ARM_3:  machine = bfd_mach_arm_3;  break;
+        default:
+        case F_ARM_3M: machine = bfd_mach_arm_3M; break;
+        case F_ARM_4:  machine = bfd_mach_arm_4;  break;
+        case F_ARM_4T: machine = bfd_mach_arm_4T; break;
+        case F_ARM_5:  machine = bfd_mach_arm_5;  break;
 	}
       break;
 #endif
@@ -1649,7 +1678,7 @@
 
 static boolean
 symname_in_debug_hook (abfd, sym)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      struct internal_syment *sym;
 {
   return SYMNAME_IN_DEBUG (sym) ? true : false;
@@ -1673,7 +1702,7 @@
 /*ARGSUSED*/
 static boolean
 coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      combined_entry_type *table_base;
      combined_entry_type *symbol;
      unsigned int indaux;
@@ -1713,11 +1742,11 @@
 /*ARGSUSED*/
 static boolean
 coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux)
-     bfd *abfd;
-     combined_entry_type *table_base;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     combined_entry_type *table_base ATTRIBUTE_UNUSED;
      combined_entry_type *symbol;
      unsigned int indaux;
-     combined_entry_type *aux;
+     combined_entry_type *aux ATTRIBUTE_UNUSED;
 {
   /* Return true if we don't want to pointerize this aux entry, which
      is the case for the lastfirst aux entry for a C_LEAFPROC symbol.  */
@@ -1742,12 +1771,12 @@
 
 static boolean
 coff_print_aux (abfd, file, table_base, symbol, aux, indaux)
-     bfd *abfd;
-     FILE *file;
-     combined_entry_type *table_base;
-     combined_entry_type *symbol;
-     combined_entry_type *aux;
-     unsigned int indaux;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     FILE *file ATTRIBUTE_UNUSED;
+     combined_entry_type *table_base ATTRIBUTE_UNUSED;
+     combined_entry_type *symbol ATTRIBUTE_UNUSED;
+     combined_entry_type *aux ATTRIBUTE_UNUSED;
+     unsigned int indaux ATTRIBUTE_UNUSED;
 {
 #ifdef RS6000COFF_C
   if ((symbol->u.syment.n_sclass == C_EXT
@@ -1937,8 +1966,8 @@
 static boolean
 coff_set_flags (abfd, magicp, flagsp)
      bfd * abfd;
-     unsigned int *magicp;
-     unsigned short *flagsp;
+     unsigned int *magicp ATTRIBUTE_UNUSED;
+     unsigned short *flagsp ATTRIBUTE_UNUSED;
 {
   switch (bfd_get_arch (abfd))
     {
@@ -2027,7 +2056,7 @@
 	    * flagsp |= F_APCS_FLOAT;
 	  
 	  if (PIC_FLAG (abfd))
-	    * flagsp |= F_PIC_INT;
+	    * flagsp |= F_PIC;
 	}
       if (INTERWORK_SET (abfd) && INTERWORK_FLAG (abfd))
 	* flagsp |= F_INTERWORK;
@@ -2039,6 +2068,8 @@
 	case bfd_mach_arm_3M: * flagsp |= F_ARM_3M; break;
 	case bfd_mach_arm_4:  * flagsp |= F_ARM_4;  break;
 	case bfd_mach_arm_4T: * flagsp |= F_ARM_4T; break;
+	case bfd_mach_arm_5:  * flagsp |= F_ARM_5;  break;
+	case bfd_mach_arm_5T: * flagsp |= F_ARM_5;  break; /* XXX - we do not have an F_ARM_5T */
 	}
       return true;
 #endif
@@ -3581,6 +3612,11 @@
 #ifdef COFF_WITH_PE
 	      if (src->u.syment.n_sclass == C_NT_WEAK)
 		dst->symbol.flags = BSF_WEAK;
+	      if (src->u.syment.n_sclass == C_SECTION
+		  && src->u.syment.n_scnum > 0)
+		{
+		  dst->symbol.flags = BSF_LOCAL;
+		}
 #endif
 
 	      if (src->u.syment.n_sclass == C_WEAKEXT)
@@ -3808,7 +3844,7 @@
 
 static boolean
 coff_sym_is_global (abfd, syment)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      struct internal_syment * syment;
 {
   return (syment->n_sclass == OTHER_GLOBAL_CLASS);
@@ -3995,12 +4031,12 @@
 /*ARGSUSED*/
 static reloc_howto_type *
 coff_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd *abfd;
-     asection *sec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
      struct internal_reloc *rel;
-     struct coff_link_hash_entry *h;
-     struct internal_syment *sym;
-     bfd_vma *addendp;
+     struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
+     struct internal_syment *sym ATTRIBUTE_UNUSED;
+     bfd_vma *addendp ATTRIBUTE_UNUSED;
 {
   arelent genrel;
 
@@ -4074,11 +4110,11 @@
 
 static int
 dummy_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
-     bfd *abfd;
-     asection *input_section;
-     arelent *reloc;
-     unsigned int shrink;
-     struct bfd_link_info *link_info;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
+     arelent *reloc ATTRIBUTE_UNUSED;
+     unsigned int shrink ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
 {
   abort ();
 }
@@ -4098,13 +4134,13 @@
 static void
 dummy_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
 			   dst_ptr)
-     bfd *abfd;
-     struct bfd_link_info *link_info;
-     struct bfd_link_order *link_order;
-     arelent *reloc;
-     bfd_byte *data;
-     unsigned int *src_ptr;
-     unsigned int *dst_ptr;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+     struct bfd_link_order *link_order ATTRIBUTE_UNUSED;
+     arelent *reloc ATTRIBUTE_UNUSED;
+     bfd_byte *data ATTRIBUTE_UNUSED;
+     unsigned int *src_ptr ATTRIBUTE_UNUSED;
+     unsigned int *dst_ptr ATTRIBUTE_UNUSED;
 {
   abort ();
 }
@@ -4155,7 +4191,7 @@
 static boolean
 coff_link_output_has_begun (abfd, info)
      bfd * abfd;
-     struct coff_final_link_info * info;
+     struct coff_final_link_info * info ATTRIBUTE_UNUSED;
 {
   return abfd->output_has_begun;
 }
@@ -4168,8 +4204,8 @@
 
 static boolean
 coff_final_link_postscript (abfd, pfinfo)
-     bfd * abfd;
-     struct coff_final_link_info * pfinfo;
+     bfd * abfd ATTRIBUTE_UNUSED;
+     struct coff_final_link_info * pfinfo ATTRIBUTE_UNUSED;
 {
   return true;
 }
@@ -4316,3 +4352,97 @@
 #ifndef coff_bfd_gc_sections
 #define coff_bfd_gc_sections		    bfd_generic_gc_sections
 #endif
+
+#define CREATE_BIG_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE)	\
+const bfd_target VAR =										\
+{												\
+  NAME ,											\
+  bfd_target_coff_flavour,									\
+  BFD_ENDIAN_BIG,		/* data byte order is big */					\
+  BFD_ENDIAN_BIG,		/* header byte order is big */					\
+  /* object flags */										\
+  (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG |						\
+   HAS_SYMS | HAS_LOCALS | WP_TEXT | EXTRA_O_FLAGS),						\
+  /* section flags */										\
+  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | EXTRA_S_FLAGS),			\
+  UNDER,			/* leading symbol underscore */					\
+  '/',				/* ar_pad_char */						\
+  15,				/* ar_max_namelen */						\
+  												\
+  /* Data conversion functions.  */								\
+  bfd_getb64, bfd_getb_signed_64, bfd_putb64,							\
+  bfd_getb32, bfd_getb_signed_32, bfd_putb32,							\
+  bfd_getb16, bfd_getb_signed_16, bfd_putb16,							\
+  												\
+  /* Header conversion functions.  */								\
+  bfd_getb64, bfd_getb_signed_64, bfd_putb64,							\
+  bfd_getb32, bfd_getb_signed_32, bfd_putb32,							\
+  bfd_getb16, bfd_getb_signed_16, bfd_putb16,							\
+												\
+	/* bfd_check_format */									\
+  { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p, _bfd_dummy_target },		\
+	/* bfd_set_format */									\
+  { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false },				\
+	/* bfd_write_contents */								\
+  { bfd_false, coff_write_object_contents, _bfd_write_archive_contents, bfd_false },		\
+												\
+  BFD_JUMP_TABLE_GENERIC (coff),								\
+  BFD_JUMP_TABLE_COPY (coff),									\
+  BFD_JUMP_TABLE_CORE (_bfd_nocore),								\
+  BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),							\
+  BFD_JUMP_TABLE_SYMBOLS (coff),								\
+  BFD_JUMP_TABLE_RELOCS (coff),									\
+  BFD_JUMP_TABLE_WRITE (coff),									\
+  BFD_JUMP_TABLE_LINK (coff),									\
+  BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),							\
+  												\
+  ALTERNATIVE,											\
+  												\
+  COFF_SWAP_TABLE										\
+};
+
+#define CREATE_LITTLE_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE)	\
+const bfd_target VAR =										\
+{												\
+  NAME ,											\
+  bfd_target_coff_flavour,									\
+  BFD_ENDIAN_LITTLE,		/* data byte order is little */					\
+  BFD_ENDIAN_LITTLE,		/* header byte order is little */				\
+	/* object flags */									\
+  (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG |						\
+   HAS_SYMS | HAS_LOCALS | WP_TEXT | EXTRA_O_FLAGS),						\
+	/* section flags */									\
+  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | EXTRA_S_FLAGS),			\
+  UNDER,			/* leading symbol underscore */					\
+  '/',				/* ar_pad_char */						\
+  15,				/* ar_max_namelen */						\
+												\
+  /* Data conversion functions.  */								\
+  bfd_getl64, bfd_getl_signed_64, bfd_putl64,							\
+  bfd_getl32, bfd_getl_signed_32, bfd_putl32,							\
+  bfd_getl16, bfd_getl_signed_16, bfd_putl16,							\
+  /* Header conversion functions.  */								\
+  bfd_getl64, bfd_getl_signed_64, bfd_putl64,							\
+  bfd_getl32, bfd_getl_signed_32, bfd_putl32,							\
+  bfd_getl16, bfd_getl_signed_16, bfd_putl16,							\
+	/* bfd_check_format */									\
+  { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p, _bfd_dummy_target },		\
+       /* bfd_set_format */									\
+  { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false },				\
+	/* bfd_write_contents */								\
+  { bfd_false, coff_write_object_contents, _bfd_write_archive_contents, bfd_false },		\
+												\
+  BFD_JUMP_TABLE_GENERIC (coff),								\
+  BFD_JUMP_TABLE_COPY (coff),									\
+  BFD_JUMP_TABLE_CORE (_bfd_nocore),								\
+  BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),							\
+  BFD_JUMP_TABLE_SYMBOLS (coff),								\
+  BFD_JUMP_TABLE_RELOCS (coff),									\
+  BFD_JUMP_TABLE_WRITE (coff),									\
+  BFD_JUMP_TABLE_LINK (coff),									\
+  BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),							\
+												\
+  ALTERNATIVE,											\
+  												\
+  COFF_SWAP_TABLE										\
+};
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index df41383..8495f3d 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -1,5 +1,5 @@
 /* Support for the generic parts of COFF, for BFD.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -559,7 +559,7 @@
 /*ARGSUSED*/
 coff_symbol_type *
 coff_symbol_from (ignore_abfd, symbol)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
 {
   if (bfd_asymbol_flavour (symbol) != bfd_target_coff_flavour)
@@ -1351,7 +1351,7 @@
 /*ARGSUSED */
 alent *
 coff_get_lineno (ignore_abfd, symbol)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
 {
   return coffsymbol (symbol)->lineno;
@@ -1747,9 +1747,19 @@
 	  else
 	    {
 	      /* ordinary short filename, put into memory anyway */
-	      internal_ptr->u.syment._n._n_n._n_offset = (long)
-		copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname,
-			   FILNMLEN);
+	      if (internal_ptr->u.syment.n_numaux > 1
+		  && coff_data (abfd)->pe)
+		{
+		  internal_ptr->u.syment._n._n_n._n_offset = (long)
+		    copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname,
+			       internal_ptr->u.syment.n_numaux * symesz);
+		}
+	      else
+		{
+		  internal_ptr->u.syment._n._n_n._n_offset = (long)
+		    copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname,
+			       FILNMLEN);
+		}
 	    }
 	}
       else
@@ -1847,8 +1857,8 @@
 asymbol *
 coff_bfd_make_debug_symbol (abfd, ptr, sz)
      bfd *abfd;
-     PTR ptr;
-     unsigned long sz;
+     PTR ptr ATTRIBUTE_UNUSED;
+     unsigned long sz ATTRIBUTE_UNUSED;
 {
   coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, sizeof (coff_symbol_type));
   if (new == NULL)
@@ -2095,7 +2105,7 @@
 
 boolean
 _bfd_coff_is_local_label_name (abfd, name)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      const char *name;
 {
   return name[0] == '.' && name[1] == 'L';
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index cf56869..994cea4 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -1,5 +1,5 @@
 /* COFF specific linker code.
-   Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -1069,7 +1069,7 @@
 static int
 process_embedded_commands (output_bfd, info,  abfd)
      bfd *output_bfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      bfd *abfd;
 {
   asection *sec = bfd_get_section_by_name (abfd, ".drectve");
diff --git a/bfd/coffswap.h b/bfd/coffswap.h
index ae30a5d..c9f25d6 100644
--- a/bfd/coffswap.h
+++ b/bfd/coffswap.h
@@ -1,5 +1,6 @@
 /* Generic COFF swapping routines, for BFD.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -422,7 +423,16 @@
 #if FILNMLEN != E_FILNMLEN
 	    -> Error, we need to cope with truncating or extending FILNMLEN!;
 #else
-	    memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+	    if (numaux > 1)
+	      {
+		if (indx == 0)
+		  memcpy (in->x_file.x_fname, ext->x_file.x_fname,
+			  numaux * sizeof (AUXENT));
+	      }
+	    else
+	      {
+		memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+	      }
 #endif
 	  }
       goto end;
@@ -518,8 +528,8 @@
      PTR 	inp;
      int   type;
      int   class;
-     int   indx;
-     int   numaux;
+     int   indx ATTRIBUTE_UNUSED;
+     int   numaux ATTRIBUTE_UNUSED;
      PTR	extp;
 {
   union internal_auxent *in = (union internal_auxent *)inp;
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 449ae91..1f3b663 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -55,7 +55,7 @@
 case "${targ}" in
 # START OF targmatch.h
 #ifdef BFD64
-  alpha*-*-netbsd*)
+  alpha*-*-netbsd* | alpha*-*-freebsd*)
     targ_defvec=bfd_elf64_alpha_vec
     targ_selvecs=ecoffalpha_little_vec
     ;;
@@ -193,7 +193,7 @@
     targ_underscore=yes
     ;;
 
-  hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*)
+  hppa*-*-*elf* | hppa*-*-linux-gnu* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*)
     targ_defvec=bfd_elf32_hppa_vec
     ;;
 #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined (HOST_HPPAMPEIX)
@@ -214,21 +214,29 @@
     targ_defvec=i386coff_vec
     targ_selvecs=bfd_elf32_i386_vec
     ;;
-  i[3456]86-*-sysv4* | i[3456]86-*-unixware | i[3456]86-*-solaris2* | \
-  i[3456]86-*-elf | i[3456]86-*-sco3.2v5* | i[3456]86-*-freebsdelf* | \
+  i[3456]86-*-sysv4* | i[3456]86-*-unixware* | i[3456]86-*-solaris2* | \
+  i[3456]86-*-elf | i[3456]86-*-sco3.2v5* | \
   i[3456]86-*-dgux* | i[3456]86-*-sysv5*)
     targ_defvec=bfd_elf32_i386_vec
     targ_selvecs=i386coff_vec
     ;;
+  i[3456]86-*-rtemself*)
+    targ_defvec=bfd_elf32_i386_vec
+    targ_selvecs="i386coff_vec i386aout_vec"
+    ;;
   i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32* | i[3456]86-go32-rtems* )
     targ_defvec=go32coff_vec
     targ_selvecs="go32stubbedcoff_vec i386aout_vec"
     ;;
   i[3456]86-*-sysv* | i[3456]86-*-isc* | i[3456]86-*-sco* | i[3456]86-*-coff | \
-  i[3456]86-*-aix* | i[3456]86*-*-rtems*)
+  i[3456]86-*-aix*)
     targ_defvec=i386coff_vec
     ;;
-  i[3456]86-sequent-bsd*)
+  i[3456]86*-*-rtems*)
+    targ_defvec=i386coff_vec
+    targ_selvecs="bfd_elf32_i386_vec i386aout_vec"
+    ;;
+ i[3456]86-sequent-bsd*)
     targ_defvec=i386dynix_vec
     targ_underscore=yes
     ;;
@@ -236,11 +244,16 @@
     targ_defvec=i386bsd_vec
     targ_underscore=yes
     ;;
-  i[3456]86-*-freebsd*)
+  i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | \
+  i[3456]86-*-freebsd[12])
     targ_defvec=i386freebsd_vec
     targ_selvecs=i386bsd_vec
     targ_underscore=yes
     ;;
+  i[3456]86-*-freebsd*)
+    targ_defvec=bfd_elf32_i386_vec
+    targ_selvecs=i386coff_vec
+    ;;
   i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
     targ_defvec=i386netbsd_vec
     targ_selvecs=i386bsd_vec
@@ -300,6 +313,9 @@
   i[3456]86-*-aout* | i[3456]86*-*-vsta*)
     targ_defvec=i386aout_vec
     ;;
+  i[3456]86-*-vxworks*)
+    targ_defvec=i386aout_vec
+    ;;
 
   i860-*-mach3* | i860-*-osf1* | i860-*-coff*)
     targ_defvec=i860coff_vec
@@ -323,6 +339,10 @@
     targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec"
     targ_underscore=yes
     ;;
+  i960-*-elf*)
+    targ_defvec=bfd_elf32_i960_vec
+    targ_selvecs="icoff_little_vec icoff_big_vec"
+    ;;
 
   m32r-*-*)
     targ_defvec=bfd_elf32_m32r_vec
@@ -354,7 +374,11 @@
     targ_defvec=bfd_elf32_m68k_vec
     targ_selvecs="m68kcoff_vec ieee_vec"
     ;;
-  m68*-*-coff* | m68*-*-sysv* | m68*-*-rtems*)
+  m68*-*-rtems*)
+    targ_defvec=m68kcoff_vec
+    targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
+    ;;
+  m68*-*-coff* | m68*-*-sysv*)
     targ_defvec=m68kcoff_vec
     targ_selvecs="m68kcoff_vec versados_vec ieee_vec"
     ;;
@@ -491,7 +515,7 @@
     targ_defvec=ecoff_big_vec
     targ_selvecs=ecoff_little_vec
     ;;
-  mips*el-*-elf* | mips*el-*-vxworks*)
+  mips*el-*-elf* | mips*el-*-rtems* | mips*el-*-vxworks*)
     targ_defvec=bfd_elf32_littlemips_vec
     targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
     ;;
@@ -546,7 +570,8 @@
     targ_selvecs="nlm32_powerpc_vec rs6000coff_vec"
     ;;
   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
-  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks*)
+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+  powerpcle-*-rtems*)
     targ_defvec=bfd_elf32_powerpcle_vec
     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
     ;;
@@ -560,7 +585,7 @@
     targ_defvec=rs6000coff_vec
     ;;
 
-  sh-*-elf*)
+  sh-*-elf* | sh-*-rtemself*)
     targ_defvec=bfd_elf32_sh_vec
     targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
     targ_underscore=yes
diff --git a/bfd/config.in b/bfd/config.in
index 51fa45b..abb2c78 100644
--- a/bfd/config.in
+++ b/bfd/config.in
@@ -67,9 +67,15 @@
 /* Define if you have the getcwd function.  */
 #undef HAVE_GETCWD
 
+/* Define if you have the getgid function.  */
+#undef HAVE_GETGID
+
 /* Define if you have the getpagesize function.  */
 #undef HAVE_GETPAGESIZE
 
+/* Define if you have the getuid function.  */
+#undef HAVE_GETUID
+
 /* Define if you have the madvise function.  */
 #undef HAVE_MADVISE
 
diff --git a/bfd/configure b/bfd/configure
index f6ca66f..57c56f4 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -16,8 +16,12 @@
 ac_help="$ac_help
   --enable-static[=PKGS]  build static libraries [default=yes]"
 ac_help="$ac_help
+  --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
+ac_help="$ac_help
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
 ac_help="$ac_help
+  --disable-libtool-lock  force libtool not to do file locking"
+ac_help="$ac_help
   --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)"
 ac_help="$ac_help
   --enable-targets        alternative target configurations"
@@ -49,6 +53,7 @@
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -163,6 +168,7 @@
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
+  --site-file=FILE        use FILE as the site file
   --version               print the version of autoconf that created configure
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -333,6 +339,11 @@
   -site=* | --site=* | --sit=*)
     site="$ac_optarg" ;;
 
+  -site-file | --site-file | --site-fil | --site-fi | --site-f)
+    ac_prev=sitefile ;;
+  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+    sitefile="$ac_optarg" ;;
+
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -498,12 +509,16 @@
 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+  if test -z "$CONFIG_SITE"; then
+    if test "x$prefix" != xNONE; then
+      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+    else
+      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+    fi
   fi
+else
+  CONFIG_SITE="$sitefile"
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
@@ -590,7 +605,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:594: checking host system type" >&5
+echo "configure:609: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -611,7 +626,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:615: checking target system type" >&5
+echo "configure:630: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -629,7 +644,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:633: checking build system type" >&5
+echo "configure:648: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -654,7 +669,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:658: checking for $ac_word" >&5
+echo "configure:673: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -684,7 +699,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:688: checking for $ac_word" >&5
+echo "configure:703: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -735,7 +750,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:739: checking for $ac_word" >&5
+echo "configure:754: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -767,7 +782,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:771: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:786: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -778,12 +793,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 782 "configure"
+#line 797 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -809,12 +824,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:813: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:828: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:818: checking whether we are using GNU C" >&5
+echo "configure:833: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -823,7 +838,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -842,7 +857,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:846: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:861: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -874,7 +889,7 @@
 fi
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:878: checking for POSIXized ISC" >&5
+echo "configure:893: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -907,7 +922,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:911: checking for a BSD compatible install" >&5
+echo "configure:926: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -960,7 +975,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:964: checking whether build environment is sane" >&5
+echo "configure:979: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -1017,7 +1032,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1021: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1036: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1046,7 +1061,7 @@
 
 PACKAGE=bfd
 
-VERSION=2.9.4
+VERSION=2.9.5
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -1063,7 +1078,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1067: checking for working aclocal" >&5
+echo "configure:1082: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1076,7 +1091,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1080: checking for working autoconf" >&5
+echo "configure:1095: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1089,7 +1104,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1093: checking for working automake" >&5
+echo "configure:1108: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1102,7 +1117,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1106: checking for working autoheader" >&5
+echo "configure:1121: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1115,7 +1130,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1119: checking for working makeinfo" >&5
+echo "configure:1134: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1138,7 +1153,7 @@
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1142: checking for $ac_word" >&5
+echo "configure:1157: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1170,7 +1185,7 @@
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1174: checking for $ac_word" >&5
+echo "configure:1189: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1202,7 +1217,7 @@
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1206: checking for $ac_word" >&5
+echo "configure:1221: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1282,10 +1297,33 @@
   enable_static=yes
 fi
 
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+  enable_fast_install=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_fast_install=yes
+fi
+
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1289: checking for $ac_word" >&5
+echo "configure:1327: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1320,18 +1358,23 @@
   with_gnu_ld=no
 fi
 
-
 ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1329: checking for ld used by GCC" >&5
+echo "configure:1366: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
-  # Accept absolute paths.
-  /* | [A-Za-z]:\\*)
-    test -z "$LD" && LD="$ac_prog"
-    ;;
+    # Accept absolute paths.
+    /* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
   "")
     # If it fails, then pretend we aren't using GCC.
     ac_prog=ld
@@ -1343,10 +1386,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1347: checking for GNU ld" >&5
+echo "configure:1390: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1350: checking for non-GNU ld" >&5
+echo "configure:1393: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1363,7 +1406,7 @@
       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
 	test "$with_gnu_ld" != no && break
       else
-        test "$with_gnu_ld" != yes && break
+	test "$with_gnu_ld" != yes && break
       fi
     fi
   done
@@ -1382,7 +1425,7 @@
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1386: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1429: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1398,7 +1441,7 @@
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1402: checking for BSD-compatible nm" >&5
+echo "configure:1445: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1407,20 +1450,22 @@
   ac_cv_path_NM="$NM"
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/nm; then
       # Check to see if the nm accepts a BSD-compat flag.
       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
       #   nm: unknown option "B" ignored
       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-        ac_cv_path_NM="$ac_dir/nm -B"
+	ac_cv_path_NM="$ac_dir/nm -B"
+	break
       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-        ac_cv_path_NM="$ac_dir/nm -p"
+	ac_cv_path_NM="$ac_dir/nm -p"
+	break
       else
-        ac_cv_path_NM="$ac_dir/nm"
+	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+	continue # so that we can try to find one that supports BSD flags
       fi
-      break
     fi
   done
   IFS="$ac_save_ifs"
@@ -1432,8 +1477,212 @@
 echo "$ac_t""$NM" 1>&6
 
 
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
+echo "configure:1483: checking command to parse $NM output" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix.  What could be older than Ultrix?!! ;)}
+
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+  ac_symcode='[BCDT]'
+  ;;
+cygwin* | mingw*)
+  ac_symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+  ;;
+irix*)
+  ac_symcode='[BCDEGRST]'
+  ;;
+solaris*)
+  ac_symcode='[BDT]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+  ac_symcode='[ABCDGISTW]'
+fi
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* 	\($ac_symcode\) 	 	*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  ac_pipe_works=no
+  rm -f conftest.$ac_ext
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+  if { (eval echo configure:1546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+    # Now try to grab the symbols.
+    ac_nlist=conftest.nm
+  
+    if { (eval echo configure:1550: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+
+      # Try sorting and uniquifying the output.
+      if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+	mv -f "$ac_nlist"T "$ac_nlist"
+      else
+	rm -f "$ac_nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+	if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+	  cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+	  cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+	cat <<\EOF >> conftest.c
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftestm.$ac_objext
+	  ac_save_LIBS="$LIBS"
+	  ac_save_CFLAGS="$CFLAGS"
+	  LIBS="conftestm.$ac_objext"
+	  CFLAGS="$CFLAGS$no_builtin_flag"
+	  if { (eval echo configure:1602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+	    ac_pipe_works=yes
+	  else
+	    echo "configure: failed program was:" >&5
+	    cat conftest.c >&5
+	  fi
+	  LIBS="$ac_save_LIBS"
+	  CFLAGS="$ac_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $ac_nlist" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $ac_nlist" >&5
+      fi
+    else
+      echo "cannot run $ac_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.c >&5
+  fi
+  rm -rf conftest*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$ac_pipe_works" = yes; then
+    if test x"$ac_symprfx" = x"_"; then
+      ac_cv_sys_symbol_underscore=yes
+    else
+      ac_cv_sys_symbol_underscore=no
+    fi
+    break
+  else
+    ac_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+   ac_result=no
+fi
+echo "$ac_t""$ac_result" 1>&6
+
+echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
+echo "configure:1648: checking for _ prefix in compiled symbols" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_sys_symbol_underscore=no
+cat > conftest.$ac_ext <<EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+EOF
+if { (eval echo configure:1657: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  # Now try to grab the symbols.
+  ac_nlist=conftest.nm
+  if { (eval echo configure:1660: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+    # See whether the symbols have a leading underscore.
+    if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+      ac_cv_sys_symbol_underscore=yes
+    else
+      if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+	:
+      else
+	echo "configure: cannot find nm_test_func in $ac_nlist" >&5
+      fi
+    fi
+  else
+    echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&5
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.c >&5
+fi
+rm -rf conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_sys_symbol_underscore" 1>&6
+USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
+
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1437: checking whether ln -s works" >&5
+echo "configure:1686: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1453,13 +1702,13 @@
   echo "$ac_t""no" 1>&6
 fi
 
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 # Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
@@ -1469,8 +1718,8 @@
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1473 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1722 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1723: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1488,14 +1737,45 @@
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
+  echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:1744: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1749 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  lt_cv_cc_needs_belf=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
   ;;
 
 *-*-cygwin*)
   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1499: checking for $ac_word" >&5
+echo "configure:1779: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1527,7 +1807,7 @@
   # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1531: checking for $ac_word" >&5
+echo "configure:1811: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1562,7 +1842,7 @@
 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
 set dummy ${ac_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1566: checking for $ac_word" >&5
+echo "configure:1846: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1594,7 +1874,7 @@
   # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1598: checking for $ac_word" >&5
+echo "configure:1878: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1631,6 +1911,71 @@
 
 esac
 
+# enable the --disable-libtool-lock switch
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+  need_locks=$enableval
+else
+  need_locks=yes
+fi
+
+
+if test x"$need_locks" = xno; then
+  libtool_flags="$libtool_flags --disable-lock"
+fi
+
+
+# Save cache, so that ltconfig can load it
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+
 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
@@ -1639,6 +1984,22 @@
 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
 
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
 # Redirect the config.log output again, so that the ltconfig log is not
 # clobbered by the next message.
 exec 5>>./config.log
@@ -1714,7 +2075,7 @@
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1718: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2079: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1737,12 +2098,12 @@
   
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1741: checking for Cygwin environment" >&5
+echo "configure:2102: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1746 "configure"
+#line 2107 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1753,7 +2114,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:1757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -1770,19 +2131,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:1774: checking for mingw32 environment" >&5
+echo "configure:2135: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1779 "configure"
+#line 2140 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -1801,7 +2162,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1805: checking for executable suffix" >&5
+echo "configure:2166: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1811,7 +2172,7 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:1815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:2176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -1840,7 +2201,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1844: checking for $ac_word" >&5
+echo "configure:2205: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1870,7 +2231,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1874: checking for $ac_word" >&5
+echo "configure:2235: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1921,7 +2282,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1925: checking for $ac_word" >&5
+echo "configure:2286: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1953,7 +2314,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1957: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2318: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1964,12 +2325,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1968 "configure"
+#line 2329 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1995,12 +2356,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1999: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2360: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2004: checking whether we are using GNU C" >&5
+echo "configure:2365: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2009,7 +2370,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2028,7 +2389,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2032: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2393: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2062,7 +2423,7 @@
 
 ALL_LINGUAS=
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2066: checking how to run the C preprocessor" >&5
+echo "configure:2427: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2077,13 +2438,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2081 "configure"
+#line 2442 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2087: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2448: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2094,13 +2455,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2098 "configure"
+#line 2459 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2111,13 +2472,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2115 "configure"
+#line 2476 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2142,12 +2503,12 @@
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2146: checking for ANSI C header files" >&5
+echo "configure:2507: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2151 "configure"
+#line 2512 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2155,7 +2516,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2172,7 +2533,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2176 "configure"
+#line 2537 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2190,7 +2551,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2194 "configure"
+#line 2555 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2211,7 +2572,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2215 "configure"
+#line 2576 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2222,7 +2583,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2246,12 +2607,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2250: checking for working const" >&5
+echo "configure:2611: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2255 "configure"
+#line 2616 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2300,7 +2661,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2321,21 +2682,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2325: checking for inline" >&5
+echo "configure:2686: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 2332 "configure"
+#line 2693 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2361,12 +2722,12 @@
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2365: checking for off_t" >&5
+echo "configure:2726: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2370 "configure"
+#line 2731 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2394,12 +2755,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2398: checking for size_t" >&5
+echo "configure:2759: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2403 "configure"
+#line 2764 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2429,19 +2790,19 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2433: checking for working alloca.h" >&5
+echo "configure:2794: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2438 "configure"
+#line 2799 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -2462,12 +2823,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2466: checking for alloca" >&5
+echo "configure:2827: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2471 "configure"
+#line 2832 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -2495,7 +2856,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:2499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -2527,12 +2888,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2531: checking whether alloca needs Cray hooks" >&5
+echo "configure:2892: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2536 "configure"
+#line 2897 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -2557,12 +2918,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2561: checking for $ac_func" >&5
+echo "configure:2922: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2566 "configure"
+#line 2927 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2585,7 +2946,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2612,7 +2973,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2616: checking stack direction for C alloca" >&5
+echo "configure:2977: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2620,7 +2981,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2624 "configure"
+#line 2985 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -2639,7 +3000,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:2643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -2664,17 +3025,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2668: checking for $ac_hdr" >&5
+echo "configure:3029: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2673 "configure"
+#line 3034 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2703,12 +3064,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2707: checking for $ac_func" >&5
+echo "configure:3068: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2712 "configure"
+#line 3073 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2731,7 +3092,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2756,7 +3117,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2760: checking for working mmap" >&5
+echo "configure:3121: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2764,7 +3125,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 2768 "configure"
+#line 3129 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2904,7 +3265,7 @@
 }
 
 EOF
-if { (eval echo configure:2908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -2932,17 +3293,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2936: checking for $ac_hdr" >&5
+echo "configure:3297: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2941 "configure"
+#line 3302 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2972,12 +3333,12 @@
 __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2976: checking for $ac_func" >&5
+echo "configure:3337: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2981 "configure"
+#line 3342 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3000,7 +3361,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3029,12 +3390,12 @@
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3033: checking for $ac_func" >&5
+echo "configure:3394: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3038 "configure"
+#line 3399 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3057,7 +3418,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3091,19 +3452,19 @@
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3095: checking for LC_MESSAGES" >&5
+echo "configure:3456: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3100 "configure"
+#line 3461 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:3107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -3124,7 +3485,7 @@
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3128: checking whether NLS is requested" >&5
+echo "configure:3489: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -3144,7 +3505,7 @@
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3148: checking whether included gettext is requested" >&5
+echo "configure:3509: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -3163,17 +3524,17 @@
 
 	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3167: checking for libintl.h" >&5
+echo "configure:3528: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3172 "configure"
+#line 3533 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3190,19 +3551,19 @@
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:3194: checking for gettext in libc" >&5
+echo "configure:3555: checking for gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3199 "configure"
+#line 3560 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libc=yes
 else
@@ -3218,7 +3579,7 @@
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 	     echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3222: checking for bindtextdomain in -lintl" >&5
+echo "configure:3583: checking for bindtextdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3226,7 +3587,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3230 "configure"
+#line 3591 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3237,7 +3598,7 @@
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3253,19 +3614,19 @@
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3257: checking for gettext in libintl" >&5
+echo "configure:3618: checking for gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3262 "configure"
+#line 3623 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libintl=yes
 else
@@ -3293,7 +3654,7 @@
 	      # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3297: checking for $ac_word" >&5
+echo "configure:3658: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3327,12 +3688,12 @@
 		for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3331: checking for $ac_func" >&5
+echo "configure:3692: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3336 "configure"
+#line 3697 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3355,7 +3716,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3382,7 +3743,7 @@
 		# Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3386: checking for $ac_word" >&5
+echo "configure:3747: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3418,7 +3779,7 @@
 		# Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3422: checking for $ac_word" >&5
+echo "configure:3783: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3450,7 +3811,7 @@
 fi
 
 		cat > conftest.$ac_ext <<EOF
-#line 3454 "configure"
+#line 3815 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3458,7 +3819,7 @@
 			       return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:3462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
 		   DATADIRNAME=share
@@ -3490,7 +3851,7 @@
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3494: checking for $ac_word" >&5
+echo "configure:3855: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3524,7 +3885,7 @@
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3528: checking for $ac_word" >&5
+echo "configure:3889: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3560,7 +3921,7 @@
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3564: checking for $ac_word" >&5
+echo "configure:3925: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3650,7 +4011,7 @@
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3654: checking for catalogs to be installed" >&5
+echo "configure:4015: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -3678,17 +4039,17 @@
       if test "$CATOBJEXT" = ".cat"; then
 	 ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:3682: checking for linux/version.h" >&5
+echo "configure:4043: checking for linux/version.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3687 "configure"
+#line 4048 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3766,7 +4127,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:3770: checking for a BSD compatible install" >&5
+echo "configure:4131: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3849,7 +4210,7 @@
   EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
   echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:3853: checking for build system executable suffix" >&5
+echo "configure:4214: checking for build system executable suffix" >&5
 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3874,17 +4235,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3878: checking for $ac_hdr" >&5
+echo "configure:4239: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3883 "configure"
+#line 4244 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3914,17 +4275,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3918: checking for $ac_hdr" >&5
+echo "configure:4279: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3923 "configure"
+#line 4284 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3951,12 +4312,12 @@
 done
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3955: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4316: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3960 "configure"
+#line 4321 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3965,7 +4326,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3990,12 +4351,12 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:3994: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4355: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3999 "configure"
+#line 4360 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4003,7 +4364,7 @@
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4028,7 +4389,7 @@
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:4032: checking for opendir in -ldir" >&5
+echo "configure:4393: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4036,7 +4397,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4040 "configure"
+#line 4401 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4047,7 +4408,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4069,7 +4430,7 @@
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4073: checking for opendir in -lx" >&5
+echo "configure:4434: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4077,7 +4438,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4081 "configure"
+#line 4442 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4088,7 +4449,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4110,15 +4471,15 @@
 
 fi
 
-for ac_func in fcntl getpagesize setitimer sysconf fdopen
+for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4117: checking for $ac_func" >&5
+echo "configure:4478: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4122 "configure"
+#line 4483 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4141,7 +4502,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4176,12 +4537,12 @@
 esac
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4180: checking whether strstr must be declared" >&5
+echo "configure:4541: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4185 "configure"
+#line 4546 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4202,7 +4563,7 @@
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:4206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -4223,12 +4584,12 @@
 fi
 
 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:4227: checking whether malloc must be declared" >&5
+echo "configure:4588: checking whether malloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4232 "configure"
+#line 4593 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4249,7 +4610,7 @@
 char *(*pfn) = (char *(*)) malloc
 ; return 0; }
 EOF
-if { (eval echo configure:4253: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_malloc=no
 else
@@ -4270,12 +4631,12 @@
 fi
 
 echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:4274: checking whether realloc must be declared" >&5
+echo "configure:4635: checking whether realloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4279 "configure"
+#line 4640 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4296,7 +4657,7 @@
 char *(*pfn) = (char *(*)) realloc
 ; return 0; }
 EOF
-if { (eval echo configure:4300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_realloc=no
 else
@@ -4317,12 +4678,12 @@
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4321: checking whether free must be declared" >&5
+echo "configure:4682: checking whether free must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4326 "configure"
+#line 4687 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4343,7 +4704,7 @@
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:4347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -4364,12 +4725,12 @@
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:4368: checking whether getenv must be declared" >&5
+echo "configure:4729: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4373 "configure"
+#line 4734 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4390,7 +4751,7 @@
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:4394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -4591,17 +4952,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4595: checking for $ac_hdr" >&5
+echo "configure:4956: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4600 "configure"
+#line 4961 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4629,19 +4990,19 @@
 
   if test "$ac_cv_header_sys_procfs_h" = yes; then
     echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4633: checking for prstatus_t in sys/procfs.h" >&5
+echo "configure:4994: checking for prstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4638 "configure"
+#line 4999 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 prstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:4645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prstatus_t=yes
 else
@@ -4663,19 +5024,19 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6
 
     echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4667: checking for prstatus_t.pr_who in sys/procfs.h" >&5
+echo "configure:5028: checking for prstatus_t.pr_who in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4672 "configure"
+#line 5033 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 prstatus_t avar; void* aref = (void*) &avar.pr_who
 ; return 0; }
 EOF
-if { (eval echo configure:4679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes
 else
@@ -4697,19 +5058,19 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6
 
     echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4701: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:5062: checking for pstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4706 "configure"
+#line 5067 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 pstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:4713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pstatus_t=yes
 else
@@ -4731,19 +5092,19 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
 
     echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4735: checking for prpsinfo_t in sys/procfs.h" >&5
+echo "configure:5096: checking for prpsinfo_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4740 "configure"
+#line 5101 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 prpsinfo_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:4747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prpsinfo_t=yes
 else
@@ -4765,19 +5126,19 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6
 
     echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4769: checking for psinfo_t in sys/procfs.h" >&5
+echo "configure:5130: checking for psinfo_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4774 "configure"
+#line 5135 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 psinfo_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:4781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_psinfo_t=yes
 else
@@ -4799,19 +5160,19 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6
 
     echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4803: checking for lwpstatus_t in sys/procfs.h" >&5
+echo "configure:5164: checking for lwpstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4808 "configure"
+#line 5169 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 lwpstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:4815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_lwpstatus_t=yes
 else
@@ -4833,19 +5194,19 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6
 
     echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4837: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
+echo "configure:5198: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4842 "configure"
+#line 5203 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 lwpstatus_t avar; void* aref = (void*) &avar.pr_context
 ; return 0; }
 EOF
-if { (eval echo configure:4849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes
 else
@@ -4867,19 +5228,19 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6
 
     echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4871: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
+echo "configure:5232: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4876 "configure"
+#line 5237 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 lwpstatus_t avar; void* aref = (void*) &avar.pr_reg
 ; return 0; }
 EOF
-if { (eval echo configure:4883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes
 else
@@ -5002,8 +5363,8 @@
     a_out_adobe_vec)		tb="$tb aout-adobe.lo aout32.lo" ;;
     armcoff_little_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armcoff_big_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
-    armpe_little_vec)		tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
-    armpe_big_vec)		tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
+    armpe_little_vec)		tb="$tb pe-arm.lo cofflink.lo " ;;
+    armpe_big_vec)		tb="$tb pe-arm.lo cofflink.lo " ;;
     armpei_little_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     armpei_big_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     arm_epoc_pe_little_vec)	tb="$tb epoc-pe-arm.lo cofflink.lo " ;;
@@ -5036,6 +5397,7 @@
     bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_i386_vec)		tb="$tb elf32-i386.lo elf32.lo $elf" ;;
     bfd_elf32_i860_vec)		tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+    bfd_elf32_i960_vec)		tb="$tb elf32-i960.lo elf32.lo $elf" ;;
     bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
     bfd_elf32_littlemips_vec) 	tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf64_littlemips_vec) 	tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
@@ -5228,17 +5590,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5239: checking for $ac_hdr" >&5
+echo "configure:5594: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5244 "configure"
+#line 5599 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5267,12 +5629,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5278: checking for $ac_func" >&5
+echo "configure:5633: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5283 "configure"
+#line 5638 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5295,7 +5657,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5320,7 +5682,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:5331: checking for working mmap" >&5
+echo "configure:5686: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5328,7 +5690,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 5339 "configure"
+#line 5694 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -5468,7 +5830,7 @@
 }
 
 EOF
-if { (eval echo configure:5479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -5493,12 +5855,12 @@
 for ac_func in madvise mprotect
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5504: checking for $ac_func" >&5
+echo "configure:5859: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5509 "configure"
+#line 5864 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5521,7 +5883,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5717,10 +6079,11 @@
 s%@RANLIB@%$RANLIB%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
+s%@USE_SYMBOL_UNDERSCORE@%$USE_SYMBOL_UNDERSCORE%g
 s%@LN_S@%$LN_S%g
-s%@LIBTOOL@%$LIBTOOL%g
 s%@DLLTOOL@%$DLLTOOL%g
 s%@AS@%$AS%g
+s%@LIBTOOL@%$LIBTOOL%g
 s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
 s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
 s%@MAINT@%$MAINT%g
diff --git a/bfd/configure.host b/bfd/configure.host
index ef7048b..e24cd60 100644
--- a/bfd/configure.host
+++ b/bfd/configure.host
@@ -63,6 +63,8 @@
 			ac_cv_func_getpagesize=no
 			ac_cv_func_madvise=no
 			ac_cv_func_mprotect=no
+			ac_cv_func_getuid=no
+			ac_cv_func_getgid=no
 			ac_cv_header_sys_file_h=no
 			ac_cv_header_sys_time_h=no
 			ac_cv_header_unistd_h=no
diff --git a/bfd/configure.in b/bfd/configure.in
index 3a3e36f..9a1e3fa 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -7,7 +7,7 @@
 AC_CANONICAL_SYSTEM
 AC_ISC_POSIX
 
-AM_INIT_AUTOMAKE(bfd, 2.9.4)
+AM_INIT_AUTOMAKE(bfd, 2.9.5)
 
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
 dnl to call AC_CHECK_PROG.
@@ -98,7 +98,7 @@
 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
 AC_HEADER_TIME
 AC_HEADER_DIRENT
-AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen)
+AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
 
 BFD_BINARY_FOPEN
 
@@ -414,8 +414,8 @@
     a_out_adobe_vec)		tb="$tb aout-adobe.lo aout32.lo" ;;
     armcoff_little_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armcoff_big_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
-    armpe_little_vec)		tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
-    armpe_big_vec)		tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
+    armpe_little_vec)		tb="$tb pe-arm.lo cofflink.lo " ;;
+    armpe_big_vec)		tb="$tb pe-arm.lo cofflink.lo " ;;
     armpei_little_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     armpei_big_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     arm_epoc_pe_little_vec)	tb="$tb epoc-pe-arm.lo cofflink.lo " ;;
@@ -448,6 +448,7 @@
     bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_i386_vec)		tb="$tb elf32-i386.lo elf32.lo $elf" ;;
     bfd_elf32_i860_vec)		tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+    bfd_elf32_i960_vec)		tb="$tb elf32-i960.lo elf32.lo $elf" ;;
     bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
     bfd_elf32_littlemips_vec) 	tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf64_littlemips_vec) 	tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c
index d999c0f..bda9c44 100644
--- a/bfd/cpu-arm.c
+++ b/bfd/cpu-arm.c
@@ -1,5 +1,5 @@
 /* BFD support for the ARM processor
-   Copyright 1994, 95, 1997 Free Software Foundation, Inc.
+   Copyright 1994, 95, 97, 1999 Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -82,10 +82,17 @@
   { bfd_mach_arm_3,  "arm7di"   },
   { bfd_mach_arm_3M, "arm7dm"   },
   { bfd_mach_arm_3M, "arm7dmi"  },
+  { bfd_mach_arm_4T, "arm7tdmi" },
   { bfd_mach_arm_4,  "arm8"     },
   { bfd_mach_arm_4,  "arm810"   },
+  { bfd_mach_arm_4,  "arm9"     },
+  { bfd_mach_arm_4,  "arm920"   },
+  { bfd_mach_arm_4T, "arm920t"  },
+  { bfd_mach_arm_4T, "arm9tdmi" },
   { bfd_mach_arm_4,  "sa1"      },
-  { bfd_mach_arm_4T, "arm7tdmi" }
+  { bfd_mach_arm_4,  "strongarm"},
+  { bfd_mach_arm_4,  "strongarm110" },
+  { bfd_mach_arm_4,  "strongarm1100" },
 };
 
 static boolean 
@@ -127,7 +134,9 @@
   N( bfd_mach_arm_3,  "armv3",  false, & arch_info_struct[3] ),
   N( bfd_mach_arm_3M, "armv3m", false, & arch_info_struct[4] ),
   N( bfd_mach_arm_4,  "armv4",  false, & arch_info_struct[5] ),
-  N( bfd_mach_arm_4T, "armv4t", false, NULL )
+  N( bfd_mach_arm_4T, "armv4t", false, & arch_info_struct[6] ),
+  N( bfd_mach_arm_5,  "armv5",  false, & arch_info_struct[7] ),
+  N( bfd_mach_arm_5T, "armv5t", false, NULL )
 };
 
 const bfd_arch_info_type bfd_arm_arch =
diff --git a/bfd/cpu-h8500.c b/bfd/cpu-h8500.c
index e4abfd1..eae42e3 100644
--- a/bfd/cpu-h8500.c
+++ b/bfd/cpu-h8500.c
@@ -1,5 +1,5 @@
 /* BFD library support routines for the H8/500 architecture.
-   Copyright (C) 1993 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 1995, 1999 Free Software Foundation, Inc.
    Hacked by Steve Chamberlain of Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -156,7 +156,7 @@
 
 static boolean 
 scan_mach (info, string)
-     const struct bfd_arch_info *info;
+     const struct bfd_arch_info *info ATTRIBUTE_UNUSED;
      const char *string;
 {
   if (strcmp(string,"h8/500") == 0) return true;
diff --git a/bfd/cpu-ns32k.c b/bfd/cpu-ns32k.c
index 1b0a18d..f74e25b 100644
--- a/bfd/cpu-ns32k.c
+++ b/bfd/cpu-ns32k.c
@@ -1,5 +1,5 @@
 /* BFD support for the ns32k architecture.
-   Copyright (C) 1990, 91, 94, 95, 96, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1990, 91, 94, 95, 96, 98, 1999 Free Software Foundation, Inc.
    Almost totally rewritten by Ian Dall from initial work
    by Andrew Cagney.
 
@@ -173,7 +173,7 @@
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
      long (*get_data)();
      int (*put_data)();
 {
@@ -596,7 +596,7 @@
 _bfd_do_ns32k_reloc_contents ( howto, input_bfd, relocation, location,
 			      get_data, put_data)
      reloc_howto_type *howto;
-     bfd *input_bfd;
+     bfd *input_bfd ATTRIBUTE_UNUSED;
      bfd_vma relocation;
      bfd_byte *location;
      long (*get_data)();
diff --git a/bfd/cpu-w65.c b/bfd/cpu-w65.c
index c0bbf04..13f68b3 100644
--- a/bfd/cpu-w65.c
+++ b/bfd/cpu-w65.c
@@ -1,5 +1,5 @@
 /* BFD library support routines for the WDC 65816 architecture.
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1999 Free Software Foundation, Inc.
    Hacked by Steve Chamberlain of Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -27,7 +27,7 @@
 
 static boolean 
 scan_mach (info, string)
-     const struct bfd_arch_info *info;
+     const struct bfd_arch_info *info ATTRIBUTE_UNUSED;
      const char *string;
 {
   if (strcmp(string,"w65") == 0) return true;
diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c
index cbcc26b..903bfc3 100644
--- a/bfd/dwarf1.c
+++ b/bfd/dwarf1.c
@@ -1,5 +1,5 @@
 /* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line).
-   Copyright 1998 Free Software Foundation, Inc.
+   Copyright 1998, 1999 Free Software Foundation, Inc.
 
 Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).  
 
@@ -140,8 +140,8 @@
   struct dwarf1_debug* stash;
 {
   struct dwarf1_unit* x = 
-    (struct dwarf1_unit*) bfd_alloc (stash->abfd, 
-				       sizeof (struct dwarf1_unit));
+    (struct dwarf1_unit*) bfd_zalloc (stash->abfd, 
+				      sizeof (struct dwarf1_unit));
   x->prev = stash->lastUnit;
   stash->lastUnit = x;
 
@@ -157,8 +157,8 @@
      struct dwarf1_unit* aUnit;
 {
   struct dwarf1_func* x = 
-    (struct dwarf1_func*) bfd_alloc (stash->abfd, 
-				  sizeof (struct dwarf1_func));
+    (struct dwarf1_func*) bfd_zalloc (stash->abfd, 
+				      sizeof (struct dwarf1_func));
   x->prev = aUnit->func_list;
   aUnit->func_list = x;
   
@@ -291,7 +291,7 @@
   xptr = stash->line_section + aUnit->stmt_list_offset;
   if (xptr < stash->line_section_end)
     {
-      int eachLine;
+      unsigned long eachLine;
 
       char* tblend;
       unsigned long base;
@@ -398,7 +398,7 @@
     {
       if (aUnit->has_stmt_list)
 	{
-	  int i;
+	  unsigned long i;
 	  struct dwarf1_func* eachFunc;
 
 	  if (! aUnit->linenumber_table)
@@ -454,7 +454,7 @@
                               filename_ptr, functionname_ptr, linenumber_ptr)
      bfd *abfd;
      asection *section;
-     asymbol **symbols;
+     asymbol **symbols ATTRIBUTE_UNUSED;
      bfd_vma offset;
      const char **filename_ptr;
      const char **functionname_ptr;
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 385bf82..888757e 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -1,5 +1,5 @@
 /* DWARF 2 support.
-   Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
 
    Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions
    (gavin@cygnus.com).
@@ -99,8 +99,16 @@
 
   /* Length of the loaded .debug_abbrev section. */
   unsigned long dwarf_abbrev_size;
+
+  /* Buffer for decode_line_info.  */
+  char *dwarf_line_buffer;
 };
 
+struct arange {
+  struct arange *next;
+  bfd_vma low;
+  bfd_vma high;
+};
 
 
 /* A minimal decoding of DWARF2 compilation units.  We only decode
@@ -116,8 +124,7 @@
 
   /* The lowest and higest addresses contained in this compilation
      unit as specified in the compilation unit header. */
-  bfd_vma low;
-  bfd_vma high;
+  struct arange arange;
 
   /* The DW_AT_name attribute (for error messages). */
   char* name;
@@ -163,7 +170,7 @@
 
 static unsigned int
 read_1_byte (abfd, buf)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      char *buf;
 {
   return bfd_get_8 (abfd, (bfd_byte *) buf);
@@ -171,7 +178,7 @@
 
 static int
 read_1_signed_byte (abfd, buf)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      char *buf;
 {
   return bfd_get_signed_8 (abfd, (bfd_byte *) buf);
@@ -231,9 +238,9 @@
 
 static char *
 read_n_bytes (abfd, buf, size)
-     bfd * abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      char *buf;
-     unsigned int size;
+     unsigned int size ATTRIBUTE_UNUSED;
 {
   /* If the size of a host char is 8 bits, we can return a pointer
      to the buffer, otherwise we have to copy the data to a buffer
@@ -243,7 +250,7 @@
 
 static char *
 read_string (abfd, buf, bytes_read_ptr)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      char *buf;
      unsigned int *bytes_read_ptr;
 {
@@ -261,7 +268,7 @@
 
 static unsigned int
 read_unsigned_leb128 (abfd, buf, bytes_read_ptr)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      char *buf;
      unsigned int *bytes_read_ptr;
 {
@@ -291,8 +298,8 @@
 
 static int
 read_signed_leb128 (abfd, buf, bytes_read_ptr)
-     bfd * abfd;
-     char * buf;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     char *buf;
      unsigned int * bytes_read_ptr;
 {
   int           result;
@@ -423,7 +430,7 @@
 	}
       
       stash->dwarf_abbrev_size = bfd_get_section_size_before_reloc (msec);
-      stash->dwarf_abbrev_buffer = (unsigned char*) bfd_alloc (abfd, stash->dwarf_abbrev_size);
+      stash->dwarf_abbrev_buffer = (char*) bfd_alloc (abfd, stash->dwarf_abbrev_size);
       if (! stash->dwarf_abbrev_buffer)
 	  return 0;
       
@@ -604,6 +611,10 @@
       DW_UNSND (attr) = read_4_bytes (abfd, info_ptr);
       info_ptr += 4;
       break;
+    case DW_FORM_ref8:
+      DW_UNSND (attr) = read_8_bytes (abfd, info_ptr);
+      info_ptr += 8;
+      break;
     case DW_FORM_ref_udata:
       DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
       info_ptr += bytes_read;
@@ -631,6 +642,7 @@
   char* filename;
   unsigned int line;
   unsigned int column;
+  int end_sequence;		/* end of (sequential) code sequence */
 };
 
 struct fileinfo {
@@ -653,12 +665,13 @@
 };
 
 static void 
-add_line_info (table, address, filename, line, column)
+add_line_info (table, address, filename, line, column, end_sequence)
      struct line_info_table* table;
      bfd_vma address;
      char* filename;
      unsigned int line;
      unsigned int column;
+     int end_sequence;
 {
   struct line_info* info = (struct line_info*)
     bfd_alloc (table->abfd, sizeof (struct line_info));
@@ -670,6 +683,7 @@
   info->filename = filename;
   info->line = line;
   info->column = column;
+  info->end_sequence = end_sequence;
 }
 
 static char* 
@@ -677,7 +691,16 @@
      struct line_info_table* table;
      unsigned int file;
 {
-  char* filename = table->files[file - 1].name;
+  char* filename;
+
+  if (file - 1 >= table->num_files)
+    {
+      (*_bfd_error_handler) (_("Dwarf Error: mangled line number "
+			       "section (bad file number)."));
+      return "<unknown>";
+    }
+
+  filename = table->files[file - 1].name;
   if (*filename == '/')
     return filename;
 
@@ -690,6 +713,50 @@
     }
 }
 
+static void
+arange_add (unit, low_pc, high_pc)
+     struct comp_unit *unit;
+     bfd_vma low_pc;
+     bfd_vma high_pc;
+{
+  struct arange *arange;
+
+  /* first see if we can cheaply extend an existing range: */
+  arange = &unit->arange;
+  do
+    {
+      if (low_pc == arange->high)
+	{
+	  arange->high = high_pc;
+	  return;
+	}
+      if (high_pc == arange->low)
+	{
+	  arange->low = low_pc;
+	  return;
+	}
+      arange = arange->next;
+    }
+  while (arange);
+
+  if (unit->arange.high == 0)
+    {
+      /* this is the first address range: store it in unit->arange: */
+      unit->arange.next = 0;
+      unit->arange.low = low_pc;
+      unit->arange.high = high_pc;
+      return;
+    }
+
+  /* need to allocate a new arange and insert it into the arange list: */
+  arange = bfd_zalloc (unit->abfd, sizeof (*arange));
+  arange->low = low_pc;
+  arange->high = high_pc;
+
+  arange->next = unit->arange.next;
+  unit->arange.next = arange;
+}
+
 /* Decode the line number information for UNIT. */
 
 static struct line_info_table*
@@ -698,7 +765,7 @@
 {
   bfd *abfd = unit->abfd;
 
-  static char* dwarf_line_buffer = 0;
+  struct dwarf2_debug *stash;
 
   struct line_info_table* table;
 
@@ -709,7 +776,9 @@
   char *cur_file, *cur_dir;
   unsigned char op_code, extended_op, adj_opcode;
 
-  if (! dwarf_line_buffer)
+  stash = elf_tdata (abfd)->dwarf2_find_line_info;
+
+  if (! stash->dwarf_line_buffer)
     {
       asection *msec;
       unsigned long size;
@@ -723,12 +792,12 @@
 	}
       
       size = bfd_get_section_size_before_reloc (msec);
-      dwarf_line_buffer = (unsigned char*) bfd_alloc (abfd, size);
-      if (! dwarf_line_buffer)
+      stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, size);
+      if (! stash->dwarf_line_buffer)
 	return 0;
 
       if (! bfd_get_section_contents (abfd, msec, 
-				      dwarf_line_buffer, 0,
+				      stash->dwarf_line_buffer, 0,
 				      size))
 	return 0;
 
@@ -747,7 +816,10 @@
   table->num_dirs = 0;
   table->dirs = NULL;
 
-  line_ptr = dwarf_line_buffer + unit->line_offset;
+  table->files = NULL;
+  table->last_line = NULL;
+
+  line_ptr = stash->dwarf_line_buffer + unit->line_offset;
 
   /* read in the prologue */
   lh.total_length = read_4_bytes (abfd, line_ptr);
@@ -830,7 +902,8 @@
       unsigned int column = 0;
       int is_stmt = lh.default_is_stmt;
       int basic_block = 0;
-      int end_sequence = 0;
+      int end_sequence = 0, need_low_pc = 1;
+      bfd_vma low_pc = 0;
 
       /* Decode the table. */
       while (! end_sequence)
@@ -847,7 +920,14 @@
 		{
 		case DW_LNE_end_sequence:
 		  end_sequence = 1;
-		  add_line_info (table, address, filename, line, column);
+		  add_line_info (table, address, filename, line, column,
+				 end_sequence);
+		  if (need_low_pc)
+		    {
+		      need_low_pc = 0;
+		      low_pc = address;
+		    }
+		  arange_add (unit, low_pc, address);
 		  break;
 		case DW_LNE_set_address:
 		  address = read_address (unit, line_ptr);
@@ -884,8 +964,13 @@
 		}
 	      break;
 	    case DW_LNS_copy:
-	      add_line_info (table, address, filename, line, column);
+	      add_line_info (table, address, filename, line, column, 0);
 	      basic_block = 0;
+	      if (need_low_pc)
+		{
+		  need_low_pc = 0;
+		  low_pc = address;
+		}
 	      break;
 	    case DW_LNS_advance_pc:
 	      address += lh.minimum_instruction_length
@@ -918,7 +1003,8 @@
 	      basic_block = 1;
 	      break;
 	    case DW_LNS_const_add_pc:
-	      address += (255 - lh.opcode_base) / lh.line_range;
+	      address += lh.minimum_instruction_length
+		      * ((255 - lh.opcode_base) / lh.line_range);
 	      break;
 	    case DW_LNS_fixed_advance_pc:
 	      address += read_2_bytes (abfd, line_ptr);
@@ -930,8 +1016,13 @@
 		* lh.minimum_instruction_length;
 	      line += lh.line_base + (adj_opcode % lh.line_range);
 	      /* append row to matrix using current values */
-	      add_line_info (table, address, filename, line, column);
+	      add_line_info (table, address, filename, line, column, 0);
 	      basic_block = 1;
+	      if (need_low_pc)
+		{
+		  need_low_pc = 0;
+		  low_pc = address;
+		}
 	    }
 	}
     }
@@ -954,21 +1045,25 @@
      const char **filename_ptr;
      unsigned int *linenumber_ptr;
 {
+  struct line_info* next_line = table->last_line;
   struct line_info* each_line;
-  struct line_info* next_line;
   
-  for (next_line = 0, each_line = table->last_line;
-       each_line;
-       next_line = each_line, each_line = each_line->prev_line)
+  if (!next_line)
+    return false;
+
+  each_line = next_line->prev_line;
+
+  while (each_line && next_line)
     {
-      if (addr >= each_line->address
-	  && (next_line == 0
-	      || addr < next_line->address)) 
+      if (!each_line->end_sequence
+	  && addr >= each_line->address && addr < next_line->address)
 	{
 	  *filename_ptr = each_line->filename;
 	  *linenumber_ptr = each_line->line;
 	  return true;
 	}
+      next_line = each_line;
+      each_line = each_line->prev_line;
     }
   
   return false;
@@ -1125,24 +1220,27 @@
 
 
 
-/* Parse a DWARF2 compilation unit starting at INFO_PTR.  This includes
-   the compilation unit header that proceeds the DIE's, but does not
-   include the length field that preceeds each compilation unit header.
-   END_PTR points one past the end of this comp unit.
+/* Parse a DWARF2 compilation unit starting at INFO_PTR.  This
+   includes the compilation unit header that proceeds the DIE's, but
+   does not include the length field that preceeds each compilation
+   unit header.  END_PTR points one past the end of this comp unit.
+   If ABBREV_LENGTH is 0, then the length of the abbreviation offset
+   is assumed to be four bytes.  Otherwise, it it is the size given.
 
    This routine does not read the whole compilation unit; only enough
    to get to the line number information for the compilation unit.  */
 
 static struct comp_unit *
-parse_comp_unit (abfd, info_ptr, end_ptr)
+parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length)
      bfd* abfd;
      char* info_ptr;
      char* end_ptr;
+     unsigned int abbrev_length;
 {
   struct comp_unit* unit;
 
   unsigned short version;
-  unsigned int abbrev_offset;
+  unsigned int abbrev_offset = 0;
   unsigned char addr_size;
   struct abbrev_info** abbrevs;
 
@@ -1152,8 +1250,14 @@
 
   version = read_2_bytes (abfd, info_ptr);
   info_ptr += 2;
-  abbrev_offset = read_4_bytes (abfd, info_ptr);
-  info_ptr += 4;
+  BFD_ASSERT (abbrev_length == 0
+	      || abbrev_length == 4
+	      || abbrev_length == 8);
+  if (abbrev_length == 0 || abbrev_length == 4)
+    abbrev_offset = read_4_bytes (abfd, info_ptr);
+  else if (abbrev_length == 8)
+    abbrev_offset = read_8_bytes (abfd, info_ptr);
+  info_ptr += abbrev_length;
   addr_size = read_1_byte (abfd, info_ptr);
   info_ptr += 1;
 
@@ -1228,11 +1332,11 @@
 	  break;
 
 	case DW_AT_low_pc:
-	  unit->low = DW_ADDR (&attr);
+	  unit->arange.low = DW_ADDR (&attr);
 	  break;
 
 	case DW_AT_high_pc:
-	  unit->high = DW_ADDR (&attr);
+	  unit->arange.high = DW_ADDR (&attr);
 	  break;
 
 	case DW_AT_comp_dir:
@@ -1271,8 +1375,20 @@
      struct comp_unit* unit;
      bfd_vma addr;
 {
-  return ! unit->error
-    && (addr >= unit->low && addr <= unit->high);
+  struct arange *arange;
+
+  if (unit->error)
+    return 0;
+
+  arange = &unit->arange;
+  do
+    {
+      if (addr >= arange->low && addr < arange->high)
+	return 1;
+      arange = arange->next;
+    }
+  while (arange);
+  return 0;
 }
 
 
@@ -1332,19 +1448,25 @@
   return line_p || func_p;
 }
 
-/* The DWARF2 version of find_nearest line.
-   Return true if the line is found without error. */
+/* The DWARF2 version of find_nearest line.  Return true if the line
+   is found without error.  ADDR_SIZE is the number of bytes in the
+   initial .debug_info length field and in the abbreviation offset.
+   You may use zero to indicate that the default value should be
+   used.  */
 
 boolean
 _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
-			  filename_ptr, functionname_ptr, linenumber_ptr)
+			       filename_ptr, functionname_ptr,
+			       linenumber_ptr,
+			       addr_size)
      bfd *abfd;
      asection *section;
-     asymbol **symbols;
+     asymbol **symbols ATTRIBUTE_UNUSED;
      bfd_vma offset;
      const char **filename_ptr;
      const char **functionname_ptr;
      unsigned int *linenumber_ptr;
+     unsigned int addr_size;
 {
   /* Read each compilation unit from the section .debug_info, and check
      to see if it contains the address we are searching for.  If yes,
@@ -1367,6 +1489,13 @@
   *functionname_ptr = NULL;
   *linenumber_ptr = 0;
 
+  /* The DWARF2 spec says that the initial length field, and the
+     offset of the abbreviation table, should both be 4-byte values.
+     However, some compilers do things differently.  */
+  if (addr_size == 0)
+    addr_size = 4;
+  BFD_ASSERT (addr_size == 4 || addr_size == 8);
+    
   if (! stash)
     {
       asection *msec;
@@ -1404,14 +1533,20 @@
 
       stash->info_ptr_end = stash->info_ptr + size;
 
-      /* FIXME:  There is a problem with the contents of the .debug_info section.
-	 The 'low' and 'high' addresses of the comp_units are computed by relocs
-	 against symbols in the .text segment.  We need these addresses in
-	 order to determine the nearest line number, and so we have to resolve
-	 the relocs.  There is a similar problem when the .debug_line section is
-	 processed as well.
+      /* FIXME: There is a problem with the contents of the
+	 .debug_info section.  The 'low' and 'high' addresses of the
+	 comp_units are computed by relocs against symbols in the
+	 .text segment.  We need these addresses in order to determine
+	 the nearest line number, and so we have to resolve the
+	 relocs.  There is a similar problem when the .debug_line
+	 section is processed as well (e.g., there may be relocs
+	 against the operand of the DW_LNE_set_address operator).
 	 
-	 Unfortunately getting hold of the reloc information is hard... */
+	 Unfortunately getting hold of the reloc information is hard...
+
+	 For now, this means that disassembling object files (as
+	 opposed to fully executables) does not always work as well as
+	 we would like.  */
     }
   
   /* A null info_ptr indicates that there is no dwarf2 info 
@@ -1423,27 +1558,28 @@
   /* Check the previously read comp. units first. */
 
   for (each = stash->all_comp_units; each; each = each->next_unit)
-    {
-      if (comp_unit_contains_address (each, addr))
-	return comp_unit_find_nearest_line (each, addr,
-					    filename_ptr, 
-					    functionname_ptr, 
-					    linenumber_ptr);
-    }
+    if (comp_unit_contains_address (each, addr))
+      return comp_unit_find_nearest_line (each, addr, filename_ptr, 
+					  functionname_ptr, linenumber_ptr);
 
   /* Read each remaining comp. units checking each as they are read. */
   while (stash->info_ptr < stash->info_ptr_end)
     {
       struct comp_unit* each;
-      unsigned int length;
+      bfd_vma length;
+      boolean found;
 
-      length = read_4_bytes (abfd, stash->info_ptr);
-      stash->info_ptr += 4;
+      if (addr_size == 4)
+	length = read_4_bytes (abfd, stash->info_ptr);
+      else
+	length = read_8_bytes (abfd, stash->info_ptr);
+      stash->info_ptr += addr_size;
 
       if (length > 0)
         {
 	  each = parse_comp_unit (abfd, stash->info_ptr, 
-				  stash->info_ptr + length);
+				  stash->info_ptr + length,
+				  addr_size);
 	  stash->info_ptr += length;
 
 	  if (each)
@@ -1451,11 +1587,28 @@
 	      each->next_unit = stash->all_comp_units;
 	      stash->all_comp_units = each;
 
-	      if (comp_unit_contains_address (each, addr))
-		return comp_unit_find_nearest_line (each, addr,
-						    filename_ptr, 
-						    functionname_ptr, 
-						    linenumber_ptr);
+	      /* DW_AT_low_pc and DW_AT_high_pc are optional for
+		 compilation units.  If we don't have them (i.e.,
+		 unit->high == 0), we need to consult the line info
+		 table to see if a compilation unit contains the given
+		 address. */
+	      if (each->arange.high > 0)
+		{
+		  if (comp_unit_contains_address (each, addr))
+		    return comp_unit_find_nearest_line (each, addr,
+						       filename_ptr,
+						       functionname_ptr,
+						       linenumber_ptr);
+		}
+	      else
+		{
+		  found = comp_unit_find_nearest_line (each, addr,
+						       filename_ptr,
+						       functionname_ptr,
+						       linenumber_ptr);
+		  if (found)
+		    return true;
+		}
 	    }
 	}
     }
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index d5c6f85..142cf40 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -1,5 +1,5 @@
 /* Generic ECOFF (Extended-COFF) routines.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Original version by Per Bothner.
    Full support added by Ian Lance Taylor, ian@cygnus.com.
@@ -72,7 +72,12 @@
 
 /* This stuff is somewhat copied from coffcode.h.  */
 
-static asection bfd_debug_section = { "*DEBUG*" };
+static asection bfd_debug_section =
+{
+  "*DEBUG*", 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, NULL,
+   0, 0, 0, 0, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, NULL,
+  NULL, NULL
+};
 
 /* Create an ECOFF object.  */
 
@@ -138,7 +143,7 @@
 
 boolean
 _bfd_ecoff_new_section_hook (abfd, section)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *section;
 {
   section->alignment_power = 4;
@@ -350,9 +355,9 @@
 /*ARGSUSED*/
 flagword
 _bfd_ecoff_styp_to_sec_flags (abfd, hdr, name)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      PTR hdr;
-     const char *name;
+     const char *name ATTRIBUTE_UNUSED;
 {
   struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
   long styp_flags = internal_s->s_flags;
@@ -496,7 +501,7 @@
 boolean
 _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug)
      bfd *abfd;
-     asection *ignore;
+     asection *ignore ATTRIBUTE_UNUSED;
      struct ecoff_debug_info *debug;
 {
   const struct ecoff_backend_data * const backend = ecoff_backend (abfd);
@@ -1433,7 +1438,7 @@
 /*ARGSUSED*/
 void
 _bfd_ecoff_get_symbol_info (abfd, symbol, ret)
-     bfd *abfd;			/* Ignored.  */
+     bfd *abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -1445,7 +1450,7 @@
 /*ARGSUSED*/
 boolean
 _bfd_ecoff_bfd_is_local_label_name (abfd, name)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      const char *name;
 {
   return name[0] == '$';
@@ -1801,7 +1806,7 @@
 			      filename_ptr, functionname_ptr, retline_ptr)
      bfd *abfd;
      asection *section;
-     asymbol **ignore_symbols;
+     asymbol **ignore_symbols ATTRIBUTE_UNUSED;
      bfd_vma offset;
      CONST char **filename_ptr;
      CONST char **functionname_ptr;
@@ -1971,7 +1976,7 @@
 int
 _bfd_ecoff_sizeof_headers (abfd, reloc)
      bfd *abfd;
-     boolean reloc;
+     boolean reloc ATTRIBUTE_UNUSED;
 {
   asection *current;
   int c;
@@ -3181,7 +3186,14 @@
      armap.  */
   hdr.ar_uid[0] = '0';
   hdr.ar_gid[0] = '0';
+#if 0
   hdr.ar_mode[0] = '0';
+#else
+  /* Building gcc ends up extracting the armap as a file - twice. */
+  hdr.ar_mode[0] = '6';
+  hdr.ar_mode[1] = '4';
+  hdr.ar_mode[2] = '4';
+#endif
 
   sprintf (hdr.ar_size, "%-10d", (int) mapsize);
 
diff --git a/bfd/ecofflink.c b/bfd/ecofflink.c
index a120a2b..25fc966 100644
--- a/bfd/ecofflink.c
+++ b/bfd/ecofflink.c
@@ -1,5 +1,5 @@
 /* Routines to link ECOFF debugging information.
-   Copyright 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -491,9 +491,9 @@
 /*ARGSUSED*/
 PTR
 bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info)
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      struct ecoff_debug_info *output_debug;
-     const struct ecoff_debug_swap *output_swap;
+     const struct ecoff_debug_swap *output_swap ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
 {
   struct accumulate *ainfo;
@@ -551,9 +551,9 @@
 void
 bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info)
      PTR handle;
-     bfd *output_bfd;
-     struct ecoff_debug_info *output_debug;
-     const struct ecoff_debug_swap *output_swap;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     struct ecoff_debug_info *output_debug ATTRIBUTE_UNUSED;
+     const struct ecoff_debug_swap *output_swap ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
 {
   struct accumulate *ainfo = (struct accumulate *) handle;
@@ -1412,7 +1412,7 @@
 /*ARGSUSED*/
 static void
 ecoff_align_debug (abfd, debug, swap)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      struct ecoff_debug_info *debug;
      const struct ecoff_debug_swap *swap;
 {
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 82ffe2a..577823b 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1,5 +1,6 @@
 /* BFD back-end data structures for ELF files.
-   Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 Free Software
+   Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -85,6 +86,16 @@
 
   /* Symbol index as a dynamic symbol.  Initialized to -1, and remains
      -1 if this is not a dynamic symbol.  */
+  /* ??? Note that this is consistently used as a synonym for tests
+     against whether we can perform various simplifying transformations
+     to the code.  (E.g. changing a pc-relative jump to a PLT entry
+     into a pc-relative jump to the target function.)  That test, which
+     is often relatively complex, and someplaces wrong or incomplete,
+     should really be replaced by a predicate in elflink.c.
+
+     End result: this field -1 does not indicate that the symbol is
+     not in the dynamic symbol table, but rather that the symbol is
+     not visible outside this DSO.  */
   long dynindx;
 
   /* String table index in .dynstr if this is a dynamic symbol.  */
@@ -180,6 +191,25 @@
 #define ELF_LINK_HASH_MARK 04000
 };
 
+/* Records local symbols to be emitted in the dynamic symbol table.  */
+
+struct elf_link_local_dynamic_entry
+{
+  struct elf_link_local_dynamic_entry *next;
+
+  /* The input bfd this symbol came from.  */
+  bfd *input_bfd;
+
+  /* The index of the local symbol being copied.  */
+  long input_indx;
+
+  /* The index in the outgoing dynamic symbol table.  */
+  long dynindx;
+  
+  /* A copy of the input symbol.  */
+  Elf_Internal_Sym isym;
+};
+
 /* ELF linker hash table.  */
 
 struct elf_link_hash_table
@@ -208,6 +238,8 @@
   struct elf_link_hash_entry *hgot;
   /* A pointer to information used to link stabs in sections.  */
   PTR stab_info;
+  /* A linked list of local symbols to be added to .dynsym.  */
+  struct elf_link_local_dynamic_entry *dynlocal;
 };
 
 /* Look up an entry in an ELF linker hash table.  */
@@ -235,6 +267,13 @@
   unsigned char sizeof_ehdr, sizeof_phdr, sizeof_shdr;
   unsigned char sizeof_rel, sizeof_rela, sizeof_sym, sizeof_dyn, sizeof_note;
 
+  /* The size of entries in the .hash section.  */
+  unsigned char sizeof_hash_entry;
+
+  /* The number of internal relocations to allocate per external
+     relocation entry.  */
+  unsigned char int_rels_per_ext_rel;
+
   unsigned char arch_size, file_align;
   unsigned char elfclass, ev_current;
   int (*write_out_phdrs) PARAMS ((bfd *, const Elf_Internal_Phdr *, int));
@@ -245,6 +284,32 @@
     PARAMS ((bfd *, asection *, asymbol **, boolean));
   long (*slurp_symbol_table) PARAMS ((bfd *, asymbol **, boolean));
   void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
+  void (*swap_dyn_out) PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
+
+  /* This function, if defined, is called to swap in a REL
+     relocation.  If an external relocation corresponds to more than
+     one internal relocation, then all relocations are swapped in at
+     once.  */
+  void (*swap_reloc_in)
+    PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rel *));
+
+  /* This function, if defined, is called to swap out a REL
+     relocation.  */
+  void (*swap_reloc_out)
+    PARAMS ((bfd *, const Elf_Internal_Rel *, bfd_byte *));
+
+  /* This function, if defined, is called to swap in a RELA
+     relocation.  If an external relocation corresponds to more than
+     one internal relocation, then all relocations are swapped in at
+     once.  */
+  void (*swap_reloca_in)
+    PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+
+  /* This function, if defined, is called to swap out a RELA
+     relocation.  */
+  void (*swap_reloca_out)
+    PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+
 };
 
 #define elf_symbol_from(ABFD,S) \
@@ -255,11 +320,6 @@
 
 struct elf_backend_data
 {
-  /* Whether the backend uses REL or RELA relocations.  FIXME: some
-     ELF backends use both.  When we need to support one, this whole
-     approach will need to be changed.  */
-  int use_rela_p;
-
   /* The architecture for this backend.  */
   enum bfd_architecture arch;
 
@@ -515,6 +575,12 @@
     PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
 	     const Elf_Internal_Rela *relocs));
 
+  /* This function, if defined, is called after the ELF headers have
+     been created.  This allows for things like the OS and ABI versions
+     to be changed.  */
+  void (*elf_backend_post_process_headers)
+    PARAMS ((bfd *, struct bfd_link_info *));
+
   /* The swapping table to use when dealing with ECOFF information.
      Used for the MIPS ELF .mdebug section.  */
   const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap;
@@ -534,12 +600,30 @@
   bfd_vma got_header_size;
   bfd_vma plt_header_size;
 
+  /* Whether the backend may use REL relocations.  (Some backends use
+     both REL and RELA relocations, and this flag is set for those
+     backends.)  */
+  unsigned may_use_rel_p : 1;
+    
+  /* Whether the backend may use RELA relocations.  (Some backends use
+     both REL and RELA relocations, and this flag is set for those
+     backends.)  */
+  unsigned may_use_rela_p : 1;
+
+  /* Whether the default relocation type is RELA.  If a backend with
+     this flag set wants REL relocations for a particular section,
+     it must note that explicitly.  Similarly, if this flag is clear,
+     and the backend wants RELA relocations for a particular 
+     section.  */   
+  unsigned default_use_rela_p : 1;
+
   unsigned want_got_plt : 1;
   unsigned plt_readonly : 1;
   unsigned want_plt_sym : 1;
   unsigned plt_not_loaded : 1;
   unsigned plt_alignment : 4;
   unsigned can_gc_sections : 1;
+  unsigned want_dynbss : 1;
 };
 
 /* Information stored for each BFD section in an ELF file.  This
@@ -555,12 +639,19 @@
   /* If there is a second reloc section associated with this section,
      as can happen on Irix 6, this field points to the header.  */
   Elf_Internal_Shdr *rel_hdr2;
+  /* The number of relocations currently assigned to REL_HDR.  */
+  unsigned int rel_count;
+  /* The number of relocations currently assigned to REL_HDR2.  */
+  unsigned int rel_count2;
   /* The ELF section number of this section.  Only used for an output
      file.  */
   int this_idx;
-  /* The ELF section number of the reloc section associated with this
-     section, if any.  Only used for an output file.  */
+  /* The ELF section number of the reloc section indicated by
+     REL_HDR if any.  Only used for an output file.  */
   int rel_idx;
+  /* The ELF section number of the reloc section indicated by
+     REL_HDR2 if any.  Only used for an output file.  */
+  int rel_idx2;
   /* Used by the backend linker to store the symbol hash table entries
      associated with relocs against global symbols.  */
   struct elf_link_hash_entry **rel_hashes;
@@ -570,12 +661,15 @@
   Elf_Internal_Rela *relocs;
   /* Used by the backend linker when generating a shared library to
      record the dynamic symbol index for a section symbol
-     corresponding to this section.  */
+     corresponding to this section.  A value of 0 means that there is
+     no dynamic symbol for this section.  */
   long dynindx;
   /* A pointer used for .stab linking optimizations.  */
   PTR stab_info;
   /* A pointer available for the processor specific ELF backend.  */
   PTR tdata;
+  /* Nonzero if this section uses RELA relocations, rather than REL.  */
+  unsigned int use_rela_p:1;
 };
 
 #define elf_section_data(sec)  ((struct bfd_elf_section_data*)sec->used_by_bfd)
@@ -815,7 +909,7 @@
 #define bfd_elf32_print_symbol	bfd_elf_print_symbol
 #define bfd_elf64_print_symbol	bfd_elf_print_symbol
 
-extern unsigned long bfd_elf_hash PARAMS ((CONST unsigned char *));
+extern unsigned long bfd_elf_hash PARAMS ((const char *));
 
 extern bfd_reloc_status_type bfd_elf_generic_reloc PARAMS ((bfd *,
 							    arelent *,
@@ -875,6 +969,8 @@
 #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
 extern int _bfd_elf_sizeof_headers PARAMS ((bfd *, boolean));
 extern boolean _bfd_elf_new_section_hook PARAMS ((bfd *, asection *));
+extern boolean _bfd_elf_init_reloc_shdr 
+  PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, boolean));
 
 /* If the target doesn't have reloc handling written yet:  */
 extern void _bfd_elf_no_info_to_howto PARAMS ((bfd *, arelent *,
@@ -892,6 +988,9 @@
 boolean
 _bfd_elf_link_record_dynamic_symbol PARAMS ((struct bfd_link_info *,
 					     struct elf_link_hash_entry *));
+long
+_bfd_elf_link_lookup_local_dynindx PARAMS ((struct bfd_link_info *,
+					    bfd *, long));
 boolean
 _bfd_elf_compute_section_file_positions PARAMS ((bfd *,
 						 struct bfd_link_info *));
@@ -906,6 +1005,8 @@
 						  struct bfd_link_info *));
 boolean _bfd_elf_create_got_section PARAMS ((bfd *,
 					     struct bfd_link_info *));
+unsigned long _bfd_elf_link_renumber_dynsyms PARAMS ((bfd *,
+						      struct bfd_link_info *));
 
 elf_linker_section_t *_bfd_elf_create_linker_section
   PARAMS ((bfd *abfd,
@@ -991,7 +1092,7 @@
 extern void bfd_elf32_swap_dyn_in
   PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
 extern void bfd_elf32_swap_dyn_out
-  PARAMS ((bfd *, const Elf_Internal_Dyn *, Elf32_External_Dyn *));
+  PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
 extern long bfd_elf32_slurp_symbol_table
   PARAMS ((bfd *, asymbol **, boolean));
 extern boolean bfd_elf32_write_shdrs_and_ehdr PARAMS ((bfd *));
@@ -1034,7 +1135,7 @@
 extern void bfd_elf64_swap_dyn_in
   PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
 extern void bfd_elf64_swap_dyn_out
-  PARAMS ((bfd *, const Elf_Internal_Dyn *, Elf64_External_Dyn *));
+  PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
 extern long bfd_elf64_slurp_symbol_table
   PARAMS ((bfd *, asymbol **, boolean));
 extern boolean bfd_elf64_write_shdrs_and_ehdr PARAMS ((bfd *));
@@ -1047,8 +1148,15 @@
 extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs
   PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, boolean));
 
-#define bfd_elf32_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
-#define bfd_elf64_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
+#define bfd_elf32_link_record_dynamic_symbol \
+  _bfd_elf_link_record_dynamic_symbol
+#define bfd_elf64_link_record_dynamic_symbol \
+  _bfd_elf_link_record_dynamic_symbol
+
+boolean _bfd_elf32_link_record_local_dynamic_symbol
+  PARAMS ((struct bfd_link_info *, bfd *, long));
+boolean _bfd_elf64_link_record_local_dynamic_symbol
+  PARAMS ((struct bfd_link_info *, bfd *, long));
 
 extern boolean _bfd_elf_close_and_cleanup PARAMS ((bfd *));
 extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn
@@ -1081,7 +1189,7 @@
 
 extern boolean _bfd_mips_elf_object_p PARAMS ((bfd *));
 extern boolean _bfd_mips_elf_section_from_shdr
-  PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
+  PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
 extern boolean _bfd_mips_elf_fake_sections
   PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
 extern boolean _bfd_mips_elf_section_from_bfd_section
@@ -1110,5 +1218,44 @@
 	   const char **, unsigned int *));
 extern boolean _bfd_mips_elf_set_section_contents
   PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
+extern boolean _bfd_mips_elf_create_dynamic_sections
+  PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean _bfd_mips_elf_add_symbol_hook
+  PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+	   const char **, flagword *, asection **, bfd_vma *));
+extern boolean _bfd_mips_elf_adjust_dynamic_symbol
+  PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+extern boolean _bfd_mips_elf_finish_dynamic_symbol
+  PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+	   Elf_Internal_Sym *));
+extern boolean _bfd_mips_elf_finish_dynamic_sections
+  PARAMS ((bfd *, struct bfd_link_info *));
+extern asection * _bfd_mips_elf_gc_mark_hook 
+  PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
+	   struct elf_link_hash_entry *, Elf_Internal_Sym *));
+extern boolean _bfd_mips_elf_gc_sweep_hook 
+  PARAMS ((bfd *, struct bfd_link_info *, asection *, 
+	   const Elf_Internal_Rela *));
+extern boolean _bfd_mips_elf_always_size_sections
+  PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean _bfd_mips_elf_size_dynamic_sections
+  PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean _bfd_mips_elf_check_relocs
+  PARAMS ((bfd *, struct bfd_link_info *, asection *,
+	   const Elf_Internal_Rela *));
+extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create
+  PARAMS ((bfd *));
+extern boolean _bfd_mips_elf_print_private_bfd_data 
+  PARAMS ((bfd *, PTR));
+extern boolean _bfd_mips_elf_link_output_symbol_hook
+  PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *,
+	   asection *));
+extern boolean _bfd_mips_elf_final_link
+  PARAMS ((bfd *, struct bfd_link_info *));
+extern int _bfd_mips_elf_additional_program_headers PARAMS ((bfd *));
+extern boolean _bfd_mips_elf_modify_segment_map PARAMS ((bfd *));
+extern boolean _bfd_mips_elf_relocate_section
+  PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+	   Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
 
 #endif /* _LIBELF_H_ */
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h
new file mode 100644
index 0000000..26c863b
--- /dev/null
+++ b/bfd/elf-hppa.h
@@ -0,0 +1,598 @@
+/* Common code for PA ELF implementations.
+   Copyright (C) 1999 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 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.  */
+
+#define ELF_HOWTO_TABLE_SIZE       R_PARISC_UNIMPLEMENTED + 1
+
+#if ARCH_SIZE == 64
+#define ELF_R_TYPE(X)   ELF64_R_TYPE(X)
+#define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type
+#endif
+#if ARCH_SIZE == 32
+#define ELF_R_TYPE(X)   ELF32_R_TYPE(X)
+#define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type
+#endif
+
+/* ELF/PA relocation howto entries.  */
+
+static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] =
+{
+  {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_NONE", false, 0, 0, false},
+
+  /* The values in DIR32 are to placate the check in
+     _bfd_stab_section_find_nearest_line.  */
+  {R_PARISC_DIR32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR32", false, 0, 0xffffffff, false},
+  {R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR21L", false, 0, 0, false},
+  {R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR17R", false, 0, 0, false},
+  {R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR17F", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_DIR14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14R", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_PCREL32, 0, 0, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL32", false, 0, 0, false},
+
+  {R_PARISC_PCREL21L, 0, 0, 21, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL21L", false, 0, 0, false},
+  {R_PARISC_PCREL17R, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17R", false, 0, 0, false},
+  {R_PARISC_PCREL17F, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17F", false, 0, 0, false},
+  {R_PARISC_PCREL17C, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17C", false, 0, 0, false},
+  {R_PARISC_PCREL14R, 0, 0, 14, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14R", false, 0, 0, false},
+  {R_PARISC_PCREL14F, 0, 0, 14, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14F", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_DPREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL21L", false, 0, 0, false},
+  {R_PARISC_DPREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14WR", false, 0, 0, false},
+
+  {R_PARISC_DPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14DR", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_DPREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14R", false, 0, 0, false},
+  {R_PARISC_DPREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14F", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_DLTREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL21L", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_DLTREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14R", false, 0, 0, false},
+  {R_PARISC_DLTREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14F", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_DLTIND21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND21L", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_DLTIND14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14R", false, 0, 0, false},
+  {R_PARISC_DLTIND14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14F", false, 0, 0, false},
+
+  {R_PARISC_SETBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SETBASE", false, 0, 0, false},
+  {R_PARISC_SECREL32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SECREL32", false, 0, 0, false},
+  {R_PARISC_BASEREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL21L", false, 0, 0, false},
+  {R_PARISC_BASEREL17R, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL17R", false, 0, 0, false},
+  {R_PARISC_BASEREL17F, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL17F", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_BASEREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14R", false, 0, 0, false},
+  {R_PARISC_BASEREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14F", false, 0, 0, false},
+  {R_PARISC_SEGBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGBASE", false, 0, 0, false},
+  {R_PARISC_SEGREL32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGREL32", false, 0, 0, false},
+
+  {R_PARISC_PLTOFF21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF21L", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_PLTOFF14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14R", false, 0, 0, false},
+  {R_PARISC_PLTOFF14F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14F", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_LTOFF_FPTR32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR32", false, 0, 0, false},
+  {R_PARISC_LTOFF_FPTR21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR21L", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_LTOFF_FPTR14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14R", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_FPTR64", false, 0, 0, false},
+  {R_PARISC_PLABEL32, 0, 0, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL32", false, 0, 0, false},
+  {R_PARISC_PLABEL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL21L", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_PLABEL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL14R", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_PCREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL64", false, 0, 0, false},
+  {R_PARISC_PCREL22C, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL22C", false, 0, 0, false},
+  {R_PARISC_PCREL22F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL22F", false, 0, 0, false},
+  {R_PARISC_PCREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14WR", false, 0, 0, false},
+  {R_PARISC_PCREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14DR", false, 0, 0, false},
+  {R_PARISC_PCREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16F", false, 0, 0, false},
+  {R_PARISC_PCREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16WF", false, 0, 0, false},
+  {R_PARISC_PCREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16DF", false, 0, 0, false},
+
+  {R_PARISC_DIR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR64", false, 0, 0, false},
+  {R_PARISC_DIR64WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR64WR", false, 0, 0, false},
+  {R_PARISC_DIR64DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR64DR", false, 0, 0, false},
+  {R_PARISC_DIR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14WR", false, 0, 0, false},
+  {R_PARISC_DIR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14DR", false, 0, 0, false},
+  {R_PARISC_DIR16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16F", false, 0, 0, false},
+  {R_PARISC_DIR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16WF", false, 0, 0, false},
+  {R_PARISC_DIR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16DF", false, 0, 0, false},
+  {R_PARISC_GPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL64", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_DLTREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14WR", false, 0, 0, false},
+  {R_PARISC_DLTREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14DR", false, 0, 0, false},
+  {R_PARISC_GPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16F", false, 0, 0, false},
+  {R_PARISC_GPREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16WF", false, 0, 0, false},
+  {R_PARISC_GPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16DF", false, 0, 0, false},
+  {R_PARISC_LTOFF64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF64", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_DLTIND14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14WR", false, 0, 0, false},
+
+  {R_PARISC_DLTIND14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14DR", false, 0, 0, false},
+  {R_PARISC_LTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16F", false, 0, 0, false},
+  {R_PARISC_LTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", false, 0, 0, false},
+  {R_PARISC_SECREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SECREL64", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_BASEREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BSEREL14WR", false, 0, 0, false},
+  {R_PARISC_BASEREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14DR", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_SEGREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGREL64", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_PLTOFF14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14WR", false, 0, 0, false},
+  {R_PARISC_PLTOFF14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14DR", false, 0, 0, false},
+  {R_PARISC_PLTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16F", false, 0, 0, false},
+  {R_PARISC_PLTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16WF", false, 0, 0, false},
+  {R_PARISC_PLTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16DF", false, 0, 0, false},
+
+  {R_PARISC_LTOFF_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_LTOFF_FPTR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14WR", false, 0, 0, false},
+  {R_PARISC_LTOFF_FPTR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14DR", false, 0, 0, false},
+  {R_PARISC_LTOFF_FPTR16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16F", false, 0, 0, false},
+  {R_PARISC_LTOFF_FPTR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16WF", false, 0, 0, false},
+  {R_PARISC_LTOFF_FPTR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_COPY, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_COPY", false, 0, 0, false},
+  {R_PARISC_IPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_IPLT", false, 0, 0, false},
+
+  {R_PARISC_EPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_EPLT", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_TPREL32, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL32", false, 0, 0, false},
+  {R_PARISC_TPREL21L, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL21L", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_TPREL14R, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL14R", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_LTOFF_TP21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP21L", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_LTOFF_TP14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_LTOFF_TP14F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14F", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_TPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL64", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_TPREL14WR, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL14WR", false, 0, 0, false},
+
+  {R_PARISC_TPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL14DR", false, 0, 0, false},
+  {R_PARISC_TPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL16F", false, 0, 0, false},
+  {R_PARISC_TPREL16WF, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL16WF", false, 0, 0, false},
+  {R_PARISC_TPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL16DF", false, 0, 0, false},
+  {R_PARISC_LTOFF_TP64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP64", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false},
+  {R_PARISC_LTOFF_TP14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14WR", false, 0, 0, false},
+  {R_PARISC_LTOFF_TP14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14DR", false, 0, 0, false},
+  {R_PARISC_LTOFF_TP16F, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_LTOFF_TP16F", false, 0, 0, false},
+
+  {R_PARISC_LTOFF_TP16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16WF", false, 0, 0, false},
+  {R_PARISC_LTOFF_TP16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16DF", false, 0, 0, false},
+};
+
+#define OFFSET_14R_FROM_21L 4
+#define OFFSET_14F_FROM_21L 5
+
+/* Return one (or more) BFD relocations which implement the base
+   relocation with modifications based on format and field.  */
+
+elf_hppa_reloc_type **
+_bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
+     bfd *abfd;
+     elf_hppa_reloc_type base_type;
+     int format;
+     int field;
+     int ignore ATTRIBUTE_UNUSED;
+     asymbol *sym ATTRIBUTE_UNUSED;
+{
+  elf_hppa_reloc_type *finaltype;
+  elf_hppa_reloc_type **final_types;
+
+  /* Allocate slots for the BFD relocation.  */
+  final_types = ((elf_hppa_reloc_type **)
+		 bfd_alloc (abfd, sizeof (elf_hppa_reloc_type *) * 2));
+  if (final_types == NULL)
+    return NULL;
+
+  /* Allocate space for the relocation itself.  */
+  finaltype = ((elf_hppa_reloc_type *)
+	       bfd_alloc (abfd, sizeof (elf_hppa_reloc_type)));
+  if (finaltype == NULL)
+    return NULL;
+
+  /* Some reasonable defaults.  */
+  final_types[0] = finaltype;
+  final_types[1] = NULL;
+
+#define final_type finaltype[0]
+
+  final_type = base_type;
+
+  /* Just a tangle of nested switch statements to deal with the braindamage
+     that a different field selector means a completely different relocation
+     for PA ELF.  */
+  switch (base_type)
+    {
+    case R_HPPA:
+    case R_HPPA_ABS_CALL:
+      switch (format)
+	{
+	case 14:
+	  switch (field)
+	    {
+	    case e_rsel:
+	    case e_rrsel:
+	      final_type = R_PARISC_DIR14R;
+	      break;
+	    case e_rtsel:
+	      final_type = R_PARISC_DLTIND14R;
+	      break;
+	    case e_tsel:
+	      final_type = R_PARISC_DLTIND14F;
+	      break;
+	    case e_rpsel:
+	      final_type = R_PARISC_PLABEL14R;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	case 17:
+	  switch (field)
+	    {
+	    case e_fsel:
+	      final_type = R_PARISC_DIR17F;
+	      break;
+	    case e_rsel:
+	    case e_rrsel:
+	      final_type = R_PARISC_DIR17R;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	case 21:
+	  switch (field)
+	    {
+	    case e_lsel:
+	    case e_lrsel:
+	      final_type = R_PARISC_DIR21L;
+	      break;
+	    case e_ltsel:
+	      final_type = R_PARISC_DLTIND21L;
+	      break;
+	    case e_lpsel:
+	      final_type = R_PARISC_PLABEL21L;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	case 32:
+	  switch (field)
+	    {
+	    case e_fsel:
+	      final_type = R_PARISC_DIR32;
+	      break;
+	    case e_psel:
+	      final_type = R_PARISC_PLABEL32;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	case 64:
+	  switch (field)
+	    {
+	    case e_fsel:
+	      final_type = R_PARISC_DIR64;
+	      break;
+	    case e_psel:
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	default:
+	  return NULL;
+	}
+      break;
+
+
+    case R_HPPA_GOTOFF:
+      switch (format)
+	{
+	case 14:
+	  switch (field)
+	    {
+	    case e_rsel:
+	    case e_rrsel:
+	      final_type = base_type + OFFSET_14R_FROM_21L;
+	      break;
+	    case e_fsel:
+	      final_type = base_type + OFFSET_14F_FROM_21L;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	case 21:
+	  switch (field)
+	    {
+	    case e_lrsel:
+	    case e_lsel:
+	      final_type = base_type;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	default:
+	  return NULL;
+	}
+      break;
+
+
+    case R_HPPA_PCREL_CALL:
+      switch (format)
+	{
+	case 14:
+	  switch (field)
+	    {
+	    case e_rsel:
+	    case e_rrsel:
+	      final_type = R_PARISC_PCREL14R;
+	      break;
+	    case e_fsel:
+	      final_type = R_PARISC_PCREL14F;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	case 17:
+	  switch (field)
+	    {
+	    case e_rsel:
+	    case e_rrsel:
+	      final_type = R_PARISC_PCREL17R;
+	      break;
+	    case e_fsel:
+	      final_type = R_PARISC_PCREL17F;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	case 22:
+	  switch (field)
+	    {
+	    case e_fsel:
+	      final_type = R_PARISC_PCREL22F;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	case 21:
+	  switch (field)
+	    {
+	    case e_lsel:
+	    case e_lrsel:
+	      final_type = R_PARISC_PCREL21L;
+	      break;
+	    default:
+	      return NULL;
+	    }
+	  break;
+
+	default:
+	  return NULL;
+	}
+      break;
+
+    default:
+      return NULL;
+    }
+
+  return final_types;
+}
+
+/* Translate from an elf into field into a howto relocation pointer.  */
+
+static void
+elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *bfd_reloc;
+     Elf_Internal_Rela *elf_reloc;
+{
+  BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info)
+	      < (unsigned int) R_PARISC_UNIMPLEMENTED);
+  bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)];
+}
+
+/* Translate from an elf into field into a howto relocation pointer.  */
+
+static void
+elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *bfd_reloc;
+     Elf_Internal_Rel *elf_reloc;
+{
+  BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info)
+	      < (unsigned int) R_PARISC_UNIMPLEMENTED);
+  bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)];
+}
+
+/* Return the address of the howto table entry to perform the CODE
+   relocation for an ARCH machine.  */
+
+static reloc_howto_type *
+elf_hppa_reloc_type_lookup (abfd, code)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     bfd_reloc_code_real_type code;
+{
+  if ((int) code < (int) R_PARISC_UNIMPLEMENTED)
+    {
+      BFD_ASSERT ((int) elf_hppa_howto_table[(int) code].type == (int) code);
+      return &elf_hppa_howto_table[(int) code];
+    }
+  return NULL;
+}
+
+static void
+elf_hppa_final_write_processing (abfd, linker)
+     bfd *abfd;
+     boolean linker ATTRIBUTE_UNUSED;
+{
+  int mach = bfd_get_mach (abfd);
+
+  elf_elfheader (abfd)->e_flags &= ~(EF_PARISC_ARCH | EF_PARISC_TRAPNIL
+				     | EF_PARISC_EXT | EF_PARISC_LSB
+				     | EF_PARISC_WIDE | EF_PARISC_NO_KABP
+				     | EF_PARISC_LAZYSWAP);
+
+  if (mach == 10)
+    elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_0;
+  else if (mach == 11)
+    elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_1;
+  else if (mach == 20)
+    {
+      elf_elfheader (abfd)->e_flags |= EFA_PARISC_2_0;
+#if ARCH_SIZE == 64
+      elf_elfheader (abfd)->e_flags |= EF_PARISC_WIDE;
+#endif
+    }
+
+}
diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c
index 53d193d..88556fb 100644
--- a/bfd/elf-m10200.c
+++ b/bfd/elf-m10200.c
@@ -1,5 +1,5 @@
 /* Matsushita 10200 specific support for 32-bit ELF
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -185,7 +185,7 @@
 
 static reloc_howto_type *
 bfd_elf32_bfd_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -205,7 +205,7 @@
 
 static void
 mn10200_info_to_howto (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf32_Internal_Rela *dst;
 {
@@ -223,15 +223,15 @@
 				 addend, info, sym_sec, is_local)
      reloc_howto_type *howto;
      bfd *input_bfd;
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd_byte *contents;
      bfd_vma offset;
      bfd_vma value;
      bfd_vma addend;
-     struct bfd_link_info *info;
-     asection *sym_sec;
-     int is_local;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sym_sec ATTRIBUTE_UNUSED;
+     int is_local ATTRIBUTE_UNUSED;
 {
   unsigned long r_type = howto->type;
   bfd_byte *hit_data = contents + offset;
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index 9ba09a8..c46dc0c 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -1,5 +1,5 @@
 /* Matsushita 10300 specific support for 32-bit ELF
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -290,7 +290,7 @@
 
 static reloc_howto_type *
 bfd_elf32_bfd_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -310,7 +310,7 @@
 
 static void
 mn10300_info_to_howto (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf32_Internal_Rela *dst;
 {
@@ -385,7 +385,7 @@
 static asection *
 mn10300_elf_gc_mark_hook (abfd, info, rel, h, sym)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      Elf_Internal_Rela *rel;
      struct elf_link_hash_entry *h;
      Elf_Internal_Sym *sym;
@@ -407,6 +407,9 @@
 
 	    case bfd_link_hash_common:
 	      return h->root.u.c.p->section;
+
+	    default:
+	      break;
 	    }
 	}
     }
@@ -431,15 +434,15 @@
 				 addend, info, sym_sec, is_local)
      reloc_howto_type *howto;
      bfd *input_bfd;
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd_byte *contents;
      bfd_vma offset;
      bfd_vma value;
      bfd_vma addend;
-     struct bfd_link_info *info;
-     asection *sym_sec;
-     int is_local;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sym_sec ATTRIBUTE_UNUSED;
+     int is_local ATTRIBUTE_UNUSED;
 {
   unsigned long r_type = howto->type;
   bfd_byte *hit_data = contents + offset;
@@ -696,7 +699,7 @@
 static boolean
 elf32_mn10300_finish_hash_table_entry (gen_entry, in_args)
      struct bfd_hash_entry *gen_entry;
-     PTR in_args;
+     PTR in_args ATTRIBUTE_UNUSED;
 {
   struct elf32_mn10300_link_hash_entry *entry;
   unsigned int byte_count = 0;
@@ -849,7 +852,6 @@
 	      asection *sym_sec;
 	      const char *sym_name;
 	      char *new_name;
-	      Elf_Internal_Shdr *hdr;
 
 	      /* Get cached copy of section contents if it exists.  */
 	      if (elf_section_data (section)->this_hdr.contents != NULL)
@@ -1193,7 +1195,6 @@
 		  struct elf32_mn10300_link_hash_entry *sym_hash;
 		  asection *sym_sec;
 		  const char *sym_name;
-		  Elf_Internal_Shdr *hdr;
 		  char *new_name;
 
 		  bfd_elf32_swap_symbol_in (input_bfd, esym, &isym);
@@ -1461,7 +1462,6 @@
 	{
 	  Elf_Internal_Sym isym;
 	  asection *sym_sec;
-	  Elf_Internal_Shdr *hdr;
 	  const char *sym_name;
 	  char *new_name;
 
@@ -2735,13 +2735,9 @@
 void
 _bfd_mn10300_elf_final_write_processing (abfd, linker)
      bfd *abfd;
-     boolean linker;
+     boolean linker ATTRIBUTE_UNUSED;
 {
   unsigned long val;
-  unsigned int i;
-  Elf_Internal_Shdr **hdrpp;
-  const char *name;
-  asection *sec;
 
   switch (bfd_get_mach (abfd))
     {
diff --git a/bfd/elf.c b/bfd/elf.c
index ab010d4..9291b98 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -200,10 +200,12 @@
 
 /* Standard ELF hash function.  Do not change this function; you will
    cause invalid hash tables to be generated.  */
+
 unsigned long
-bfd_elf_hash (name)
-     CONST unsigned char *name;
+bfd_elf_hash (namearg)
+     const char *namearg;
 {
+  const unsigned char *name = (const unsigned char *) namearg;
   unsigned long h = 0;
   unsigned long g;
   int ch;
@@ -503,13 +505,13 @@
 		       input_section,
 		       output_bfd,
 		       error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
-     PTR data;
+     PTR data ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   if (output_bfd != (bfd *) NULL
       && (symbol->flags & BSF_SECTION_SYM) == 0
@@ -944,7 +946,7 @@
 
 struct bfd_link_needed_list *
 bfd_elf_get_needed_list (abfd, info)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
 {
   if (info->hash->creator->flavour != bfd_target_elf_flavour)
@@ -1201,6 +1203,15 @@
 	asection *target_sect;
 	Elf_Internal_Shdr *hdr2;
 
+	/* Check for a bogus link to avoid crashing.  */
+	if (hdr->sh_link >= ehdr->e_shnum)
+	  {
+	    ((*_bfd_error_handler)
+	     (_("%s: invalid link %lu for reloc section %s (index %u)"),
+	      bfd_get_filename (abfd), hdr->sh_link, name, shindex));
+	    return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
+	  }
+
 	/* For some incomprehensible reason Oracle distributes
 	   libraries for Solaris in which some of the objects have
 	   bogus sh_link fields.  It would be nice if we could just
@@ -1265,6 +1276,10 @@
 	target_sect->flags |= SEC_RELOC;
 	target_sect->relocation = NULL;
 	target_sect->rel_filepos = hdr->sh_offset;
+	/* In the section to which the relocations apply, mark whether
+	   its relocations are of the REL or RELA variety.  */
+	elf_section_data (target_sect)->use_rela_p 
+	  = (hdr->sh_type == SHT_RELA);
 	abfd->flags |= HAS_RELOC;
 	return true;
       }
@@ -1324,11 +1339,15 @@
 {
   struct bfd_elf_section_data *sdata;
 
-  sdata = (struct bfd_elf_section_data *) bfd_alloc (abfd, sizeof (*sdata));
+  sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd, sizeof (*sdata));
   if (!sdata)
     return false;
   sec->used_by_bfd = (PTR) sdata;
-  memset (sdata, 0, sizeof (*sdata));
+
+  /* Indicate whether or not this section should use RELA relocations.  */
+  sdata->use_rela_p 
+    = get_elf_backend_data (abfd)->default_use_rela_p;
+
   return true;
 }
 
@@ -1423,6 +1442,43 @@
   return true;
 }
 
+/* Initialize REL_HDR, the section-header for new section, containing
+   relocations against ASECT.  If USE_RELA_P is true, we use RELA
+   relocations; otherwise, we use REL relocations.  */
+
+boolean
+_bfd_elf_init_reloc_shdr (abfd, rel_hdr, asect, use_rela_p)
+     bfd *abfd;
+     Elf_Internal_Shdr *rel_hdr;
+     asection *asect;
+     boolean use_rela_p;
+{
+  char *name;
+  struct elf_backend_data *bed;
+
+  bed = get_elf_backend_data (abfd);
+  name = bfd_alloc (abfd, sizeof ".rela" + strlen (asect->name));
+  if (name == NULL)
+    return false;
+  sprintf (name, "%s%s", use_rela_p ? ".rela" : ".rel", asect->name);
+  rel_hdr->sh_name =
+    (unsigned int) _bfd_stringtab_add (elf_shstrtab (abfd), name,
+				       true, false);
+  if (rel_hdr->sh_name == (unsigned int) -1)
+    return false;
+  rel_hdr->sh_type = use_rela_p ? SHT_RELA : SHT_REL;
+  rel_hdr->sh_entsize = (use_rela_p
+			 ? bed->s->sizeof_rela
+			 : bed->s->sizeof_rel);
+  rel_hdr->sh_addralign = bed->s->file_align;
+  rel_hdr->sh_flags = 0;
+  rel_hdr->sh_addr = 0;
+  rel_hdr->sh_size = 0;
+  rel_hdr->sh_offset = 0;
+
+  return true;
+}
+
 /* Set up an ELF internal section header for a section.  */
 
 /*ARGSUSED*/
@@ -1478,7 +1534,7 @@
   else if (strcmp (asect->name, ".hash") == 0)
     {
       this_hdr->sh_type = SHT_HASH;
-      this_hdr->sh_entsize = bed->s->arch_size / 8;
+      this_hdr->sh_entsize = bed->s->sizeof_hash_entry;
     }
   else if (strcmp (asect->name, ".dynsym") == 0)
     {
@@ -1491,13 +1547,13 @@
       this_hdr->sh_entsize = bed->s->sizeof_dyn;
     }
   else if (strncmp (asect->name, ".rela", 5) == 0
-	   && get_elf_backend_data (abfd)->use_rela_p)
+	   && get_elf_backend_data (abfd)->may_use_rela_p)
     {
       this_hdr->sh_type = SHT_RELA;
       this_hdr->sh_entsize = bed->s->sizeof_rela;
     }
   else if (strncmp (asect->name, ".rel", 4) == 0
-	   && ! get_elf_backend_data (abfd)->use_rela_p)
+	   && get_elf_backend_data (abfd)->may_use_rel_p)
     {
       this_hdr->sh_type = SHT_REL;
       this_hdr->sh_entsize = bed->s->sizeof_rel;
@@ -1558,47 +1614,19 @@
     this_hdr->sh_flags |= SHF_EXECINSTR;
 
   /* Check for processor-specific section types.  */
-  {
-    struct elf_backend_data *bed = get_elf_backend_data (abfd);
-
-    if (bed->elf_backend_fake_sections)
-      (*bed->elf_backend_fake_sections) (abfd, this_hdr, asect);
-  }
+  if (bed->elf_backend_fake_sections)
+    (*bed->elf_backend_fake_sections) (abfd, this_hdr, asect);
 
   /* If the section has relocs, set up a section header for the
-     SHT_REL[A] section.  */
-  if ((asect->flags & SEC_RELOC) != 0)
-    {
-      Elf_Internal_Shdr *rela_hdr;
-      int use_rela_p = get_elf_backend_data (abfd)->use_rela_p;
-      char *name;
-
-      rela_hdr = &elf_section_data (asect)->rel_hdr;
-      name = bfd_alloc (abfd, sizeof ".rela" + strlen (asect->name));
-      if (name == NULL)
-	{
-	  *failedptr = true;
-	  return;
-	}
-      sprintf (name, "%s%s", use_rela_p ? ".rela" : ".rel", asect->name);
-      rela_hdr->sh_name =
-	(unsigned int) _bfd_stringtab_add (elf_shstrtab (abfd), name,
-					   true, false);
-      if (rela_hdr->sh_name == (unsigned int) -1)
-	{
-	  *failedptr = true;
-	  return;
-	}
-      rela_hdr->sh_type = use_rela_p ? SHT_RELA : SHT_REL;
-      rela_hdr->sh_entsize = (use_rela_p
-			      ? bed->s->sizeof_rela
-			      : bed->s->sizeof_rel);
-      rela_hdr->sh_addralign = bed->s->file_align;
-      rela_hdr->sh_flags = 0;
-      rela_hdr->sh_addr = 0;
-      rela_hdr->sh_size = 0;
-      rela_hdr->sh_offset = 0;
-    }
+     SHT_REL[A] section.  If two relocation sections are required for
+     this section, it is up to the processor-specific back-end to
+     create the other.  */ 
+  if ((asect->flags & SEC_RELOC) != 0
+      && !_bfd_elf_init_reloc_shdr (abfd, 
+				    &elf_section_data (asect)->rel_hdr,
+				    asect, 
+				    elf_section_data (asect)->use_rela_p))
+    *failedptr = true;
 }
 
 /* Assign all ELF section numbers.  The dummy first section is handled here
@@ -1626,6 +1654,11 @@
 	d->rel_idx = 0;
       else
 	d->rel_idx = section_number++;
+
+      if (d->rel_hdr2)
+	d->rel_idx2 = section_number++;
+      else
+	d->rel_idx2 = 0;
     }
 
   t->shstrtab_section = section_number++;
@@ -1674,6 +1707,8 @@
       i_shdrp[d->this_idx] = &d->this_hdr;
       if (d->rel_idx != 0)
 	i_shdrp[d->rel_idx] = &d->rel_hdr;
+      if (d->rel_idx2 != 0)
+	i_shdrp[d->rel_idx2] = d->rel_hdr2;
 
       /* Fill in the sh_link and sh_info fields while we're at it.  */
 
@@ -1685,6 +1720,11 @@
 	  d->rel_hdr.sh_link = t->symtab_section;
 	  d->rel_hdr.sh_info = d->this_idx;
 	}
+      if (d->rel_idx2 != 0)
+	{
+	  d->rel_hdr2->sh_link = t->symtab_section;
+	  d->rel_hdr2->sh_info = d->this_idx;
+	}
 
       switch (d->this_hdr.sh_type)
 	{
@@ -2011,6 +2051,10 @@
   if (! prep_headers (abfd))
     return false;
 
+  /* Post process the headers if necessary.  */
+  if (bed->elf_backend_post_process_headers)
+    (*bed->elf_backend_post_process_headers) (abfd, link_info);
+
   failed = false;
   bfd_map_over_sections (abfd, elf_fake_sections, &failed);
   if (failed)
@@ -2514,11 +2558,7 @@
 	       elf_sort_sections);
 
       p->p_type = m->p_type;
-
-      if (m->p_flags_valid)
-	p->p_flags = m->p_flags;
-      else
-	p->p_flags = 0;
+      p->p_flags = m->p_flags;
 
       if (p->p_type == PT_LOAD
 	  && m->count > 0
@@ -3042,6 +3082,9 @@
     bfd_big_endian (abfd) ? ELFDATA2MSB : ELFDATA2LSB;
   i_ehdrp->e_ident[EI_VERSION] = bed->s->ev_current;
 
+  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_SYSV;
+  i_ehdrp->e_ident[EI_ABIVERSION] = 0;
+
   for (count = EI_PAD; count < EI_NIDENT; count++)
     i_ehdrp->e_ident[count] = 0;
 
@@ -3077,6 +3120,9 @@
     case bfd_arch_i860:
       i_ehdrp->e_machine = EM_860;
       break;
+    case bfd_arch_i960:
+      i_ehdrp->e_machine = EM_960;
+      break;
     case bfd_arch_mips:	/* MIPS Rxxxx */
       i_ehdrp->e_machine = EM_MIPS;	/* only MIPS R3000 */
       break;
@@ -3827,6 +3873,9 @@
       || ihdr->sh_type == SHT_GNU_verdef)
     ohdr->sh_info = ihdr->sh_info;
 
+  elf_section_data (osec)->use_rela_p
+    = elf_section_data (isec)->use_rela_p;
+
   return true;
 }
 
@@ -4140,7 +4189,7 @@
 
 long
 _bfd_elf_get_reloc_upper_bound (abfd, asect)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      sec_ptr asect;
 {
   return (asect->reloc_count + 1) * sizeof (arelent *);
@@ -4471,7 +4520,7 @@
 
 void
 _bfd_elf_get_symbol_info (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -4484,7 +4533,7 @@
 
 boolean
 _bfd_elf_is_local_label_name (abfd, name)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      const char *name;
 {
   /* Normal local symbols start with ``.L''.  */
@@ -4510,8 +4559,8 @@
 
 alent *
 _bfd_elf_get_lineno (ignore_abfd, symbol)
-     bfd *ignore_abfd;
-     asymbol *symbol;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
 {
   abort ();
   return NULL;
@@ -4565,7 +4614,7 @@
 
   if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
 				     filename_ptr, functionname_ptr,
-				     line_ptr))
+				     line_ptr, 0))
     return true;
 
   if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset,
@@ -4661,9 +4710,9 @@
 
 void
 _bfd_elf_no_info_to_howto (abfd, cache_ptr, dst)
-     bfd *abfd;
-     arelent *cache_ptr;
-     Elf_Internal_Rela *dst;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *cache_ptr ATTRIBUTE_UNUSED;
+     Elf_Internal_Rela *dst ATTRIBUTE_UNUSED;
 {
   abort ();
 }
@@ -4797,13 +4846,13 @@
 
 bfd_reloc_status_type
 _bfd_elf_rel_vtable_reloc_fn (abfd, re, symbol, data, is, obfd, errmsg)
-     bfd *abfd;
-     arelent *re;
-     struct symbol_cache_entry *symbol;
-     PTR data;
-     asection *is;
-     bfd *obfd;
-     char **errmsg;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *re ATTRIBUTE_UNUSED;
+     struct symbol_cache_entry *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *is ATTRIBUTE_UNUSED;
+     bfd *obfd ATTRIBUTE_UNUSED;
+     char **errmsg ATTRIBUTE_UNUSED;
 {
   return bfd_reloc_ok;
 }
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index a490a24..318dc70 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1,5 +1,5 @@
 /* ARC-specific support for 32-bit ELF
-   Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
    Contributed by Doug Evans (dje@cygnus.com).
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -118,7 +118,7 @@
 
 static reloc_howto_type *
 bfd_elf32_bfd_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -138,7 +138,7 @@
 
 static void
 arc_info_to_howto_rel (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf32_Internal_Rel *dst;
 {
@@ -178,7 +178,7 @@
 static void
 arc_elf_final_write_processing (abfd, linker)
      bfd *abfd;
-     boolean linker;
+     boolean linker ATTRIBUTE_UNUSED;
 {
   int mach;
   unsigned long val;
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index d4e97d6..3534b43 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -29,12 +29,14 @@
   PARAMS ((bfd *, bfd *));
 static boolean elf32_arm_print_private_bfd_data
   PARAMS ((bfd *, PTR));
-static int elf32_arm_get_symbol_type 
+static int elf32_arm_get_symbol_type
   PARAMS (( Elf_Internal_Sym *, int));
 static struct bfd_link_hash_table *elf32_arm_link_hash_table_create
   PARAMS ((bfd *));
 static bfd_reloc_status_type elf32_arm_final_link_relocate
-  PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma, struct bfd_link_info *, asection *, const char *, unsigned char));
+  PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *,
+	   Elf_Internal_Rela *, bfd_vma, struct bfd_link_info *, asection *,
+	   const char *, unsigned char, struct elf_link_hash_entry *));
 
 static insn32 insert_thumb_branch
   PARAMS ((insn32, int));
@@ -46,6 +48,8 @@
   PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
 static void record_thumb_to_arm_glue
   PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+static void elf32_arm_post_process_headers
+  PARAMS ((bfd *, struct bfd_link_info *));
 
 /* The linker script knows the section names for placement.
    The entry_names are used to do simple name mangling on the stubs.
@@ -113,7 +117,7 @@
   bfd_size_type count;
 };
 
-/* arm ELF linker hash entry.  */
+/* Arm ELF linker hash entry.  */
 
 struct elf32_arm_link_hash_entry
 {
@@ -154,9 +158,43 @@
 
     /* An arbitary input BFD chosen to hold the glue sections.  */
     bfd * bfd_of_glue_owner;
+
+    /* A boolean indicating whether knowledge of the ARM's pipeline
+       length should be applied by the linker.  */
+    int no_pipeline_knowledge;
   };
 
 
+/* Create an entry in an ARM ELF linker hash table.  */
+
+static struct bfd_hash_entry *
+elf32_arm_link_hash_newfunc (entry, table, string)
+     struct bfd_hash_entry * entry;
+     struct bfd_hash_table * table;
+     const char * string;
+{
+  struct elf32_arm_link_hash_entry * ret =
+    (struct elf32_arm_link_hash_entry *) entry;
+
+  /* Allocate the structure if it has not already been allocated by a
+     subclass.  */
+  if (ret == (struct elf32_arm_link_hash_entry *) NULL)
+    ret = ((struct elf32_arm_link_hash_entry *)
+	   bfd_hash_allocate (table,
+			      sizeof (struct elf32_arm_link_hash_entry)));
+  if (ret == (struct elf32_arm_link_hash_entry *) NULL)
+    return (struct bfd_hash_entry *) ret;
+
+  /* Call the allocation method of the superclass.  */
+  ret = ((struct elf32_arm_link_hash_entry *)
+	 _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+				     table, string));
+  if (ret != (struct elf32_arm_link_hash_entry *) NULL)
+    ret->pcrel_relocs_copied = NULL;
+
+  return (struct bfd_hash_entry *) ret;
+}
+
 /* Create an ARM elf linker hash table */
 
 static struct bfd_link_hash_table *
@@ -171,7 +209,7 @@
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
-				      _bfd_elf_link_hash_newfunc))
+				      elf32_arm_link_hash_newfunc))
     {
       bfd_release (abfd, ret);
       return NULL;
@@ -180,6 +218,7 @@
   ret->thumb_glue_size = 0;
   ret->arm_glue_size = 0;
   ret->bfd_of_glue_owner = NULL;
+  ret->no_pipeline_knowledge = 0;
 
   return &ret->root.root;
 }
@@ -282,7 +321,7 @@
    ldmia r13! {r6, lr}
    bx    lr
    __func_addr:
-   .word        func 
+   .word        func
  */
 
 #define THUMB2ARM_GLUE_SIZE 8
@@ -531,9 +570,10 @@
 }
 
 boolean
-bfd_elf32_arm_process_before_allocation (abfd, link_info)
+bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge)
      bfd *abfd;
      struct bfd_link_info *link_info;
+     int no_pipeline_knowledge;
 {
   Elf_Internal_Shdr *symtab_hdr;
   Elf_Internal_Rela *free_relocs = NULL;
@@ -559,6 +599,8 @@
   BFD_ASSERT (globals != NULL);
   BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
 
+  globals->no_pipeline_knowledge = no_pipeline_knowledge;
+
   /* Rummage around all the relocs and map the glue vectors.  */
   sec = abfd->sections;
 
@@ -583,7 +625,6 @@
 	{
 	  long r_type;
 	  unsigned long r_index;
-	  unsigned char code;
 
 	  struct elf_link_hash_entry *h;
 
@@ -591,7 +632,7 @@
 	  r_index = ELF32_R_SYM (irel->r_info);
 
 	  /* These are the only relocation types we care about */
-	  if (r_type != R_ARM_PC24
+	  if (   r_type != R_ARM_PC24
 	      && r_type != R_ARM_THM_PC22)
 	    continue;
 
@@ -666,9 +707,9 @@
 	      break;
 
 	    case R_ARM_THM_PC22:
-	      /* This one is a call from thumb code.  We look 
+	      /* This one is a call from thumb code.  We look
 	         up the target of the call. If it is not a thumb
-                 target, we insert glue. */ 
+                 target, we insert glue. */
 
 	      if (ELF_ST_TYPE (h->type) != STT_ARM_TFUNC)
 		record_thumb_to_arm_glue (link_info, h);
@@ -694,16 +735,16 @@
 
 /* The thumb form of a long branch is a bit finicky, because the offset
    encoding is split over two fields, each in it's own instruction. They
-   can occur in any order. So given a thumb form of long branch, and an 
+   can occur in any order. So given a thumb form of long branch, and an
    offset, insert the offset into the thumb branch and return finished
-   instruction. 
+   instruction.
 
-   It takes two thumb instructions to encode the target address. Each has 
+   It takes two thumb instructions to encode the target address. Each has
    11 bits to invest. The upper 11 bits are stored in one (identifed by
-   H-0.. see below), the lower 11 bits are stored in the other (identified 
-   by H-1). 
+   H-0.. see below), the lower 11 bits are stored in the other (identified
+   by H-1).
 
-   Combine together and shifted left by 1 (it's a half word address) and 
+   Combine together and shifted left by 1 (it's a half word address) and
    there you have it.
 
    Op: 1111 = F,
@@ -711,7 +752,7 @@
    Op: 1111 = F,
    H-1, lower address-0 = 800
 
-   They can be ordered either way, but the arm tools I've seen always put 
+   They can be ordered either way, but the arm tools I've seen always put
    the lower one first. It probably doesn't matter. krk@cygnus.com
 
    XXX:  Actually the order does matter.  The second instruction (H-1)
@@ -943,7 +984,7 @@
 static bfd_reloc_status_type
 elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
 			       input_section, contents, rel, value,
-			       info, sym_sec, sym_name, sym_flags)
+			       info, sym_sec, sym_name, sym_flags, h)
      reloc_howto_type *     howto;
      bfd *                  input_bfd;
      bfd *                  output_bfd;
@@ -955,6 +996,7 @@
      asection *             sym_sec;
      const char *           sym_name;
      unsigned char          sym_flags;
+     struct elf_link_hash_entry * h;
 {
   unsigned long                 r_type = howto->type;
   unsigned long                 r_symndx;
@@ -966,9 +1008,12 @@
   asection *                    sgot = NULL;
   asection *                    splt = NULL;
   asection *                    sreloc = NULL;
-  struct elf_link_hash_entry *  h = NULL;
   bfd_vma                       addend;
-    
+  bfd_signed_vma                signed_addend;
+  struct elf32_arm_link_hash_table * globals;
+
+  globals = elf32_arm_hash_table (info);
+
   dynobj = elf_hash_table (info)->dynobj;
   if (dynobj)
     {
@@ -981,11 +1026,20 @@
   r_symndx = ELF32_R_SYM (rel->r_info);
 
 #ifdef USE_REL
-  addend = (bfd_get_32 (input_bfd, hit_data) & howto->src_mask);
+  addend = bfd_get_32 (input_bfd, hit_data) & howto->src_mask;
+
+  if (addend & ((howto->src_mask + 1) >> 1))
+    {
+      signed_addend = -1;
+      signed_addend &= ~ howto->src_mask;
+      signed_addend |= addend;
+    }
+  else
+    signed_addend = addend;
 #else
-  addend = rel->r_addend;
+  addend = signed_addend = rel->r_addend;
 #endif
-  
+
   switch (r_type)
     {
     case R_ARM_NONE:
@@ -996,7 +1050,7 @@
     case R_ARM_REL32:
       /* When generating a shared object, these relocations are copied
 	 into the output file to be resolved at run time. */
-      
+
       if (info->shared
 	  && (r_type != R_ARM_PC24
  	      || (h != NULL
@@ -1007,35 +1061,35 @@
 	{
 	  Elf_Internal_Rel outrel;
 	  boolean skip, relocate;
-	  
+
 	  if (sreloc == NULL)
 	    {
 	      const char * name;
-	      
+
 	      name = (bfd_elf_string_from_elf_section
 		      (input_bfd,
 		       elf_elfheader (input_bfd)->e_shstrndx,
 		       elf_section_data (input_section)->rel_hdr.sh_name));
 	      if (name == NULL)
 		return bfd_reloc_notsupported;
-	      
+
 	      BFD_ASSERT (strncmp (name, ".rel", 4) == 0
 			  && strcmp (bfd_get_section_name (input_bfd,
 							   input_section),
 				     name + 4) == 0);
-	      
+
 	      sreloc = bfd_get_section_by_name (dynobj, name);
 	      BFD_ASSERT (sreloc != NULL);
 	    }
-	  
+
 	  skip = false;
-	  
+
 	  if (elf_section_data (input_section)->stab_info == NULL)
 	    outrel.r_offset = rel->r_offset;
 	  else
 	    {
 	      bfd_vma off;
-	      
+
 	      off = (_bfd_stab_section_offset
 		     (output_bfd, &elf_hash_table (info)->stab_info,
 		      input_section,
@@ -1045,10 +1099,10 @@
 		skip = true;
 	      outrel.r_offset = off;
 	    }
-	  
+
 	  outrel.r_offset += (input_section->output_section->vma
 			      + input_section->output_offset);
-	  
+
 	  if (skip)
 	    {
 	      memset (&outrel, 0, sizeof outrel);
@@ -1083,20 +1137,21 @@
 		  outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_ABS32);
 		}
 	    }
-	  
+
 	  bfd_elf32_swap_reloc_out (output_bfd, &outrel,
 				    (((Elf32_External_Rel *)
 				      sreloc->contents)
 				     + sreloc->reloc_count));
 	  ++sreloc->reloc_count;
 	  
-	  /* If this reloc is against an external symbol, we do not want to 
+	  /* If this reloc is against an external symbol, we do not want to
 	     fiddle with the addend.  Otherwise, we need to include the symbol
 	     value so that it becomes an addend for the dynamic reloc. */
 	  if (! relocate)
 	    return bfd_reloc_ok;
+
 	  
-	  return _bfd_final_link_relocate (howto, input_bfd, input_section, 
+	  return _bfd_final_link_relocate (howto, input_bfd, input_section,
 					   contents, rel->r_offset, value,
 					   (bfd_vma) 0);
 	}
@@ -1104,7 +1159,7 @@
 	{
 	case R_ARM_PC24:
 	  /* Arm B/BL instruction */
-	  
+
 	  /* Check for arm calling thumb function.  */
 	  if (sym_flags == STT_ARM_TFUNC)
 	    {
@@ -1112,30 +1167,81 @@
 				       input_section, hit_data, sym_sec, rel->r_offset, addend, value);
 	      return bfd_reloc_ok;
 	    }
+
+	  if (   strcmp (bfd_get_target (input_bfd), "elf32-littlearm-oabi") == 0
+	      || strcmp (bfd_get_target (input_bfd), "elf32-bigarm-oabi") == 0)
+	    {
+	      /* The old way of doing things.  Trearing the addend as a
+		 byte sized field and adding in the pipeline offset.  */
+
+	      value -= (input_section->output_section->vma
+			+ input_section->output_offset);
+	      value -= rel->r_offset;
+	      value += addend;
+
+	      if (! globals->no_pipeline_knowledge)
+		value -= 8;
+	    }
+	  else
+	    {
+	      /* The ARM ELF ABI says that this reloc is computed as: S - P + A
+		 where:
+		  S is the address of the symbol in the relocation.
+		  P is address of the instruction being relocated.
+		  A is the addend (extracted from the instruction) in bytes.
+
+		 S is held in 'value'.
+		 P is the base address of the section containing the instruction
+		   plus the offset of the reloc into that section, ie:
+		     (input_section->output_section->vma +
+		      input_section->output_offset +
+		      rel->r_offset).
+		 A is the addend, converted into bytes, ie:
+		     (signed_addend * 4)
+
+		 Note: None of these operations have knowledge of the pipeline
+		 size of the processor, thus it is up to the assembler to encode
+		 this information into the addend.  */
+
+	      value -= (input_section->output_section->vma
+			+ input_section->output_offset);
+	      value -= rel->r_offset;
+	      value += (signed_addend << howto->size);
+
+	      /* Previous versions of this code also used to add in the pipeline
+		 offset here.  This is wrong because the linker is not supposed
+		 to know about such things, and one day it might change.  In order
+		 to support old binaries that need the old behaviour however, so
+		 we attempt to detect which ABI was used to create the reloc.  */
+	      if (! globals->no_pipeline_knowledge)
+		{
+		  Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */
+
+		  i_ehdrp = elf_elfheader (input_bfd);
+
+		  if (i_ehdrp->e_ident[EI_OSABI] == 0)
+		    value -= 8;
+		}
+	    }
 	  
-	  value = value + addend;
-	  value -= (input_section->output_section->vma
-		    + input_section->output_offset + 8);
-	  value -= rel->r_offset;
-	  value = value >> howto->rightshift;
-	  
-	  value &= 0xffffff;
-	  value |= (bfd_get_32 (input_bfd, hit_data) & 0xff000000);
+	  value >>= howto->rightshift;
+	  value &= howto->dst_mask;
+	  value |= (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask));
 	  break;
-	  
+
 	case R_ARM_ABS32:
 	  value += addend;
 	  if (sym_flags == STT_ARM_TFUNC)
 	    value |= 1;
 	  break;
-	  
+
 	case R_ARM_REL32:
 	  value -= (input_section->output_section->vma
 		    + input_section->output_offset);
 	  value += addend;
 	  break;
 	}
-      
+
       bfd_put_32 (input_bfd, value, hit_data);
       return bfd_reloc_ok;
 
@@ -1190,26 +1296,24 @@
     case R_ARM_THM_PC22:
       /* Thumb BL (branch long instruction). */
       {
-	bfd_vma relocation;
-	boolean overflow = false;
-	bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data);
-	bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2);
-	bfd_vma src_mask = 0x007FFFFE;
+	bfd_vma        relocation;
+	boolean        overflow = false;
+	bfd_vma        upper_insn = bfd_get_16 (input_bfd, hit_data);
+	bfd_vma        lower_insn = bfd_get_16 (input_bfd, hit_data + 2);
 	bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
-	bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
-	bfd_vma check;
+	bfd_signed_vma reloc_signed_min = ~ reloc_signed_max;
+	bfd_vma        check;
 	bfd_signed_vma signed_check;
-	bfd_vma add;
-	bfd_signed_vma signed_add;
 
 #ifdef USE_REL
 	/* Need to refetch the addend and squish the two 11 bit pieces
 	   together.  */
 	{
-	  bfd_vma upper = bfd_get_16 (input_bfd, hit_data) & 0x7ff;
-	  bfd_vma lower = bfd_get_16 (input_bfd, hit_data + 2) & 0x7ff;
+	  bfd_vma upper = upper_insn & 0x7ff;
+	  bfd_vma lower = lower_insn & 0x7ff;
 	  upper = (upper ^ 0x400) - 0x400; /* sign extend */
 	  addend = (upper << 12) | (lower << 1);
+	  signed_addend = addend;
 	}
 #endif
 
@@ -1224,11 +1328,28 @@
 	      return bfd_reloc_dangerous;
 	  }
 
-	/* +4: pc is offset by 4 */
-	relocation = value + addend + 4;
+	relocation = value + signed_addend;
+
 	relocation -= (input_section->output_section->vma
-		       + input_section->output_offset);
-	relocation -= rel->r_offset;
+		       + input_section->output_offset
+		       + rel->r_offset);
+	
+	if (! globals->no_pipeline_knowledge)
+	  {
+	    Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */
+	    
+	    i_ehdrp = elf_elfheader (input_bfd);
+
+	    /* Previous versions of this code also used to add in the pipline
+	       offset here.  This is wrong because the linker is not supposed
+	       to know about such things, and one day it might change.  In order
+	       to support old binaries that need the old behaviour however, so
+	       we attempt to detect which ABI was used to create the reloc.  */
+	    if (   strcmp (bfd_get_target (input_bfd), "elf32-littlearm-oabi") == 0
+		|| strcmp (bfd_get_target (input_bfd), "elf32-bigarm-oabi") == 0
+		|| i_ehdrp->e_ident[EI_OSABI] == 0)
+	      relocation += 4;
+	  }
 
 	check = relocation >> howto->rightshift;
 
@@ -1239,17 +1360,8 @@
 	else
 	  signed_check = check | ~((bfd_vma) -1 >> howto->rightshift);
 
-	add = ((upper_insn & 0x7ff) << 12) | ((lower_insn & 0x7ff) << 1);
-	/* sign extend */
-	signed_add = (add ^ 0x400000) - 0x400000;
-
-	/* Add the value from the object file.  */
-	signed_check += signed_add;
-	relocation += signed_add;
-
 	/* Assumes two's complement.  */
-	if (signed_check > reloc_signed_max
-	    || signed_check < reloc_signed_min)
+	if (signed_check > reloc_signed_max || signed_check < reloc_signed_min)
 	  overflow = true;
 
 	/* Put RELOCATION back into the insn.  */
@@ -1287,15 +1399,15 @@
       BFD_ASSERT (sgot != NULL);
       if (sgot == NULL)
         return bfd_reloc_notsupported;
-        
+      
       /* Note that sgot->output_offset is not involved in this
          calculation.  We always want the start of .got.  If we
          define _GLOBAL_OFFSET_TABLE in a different way, as is
          permitted by the ABI, we might have to change this
          calculation. */
-      
+
       value -= sgot->output_section->vma;
-      return _bfd_final_link_relocate (howto, input_bfd, input_section, 
+      return _bfd_final_link_relocate (howto, input_bfd, input_section,
       				       contents, rel->r_offset, value,
       				       (bfd_vma) 0);
 
@@ -1303,28 +1415,28 @@
       /* Use global offset table as symbol value. */
 
       BFD_ASSERT (sgot != NULL);
-      
+
       if (sgot == NULL)
         return bfd_reloc_notsupported;
 
       value = sgot->output_section->vma;
-      return _bfd_final_link_relocate (howto, input_bfd, input_section, 
+      return _bfd_final_link_relocate (howto, input_bfd, input_section,
       				       contents, rel->r_offset, value,
       				       (bfd_vma) 0);
-      
+
     case R_ARM_GOT32:
       /* Relocation is to the entry for this symbol in the
          global offset table. */
       if (sgot == NULL)
 	return bfd_reloc_notsupported;
-      
+
       if (h != NULL)
 	{
 	  bfd_vma off;
-	  
+
 	  off = h->got.offset;
 	  BFD_ASSERT (off != (bfd_vma) -1);
-	  
+
 	  if (!elf_hash_table (info)->dynamic_sections_created ||
 	      (info->shared && (info->symbolic || h->dynindx == -1)
 	       && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
@@ -1334,11 +1446,11 @@
 		 entry in the global offset table.  Since the offset must
 		 always be a multiple of 4, we use the least significant bit
 		 to record whether we have initialized it already.
-		 
+
 		 When doing a dynamic link, we create a .rel.got relocation
-		 entry to initialize the value.  This is done in the 
+		 entry to initialize the value.  This is done in the
 		 finish_dynamic_symbol routine. */
-	      
+
 	      if ((off & 1) != 0)
 		off &= ~1;
 	      else
@@ -1347,18 +1459,18 @@
 		  h->got.offset |= 1;
 		}
 	    }
-	  
+
 	  value = sgot->output_offset + off;
 	}
       else
 	{
 	  bfd_vma off;
-	  
+
 	  BFD_ASSERT (local_got_offsets != NULL &&
 		      local_got_offsets[r_symndx] != (bfd_vma) -1);
-	  
+
 	  off = local_got_offsets[r_symndx];
-	  
+
 	  /* The offset must always be a multiple of 4.  We use the
 	     least significant bit to record whether we have already
 	     generated the necessary reloc. */
@@ -1367,17 +1479,17 @@
 	  else
 	    {
 	      bfd_put_32 (output_bfd, value, sgot->contents + off);
-	      
+
 	      if (info->shared)
 		{
 		  asection * srelgot;
 		  Elf_Internal_Rel outrel;
-		  
+
 		  srelgot = bfd_get_section_by_name (dynobj, ".rel.got");
 		  BFD_ASSERT (srelgot != NULL);
-		  
+
 		  outrel.r_offset = (sgot->output_section->vma
-				     + sgot->output_offset 
+				     + sgot->output_offset
 				     + off);
 		  outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
 		  bfd_elf32_swap_reloc_out (output_bfd, &outrel,
@@ -1386,17 +1498,17 @@
 					     + srelgot->reloc_count));
 		  ++srelgot->reloc_count;
 		}
-	      
+
 	      local_got_offsets[r_symndx] |= 1;
 	    }
-	  
+
 	  value = sgot->output_offset + off;
 	}
       
-      return _bfd_final_link_relocate (howto, input_bfd, input_section, 
+      return _bfd_final_link_relocate (howto, input_bfd, input_section,
       				       contents, rel->r_offset, value,
       				       (bfd_vma) 0);
-      
+
     case R_ARM_PLT32:
       /* Relocation is to the entry for this symbol in the
          procedure linkage table.  */
@@ -1426,7 +1538,7 @@
       return _bfd_final_link_relocate (howto, input_bfd, input_section,
         			       contents, rel->r_offset, value,
         			       (bfd_vma) 0);
-      
+
     case R_ARM_SBREL32:
       return bfd_reloc_notsupported;
 
@@ -1483,25 +1595,25 @@
   relend = relocs + input_section->reloc_count;
   for (; rel < relend; rel++)
     {
-      int r_type;
-      reloc_howto_type * howto;
-      unsigned long r_symndx;
-      Elf_Internal_Sym * sym;
-      asection * sec;
+      int                          r_type;
+      reloc_howto_type *           howto;
+      unsigned long                r_symndx;
+      Elf_Internal_Sym *           sym;
+      asection *                   sec;
       struct elf_link_hash_entry * h;
-      bfd_vma relocation;
-      bfd_reloc_status_type r;
+      bfd_vma                      relocation;
+      bfd_reloc_status_type        r;
+      arelent                      bfd_reloc;
 
       r_symndx = ELF32_R_SYM (rel->r_info);
-      r_type = ELF32_R_TYPE (rel->r_info);
+      r_type   = ELF32_R_TYPE (rel->r_info);
 
-      if (r_type == R_ARM_GNU_VTENTRY
-          || r_type == R_ARM_GNU_VTINHERIT )
+      if (   r_type == R_ARM_GNU_VTENTRY
+          || r_type == R_ARM_GNU_VTINHERIT)
         continue;
 
-      /* ScottB: range check r_type here. */
-      
-      howto = elf32_arm_howto_table + r_type;
+      elf32_arm_info_to_howto (input_bfd, & bfd_reloc, rel);
+      howto = bfd_reloc.howto;
 
       if (info->relocateable)
 	{
@@ -1518,8 +1630,14 @@
 #ifdef USE_REL
 		  {
 		    bfd_vma val;
-		    val = bfd_get_32 (input_bfd, contents + rel->r_offset);
-		    val += (sec->output_offset + sym->st_value) >> howto->rightshift;
+		    bfd_vma insn;
+
+		    insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
+		    val = insn + ((sec->output_offset + sym->st_value)
+				  >> howto->rightshift);
+		    val &= howto->dst_mask;
+		    val |= insn & ~(howto->dst_mask);
+
 		    bfd_put_32 (input_bfd, val, contents + rel->r_offset);
 		  }
 #else
@@ -1553,14 +1671,12 @@
 	  if (h->root.type == bfd_link_hash_defined
 	      || h->root.type == bfd_link_hash_defweak)
 	    {
+	      int relocation_needed = 1;
+
 	      sec = h->root.u.def.section;
-	      
-              relocation = (h->root.u.def.value
-	  	           + sec->output_section->vma
-		           + sec->output_offset);
-	      
+
 	      /* In these cases, we don't need the relocation value.
-	         We check specially because in some obscure cases 
+	         We check specially because in some obscure cases
 	         sec->output_section will be NULL. */
 	      switch (r_type)
 		{
@@ -1569,17 +1685,17 @@
 	          if (info->shared
 	              && (
 	              	  (!info->symbolic && h->dynindx != -1)
-	                  || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR == 0)
+	                  || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
 			  )
 	              && ((input_section->flags & SEC_ALLOC) != 0)
 		      )
-	            relocation = 0;
+	            relocation_needed = 0;
 		  break;
-		  
+
 	        case R_ARM_GOTPC:
-	          relocation = 0;
+	          relocation_needed = 0;
 		  break;
-		  
+
 	        case R_ARM_GOT32:
 	          if (elf_hash_table(info)->dynamic_sections_created
 	              && (!info->shared
@@ -1587,14 +1703,14 @@
 	                  || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
 			  )
 		      )
-	            relocation = 0;
+	            relocation_needed = 0;
 		  break;
-		  
+
 	        case R_ARM_PLT32:
 	          if (h->plt.offset != (bfd_vma)-1)
-	            relocation = 0;
+	            relocation_needed = 0;
 		  break;
-		  
+
 	        default:
 		  if (sec->output_section == NULL)
 		    {
@@ -1602,12 +1718,21 @@
 			(_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
 			 bfd_get_filename (input_bfd), h->root.root.string,
 			 bfd_get_section_name (input_bfd, input_section));
-		      relocation = 0;
+		      relocation_needed = 0;
 		    }
 		}
+
+	      if (relocation_needed)
+		relocation = h->root.u.def.value
+		  + sec->output_section->vma
+		  + sec->output_offset;
+	      else
+		relocation = 0;
 	    }
 	  else if (h->root.type == bfd_link_hash_undefweak)
 	    relocation = 0;
+	  else if (info->shared && !info->symbolic && !info->no_undefined)
+	    relocation = 0;
 	  else
 	    {
 	      if (!((*info->callbacks->undefined_symbol)
@@ -1627,12 +1752,12 @@
 	  if (name == NULL || *name == '\0')
 	    name = bfd_section_name (input_bfd, sec);
 	}
-      
+
       r = elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
 					 input_section, contents, rel,
 					 relocation, info, sec, name,
 					 (h ? ELF_ST_TYPE (h->type) :
-					  ELF_ST_TYPE (sym->st_info)));
+					  ELF_ST_TYPE (sym->st_info)), h);
 
       if (r != bfd_reloc_ok)
 	{
@@ -1915,11 +2040,11 @@
   else
     return type;
 }
-    
+
 static asection *
 elf32_arm_gc_mark_hook (abfd, info, rel, h, sym)
        bfd *abfd;
-       struct bfd_link_info *info;
+       struct bfd_link_info *info ATTRIBUTE_UNUSED;
        Elf_Internal_Rela *rel;
        struct elf_link_hash_entry *h;
        Elf_Internal_Sym *sym;
@@ -1941,6 +2066,9 @@
 
           case bfd_link_hash_common:
             return h->root.u.c.p->section;
+
+	  default:
+	    break;
           }
        }
      }
@@ -1957,21 +2085,21 @@
   return NULL;
 }
 
+/* Update the got entry reference counts for the section being removed.  */
+
 static boolean
 elf32_arm_gc_sweep_hook (abfd, info, sec, relocs)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     asection *sec;
-     const Elf_Internal_Rela *relocs;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
 {
-  /* we don't use got and plt entries for armelf */
+  /* We don't support garbage collection of GOT and PLT relocs yet.  */
   return true;
 }
 
-/* Look through the relocs for a section during the first phase.
-   Since we don't do .gots or .plts, we just need to consider the
-   virtual table relocs for gc.  */
- 
+/* Look through the relocs for a section during the first phase.  */
+
 static boolean
 elf32_arm_check_relocs (abfd, info, sec, relocs)
      bfd *                      abfd;
@@ -1987,33 +2115,33 @@
   bfd *                         dynobj;
   asection * sgot, *srelgot, *sreloc;
   bfd_vma * local_got_offsets;
-   
+  
   if (info->relocateable)
     return true;
- 
+  
   sgot = srelgot = sreloc = NULL;
-				   
+  
   dynobj = elf_hash_table (info)->dynobj;
   local_got_offsets = elf_local_got_offsets (abfd);
-  
+
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
   sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym);
   if (!elf_bad_symtab (abfd))
     sym_hashes_end -= symtab_hdr->sh_info;
- 
+  
   rel_end = relocs + sec->reloc_count;
   for (rel = relocs; rel < rel_end; rel++)
     {
       struct elf_link_hash_entry *h;
       unsigned long r_symndx;
- 
+      
       r_symndx = ELF32_R_SYM (rel->r_info);
       if (r_symndx < symtab_hdr->sh_info)
         h = NULL;
       else
         h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- 
+      
       /* Some relocs require a global offset table.  */
       if (dynobj == NULL)
 	{
@@ -2047,7 +2175,7 @@
 	        && (h != NULL || info->shared))
 	      {
 	        srelgot = bfd_get_section_by_name (dynobj, ".rel.got");
-	      
+		
 	        /* If no got relocation section, make one and initialize.  */
 	        if (srelgot == NULL)
 		  {
@@ -2070,7 +2198,7 @@
 	        if (h->got.offset != (bfd_vma) -1)
 		  /* We have already allocated space in the .got.  */
 		  break;
-		
+
 	        h->got.offset = sgot->_raw_size;
 
 	        /* Make sure this symbol is output as a dynamic symbol.  */
@@ -2097,7 +2225,7 @@
 		    for (i = 0; i < symtab_hdr->sh_info; i++)
 		      local_got_offsets[i] = (bfd_vma) -1;
 		  }
-		
+
 	        if (local_got_offsets[r_symndx] != (bfd_vma) -1)
 		  /* We have already allocated space in the .got.  */
 		  break;
@@ -2212,7 +2340,7 @@
 		      {
 		        p = ((struct elf32_arm_pcrel_relocs_copied *)
 			     bfd_alloc (dynobj, sizeof * p));
-			
+
 		        if (p == NULL)
 			  return false;
 		        p->next = eh->pcrel_relocs_copied;
@@ -2232,7 +2360,7 @@
           if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
             return false;
           break;
- 
+	  
         /* This relocation describes which C++ vtable entries are actually
            used.  Record for later use during GC.  */
         case R_ARM_GNU_VTENTRY:
@@ -2241,11 +2369,11 @@
           break;
         }
     }
- 
+
   return true;
 }
 
-       
+
 /* Find the nearest line to a particular section and offset, for error
    reporting.   This code is a duplicate of the code in elf.c, except
    that it also accepts STT_ARM_TFUNC as a symbol that names a function. */
@@ -2268,8 +2396,8 @@
   asymbol **   p;
 
   if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
-				     filename_ptr, functionname_ptr, 
-				     line_ptr))
+				     filename_ptr, functionname_ptr,
+				     line_ptr, 0))
     return true;
 
   if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset,
@@ -2277,7 +2405,7 @@
 					     functionname_ptr, line_ptr,
 					     &elf_tdata (abfd)->line_info))
     return false;
-  
+
   if (found)
     return true;
 
@@ -2324,7 +2452,7 @@
   *filename_ptr = filename;
   *functionname_ptr = bfd_asymbol_name (func);
   *line_ptr = 0;
-  
+
   return true;
 }
 
@@ -2702,7 +2830,7 @@
 static boolean
 elf32_arm_discard_copies (h, ignore)
      struct elf32_arm_link_hash_entry * h;
-     PTR ignore;
+     PTR ignore ATTRIBUTE_UNUSED;
 {
   struct elf32_arm_pcrel_relocs_copied * s;
 
@@ -2767,7 +2895,7 @@
       bfd_put_32 (output_bfd,
 		      (sgot->output_section->vma
 		       + sgot->output_offset
-		       + got_offset 
+		       + got_offset
 		       - splt->output_section->vma
 		       - splt->output_offset
 		       - h->plt.offset - 12),
@@ -2804,7 +2932,7 @@
 
       /* This symbol has an entry in the global offset table.  Set it
 	 up.  */
-      
+
       sgot = bfd_get_section_by_name (dynobj, ".got");
       srel = bfd_get_section_by_name (dynobj, ".rel.got");
       BFD_ASSERT (sgot != NULL && srel != NULL);
@@ -2978,9 +3106,23 @@
   return true;
 }
 
+static void
+elf32_arm_post_process_headers (abfd, link_info)
+     bfd * abfd;
+     struct bfd_link_info * link_info ATTRIBUTE_UNUSED;
+{
+  Elf_Internal_Ehdr * i_ehdrp;	/* Elf file header, internal form */
+
+  i_ehdrp = elf_elfheader (abfd);
+
+  i_ehdrp->e_ident[EI_OSABI]      = ARM_ELF_OS_ABI_VERSION;
+  i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION;
+}
+
+
 #define ELF_ARCH			bfd_arch_arm
 #define ELF_MACHINE_CODE		EM_ARM
-#define ELF_MAXPAGE_SIZE		0x8000
+#define ELF_MAXPAGESIZE			0x8000
 
 
 #define bfd_elf32_bfd_copy_private_bfd_data 	elf32_arm_copy_private_bfd_data
@@ -3001,10 +3143,14 @@
 #define elf_backend_finish_dynamic_symbol	elf32_arm_finish_dynamic_symbol
 #define elf_backend_finish_dynamic_sections	elf32_arm_finish_dynamic_sections
 #define elf_backend_size_dynamic_sections	elf32_arm_size_dynamic_sections
+#define elf_backend_post_process_headers	elf32_arm_post_process_headers
 
 #define elf_backend_can_gc_sections 1
 #define elf_backend_plt_readonly    1
 #define elf_backend_want_got_plt    1
 #define elf_backend_want_plt_sym    0
 
+#define elf_backend_got_header_size	12
+#define elf_backend_plt_header_size	PLT_ENTRY_SIZE
+
 #include "elf32-target.h"
diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c
index be80bae..29deb7c 100644
--- a/bfd/elf32-d10v.c
+++ b/bfd/elf32-d10v.c
@@ -1,5 +1,5 @@
 /* D10V-specific support for 32-bit ELF
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
    Contributed by Martin Hunt (hunt@cygnus.com).
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -211,7 +211,7 @@
 
 static reloc_howto_type *
 bfd_elf32_bfd_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -231,7 +231,7 @@
 
 static void
 d10v_info_to_howto_rel (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf32_Internal_Rel *dst;
 {
@@ -245,7 +245,7 @@
 static asection *
 elf32_d10v_gc_mark_hook (abfd, info, rel, h, sym)
        bfd *abfd;
-       struct bfd_link_info *info;
+       struct bfd_link_info *info ATTRIBUTE_UNUSED;
        Elf_Internal_Rela *rel;
        struct elf_link_hash_entry *h;
        Elf_Internal_Sym *sym;
@@ -267,6 +267,9 @@
 
           case bfd_link_hash_common:
             return h->root.u.c.p->section;
+
+	  default:
+	    break;
           }
        }
      }
@@ -285,10 +288,10 @@
 
 static boolean
 elf32_d10v_gc_sweep_hook (abfd, info, sec, relocs)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     asection *sec;
-     const Elf_Internal_Rela *relocs;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
 {
   /* we don't use got and plt entries for d10v */
   return true;
@@ -356,7 +359,7 @@
 static boolean
 elf32_d10v_relocate_section (output_bfd, info, input_bfd, input_section,
 			    contents, relocs, local_syms, local_sections)
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
      bfd *input_bfd;
      asection *input_section;
diff --git a/bfd/elf32-d30v.c b/bfd/elf32-d30v.c
index 0b0e9e9..263b5c0 100644
--- a/bfd/elf32-d30v.c
+++ b/bfd/elf32-d30v.c
@@ -1,5 +1,5 @@
 /* D30V-specific support for 32-bit ELF
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
    Contributed by Martin Hunt (hunt@cygnus.com).
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -540,7 +540,7 @@
 
 static reloc_howto_type *
 bfd_elf32_bfd_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -560,7 +560,7 @@
 
 static void
 d30v_info_to_howto_rel (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf32_Internal_Rel *dst;
 {
@@ -575,7 +575,7 @@
 
 static void
 d30v_info_to_howto_rela (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf32_Internal_Rela *dst;
 {
diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c
index 7c8725f..04c7d37 100644
--- a/bfd/elf32-fr30.c
+++ b/bfd/elf32-fr30.c
@@ -1,5 +1,5 @@
 /* FR30-specific support for 32-bit ELF.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -250,7 +250,7 @@
      PTR        data;
      asection * input_section;
      bfd *      output_bfd;
-     char **    error_message;
+     char **    error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma       relocation;
   unsigned long x;
@@ -297,7 +297,7 @@
      PTR        data;
      asection * input_section;
      bfd *      output_bfd;
-     char **    error_message;
+     char **    error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma       relocation;
 
@@ -353,7 +353,7 @@
 
 static reloc_howto_type *
 fr30_reloc_type_lookup (abfd, code)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -370,7 +370,7 @@
 
 static void
 fr30_info_to_howto_rela (abfd, cache_ptr, dst)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      arelent * cache_ptr;
      Elf32_Internal_Rela * dst;
 {
@@ -499,7 +499,7 @@
 static boolean
 fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 			   contents, relocs, local_syms, local_sections)
-     bfd *                   output_bfd;
+     bfd *                   output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *  info;
      bfd *                   input_bfd;
      asection *              input_section;
@@ -681,7 +681,7 @@
 static asection *
 fr30_elf_gc_mark_hook (abfd, info, rel, h, sym)
      bfd *                        abfd;
-     struct bfd_link_info *       info;
+     struct bfd_link_info *       info ATTRIBUTE_UNUSED;
      Elf_Internal_Rela *          rel;
      struct elf_link_hash_entry * h;
      Elf_Internal_Sym *           sym;
@@ -703,6 +703,9 @@
 
 	    case bfd_link_hash_common:
 	      return h->root.u.c.p->section;
+
+	    default:
+	      break;
 	    }
 	}
     }
@@ -724,10 +727,10 @@
 
 static boolean
 fr30_elf_gc_sweep_hook (abfd, info, sec, relocs)
-     bfd *                     abfd;
-     struct bfd_link_info *    info;
-     asection *                sec;
-     const Elf_Internal_Rela * relocs;
+     bfd *                     abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *    info ATTRIBUTE_UNUSED;
+     asection *                sec ATTRIBUTE_UNUSED;
+     const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED;
 {
   return true;
 }
diff --git a/bfd/elf32-gen.c b/bfd/elf32-gen.c
index a4d3cac..47da53b 100644
--- a/bfd/elf32-gen.c
+++ b/bfd/elf32-gen.c
@@ -1,5 +1,5 @@
 /* Generic support for 32-bit ELF
-   Copyright 1993, 1995, 1998 Free Software Foundation, Inc.
+   Copyright 1993, 1995, 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -42,18 +42,18 @@
 
 static void
 elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *bfd_reloc;
-     Elf32_Internal_Rela *elf_reloc;
+     Elf32_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
 {
   bfd_reloc->howto = &dummy;
 }
 
 static void
 elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *bfd_reloc;
-     Elf32_Internal_Rel *elf_reloc;
+     Elf32_Internal_Rel *elf_reloc ATTRIBUTE_UNUSED;
 {
   bfd_reloc->howto = &dummy;
 }
@@ -64,6 +64,7 @@
 #define TARGET_BIG_NAME			"elf32-big"
 #define ELF_ARCH			bfd_arch_unknown
 #define ELF_MACHINE_CODE		EM_NONE
+#define ELF_MAXPAGESIZE			0x1
 #define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
 #define elf_info_to_howto		elf_generic_info_to_howto
 #define elf_info_to_howto_rel		elf_generic_info_to_howto_rel
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 6bd7f67..1813b98 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -1,5 +1,5 @@
 /* BFD back-end for HP PA-RISC ELF files.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    Written by
@@ -26,53 +26,14 @@
 
 #include "bfd.h"
 #include "sysdep.h"
-#include "bfdlink.h"
 #include "libbfd.h"
 #include "elf-bfd.h"
+#include "elf/hppa.h"
+#include "libhppa.h"
+#include "elf32-hppa.h"
+#define ARCH_SIZE		32
+#include "elf-hppa.h"
 
-/* The internal type of a symbol table extension entry.  */
-typedef unsigned long symext_entryS;
-
-/* The external type of a symbol table extension entry.  */
-#define ELF32_PARISC_SX_SIZE (4)
-#define ELF32_PARISC_SX_GET(bfd, addr) bfd_h_get_32 ((bfd), (addr))
-#define ELF32_PARISC_SX_PUT(bfd, val, addr) \
-  bfd_h_put_32 ((bfd), (val), (addr))
-
-/* HPPA symbol table extension entry types */
-enum elf32_hppa_symextn_types
-{
-  PARISC_SXT_NULL,
-  PARISC_SXT_SYMNDX,
-  PARISC_SXT_ARG_RELOC,
-};
-
-/* These macros compose and decompose the value of a symextn entry:
-
-   entry_type = ELF32_PARISC_SX_TYPE(word);
-   entry_value = ELF32_PARISC_SX_VAL(word);
-   word = ELF32_PARISC_SX_WORD(type,val);  */
-
-#define ELF32_PARISC_SX_TYPE(p)		((p) >> 24)
-#define ELF32_PARISC_SX_VAL(p)		((p) & 0xFFFFFF)
-#define ELF32_PARISC_SX_WORD(type,val)	(((type) << 24) + (val & 0xFFFFFF))
-
-/* The following was added facilitate implementation of the .hppa_symextn
-   section.  This section is built after the symbol table is built in the
-   elf_write_object_contents routine (called from bfd_close).  It is built
-   so late because it requires information that is not known until
-   the symbol and string table sections have been allocated, and
-   the symbol table has been built. */
-
-#define SYMEXTN_SECTION_NAME ".PARISC.symext"
-
-struct symext_chain
-  {
-    symext_entryS entry;
-    struct symext_chain *next;
-  };
-
-typedef struct symext_chain symext_chainS;
 
 /* We use three different hash tables to hold information for
    linking PA ELF objects.
@@ -83,11 +44,7 @@
 
    The second is the stub hash table which is derived from the
    base BFD hash table.  The stub hash table holds the information
-   necessary to build the linker stubs during a link.
-
-   The last hash table keeps track of argument location information needed
-   to build hash tables.  Each function with nonzero argument location
-   bits will have an entry in this table.  */
+   necessary to build the linker stubs during a link.  */
 
 /* Hash table for linker stubs.  */
 
@@ -123,23 +80,6 @@
 
 };
 
-/* Hash table for argument location information.  */
-
-struct elf32_hppa_args_hash_entry
-{
-  /* Base hash table entry structure.  */
-  struct bfd_hash_entry root;
-
-  /* The argument location bits for this entry.  */
-  int arg_bits;
-};
-
-struct elf32_hppa_args_hash_table
-{
-  /* The hash table itself.  */
-  struct bfd_hash_table root;
-};
-
 struct elf32_hppa_link_hash_entry
 {
   struct elf_link_hash_entry root;
@@ -153,9 +93,6 @@
   /* The stub hash table.  */
   struct elf32_hppa_stub_hash_table *stub_hash_table;
 
-  /* The argument relocation bits hash table.  */
-  struct elf32_hppa_args_hash_table *args_hash_table;
-
   /* A count of the number of output symbols.  */
   unsigned int output_symbol_count;
 
@@ -164,32 +101,6 @@
   int global_sym_defined;
 };
 
-/* FIXME.  */
-#define ARGUMENTS	0
-#define RETURN_VALUE	1
-
-/* The various argument relocations that may be performed.  */
-typedef enum
-{
-  /* No relocation.  */
-  NO,
-  /* Relocate 32 bits from GR to FP register.  */
-  GF,
-  /* Relocate 64 bits from a GR pair to FP pair.  */
-  GD,
-  /* Relocate 32 bits from FP to GR.  */
-  FG,
-  /* Relocate 64 bits from FP pair to GR pair.  */
-  DG,
-} arg_reloc_type;
-
-/* What is being relocated (eg which argument or the return value).  */
-typedef enum
-{
-  ARG0, ARG1, ARG2, ARG3, RET,
-} arg_reloc_location;
-
-
 /* ELF32/HPPA relocation support
 
 	This file contains ELF32/HPPA relocation support as specified
@@ -199,41 +110,10 @@
 #include "elf32-hppa.h"
 #include "hppa_stubs.h"
 
-static bfd_reloc_status_type hppa_elf_reloc
-  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
 static unsigned long hppa_elf_relocate_insn
   PARAMS ((bfd *, asection *, unsigned long, unsigned long, long,
 	   long, unsigned long, unsigned long, unsigned long));
 
-static bfd_reloc_status_type hppa_elf_reloc
-  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd*, char **));
-
-static reloc_howto_type * elf_hppa_reloc_type_lookup
-  PARAMS ((bfd *, bfd_reloc_code_real_type));
-
-static boolean elf32_hppa_set_section_contents
-  PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
-
-static void elf32_hppa_info_to_howto
-  PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
-
-static boolean elf32_hppa_backend_symbol_table_processing
-  PARAMS ((bfd *, elf_symbol_type *, unsigned int));
-
-static void elf32_hppa_backend_begin_write_processing
-  PARAMS ((bfd *, struct bfd_link_info *));
-
-static void elf32_hppa_backend_final_write_processing
-  PARAMS ((bfd *, boolean));
-
-static void add_entry_to_symext_chain
-  PARAMS ((bfd *, unsigned int, unsigned int, symext_chainS **,
-	   symext_chainS **));
-
-static void
-elf_hppa_tc_make_sections PARAMS ((bfd *, symext_chainS *));
-
 static boolean hppa_elf_is_local_label_name PARAMS ((bfd *, const char *));
 
 static boolean elf32_hppa_add_symbol_hook
@@ -252,10 +132,6 @@
 elf32_hppa_stub_hash_newfunc
   PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
 
-static struct bfd_hash_entry *
-elf32_hppa_args_hash_newfunc
-  PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-
 static boolean
 elf32_hppa_relocate_section
   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
@@ -271,238 +147,11 @@
 static boolean
 elf32_hppa_build_one_stub PARAMS ((struct bfd_hash_entry *, PTR));
 
-static boolean
-elf32_hppa_read_symext_info
-  PARAMS ((bfd *, Elf_Internal_Shdr *, struct elf32_hppa_args_hash_table *,
-	   Elf_Internal_Sym *));
-
 static unsigned int elf32_hppa_size_of_stub
-  PARAMS ((unsigned int, unsigned int, bfd_vma, bfd_vma, const char *));
-
-static boolean elf32_hppa_arg_reloc_needed
-  PARAMS ((unsigned int, unsigned int, arg_reloc_type []));
+  PARAMS ((bfd_vma, bfd_vma, const char *));
 
 static void elf32_hppa_name_of_stub
-  PARAMS ((unsigned int, unsigned int, bfd_vma, bfd_vma, char *));
-
-static boolean elf32_hppa_size_symext PARAMS ((struct bfd_hash_entry *, PTR));
-
-static boolean elf32_hppa_link_output_symbol_hook
-  PARAMS ((bfd *, struct bfd_link_info *, const char *,
-	   Elf_Internal_Sym *, asection *));
-
-/* ELF/PA relocation howto entries.  */
-
-static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] =
-{
-  {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_NONE"},
-  /* The values in DIR32 are to placate the check in
-     _bfd_stab_section_find_nearest_line.  */
-  {R_PARISC_DIR32, 0, 2, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR32", false, 0, 0xffffffff, false},
-  {R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR21L"},
-  {R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR17R"},
-  {R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR17F"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_DIR14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR14R"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_PCREL21L, 0, 0, 21, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL21L"},
-  {R_PARISC_PCREL17R, 0, 0, 17, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL17R"},
-  {R_PARISC_PCREL17F, 0, 0, 17, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL17F"},
-  {R_PARISC_PCREL17C, 0, 0, 17, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL17C"},
-  {R_PARISC_PCREL14R, 0, 0, 14, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL14R"},
-  {R_PARISC_PCREL14F, 0, 0, 14, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL14F"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_DPREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DPREL21L"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_DPREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DPREL14R"},
-  {R_PARISC_DPREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DPREL14F"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_DLTREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTREL21L"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_DLTREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTREL14R"},
-  {R_PARISC_DLTREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTREL14F"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_DLTIND21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTIND21L"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_DLTIND14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTIND14R"},
-  {R_PARISC_DLTIND14F, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTIND14F"},
-
-  {R_PARISC_SETBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_SETBASE"},
-  {R_PARISC_BASEREL32, 0, 0, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL32"},
-  {R_PARISC_BASEREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL21L"},
-  {R_PARISC_BASEREL17R, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL17R"},
-  {R_PARISC_BASEREL17F, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL17F"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_BASEREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL14R"},
-  {R_PARISC_BASEREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL14F"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_TEXTREL32, 0, 0, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_TEXTREL32"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_DATAREL32, 0, 0, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_PLABEL32, 0, 0, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLABEL32"},
-  {R_PARISC_PLABEL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLABEL21L"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_PLABEL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLABEL14R"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_PLTIND21L, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLTIND21L"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"},
-  {R_PARISC_PLTIND14R, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLTIND14R"},
-  {R_PARISC_PLTIND14F, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLTIND14F"},
-
-
-  {R_PARISC_COPY, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_COPY"},
-  {R_PARISC_GLOB_DAT, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_GLOB_DAT"},
-  {R_PARISC_JMP_SLOT, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_JMP_SLOT"},
-  {R_PARISC_RELATIVE, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_RELATIVE"},
-
-  {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
-};
-
-/* Where (what register type) is an argument comming from?  */
-typedef enum
-{
-  AR_NO,
-  AR_GR,
-  AR_FR,
-  AR_FU,
-  AR_FPDBL1,
-  AR_FPDBL2,
-} arg_location;
-
-/* Horizontal represents the callee's argument location information,
-   vertical represents caller's argument location information.  Value at a
-   particular X,Y location represents what (if any) argument relocation
-   needs to be performed to make caller and callee agree.  */
-
-static CONST arg_reloc_type arg_mismatches[6][6] =
-{
-  {NO, NO, NO, NO, NO, NO},
-  {NO, NO, GF, NO, GD, NO},
-  {NO, FG, NO, NO, NO, NO},
-  {NO, NO, NO, NO, NO, NO},
-  {NO, DG, NO, NO, NO, NO},
-  {NO, DG, NO, NO, NO, NO},
-};
-
-/* Likewise, but reversed for the return value.  */
-static CONST arg_reloc_type ret_mismatches[6][6] =
-{
-  {NO, NO, NO, NO, NO, NO},
-  {NO, NO, FG, NO, DG, NO},
-  {NO, GF, NO, NO, NO, NO},
-  {NO, NO, NO, NO, NO, NO},
-  {NO, GD, NO, NO, NO, NO},
-  {NO, GD, NO, NO, NO, NO},
-};
-
-/* Misc static crud for symbol extension records.  */
-static symext_chainS *symext_rootP;
-static symext_chainS *symext_lastP;
-static bfd_size_type symext_chain_size;
-
-/* FIXME: We should be able to try this static variable!  */
-static bfd_byte *symextn_contents;
-
+  PARAMS ((bfd_vma, bfd_vma, char *));
 
 /* For linker stub hash tables.  */
 #define elf32_hppa_stub_hash_lookup(table, string, create, copy) \
@@ -515,24 +164,6 @@
     (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) (func), \
     (info)))
 
-/* For linker args hash tables.  */
-#define elf32_hppa_args_hash_lookup(table, string, create, copy) \
-  ((struct elf32_hppa_args_hash_entry *) \
-   bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
-
-#define elf32_hppa_args_hash_traverse(table, func, info) \
-  (bfd_hash_traverse \
-   (&(table)->root, \
-    (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) (func), \
-    (info)))
-
-#define elf32_hppa_args_hash_table_init(table, newfunc) \
-  (bfd_hash_table_init \
-   (&(table)->root, \
-    (struct bfd_hash_entry *(*) PARAMS ((struct bfd_hash_entry *, \
-					 struct bfd_hash_table *, \
-					 const char *))) (newfunc)))
-
 /* For HPPA linker hash table.  */
 
 #define elf32_hppa_link_hash_lookup(table, string, create, copy, follow)\
@@ -552,10 +183,6 @@
   ((struct elf32_hppa_link_hash_table *) ((p)->hash))
 
 
-/* Extract specific argument location bits for WHICH from
-   the full argument location in AR.  */
-#define EXTRACT_ARBITS(ar, which) ((ar) >> (8 - ((which) * 2))) & 3
-
 /* Assorted hash table functions.  */
 
 /* Initialize an entry in the stub hash table.  */
@@ -610,38 +237,6 @@
   return (bfd_hash_table_init (&table->root, newfunc));
 }
 
-/* Initialize an entry in the argument location hash table.  */
-
-static struct bfd_hash_entry *
-elf32_hppa_args_hash_newfunc (entry, table, string)
-     struct bfd_hash_entry *entry;
-     struct bfd_hash_table *table;
-     const char *string;
-{
-  struct elf32_hppa_args_hash_entry *ret;
-
-  ret = (struct elf32_hppa_args_hash_entry *) entry;
-
-  /* Allocate the structure if it has not already been allocated by a
-     subclass.  */
-  if (ret == NULL)
-    ret = ((struct elf32_hppa_args_hash_entry *)
-	   bfd_hash_allocate (table,
-			      sizeof (struct elf32_hppa_args_hash_entry)));
-  if (ret == NULL)
-    return NULL;
-
-  /* Call the allocation method of the superclass.  */
-  ret = ((struct elf32_hppa_args_hash_entry *)
-	 bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
-
-  /* Initialize the local fields.  */
-  if (ret)
-    ret->arg_bits = 0;
-
-  return (struct bfd_hash_entry *) ret;
-}
-
 /* Create the derived linker hash table.  The PA ELF port uses the derived
    hash table to keep information specific to the PA ELF linker (without
    using static variables).  */
@@ -663,7 +258,6 @@
       return NULL;
     }
   ret->stub_hash_table = NULL;
-  ret->args_hash_table = NULL;
   ret->output_symbol_count = 0;
   ret->global_value = 0;
   ret->global_sym_defined = 0;
@@ -870,13 +464,6 @@
 	    sym_name = bfd_section_name (input_bfd, sym_sec);
 	}
 
-      /* If args_hash_table is NULL, then we have encountered some
-	 kind of link error (ex. undefined symbols).  Do not try to
-	 apply any relocations, continue the loop so we can notify
-	 the user of several errors in a single attempted link.  */
-      if (elf32_hppa_hash_table (info)->args_hash_table == NULL)
-	continue;
-
       r = elf32_hppa_bfd_final_link_relocate (howto, input_bfd, output_bfd,
 					      input_section, contents,
 					      rel->r_offset, relocation,
@@ -937,286 +524,6 @@
   return true;
 }
 
-/* Return one (or more) BFD relocations which implement the base
-   relocation with modifications based on format and field.  */
-
-elf32_hppa_reloc_type **
-hppa_elf_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
-     bfd *abfd;
-     elf32_hppa_reloc_type base_type;
-     int format;
-     int field;
-     int ignore;
-     asymbol *sym;
-{
-  elf32_hppa_reloc_type *finaltype;
-  elf32_hppa_reloc_type **final_types;
-
-  /* Allocate slots for the BFD relocation.  */
-  final_types = ((elf32_hppa_reloc_type **)
-		 bfd_alloc (abfd, sizeof (elf32_hppa_reloc_type *) * 2));
-  if (final_types == NULL)
-    return NULL;
-
-  /* Allocate space for the relocation itself.  */
-  finaltype = ((elf32_hppa_reloc_type *)
-	       bfd_alloc (abfd, sizeof (elf32_hppa_reloc_type)));
-  if (finaltype == NULL)
-    return NULL;
-
-  /* Some reasonable defaults.  */
-  final_types[0] = finaltype;
-  final_types[1] = NULL;
-
-#define final_type finaltype[0]
-
-  final_type = base_type;
-
-  /* Just a tangle of nested switch statements to deal with the braindamage
-     that a different field selector means a completely different relocation
-     for PA ELF.  */
-  switch (base_type)
-    {
-    case R_HPPA:
-    case R_HPPA_ABS_CALL:
-      switch (format)
-	{
-	case 14:
-	  switch (field)
-	    {
-	    case e_rsel:
-	    case e_rrsel:
-	      final_type = R_PARISC_DIR14R;
-	      break;
-	    case e_rtsel:
-	      final_type = R_PARISC_DLTREL14R;
-	      break;
-	    case e_tsel:
-	      final_type = R_PARISC_DLTREL14F;
-	      break;
-	    case e_rpsel:
-	      final_type = R_PARISC_PLABEL14R;
-	      break;
-	    default:
-	      return NULL;
-	    }
-	  break;
-
-	case 17:
-	  switch (field)
-	    {
-	    case e_fsel:
-	      final_type = R_PARISC_DIR17F;
-	      break;
-	    case e_rsel:
-	    case e_rrsel:
-	      final_type = R_PARISC_DIR17R;
-	      break;
-	    default:
-	      return NULL;
-	    }
-	  break;
-
-	case 21:
-	  switch (field)
-	    {
-	    case e_lsel:
-	    case e_lrsel:
-	      final_type = R_PARISC_DIR21L;
-	      break;
-	    case e_ltsel:
-	      final_type = R_PARISC_DLTREL21L;
-	      break;
-	    case e_lpsel:
-	      final_type = R_PARISC_PLABEL21L;
-	      break;
-	    default:
-	      return NULL;
-	    }
-	  break;
-
-	case 32:
-	  switch (field)
-	    {
-	    case e_fsel:
-	      final_type = R_PARISC_DIR32;
-	      break;
-	    case e_psel:
-	      final_type = R_PARISC_PLABEL32;
-	      break;
-	    default:
-	      return NULL;
-	    }
-	  break;
-
-	default:
-	  return NULL;
-	}
-      break;
-
-
-    case R_HPPA_GOTOFF:
-      switch (format)
-	{
-	case 14:
-	  switch (field)
-	    {
-	    case e_rsel:
-	    case e_rrsel:
-	      final_type = R_PARISC_DPREL14R;
-	      break;
-	    case e_fsel:
-	      final_type = R_PARISC_DPREL14F;
-	      break;
-	    default:
-	      return NULL;
-	    }
-	  break;
-
-	case 21:
-	  switch (field)
-	    {
-	    case e_lrsel:
-	    case e_lsel:
-	      final_type = R_PARISC_DPREL21L;
-	      break;
-	    default:
-	      return NULL;
-	    }
-	  break;
-
-	default:
-	  return NULL;
-	}
-      break;
-
-
-    case R_HPPA_PCREL_CALL:
-      switch (format)
-	{
-	case 14:
-	  switch (field)
-	    {
-	    case e_rsel:
-	    case e_rrsel:
-	      final_type = R_PARISC_PCREL14R;
-	      break;
-	    case e_fsel:
-	      final_type = R_PARISC_PCREL14F;
-	      break;
-	    default:
-	      return NULL;
-	    }
-	  break;
-
-	case 17:
-	  switch (field)
-	    {
-	    case e_rsel:
-	    case e_rrsel:
-	      final_type = R_PARISC_PCREL17R;
-	      break;
-	    case e_fsel:
-	      final_type = R_PARISC_PCREL17F;
-	      break;
-	    default:
-	      return NULL;
-	    }
-	  break;
-
-	case 21:
-	  switch (field)
-	    {
-	    case e_lsel:
-	    case e_lrsel:
-	      final_type = R_PARISC_PCREL21L;
-	      break;
-	    default:
-	      return NULL;
-	    }
-	  break;
-
-	default:
-	  return NULL;
-	}
-      break;
-
-    default:
-      return NULL;
-    }
-
-  return final_types;
-}
-
-#undef final_type
-
-/* Set the contents of a particular section at a particular location.  */
-
-static boolean
-elf32_hppa_set_section_contents (abfd, section, location, offset, count)
-     bfd *abfd;
-     sec_ptr section;
-     PTR location;
-     file_ptr offset;
-     bfd_size_type count;
-{
-  /* Ignore write requests for the symbol extension section until we've
-     had the chance to rebuild it ourselves.  */
-  if (!strcmp (section->name, ".PARISC.symextn") && !symext_chain_size)
-    return true;
-  else
-    return _bfd_elf_set_section_contents (abfd, section, location,
-					  offset, count);
-}
-
-/* Translate from an elf into field into a howto relocation pointer.  */
-
-static void
-elf32_hppa_info_to_howto (abfd, cache_ptr, dst)
-     bfd *abfd;
-     arelent *cache_ptr;
-     Elf32_Internal_Rela *dst;
-{
-  BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_PARISC_UNIMPLEMENTED);
-  cache_ptr->howto = &elf_hppa_howto_table[ELF32_R_TYPE (dst->r_info)];
-}
-
-
-/* Actually perform a relocation.  NOTE this is (mostly) superceeded
-   by elf32_hppa_bfd_final_link_relocate which is called by the new
-   fast linker.  */
-
-static bfd_reloc_status_type
-hppa_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
-		error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol_in;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
-{
-  /* It is no longer valid to call hppa_elf_reloc when creating
-     a final executable.  */
-  if (output_bfd)
-    {
-      reloc_entry->address += input_section->output_offset;
-
-      /* Work around lossage in generic elf code to write relocations.
-	 (maps different section symbols into the same symbol index).  */
-      if ((symbol_in->flags & BSF_SECTION_SYM)
-	  && symbol_in->section)
-	reloc_entry->addend += symbol_in->section->output_offset;
-      return bfd_reloc_ok;
-    }
-  else
-    {
-      *error_message = (char *) _("Unsupported call to hppa_elf_reloc");
-      return bfd_reloc_notsupported;
-    }
-}
-
 /* Actually perform a relocation as part of a final link.  This can get
    rather hairy when linker stubs are needed.  */
 
@@ -1226,7 +533,7 @@
 				    addend, info, sym_sec, sym_name, is_local)
      reloc_howto_type *howto;
      bfd *input_bfd;
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd_byte *contents;
      bfd_vma offset;
@@ -1329,10 +636,7 @@
     case R_PARISC_PCREL17F:
       {
 	bfd_vma location;
-	unsigned int len, caller_args, callee_args;
-	arg_reloc_type arg_reloc_types[5];
-	struct elf32_hppa_args_hash_table *args_hash_table;
-	struct elf32_hppa_args_hash_entry *args_hash;
+	unsigned int len;
 	char *new_name, *stub_name;
 
 	/* Get the field selector right.  We'll need it in a minute.  */
@@ -1349,8 +653,6 @@
 		    input_section->output_offset +
 		    input_section->output_section->vma);
 
-	/* Now look for the argument relocation bits associated with the
-	   target.  */
 	len = strlen (sym_name) + 1;
 	if (is_local)
 	  len += 9;
@@ -1363,32 +665,9 @@
 	if (is_local)
 	  sprintf (new_name + len - 10, "_%08x", (int)sym_sec);
 
-	args_hash_table = elf32_hppa_hash_table (info)->args_hash_table;
-
-	args_hash = elf32_hppa_args_hash_lookup (args_hash_table,
-						 new_name, false, false);
-	if (args_hash == NULL)
-	  callee_args = 0;
-	else
-	  callee_args = args_hash->arg_bits;
-
-	/* If this is a CALL relocation, then get the caller's bits
-	   from the addend.  Else use the magic 0x155 value for PLABELS.
-
-	   Also we don't care about the destination (value) for PLABELS.  */
-	if (r_type == R_PARISC_PCREL17F)
-	  caller_args = HPPA_R_ARG_RELOC (addend);
-	else
-	  {
-	    caller_args = 0x155;
-	    location = value;
-	  }
-
 	/* Any kind of linker stub needed?  */
 	if (((int)(value - location) > 0x3ffff)
-	    || ((int)(value - location) < (int)0xfffc0000)
-	    || elf32_hppa_arg_reloc_needed (caller_args, callee_args,
-					    arg_reloc_types))
+	    || ((int)(value - location) < (int)0xfffc0000))
 	  {
 	    struct elf32_hppa_stub_hash_table *stub_hash_table;
 	    struct elf32_hppa_stub_hash_entry *stub_hash;
@@ -1401,8 +680,7 @@
 	    stub_name = bfd_malloc (len);
 	    if (!stub_name)
 	      return bfd_reloc_notsupported;
-	    elf32_hppa_name_of_stub (caller_args, callee_args,
-				     location, value, stub_name);
+	    elf32_hppa_name_of_stub (location, value, stub_name);
 	    strcat (stub_name, new_name);
 	    free (new_name);
 
@@ -1420,7 +698,6 @@
 
 	    if (stub_hash != NULL)
 	      {
-
 		if (r_type == R_PARISC_PCREL17F)
 		  {
 		    unsigned long delay_insn;
@@ -1492,28 +769,9 @@
 			return bfd_reloc_dangerous;
 		      }
 		  }
-		else
-		  {
-		    /* PLABEL stuff is easy.  */
-
-		    value = (stub_hash->offset
-			     + stub_section->output_offset
-			     + stub_section->output_section->vma);
-		    /* We don't need the RP adjustment for PLABELs.  */
-		    value += 4;
-		    if (r_type == R_PARISC_PLABEL32)
-		      r_format = 32;
-		    else if (r_type == R_PARISC_PLABEL21L)
-		      r_format = 21;
-		    else if (r_type == R_PARISC_PLABEL14R)
-		      r_format = 14;
-
-		    r_pcrel = 0;
-		    addend = 0;
-		  }
-		}
-	      else
-		return bfd_reloc_notsupported;
+	        else
+		  return bfd_reloc_notsupported;
+	      }
 	  }
 	goto do_basic_type_1;
       }
@@ -1534,526 +792,26 @@
   return (bfd_reloc_ok);
 }
 
-/* Return the address of the howto table entry to perform the CODE
-   relocation for an ARCH machine.  */
-
-static reloc_howto_type *
-elf_hppa_reloc_type_lookup (abfd, code)
-     bfd *abfd;
-     bfd_reloc_code_real_type code;
-{
-  if ((int) code < (int) R_PARISC_UNIMPLEMENTED)
-    {
-      BFD_ASSERT ((int) elf_hppa_howto_table[(int) code].type == (int) code);
-      return &elf_hppa_howto_table[(int) code];
-    }
-  return NULL;
-}
-
 /* Return true if SYM represents a local label symbol.  */
 
 static boolean
 hppa_elf_is_local_label_name (abfd, name)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      const char *name;
 {
   return (name[0] == 'L' && name[1] == '$');
 }
 
-/* Do any backend specific processing when beginning to write an object
-   file.  For PA ELF we need to determine the size of the symbol extension
-   section *before* any other output processing happens.  */
-
-static void
-elf32_hppa_backend_begin_write_processing (abfd, info)
-     bfd *abfd;
-     struct bfd_link_info *info;
-{
-  unsigned int i;
-  asection *symextn_sec;
-
-  /* Size up the symbol extension section.  */
-  if ((abfd->outsymbols == NULL
-       && info == NULL)
-      || symext_chain_size != 0)
-    return;
-
-  if (info == NULL)
-    {
-      /* We were not called from the BFD ELF linker code, so we need
-	 to examine the output BFD's outsymbols.
-
-	 Note we can not build the symbol extensions now as the symbol
-	 map hasn't been set up.  */
-      for (i = 0; i < abfd->symcount; i++)
-	{
-	  elf_symbol_type *symbol = (elf_symbol_type *)abfd->outsymbols[i];
-
-	  /* Only functions ever need an entry in the symbol extension
-	     section.  */
-	  if (!(symbol->symbol.flags & BSF_FUNCTION))
-	    continue;
-
-	  /* And only if they specify the locations of their arguments.  */
-	  if (symbol->tc_data.hppa_arg_reloc == 0)
-	    continue;
-
-	  /* Yup.  This function symbol needs an entry.  */
-	  symext_chain_size += 2 * ELF32_PARISC_SX_SIZE;
-	}
-    }
-  else if (info->relocateable == true)
-    {
-      struct elf32_hppa_args_hash_table *table;
-      table = elf32_hppa_hash_table (info)->args_hash_table;
-
-      /* Determine the size of the symbol extension section.  */
-      elf32_hppa_args_hash_traverse (table,
-				     elf32_hppa_size_symext,
-				     &symext_chain_size);
-    }
-
-  /* Now create the section and set its size.  We'll fill in the
-     contents later.  */
-  symextn_sec = bfd_get_section_by_name (abfd, SYMEXTN_SECTION_NAME);
-  if (symextn_sec == NULL)
-    symextn_sec = bfd_make_section (abfd, SYMEXTN_SECTION_NAME);
-
-  bfd_set_section_flags (abfd, symextn_sec,
-			 SEC_LOAD | SEC_HAS_CONTENTS | SEC_DATA);
-  symextn_sec->output_section = symextn_sec;
-  symextn_sec->output_offset = 0;
-  bfd_set_section_alignment (abfd, symextn_sec, 2);
-  bfd_set_section_size (abfd, symextn_sec, symext_chain_size);
-}
-
-/* Called for each entry in the args location hash table.  For each
-   entry we bump the size pointer by 2 records (16 bytes).  */
-
-static boolean
-elf32_hppa_size_symext (gen_entry, in_args)
-     struct bfd_hash_entry *gen_entry;
-     PTR in_args;
-{
-  bfd_size_type *sizep = (bfd_size_type *)in_args;
-
-  *sizep += 2 * ELF32_PARISC_SX_SIZE;
-  return true;
-}
-
-/* Backend routine called by the linker for each output symbol.
-
-   For PA ELF we use this opportunity to add an appropriate entry
-   to the symbol extension chain for function symbols.  */
-
-static boolean
-elf32_hppa_link_output_symbol_hook (abfd, info, name, sym, section)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     const char *name;
-     Elf_Internal_Sym *sym;
-     asection *section;
-{
-  char *new_name;
-  unsigned int len, index;
-  struct elf32_hppa_args_hash_table *args_hash_table;
-  struct elf32_hppa_args_hash_entry *args_hash;
-
-  /* If the args hash table is NULL, then we've encountered an error
-     of some sorts (for example, an undefined symbol).  In that case
-     we've got nothing else to do.
-
-     NOTE: elf_link_output_symbol will abort if we return false here!  */
-  if (elf32_hppa_hash_table (info)->args_hash_table == NULL)
-    return true;
-
-  index = elf32_hppa_hash_table (info)->output_symbol_count++;
-
-  /* We need to look up this symbol in the args hash table to see if
-     it has argument relocation bits.  */
-  if (ELF_ST_TYPE (sym->st_info) != STT_FUNC)
-    return true;
-
-  /* We know it's a function symbol of some kind.  */
-  len = strlen (name) + 1;
-  if (ELF_ST_BIND (sym->st_info) == STB_LOCAL)
-    len += 9;
-
-  new_name = bfd_malloc (len);
-  if (new_name == NULL)
-    return false;
-
-  strcpy (new_name, name);
-  if (ELF_ST_BIND (sym->st_info) == STB_LOCAL)
-    sprintf (new_name + len - 10, "_%08x", (int)section);
-
-  /* Now that we have the unique name, we can look it up in the
-     args hash table.  */
-  args_hash_table = elf32_hppa_hash_table (info)->args_hash_table;
-  args_hash = elf32_hppa_args_hash_lookup (args_hash_table, new_name,
-					   false, false);
-  free (new_name);
-  if (args_hash == NULL)
-    return true;
-
-  /* We know this symbol has arg reloc bits.  */
-  add_entry_to_symext_chain (abfd, args_hash->arg_bits,
-			     index, &symext_rootP, &symext_lastP);
-  return true;
-}
-
-/* Perform any processing needed late in the object file writing process.
-   For PA ELF we build and set the contents of the symbol extension
-   section.  */
-
-static void
-elf32_hppa_backend_final_write_processing (abfd, linker)
-     bfd *abfd;
-     boolean linker;
-{
-  asection *symextn_sec;
-  unsigned int i;
-
-  /* Now build the symbol extension section.  */
-  if (symext_chain_size == 0)
-    return;
-
-  if (! linker)
-    {
-      /* We were not called from the backend linker, so we still need
-	 to build the symbol extension chain.
-
-         Look at each symbol, adding the appropriate information to the
-	 symbol extension section list as necessary.  */
-      for (i = 0; i < abfd->symcount; i++)
-	{
-	  elf_symbol_type *symbol = (elf_symbol_type *) abfd->outsymbols[i];
-
-	  /* Only functions ever need an entry in the symbol extension
-	     section.  */
-	  if (!(symbol->symbol.flags & BSF_FUNCTION))
-	    continue;
-
-	  /* And only if they specify the locations of their arguments.  */
-	  if (symbol->tc_data.hppa_arg_reloc == 0)
-	    continue;
-
-	  /* Add this symbol's information to the chain.  */
-	  add_entry_to_symext_chain (abfd, symbol->tc_data.hppa_arg_reloc,
-				     symbol->symbol.udata.i, &symext_rootP,
-				     &symext_lastP);
-	}
-    }
-
-  /* Now fill in the contents of the symbol extension section.  */
-  elf_hppa_tc_make_sections (abfd, symext_rootP);
-
-  /* And attach that as the section's contents.  */
-  symextn_sec = bfd_get_section_by_name (abfd, SYMEXTN_SECTION_NAME);
-  if (symextn_sec == (asection *) 0)
-    abort();
-
-  symextn_sec->contents = (void *)symextn_contents;
-
-  bfd_set_section_contents (abfd, symextn_sec, symextn_sec->contents,
-			    symextn_sec->output_offset, symextn_sec->_raw_size);
-}
-
-/* Update the symbol extention chain to include the symbol pointed to
-   by SYMBOLP if SYMBOLP is a function symbol.  Used internally and by GAS.  */
-
-static void
-add_entry_to_symext_chain (abfd, arg_reloc, sym_idx, symext_root, symext_last)
-     bfd *abfd;
-     unsigned int arg_reloc;
-     unsigned int sym_idx;
-     symext_chainS **symext_root;
-     symext_chainS **symext_last;
-{
-  symext_chainS *symextP;
-
-  /* Allocate memory and initialize this entry.  */
-  symextP = (symext_chainS *) bfd_alloc (abfd, sizeof (symext_chainS) * 2);
-  if (!symextP)
-    abort();			/* FIXME */
-
-  symextP[0].entry = ELF32_PARISC_SX_WORD (PARISC_SXT_SYMNDX, sym_idx);
-  symextP[0].next = &symextP[1];
-
-  symextP[1].entry = ELF32_PARISC_SX_WORD (PARISC_SXT_ARG_RELOC, arg_reloc);
-  symextP[1].next = NULL;
-
-  /* Now update the chain itself so it can be walked later to build
-     the symbol extension section.  */
-  if (*symext_root == NULL)
-    {
-      *symext_root = &symextP[0];
-      *symext_last = &symextP[1];
-    }
-  else
-    {
-      (*symext_last)->next = &symextP[0];
-      *symext_last = &symextP[1];
-    }
-}
-
-/* Build the symbol extension section.  */
-
-static void
-elf_hppa_tc_make_sections (abfd, symext_root)
-     bfd *abfd;
-     symext_chainS *symext_root;
-{
-  symext_chainS *symextP;
-  unsigned int i;
-  asection *symextn_sec;
-
-  symextn_sec = bfd_get_section_by_name (abfd, SYMEXTN_SECTION_NAME);
-
-  /* Grab some memory for the contents of the symbol extension section
-     itself.  */
-  symextn_contents = (bfd_byte *) bfd_zalloc (abfd,
-					      symextn_sec->_raw_size);
-  if (!symextn_contents)
-    abort();			/* FIXME */
-
-  /* Fill in the contents of the symbol extension chain.  */
-  for (i = 0, symextP = symext_root; symextP; symextP = symextP->next, ++i)
-    ELF32_PARISC_SX_PUT (abfd, (bfd_vma) symextP->entry,
-			 symextn_contents + i * ELF32_PARISC_SX_SIZE);
-
-  return;
-}
-
-/* Do some PA ELF specific work after reading in the symbol table.
-   In particular attach the argument relocation from the
-   symbol extension section to the appropriate symbols.  */
-
-static boolean
-elf32_hppa_backend_symbol_table_processing (abfd, esyms,symcnt)
-     bfd *abfd;
-     elf_symbol_type *esyms;
-     unsigned int symcnt;
-{
-  Elf32_Internal_Shdr *symextn_hdr =
-    bfd_elf_find_section (abfd, SYMEXTN_SECTION_NAME);
-  unsigned int i, current_sym_idx = 0;
-
-  /* If no symbol extension existed, then all symbol extension information
-     is assumed to be zero.  */
-  if (symextn_hdr == NULL)
-    {
-      for (i = 0; i < symcnt; i++)
-	esyms[i].tc_data.hppa_arg_reloc = 0;
-      return (true);
-    }
-
-  /* FIXME:  Why not use bfd_get_section_contents here?  Also should give
-     memory back when we're done.  */
-  /* Allocate a buffer of the appropriate size for the symextn section.  */
-  symextn_hdr->contents = bfd_zalloc(abfd,symextn_hdr->sh_size);
-  if (!symextn_hdr->contents)
-    return false;
-
-  /* Read in the symextn section.  */
-  if (bfd_seek (abfd, symextn_hdr->sh_offset, SEEK_SET) == -1)
-    return false;
-  if (bfd_read ((PTR) symextn_hdr->contents, 1, symextn_hdr->sh_size, abfd)
-      != symextn_hdr->sh_size)
-    return false;
-
-  /* Parse entries in the symbol extension section, updating the symtab
-     entries as we go */
-  for (i = 0; i < symextn_hdr->sh_size / ELF32_PARISC_SX_SIZE; i++)
-    {
-      symext_entryS se =
-	ELF32_PARISC_SX_GET (abfd,
-			     ((unsigned char *)symextn_hdr->contents
-			      + i * ELF32_PARISC_SX_SIZE));
-      unsigned int se_value = ELF32_PARISC_SX_VAL (se);
-      unsigned int se_type = ELF32_PARISC_SX_TYPE (se);
-
-      switch (se_type)
-	{
-	case PARISC_SXT_NULL:
-	  break;
-
-	case PARISC_SXT_SYMNDX:
-	  if (se_value >= symcnt)
-	    {
-	      bfd_set_error (bfd_error_bad_value);
-	      return (false);
-	    }
-	  current_sym_idx = se_value - 1;
-	  break;
-
-	case PARISC_SXT_ARG_RELOC:
-	  esyms[current_sym_idx].tc_data.hppa_arg_reloc = se_value;
-	  break;
-
-	default:
-	  bfd_set_error (bfd_error_bad_value);
-	  return (false);
-	}
-    }
-  return (true);
-}
-
-/* Read and attach the symbol extension information for the symbols
-   in INPUT_BFD to the argument location hash table.  Handle locals
-   if DO_LOCALS is true; likewise for globals when DO_GLOBALS is true.  */
-
-static boolean
-elf32_hppa_read_symext_info (input_bfd, symtab_hdr, args_hash_table, local_syms)
-     bfd *input_bfd;
-     Elf_Internal_Shdr *symtab_hdr;
-     struct elf32_hppa_args_hash_table *args_hash_table;
-     Elf_Internal_Sym *local_syms;
-{
-  asection *symextn_sec;
-  bfd_byte *contents;
-  unsigned int i, n_entries, current_index = 0;
-
-  /* Get the symbol extension section for this BFD.  If no section exists
-     then there's nothing to do.  Likewise if the section exists, but
-     has no contents.  */
-  symextn_sec = bfd_get_section_by_name (input_bfd, SYMEXTN_SECTION_NAME);
-  if (symextn_sec == NULL)
-    return true;
-
-  /* Done separately so we can turn off SEC_HAS_CONTENTS (see below).  */
-  if (symextn_sec->_raw_size == 0)
-    {
-      symextn_sec->flags &= ~SEC_HAS_CONTENTS;
-      return true;
-    }
-
-  contents = (bfd_byte *) bfd_malloc ((size_t) symextn_sec->_raw_size);
-  if (contents == NULL)
-    return false;
-
-  /* How gross.  We turn off SEC_HAS_CONTENTS for the input symbol extension
-     sections to keep the generic ELF/BFD code from trying to do anything
-     with them.  We have to undo that hack temporarily so that we can read
-     in the contents with the generic code.  */
-  symextn_sec->flags |= SEC_HAS_CONTENTS;
-  if (bfd_get_section_contents (input_bfd, symextn_sec, contents,
-				0, symextn_sec->_raw_size) == false)
-    {
-      symextn_sec->flags &= ~SEC_HAS_CONTENTS;
-      free (contents);
-      return false;
-    }
-
-  /* Gross.  Turn off SEC_HAS_CONTENTS for the input symbol extension
-     sections (see above).  */
-  symextn_sec->flags &= ~SEC_HAS_CONTENTS;
-
-  n_entries = symextn_sec->_raw_size / ELF32_PARISC_SX_SIZE;
-  for (i = 0; i < n_entries; i++)
-    {
-      symext_entryS entry =
-	ELF32_PARISC_SX_GET (input_bfd, contents + i * ELF32_PARISC_SX_SIZE);
-      unsigned int value = ELF32_PARISC_SX_VAL (entry);
-      unsigned int type = ELF32_PARISC_SX_TYPE (entry);
-      struct elf32_hppa_args_hash_entry *args_hash;
-
-      switch (type)
-	{
-	case PARISC_SXT_NULL:
-	  break;
-
-	case PARISC_SXT_SYMNDX:
-	  if (value >= symtab_hdr->sh_size / sizeof (Elf32_External_Sym))
-	    {
-	      bfd_set_error (bfd_error_bad_value);
-	      free (contents);
-	      return false;
-	    }
-	  current_index = value;
-	  break;
-
-	case PARISC_SXT_ARG_RELOC:
-	  if (current_index < symtab_hdr->sh_info)
-	    {
-	      Elf_Internal_Shdr *hdr;
-	      char *new_name;
-	      const char *sym_name;
-	      asection *sym_sec;
-	      unsigned int len;
-
-	      hdr = elf_elfsections (input_bfd)[local_syms[current_index].st_shndx];
-	      sym_sec = hdr->bfd_section;
-	      sym_name = bfd_elf_string_from_elf_section (input_bfd,
-						      symtab_hdr->sh_link,
-	 			        local_syms[current_index].st_name);
-	      len = strlen (sym_name) + 10;
-	      new_name = bfd_malloc (len);
-	      if (new_name == NULL)
-		{
-		  free (contents);
-		  return false;
-		}
-	      strcpy (new_name, sym_name);
-	      sprintf (new_name + len - 10, "_%08x", (int)sym_sec);
-
-	      /* This is a global symbol with argument location info.
-		 We need to enter it into the hash table.  */
-	      args_hash = elf32_hppa_args_hash_lookup (args_hash_table,
-						       new_name, true,
-						       true);
-	      free (new_name);
-	      if (args_hash == NULL)
-		{
-		  free (contents);
-		  return false;
-		}
-	      args_hash->arg_bits = value;
-	      break;
-	    }
-	  else if (current_index >= symtab_hdr->sh_info)
-	    {
-	      struct elf_link_hash_entry *h;
-
-	      current_index -= symtab_hdr->sh_info;
-	      h = elf_sym_hashes(input_bfd)[current_index];
-	      /* This is a global symbol with argument location
-		 information.  We need to enter it into the hash table.  */
-	      args_hash = elf32_hppa_args_hash_lookup (args_hash_table,
-						       h->root.root.string,
-						       true, true);
-	      if (args_hash == NULL)
-		{
-		  bfd_set_error (bfd_error_bad_value);
-		  free (contents);
-		  return false;
-		}
-	      args_hash->arg_bits = value;
-	      break;
-	    }
-	  else
-	    break;
-
-	default:
-	  bfd_set_error (bfd_error_bad_value);
-	  free (contents);
-	  return false;
-	}
-    }
-  free (contents);
-  return true;
-}
-
 /* Undo the generic ELF code's subtraction of section->vma from the
    value of each external symbol.  */
 
 static boolean
 elf32_hppa_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     const Elf_Internal_Sym *sym;
-     const char **namep;
-     flagword *flagsp;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     const Elf_Internal_Sym *sym ATTRIBUTE_UNUSED;
+     const char **namep ATTRIBUTE_UNUSED;
+     flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
      bfd_vma *valp;
 {
@@ -2066,117 +824,12 @@
    for a call from LOCATION to DESTINATION.  Copy the name into STUB_NAME.  */
 
 static void
-elf32_hppa_name_of_stub (caller, callee, location, destination, stub_name)
-     unsigned int caller, callee;
-     bfd_vma location, destination;
+elf32_hppa_name_of_stub (location, destination, stub_name)
+     bfd_vma location ATTRIBUTE_UNUSED;
+     bfd_vma destination ATTRIBUTE_UNUSED;
      char *stub_name;
 {
-  arg_reloc_type arg_reloc_types[5];
-
-  if (elf32_hppa_arg_reloc_needed (caller, callee, arg_reloc_types))
-    {
-      arg_reloc_location i;
-      /* Fill in the basic template.  */
-      strcpy (stub_name, "__XX_XX_XX_XX_XX_stub_");
-
-      /* Now fix the specifics.  */
-      for (i = ARG0; i <= RET; i++)
-	switch (arg_reloc_types[i])
-	  {
-	    case NO:
-	      stub_name[3 * i + 2] = 'N';
-	      stub_name[3 * i + 3] = 'O';
-	      break;
-	    case GF:
-	      stub_name[3 * i + 2] = 'G';
-	      stub_name[3 * i + 3] = 'F';
-	      break;
-	    case FG:
-	      stub_name[3 * i + 2] = 'F';
-	      stub_name[3 * i + 3] = 'G';
-	      break;
-	    case GD:
-	      stub_name[3 * i + 2] = 'G';
-	      stub_name[3 * i + 3] = 'D';
-	      break;
-	    case DG:
-	      stub_name[3 * i + 2] = 'D';
-	      stub_name[3 * i + 3] = 'G';
-	      break;
-	  }
-    }
-  else
-    strcpy (stub_name, "_____long_branch_stub_");
-}
-
-/* Determine if an argument relocation stub is needed to perform a
-   call assuming the argument relocation bits for caller and callee
-   are in CALLER and CALLEE.  Place the type of relocations (if any)
-   into stub_types_p.  */
-
-static boolean
-elf32_hppa_arg_reloc_needed (caller, callee, stub_types)
-     unsigned int caller, callee;
-     arg_reloc_type stub_types[5];
-{
-  /* Special case for no relocations.  */
-  if (caller == 0 || callee == 0)
-    return 0;
-  else
-    {
-      arg_location caller_loc[5];
-      arg_location callee_loc[5];
-
-      /* Extract the location information for the argument and return
-	 value on both the caller and callee sides.  */
-      caller_loc[ARG0] = EXTRACT_ARBITS (caller, ARG0);
-      callee_loc[ARG0] = EXTRACT_ARBITS (callee, ARG0);
-      caller_loc[ARG1] = EXTRACT_ARBITS (caller, ARG1);
-      callee_loc[ARG1] = EXTRACT_ARBITS (callee, ARG1);
-      caller_loc[ARG2] = EXTRACT_ARBITS (caller, ARG2);
-      callee_loc[ARG2] = EXTRACT_ARBITS (callee, ARG2);
-      caller_loc[ARG3] = EXTRACT_ARBITS (caller, ARG3);
-      callee_loc[ARG3] = EXTRACT_ARBITS (callee, ARG3);
-      caller_loc[RET] = EXTRACT_ARBITS (caller, RET);
-      callee_loc[RET] = EXTRACT_ARBITS (callee, RET);
-
-      /* Check some special combinations.  This is necessary to
-	 deal with double precision FP arguments.  */
-      if (caller_loc[ARG0] == AR_FU || caller_loc[ARG1] == AR_FU)
-	{
-	  caller_loc[ARG0] = AR_FPDBL1;
-	  caller_loc[ARG1] = AR_NO;
-	}
-      if (caller_loc[ARG2] == AR_FU || caller_loc[ARG3] == AR_FU)
-	{
-	  caller_loc[ARG2] = AR_FPDBL2;
-	  caller_loc[ARG3] = AR_NO;
-	}
-      if (callee_loc[ARG0] == AR_FU || callee_loc[ARG1] == AR_FU)
-	{
-	  callee_loc[ARG0] = AR_FPDBL1;
-	  callee_loc[ARG1] = AR_NO;
-	}
-      if (callee_loc[ARG2] == AR_FU || callee_loc[ARG3] == AR_FU)
-	{
-	  callee_loc[ARG2] = AR_FPDBL2;
-	  callee_loc[ARG3] = AR_NO;
-	}
-
-      /* Now look up any relocation needed for each argument and the
-	 return value.  */
-      stub_types[ARG0] = arg_mismatches[caller_loc[ARG0]][callee_loc[ARG0]];
-      stub_types[ARG1] = arg_mismatches[caller_loc[ARG1]][callee_loc[ARG1]];
-      stub_types[ARG2] = arg_mismatches[caller_loc[ARG2]][callee_loc[ARG2]];
-      stub_types[ARG3] = arg_mismatches[caller_loc[ARG3]][callee_loc[ARG3]];
-      stub_types[RET] = ret_mismatches[caller_loc[RET]][callee_loc[RET]];
-
-      return (stub_types[ARG0] != NO
-	      || stub_types[ARG1] != NO
-	      || stub_types[ARG2] != NO
-	      || stub_types[ARG3] != NO
-	      || stub_types[RET] != NO);
-    }
+  strcpy (stub_name, "_____long_branch_stub_");
 }
 
 /* Compute the size of the stub needed to call from LOCATION to DESTINATION
@@ -2184,62 +837,16 @@
    CALLEE.  Return zero if no stub is needed to perform such a call.  */
 
 static unsigned int
-elf32_hppa_size_of_stub (callee, caller, location, destination, sym_name)
-     unsigned int callee, caller;
+elf32_hppa_size_of_stub (location, destination, sym_name)
      bfd_vma location, destination;
      const char *sym_name;
 {
-  arg_reloc_type arg_reloc_types[5];
-
-  /* Determine if a long branch or argument relocation stub is needed.
-     If an argument relocation stub is needed, the relocation will be
-     stored into arg_reloc_types.  */
+  /* Determine if a long branch stub is needed.  */
   if (!(((int)(location - destination) > 0x3ffff)
-	|| ((int)(location - destination) < (int)0xfffc0000)
-	|| elf32_hppa_arg_reloc_needed (caller, callee, arg_reloc_types)))
+	|| ((int)(location - destination) < (int)0xfffc0000)))
     return 0;
 
-  /* Some kind of stub is needed.  Determine how big it needs to be.
-     First check for argument relocation stubs as they also handle
-     long calls.  Then check for long calls to millicode and finally
-     the normal long calls.  */
-  if (arg_reloc_types[ARG0] != NO
-      || arg_reloc_types[ARG1] != NO
-      || arg_reloc_types[ARG2] != NO
-      || arg_reloc_types[ARG3] != NO
-      || arg_reloc_types[RET] != NO)
-    {
-      /* Some kind of argument relocation stub is needed.  */
-      unsigned int len = 16;
-      arg_reloc_location i;
-
-      /* Each GR or FG relocation takes 2 insns, each GD or DG
-	 relocation takes 3 insns.  Plus 4 more insns for the
-         RP adjustment, ldil & (be | ble) and copy.  */
-      for (i = ARG0; i <= RET; i++)
-	switch (arg_reloc_types[i])
-	  {
-	    case GF:
-	    case FG:
-	      len += 8;
-	      break;
-
-	    case GD:
-	    case DG:
-	      len += 12;
-	      break;
-
-	    default:
-	      break;
-	  }
-
-      /* Extra instructions are needed if we're relocating a return value.  */
-      if (arg_reloc_types[RET] != NO)
-	len += 12;
-
-      return len;
-    }
-  else if (!strncmp ("$$", sym_name, 2)
+  if (!strncmp ("$$", sym_name, 2)
       && strcmp ("$$dyncall", sym_name))
     return 12;
   else
@@ -2280,131 +887,7 @@
 	       + entry->target_section->output_offset
 	       + entry->target_section->output_section->vma);
 
-  if (strncmp ("_____long_branch_stub_", entry->root.string, 22))
-    {
-      /* This must be an argument or return value relocation stub.  */
-      unsigned long insn;
-      arg_reloc_location i;
-      bfd_byte *begin_loc = loc;
-
-      /* First the return pointer adjustment.  Depending on exact calling
-	 sequence this instruction may be skipped.  */
-      bfd_put_32 (stub_bfd, LDO_M4_R31_R31, loc);
-      loc += 4;
-
-      /* If we are relocating a return value, then we're going to have
-	 to return into the stub.  So we have to save off the user's
-	 return pointer into the stack at RP'.  */
-      if (strncmp (entry->root.string + 14, "NO", 2))
-	{
-	  bfd_put_32 (stub_bfd, STW_R31_M8R30, loc);
-	  loc += 4;
-	}
-
-      /* Iterate over the argument relocations, emitting instructions
-	 to move them around as necessary.  */
-      for (i = ARG0; i <= ARG3; i++)
-	{
-	  if (!strncmp (entry->root.string + 3 * i + 2, "GF", 2))
-	    {
-	      bfd_put_32 (stub_bfd, STW_ARG_M16R30 | ((26 - i) << 16), loc);
-	      bfd_put_32 (stub_bfd, FLDW_M16R30_FARG | (4 + i), loc + 4);
-	      loc += 8;
-	    }
-	  else if (!strncmp (entry->root.string + 3 * i + 2, "FG", 2))
-	    {
-	      bfd_put_32 (stub_bfd, FSTW_FARG_M16R30 | (4 + i), loc);
-	      bfd_put_32 (stub_bfd, LDW_M16R30_ARG | ((26 - i) << 16), loc + 4);
-	      loc += 8;
-	    }
-	  else if (!strncmp (entry->root.string + 3 * i + 2, "GD", 2))
-	    {
-	      bfd_put_32 (stub_bfd, STW_ARG_M12R30 | ((26 - i) << 16), loc);
-	      bfd_put_32 (stub_bfd, STW_ARG_M16R30 | ((25 - i) << 16), loc + 4);
-	      bfd_put_32 (stub_bfd, FLDD_M16R30_FARG | (5 + i), loc + 8);
-	      loc += 12;
-	    }
-	  else if (!strncmp (entry->root.string + 3 * i + 2, "DG", 2))
-	    {
-	      bfd_put_32 (stub_bfd, FSTD_FARG_M16R30 | (5 + i), loc);
-	      bfd_put_32 (stub_bfd, LDW_M12R30_ARG | ((26 - i) << 16), loc + 4);
-	      bfd_put_32 (stub_bfd, LDW_M16R30_ARG | ((25 - i) << 16), loc + 8);
-	      loc += 12;
-	    }
-	}
-
-      /* Load the high bits of the target address into %r1.  */
-      insn = hppa_rebuild_insn (stub_bfd, LDIL_R1,
-				hppa_field_adjust (sym_value, 0, e_lrsel), 21);
-      bfd_put_32 (stub_bfd, insn, loc);
-      loc += 4;
-
-      /* If we are relocating a return value, then we're going to have
-	 to return into the stub, then perform the return value relocation.  */
-      if (strncmp (entry->root.string + 14, "NO", 2))
-	{
-	  /* To return to the stub we "ble" to the target and copy the return
-	     pointer from %r31 into %r2.  */
-	  insn = hppa_rebuild_insn (stub_bfd,
-				    BLE_SR4_R1,
-				    hppa_field_adjust (sym_value, 0,
-						       e_rrsel) >> 2,
-				    17);
-	  bfd_put_32 (stub_bfd, insn, loc);
-	  bfd_put_32 (stub_bfd, COPY_R31_R2, loc + 4);
-
-	  /* Reload the return pointer for our caller from the stack.  */
-	  bfd_put_32 (stub_bfd, LDW_M8R30_R31, loc + 8);
-	  loc += 12;
-
-	  /* Perform the return value relocation.  */
-	  if (!strncmp (entry->root.string + 14, "GF", 2))
-	    {
-	      bfd_put_32 (stub_bfd, STW_ARG_M16R30 | (28 << 16), loc);
-	      bfd_put_32 (stub_bfd, FLDW_M16R30_FARG | 4, loc + 4);
-	      loc += 8;
-	    }
-	  else if (!strncmp (entry->root.string + 14, "FG", 2))
-	    {
-	      bfd_put_32 (stub_bfd, FSTW_FARG_M16R30 | 4, loc);
-	      bfd_put_32 (stub_bfd, LDW_M16R30_ARG | (28 << 16), loc + 4);
-	      loc += 8;
-	    }
-	  else if (!strncmp (entry->root.string + 2, "GD", 2))
-	    {
-	      bfd_put_32 (stub_bfd, STW_ARG_M12R30 | (28 << 16), loc);
-	      bfd_put_32 (stub_bfd, STW_ARG_M16R30 | (29 << 16), loc + 4);
-	      bfd_put_32 (stub_bfd, FLDD_M16R30_FARG | 4, loc + 8);
-	      loc += 12;
-	    }
-	  else if (!strncmp (entry->root.string + 2, "DG", 2))
-	    {
-	      bfd_put_32 (stub_bfd, FSTD_FARG_M16R30 | 4, loc);
-	      bfd_put_32 (stub_bfd, LDW_M12R30_ARG | (28 << 16), loc + 4);
-	      bfd_put_32 (stub_bfd, LDW_M16R30_ARG | (29 << 16), loc + 8);
-	      loc += 12;
-	    }
-	  /* Branch back to the user's code now.  */
-	  bfd_put_32 (stub_bfd, BV_N_0_R31, loc);
-	  loc += 4;
-	}
-      else
-	{
-	  /* No return value relocation, so we can simply "be" to the
-	     target and copy out return pointer into %r2.  */
-	  insn = hppa_rebuild_insn (stub_bfd, BE_SR4_R1,
-				    hppa_field_adjust (sym_value, 0,
-						       e_rrsel) >> 2, 17);
-	  bfd_put_32 (stub_bfd, insn, loc);
-	  bfd_put_32 (stub_bfd, COPY_R31_R2, loc + 4);
-	  loc += 8;
-	}
-
-      /* Update the location and offsets.  */
-      stub_hash_table->location += (loc - begin_loc);
-      stub_hash_table->offset += (loc - begin_loc);
-    }
-  else
+  if (1)
     {
       /* Create one of two variant long branch stubs.  One for $$dyncall and
 	 normal calls, the other for calls to millicode.  */
@@ -2498,17 +981,15 @@
 boolean
 elf32_hppa_size_stubs (stub_bfd, output_bfd, link_info)
      bfd *stub_bfd;
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *link_info;
 {
   bfd *input_bfd;
   asection *section, *stub_sec = 0;
   Elf_Internal_Shdr *symtab_hdr;
-  Elf_Internal_Sym *local_syms, *isym, **all_local_syms;
-  Elf32_External_Sym *ext_syms, *esym;
+  Elf_Internal_Sym *local_syms, **all_local_syms;
   unsigned int i, index, bfd_count = 0;
   struct elf32_hppa_stub_hash_table *stub_hash_table = 0;
-  struct elf32_hppa_args_hash_table *args_hash_table = 0;
 
   /* Create and initialize the stub hash table.  */
   stub_hash_table = ((struct elf32_hppa_stub_hash_table *)
@@ -2520,19 +1001,8 @@
 					elf32_hppa_stub_hash_newfunc))
     goto error_return;
 
-  /* Likewise for the argument location hash table.  */
-  args_hash_table = ((struct elf32_hppa_args_hash_table *)
-		     bfd_malloc (sizeof (struct elf32_hppa_args_hash_table)));
-  if (!args_hash_table)
-    goto error_return;
-
-  if (!elf32_hppa_args_hash_table_init (args_hash_table,
-					elf32_hppa_args_hash_newfunc))
-    goto error_return;
-
   /* Attach the hash tables to the main hash table.  */
   elf32_hppa_hash_table(link_info)->stub_hash_table = stub_hash_table;
-  elf32_hppa_hash_table(link_info)->args_hash_table = args_hash_table;
 
   /* Count the number of input BFDs.  */
   for (input_bfd = link_info->input_bfds;
@@ -2540,88 +1010,6 @@
        input_bfd = input_bfd->link_next)
      bfd_count++;
 
-  /* We want to read in symbol extension records only once.  To do this
-     we need to read in the local symbols in parallel and save them for
-     later use; so hold pointers to the local symbols in an array.  */
-  all_local_syms
-    = (Elf_Internal_Sym **) bfd_malloc (sizeof (Elf_Internal_Sym *)
-					* bfd_count);
-  if (all_local_syms == NULL)
-    goto error_return;
-  memset (all_local_syms, 0, sizeof (Elf_Internal_Sym *) * bfd_count);
-
-  /* Walk over all the input BFDs adding entries to the args hash table
-     for all the external functions.  */
-  for (input_bfd = link_info->input_bfds, index = 0;
-       input_bfd != NULL;
-       input_bfd = input_bfd->link_next, index++)
-    {
-      /* We'll need the symbol table in a second.  */
-      symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
-      if (symtab_hdr->sh_info == 0)
-	continue;
-
-      /* We need an array of the local symbols attached to the input bfd.
-	 Unfortunately, we're going to have to read & swap them in.  */
-      local_syms
-	= (Elf_Internal_Sym *) bfd_malloc (symtab_hdr->sh_info
-					   * sizeof (Elf_Internal_Sym));
-      if (local_syms == NULL)
-	{
-	  for (i = 0; i < bfd_count; i++)
-	    if (all_local_syms[i])
-	      free (all_local_syms[i]);
-	  free (all_local_syms);
-	  goto error_return;
-	}
-      all_local_syms[index] = local_syms;
-
-      ext_syms
-	= (Elf32_External_Sym *) bfd_malloc (symtab_hdr->sh_info
-					     * sizeof (Elf32_External_Sym));
-      if (ext_syms == NULL)
-	{
-	  for (i = 0; i < bfd_count; i++)
-	    if (all_local_syms[i])
-	      free (all_local_syms[i]);
-	  free (all_local_syms);
-	  goto error_return;
-	}
-
-      if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
-	  || bfd_read (ext_syms, 1,
-		       (symtab_hdr->sh_info
-			* sizeof (Elf32_External_Sym)), input_bfd)
-	  != (symtab_hdr->sh_info * sizeof (Elf32_External_Sym)))
-	{
-	  for (i = 0; i < bfd_count; i++)
-	    if (all_local_syms[i])
-	      free (all_local_syms[i]);
-	  free (all_local_syms);
-	  free (ext_syms);
-	  goto error_return;
-	}
-
-      /* Swap the local symbols in.  */
-      isym = local_syms;
-      esym = ext_syms;
-      for (i = 0; i < symtab_hdr->sh_info; i++, esym++, isym++)
-	 bfd_elf32_swap_symbol_in (input_bfd, esym, isym);
-
-      /* Now we can free the external symbols.  */
-      free (ext_syms);
-
-      if (elf32_hppa_read_symext_info (input_bfd, symtab_hdr, args_hash_table,
-				       local_syms) == false)
-	{
-	  for (i = 0; i < bfd_count; i++)
-	    if (all_local_syms[i])
-	      free (all_local_syms[i]);
-	  free (all_local_syms);
-	  goto error_return;
-	}
-    }
-
   /* Magic as we know the stub bfd only has one section.  */
   stub_sec = stub_bfd->sections;
 
@@ -2721,11 +1109,10 @@
 	  irelaend = irela + section->reloc_count;
 	  for (; irela < irelaend; irela++)
 	    {
-	      long r_type, callee_args, caller_args, size_of_stub;
+	      long r_type, size_of_stub;
 	      unsigned long r_index;
 	      struct elf_link_hash_entry *hash;
 	      struct elf32_hppa_stub_hash_entry *stub_hash;
-	      struct elf32_hppa_args_hash_entry *args_hash;
 	      Elf_Internal_Sym *sym;
 	      asection *sym_sec;
 	      const char *sym_name;
@@ -2821,24 +1208,6 @@
 		    }
 		}
 
-	      args_hash = elf32_hppa_args_hash_lookup (args_hash_table,
-						       sym_name, false, false);
-
-	      /* Get both caller and callee argument information.  */
-	      if (args_hash == NULL)
-		callee_args = 0;
-	      else
-		callee_args = args_hash->arg_bits;
-
-	      /* For calls get the caller's bits from the addend of
-		 the call relocation.  For PLABELS the caller's bits
-		 are assumed to have all args & return values in general
-		 registers (0x155).  */
-	      if (r_type == R_PARISC_PCREL17F)
-		caller_args = HPPA_R_ARG_RELOC (irela->r_addend);
-	      else
-		caller_args = 0x155;
-
 	      /* Now determine where the call point is.  */
 	      location = (section->output_offset
 			  + section->output_section->vma
@@ -2851,9 +1220,7 @@
 
 	      /* Determine what (if any) linker stub is needed and its
 		 size (in bytes).  */
-	      size_of_stub = elf32_hppa_size_of_stub (callee_args,
-						      caller_args,
-						      location,
+	      size_of_stub = elf32_hppa_size_of_stub (location,
 						      destination,
 						      sym_name);
 	      if (size_of_stub != 0)
@@ -2880,8 +1247,7 @@
 		      free (all_local_syms);
 		      goto error_return;
 		    }
-		  elf32_hppa_name_of_stub (caller_args, callee_args,
-					   location, destination, stub_name);
+		  elf32_hppa_name_of_stub (location, destination, stub_name);
 		  strcat (stub_name + 22, sym_name);
 
 		  /* Because sym_name was malloced above for local symbols.  */
@@ -2945,11 +1311,6 @@
       elf32_hppa_hash_table(link_info)->stub_hash_table = NULL;
       free (stub_hash_table);
     }
-  if (args_hash_table)
-    {
-      elf32_hppa_hash_table(link_info)->args_hash_table = NULL;
-      free (args_hash_table);
-    }
   /* Set the size of the stub section to zero since we're never going
      to create them.   Avoids losing when we try to get its contents
      too.  */
@@ -2960,22 +1321,12 @@
 /* Misc BFD support code.  */
 #define bfd_elf32_bfd_reloc_type_lookup		elf_hppa_reloc_type_lookup
 #define bfd_elf32_bfd_is_local_label_name	hppa_elf_is_local_label_name
-
-/* Symbol extension stuff.  */
-#define bfd_elf32_set_section_contents		elf32_hppa_set_section_contents
-#define elf_info_to_howto			elf32_hppa_info_to_howto
-#define elf_backend_symbol_table_processing \
-  elf32_hppa_backend_symbol_table_processing
-#define elf_backend_begin_write_processing \
-  elf32_hppa_backend_begin_write_processing
-#define elf_backend_final_write_processing \
-  elf32_hppa_backend_final_write_processing
+#define elf_info_to_howto               	elf_hppa_info_to_howto
+#define elf_info_to_howto_rel           	elf_hppa_info_to_howto_rel
 
 /* Stuff for the BFD linker.  */
 #define elf_backend_relocate_section		elf32_hppa_relocate_section
 #define elf_backend_add_symbol_hook		elf32_hppa_add_symbol_hook
-#define elf_backend_link_output_symbol_hook \
-  elf32_hppa_link_output_symbol_hook
 #define bfd_elf32_bfd_link_hash_table_create \
   elf32_hppa_link_hash_table_create
 
diff --git a/bfd/elf32-hppa.h b/bfd/elf32-hppa.h
index b233920..2d99aa8 100644
--- a/bfd/elf32-hppa.h
+++ b/bfd/elf32-hppa.h
@@ -35,32 +35,26 @@
 #include "libhppa.h"
 #include "elf/hppa.h"
 
-#define ELF_HOWTO_TABLE_SIZE	R_PARISC_UNIMPLEMENTED + 1
-#define N_PARISC_RELOCS		R_PARISC_UNIMPLEMENTED + 1
-
-/* Define groups of basic relocations.  FIXME:  These should
-   be the only basic relocations created by GAS.  The rest
-   should be internal to the BFD backend.  
-
-   The idea is both SOM and ELF define these basic relocation
-   types so they map into a SOM or ELF specific relocation 
-   as appropriate.  This allows GAS to share much more code
-   between the two target object formats.  */
-
-#define R_HPPA_NONE			R_PARISC_NONE
-#define	R_HPPA				R_PARISC_DIR32
-#define	R_HPPA_GOTOFF			R_PARISC_DPREL21L
-#define	R_HPPA_PCREL_CALL		R_PARISC_PCREL21L
-#define R_HPPA_ABS_CALL			R_PARISC_DIR17F
-#define R_HPPA_COMPLEX			R_PARISC_UNIMPLEMENTED
-
-elf32_hppa_reloc_type ** hppa_elf_gen_reloc_type
-  PARAMS ((bfd *, elf32_hppa_reloc_type, int, int, int, asymbol *));
-
 boolean elf32_hppa_size_stubs
   PARAMS ((bfd *, bfd *, struct bfd_link_info *));
 
 boolean elf32_hppa_build_stubs
   PARAMS ((bfd *, struct bfd_link_info *));
 
+/* Define groups of basic relocations.  FIXME:  These should
+   be the only basic relocations created by GAS.  The rest
+   should be internal to the BFD backend.
+
+   The idea is both SOM and ELF define these basic relocation
+   types so they map into a SOM or ELF specific relocation
+   as appropriate.  This allows GAS to share much more code
+   between the two target object formats.  */
+
+#define R_HPPA_NONE			R_PARISC_NONE
+#define R_HPPA				R_PARISC_DIR32
+#define R_HPPA_GOTOFF			R_PARISC_DPREL21L
+#define R_HPPA_PCREL_CALL		R_PARISC_PCREL21L
+#define R_HPPA_ABS_CALL			R_PARISC_DIR17F
+#define R_HPPA_COMPLEX			R_PARISC_UNIMPLEMENTED
+
 #endif /* _ELF32_HPPA_H */
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 830c680..0790af5 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1,5 +1,5 @@
 /* Intel 80386/80486-specific support for 32-bit ELF
-   Copyright 1993-1998, 1999 Free Software Foundation, Inc.
+   Copyright 1993, 94-98, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -67,20 +67,20 @@
   HOWTO(R_386_RELATIVE,  0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_RELATIVE", true,0xffffffff,0xffffffff,false),
   HOWTO(R_386_GOTOFF,    0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTOFF",   true,0xffffffff,0xffffffff,false),
   HOWTO(R_386_GOTPC,     0,2,32,true,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTPC",    true,0xffffffff,0xffffffff,true),
-  { 11 },
-  { 12 },
-  { 13 },
-  { 14 },
-  { 15 },
-  { 16 },
-  { 17 },
-  { 18 },
-  { 19 },
+  EMPTY_HOWTO (11),
+  EMPTY_HOWTO (12),
+  EMPTY_HOWTO (13),
+  EMPTY_HOWTO (14),
+  EMPTY_HOWTO (15),
+  EMPTY_HOWTO (16),
+  EMPTY_HOWTO (17),
+  EMPTY_HOWTO (18),
+  EMPTY_HOWTO (19),
   /* The remaining relocs are a GNU extension.  */
   HOWTO(R_386_16,	 0,1,16,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_16",	    true,0xffff,0xffff,false),
   HOWTO(R_386_PC16,	 0,1,16,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC16",	    true,0xffff,0xffff,true),
   HOWTO(R_386_8,	 0,0,8,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_8",	    true,0xff,0xff,false),
-  HOWTO(R_386_PC8,	 0,0,8,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC8",	    true,0xff,0xff,true),
+  HOWTO(R_386_PC8,	 0,0,8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc,"R_386_PC8",	    true,0xff,0xff,true),
 };
 
 /* GNU extension to record C++ vtable hierarchy.  */
@@ -123,7 +123,7 @@
 
 static reloc_howto_type *
 elf_i386_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   switch (code)
@@ -211,16 +211,16 @@
 
 static void
 elf_i386_info_to_howto (abfd, cache_ptr, dst)
-     bfd		*abfd;
-     arelent		*cache_ptr;
-     Elf32_Internal_Rela *dst;
+     bfd		*abfd ATTRIBUTE_UNUSED;
+     arelent		*cache_ptr ATTRIBUTE_UNUSED;
+     Elf32_Internal_Rela *dst ATTRIBUTE_UNUSED;
 {
   abort ();
 }
 
 static void
 elf_i386_info_to_howto_rel (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf32_Internal_Rel *dst;
 {
@@ -714,7 +714,7 @@
 static asection *
 elf_i386_gc_mark_hook (abfd, info, rel, h, sym)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      Elf_Internal_Rela *rel;
      struct elf_link_hash_entry *h;
      Elf_Internal_Sym *sym;
@@ -760,10 +760,10 @@
 
 static boolean
 elf_i386_gc_sweep_hook (abfd, info, sec, relocs)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     asection *sec;
-     const Elf_Internal_Rela *relocs;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
 {
   /* ??? It would seem that the existing i386 code does no sort
      of reference counting or whatnot on its GOT and PLT entries,
@@ -1139,7 +1139,7 @@
 static boolean
 elf_i386_discard_copies (h, ignore)
      struct elf_i386_link_hash_entry *h;
-     PTR ignore;
+     PTR ignore ATTRIBUTE_UNUSED;
 {
   struct elf_i386_pcrel_relocs_copied *s;
 
diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c
index a8537a7..6a2d2d9 100644
--- a/bfd/elf32-i860.c
+++ b/bfd/elf32-i860.c
@@ -25,9 +25,10 @@
 #define bfd_elf32_bfd_reloc_type_lookup	bfd_default_reloc_type_lookup
 #define elf_info_to_howto		_bfd_elf_no_info_to_howto
 
-#define TARGET_BIG_SYM	bfd_elf32_i860_vec
-#define TARGET_BIG_NAME "elf32-i860"
-#define ELF_ARCH	bfd_arch_i860
+#define TARGET_BIG_SYM	 bfd_elf32_i860_vec
+#define TARGET_BIG_NAME  "elf32-i860"
+#define ELF_ARCH	 bfd_arch_i860
 #define ELF_MACHINE_CODE EM_860
+#define ELF_MAXPAGESIZE  1 /* FIXME: This number is wrong,  It should be the page size in bytes.  */
 
 #include "elf32-target.h"
diff --git a/bfd/elf32-i960.c b/bfd/elf32-i960.c
new file mode 100644
index 0000000..839fc3d
--- /dev/null
+++ b/bfd/elf32-i960.c
@@ -0,0 +1,168 @@
+/* Intel 860 specific support for 32-bit ELF
+   Copyright 1999 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 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 "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/i960.h"
+
+static bfd_reloc_status_type elf32_i960_relocate
+  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static reloc_howto_type *elf32_i960_reloc_type_lookup
+  PARAMS ((bfd *, bfd_reloc_code_real_type));
+
+#define USE_REL 1
+
+#define bfd_elf32_bfd_reloc_type_lookup	elf32_i960_reloc_type_lookup
+#define elf_info_to_howto		elf32_i960_info_to_howto
+#define elf_info_to_howto_rel		elf32_i960_info_to_howto_rel
+
+static reloc_howto_type elf_howto_table[]=
+{
+  HOWTO(R_960_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield,
+	elf32_i960_relocate, "R_960_NONE", true,
+	0x00000000, 0x00000000, false),
+  EMPTY_HOWTO (1),
+  HOWTO (R_960_32, 0, 2, 32, false, 0, complain_overflow_bitfield,
+	elf32_i960_relocate, "R_960_32", true,
+	0xffffffff, 0xffffffff, false),
+  HOWTO (R_960_IP24, 0, 2, 24, true, 0, complain_overflow_signed,
+	elf32_i960_relocate, "R_960_IP24 ", true,
+	0x00ffffff, 0x00ffffff, false),
+  EMPTY_HOWTO (4),
+  EMPTY_HOWTO (5),
+  EMPTY_HOWTO (6),
+  EMPTY_HOWTO (7)
+};
+
+static enum elf_i960_reloc_type
+elf32_i960_bfd_to_reloc_type (bfd_reloc_code_real_type code)
+{
+  switch (code)
+    {
+    default:
+      return R_960_NONE;
+    case BFD_RELOC_I960_CALLJ:
+      return R_960_OPTCALL;
+    case BFD_RELOC_32:
+    case BFD_RELOC_CTOR:
+      return R_960_32;
+    case BFD_RELOC_24_PCREL:
+      return R_960_IP24;
+    }
+}
+
+static void
+elf32_i960_info_to_howto (abfd, cache_ptr, dst)
+     bfd		*abfd ATTRIBUTE_UNUSED;
+     arelent		*cache_ptr ATTRIBUTE_UNUSED;
+     Elf32_Internal_Rela *dst ATTRIBUTE_UNUSED;
+{
+  abort ();
+}
+
+static void
+elf32_i960_info_to_howto_rel (abfd, cache_ptr, dst)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *cache_ptr;
+     Elf32_Internal_Rel *dst;
+{
+  enum elf_i960_reloc_type type;
+
+  type = (enum elf_i960_reloc_type) ELF32_R_TYPE (dst->r_info);
+  BFD_ASSERT (type < R_960_max);
+
+  cache_ptr->howto = &elf_howto_table[(int) type];
+}
+
+/* ELF relocs are against symbols.  If we are producing relocateable
+   output, and the reloc is against an external symbol, and nothing
+   has given us any additional addend, the resulting reloc will also
+   be against the same symbol.  In such a case, we don't want to
+   change anything about the way the reloc is handled, since it will
+   all be done at final link time.  Rather than put special case code
+   into bfd_perform_relocation, all the reloc types use this howto
+   function.  It just short circuits the reloc if producing
+   relocateable output against an external symbol.  */
+
+/*ARGSUSED*/
+bfd_reloc_status_type
+elf32_i960_relocate (abfd,
+		       reloc_entry,
+		       symbol,
+		       data,
+		       input_section,
+		       output_bfd,
+		       error_message)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry;
+     asymbol *symbol;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section;
+     bfd *output_bfd;
+     char **error_message ATTRIBUTE_UNUSED;
+{
+  /* HACK: I think this first condition is necessary when producing
+     relocatable output.  After the end of HACK, the code is identical
+     to bfd_elf_generic_reloc().  I would _guess_ the first change
+     belongs there rather than here.  martindo 1998-10-23.  */
+  if (output_bfd != (bfd *) NULL
+      && reloc_entry->howto->pc_relative
+      && !reloc_entry->howto->pcrel_offset)
+    {
+      reloc_entry->addend -= symbol->value;
+    }
+  /* This is more dubious. */
+  else if (output_bfd != (bfd *) NULL
+	   && (symbol->flags & BSF_SECTION_SYM) != 0)
+    {
+      reloc_entry->addend -= symbol->section->output_section->vma;
+    }
+  else
+    {
+      /* end of HACK */
+      if (output_bfd != (bfd *) NULL
+	  && (symbol->flags & BSF_SECTION_SYM) == 0
+	  && (! reloc_entry->howto->partial_inplace
+	      || reloc_entry->addend == 0))
+	{
+	  reloc_entry->address += input_section->output_offset;
+	  return bfd_reloc_ok;
+	}
+    }
+
+  return bfd_reloc_continue;
+}
+
+static reloc_howto_type *
+elf32_i960_reloc_type_lookup (abfd, code)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     bfd_reloc_code_real_type code;
+{
+  return elf_howto_table + elf32_i960_bfd_to_reloc_type (code);
+}
+
+#define TARGET_LITTLE_SYM	bfd_elf32_i960_vec
+#define TARGET_LITTLE_NAME	"elf32-i960"
+#define ELF_ARCH		bfd_arch_i960
+#define ELF_MACHINE_CODE	EM_960
+#define ELF_MAXPAGESIZE  	1 /* FIXME: This number is wrong,  It should be the page size in bytes.  */
+
+#include "elf32-target.h"
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index b2f8523..6bda8de 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -301,7 +301,7 @@
      PTR data;
      asection * input_section;
      bfd * output_bfd;
-     char ** error_message;
+     char ** error_message ATTRIBUTE_UNUSED;
 {
   /* This part is from bfd_elf_generic_reloc.  */
   if (output_bfd != (bfd *) NULL
@@ -339,7 +339,7 @@
      asection *input_section;
      bfd_byte *data;
      bfd_vma offset;
-     asection *symbol_section;
+     asection *symbol_section ATTRIBUTE_UNUSED;
      bfd_vma symbol_value;
      bfd_vma addend;
 {
@@ -403,13 +403,13 @@
 static bfd_reloc_status_type
 m32r_elf_hi16_reloc (abfd, reloc_entry, symbol, data,
 		     input_section, output_bfd, error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_reloc_status_type ret;
   bfd_vma relocation;
@@ -558,13 +558,13 @@
 static bfd_reloc_status_type
 m32r_elf_sda16_reloc (abfd, reloc_entry, symbol, data,
 		      input_section, output_bfd, error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
-     PTR data;
+     PTR data ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   /* This part is from bfd_elf_generic_reloc.  */
   if (output_bfd != (bfd *) NULL
@@ -614,7 +614,7 @@
 
 static reloc_howto_type *
 bfd_elf32_bfd_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -634,7 +634,7 @@
 
 static void
 m32r_info_to_howto_rel (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf32_Internal_Rel *dst;
 {
@@ -650,8 +650,8 @@
 
 boolean
 _bfd_m32r_elf_section_from_bfd_section (abfd, hdr, sec, retval)
-     bfd *abfd;
-     Elf32_Internal_Shdr *hdr;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     Elf32_Internal_Shdr *hdr ATTRIBUTE_UNUSED;
      asection *sec;
      int *retval;
 {
@@ -677,7 +677,7 @@
 
 void
 _bfd_m32r_elf_symbol_processing (abfd, asym)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asymbol *asym;
 {
   elf_symbol_type *elfsym;
@@ -717,7 +717,7 @@
      struct bfd_link_info *info;
      const Elf_Internal_Sym *sym;
      const char **namep;
-     flagword *flagsp;
+     flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
      bfd_vma *valp;
 {
@@ -850,7 +850,7 @@
 static boolean
 m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 			   contents, relocs, local_syms, local_sections)
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
      bfd *input_bfd;
      asection *input_section;
@@ -1801,7 +1801,7 @@
 static void
 m32r_elf_final_write_processing (abfd, linker)
      bfd *   abfd;
-     boolean linker;
+     boolean linker ATTRIBUTE_UNUSED;
 {
   unsigned long val;
 
@@ -1936,7 +1936,7 @@
 asection *
 m32r_elf_gc_mark_hook (abfd, info, rel, h, sym)
        bfd *abfd;
-       struct bfd_link_info *info;
+       struct bfd_link_info *info ATTRIBUTE_UNUSED;
        Elf_Internal_Rela *rel;
        struct elf_link_hash_entry *h;
        Elf_Internal_Sym *sym;
@@ -1958,6 +1958,9 @@
  
           case bfd_link_hash_common:
             return h->root.u.c.p->section;
+
+	  default:
+	    break;
           }
        }
      }
@@ -1976,10 +1979,10 @@
 
 static boolean
 m32r_elf_gc_sweep_hook (abfd, info, sec, relocs)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     asection *sec;
-     const Elf_Internal_Rela *relocs;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
 {
   /* we don't use got and plt entries for m32r */
   return true;
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 2d0aba2..709057b 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -43,8 +43,6 @@
 	   const Elf_Internal_Rela *));
 static boolean elf_m68k_adjust_dynamic_symbol
   PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-static boolean elf_m68k_adjust_dynindx
-  PARAMS ((struct elf_link_hash_entry *, PTR));
 static boolean elf_m68k_size_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
 static boolean elf_m68k_relocate_section
@@ -56,6 +54,15 @@
 static boolean elf_m68k_finish_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
 
+static boolean elf32_m68k_set_private_flags
+  PARAMS ((bfd *, flagword));
+static boolean elf32_m68k_copy_private_bfd_data
+  PARAMS ((bfd *, bfd *));
+static boolean elf32_m68k_merge_private_bfd_data
+  PARAMS ((bfd *, bfd *));
+static boolean elf32_m68k_print_private_bfd_data
+  PARAMS ((bfd *, PTR));
+
 static reloc_howto_type howto_table[] = {
   HOWTO(R_68K_NONE,       0, 0, 0, false,0, complain_overflow_dont,     bfd_elf_generic_reloc, "R_68K_NONE",      false, 0, 0x00000000,false),
   HOWTO(R_68K_32,         0, 2,32, false,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_32",        false, 0, 0xffffffff,false),
@@ -112,7 +119,7 @@
 
 static void
 rtype_to_howto (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf_Internal_Rela *dst;
 {
@@ -157,7 +164,7 @@
 
 static reloc_howto_type *
 reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -211,6 +218,33 @@
   0, 0, 0, 0		  /* replaced with offset to start of .plt.  */
 };
 
+#define CPU32_FLAG(abfd)  (elf_elfheader (abfd)->e_flags & EF_CPU32)
+
+#define PLT_CPU32_ENTRY_SIZE 24
+/* Procedure linkage table entries for the cpu32 */
+static const bfd_byte elf_cpu32_plt0_entry[PLT_CPU32_ENTRY_SIZE] =
+{
+  0x20, 0x7b, 0x01, 0x70, /* moveal %pc@(0xc), %a0 */
+  0, 0, 0, 0,             /* replaced with offset to .got + 4.  */
+  0x4e, 0xd0,             /* jmp %a0@ */
+  0, 0, 0, 0,             /* replace with offset to .got +8. */
+  0, 0, 0, 0,             /* pad out to 24 bytes.  */
+  0, 0, 0, 0,             /* pad out to 24 bytes.  */
+  0, 0
+};
+
+static const bfd_byte elf_cpu32_plt_entry[PLT_CPU32_ENTRY_SIZE] =
+{
+  0x20, 0x7b, 0x01, 0x70,  /* moveal %pc@(0xc), %a0 */
+  0, 0, 0, 0,              /* replaced with offset to symbol's .got entry.  */
+  0x4e, 0xd0,              /* jmp %a0@ */
+  0x2f, 0x3c,              /* move.l #offset,-(%sp) */
+  0, 0, 0, 0,              /* replaced with offset into relocation table.  */
+  0x60, 0xff,              /* bra.l .plt */
+  0, 0, 0, 0,              /* replaced with offset to start of .plt.  */
+  0, 0
+};
+
 /* The m68k linker needs to keep track of the number of relocs that it
    decides to copy in check_relocs for each symbol.  This is so that it
    can discard PC relative relocs if it doesn't need them when linking
@@ -320,6 +354,88 @@
   return &ret->root.root;
 }
 
+/* Keep m68k-specific flags in the ELF header */
+static boolean
+elf32_m68k_set_private_flags (abfd, flags)
+     bfd *abfd;
+     flagword flags;
+{
+  elf_elfheader (abfd)->e_flags = flags;
+  elf_flags_init (abfd) = true;
+  return true;
+}
+
+/* Copy m68k-specific data from one module to another */
+static boolean
+elf32_m68k_copy_private_bfd_data (ibfd, obfd)
+     bfd *ibfd;
+     bfd *obfd;
+{
+  flagword in_flags;
+
+  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+    return true;
+ 
+  in_flags = elf_elfheader (ibfd)->e_flags;
+ 
+  elf_elfheader (obfd)->e_flags = in_flags;
+  elf_flags_init (obfd) = true;
+ 
+  return true;
+}
+
+/* Merge backend specific data from an object file to the output
+   object file when linking.  */
+static boolean
+elf32_m68k_merge_private_bfd_data (ibfd, obfd)
+     bfd *ibfd;
+     bfd *obfd;
+{
+  flagword out_flags;
+  flagword in_flags;
+
+  if (   bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+    return true;
+
+  in_flags  = elf_elfheader (ibfd)->e_flags;
+  out_flags = elf_elfheader (obfd)->e_flags;
+
+  if (!elf_flags_init (obfd))
+    {
+      elf_flags_init (obfd) = true;
+      elf_elfheader (obfd)->e_flags = in_flags;
+    }
+
+  return true;
+}
+
+/* Display the flags field */
+static boolean
+elf32_m68k_print_private_bfd_data (abfd, ptr)
+     bfd *abfd;
+     PTR ptr;
+{
+  FILE *file = (FILE *) ptr;
+
+  BFD_ASSERT (abfd != NULL && ptr != NULL);
+
+  /* Print normal ELF private data.  */
+  _bfd_elf_print_private_bfd_data (abfd, ptr);
+
+  /* Ignore init flag - it may not be set, despite the flags field containing valid data.  */
+
+  /* xgettext:c-format */
+  fprintf (file, _ ("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
+
+  if (elf_elfheader (abfd)->e_flags & EF_CPU32)
+    fprintf (file, _ (" [cpu32]"));
+
+  fputc ('\n', file);
+
+  return true;
+}
 /* Look through the relocs for a section during the first phase, and
    allocate space in the global offset table or procedure linkage
    table.  */
@@ -673,7 +789,7 @@
 static asection *
 elf_m68k_gc_mark_hook (abfd, info, rel, h, sym)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      Elf_Internal_Rela *rel;
      struct elf_link_hash_entry *h;
      Elf_Internal_Sym *sym;
@@ -890,7 +1006,12 @@
       /* If this is the first .plt entry, make room for the special
 	 first entry.  */
       if (s->_raw_size == 0)
-	s->_raw_size += PLT_ENTRY_SIZE;
+	{
+	  if (CPU32_FLAG (dynobj))
+	    s->_raw_size += PLT_CPU32_ENTRY_SIZE;
+	  else
+	    s->_raw_size += PLT_ENTRY_SIZE;
+	}
 
       /* If this symbol is not defined in a regular file, and we are
 	 not generating a shared library, then set the symbol to this
@@ -907,7 +1028,10 @@
       h->plt.offset = s->_raw_size;
 
       /* Make room for this entry.  */
-      s->_raw_size += PLT_ENTRY_SIZE;
+      if (CPU32_FLAG (dynobj))
+        s->_raw_size += PLT_CPU32_ENTRY_SIZE;
+      else
+        s->_raw_size += PLT_ENTRY_SIZE;
 
       /* We also need to make an entry in the .got.plt section, which
 	 will be placed in the .got section by the linker script.  */
@@ -1186,51 +1310,6 @@
 	}
     }
 
-  /* If we are generating a shared library, we generate a section
-     symbol for each output section for which we might need to copy
-     relocs.  These are local symbols, which means that they must come
-     first in the dynamic symbol table.  That means we must increment
-     the dynamic symbol index of every other dynamic symbol.  */
-  if (info->shared)
-    {
-      int c;
-
-      c = 0;
-      for (s = output_bfd->sections; s != NULL; s = s->next)
-	{
-	  if ((s->flags & SEC_LINKER_CREATED) != 0
-	      || (s->flags & SEC_ALLOC) == 0)
-	    continue;
-
-	  elf_section_data (s)->dynindx = c + 1;
-
-	  /* These symbols will have no names, so we don't need to
-             fiddle with dynstr_index.  */
-
-	  ++c;
-	}
-
-      elf_link_hash_traverse (elf_hash_table (info),
-			      elf_m68k_adjust_dynindx,
-			      (PTR) &c);
-      elf_hash_table (info)->dynsymcount += c;
-    }
-
-  return true;
-}
-
-/* Increment the index of a dynamic symbol by a given amount.  Called
-   via elf_link_hash_traverse.  */
-
-static boolean
-elf_m68k_adjust_dynindx (h, cparg)
-     struct elf_link_hash_entry *h;
-     PTR cparg;
-{
-  int *cp = (int *) cparg;
-
-  if (h->dynindx != -1)
-    h->dynindx += *cp;
   return true;
 }
 
@@ -1244,7 +1323,7 @@
 static boolean
 elf_m68k_discard_copies (h, ignore)
      struct elf_m68k_link_hash_entry *h;
-     PTR ignore;
+     PTR ignore ATTRIBUTE_UNUSED;
 {
   struct elf_m68k_pcrel_relocs_copied *s;
 
@@ -1776,6 +1855,7 @@
      Elf_Internal_Sym *sym;
 {
   bfd *dynobj;
+  int plt_off1, plt_off2, plt_off3;
 
   dynobj = elf_hash_table (info)->dynobj;
 
@@ -1802,16 +1882,35 @@
 	 corresponds to this symbol.  This is the index of this symbol
 	 in all the symbols for which we are making plt entries.  The
 	 first entry in the procedure linkage table is reserved.  */
-      plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
+      if ( CPU32_FLAG (output_bfd))
+        plt_index = h->plt.offset / PLT_CPU32_ENTRY_SIZE - 1;
+      else
+        plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
 
       /* Get the offset into the .got table of the entry that
 	 corresponds to this function.  Each .got entry is 4 bytes.
 	 The first three are reserved.  */
       got_offset = (plt_index + 3) * 4;
 
-      /* Fill in the entry in the procedure linkage table.  */
-      memcpy (splt->contents + h->plt.offset, elf_m68k_plt_entry,
-	      PLT_ENTRY_SIZE);
+      if ( CPU32_FLAG (output_bfd))
+        {
+          /* Fill in the entry in the procedure linkage table.  */
+          memcpy (splt->contents + h->plt.offset, elf_cpu32_plt_entry,
+	          PLT_CPU32_ENTRY_SIZE);
+          plt_off1 = 4;
+          plt_off2 = 12;
+          plt_off3 = 18;
+        }
+      else
+        {
+          /* Fill in the entry in the procedure linkage table.  */
+          memcpy (splt->contents + h->plt.offset, elf_m68k_plt_entry,
+	          PLT_ENTRY_SIZE);
+          plt_off1 = 4;
+          plt_off2 = 10;
+          plt_off3 = 16;
+        }
+
       /* The offset is relative to the first extension word.  */
       bfd_put_32 (output_bfd,
 		  (sgot->output_section->vma
@@ -1819,12 +1918,12 @@
 		   + got_offset
 		   - (splt->output_section->vma
 		      + h->plt.offset + 2)),
-		  splt->contents + h->plt.offset + 4);
+		  splt->contents + h->plt.offset + plt_off1);
 
       bfd_put_32 (output_bfd, plt_index * sizeof (Elf32_External_Rela),
-		  splt->contents + h->plt.offset + 10);
-      bfd_put_32 (output_bfd, - (h->plt.offset + 16),
-		  splt->contents + h->plt.offset + 16);
+		  splt->contents + h->plt.offset + plt_off2);
+      bfd_put_32 (output_bfd, - (h->plt.offset + plt_off3),
+		  splt->contents + h->plt.offset + plt_off3);
 
       /* Fill in the entry in the global offset table.  */
       bfd_put_32 (output_bfd,
@@ -2017,21 +2116,39 @@
       /* Fill in the first entry in the procedure linkage table.  */
       if (splt->_raw_size > 0)
 	{
-	  memcpy (splt->contents, elf_m68k_plt0_entry, PLT_ENTRY_SIZE);
-	  bfd_put_32 (output_bfd,
-		      (sgot->output_section->vma
-		       + sgot->output_offset + 4
-		       - (splt->output_section->vma + 2)),
-		      splt->contents + 4);
-	  bfd_put_32 (output_bfd,
-		      (sgot->output_section->vma
-		       + sgot->output_offset + 8
-		       - (splt->output_section->vma + 10)),
-		      splt->contents + 12);
+          if (!CPU32_FLAG (output_bfd))
+            {
+	      memcpy (splt->contents, elf_m68k_plt0_entry, PLT_ENTRY_SIZE);
+	      bfd_put_32 (output_bfd,
+		          (sgot->output_section->vma
+		           + sgot->output_offset + 4
+		           - (splt->output_section->vma + 2)),
+		          splt->contents + 4);
+	      bfd_put_32 (output_bfd,
+		          (sgot->output_section->vma
+		           + sgot->output_offset + 8
+		           - (splt->output_section->vma + 10)),
+		          splt->contents + 12);
+              elf_section_data (splt->output_section)->this_hdr.sh_entsize 
+               = PLT_ENTRY_SIZE;
+            }
+          else /* cpu32 */
+            {
+              memcpy (splt->contents, elf_cpu32_plt0_entry, PLT_CPU32_ENTRY_SIZE);
+	      bfd_put_32 (output_bfd,
+		          (sgot->output_section->vma
+		           + sgot->output_offset + 4
+		           - (splt->output_section->vma + 2)),
+		          splt->contents + 4);
+	      bfd_put_32 (output_bfd,
+		          (sgot->output_section->vma
+		           + sgot->output_offset + 8
+		           - (splt->output_section->vma + 10)),
+		          splt->contents + 10);
+              elf_section_data (splt->output_section)->this_hdr.sh_entsize 
+               = PLT_CPU32_ENTRY_SIZE;
+            }
 	}
-
-      elf_section_data (splt->output_section)->this_hdr.sh_entsize
-	= PLT_ENTRY_SIZE;
     }
 
   /* Fill in the first three entries in the global offset table.  */
@@ -2049,50 +2166,6 @@
 
   elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
 
-  if (info->shared)
-    {
-      asection *sdynsym;
-      asection *s;
-      Elf_Internal_Sym sym;
-      int c;
-
-      /* Set up the section symbols for the output sections.  */
-
-      sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
-      BFD_ASSERT (sdynsym != NULL);
-
-      sym.st_size = 0;
-      sym.st_name = 0;
-      sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
-      sym.st_other = 0;
-
-      c = 0;
-      for (s = output_bfd->sections; s != NULL; s = s->next)
-	{
-	  int indx;
-
-	  if (elf_section_data (s)->dynindx == 0)
-	    continue;
-
-	  sym.st_value = s->vma;
-
-	  indx = elf_section_data (s)->this_idx;
-	  BFD_ASSERT (indx > 0);
-	  sym.st_shndx = indx;
-
-	  bfd_elf32_swap_symbol_out (output_bfd, &sym,
-				     (PTR) (((Elf32_External_Sym *)
-					     sdynsym->contents)
-					    + elf_section_data (s)->dynindx));
-
-	  ++c;
-	}
-
-      /* Set the sh_info field of the output .dynsym section to the
-         index of the first global symbol.  */
-      elf_section_data (sdynsym->output_section)->this_hdr.sh_info = c + 1;
-    }
-
   return true;
 }
 
@@ -2118,11 +2191,19 @@
 					elf_m68k_finish_dynamic_sections
 #define elf_backend_gc_mark_hook	elf_m68k_gc_mark_hook
 #define elf_backend_gc_sweep_hook	elf_m68k_gc_sweep_hook
+#define bfd_elf32_bfd_copy_private_bfd_data \
+                                        elf32_m68k_copy_private_bfd_data
+#define bfd_elf32_bfd_merge_private_bfd_data \
+                                        elf32_m68k_merge_private_bfd_data
+#define bfd_elf32_bfd_set_private_flags \
+                                        elf32_m68k_set_private_flags
+#define bfd_elf32_bfd_print_private_bfd_data \
+                                        elf32_m68k_print_private_bfd_data
+
 #define elf_backend_can_gc_sections 1
 #define elf_backend_want_got_plt 1
 #define elf_backend_plt_readonly 1
 #define elf_backend_want_plt_sym 0
 #define elf_backend_got_header_size	12
-#define elf_backend_plt_header_size	PLT_ENTRY_SIZE
 
 #include "elf32-target.h"
diff --git a/bfd/elf32-m88k.c b/bfd/elf32-m88k.c
index f3c535e..20de22a 100644
--- a/bfd/elf32-m88k.c
+++ b/bfd/elf32-m88k.c
@@ -29,6 +29,7 @@
 #define TARGET_BIG_NAME		"elf32-m88k"
 #define ELF_ARCH		bfd_arch_m88k
 #define ELF_MACHINE_CODE	EM_88K
+#define ELF_MAXPAGESIZE  	1 /* FIXME: This number is wrong,  It should be the page size in bytes.  */
 #define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
 #define elf_info_to_howto		_bfd_elf_no_info_to_howto
 
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index ef3a39f..6a8b70a 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -1,4 +1,4 @@
-/* Motorolla MCore specific support for 32-bit ELF
+/* Motorola MCore specific support for 32-bit ELF
    Copyright 1994, 1995, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -57,16 +57,16 @@
   HOWTO (R_MCORE_NONE,		/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
-	 1,			/* bitsize */
-	 true,			/* pc_relative */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_bitfield,  /* complain_on_overflow */
-	 mcore_elf_unsupported_reloc, /* special_function */
+	 NULL,                  /* special_function */
 	 "R_MCORE_NONE",	/* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0,			/* dst_mask */
-	 true),			/* pcrel_offset */
+	 false),		/* pcrel_offset */
 
   /* A standard 32 bit relocation.  */
   HOWTO (R_MCORE_ADDR32,	/* type */
@@ -196,6 +196,20 @@
          0,                     /* src_mask */
          0,                     /* dst_mask */
          false),                /* pcrel_offset */
+  
+  HOWTO (R_MCORE_RELATIVE,      /* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 NULL,                  /* special_function */
+	 "R_MCORE_RELATIVE",    /* name */
+	 true,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 false)			/* pcrel_offset */
 };
 
 #ifndef NUM_ELEM
@@ -223,7 +237,7 @@
 
 static reloc_howto_type *
 mcore_elf_reloc_type_lookup (abfd, code)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   enum elf_mcore_reloc_type mcore_reloc = R_MCORE_NONE;
@@ -239,6 +253,7 @@
     case BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: mcore_reloc = R_MCORE_PCRELJSR_IMM11BY2; break;
     case BFD_RELOC_VTABLE_INHERIT:           mcore_reloc = R_MCORE_GNU_VTINHERIT; break;
     case BFD_RELOC_VTABLE_ENTRY:             mcore_reloc = R_MCORE_GNU_VTENTRY; break;
+    case BFD_RELOC_RVA:                      mcore_reloc = R_MCORE_RELATIVE; break;
     default:
       return (reloc_howto_type *)NULL;
     }
@@ -252,7 +267,7 @@
 /* Set the howto pointer for a RCE ELF reloc.  */
 static void
 mcore_elf_info_to_howto (abfd, cache_ptr, dst)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      arelent * cache_ptr;
      Elf32_Internal_Rela * dst;
 {
@@ -305,7 +320,6 @@
 {
   flagword old_flags;
   flagword new_flags;
-  boolean error;
 
   /* Check if we have the same endianess */
   if (   ibfd->xvec->byteorder != obfd->xvec->byteorder
@@ -335,7 +349,11 @@
     }
   else if (new_flags == old_flags)	/* Compatible flags are ok */
     ;
-  
+  else
+    {
+      /* FIXME */
+    }
+
   return true;
 }
 
@@ -348,11 +366,11 @@
 			   output_bfd, error_message)
      bfd * abfd;
      arelent * reloc_entry;
-     asymbol * symbol;
-     PTR data;
-     asection * input_section;
-     bfd * output_bfd;
-     char ** error_message;
+     asymbol * symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection * input_section ATTRIBUTE_UNUSED;
+     bfd * output_bfd ATTRIBUTE_UNUSED;
+     char ** error_message ATTRIBUTE_UNUSED;
 {
   BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
   
@@ -397,7 +415,7 @@
 static boolean
 mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 			  contents, relocs, local_syms, local_sections)
-     bfd * output_bfd;
+     bfd * output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info * info;
      bfd * input_bfd;
      asection * input_section;
@@ -411,7 +429,6 @@
   Elf_Internal_Rela *           rel = relocs;
   Elf_Internal_Rela *           relend = relocs + input_section->reloc_count;
   boolean ret = true;
-  long insn;
 
 #ifdef DEBUG
   fprintf (stderr,
@@ -532,9 +549,6 @@
       switch (r_type)
 	{
 	default:
-	case R_MCORE_PCRELIMM8BY4:	
-	case R_MCORE_PCRELIMM11BY2:
-	case R_MCORE_PCRELIMM4BY2:
 	  break;
 
 	case R_MCORE_PCRELJSR_IMM11BY2:
@@ -609,7 +623,7 @@
 static asection *
 mcore_elf_gc_mark_hook (abfd, info, rel, h, sym)
      bfd *                        abfd;
-     struct bfd_link_info *       info;
+     struct bfd_link_info *       info ATTRIBUTE_UNUSED;
      Elf_Internal_Rela *          rel;
      struct elf_link_hash_entry * h;
      Elf_Internal_Sym *           sym;
@@ -631,6 +645,9 @@
 	      
 	    case bfd_link_hash_common:
 	      return h->root.u.c.p->section;
+
+	    default:
+	      break;
 	    }
 	}
     }
@@ -652,10 +669,10 @@
 
 static boolean
 mcore_elf_gc_sweep_hook (abfd, info, sec, relocs)
-     bfd *                     abfd;
-     struct bfd_link_info *    info;
-     asection *                sec;
-     const Elf_Internal_Rela * relocs;
+     bfd *                     abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *    info ATTRIBUTE_UNUSED;
+     asection *                sec ATTRIBUTE_UNUSED;
+     const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED;
 {
   return true;
 }
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 9f03262..cdcf65c 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -3,6 +3,8 @@
 
    Most of the information added by Ian Lance Taylor, Cygnus Support,
    <ian@cygnus.com>.
+   N32/64 ABI support added by Mark Mitchell, CodeSourcery, LLC.
+   <mark@codesourcery.com>
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -41,39 +43,85 @@
 #define ECOFF_32
 #include "ecoffswap.h"
 
+/* This structure is used to hold .got information when linking.  It
+   is stored in the tdata field of the bfd_elf_section_data structure.  */
+
+struct mips_got_info
+{
+  /* The global symbol in the GOT with the lowest index in the dynamic
+     symbol table.  */
+  struct elf_link_hash_entry *global_gotsym;
+  /* The number of global .got entries.  */
+  unsigned int global_gotno;
+  /* The number of local .got entries.  */
+  unsigned int local_gotno;
+  /* The number of local .got entries we have used.  */
+  unsigned int assigned_gotno;
+};
+
+/* The MIPS ELF linker needs additional information for each symbol in
+   the global hash table.  */
+
+struct mips_elf_link_hash_entry
+{
+  struct elf_link_hash_entry root;
+
+  /* External symbol information.  */
+  EXTR esym;
+
+  /* Number of R_MIPS_32, R_MIPS_REL32, or R_MIPS_64 relocs against
+     this symbol.  */ 
+  unsigned int possibly_dynamic_relocs;
+
+  /* The index of the first dynamic relocation (in the .rel.dyn
+     section) against this symbol.  */
+  unsigned int min_dyn_reloc_index;
+
+  /* If there is a stub that 32 bit functions should use to call this
+     16 bit function, this points to the section containing the stub.  */
+  asection *fn_stub;
+
+  /* Whether we need the fn_stub; this is set if this symbol appears
+     in any relocs other than a 16 bit call.  */
+  boolean need_fn_stub;
+
+  /* If there is a stub that 16 bit functions should use to call this
+     32 bit function, this points to the section containing the stub.  */
+  asection *call_stub;
+
+  /* This is like the call_stub field, but it is used if the function
+     being called returns a floating point value.  */
+  asection *call_fp_stub;
+};
+
 static bfd_reloc_status_type mips32_64bit_reloc
   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
 static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
   PARAMS ((bfd *, bfd_reloc_code_real_type));
 static void mips_info_to_howto_rel
   PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
+static void mips_info_to_howto_rela
+  PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
 static void bfd_mips_elf32_swap_gptab_in
   PARAMS ((bfd *, const Elf32_External_gptab *, Elf32_gptab *));
 static void bfd_mips_elf32_swap_gptab_out
   PARAMS ((bfd *, const Elf32_gptab *, Elf32_External_gptab *));
+static void bfd_mips_elf_swap_msym_in 
+  PARAMS ((bfd *, const Elf32_External_Msym *, Elf32_Internal_Msym *));
+static void bfd_mips_elf_swap_msym_out
+  PARAMS ((bfd *, const Elf32_Internal_Msym *, Elf32_External_Msym *));
 static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *));
-static boolean mips_elf32_object_p PARAMS ((bfd *));
 static boolean mips_elf_create_procedure_table
   PARAMS ((PTR, bfd *, struct bfd_link_info *, asection *,
 	   struct ecoff_debug_info *));
-static int mips_elf_additional_program_headers PARAMS ((bfd *));
-static boolean mips_elf_modify_segment_map PARAMS ((bfd *));
 static INLINE int elf_mips_isa PARAMS ((flagword));
 static INLINE int elf_mips_mach PARAMS ((flagword));
-static INLINE char* elf_mips_abi_name PARAMS ((flagword));
-static boolean mips_elf32_section_from_shdr
-  PARAMS ((bfd *, Elf32_Internal_Shdr *, char *));
-static boolean mips_elf32_section_processing
-  PARAMS ((bfd *, Elf32_Internal_Shdr *));
+static INLINE char* elf_mips_abi_name PARAMS ((bfd *));
 static boolean mips_elf_is_local_label_name
   PARAMS ((bfd *, const char *));
 static struct bfd_hash_entry *mips_elf_link_hash_newfunc
   PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static struct bfd_link_hash_table *mips_elf_link_hash_table_create
-  PARAMS ((bfd *));
 static int gptab_compare PARAMS ((const void *, const void *));
-static boolean mips_elf_final_link
-  PARAMS ((bfd *, struct bfd_link_info *));
 static void mips_elf_relocate_hi16
   PARAMS ((bfd *, Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_byte *,
 	   bfd_vma));
@@ -86,61 +134,159 @@
   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
 static bfd_reloc_status_type mips16_gprel_reloc
   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static boolean mips_elf_adjust_dynindx
-  PARAMS ((struct elf_link_hash_entry *, PTR));
-static boolean mips_elf_relocate_section
-  PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
-	   Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-static boolean mips_elf_link_output_symbol_hook
-  PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *,
-	   asection *));
-static boolean mips_elf_create_dynamic_sections
-  PARAMS ((bfd *, struct bfd_link_info *));
 static boolean mips_elf_create_compact_rel_section
   PARAMS ((bfd *, struct bfd_link_info *));
 static boolean mips_elf_create_got_section
   PARAMS ((bfd *, struct bfd_link_info *));
-static boolean mips_elf_check_relocs
-  PARAMS ((bfd *, struct bfd_link_info *, asection *,
-	   const Elf_Internal_Rela *));
-static boolean mips_elf_adjust_dynamic_symbol
-  PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-static boolean mips_elf_always_size_sections
-  PARAMS ((bfd *, struct bfd_link_info *));
-static boolean mips_elf_size_dynamic_sections
-  PARAMS ((bfd *, struct bfd_link_info *));
-static boolean mips_elf_finish_dynamic_symbol
-  PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
-	   Elf_Internal_Sym *));
-static boolean mips_elf_finish_dynamic_sections
-  PARAMS ((bfd *, struct bfd_link_info *));
-static boolean mips_elf_add_symbol_hook
-  PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
-	   const char **, flagword *, asection **, bfd_vma *));
 static bfd_reloc_status_type mips_elf_final_gp
   PARAMS ((bfd *, asymbol *, boolean, char **, bfd_vma *));
 static bfd_byte *elf32_mips_get_relocated_section_contents
   PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
 	   bfd_byte *, boolean, asymbol **));
+static asection *mips_elf_create_msym_section 
+  PARAMS ((bfd *));
+static void mips_elf_irix6_finish_dynamic_symbol 
+  PARAMS ((bfd *, const char *, Elf_Internal_Sym *));
+static bfd_vma mips_elf_sign_extend PARAMS ((bfd_vma, int));
+static boolean mips_elf_overflow_p PARAMS ((bfd_vma, int));
+static bfd_vma mips_elf_high PARAMS ((bfd_vma));
+static bfd_vma mips_elf_higher PARAMS ((bfd_vma));
+static bfd_vma mips_elf_highest PARAMS ((bfd_vma));
+static bfd_vma mips_elf_global_got_index
+  PARAMS ((bfd *, struct elf_link_hash_entry *));
+static bfd_vma mips_elf_local_got_index
+  PARAMS ((bfd *, struct bfd_link_info *, bfd_vma));
+static bfd_vma mips_elf_got_offset_from_index
+  PARAMS ((bfd *, bfd *, bfd_vma));
+static boolean mips_elf_record_global_got_symbol 
+  PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *,
+	   struct mips_got_info *));
+static bfd_vma mips_elf_got_page
+  PARAMS ((bfd *, struct bfd_link_info *, bfd_vma, bfd_vma *));
+static boolean mips_elf_next_lo16_addend
+  PARAMS ((const Elf_Internal_Rela *, const Elf_Internal_Rela *, bfd_vma *));
+static bfd_reloc_status_type mips_elf_calculate_relocation
+  PARAMS ((bfd *, bfd *, asection *, struct bfd_link_info *,
+	   const Elf_Internal_Rela *, bfd_vma, reloc_howto_type *,
+	   Elf_Internal_Sym *, asection **, bfd_vma *, const char **,
+	   boolean *));
+static bfd_vma mips_elf_obtain_contents
+  PARAMS ((reloc_howto_type *, const Elf_Internal_Rela *, bfd *, bfd_byte *));
+static boolean mips_elf_perform_relocation
+  PARAMS ((struct bfd_link_info *, reloc_howto_type *, 
+	   const Elf_Internal_Rela *, bfd_vma,
+	   bfd *, asection *, bfd_byte *, boolean));
+static boolean mips_elf_assign_gp PARAMS ((bfd *, bfd_vma *));
+static boolean mips_elf_sort_hash_table_f 
+  PARAMS ((struct mips_elf_link_hash_entry *, PTR));
+static boolean mips_elf_sort_hash_table 
+  PARAMS ((struct bfd_link_info *, unsigned long));
+static asection * mips_elf_got_section PARAMS ((bfd *));
+static struct mips_got_info *mips_elf_got_info 
+  PARAMS ((bfd *, asection **));
+static boolean mips_elf_local_relocation_p
+  PARAMS ((bfd *, const Elf_Internal_Rela *, asection **));
+static bfd_vma mips_elf_create_local_got_entry 
+  PARAMS ((bfd *, struct mips_got_info *, asection *, bfd_vma));
+static bfd_vma mips_elf_got16_entry 
+  PARAMS ((bfd *, struct bfd_link_info *, bfd_vma));
+static unsigned int mips_elf_create_dynamic_relocation 
+  PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Rela *,
+	   long, bfd_vma, asection *));
+static void mips_elf_allocate_dynamic_relocations 
+  PARAMS ((bfd *, unsigned int));
+static boolean mips_elf_stub_section_p 
+  PARAMS ((bfd *, asection *));
 
-/* This is true for Irix 5 executables, false for normal MIPS ELF ABI
-   executables.  FIXME: At the moment, we default to always generating
-   Irix 5 executables.  */
+/* The level of IRIX compatibility we're striving for.  */
 
-#define SGI_COMPAT(abfd) (1)
+typedef enum {
+  ict_none,
+  ict_irix5,
+  ict_irix6
+} irix_compat_t;
 
-/* This structure is used to hold .got information when linking.  It
-   is stored in the tdata field of the bfd_elf_section_data structure.  */
+/* Nonzero if ABFD is using the N32 ABI.  */
 
-struct mips_got_info
-{
-  /* The symbol index of the first global .got symbol.  */
-  unsigned long global_gotsym;
-  /* The number of local .got entries.  */
-  unsigned int local_gotno;
-  /* The number of local .got entries we have used.  */
-  unsigned int assigned_gotno;
-};
+#define ABI_N32_P(abfd) \
+  ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0)
+
+/* Nonzero if ABFD is using the 64-bit ABI.  FIXME: This is never
+   true, yet.  */
+#define ABI_64_P(abfd) \
+  ((elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64) != 0)
+
+/* What version of Irix we are trying to be compatible with.  FIXME:
+   At the moment, we never generate "normal" MIPS ELF ABI executables;
+   we always use some version of Irix.  */
+
+#define IRIX_COMPAT(abfd) \
+  ((ABI_N32_P (abfd) || ABI_64_P (abfd)) ? ict_irix6 : ict_irix5)
+
+/* Whether we are trying to be compatible with IRIX at all.  */
+
+#define SGI_COMPAT(abfd) \
+  (IRIX_COMPAT (abfd) != ict_none)
+
+/* The name of the msym section.  */
+#define MIPS_ELF_MSYM_SECTION_NAME(abfd) ".msym"
+
+/* The name of the srdata section.  */
+#define MIPS_ELF_SRDATA_SECTION_NAME(abfd) ".srdata"
+
+/* The name of the options section.  */
+#define MIPS_ELF_OPTIONS_SECTION_NAME(abfd) \
+  (IRIX_COMPAT (abfd) == ict_irix6 ? ".MIPS.options" : ".options")
+
+/* The name of the stub section.  */
+#define MIPS_ELF_STUB_SECTION_NAME(abfd) \
+  (IRIX_COMPAT (abfd) == ict_irix6 ? ".MIPS.stubs" : ".stub")
+
+/* The name of the dynamic relocation section.  */
+#define MIPS_ELF_REL_DYN_SECTION_NAME(abfd) ".rel.dyn"
+
+/* The size of an external REL relocation.  */
+#define MIPS_ELF_REL_SIZE(abfd) \
+  (get_elf_backend_data (abfd)->s->sizeof_rel)
+
+/* The size of an external dynamic table entry.  */
+#define MIPS_ELF_DYN_SIZE(abfd) \
+  (get_elf_backend_data (abfd)->s->sizeof_dyn)
+
+/* The size of a GOT entry.  */
+#define MIPS_ELF_GOT_SIZE(abfd) \
+  (get_elf_backend_data (abfd)->s->arch_size / 8)
+
+/* The size of a symbol-table entry.  */
+#define MIPS_ELF_SYM_SIZE(abfd) \
+  (get_elf_backend_data (abfd)->s->sizeof_sym)
+
+/* The default alignment for sections, as a power of two.  */
+#define MIPS_ELF_LOG_FILE_ALIGN(abfd)				\
+  (get_elf_backend_data (abfd)->s->file_align == 8 ? 3 : 2)
+
+/* Get word-sized data.  */
+#define MIPS_ELF_GET_WORD(abfd, ptr) \
+  (ABI_64_P (abfd) ? bfd_get_64 (abfd, ptr) : bfd_get_32 (abfd, ptr))
+
+/* Put out word-sized data.  */
+#define MIPS_ELF_PUT_WORD(abfd, val, ptr)	\
+  (ABI_64_P (abfd) 				\
+   ? bfd_put_64 (abfd, val, ptr) 		\
+   : bfd_put_32 (abfd, val, ptr))
+
+/* Add a dynamic symbol table-entry.  */
+#ifdef BFD64
+#define MIPS_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \
+  (ABI_64_P (elf_hash_table (info)->dynobj)	   \
+   ? bfd_elf64_add_dynamic_entry (info, tag, val)  \
+   : bfd_elf32_add_dynamic_entry (info, tag, val))
+#else
+#define MIPS_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \
+  (ABI_64_P (elf_hash_table (info)->dynobj)	   \
+   ? (abort (), false)                             \
+   : bfd_elf32_add_dynamic_entry (info, tag, val))
+#endif
 
 /* The number of local .got entries we reserve.  */
 #define MIPS_RESERVED_GOTNO (2)
@@ -148,9 +294,11 @@
 /* Instructions which appear in a stub.  For some reason the stub is
    slightly different on an SGI system.  */
 #define ELF_MIPS_GP_OFFSET(abfd) (SGI_COMPAT (abfd) ? 0x7ff0 : 0x8000)
-#define STUB_LW(abfd)					\
-  (SGI_COMPAT (abfd)					\
-   ? 0x8f998010			/* lw t9,0x8010(gp) */	\
+#define STUB_LW(abfd)						\
+  (SGI_COMPAT (abfd)						\
+   ? (ABI_64_P (abfd)  						\
+      ? 0xdf998010		/* ld t9,0x8010(gp) */		\
+      : 0x8f998010)             /* lw t9,0x8010(gp) */		\
    : 0x8f998000)		/* lw t9,0x8000(gp) */
 #define STUB_MOVE 0x03e07825	/* move t7,ra */
 #define STUB_JALR 0x0320f809	/* jal t9 */
@@ -297,6 +445,10 @@
 
 #define USE_REL	1		/* MIPS uses REL relocations instead of RELA */
 
+/* In case we're on a 32-bit machine, construct a 64-bit "-1" value
+   from smaller values.  Start with zero, widen, *then* decrement.  */
+#define MINUS_ONE	(((bfd_vma)0) - 1)
+
 static reloc_howto_type elf_mips_howto_table[] =
 {
   /* No relocation.  */
@@ -468,7 +620,6 @@
 	 false),		/* pcrel_offset */
 
   /* 16 bit call through global offset table.  */
-  /* FIXME: This is not handled correctly.  */
   HOWTO (R_MIPS_CALL16,		/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -500,9 +651,9 @@
 
     /* The remaining relocs are defined on Irix 5, although they are
        not defined by the ABI.  */
-    { 13 },
-    { 14 },
-    { 15 },
+    EMPTY_HOWTO (13),
+    EMPTY_HOWTO (14),
+    EMPTY_HOWTO (15),
 
   /* A 5 bit shift field.  */
   HOWTO (R_MIPS_SHIFT5,		/* type */
@@ -536,26 +687,22 @@
 	 0x000007c4,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
-  /* A 64 bit relocation.  This is used in 32 bit ELF when addresses
-     are 64 bits long; the upper 32 bits are simply a sign extension.
-     The fields of the howto should be the same as for R_MIPS_32,
-     other than the type, name, and special_function.  */
+  /* A 64 bit relocation.  */
   HOWTO (R_MIPS_64,		/* type */
 	 0,			/* rightshift */
-	 2,			/* size (0 = byte, 1 = short, 2 = long) */
-	 32,			/* bitsize */
+	 4,			/* size (0 = byte, 1 = short, 2 = long) */
+	 64,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_bitfield, /* complain_on_overflow */
 	 mips32_64bit_reloc,	/* special_function */
 	 "R_MIPS_64",		/* name */
 	 true,			/* partial_inplace */
-	 0xffffffff,		/* src_mask */
-	 0xffffffff,		/* dst_mask */
+	 MINUS_ONE,		/* src_mask */
+	 MINUS_ONE,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* Displacement in the global offset table.  */
-  /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_GOT_DISP,	/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -571,7 +718,6 @@
 	 false),		/* pcrel_offset */
 
   /* Displacement to page pointer in the global offset table.  */
-  /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_GOT_PAGE,	/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -587,7 +733,6 @@
 	 false),		/* pcrel_offset */
 
   /* Offset from page pointer in the global offset table.  */
-  /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_GOT_OFST,	/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -603,7 +748,6 @@
 	 false),		/* pcrel_offset */
 
   /* High 16 bits of displacement in global offset table.  */
-  /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_GOT_HI16,	/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -619,7 +763,6 @@
 	 false),		/* pcrel_offset */
 
   /* Low 16 bits of displacement in global offset table.  */
-  /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_GOT_LO16,	/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -634,21 +777,57 @@
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
-  /* 64 bit subtraction.  Presumably not used in 32 bit ELF.  */
-  { R_MIPS_SUB },
+  /* 64 bit subtraction.  Used in the N32 ABI.  */
+  HOWTO (R_MIPS_SUB,		/* type */
+	 0,			/* rightshift */
+	 4,			/* size (0 = byte, 1 = short, 2 = long) */
+	 64,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_MIPS_SUB",		/* name */
+	 true,			/* partial_inplace */
+	 MINUS_ONE,		/* src_mask */
+	 MINUS_ONE,		/* dst_mask */
+	 false),		/* pcrel_offset */
 
   /* Used to cause the linker to insert and delete instructions?  */
-  { R_MIPS_INSERT_A },
-  { R_MIPS_INSERT_B },
-  { R_MIPS_DELETE },
+  EMPTY_HOWTO (R_MIPS_INSERT_A),
+  EMPTY_HOWTO (R_MIPS_INSERT_B),
+  EMPTY_HOWTO (R_MIPS_DELETE),
 
-  /* Get the higher values of a 64 bit addend.  Presumably not used in
-     32 bit ELF.  */
-  { R_MIPS_HIGHER },
-  { R_MIPS_HIGHEST },
+  /* Get the higher value of a 64 bit addend.  */
+  HOWTO (R_MIPS_HIGHER,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_MIPS_HIGHER",	/* name */
+	 true,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Get the highest value of a 64 bit addend.  */
+  HOWTO (R_MIPS_HIGHEST,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_MIPS_HIGHEST",	/* name */
+	 true,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
 
   /* High 16 bits of displacement in global offset table.  */
-  /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_CALL_HI16,	/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -664,7 +843,6 @@
 	 false),		/* pcrel_offset */
 
   /* Low 16 bits of displacement in global offset table.  */
-  /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_CALL_LO16,	/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -679,11 +857,41 @@
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
-  { R_MIPS_SCN_DISP },
-  { R_MIPS_REL16 },
-  { R_MIPS_ADD_IMMEDIATE },
-  { R_MIPS_PJUMP },
-  { R_MIPS_RELGOT }
+  /* Section displacement.  */
+  HOWTO (R_MIPS_SCN_DISP,       /* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_MIPS_SCN_DISP",     /* name */
+	 false,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  EMPTY_HOWTO (R_MIPS_REL16),
+  EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE),
+  EMPTY_HOWTO (R_MIPS_PJUMP),
+  EMPTY_HOWTO (R_MIPS_RELGOT),
+
+  /* Protected jump conversion.  This is an optimization hint.  No 
+     relocation is required for correctness.  */
+  HOWTO (R_MIPS_JALR,	        /* type */
+	 0,			/* rightshift */
+	 0,			/* size (0 = byte, 1 = short, 2 = long) */
+	 0,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_MIPS_JALR",	        /* name */
+	 false,			/* partial_inplace */
+	 0x00000000,		/* src_mask */
+	 0x00000000,		/* dst_mask */
+	 false),		/* pcrel_offset */
 };
 
 /* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link.  This
@@ -722,10 +930,7 @@
 	 0x3ffffff,		/* dst_mask */
 	 false);		/* pcrel_offset */
 
-/* The reloc used for the mips16 gprel instruction.  The src_mask and
-   dsk_mask for this howto do not reflect the actual instruction, in
-   which the value is not contiguous; the masks are for the
-   convenience of the relocate_section routine.  */
+/* The reloc used for the mips16 gprel instruction.  */
 static reloc_howto_type elf_mips16_gprel_howto =
   HOWTO (R_MIPS16_GPREL,	/* type */
 	 0,			/* rightshift */
@@ -737,8 +942,8 @@
 	 mips16_gprel_reloc,	/* special_function */
 	 "R_MIPS16_GPREL",	/* name */
 	 true,			/* partial_inplace */
-	 0xffff,		/* src_mask */
-	 0xffff,		/* dst_mask */
+	 0x07ff001f,		/* src_mask */
+	 0x07ff001f,	        /* dst_mask */
 	 false);		/* pcrel_offset */
 
 
@@ -802,7 +1007,7 @@
 		     input_section,
 		     output_bfd,
 		     error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
      PTR data;
@@ -1033,6 +1238,57 @@
   abort ();
 }
 
+/* Set the GP value for OUTPUT_BFD.  Returns false if this is a
+   dangerous relocation.  */
+
+static boolean
+mips_elf_assign_gp (output_bfd, pgp)
+     bfd *output_bfd;
+     bfd_vma *pgp;
+{
+  unsigned int count;
+  asymbol **sym;
+  unsigned int i;
+
+  /* If we've already figured out what GP will be, just return it.  */
+  *pgp = _bfd_get_gp_value (output_bfd);
+  if (*pgp)
+    return true;
+
+  count = bfd_get_symcount (output_bfd);
+  sym = bfd_get_outsymbols (output_bfd);
+
+  /* The linker script will have created a symbol named `_gp' with the
+     appropriate value.  */
+  if (sym == (asymbol **) NULL)
+    i = count;
+  else
+    {
+      for (i = 0; i < count; i++, sym++)
+	{
+	  register CONST char *name;
+
+	  name = bfd_asymbol_name (*sym);
+	  if (*name == '_' && strcmp (name, "_gp") == 0)
+	    {
+	      *pgp = bfd_asymbol_value (*sym);
+	      _bfd_set_gp_value (output_bfd, *pgp);
+	      break;
+	    }
+	}
+    }
+
+  if (i >= count)
+    {
+      /* Only get the error once.  */
+      *pgp = 4;
+      _bfd_set_gp_value (output_bfd, *pgp);
+      return false;
+    }
+
+  return true;
+}
+
 /* We have to figure out the gp value, so that we can adjust the
    symbol value correctly.  We look up the symbol _gp in the output
    BFD.  If we can't find it, we're stuck.  We cache it in the ELF
@@ -1065,42 +1321,11 @@
 	  *pgp = symbol->section->output_section->vma + 0x4000;
 	  _bfd_set_gp_value (output_bfd, *pgp);
 	}
-      else
+      else if (!mips_elf_assign_gp (output_bfd, pgp))
 	{
-	  unsigned int count;
-	  asymbol **sym;
-	  unsigned int i;
-
-	  count = bfd_get_symcount (output_bfd);
-	  sym = bfd_get_outsymbols (output_bfd);
-
-	  if (sym == (asymbol **) NULL)
-	    i = count;
-	  else
-	    {
-	      for (i = 0; i < count; i++, sym++)
-		{
-		  register CONST char *name;
-
-		  name = bfd_asymbol_name (*sym);
-		  if (*name == '_' && strcmp (name, "_gp") == 0)
-		    {
-		      *pgp = bfd_asymbol_value (*sym);
-		      _bfd_set_gp_value (output_bfd, *pgp);
-		      break;
-		    }
-		}
-	    }
-
-	  if (i >= count)
-	    {
-	      /* Only get the error once.  */
-	      *pgp = 4;
-	      _bfd_set_gp_value (output_bfd, *pgp);
-	      *error_message =
-		(char *) _("GP relative relocation when _gp not defined");
-	      return bfd_reloc_dangerous;
-	    }
+	  *error_message =
+	    (char *) _("GP relative relocation when _gp not defined");
+	  return bfd_reloc_dangerous;
 	}
     }
 
@@ -1385,13 +1610,13 @@
 static bfd_reloc_status_type
 mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section,
 		   output_bfd, error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
-     PTR data;
+     PTR data ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   if (output_bfd != (bfd *) NULL
       && (symbol->flags & BSF_SECTION_SYM) == 0
@@ -1559,12 +1784,20 @@
   return 0;
 }
 
-/* Return printable name for ABI from flagword. */
+/* Return printable name for ABI. */
 
 static INLINE char*
-elf_mips_abi_name (flags)
-     flagword flags;
+elf_mips_abi_name (abfd)
+     bfd *abfd;
 {
+  flagword flags;
+
+  if (ABI_N32_P (abfd))
+    return "N32";
+  else if (ABI_64_P (abfd))
+    return "64";
+      
+  flags = elf_elfheader (abfd)->e_flags;
   switch (flags & EF_MIPS_ABI)
     {
     case 0:
@@ -1607,7 +1840,11 @@
   { BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
   { BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 },
   { BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 },
-  { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 }
+  { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 },
+  { BFD_RELOC_MIPS_SUB, R_MIPS_SUB },
+  { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE },
+  { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST },
+  { BFD_RELOC_MIPS_GOT_DISP, R_MIPS_GOT_DISP }
 };
 
 /* Given a BFD reloc type, return a howto structure.  */
@@ -1651,7 +1888,7 @@
     }
 }
 
-/* Given a MIPS reloc type, fill in an arelent structure.  */
+/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure.  */
 
 static void
 mips_info_to_howto_rel (abfd, cache_ptr, dst)
@@ -1692,6 +1929,23 @@
 	  || r_type == (unsigned int) R_MIPS_LITERAL))
     cache_ptr->addend = elf_gp (abfd);
 }
+
+/* Given a MIPS Elf32_Internal_Rela, fill in an arelent structure.  */
+
+static void
+mips_info_to_howto_rela (abfd, cache_ptr, dst)
+     bfd *abfd;
+     arelent *cache_ptr;
+     Elf32_Internal_Rela *dst;
+{
+  /* Since an Elf32_Internal_Rel is an initial prefix of an
+     Elf32_Internal_Rela, we can just use mips_info_to_howto_rel
+     above.  */
+  mips_info_to_howto_rel (abfd, cache_ptr, (Elf32_Internal_Rel *) dst);
+
+  /* If we ever need to do any extra processing with dst->r_addend
+     (the field omitted in an Elf32_Internal_Rel) we can do it here.  */
+}
 
 /* A .reginfo section holds a single Elf32_RegInfo structure.  These
    routines swap this structure in and out.  They are used outside of
@@ -1857,6 +2111,31 @@
   bfd_h_put_16 (abfd, in->section, ex->section);
   bfd_h_put_32 (abfd, in->info, ex->info);
 }
+
+/* Swap in an MSYM entry.  */
+
+static void
+bfd_mips_elf_swap_msym_in (abfd, ex, in)
+     bfd *abfd;
+     const Elf32_External_Msym *ex;
+     Elf32_Internal_Msym *in;
+{
+  in->ms_hash_value = bfd_h_get_32 (abfd, ex->ms_hash_value);
+  in->ms_info = bfd_h_get_32 (abfd, ex->ms_info);
+}
+
+/* Swap out an MSYM entry.  */
+
+static void
+bfd_mips_elf_swap_msym_out (abfd, in, ex)
+     bfd *abfd;
+     const Elf32_Internal_Msym *in;
+     Elf32_External_Msym *ex;
+{
+  bfd_h_put_32 (abfd, in->ms_hash_value, ex->ms_hash_value);
+  bfd_h_put_32 (abfd, in->ms_info, ex->ms_info);
+}
+
 
 /* Determine whether a symbol is global for the purposes of splitting
    the symbol table into global symbols and local symbols.  At least
@@ -1867,7 +2146,7 @@
 /*ARGSUSED*/
 static boolean
 mips_elf_sym_is_global (abfd, sym)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asymbol *sym;
 {
   return (sym->flags & BSF_SECTION_SYM) == 0 ? true : false;
@@ -1880,23 +2159,14 @@
 _bfd_mips_elf_object_p (abfd)
      bfd *abfd;
 {
-  bfd_default_set_arch_mach (abfd, bfd_arch_mips,
-			     elf_mips_mach (elf_elfheader (abfd)->e_flags));
-  return true;
-}
-
-/* Set the right machine number for a 32-bit MIPS ELF file.  */
-
-static boolean
-mips_elf32_object_p (abfd)
-     bfd *abfd;
-{
-  /* Irix 5 is broken.  Object file symbol tables are not always
+  /* Irix 5 and 6 is broken.  Object file symbol tables are not always
      sorted correctly such that local symbols precede global symbols,
      and the sh_info field in the symbol table is not always right.  */
   elf_bad_symtab (abfd) = true;
 
-  return _bfd_mips_elf_object_p (abfd);
+  bfd_default_set_arch_mach (abfd, bfd_arch_mips,
+			     elf_mips_mach (elf_elfheader (abfd)->e_flags));
+  return true;
 }
 
 /* The final processing done just before writing out a MIPS ELF object
@@ -1907,7 +2177,7 @@
 void
 _bfd_mips_elf_final_write_processing (abfd, linker)
      bfd *abfd;
-     boolean linker;
+     boolean linker ATTRIBUTE_UNUSED;
 {
   unsigned long val;
   unsigned int i;
@@ -1967,6 +2237,7 @@
     {
       switch ((*hdrpp)->sh_type)
 	{
+	case SHT_MIPS_MSYM:
 	case SHT_MIPS_LIBLIST:
 	  sec = bfd_get_section_by_name (abfd, ".dynstr");
 	  if (sec != NULL)
@@ -1992,7 +2263,7 @@
 	  sec = bfd_get_section_by_name (abfd,
 					 name + sizeof ".MIPS.content" - 1);
 	  BFD_ASSERT (sec != NULL);
-	  (*hdrpp)->sh_info = elf_section_data (sec)->this_idx;
+	  (*hdrpp)->sh_link = elf_section_data (sec)->this_idx;
 	  break;
 
 	case SHT_MIPS_SYMBOL_LIB:
@@ -2104,6 +2375,8 @@
     {
       elf_flags_init (obfd) = true;
       elf_elfheader (obfd)->e_flags = new_flags;
+      elf_elfheader (obfd)->e_ident[EI_CLASS] 
+	= elf_elfheader (ibfd)->e_ident[EI_CLASS];
 
       if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
 	  && bfd_get_arch_info (obfd)->the_default)
@@ -2191,18 +2464,22 @@
       old_flags &= ~ (EF_MIPS_ARCH | EF_MIPS_MACH);
     }
 
-  /* Compare ABI's */
-  if ((new_flags & EF_MIPS_ABI) != (old_flags & EF_MIPS_ABI))
+  /* Compare ABI's.  The 64-bit ABI does not use EF_MIPS_ABI.  But, it
+     does set EI_CLASS differently from any 32-bit ABI.  */
+  if ((new_flags & EF_MIPS_ABI) != (old_flags & EF_MIPS_ABI)
+      || (elf_elfheader (ibfd)->e_ident[EI_CLASS] 
+	  != elf_elfheader (obfd)->e_ident[EI_CLASS]))
     {
       /* Only error if both are set (to different values). */
-      if ((new_flags & EF_MIPS_ABI)
-	  && (old_flags & EF_MIPS_ABI))
+      if (((new_flags & EF_MIPS_ABI) && (old_flags & EF_MIPS_ABI))
+	  || (elf_elfheader (ibfd)->e_ident[EI_CLASS] 
+	      != elf_elfheader (obfd)->e_ident[EI_CLASS]))
 	{
 	  (*_bfd_error_handler)
 	    (_("%s: ABI mismatch: linking %s module with previous %s modules"),
 	     bfd_get_filename (ibfd),
-	     elf_mips_abi_name (new_flags),
-	     elf_mips_abi_name (old_flags));
+	     elf_mips_abi_name (ibfd),
+	     elf_mips_abi_name (obfd));
 	  ok = false;
 	}
       new_flags &= ~EF_MIPS_ABI;
@@ -2228,7 +2505,7 @@
   return true;
 }
 
-static boolean
+boolean
 _bfd_mips_elf_print_private_bfd_data (abfd, ptr)
      bfd *abfd;
      PTR ptr;
@@ -2253,6 +2530,10 @@
     fprintf (file, _ (" [abi=EABI64]"));
   else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI))
     fprintf (file, _ (" [abi unknown]"));
+  else if (ABI_N32_P (abfd))
+    fprintf (file, _ (" [abi=N32]"));
+  else if (ABI_64_P (abfd))
+    fprintf (file, _ (" [abi=64]"));
   else
     fprintf (file, _ (" [no abi set]"));
 
@@ -2288,7 +2569,7 @@
 _bfd_mips_elf_section_from_shdr (abfd, hdr, name)
      bfd *abfd;
      Elf_Internal_Shdr *hdr;
-     const char *name;
+     char *name;
 {
   flagword flags = 0;
 
@@ -2304,7 +2585,7 @@
 	return false;
       break;
     case SHT_MIPS_MSYM:
-      if (strcmp (name, ".msym") != 0)
+      if (strcmp (name, MIPS_ELF_MSYM_SECTION_NAME (abfd)) != 0)
 	return false;
       break;
     case SHT_MIPS_CONFLICT:
@@ -2339,8 +2620,7 @@
 	return false;
       break;
     case SHT_MIPS_OPTIONS:
-      if (strcmp (name, ".options") != 0
-	  && strcmp (name, ".MIPS.options") != 0)
+      if (strcmp (name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) != 0)
 	return false;
       break;
     case SHT_MIPS_DWARF:
@@ -2373,20 +2653,6 @@
 	return false;
     }
 
-  return true;
-}
-
-/* Handle a 32-bit MIPS ELF specific section.  */
-
-static boolean
-mips_elf32_section_from_shdr (abfd, hdr, name)
-     bfd *abfd;
-     Elf_Internal_Shdr *hdr;
-     char *name;
-{
-  if (! _bfd_mips_elf_section_from_shdr (abfd, hdr, name))
-    return false;
-
   /* FIXME: We should record sh_info for a .gptab section.  */
 
   /* For a .reginfo section, set the gp value in the tdata information
@@ -2430,7 +2696,18 @@
 
 	  bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l,
 					&intopt);
-	  if (intopt.kind == ODK_REGINFO)
+	  if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO)
+	    {
+	      Elf64_Internal_RegInfo intreg;
+
+	      bfd_mips_elf64_swap_reginfo_in
+		(abfd,
+		 ((Elf64_External_RegInfo *)
+		  (l + sizeof (Elf_External_Options))),
+		 &intreg);
+	      elf_gp (abfd) = intreg.ri_gp_value;
+	    }
+	  else if (intopt.kind == ODK_REGINFO)
 	    {
 	      Elf32_RegInfo intreg;
 
@@ -2469,12 +2746,6 @@
       hdr->sh_info = sec->_raw_size / sizeof (Elf32_Lib);
       /* The sh_link field is set in final_write_processing.  */
     }
-  else if (strcmp (name, ".msym") == 0)
-    {
-      hdr->sh_type = SHT_MIPS_MSYM;
-      hdr->sh_entsize = 8;
-      /* FIXME: Set the sh_info field.  */
-    }
   else if (strcmp (name, ".conflict") == 0)
     hdr->sh_type = SHT_MIPS_CONFLICT;
   else if (strncmp (name, ".gptab.", sizeof ".gptab." - 1) == 0)
@@ -2517,6 +2788,7 @@
 #endif
     }
   else if (strcmp (name, ".got") == 0
+	   || strcmp (name, MIPS_ELF_SRDATA_SECTION_NAME (abfd)) == 0
 	   || strcmp (name, ".sdata") == 0
 	   || strcmp (name, ".sbss") == 0
 	   || strcmp (name, ".lit4") == 0
@@ -2527,13 +2799,13 @@
       hdr->sh_type = SHT_MIPS_IFACE;
       hdr->sh_flags |= SHF_MIPS_NOSTRIP;
     }
-  else if (strcmp (name, ".MIPS.content") == 0)
+  else if (strncmp (name, ".MIPS.content", strlen (".MIPS.content")) == 0)
     {
       hdr->sh_type = SHT_MIPS_CONTENT;
+      hdr->sh_flags |= SHF_MIPS_NOSTRIP;
       /* The sh_info field is set in final_write_processing.  */
     }
-  else if (strcmp (name, ".options") == 0
-	   || strcmp (name, ".MIPS.options") == 0)
+  else if (strcmp (name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0)
     {
       hdr->sh_type = SHT_MIPS_OPTIONS;
       hdr->sh_entsize = 1;
@@ -2555,6 +2827,29 @@
       hdr->sh_flags |= SHF_MIPS_NOSTRIP;
       /* The sh_link field is set in final_write_processing.  */
     }
+  else if (strcmp (name, MIPS_ELF_MSYM_SECTION_NAME (abfd)) == 0)
+    {
+      hdr->sh_type = SHT_MIPS_MSYM;
+      hdr->sh_flags |= SHF_ALLOC;
+      hdr->sh_entsize = 8;
+    }
+
+  /* The generic elf_fake_sections will set up REL_HDR using the
+     default kind of relocations.  But, we may actually need both
+     kinds of relocations, so we set up the second header here.  */
+  if ((sec->flags & SEC_RELOC) != 0)
+    {
+      struct bfd_elf_section_data *esd;
+
+      esd = elf_section_data (sec);
+      BFD_ASSERT (esd->rel_hdr2 == NULL);
+      esd->rel_hdr2 
+	= (Elf_Internal_Shdr *) bfd_zalloc (abfd, sizeof (Elf_Internal_Shdr));
+      if (!esd->rel_hdr2)
+	return false;
+      _bfd_elf_init_reloc_shdr (abfd, esd->rel_hdr2, sec,
+				!elf_section_data (sec)->use_rela_p);
+    }
 
   return true;
 }
@@ -2567,8 +2862,8 @@
 
 boolean
 _bfd_mips_elf_section_from_bfd_section (abfd, hdr, sec, retval)
-     bfd *abfd;
-     Elf32_Internal_Shdr *hdr;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     Elf32_Internal_Shdr *hdr ATTRIBUTE_UNUSED;
      asection *sec;
      int *retval;
 {
@@ -2597,8 +2892,7 @@
      file_ptr offset;
      bfd_size_type count;
 {
-  if (strcmp (section->name, ".options") == 0
-      || strcmp (section->name, ".MIPS.options") == 0)
+  if (strcmp (section->name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0)
     {
       bfd_byte *c;
 
@@ -2641,57 +2935,8 @@
      bfd *abfd;
      Elf_Internal_Shdr *hdr;
 {
-  if (hdr->bfd_section != NULL)
-    {
-      const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
-
-      if (strcmp (name, ".sdata") == 0)
-	{
-	  hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
-	  hdr->sh_type = SHT_PROGBITS;
-	}
-      else if (strcmp (name, ".sbss") == 0)
-	{
-	  hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
-	  hdr->sh_type = SHT_NOBITS;
-	}
-      else if (strcmp (name, ".lit8") == 0
-	       || strcmp (name, ".lit4") == 0)
-	{
-	  hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
-	  hdr->sh_type = SHT_PROGBITS;
-	}
-      else if (strcmp (name, ".compact_rel") == 0)
-	{
-	  hdr->sh_flags = 0;
-	  hdr->sh_type = SHT_PROGBITS;
-	}
-      else if (strcmp (name, ".rtproc") == 0)
-	{
-	  if (hdr->sh_addralign != 0 && hdr->sh_entsize == 0)
-	    {
-	      unsigned int adjust;
-
-	      adjust = hdr->sh_size % hdr->sh_addralign;
-	      if (adjust != 0)
-		hdr->sh_size += hdr->sh_addralign - adjust;
-	    }
-	}
-    }
-
-  return true;
-}
-
-/* Work over a section just before writing it out.  We update the GP
-   value in the SHT_MIPS_REGINFO and SHT_MIPS_OPTIONS sections based
-   on the value we are using.  */
-
-static boolean
-mips_elf32_section_processing (abfd, hdr)
-     bfd *abfd;
-     Elf32_Internal_Shdr *hdr;
-{
-  if (hdr->sh_type == SHT_MIPS_REGINFO)
+  if (hdr->sh_type == SHT_MIPS_REGINFO
+      && hdr->sh_size > 0)
     {
       bfd_byte buf[4];
 
@@ -2730,7 +2975,22 @@
 
 	  bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l,
 					&intopt);
-	  if (intopt.kind == ODK_REGINFO)
+	  if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO)
+	    {
+	      bfd_byte buf[8];
+
+	      if (bfd_seek (abfd,
+			    (hdr->sh_offset
+			     + (l - contents)
+			     + sizeof (Elf_External_Options)
+			     + (sizeof (Elf64_External_RegInfo) - 8)),
+			     SEEK_SET) == -1)
+		return false;
+	      bfd_h_put_64 (abfd, elf_gp (abfd), buf);
+	      if (bfd_write (buf, 1, 8, abfd) != 8)
+		return false;
+	    }
+	  else if (intopt.kind == ODK_REGINFO)
 	    {
 	      bfd_byte buf[4];
 
@@ -2749,8 +3009,48 @@
 	}
     }
 
-  return _bfd_mips_elf_section_processing (abfd, hdr);
+  if (hdr->bfd_section != NULL)
+    {
+      const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
+
+      if (strcmp (name, ".sdata") == 0
+	  || strcmp (name, ".lit8") == 0
+	  || strcmp (name, ".lit4") == 0)
+	{
+	  hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
+	  hdr->sh_type = SHT_PROGBITS;
+	}
+      else if (strcmp (name, ".sbss") == 0)
+	{
+	  hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
+	  hdr->sh_type = SHT_NOBITS;
+	}
+      else if (strcmp (name, MIPS_ELF_SRDATA_SECTION_NAME (abfd)) == 0)
+	{
+	  hdr->sh_flags |= SHF_ALLOC | SHF_MIPS_GPREL;
+	  hdr->sh_type = SHT_PROGBITS;
+	}
+      else if (strcmp (name, ".compact_rel") == 0)
+	{
+	  hdr->sh_flags = 0;
+	  hdr->sh_type = SHT_PROGBITS;
+	}
+      else if (strcmp (name, ".rtproc") == 0)
+	{
+	  if (hdr->sh_addralign != 0 && hdr->sh_entsize == 0)
+	    {
+	      unsigned int adjust;
+
+	      adjust = hdr->sh_size % hdr->sh_addralign;
+	      if (adjust != 0)
+		hdr->sh_size += hdr->sh_addralign - adjust;
+	    }
+	}
+    }
+
+  return true;
 }
+
 
 /* MIPS ELF uses two common sections.  One is the usual one, and the
    other is for small objects.  All the small objects are kept
@@ -2817,8 +3117,9 @@
 
     case SHN_COMMON:
       /* Common symbols less than the GP size are automatically
-	 treated as SHN_MIPS_SCOMMON symbols.  */
-      if (asym->value > elf_gp_size (abfd))
+	 treated as SHN_MIPS_SCOMMON symbols on IRIX5.  */
+      if (asym->value > elf_gp_size (abfd)
+	  || IRIX_COMPAT (abfd) == ict_irix6)
 	break;
       /* Fall through.  */
     case SHN_MIPS_SCOMMON:
@@ -2858,39 +3159,40 @@
 /* When creating an Irix 5 executable, we need REGINFO and RTPROC
    segments.  */
 
-static int
-mips_elf_additional_program_headers (abfd)
+int
+_bfd_mips_elf_additional_program_headers (abfd)
      bfd *abfd;
 {
   asection *s;
-  int ret;
+  int ret = 0;
 
-  ret = 0;
+  if (!SGI_COMPAT (abfd))
+    return 0;
 
-  if (! SGI_COMPAT (abfd))
-    return ret;
-
+  /* See if we need a PT_MIPS_REGINFO segment.  */
   s = bfd_get_section_by_name (abfd, ".reginfo");
-  if (s != NULL && (s->flags & SEC_LOAD) != 0)
-    {
-      /* We need a PT_MIPS_REGINFO segment.  */
-      ++ret;
-    }
+  if (s && (s->flags & SEC_LOAD))
+    ++ret;
 
-  if (bfd_get_section_by_name (abfd, ".dynamic") != NULL
-      && bfd_get_section_by_name (abfd, ".mdebug") != NULL)
-    {
-      /* We need a PT_MIPS_RTPROC segment.  */
-      ++ret;
-    }
+  /* See if we need a PT_MIPS_OPTIONS segment.  */
+  if (IRIX_COMPAT (abfd) == ict_irix6
+      && bfd_get_section_by_name (abfd, 
+				  MIPS_ELF_OPTIONS_SECTION_NAME (abfd)))
+    ++ret;
+
+  /* See if we need a PT_MIPS_RTPROC segment.  */
+  if (IRIX_COMPAT (abfd) == ict_irix5
+      && bfd_get_section_by_name (abfd, ".dynamic")
+      && bfd_get_section_by_name (abfd, ".mdebug"))
+    ++ret;
 
   return ret;
 }
 
 /* Modify the segment map for an Irix 5 executable.  */
 
-static boolean
-mips_elf_modify_segment_map (abfd)
+boolean
+_bfd_mips_elf_modify_segment_map (abfd)
      bfd *abfd;
 {
   asection *s;
@@ -2929,114 +3231,156 @@
 	}
     }
 
-  /* If there are .dynamic and .mdebug sections, we make a room for
-     the RTPROC header.  FIXME: Rewrite without section names.  */
-  if (bfd_get_section_by_name (abfd, ".interp") == NULL
-      && bfd_get_section_by_name (abfd, ".dynamic") != NULL
-      && bfd_get_section_by_name (abfd, ".mdebug") != NULL)
+  /* For IRIX 6, we don't have .mdebug sections, nor does anything but
+     .dynamic end up in PT_DYNAMIC.  However, we do have to insert a
+     PT_OPTIONS segement immediately following the program header
+     table.  */
+  if (IRIX_COMPAT (abfd) == ict_irix6)
     {
-      for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
-	if (m->p_type == PT_MIPS_RTPROC)
+      asection *s;
+
+      for (s = abfd->sections; s; s = s->next)
+	if (elf_section_data (s)->this_hdr.sh_type == SHT_MIPS_OPTIONS)
 	  break;
-      if (m == NULL)
+
+      if (s)
 	{
-	  m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m);
-	  if (m == NULL)
-	    return false;
+	  struct elf_segment_map *options_segment;
 
-	  m->p_type = PT_MIPS_RTPROC;
+	  /* Usually, there's a program header table.  But, sometimes
+	     there's not (like when running the `ld' testsuite).  So,
+	     if there's no program header table, we just put the
+	     options segement at the end.  */
+	  for (pm = &elf_tdata (abfd)->segment_map; 
+	       *pm != NULL;
+	       pm = &(*pm)->next)
+	    if ((*pm)->p_type == PT_PHDR)
+	      break;
 
-	  s = bfd_get_section_by_name (abfd, ".rtproc");
-	  if (s == NULL)
-	    {
-	      m->count = 0;
-	      m->p_flags = 0;
-	      m->p_flags_valid = 1;
-	    }
-	  else
-	    {
-	      m->count = 1;
-	      m->sections[0] = s;
-	    }
-
-	  /* We want to put it after the DYNAMIC segment.  */
-	  pm = &elf_tdata (abfd)->segment_map;
-	  while (*pm != NULL && (*pm)->p_type != PT_DYNAMIC)
-	    pm = &(*pm)->next;
-	  if (*pm != NULL)
-	    pm = &(*pm)->next;
-
-	  m->next = *pm;
-	  *pm = m;
+	  options_segment = bfd_zalloc (abfd, 
+					sizeof (struct elf_segment_map));
+	  options_segment->next = *pm;
+	  options_segment->p_type = PT_MIPS_OPTIONS;
+	  options_segment->p_flags = PF_R;
+	  options_segment->p_flags_valid = true;
+	  options_segment->count = 1;
+	  options_segment->sections[0] = s;
+	  *pm = options_segment;
 	}
     }
-
-  /* On Irix 5, the PT_DYNAMIC segment includes the .dynamic, .dynstr,
-     .dynsym, and .hash sections, and everything in between.  */
-  for (pm = &elf_tdata (abfd)->segment_map; *pm != NULL; pm = &(*pm)->next)
-    if ((*pm)->p_type == PT_DYNAMIC)
-      break;
-  m = *pm;
-  if (m != NULL
-      && m->count == 1
-      && strcmp (m->sections[0]->name, ".dynamic") == 0)
+  else
     {
-      static const char *sec_names[] =
-	{ ".dynamic", ".dynstr", ".dynsym", ".hash" };
-      bfd_vma low, high;
-      unsigned int i, c;
-      struct elf_segment_map *n;
-
-      low = 0xffffffff;
-      high = 0;
-      for (i = 0; i < sizeof sec_names / sizeof sec_names[0]; i++)
+      /* If there are .dynamic and .mdebug sections, we make a room
+	 for the RTPROC header.  FIXME: Rewrite without section names.  */
+      if (bfd_get_section_by_name (abfd, ".interp") == NULL
+	  && bfd_get_section_by_name (abfd, ".dynamic") != NULL
+	  && bfd_get_section_by_name (abfd, ".mdebug") != NULL)
 	{
-	  s = bfd_get_section_by_name (abfd, sec_names[i]);
-	  if (s != NULL && (s->flags & SEC_LOAD) != 0)
+	  for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
+	    if (m->p_type == PT_MIPS_RTPROC)
+	      break;
+	  if (m == NULL)
 	    {
-	      bfd_size_type sz;
+	      m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m);
+	      if (m == NULL)
+		return false;
 
-	      if (low > s->vma)
-		low = s->vma;
-	      sz = s->_cooked_size;
-	      if (sz == 0)
-		sz = s->_raw_size;
-	      if (high < s->vma + sz)
-		high = s->vma + sz;
+	      m->p_type = PT_MIPS_RTPROC;
+
+	      s = bfd_get_section_by_name (abfd, ".rtproc");
+	      if (s == NULL)
+		{
+		  m->count = 0;
+		  m->p_flags = 0;
+		  m->p_flags_valid = 1;
+		}
+	      else
+		{
+		  m->count = 1;
+		  m->sections[0] = s;
+		}
+
+	      /* We want to put it after the DYNAMIC segment.  */
+	      pm = &elf_tdata (abfd)->segment_map;
+	      while (*pm != NULL && (*pm)->p_type != PT_DYNAMIC)
+		pm = &(*pm)->next;
+	      if (*pm != NULL)
+		pm = &(*pm)->next;
+
+	      m->next = *pm;
+	      *pm = m;
 	    }
 	}
 
-      c = 0;
-      for (s = abfd->sections; s != NULL; s = s->next)
-	if ((s->flags & SEC_LOAD) != 0
-	    && s->vma >= low
-	    && ((s->vma
-		 + (s->_cooked_size != 0 ? s->_cooked_size : s->_raw_size))
-		<= high))
-	  ++c;
-
-      n = ((struct elf_segment_map *)
-	   bfd_zalloc (abfd, sizeof *n + (c - 1) * sizeof (asection *)));
-      if (n == NULL)
-	return false;
-      *n = *m;
-      n->count = c;
-
-      i = 0;
-      for (s = abfd->sections; s != NULL; s = s->next)
+      /* On Irix 5, the PT_DYNAMIC segment includes the .dynamic,
+	 .dynstr, .dynsym, and .hash sections, and everything in
+	 between.  */
+      for (pm = &elf_tdata (abfd)->segment_map; *pm != NULL; pm = &(*pm)->next)
+	if ((*pm)->p_type == PT_DYNAMIC)
+	  break;
+      m = *pm;
+      if (m != NULL
+	  && m->count == 1
+	  && strcmp (m->sections[0]->name, ".dynamic") == 0)
 	{
-	  if ((s->flags & SEC_LOAD) != 0
-	      && s->vma >= low
-	      && ((s->vma
-		   + (s->_cooked_size != 0 ? s->_cooked_size : s->_raw_size))
-		  <= high))
-	    {
-	      n->sections[i] = s;
-	      ++i;
-	    }
-	}
+	  static const char *sec_names[] =
+	  { ".dynamic", ".dynstr", ".dynsym", ".hash" };
+	  bfd_vma low, high;
+	  unsigned int i, c;
+	  struct elf_segment_map *n;
 
-      *pm = n;
+	  low = 0xffffffff;
+	  high = 0;
+	  for (i = 0; i < sizeof sec_names / sizeof sec_names[0]; i++)
+	    {
+	      s = bfd_get_section_by_name (abfd, sec_names[i]);
+	      if (s != NULL && (s->flags & SEC_LOAD) != 0)
+		{
+		  bfd_size_type sz;
+
+		  if (low > s->vma)
+		    low = s->vma;
+		  sz = s->_cooked_size;
+		  if (sz == 0)
+		    sz = s->_raw_size;
+		  if (high < s->vma + sz)
+		    high = s->vma + sz;
+		}
+	    }
+
+	  c = 0;
+	  for (s = abfd->sections; s != NULL; s = s->next)
+	    if ((s->flags & SEC_LOAD) != 0
+		&& s->vma >= low
+		&& ((s->vma
+		     + (s->_cooked_size != 0 ? s->_cooked_size : s->_raw_size))
+		    <= high))
+	      ++c;
+
+	  n = ((struct elf_segment_map *)
+	       bfd_zalloc (abfd, sizeof *n + (c - 1) * sizeof (asection *)));
+	  if (n == NULL)
+	    return false;
+	  *n = *m;
+	  n->count = c;
+
+	  i = 0;
+	  for (s = abfd->sections; s != NULL; s = s->next)
+	    {
+	      if ((s->flags & SEC_LOAD) != 0
+		  && s->vma >= low
+		  && ((s->vma
+		       + (s->_cooked_size != 0 ?
+			  s->_cooked_size : s->_raw_size))
+		      <= high))
+		{
+		  n->sections[i] = s;
+		  ++i;
+		}
+	    }
+
+	  *pm = n;
+	}
     }
 
   return true;
@@ -3225,7 +3569,8 @@
 
   if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
 				     filename_ptr, functionname_ptr,
-				     line_ptr))
+				     line_ptr, 
+				     ABI_64_P (abfd) ? 8 : 0))
     return true;
 
   msec = bfd_get_section_by_name (abfd, ".mdebug");
@@ -3349,36 +3694,6 @@
 #define CALL_STUB ".mips16.call."
 #define CALL_FP_STUB ".mips16.call.fp."
 
-/* The MIPS ELF linker needs additional information for each symbol in
-   the global hash table.  */
-
-struct mips_elf_link_hash_entry
-{
-  struct elf_link_hash_entry root;
-
-  /* External symbol information.  */
-  EXTR esym;
-
-  /* Number of MIPS_32 or MIPS_REL32 relocs against this symbol.  */
-  unsigned int mips_32_relocs;
-
-  /* If there is a stub that 32 bit functions should use to call this
-     16 bit function, this points to the section containing the stub.  */
-  asection *fn_stub;
-
-  /* Whether we need the fn_stub; this is set if this symbol appears
-     in any relocs other than a 16 bit call.  */
-  boolean need_fn_stub;
-
-  /* If there is a stub that 16 bit functions should use to call this
-     32 bit function, this points to the section containing the stub.  */
-  asection *call_stub;
-
-  /* This is like the call_stub field, but it is used if the function
-     being called returns a floating point value.  */
-  asection *call_fp_stub;
-};
-
 /* MIPS ELF linker hash table.  */
 
 struct mips_elf_link_hash_table
@@ -3456,7 +3771,8 @@
       /* We use -2 as a marker to indicate that the information has
 	 not been set.  -1 means there is no associated ifd.  */
       ret->esym.ifd = -2;
-      ret->mips_32_relocs = 0;
+      ret->possibly_dynamic_relocs = 0;
+      ret->min_dyn_reloc_index = 0;
       ret->fn_stub = NULL;
       ret->need_fn_stub = false;
       ret->call_stub = NULL;
@@ -3468,8 +3784,8 @@
 
 /* Create a MIPS ELF linker hash table.  */
 
-static struct bfd_link_hash_table *
-mips_elf_link_hash_table_create (abfd)
+struct bfd_link_hash_table *
+_bfd_mips_elf_link_hash_table_create (abfd)
      bfd *abfd;
 {
   struct mips_elf_link_hash_table *ret;
@@ -3504,13 +3820,13 @@
    file.  We must handle the special MIPS section numbers here.  */
 
 /*ARGSUSED*/
-static boolean
-mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
+boolean
+_bfd_mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd *abfd;
      struct bfd_link_info *info;
      const Elf_Internal_Sym *sym;
      const char **namep;
-     flagword *flagsp;
+     flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
      bfd_vma *valp;
 {
@@ -3528,7 +3844,8 @@
     case SHN_COMMON:
       /* Common symbols less than the GP size are automatically
 	 treated as SHN_MIPS_SCOMMON symbols.  */
-      if (sym->st_size > elf_gp_size (abfd))
+      if (sym->st_size > elf_gp_size (abfd)
+	  || IRIX_COMPAT (abfd) == ict_irix6)
 	break;
       /* Fall through.  */
     case SHN_MIPS_SCOMMON:
@@ -3981,8 +4298,8 @@
    the .mdebug sections.  We need to merge all instances of these
    sections together, not write them all out sequentially.  */
 
-static boolean
-mips_elf_final_link (abfd, info)
+boolean
+_bfd_mips_elf_final_link (abfd, info)
      bfd *abfd;
      struct bfd_link_info *info;
 {
@@ -3998,22 +4315,68 @@
   HDRR *symhdr = &debug.symbolic_header;
   PTR mdebug_handle = NULL;
 
-  /* Drop the .options section, since it has special semantics which I
-     haven't bothered to figure out.  */
-  for (secpp = &abfd->sections; *secpp != NULL; secpp = &(*secpp)->next)
+  /* If all the things we linked together were PIC, but we're
+     producing an executable (rather than a shared object), then the
+     resulting file is CPIC (i.e., it calls PIC code.)  */
+  if (!info->shared
+      && !info->relocateable
+      && elf_elfheader (abfd)->e_flags & EF_MIPS_PIC)
     {
-      if (strcmp ((*secpp)->name, ".options") == 0)
-	{
-	  for (p = (*secpp)->link_order_head; p != NULL; p = p->next)
-	    if (p->type == bfd_indirect_link_order)
-	      p->u.indirect.section->flags &=~ SEC_HAS_CONTENTS;
-	  (*secpp)->link_order_head = NULL;
-	  *secpp = (*secpp)->next;
-	  --abfd->section_count;
-	  break;
-	}
+      elf_elfheader (abfd)->e_flags &= ~EF_MIPS_PIC;
+      elf_elfheader (abfd)->e_flags |= EF_MIPS_CPIC;
     }
 
+  /* We'd carefully arranged the dynamic symbol indices, and then the
+     generic size_dynamic_sections renumbered them out from under us.
+     Rather than trying somehow to prevent the renumbering, just do
+     the sort again.  */
+  if (elf_hash_table (info)->dynobj)
+    {
+      bfd *dynobj;
+      asection *got;
+      struct mips_got_info *g;
+
+      /* When we resort, we must tell mips_elf_sort_hash_table what
+	 the lowest index it may use is.  That's the number of section
+	 symbols we're going to add.  The generic ELF linker only
+	 adds these symbols when building a shared object.  Note that
+	 we count the sections after (possibly) removing the .options
+	 section above.  */
+      if (!mips_elf_sort_hash_table (info, (info->shared 
+					    ? bfd_count_sections (abfd) + 1
+					    : 1)))
+        return false;
+
+      /* Make sure we didn't grow the global .got region.  */
+      dynobj = elf_hash_table (info)->dynobj;
+      got = bfd_get_section_by_name (dynobj, ".got");
+      g = (struct mips_got_info *) elf_section_data (got)->tdata;
+
+      BFD_ASSERT ((elf_hash_table (info)->dynsymcount
+		   - g->global_gotsym->dynindx)
+		  <= g->global_gotno);
+    }
+
+  /* On IRIX5, we omit the .options section.  On IRIX6, however, we
+     include it, even though we don't process it quite right.  (Some
+     entries are supposed to be merged.)  Empirically, we seem to be
+     better off including it then not.  */
+  if (IRIX_COMPAT (abfd) == ict_irix5)
+    for (secpp = &abfd->sections; *secpp != NULL; secpp = &(*secpp)->next)
+      {
+	if (strcmp ((*secpp)->name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0)
+	  {
+	    for (p = (*secpp)->link_order_head; p != NULL; p = p->next)
+	      if (p->type == bfd_indirect_link_order)
+		p->u.indirect.section->flags &=~ SEC_HAS_CONTENTS;
+	    (*secpp)->link_order_head = NULL;
+	    *secpp = (*secpp)->next;
+	    --abfd->section_count;
+	    
+	    break;
+	  }
+      }
+
   /* Get a value for the GP register.  */
   if (elf_gp (abfd) == 0)
     {
@@ -4029,17 +4392,14 @@
 	{
 	  bfd_vma lo;
 
-	  /* Make up a value.  */
+	  /* Find the GP-relative section with the lowest offset.  */
 	  lo = (bfd_vma) -1;
 	  for (o = abfd->sections; o != (asection *) NULL; o = o->next)
-	    {
-	      if (o->vma < lo
-		  && (strcmp (o->name, ".sbss") == 0
-		      || strcmp (o->name, ".sdata") == 0
-		      || strcmp (o->name, ".lit4") == 0
-		      || strcmp (o->name, ".lit8") == 0))
-		lo = o->vma;
-	    }
+	    if (o->vma < lo 
+		&& (elf_section_data (o)->this_hdr.sh_flags & SHF_MIPS_GPREL))
+	      lo = o->vma;
+
+	  /* And calculate GP relative to that.  */
 	  elf_gp (abfd) = lo + ELF_MIPS_GP_OFFSET (abfd);
 	}
       else
@@ -4572,7 +4932,17 @@
     }
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (! bfd_elf32_bfd_final_link (abfd, info))
+  if (ABI_64_P (abfd))
+    {
+#ifdef BFD64
+      if (!bfd_elf64_bfd_final_link (abfd, info))
+	return false;
+#else
+      abort ();
+      return false;
+#endif /* BFD64 */
+    }
+  else if (!bfd_elf32_bfd_final_link (abfd, info))
     return false;
 
   /* Now write out the computed sections.  */
@@ -4750,11 +5120,1306 @@
 	      contents + rel->r_offset);
 }
 
-/* Relocate a MIPS ELF section.  */
+/* Returns the GOT section for ABFD.  */
+
+static asection *
+mips_elf_got_section (abfd)
+     bfd *abfd;
+{
+  return bfd_get_section_by_name (abfd, ".got");
+}
+
+/* Returns the GOT information associated with the link indicated by
+   INFO.  If SGOTP is non-NULL, it is filled in with the GOT 
+   section.  */
+
+static struct mips_got_info *
+mips_elf_got_info (abfd, sgotp)
+     bfd *abfd;
+     asection **sgotp;
+{
+  asection *sgot;
+  struct mips_got_info *g;
+
+  sgot = mips_elf_got_section (abfd);
+  BFD_ASSERT (sgot != NULL);
+  BFD_ASSERT (elf_section_data (sgot) != NULL);
+  g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
+  BFD_ASSERT (g != NULL);
+
+  if (sgotp)
+    *sgotp = sgot;
+  return g;
+}
+
+/* Return whether a relocation is against a local symbol.  */
 
 static boolean
-mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
-			   contents, relocs, local_syms, local_sections)
+mips_elf_local_relocation_p (input_bfd, relocation, local_sections)
+     bfd *input_bfd;
+     const Elf_Internal_Rela *relocation;
+     asection **local_sections;
+{
+  unsigned long r_symndx;
+  Elf_Internal_Shdr *symtab_hdr;
+
+  r_symndx = ELF32_R_SYM (relocation->r_info);
+  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  if (! elf_bad_symtab (input_bfd))
+    return r_symndx < symtab_hdr->sh_info;
+  else
+    {
+      /* The symbol table does not follow the rule that local symbols
+	 must come before globals.  */
+      return local_sections[r_symndx] != NULL;
+    }
+}
+
+/* Sign-extend VALUE, which has the indicated number of BITS.  */
+
+static bfd_vma
+mips_elf_sign_extend (value, bits)
+     bfd_vma value;
+     int bits;
+{
+  if (value & (1 << (bits - 1)))
+    /* VALUE is negative.  */
+    value |= ((bfd_vma) - 1) << bits;      
+  
+  return value;
+}
+
+/* Return non-zero if the indicated VALUE has overflowed the maximum
+   range expressable by a signed number with the indicated number of
+   BITS.  */
+
+static boolean
+mips_elf_overflow_p (value, bits)
+     bfd_vma value;
+     int bits;
+{
+  bfd_signed_vma svalue = (bfd_signed_vma) value;
+
+  if (svalue > (1 << (bits - 1)) - 1)
+    /* The value is too big.  */
+    return true;
+  else if (svalue < -(1 << (bits - 1)))
+    /* The value is too small.  */
+    return true;
+    
+  /* All is well.  */
+  return false;
+}
+
+/* Calculate the %high function.  */
+
+static bfd_vma
+mips_elf_high (value)
+     bfd_vma value;
+{
+  return ((value + (bfd_vma) 0x8000) >> 16) & 0xffff;
+}
+
+/* Calculate the %higher function.  */
+
+static bfd_vma
+mips_elf_higher (value)
+     bfd_vma value ATTRIBUTE_UNUSED;
+{
+#ifdef BFD64
+  return ((value + (bfd_vma) 0x80008000) >> 32) & 0xffff;
+#else
+  abort ();
+  return (bfd_vma) -1;
+#endif
+}
+
+/* Calculate the %highest function.  */
+
+static bfd_vma 
+mips_elf_highest (value)
+     bfd_vma value ATTRIBUTE_UNUSED;
+{
+#ifdef BFD64
+  return ((value + (bfd_vma) 0x800080008000) > 48) & 0xffff;
+#else
+  abort ();
+  return (bfd_vma) -1;
+#endif
+}
+
+/* Returns the GOT index for the global symbol indicated by H.  */
+
+static bfd_vma 
+mips_elf_global_got_index (abfd, h)
+     bfd *abfd;
+     struct elf_link_hash_entry *h;
+{
+  bfd_vma index;
+  asection *sgot;
+  struct mips_got_info *g;
+
+  g = mips_elf_got_info (abfd, &sgot);
+
+  /* Once we determine the global GOT entry with the lowest dynamic
+     symbol table index, we must put all dynamic symbols with greater
+     indices into the GOT.  That makes it easy to calculate the GOT
+     offset.  */
+  BFD_ASSERT (h->dynindx >= g->global_gotsym->dynindx);
+  index = ((h->dynindx - g->global_gotsym->dynindx + g->local_gotno) 
+	   * MIPS_ELF_GOT_SIZE (abfd));
+  BFD_ASSERT (index < sgot->_raw_size);
+
+  return index;
+}
+
+/* Returns the offset for the entry at the INDEXth position
+   in the GOT.  */
+
+static bfd_vma
+mips_elf_got_offset_from_index (dynobj, output_bfd, index)
+     bfd *dynobj;
+     bfd *output_bfd;
+     bfd_vma index;
+{
+  asection *sgot;
+  bfd_vma gp;
+
+  sgot = mips_elf_got_section (dynobj);
+  gp = _bfd_get_gp_value (output_bfd);
+  return (sgot->output_section->vma + sgot->output_offset + index - 
+	  gp);
+}
+
+/* If H is a symbol that needs a global GOT entry, but has a dynamic
+   symbol table index lower than any we've seen to date, record it for
+   posterity.  */
+
+static boolean
+mips_elf_record_global_got_symbol (h, info, g)
+     struct elf_link_hash_entry *h;
+     struct bfd_link_info *info;
+     struct mips_got_info *g ATTRIBUTE_UNUSED;
+{
+  /* A global symbol in the GOT must also be in the dynamic symbol
+     table.  */
+  if (h->dynindx == -1
+      && !bfd_elf32_link_record_dynamic_symbol (info, h))
+    return false;
+  
+  /* If we've already marked this entry as need GOT space, we don't
+     need to do it again.  */
+  if (h->got.offset != (bfd_vma) - 1)
+    return true;
+
+  /* By setting this to a value other than -1, we are indicating that
+     there needs to be a GOT entry for H.  */
+  h->got.offset = 0;
+
+  return true;
+}
+
+/* This structure is passed to mips_elf_sort_hash_table_f when sorting
+   the dynamic symbols.  */
+     
+struct mips_elf_hash_sort_data
+{
+  /* The symbol in the global GOT with the lowest dynamic symbol table
+     index.  */
+  struct elf_link_hash_entry *low;
+  /* The least dynamic symbol table index corresponding to a symbol
+     with a GOT entry.  */
+  long min_got_dynindx;
+  /* The greatest dynamic symbol table index not corresponding to a
+     symbol without a GOT entry.  */
+  long max_non_got_dynindx;
+};
+
+/* If H needs a GOT entry, assign it the highest available dynamic
+   index.  Otherwise, assign it the lowest available dynamic 
+   index.  */
+
+static boolean
+mips_elf_sort_hash_table_f (h, data)
+     struct mips_elf_link_hash_entry *h;
+     PTR data;
+{
+  struct mips_elf_hash_sort_data *hsd 
+    = (struct mips_elf_hash_sort_data *) data;
+
+  /* Symbols without dynamic symbol table entries aren't interesting
+     at all.  */
+  if (h->root.dynindx == -1)
+    return true;
+
+  if (h->root.got.offset != 0)
+    h->root.dynindx = hsd->max_non_got_dynindx++;
+  else
+    {
+      h->root.dynindx = --hsd->min_got_dynindx;
+      hsd->low = (struct elf_link_hash_entry *) h;
+    }
+
+  return true;
+}
+
+/* Sort the dynamic symbol table so that symbols that need GOT entries
+   appear towards the end.  This reduces the amount of GOT space
+   required.  MAX_LOCAL is used to set the number of local symbols
+   known to be in the dynamic symbol table.  During
+   mips_elf_size_dynamic_sections, this value is 1.  Afterward, the
+   section symbols are added and the count is higher.  */
+
+static boolean
+mips_elf_sort_hash_table (info, max_local)
+     struct bfd_link_info *info;
+     unsigned long max_local;
+{
+  struct mips_elf_hash_sort_data hsd;
+  struct mips_got_info *g;
+  bfd *dynobj;
+
+  dynobj = elf_hash_table (info)->dynobj;
+
+  hsd.low = NULL;
+  hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount;
+  hsd.max_non_got_dynindx = max_local;
+  mips_elf_link_hash_traverse (((struct mips_elf_link_hash_table *) 
+				elf_hash_table (info)), 
+			       mips_elf_sort_hash_table_f, 
+			       &hsd);
+
+  /* There shoud have been enough room in the symbol table to
+     accomodate both the GOT and non-GOT symbols.  */
+  BFD_ASSERT (hsd.min_got_dynindx == hsd.max_non_got_dynindx);
+
+  /* Now we know which dynamic symbol has the lowest dynamic symbol
+     table index in the GOT.  */
+  g = mips_elf_got_info (dynobj, NULL);
+  g->global_gotsym = hsd.low;
+
+  return true;
+}
+
+/* Create a local GOT entry for VALUE.  Return the index of the entry,
+   or -1 if it could not be created.  */
+
+static bfd_vma
+mips_elf_create_local_got_entry (abfd, g, sgot, value)
+     bfd *abfd;
+     struct mips_got_info *g;
+     asection *sgot;
+     bfd_vma value;
+{
+  if (g->assigned_gotno >= g->local_gotno)
+    {
+      /* We didn't allocate enough space in the GOT.  */
+      (*_bfd_error_handler)
+	(_("not enough GOT space for local GOT entries"));
+      bfd_set_error (bfd_error_bad_value);
+      return (bfd_vma) -1;
+    }
+
+  MIPS_ELF_PUT_WORD (abfd, value,
+		     (sgot->contents 
+		      + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno));
+  return MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno++;
+}
+
+/* Returns the GOT offset at which the indicated address can be found.
+   If there is not yet a GOT entry for this value, create one.  Returns
+   -1 if no satisfactory GOT offset can be found.  */
+
+static bfd_vma
+mips_elf_local_got_index (abfd, info, value)
+     bfd *abfd;
+     struct bfd_link_info *info;
+     bfd_vma value;
+{
+  asection *sgot;
+  struct mips_got_info *g;
+  bfd_byte *entry;
+
+  g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
+
+  /* Look to see if we already have an appropriate entry.  */
+  for (entry = (sgot->contents 
+		+ MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO); 
+       entry != sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno;
+       entry += MIPS_ELF_GOT_SIZE (abfd))
+    {
+      bfd_vma address = MIPS_ELF_GET_WORD (abfd, entry);
+      if (address == value)
+	return entry - sgot->contents;
+    }
+
+  return mips_elf_create_local_got_entry (abfd, g, sgot, value);
+}
+
+/* Find a GOT entry that is within 32KB of the VALUE.  These entries
+   are supposed to be placed at small offsets in the GOT, i.e.,
+   within 32KB of GP.  Return the index into the GOT for this page,
+   and store the offset from this entry to the desired address in
+   OFFSETP, if it is non-NULL.  */
+
+static bfd_vma
+mips_elf_got_page (abfd, info, value, offsetp)
+     bfd *abfd;
+     struct bfd_link_info *info;
+     bfd_vma value;
+     bfd_vma *offsetp;
+{
+  asection *sgot;
+  struct mips_got_info *g;
+  bfd_byte *entry;
+  bfd_byte *last_entry;
+  bfd_vma index;
+  bfd_vma address;
+
+  g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
+
+  /* Look to see if we aleady have an appropriate entry.  */
+  last_entry = sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno;
+  for (entry = (sgot->contents 
+		+ MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO);
+       entry != last_entry;
+       entry += MIPS_ELF_GOT_SIZE (abfd))
+    {
+      address = MIPS_ELF_GET_WORD (abfd, entry);
+
+      if (!mips_elf_overflow_p (value - address, 16))
+	{
+	  /* This entry will serve as the page pointer.  We can add a
+	     16-bit number to it to get the actual address.  */
+	  index = entry - sgot->contents;
+	  break;
+	}
+    }
+
+  /* If we didn't have an appropriate entry, we create one now.  */
+  if (entry == last_entry)
+    index = mips_elf_create_local_got_entry (abfd, g, sgot, value);
+
+  if (offsetp)
+    {
+      address = MIPS_ELF_GET_WORD (abfd, entry);
+      *offsetp = value - address;
+    }
+
+  return index;
+}
+
+/* Find a GOT entry whose higher-order 16 bits are the same as those
+   for value.  Return the index into the GOT for this entry.  */
+
+static bfd_vma
+mips_elf_got16_entry (abfd, info, value)
+     bfd *abfd;
+     struct bfd_link_info *info;
+     bfd_vma value;
+{
+  asection *sgot;
+  struct mips_got_info *g;
+  bfd_byte *entry;
+  bfd_byte *last_entry;
+  bfd_vma index;
+  bfd_vma address;
+
+  value &= 0xffff0000;
+  g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
+
+  /* Look to see if we already have an appropriate entry.  */
+  last_entry = sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno;
+  for (entry = (sgot->contents 
+		+ MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO);
+       entry != last_entry;
+       entry += MIPS_ELF_GOT_SIZE (abfd))
+    {
+      address = MIPS_ELF_GET_WORD (abfd, entry);
+      if ((address & 0xffff0000) == value)
+	{
+	  /* This entry has the right high-order 16 bits.  */
+	  index = MIPS_ELF_GOT_SIZE (abfd) * (entry - sgot->contents);
+	  break;
+	}
+    }
+
+  /* If we didn't have an appropriate entry, we create one now.  */
+  if (entry == last_entry)
+    index = mips_elf_create_local_got_entry (abfd, g, sgot, value);
+
+  return index;
+}
+
+/* Sets *ADDENDP to the addend for the first R_MIPS_LO16 relocation
+   found, beginning with RELOCATION.  RELEND is one-past-the-end of
+   the relocation table.  */
+
+static boolean
+mips_elf_next_lo16_addend (relocation, relend, addendp)
+     const Elf_Internal_Rela *relocation;
+     const Elf_Internal_Rela *relend;
+     bfd_vma *addendp;
+{
+  /* According to the MIPS ELF ABI, the R_MIPS_LO16 relocation must be
+     immediately following.  However, for the IRIX6 ABI, the next
+     relocation may be a composed relocation consisting of several
+     relocations for the same address.  In that case, the R_MIPS_LO16
+     relocation may occur as one of these.  We permit a similar
+     extension in general, as that is useful for GCC.  */
+  while (relocation < relend)
+    {
+      if (ELF32_R_TYPE (relocation->r_info) == R_MIPS_LO16)
+	{
+	  *addendp = relocation->r_addend;
+	  return true;
+	}
+
+      ++relocation;
+    }
+
+  /* We didn't find it.  */
+  bfd_set_error (bfd_error_bad_value);
+  return false;
+}
+
+/* Create a rel.dyn relocation for the dynamic linker to resolve.  The
+   relocatin is against the symbol with the dynamic symbol table index
+   DYNINDX.  REL is the original relocation, which is now being made
+   dynamic.  */
+
+static unsigned int
+mips_elf_create_dynamic_relocation (output_bfd, info, rel, dynindx,
+				    addend, input_section)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
+     const Elf_Internal_Rela *rel;
+     long dynindx;
+     bfd_vma addend;
+     asection *input_section;
+{
+  Elf_Internal_Rel outrel;
+  boolean skip;
+  asection *sreloc;
+  bfd *dynobj;
+  int r_type;
+
+  r_type = ELF32_R_TYPE (rel->r_info);
+  dynobj = elf_hash_table (info)->dynobj;
+  sreloc 
+    = bfd_get_section_by_name (dynobj,
+			       MIPS_ELF_REL_DYN_SECTION_NAME (output_bfd));
+  BFD_ASSERT (sreloc != NULL);
+
+  skip = false;
+
+  /* The symbol for the relocation is the same as it was for the
+     original relocation.  */
+  outrel.r_info = ELF32_R_INFO (dynindx, R_MIPS_REL32);
+
+  /* The offset for the dynamic relocation is the same as for the
+     original relocation, adjusted by the offset at which the original
+     section is output.  */
+  if (elf_section_data (input_section)->stab_info == NULL)
+    outrel.r_offset = rel->r_offset;
+  else
+    {
+      bfd_vma off;
+
+      off = (_bfd_stab_section_offset
+	     (output_bfd, &elf_hash_table (info)->stab_info,
+	      input_section,
+	      &elf_section_data (input_section)->stab_info,
+	      rel->r_offset));
+      if (off == (bfd_vma) -1)
+	skip = true;
+      outrel.r_offset = off;
+    }
+  outrel.r_offset += (input_section->output_section->vma
+		      + input_section->output_offset);
+
+  /* If we've decided to skip this relocation, just output an emtpy
+     record.  */
+  if (skip)
+    memset (&outrel, 0, sizeof (outrel));
+
+  if (ABI_64_P (output_bfd))
+    {
+      (*get_elf_backend_data (output_bfd)->s->swap_reloc_out)
+	(output_bfd, &outrel,
+	 (sreloc->contents 
+	  + sreloc->reloc_count * sizeof (Elf64_Mips_External_Rel)));
+    }
+  else
+    bfd_elf32_swap_reloc_out (output_bfd, &outrel,
+			      (((Elf32_External_Rel *)
+				sreloc->contents)
+			       + sreloc->reloc_count));
+  ++sreloc->reloc_count;
+
+  /* Make sure the output section is writable.  The dynamic linker
+     will be writing to it.  */
+  elf_section_data (input_section->output_section)->this_hdr.sh_flags
+    |= SHF_WRITE;
+
+  /* On IRIX5, make an entry of compact relocation info.  */
+  if (! skip && IRIX_COMPAT (output_bfd) == ict_irix5)
+    {
+      asection* scpt = bfd_get_section_by_name (dynobj, ".compact_rel");
+      bfd_byte *cr;
+
+      if (scpt)
+	{
+	  Elf32_crinfo cptrel;
+
+	  mips_elf_set_cr_format (cptrel, CRF_MIPS_LONG);
+	  cptrel.vaddr = (rel->r_offset
+			  + input_section->output_section->vma
+			  + input_section->output_offset);
+	  if (r_type == R_MIPS_REL32)
+	    mips_elf_set_cr_type (cptrel, CRT_MIPS_REL32);
+	  else
+	    mips_elf_set_cr_type (cptrel, CRT_MIPS_WORD);
+	  mips_elf_set_cr_dist2to (cptrel, 0);
+	  cptrel.konst = addend;
+
+	  cr = (scpt->contents
+		+ sizeof (Elf32_External_compact_rel));
+	  bfd_elf32_swap_crinfo_out (output_bfd, &cptrel,
+				     ((Elf32_External_crinfo *) cr
+				      + scpt->reloc_count));
+	  ++scpt->reloc_count;
+	}
+    }
+
+  return sreloc->reloc_count - 1;
+}
+
+/* Calculate the value produced by the RELOCATION (which comes from
+   the INPUT_BFD).  The ADDEND is the addend to use for this
+   RELOCATION; RELOCATION->R_ADDEND is ignored.
+
+   The result of the relocation calculation is stored in VALUEP.
+   REQUIRE_JALXP indicates whether or not the opcode used with this
+   relocation must be JALX.
+
+   This function returns bfd_reloc_continue if the caller need take no
+   further action regarding this relocation, bfd_reloc_notsupported if
+   something goes dramatically wrong, bfd_reloc_overflow if an
+   overflow occurs, and bfd_reloc_ok to indicate success.  */
+
+static bfd_reloc_status_type
+mips_elf_calculate_relocation (abfd, 
+			       input_bfd,
+			       input_section,
+			       info,
+			       relocation,
+			       addend,
+			       howto,
+			       local_syms,
+			       local_sections,
+			       valuep,
+			       namep,
+			       require_jalxp) 
+     bfd *abfd;
+     bfd *input_bfd;
+     asection *input_section;
+     struct bfd_link_info *info;
+     const Elf_Internal_Rela *relocation;
+     bfd_vma addend;
+     reloc_howto_type *howto;
+     Elf_Internal_Sym *local_syms;
+     asection **local_sections;
+     bfd_vma *valuep;
+     const char **namep;
+     boolean *require_jalxp;
+{
+  /* The eventual value we will return.  */
+  bfd_vma value;
+  /* The address of the symbol against which the relocation is
+     occurring.  */
+  bfd_vma symbol = 0;
+  /* The final GP value to be used for the relocatable, executable, or
+     shared object file being produced.  */
+  bfd_vma gp = (bfd_vma) - 1;
+  /* The place (section offset or address) of the storage unit being
+     relocated.  */
+  bfd_vma p;
+  /* The value of GP used to create the relocatable object.  */
+  bfd_vma gp0 = (bfd_vma) - 1;
+  /* The offset into the global offset table at which the address of
+     the relocation entry symbol, adjusted by the addend, resides
+     during execution.  */
+  bfd_vma g = (bfd_vma) - 1;
+  /* The section in which the symbol referenced by the relocation is
+     located.  */
+  asection *sec = NULL;
+  struct mips_elf_link_hash_entry* h = NULL;
+  /* True if the symbol referred to by this relocation is a local
+     symbol.  */
+  boolean local_p;
+  /* True if the symbol referred to by this relocation is "_gp_disp".  */
+  boolean gp_disp_p = false;
+  Elf_Internal_Shdr *symtab_hdr;
+  size_t extsymoff;
+  unsigned long r_symndx;
+  int r_type;
+  /* True if overflow occurred during the calculation of the
+     relocation value.  */
+  boolean overflowed_p;
+  /* True if this relocation refers to a MIPS16 function.  */
+  boolean target_is_16_bit_code_p = false;
+
+  /* Parse the relocation.  */
+  r_symndx = ELF32_R_SYM (relocation->r_info);
+  r_type = ELF32_R_TYPE (relocation->r_info);
+  p = (input_section->output_section->vma 
+       + input_section->output_offset
+       + relocation->r_offset);
+
+  /* Assume that there will be no overflow.  */
+  overflowed_p = false;
+
+  /* Figure out whether or not the symbol is local, and get the offset
+     used in the array of hash table entries.  */
+  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  local_p = mips_elf_local_relocation_p (input_bfd, relocation,
+					 local_sections);
+  if (! elf_bad_symtab (input_bfd))
+    extsymoff = symtab_hdr->sh_info;
+  else
+    {
+      /* The symbol table does not follow the rule that local symbols
+	 must come before globals.  */
+      extsymoff = 0;
+    }
+      
+  /* Figure out the value of the symbol.  */
+  if (local_p)
+    {
+      Elf_Internal_Sym *sym;
+
+      sym = local_syms + r_symndx;
+      sec = local_sections[r_symndx];
+
+      symbol = sec->output_section->vma + sec->output_offset;
+      if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
+	symbol += sym->st_value;
+
+      /* MIPS16 text labels should be treated as odd.  */
+      if (sym->st_other == STO_MIPS16)
+	++symbol;
+
+      /* Record the name of this symbol, for our caller.  */
+      *namep = bfd_elf_string_from_elf_section (input_bfd,
+						symtab_hdr->sh_link,
+						sym->st_name);
+      if (*namep == '\0')
+	*namep = bfd_section_name (input_bfd, sec);
+
+      target_is_16_bit_code_p = (sym->st_other == STO_MIPS16);
+    }
+  else
+    {
+      /* For global symbols we look up the symbol in the hash-table.  */
+      h = ((struct mips_elf_link_hash_entry *) 
+	   elf_sym_hashes (input_bfd) [r_symndx - extsymoff]);
+      /* Find the real hash-table entry for this symbol.  */
+      while (h->root.type == bfd_link_hash_indirect
+	     || h->root.type == bfd_link_hash_warning)
+	h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link;
+      
+      /* Record the name of this symbol, for our caller.  */
+      *namep = h->root.root.root.string;
+
+      /* See if this is the special _gp_disp symbol.  Note that such a
+	 symbol must always be a global symbol.  */
+      if (strcmp (h->root.root.root.string, "_gp_disp") == 0)
+	{
+	  /* Relocations against _gp_disp are permitted only with
+	     R_MIPS_HI16 and R_MIPS_LO16 relocations.  */
+	  if (r_type != R_MIPS_HI16 && r_type != R_MIPS_LO16)
+	    return bfd_reloc_notsupported;
+
+	  gp_disp_p = true;
+	}
+      /* If this symbol is defined, calculate its address.  Note that
+	 _gp_disp is a magic symbol, always implicitly defined by the
+	 linker, so it's inappropriate to check to see whether or not
+	 its defined.  */
+      else if ((h->root.root.type == bfd_link_hash_defined
+		|| h->root.root.type == bfd_link_hash_defweak)
+	       && h->root.root.u.def.section)
+	{
+	  sec = h->root.root.u.def.section;
+	  if (sec->output_section)
+	    symbol = (h->root.root.u.def.value 
+		      + sec->output_section->vma
+		      + sec->output_offset);
+	  else
+	    symbol = h->root.root.u.def.value;
+	}
+      else
+	{
+	  (*info->callbacks->undefined_symbol)
+	    (info, h->root.root.root.string, input_bfd,
+	     input_section, relocation->r_offset);
+	  return bfd_reloc_undefined;
+	}
+
+      target_is_16_bit_code_p = (h->root.other == STO_MIPS16);
+    }
+  
+  /* If this is a 32-bit call to a 16-bit function with a stub, we
+     need to redirect the call to the stub, unless we're already *in*
+     a stub.  */
+  if (r_type != R_MIPS16_26 && !info->relocateable
+      && ((h != NULL && h->fn_stub != NULL)
+	  || (local_p && elf_tdata (input_bfd)->local_stubs != NULL
+	      && elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL))
+      && !mips_elf_stub_section_p (input_bfd, input_section))
+    {
+      /* This is a 32-bit call to a 16-bit function.  We should
+	 have already noticed that we were going to need the
+	 stub.  */
+      if (local_p)
+	sec = elf_tdata (input_bfd)->local_stubs[r_symndx];
+      else
+	{
+	  BFD_ASSERT (h->need_fn_stub);
+	  sec = h->fn_stub;
+	}
+
+      symbol = sec->output_section->vma + sec->output_offset;
+    }
+  /* If this is a 16-bit call to a 32-bit function with a stub, we
+     need to redirect the call to the stub.  */
+  else if (r_type == R_MIPS16_26 && !info->relocateable
+	   && h != NULL 
+	   && (h->call_stub != NULL || h->call_fp_stub != NULL)
+	   && !target_is_16_bit_code_p)
+    {
+      /* If both call_stub and call_fp_stub are defined, we can figure
+	 out which one to use by seeing which one appears in the input
+	 file.  */
+      if (h->call_stub != NULL && h->call_fp_stub != NULL)
+	{
+	  asection *o;
+
+	  sec = NULL;
+	  for (o = input_bfd->sections; o != NULL; o = o->next)
+	    {
+	      if (strncmp (bfd_get_section_name (input_bfd, o),
+			   CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0)
+		{
+		  sec = h->call_fp_stub;
+		  break;
+		}
+	    }
+	  if (sec == NULL)
+	    sec = h->call_stub;
+	}
+      else if (h->call_stub != NULL)
+	sec = h->call_stub;
+      else
+	sec = h->call_fp_stub;
+
+      BFD_ASSERT (sec->_raw_size > 0);
+      symbol = sec->output_section->vma + sec->output_offset;
+    }
+
+  /* Calls from 16-bit code to 32-bit code and vice versa require the
+     special jalx instruction.  */
+  *require_jalxp = (!info->relocateable
+		    && ((r_type == R_MIPS16_26) != target_is_16_bit_code_p));
+
+  /* If we haven't already determined the GOT offset, or the GP value,
+     and we're going to need it, get it now.  */
+  switch (r_type)
+    {
+    case R_MIPS_CALL16:
+    case R_MIPS_GOT_DISP:
+    case R_MIPS_GOT_HI16:
+    case R_MIPS_CALL_HI16:
+    case R_MIPS_GOT_LO16:
+    case R_MIPS_CALL_LO16:
+      /* Find the index into the GOT where this value is located.  */
+      if (h)
+	{
+	  BFD_ASSERT (addend == 0);
+	  g = mips_elf_global_got_index 
+	    (elf_hash_table (info)->dynobj,
+	     (struct elf_link_hash_entry*) h);
+	}
+      else
+	{
+	  g = mips_elf_local_got_index (abfd, info, symbol + addend);
+	  if (g == (bfd_vma) -1)
+	    return false;
+	}
+
+      /* Convert GOT indices to actual offsets.  */
+      g = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
+					  abfd, g);
+      break;
+      
+    case R_MIPS_HI16:
+    case R_MIPS_LO16:
+    case R_MIPS_GPREL16:
+    case R_MIPS_GPREL32:
+      gp0 = _bfd_get_gp_value (input_bfd);
+      gp = _bfd_get_gp_value (abfd);
+      break;
+
+    default:
+      break;
+    }
+
+  /* Figure out what kind of relocation is being performed.  */
+  switch (r_type)
+    {
+    case R_MIPS_NONE:
+      return bfd_reloc_continue;
+
+    case R_MIPS_16:
+      value = symbol + mips_elf_sign_extend (addend, 16);
+      overflowed_p = mips_elf_overflow_p (value, 16);
+      break;
+
+    case R_MIPS_32:
+    case R_MIPS_REL32:
+    case R_MIPS_64:
+      /* If we're creating a shared library, or this relocation is
+	 against a symbol in a shared library, then we can't know
+	 where the symbol will end up.  So, we create a relocation
+	 record in the output, and leave the job up to the dynamic
+	 linker.  */
+      if (info->shared || !sec->output_section)
+	{
+	  unsigned int reloc_index;
+
+	  BFD_ASSERT (h != NULL);
+	  reloc_index 
+	    = mips_elf_create_dynamic_relocation (abfd, 
+						  info, 
+						  relocation,
+						  h->root.dynindx,
+						  addend,
+						  input_section);
+	  if (h->min_dyn_reloc_index == 0
+	      || reloc_index < h->min_dyn_reloc_index)
+	    h->min_dyn_reloc_index = reloc_index;
+	  value = symbol + addend;
+	}
+      else
+	{
+	  if (r_type != R_MIPS_REL32)
+	    value = symbol + addend;
+	  else
+	    value = addend;
+	}
+      value &= howto->dst_mask;
+      break;
+
+    case R_MIPS16_26:
+      /* The calculation for R_MIPS_26 is just the same as for an
+	 R_MIPS_26.  It's only the storage of the relocated field into
+	 the output file that's different.  That's handled in
+	 mips_elf_perform_relocation.  So, we just fall through to the
+	 R_MIPS_26 case here.  */
+    case R_MIPS_26:
+      if (local_p)
+	value = (((addend << 2) | (p & 0xf0000000)) + symbol) >> 2;
+      else
+	value = (mips_elf_sign_extend (addend << 2, 28) + symbol) >> 2;
+      value &= howto->dst_mask;
+      break;
+
+    case R_MIPS_HI16:
+      if (!gp_disp_p)
+	{
+	  value = mips_elf_high (addend + symbol);
+	  value &= howto->dst_mask;
+	}
+      else
+	{
+	  value = mips_elf_high (addend + gp - p);
+	  overflowed_p = mips_elf_overflow_p (value, 16);
+	}
+      break;
+
+    case R_MIPS_LO16:
+      if (!gp_disp_p)
+	value = (symbol + addend) & howto->dst_mask;
+      else
+	{
+	  value = addend + gp - p + 4;
+	  /* The MIPS ABI requires checking the R_MIPS_LO16 relocation
+	     for overflow.  But, on, say, Irix 5, relocations against
+	     _gp_disp are normally generated from the .cpload
+	     pseudo-op.  It generates code that normally looks like
+	     this:
+
+	       lui    $gp,%hi(_gp_disp)
+	       addiu  $gp,$gp,%lo(_gp_disp)
+	       addu   $gp,$gp,$t9
+
+	     Here $t9 holds the address of the function being called,
+	     as required by the MIPS ELF ABI.  The R_MIPS_LO16
+	     relocation can easily overflow in this situation, but the
+	     R_MIPS_HI16 relocation will handle the overflow.
+	     Therefore, we consider this a bug in the MIPS ABI, and do
+	     not check for overflow here.  */
+	}
+      break;
+
+    case R_MIPS_LITERAL:
+      /* Because we don't merge literal sections, we can handle this
+	 just like R_MIPS_GPREL16.  In the long run, we should merge
+	 shared literals, and then we will need to additional work
+	 here.  */
+
+      /* Fall through.  */
+
+    case R_MIPS16_GPREL:
+      /* The R_MIPS16_GPREL performs the same calculation as
+	 R_MIPS_GPREL16, but stores the relocated bits in a different
+	 order.  We don't need to do anything special here; the
+	 differences are handled in mips_elf_perform_relocation.  */
+    case R_MIPS_GPREL16:
+      if (local_p)
+	value = mips_elf_sign_extend (addend, 16) + symbol + gp0 - gp;
+      else
+	value = mips_elf_sign_extend (addend, 16) + symbol - gp;
+      overflowed_p = mips_elf_overflow_p (value, 16);
+      break;
+      
+    case R_MIPS_GOT16:
+      if (local_p)
+	{
+	  value = mips_elf_got16_entry (abfd, info, symbol + addend);
+	  if (value == (bfd_vma) -1)
+	    return false;
+	  value 
+	    = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
+					      abfd,
+					      value);
+	  overflowed_p = mips_elf_overflow_p (value, 16);
+	  break;
+	}
+
+      /* Fall through.  */
+
+    case R_MIPS_CALL16:
+    case R_MIPS_GOT_DISP:
+      value = g;
+      overflowed_p = mips_elf_overflow_p (value, 16);
+      break;
+
+    case R_MIPS_GPREL32:
+      value = (addend + symbol + gp0 - gp) & howto->dst_mask;
+      break;
+
+    case R_MIPS_PC16:
+      value = mips_elf_sign_extend (addend, 16) + symbol - p;
+      overflowed_p = mips_elf_overflow_p (value, 16);
+      break;
+
+    case R_MIPS_GOT_HI16:
+    case R_MIPS_CALL_HI16:
+      /* We're allowed to handle these two relocations identically.
+	 The dynamic linker is allowed to handle the CALL relocations
+	 differently by creating a lazy evaluation stub.  */
+      value = g;
+      value = mips_elf_high (value);
+      value &= howto->dst_mask;
+      break;
+
+    case R_MIPS_GOT_LO16:
+    case R_MIPS_CALL_LO16:
+      value = g & howto->dst_mask;
+      break;
+
+    case R_MIPS_GOT_PAGE:
+      value = mips_elf_got_page (abfd, info, symbol + addend, NULL);
+      if (value == (bfd_vma) -1)
+	return false;
+      value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
+					      abfd,
+					      value);
+      overflowed_p = mips_elf_overflow_p (value, 16);
+      break;
+      
+    case R_MIPS_GOT_OFST:
+      mips_elf_got_page (abfd, info, symbol + addend, &value);
+      overflowed_p = mips_elf_overflow_p (value, 16);
+      break;
+
+    case R_MIPS_SUB:
+      value = symbol - addend;
+      value &= howto->dst_mask;
+      break;
+
+    case R_MIPS_HIGHER:
+      value = mips_elf_higher (addend + symbol);
+      value &= howto->dst_mask;
+      break;
+
+    case R_MIPS_HIGHEST:
+      value = mips_elf_highest (addend + symbol);
+      value &= howto->dst_mask;
+      break;
+      
+    case R_MIPS_SCN_DISP:
+      value = symbol + addend - sec->output_offset;
+      value &= howto->dst_mask;
+      break;
+
+    case R_MIPS_PJUMP:
+    case R_MIPS_JALR:
+      /* Both of these may be ignored.  R_MIPS_JALR is an optimization
+	 hint; we could improve performance by honoring that hint.  */
+      return bfd_reloc_continue;
+
+    case R_MIPS_GNU_VTINHERIT:
+    case R_MIPS_GNU_VTENTRY:
+      /* We don't do anything with these at present.  */
+      return bfd_reloc_continue;
+
+    default:
+      /* An unrecognized relocation type.  */
+      return bfd_reloc_notsupported;
+    }
+
+  /* Store the VALUE for our caller.  */
+  *valuep = value;
+  return overflowed_p ? bfd_reloc_overflow : bfd_reloc_ok;
+}
+
+/* Obtain the field relocated by RELOCATION.  */
+
+static bfd_vma
+mips_elf_obtain_contents (howto, relocation, input_bfd, contents)
+     reloc_howto_type *howto;
+     const Elf_Internal_Rela *relocation;
+     bfd *input_bfd;
+     bfd_byte *contents;
+{
+  bfd_vma x;
+  bfd_byte *location = contents + relocation->r_offset;
+
+  /* Obtain the bytes.  */
+  x = bfd_get (8 * bfd_get_reloc_size (howto), input_bfd, location);
+
+  if ((ELF32_R_TYPE (relocation->r_info) == R_MIPS16_26
+       || ELF32_R_TYPE (relocation->r_info) == R_MIPS16_GPREL)
+      && bfd_little_endian (input_bfd))
+    /* The two 16-bit words will be reversed on a little-endian
+       system.  See mips_elf_perform_relocation for more details.  */
+    x = (((x & 0xffff) << 16) | ((x & 0xffff0000) >> 16));
+
+  return x;
+}
+
+/* It has been determined that the result of the RELOCATION is the
+   VALUE.  Use HOWTO to place VALUE into the output file at the
+   appropriate position.  The SECTION is the section to which the
+   relocation applies.  If REQUIRE_JALX is true, then the opcode used
+   for the relocation must be either JAL or JALX, and it is
+   unconditionally converted to JALX.
+
+   Returns false if anything goes wrong.  */
+
+static boolean
+mips_elf_perform_relocation (info, howto, relocation, value,
+			     input_bfd, input_section, 
+			     contents, require_jalx)
+     struct bfd_link_info *info;
+     reloc_howto_type *howto;
+     const Elf_Internal_Rela *relocation;
+     bfd_vma value;
+     bfd *input_bfd;
+     asection *input_section;
+     bfd_byte *contents;
+     boolean require_jalx;
+{
+  bfd_vma x;
+  bfd_byte *location;
+  int r_type = ELF32_R_TYPE (relocation->r_info);
+
+  /* Figure out where the relocation is occurring.  */
+  location = contents + relocation->r_offset;
+
+  /* Obtain the current value.  */
+  x = mips_elf_obtain_contents (howto, relocation, input_bfd, contents);
+
+  /* Clear the field we are setting.  */
+  x &= ~howto->dst_mask;
+
+  /* If this is the R_MIPS16_26 relocation, we must store the
+     value in a funny way.  */
+  if (r_type == R_MIPS16_26)
+    {
+      /* R_MIPS16_26 is used for the mips16 jal and jalx instructions.
+	 Most mips16 instructions are 16 bits, but these instructions
+	 are 32 bits.
+
+	 The format of these instructions is:
+
+	 +--------------+--------------------------------+
+	 !     JALX     ! X!   Imm 20:16  !   Imm 25:21  !
+	 +--------------+--------------------------------+
+	 !	  	  Immediate  15:0		    !
+	 +-----------------------------------------------+
+	 
+	 JALX is the 5-bit value 00011.  X is 0 for jal, 1 for jalx.
+	 Note that the immediate value in the first word is swapped.
+
+	 When producing a relocateable object file, R_MIPS16_26 is
+	 handled mostly like R_MIPS_26.  In particular, the addend is
+	 stored as a straight 26-bit value in a 32-bit instruction.
+	 (gas makes life simpler for itself by never adjusting a
+	 R_MIPS16_26 reloc to be against a section, so the addend is
+	 always zero).  However, the 32 bit instruction is stored as 2
+	 16-bit values, rather than a single 32-bit value.  In a
+	 big-endian file, the result is the same; in a little-endian
+	 file, the two 16-bit halves of the 32 bit value are swapped.
+	 This is so that a disassembler can recognize the jal
+	 instruction.
+
+	 When doing a final link, R_MIPS16_26 is treated as a 32 bit
+	 instruction stored as two 16-bit values.  The addend A is the
+	 contents of the targ26 field.  The calculation is the same as
+	 R_MIPS_26.  When storing the calculated value, reorder the
+	 immediate value as shown above, and don't forget to store the
+	 value as two 16-bit values.
+
+	 To put it in MIPS ABI terms, the relocation field is T-targ26-16,
+	 defined as
+	 
+	 big-endian:
+	 +--------+----------------------+
+	 |        |                      |
+	 |        |    targ26-16         |
+	 |31    26|25                   0|
+	 +--------+----------------------+
+	 
+	 little-endian:
+	 +----------+------+-------------+
+	 |          |      |             |
+	 |  sub1    |      |     sub2    |
+	 |0        9|10  15|16         31|
+	 +----------+--------------------+
+	 where targ26-16 is sub1 followed by sub2 (i.e., the addend field A is
+	 ((sub1 << 16) | sub2)).
+	 
+	 When producing a relocateable object file, the calculation is
+	 (((A < 2) | (P & 0xf0000000) + S) >> 2)
+	 When producing a fully linked file, the calculation is
+	 let R = (((A < 2) | (P & 0xf0000000) + S) >> 2)
+	 ((R & 0x1f0000) << 5) | ((R & 0x3e00000) >> 5) | (R & 0xffff)  */
+
+      if (!info->relocateable)
+	/* Shuffle the bits according to the formula above.  */
+	value = (((value & 0x1f0000) << 5) 
+		 | ((value & 0x3e00000) >> 5) 
+		 | (value & 0xffff));
+      
+    }
+  else if (r_type == R_MIPS16_GPREL)
+    {
+      /* R_MIPS16_GPREL is used for GP-relative addressing in mips16
+	 mode.  A typical instruction will have a format like this:
+
+	 +--------------+--------------------------------+
+	 !    EXTEND    !     Imm 10:5    !   Imm 15:11  !
+	 +--------------+--------------------------------+
+	 !    Major     !   rx   !   ry   !   Imm  4:0   !
+	 +--------------+--------------------------------+
+	 
+	 EXTEND is the five bit value 11110.  Major is the instruction
+	 opcode.
+	 
+	 This is handled exactly like R_MIPS_GPREL16, except that the
+	 addend is retrieved and stored as shown in this diagram; that
+	 is, the Imm fields above replace the V-rel16 field.  
+
+         All we need to do here is shuffle the bits appropriately.  As
+	 above, the two 16-bit halves must be swapped on a
+	 little-endian system.  */
+      value = (((value & 0x7e0) << 16)
+	       | ((value & 0xf800) << 5)
+	       | (value & 0x1f));
+    }
+
+  /* Set the field.  */
+  x |= (value & howto->dst_mask);
+
+  /* If required, turn JAL into JALX.  */
+  if (require_jalx)
+    {
+      boolean ok;
+      bfd_vma opcode = x >> 26;
+      bfd_vma jalx_opcode;
+
+      /* Check to see if the opcode is already JAL or JALX.  */
+      if (r_type == R_MIPS16_26)
+	{
+	  ok = ((opcode == 0x6) || (opcode == 0x7));
+	  jalx_opcode = 0x7;
+	}
+      else
+	{
+	  ok = ((opcode == 0x3) || (opcode == 0x1d));
+	  jalx_opcode = 0x1d;
+	}
+
+      /* If the opcode is not JAL or JALX, there's a problem.  */
+      if (!ok)
+	{
+	  (*_bfd_error_handler)
+	    (_("%s: %s+0x%lx: jump to stub routine which is not jal"),
+	     bfd_get_filename (input_bfd),
+	     input_section->name,
+	     (unsigned long) relocation->r_offset);
+	  bfd_set_error (bfd_error_bad_value);
+	  return false;
+	}
+
+      /* Make this the JALX opcode.  */
+      x = (x & ~(0x3f << 26)) | (jalx_opcode << 26);
+    }
+
+  /* Swap the high- and low-order 16 bits on little-endian systems
+     when doing a MIPS16 relocation.  */
+  if ((r_type == R_MIPS16_GPREL || r_type == R_MIPS16_26)
+      && bfd_little_endian (input_bfd))
+    x = (((x & 0xffff) << 16) | ((x & 0xffff0000) >> 16));
+  
+  /* Put the value into the output.  */
+  bfd_put (8 * bfd_get_reloc_size (howto), input_bfd, x, location);
+  return true;
+}
+
+/* Returns true if SECTION is a MIPS16 stub section.  */
+
+static boolean
+mips_elf_stub_section_p (abfd, section)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section;
+{
+  const char *name = bfd_get_section_name (abfd, section);
+
+  return (strncmp (name, FN_STUB, sizeof FN_STUB - 1) == 0
+	  || strncmp (name, CALL_STUB, sizeof CALL_STUB - 1) == 0
+	  || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0);
+}
+
+/* Relocate a MIPS ELF section.  */
+
+boolean
+_bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+				contents, relocs, local_syms, local_sections)
      bfd *output_bfd;
      struct bfd_link_info *info;
      bfd *input_bfd;
@@ -4764,897 +6429,294 @@
      Elf_Internal_Sym *local_syms;
      asection **local_sections;
 {
-  Elf_Internal_Shdr *symtab_hdr;
-  size_t locsymcount;
-  size_t extsymoff;
-  asection *sgot, *sreloc, *scpt;
-  bfd *dynobj;
-  bfd_vma gp;
   Elf_Internal_Rela *rel;
-  Elf_Internal_Rela *relend;
-  struct mips_got_info *g;
+  const Elf_Internal_Rela *relend;
+  bfd_vma addend;
+  bfd_vma last_hi16_addend;
+  boolean use_saved_addend_p = false;
+  boolean last_hi16_addend_valid_p = false;
+  struct elf_backend_data *bed;
 
-  dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
-
-  sgot = NULL;
-  sreloc = NULL;
-  if (dynobj == NULL || ! SGI_COMPAT (output_bfd))
-    scpt = NULL;
-  else
-    scpt = bfd_get_section_by_name (dynobj, ".compact_rel");
-  g = NULL;
-
-  if (elf_bad_symtab (input_bfd))
+  bed = get_elf_backend_data (output_bfd);
+  relend = relocs + input_section->reloc_count * bed->s->int_rels_per_ext_rel;
+  for (rel = relocs; rel < relend; ++rel)
     {
-      locsymcount = symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
-      extsymoff = 0;
-    }
-  else
-    {
-      locsymcount = symtab_hdr->sh_info;
-      extsymoff = symtab_hdr->sh_info;
-    }
-
-  gp = _bfd_get_gp_value (output_bfd);
-
-  rel = relocs;
-  relend = relocs + input_section->reloc_count;
-  for (; rel < relend; rel++)
-    {
-      int r_type;
+      const char *name;
+      bfd_vma value;
       reloc_howto_type *howto;
-      unsigned long r_symndx;
-      bfd_vma addend;
-      struct elf_link_hash_entry *h;
-      asection *sec;
-      Elf_Internal_Sym *sym;
-      struct mips_elf_link_hash_entry *mh;
-      int other;
-      bfd_reloc_status_type r;
+      boolean require_jalx;
+      /* True if the relocation is a RELA relocation, rather than a
+         REL relocation.  */
+      boolean rela_relocation_p = true;
+      int r_type = ELF32_R_TYPE (rel->r_info);
 
-      r_type = ELF32_R_TYPE (rel->r_info);
-      if (r_type == R_MIPS_GNU_VTINHERIT
-	  || r_type == R_MIPS_GNU_VTENTRY)
-	continue;
-      if ((r_type < 0 || r_type >= (int) R_MIPS_max)
-	  && r_type != R_MIPS16_26
-	  && r_type != R_MIPS16_GPREL)
-	{
-	  bfd_set_error (bfd_error_bad_value);
-	  return false;
-	}
-      if (r_type == R_MIPS16_26)
-	howto = &elf_mips16_jump_howto;
-      else if (r_type == R_MIPS16_GPREL)
-	howto = &elf_mips16_gprel_howto;
+      /* Find the relocation howto for this relocation.  */
+      if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd))
+	/* Some 32-bit code uses R_MIPS_64.  In particular, people use
+	   64-bit code, but make sure all their addresses are in the 
+	   lowermost or uppermost 32-bit section of the 64-bit address
+	   space.  Thus, when they use an R_MIPS_64 they mean what is
+	   usually meant by R_MIPS_32, with the exception that the
+	   stored value is sign-extended to 64 bits.  */
+	howto = elf_mips_howto_table + R_MIPS_32;
       else
 	howto = elf_mips_howto_table + r_type;
 
-      if (dynobj != NULL
-	  && (r_type == R_MIPS_CALL16
-	      || r_type == R_MIPS_GOT16
-	      || r_type == R_MIPS_CALL_HI16
-	      || r_type == R_MIPS_CALL_LO16
-	      || r_type == R_MIPS_GOT_HI16
-	      || r_type == R_MIPS_GOT_LO16))
+      if (!use_saved_addend_p)
 	{
-	  /* We need the .got section.  */
-	  if (sgot == NULL)
-	    {
-	      sgot = bfd_get_section_by_name (dynobj, ".got");
-	      BFD_ASSERT (sgot != NULL);
-	      BFD_ASSERT (elf_section_data (sgot) != NULL);
-	      g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
-	      BFD_ASSERT (g != NULL);
-	    }
-	}
+	  Elf_Internal_Shdr *rel_hdr;
 
-      r_symndx = ELF32_R_SYM (rel->r_info);
+	  /* If these relocations were originally of the REL variety,
+	     we must pull the addend out of the field that will be
+	     relocated.  Otherwise, we simply use the contents of the
+	     RELA relocation.  To determine which flavor or relocation
+	     this is, we depend on the fact that the INPUT_SECTION's
+	     REL_HDR is read before its REL_HDR2.  */
+	  rel_hdr = &elf_section_data (input_section)->rel_hdr;
+	  if ((size_t) (rel - relocs)
+	      >= (rel_hdr->sh_size / rel_hdr->sh_entsize
+		  * bed->s->int_rels_per_ext_rel))
+	    rel_hdr = elf_section_data (input_section)->rel_hdr2;
+	  if (rel_hdr->sh_entsize == MIPS_ELF_REL_SIZE (input_bfd))
+	    {
+	      /* Note that this is a REL relocation.  */
+	      rela_relocation_p = false;
 
-      /* Mix in the change in GP address for a GP relative reloc.  */
-      if (r_type != R_MIPS_GPREL16
-	  && r_type != R_MIPS_LITERAL
-	  && r_type != R_MIPS_GPREL32
-	  && r_type != R_MIPS16_GPREL)
-	addend = 0;
-      else
-	{
-	  if (gp == 0)
-	    {
-	      if (! ((*info->callbacks->reloc_dangerous)
-		     (info,
-		      _("GP relative relocation when GP not defined"),
-		      input_bfd, input_section,
-		      rel->r_offset)))
-		return false;
-	      /* Only give the error once per link.  */
-	      gp = 4;
-	      _bfd_set_gp_value (output_bfd, gp);
-	    }
+	      /* Get the addend, which is stored in the input file.  */
+	      addend = mips_elf_obtain_contents (howto, 
+						 rel,
+						 input_bfd,
+						 contents);
+	      addend &= howto->src_mask;
 
-	  if (r_symndx < extsymoff
-	      || (elf_bad_symtab (input_bfd)
-		  && local_sections[r_symndx] != NULL))
-	    {
-	      /* This is a relocation against a section.  The current
-		 addend in the instruction is the difference between
-		 INPUT_SECTION->vma and the GP value of INPUT_BFD.  We
-		 must change this to be the difference between the
-		 final definition (which will end up in RELOCATION)
-		 and the GP value of OUTPUT_BFD (which is in GP).  */
-	      addend = elf_gp (input_bfd) - gp;
-	    }
-	  else if (! info->relocateable)
-	    {
-	      /* We are doing a final link.  The current addend in the
-		 instruction is simply the desired offset into the
-		 symbol (normally zero).  We want the instruction to
-		 hold the difference between the final definition of
-		 the symbol (which will end up in RELOCATION) and the
-		 GP value of OUTPUT_BFD (which is in GP).  */
-	      addend = - gp;
+	      /* For some kinds of relocations, the ADDEND is a
+		 combination of the addend stored in two different
+		 relocations.   */
+	      if (r_type == R_MIPS_HI16
+		  || (r_type == R_MIPS_GOT16
+		      && mips_elf_local_relocation_p (input_bfd, rel,
+						      local_sections)))
+		{
+		  /* Scan ahead to find a matching R_MIPS_LO16
+		     relocation.  */
+		  bfd_vma l;
+		  
+		  if (!mips_elf_next_lo16_addend (rel, relend, &l))
+		    return false;
+
+		  /* Save the high-order bit for later.  When we
+		     encounter the R_MIPS_LO16 relocation we will need
+		     them again.  */
+		  addend <<= 16;
+		  last_hi16_addend = addend;
+		  last_hi16_addend_valid_p = true;
+
+		  /* Compute the combined addend.  */
+		  addend |= l;
+		}
+	      else if (r_type == R_MIPS_LO16) 
+		{
+		  /* Used the saved HI16 addend.  */
+		  if (!last_hi16_addend_valid_p)
+		    {
+		      bfd_set_error (bfd_error_bad_value);
+		      return false;
+		    }
+		  addend |= last_hi16_addend;
+		}
+	      else if (r_type == R_MIPS16_GPREL)
+		{
+		  /* The addend is scrambled in the object file.  See
+		     mips_elf_perform_relocation for details on the
+		     format.  */
+		  addend = (((addend & 0x1f0000) >> 5)
+			    | ((addend & 0x7e00000) >> 16)
+			    | (addend & 0x1f));
+		}
 	    }
 	  else
-	    {
-	      /* We are generating relocateable output, and we aren't
-		 going to define this symbol, so we just leave the
-		 instruction alone.  */
-	      addend = 0;
-	    }
+	    addend = rel->r_addend;
 	}
 
-      h = NULL;
-      sym = NULL;
-      sec = NULL;
       if (info->relocateable)
 	{
-	  /* This is a relocateable link.  We don't have to change
-	     anything, unless the reloc is against a section symbol,
-	     in which case we have to adjust according to where the
-	     section symbol winds up in the output section.  */
-	  if (r_symndx >= locsymcount
-	      || (elf_bad_symtab (input_bfd)
-		  && local_sections[r_symndx] == NULL))
-	    r = bfd_reloc_ok;
+	  Elf_Internal_Sym *sym;
+	  unsigned long r_symndx;
+
+	  /* Since we're just relocating, all we need to do is copy
+	     the relocations back out to the object file, unless
+	     they're against a section symbol, in which case we need
+	     to adjust by the section offset, or unless they're GP
+	     relative in which case we need to adjust by the amount
+	     that we're adjusting GP in this relocateable object.  */
+
+	  if (!mips_elf_local_relocation_p (input_bfd, rel, local_sections))
+	    /* There's nothing to do for non-local relocations.  */
+	    continue;
+
+	  r_symndx = ELF32_R_SYM (rel->r_info);
+	  sym = local_syms + r_symndx;
+	  if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+	    /* Adjust the addend appropriately.  */
+	    addend += local_sections[r_symndx]->output_offset;
+	  
+	  if (r_type == R_MIPS16_GPREL 
+	      || r_type == R_MIPS_GPREL16
+	      || r_type == R_MIPS_GPREL32)
+	    addend -= (_bfd_get_gp_value (output_bfd)
+		       - _bfd_get_gp_value (input_bfd));
+
+	  /* If the relocation is for a R_MIPS_HI16 or R_MIPS_GOT16,
+	     then we only want to write out the high-order 16 bits.
+	     The subsequent R_MIPS_LO16 will handle the low-order bits.  */
+	  if (r_type == R_MIPS_HI16 || r_type == R_MIPS_GOT16)
+	    addend >>= 16;
+
+	  if (rela_relocation_p)
+	    /* If this is a RELA relocation, just update the addend.
+               We have to cast away constness for REL.  */
+	    rel->r_addend = addend;
 	  else
 	    {
-	      sym = local_syms + r_symndx;
-	      if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
-		r = bfd_reloc_ok;
-	      else
-		{
-		  sec = local_sections[r_symndx];
-
-		  /* It would be logical to add sym->st_value here,
-		     but Irix 5 sometimes generates a garbage symbol
-		     value.  */
-		  addend += sec->output_offset;
-
-		  /* If this is HI16 or GOT16 with an associated LO16,
-		     adjust the addend accordingly.  Otherwise, just
-		     relocate.  */
-		  if (r_type == R_MIPS_64 && bfd_big_endian (input_bfd))
-		    r = _bfd_relocate_contents (howto, input_bfd,
-						addend,
-						contents + rel->r_offset + 4);
-		  else if (r_type != R_MIPS_HI16 && r_type != R_MIPS_GOT16)
-		    r = _bfd_relocate_contents (howto, input_bfd,
-						addend,
-						contents + rel->r_offset);
-		  else
-		    {
-		      Elf_Internal_Rela *lorel;
-
-		      /* As a GNU extension, permit an arbitrary
-			 number of R_MIPS_HI16 relocs before the
-			 R_MIPS_LO16 reloc.  This permits gcc to emit
-			 the HI and LO relocs itself.  */
-		      if (r_type == R_MIPS_GOT16)
-			lorel = rel + 1;
-		      else
-			{
-			  for (lorel = rel + 1;
-			       (lorel < relend
-				&& (ELF32_R_TYPE (lorel->r_info)
-				    == R_MIPS_HI16));
-			       lorel++)
-			    ;
-			}
-		      if (lorel < relend
-			  && ELF32_R_TYPE (lorel->r_info) == R_MIPS_LO16)
-			{
-			  mips_elf_relocate_hi16 (input_bfd, rel, lorel,
-						  contents, addend);
-			  r = bfd_reloc_ok;
-			}
-		      else
-			r = _bfd_relocate_contents (howto, input_bfd,
-						    addend,
-						    contents + rel->r_offset);
-		    }
-		}
+	      /* Otherwise, we have to write the value back out.  Note
+		 that we use the source mask, rather than the
+		 destination mask because the place to which we are
+		 writing will be source of the addend in the final
+		 link.  */
+	      addend &= howto->src_mask;
+	      if (!mips_elf_perform_relocation (info, howto, rel, addend,
+						input_bfd,  input_section, 
+						contents, false))
+		return false;
 	    }
+
+	  /* Go on to the next relocation.  */
+	  continue;
 	}
+
+      /* In the N32 and 64-bit ABIs there may be multiple consecutive
+	 relocations for the same offset.  In that case we are
+	 supposed to treat the output of each relocation as the addend
+	 for the next.  */
+      if (rel + 1 < relend 
+	  && rel->r_offset == rel[1].r_offset
+	  && r_type != R_MIPS_NONE)
+	use_saved_addend_p = true;
       else
+	use_saved_addend_p = false;
+
+      /* Figure out what value we are supposed to relocate.  */
+      switch (mips_elf_calculate_relocation (output_bfd, 
+					     input_bfd,
+					     input_section,
+					     info,
+					     rel,
+					     addend,
+					     howto,
+					     local_syms,
+					     local_sections,
+					     &value,
+					     &name,
+					     &require_jalx))
 	{
-	  bfd_vma relocation;
-	  boolean local;
-	  boolean undefined_error;
+	case bfd_reloc_continue:
+	  /* There's nothing to do.  */
+	  continue;
 
-	  /* This is a final link.  */
-	  undefined_error = false;
-	  sym = NULL;
-	  if (r_symndx < extsymoff
-	      || (elf_bad_symtab (input_bfd)
-		  && local_sections[r_symndx] != NULL))
-	    {
-	      local = true;
-	      sym = local_syms + r_symndx;
-	      sec = local_sections[r_symndx];
-	      relocation = (sec->output_section->vma
-			    + sec->output_offset);
+	case bfd_reloc_undefined:
+	  /* mips_elf_calculate_relocation already called the
+             undefined_symbol callback.  */
+	  break;
 
-	      /* It would be logical to always add sym->st_value here,
-		 but Irix 5 sometimes generates a garbage symbol
-		 value.  */
-	      if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
-		relocation += sym->st_value;
+	case bfd_reloc_notsupported:
+	  abort ();
+	  break;
 
-	      /* mips16 text labels should be treated as odd.  */
-	      if (sym->st_other == STO_MIPS16)
-		++relocation;
-	    }
+	case bfd_reloc_overflow:
+	  if (use_saved_addend_p)
+	    /* Ignore overflow until we reach the last relocation for
+	       a given location.  */
+	    ;
 	  else
 	    {
-	      long indx;
-
-	      local = false;
-	      indx = r_symndx - extsymoff;
-	      h = elf_sym_hashes (input_bfd)[indx];
-	      while (h->root.type == bfd_link_hash_indirect
-		     || h->root.type == bfd_link_hash_warning)
-		h = (struct elf_link_hash_entry *) h->root.u.i.link;
-	      if (strcmp (h->root.root.string, "_gp_disp") == 0)
-		{
-		  if (gp == 0)
-		    {
-		      if (! ((*info->callbacks->reloc_dangerous)
-			     (info,
-			      _("_gp_disp used when GP not defined"),
-			      input_bfd, input_section,
-			      rel->r_offset)))
-			return false;
-		      /* Only give the error once per link.  */
-		      gp = 4;
-		      _bfd_set_gp_value (output_bfd, gp);
-		      relocation = 0;
-		    }
-		  else
-		    {
-		      sec = input_section;
-		      if (sec->output_section != NULL)
-			relocation = (gp
-				      - (rel->r_offset
-					 + sec->output_section->vma
-					 + sec->output_offset));
-		      else
-			relocation = gp - rel->r_offset;
-		      if (r_type == R_MIPS_LO16)
-			relocation += 4;
-		    }
-		}
-	      else if (h->root.type == bfd_link_hash_defined
-		  || h->root.type == bfd_link_hash_defweak)
-		{
-		  sec = h->root.u.def.section;
-		  if (sec->output_section == NULL)
-		    relocation = 0;
-		  else
-		    relocation = (h->root.u.def.value
-				  + sec->output_section->vma
-				  + sec->output_offset);
-		}
-	      else if (h->root.type == bfd_link_hash_undefweak)
-		relocation = 0;
-	      else if (info->shared && !info->symbolic && !info->no_undefined)
-		relocation = 0;
-	      else if (strcmp (h->root.root.string, "_DYNAMIC_LINK") == 0)
-		{
-		  /* If this is a dynamic link, we should have created
-                     a _DYNAMIC_LINK symbol in
-                     mips_elf_create_dynamic_sections.  Otherwise, we
-                     should define the symbol with a value of 0.
-                     FIXME: It should probably get into the symbol
-                     table somehow as well.  */
-		  BFD_ASSERT (! info->shared);
-		  BFD_ASSERT (bfd_get_section_by_name (output_bfd,
-						       ".dynamic") == NULL);
-		  relocation = 0;
-		}
-	      else
-		{
-		  if (! ((*info->callbacks->undefined_symbol)
-			 (info, h->root.root.string, input_bfd,
-			  input_section, rel->r_offset)))
-		    return false;
-		  undefined_error = true;
-		  relocation = 0;
-		}
+	      BFD_ASSERT (name != NULL);
+	      if (! ((*info->callbacks->reloc_overflow)
+		     (info, name, howto->name, (bfd_vma) 0,
+		      input_bfd, input_section, rel->r_offset)))
+		return false;
 	    }
+	  break;
 
-	  mh = (struct mips_elf_link_hash_entry *) h;
-	  if (h != NULL)
-	    other = h->other;
-	  else if (sym != NULL)
-	    other = sym->st_other;
-	  else
-	    other = 0;
+	case bfd_reloc_ok:
+	  break;
 
-	  /* If this function has an fn_stub, then it is a mips16
-	     function which needs a stub if it is called by a 32 bit
-	     function.  If this reloc is anything other than a 16 bit
-	     call, redirect the reloc to the stub.  We don't redirect
-	     relocs from other stub functions.  */
-	  if (r_type != R_MIPS16_26
-	      && ((mh != NULL
-		   && mh->fn_stub != NULL)
-		  || (mh == NULL
-		      && elf_tdata (input_bfd)->local_stubs != NULL
-		      && elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL))
-	      && strncmp (bfd_get_section_name (input_bfd, input_section),
-			  FN_STUB, sizeof FN_STUB - 1) != 0
-	      && strncmp (bfd_get_section_name (input_bfd, input_section),
-			  CALL_STUB, sizeof CALL_STUB - 1) != 0
-	      && strncmp (bfd_get_section_name (input_bfd, input_section),
-			  CALL_FP_STUB, sizeof CALL_FP_STUB - 1) != 0)
-	    {
-	      if (mh != NULL)
-		{
-		  BFD_ASSERT (mh->need_fn_stub);
-		  relocation = (mh->fn_stub->output_section->vma
-				+ mh->fn_stub->output_offset);
-		}
-	      else
-		{
-		  asection *fn_stub;
-
-		  fn_stub = elf_tdata (input_bfd)->local_stubs[r_symndx];
-		  relocation = (fn_stub->output_section->vma
-				+ fn_stub->output_offset);
-		}
-
-	      /* RELOCATION now points to 32 bit code.  */
-	      other = 0;
-	    }
-
-	  /* If this function has a call_stub, then it is called by a
-             mips16 function; the call needs to go through a stub if
-             this function is a 32 bit function.  If this reloc is a
-             16 bit call, and the symbol is not a 16 bit function,
-             then redirect the reloc to the stub.  Note that we don't
-             need to worry about calling the function through a
-             function pointer; such calls are handled by routing
-             through a special mips16 routine.  We don't have to check
-             whether this call is from a stub; it can't be, because a
-             stub contains 32 bit code, and hence can not have a 16
-             bit reloc.  */
-	  if (r_type == R_MIPS16_26
-	      && mh != NULL
-	      && (mh->call_stub != NULL || mh->call_fp_stub != NULL)
-	      && other != STO_MIPS16)
-	    {
-	      asection *stub;
-
-	      /* If both call_stub and call_fp_stub are defined, we
-                 can figure out which one to use by seeing which one
-                 appears in the input file.  */
-	      if (mh->call_stub != NULL && mh->call_fp_stub != NULL)
-		{
-		  asection *o;
-
-		  stub = NULL;
-		  for (o = input_bfd->sections; o != NULL; o = o->next)
-		    {
-		      if (strncmp (bfd_get_section_name (input_bfd, o),
-				   CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0)
-			{
-			  stub = mh->call_fp_stub;
-			  break;
-			}
-		    }
-		  if (stub == NULL)
-		    stub = mh->call_stub;
-		}
-	      else if (mh->call_stub != NULL)
-		stub = mh->call_stub;
-	      else
-		stub = mh->call_fp_stub;
-
-	      BFD_ASSERT (stub->_raw_size > 0);
-	      relocation = stub->output_section->vma + stub->output_offset;
-	    }
-
-	  if (r_type == R_MIPS_HI16)
-	    {
-	      Elf_Internal_Rela *lorel;
-
-	      /* As a GNU extension, permit an arbitrary number of
-		 R_MIPS_HI16 relocs before the R_MIPS_LO16 reloc.
-		 This permits gcc to emit the HI and LO relocs itself.  */
-	      for (lorel = rel + 1;
-		   (lorel < relend
-		    && ELF32_R_TYPE (lorel->r_info) == R_MIPS_HI16);
-		   lorel++)
-		;
-	      if (lorel < relend
-		  && ELF32_R_TYPE (lorel->r_info) == R_MIPS_LO16)
-		{
-		  mips_elf_relocate_hi16 (input_bfd, rel, lorel,
-					  contents, relocation + addend);
-		  r = bfd_reloc_ok;
-		}
-	      else
-		r = _bfd_final_link_relocate (howto, input_bfd, input_section,
-					      contents, rel->r_offset,
-					      relocation, addend);
-	    }
-	  else if (r_type == R_MIPS_GOT16 && local)
-	    {
-	      /* GOT16 must also have an associated LO16 in the local
-		 case.  In this case, the addend is extracted and the
-		 section in which the referenced object is determined.
-		 Then the final address of the object is computed and
-		 the GOT entry for the hipage (an aligned 64kb chunk)
-		 is added to .got section if needed.  The offset field
-		 of the GOT16-relocated instruction is replaced by the
-		 index of this GOT entry for the hipage.  */
-	      if ((rel + 1) < relend
-		  && ELF32_R_TYPE ((rel + 1)->r_info) == R_MIPS_LO16)
-		{
-		  if (! mips_elf_relocate_got_local (output_bfd, input_bfd,
-						     sgot, rel, rel + 1,
-						     contents,
-						     relocation + addend))
-		    return false;
-		  r = bfd_reloc_ok;
-		}
-	      else
-		r = bfd_reloc_outofrange;
-	    }
-	  else if (r_type == R_MIPS_CALL16
-		   || r_type == R_MIPS_GOT16
-		   || r_type == R_MIPS_CALL_LO16
-		   || r_type == R_MIPS_GOT_LO16)
-	    {
-	      bfd_vma offset;
-
-	      /* This symbol must be registered as a global symbol
-		 having the corresponding got entry.  */
-	      BFD_ASSERT (h->got.offset != (bfd_vma) -1);
-
-	      offset = (h->dynindx - g->global_gotsym + g->local_gotno) * 4;
-	      BFD_ASSERT (g->local_gotno <= offset
-			  && offset < sgot->_raw_size);
-	      bfd_put_32 (output_bfd, relocation + addend,
-			  sgot->contents + offset);
-	      offset = (sgot->output_section->vma + sgot->output_offset
-			+ offset - gp);
-	      mips_elf_relocate_global_got (input_bfd, rel, contents,
-					    offset);
-	      r = bfd_reloc_ok;
-	    }
-	  else if (r_type == R_MIPS_CALL_HI16
-		   || r_type == R_MIPS_GOT_HI16)
-	    {
-	      bfd_vma offset;
-
-	      /* This must be a global symbol with a got entry.  The
-                 next reloc must be the corresponding LO16 reloc.  */
-	      BFD_ASSERT (h != NULL && h->got.offset != (bfd_vma) -1);
-	      BFD_ASSERT ((rel + 1) < relend);
-	      BFD_ASSERT ((int) ELF32_R_TYPE ((rel + 1)->r_info)
-			  == (r_type == R_MIPS_CALL_HI16
-			      ? (int) R_MIPS_CALL_LO16
-			      : (int) R_MIPS_GOT_LO16));
-
-	      offset = (h->dynindx - g->global_gotsym + g->local_gotno) * 4;
-	      BFD_ASSERT (g->local_gotno <= offset
-			  && offset < sgot->_raw_size);
-	      bfd_put_32 (output_bfd, relocation + addend,
-			  sgot->contents + offset);
-	      offset = (sgot->output_section->vma + sgot->output_offset
-			+ offset - gp);
-	      mips_elf_relocate_hi16 (input_bfd, rel, rel + 1, contents,
-				      offset);
-	      r = bfd_reloc_ok;
-	    }
-	  else if (r_type == R_MIPS_REL32
-		   || r_type == R_MIPS_32)
-	    {
-	      Elf_Internal_Rel outrel;
-	      Elf32_crinfo cptrel;
-	      bfd_byte *cr;
-
-	      if ((info->shared
-		   || (elf_hash_table (info)->dynamic_sections_created
-		       && h != NULL
-		       && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
-			   == 0)))
-		  && (input_section->flags & SEC_ALLOC) != 0)
-		{
-		  boolean skip;
-
-		  /* When generating a shared object, these
-		     relocations are copied into the output file to be
-		     resolved at run time.  */
-		  if (sreloc == NULL)
-		    {
-		      sreloc = bfd_get_section_by_name (dynobj, ".rel.dyn");
-		      BFD_ASSERT (sreloc != NULL);
-		    }
-
-		  skip = false;
-
-		  if (elf_section_data (input_section)->stab_info == NULL)
-		    outrel.r_offset = rel->r_offset;
-		  else
-		    {
-		      bfd_vma off;
-
-		      off = (_bfd_stab_section_offset
-			     (output_bfd, &elf_hash_table (info)->stab_info,
-			      input_section,
-			      &elf_section_data (input_section)->stab_info,
-			      rel->r_offset));
-		      if (off == (bfd_vma) -1)
-			skip = true;
-		      outrel.r_offset = off;
-		    }
-
-		  outrel.r_offset += (input_section->output_section->vma
-				      + input_section->output_offset);
-
-		  addend = bfd_get_32 (input_bfd, contents + rel->r_offset);
-
-		  if (skip)
-		    memset (&outrel, 0, sizeof outrel);
-		  else if (h != NULL
-			   && (! info->symbolic
-			       || (h->elf_link_hash_flags
-				   & ELF_LINK_HASH_DEF_REGULAR) == 0))
-		    {
-		      BFD_ASSERT (h->dynindx != -1);
-		      outrel.r_info = ELF32_R_INFO (h->dynindx, R_MIPS_REL32);
-		      sec = input_section;
-		    }
-		  else
-		    {
-		      long indx;
-
-		      if (h == NULL)
-			sec = local_sections[r_symndx];
-		      else
-			{
-			  BFD_ASSERT (h->root.type == bfd_link_hash_defined
-				      || (h->root.type
-					  == bfd_link_hash_defweak));
-			  sec = h->root.u.def.section;
-			}
-		      if (sec != NULL && bfd_is_abs_section (sec))
-			indx = 0;
-		      else if (sec == NULL || sec->owner == NULL)
-			{
-			  bfd_set_error (bfd_error_bad_value);
-			  return false;
-			}
-		      else
-			{
-			  asection *osec;
-
-			  osec = sec->output_section;
-			  indx = elf_section_data (osec)->dynindx;
-			  if (indx == 0)
-			    abort ();
-			}
-
-		      outrel.r_info = ELF32_R_INFO (indx, R_MIPS_REL32);
-		      addend += relocation;
-		    }
-
-		  if (! skip)
-		    bfd_put_32 (output_bfd, addend, contents + rel->r_offset);
-
-		  bfd_elf32_swap_reloc_out (output_bfd, &outrel,
-					     (((Elf32_External_Rel *)
-					       sreloc->contents)
-					      + sreloc->reloc_count));
-		  ++sreloc->reloc_count;
-
-		  if (! skip && SGI_COMPAT (output_bfd))
-		    {
-		      if (scpt == NULL)
-			continue;
-
-		      /* Make an entry of compact relocation info.  */
-		      mips_elf_set_cr_format (cptrel, CRF_MIPS_LONG);
-		      cptrel.vaddr = (rel->r_offset
-				      + input_section->output_section->vma
-				      + input_section->output_offset);
-		      if (r_type == R_MIPS_REL32)
-			mips_elf_set_cr_type (cptrel, CRT_MIPS_REL32);
-		      else
-			mips_elf_set_cr_type (cptrel, CRT_MIPS_WORD);
-		      mips_elf_set_cr_dist2to (cptrel, 0);
-		      cptrel.konst = addend;
-
-		      cr = (scpt->contents
-			    + sizeof (Elf32_External_compact_rel));
-		      bfd_elf32_swap_crinfo_out (output_bfd, &cptrel,
-						 ((Elf32_External_crinfo *) cr
-						  + scpt->reloc_count));
-		      ++scpt->reloc_count;
-		    }
-
-		  /* This reloc will be computed at runtime, so
-		     there's no need to do anything now.  */
-		  continue;
-		}
-	      else
-		r = _bfd_final_link_relocate (howto, input_bfd, input_section,
-					      contents, rel->r_offset,
-					      relocation, addend);
-	    }
-	  else if (r_type == R_MIPS_64)
-	    {
-	      bfd_size_type addr;
-	      unsigned long val;
-
-	      /* Do a 32 bit relocation, and sign extend to 64 bits.  */
-	      addr = rel->r_offset;
-	      if (bfd_big_endian (input_bfd))
-		addr += 4;
-	      r = _bfd_final_link_relocate (howto, input_bfd, input_section,
-					    contents, addr, relocation,
-					    addend);
-	      val = bfd_get_32 (input_bfd, contents + addr);
-	      if ((val & 0x80000000) != 0)
-		val = 0xffffffff;
-	      else
-		val = 0;
-	      addr = rel->r_offset;
-	      if (bfd_little_endian (input_bfd))
-		addr += 4;
-	      bfd_put_32 (input_bfd, val, contents + addr);
-	    }
-	  else if (r_type == R_MIPS_26 && other == STO_MIPS16)
-	    {
-	      unsigned long insn;
-
-	      /* This is a jump to a mips16 routine from a mips32
-                 routine.  We need to change jal into jalx.  */
-	      insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
-	      if (((insn >> 26) & 0x3f) != 0x3
-		  && ((insn >> 26) & 0x3f) != 0x1d)
-		{
-		  (*_bfd_error_handler)
-		    (_("%s: %s+0x%lx: jump to mips16 routine which is not jal"),
-		     bfd_get_filename (input_bfd),
-		     input_section->name,
-		     (unsigned long) rel->r_offset);
-		  bfd_set_error (bfd_error_bad_value);
-		  return false;
-		}
-	      insn = (insn & 0x3ffffff) | (0x1d << 26);
-	      bfd_put_32 (input_bfd, insn, contents + rel->r_offset);
-	      r = _bfd_final_link_relocate (howto, input_bfd, input_section,
-					    contents, rel->r_offset,
-					    relocation, addend);
-	    }
-	  else if (r_type == R_MIPS16_26)
-	    {
-	      /* It's easiest to do the normal relocation, and then
-                 dig out the instruction and swap the first word the
-                 way the mips16 expects it.  If this is little endian,
-                 though, we need to swap the two words first, and then
-                 swap them back again later, so that the address looks
-                 right.  */
-
-	      if (bfd_little_endian (input_bfd))
-		{
-		  unsigned long insn;
-
-		  insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
-		  insn = ((insn >> 16) & 0xffff) | ((insn & 0xffff) << 16);
-		  bfd_put_32 (input_bfd, insn, contents + rel->r_offset);
-		}
-
-	      r = _bfd_final_link_relocate (howto, input_bfd, input_section,
-					    contents, rel->r_offset,
-					    relocation, addend);
-	      if (r == bfd_reloc_ok)
-		{
-		  unsigned long insn;
-
-		  if (bfd_little_endian (input_bfd))
-		    {
-		      insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
-		      insn = ((insn >> 16) & 0xffff) | ((insn & 0xffff) << 16);
-		      bfd_put_32 (input_bfd, insn, contents + rel->r_offset);
-		    }
-
-		  insn = bfd_get_16 (input_bfd, contents + rel->r_offset);
-		  insn = ((insn & 0xfc00)
-			  | ((insn & 0x1f) << 5)
-			  | ((insn & 0x3e0) >> 5));
-		  /* If this is a jump to a 32 bit routine, then make
-		     it jalx.  */
-		  if (other != STO_MIPS16)
-		    insn |= 0x400;
-		  bfd_put_16 (input_bfd, insn, contents + rel->r_offset);
-		}
-	    }
-	  else if (r_type == R_MIPS16_GPREL)
-	    {
-	      unsigned short extend, insn;
-	      bfd_byte buf[4];
-	      unsigned long final;
-
-	      /* Extract the addend into buf, run the regular reloc,
-                 and stuff the resulting value back into the
-                 instructions.  */
-	      if (rel->r_offset > input_section->_raw_size)
-		r = bfd_reloc_outofrange;
-	      else
-		{
-		  extend = bfd_get_16 (input_bfd, contents + rel->r_offset);
-		  insn = bfd_get_16 (input_bfd, contents + rel->r_offset + 2);
-		  bfd_put_32 (input_bfd,
-			      (((extend & 0x1f) << 11)
-			       | (extend & 0x7e0)
-			       | (insn & 0x1f)),
-			      buf);
-		  r = _bfd_final_link_relocate (howto, input_bfd,
-						input_section, buf,
-						(bfd_vma) 0, relocation,
-						addend);
-		  final = bfd_get_32 (input_bfd, buf);
-		  bfd_put_16 (input_bfd,
-			      ((extend & 0xf800)
-			       | ((final >> 11) & 0x1f)
-			       | (final & 0x7e0)),
-			      contents + rel->r_offset);
-		  bfd_put_16 (input_bfd,
-			      ((insn & 0xffe0)
-			       | (final & 0x1f)),
-			      contents + rel->r_offset + 2);
-		}
-	    }
-	  else
-	    r = _bfd_final_link_relocate (howto, input_bfd, input_section,
-					  contents, rel->r_offset,
-					  relocation, addend);
-
-	  /* The jal instruction can only jump to an address which is
-             divisible by 4, and it can only jump to an address with
-             the same upper 4 bits as the PC.  */
-	  if (r == bfd_reloc_ok
-	      && (r_type == R_MIPS16_26 || r_type == R_MIPS_26))
-	    {
-	      bfd_vma addr;
-              bfd_vma pc;
-              bfd_vma target;
-
-              pc = ((input_section->output_section->vma
-                     + input_section->output_offset
-                     + rel->r_offset)
-                    & 0xf0000000);
-              target = bfd_get_32 (input_bfd, contents + rel->r_offset)
-			& (howto->dst_mask);
-              addr = (target << 2) + pc;
-	      if (other == STO_MIPS16)
-		addr &= ~ (bfd_vma) 1;
-	      if ((addr & 3) != 0
-		  || ((addr & 0xf0000000)
-                      != pc))
-		r = bfd_reloc_overflow;
-	    }
-
-	  /* Don't bother to report a relocation overflow for a call
-             to a weak undefined symbol with a value of zero.  This
-             permits us to use
-	         if (!f) f();
-	     even if we aren't in range to call address zero.  */
-	  if (r == bfd_reloc_overflow
-	      && (r_type == R_MIPS16_26 || r_type == R_MIPS_26)
-	      && relocation + addend == 0
-	      && h != NULL
-	      && h->root.type == bfd_link_hash_undefweak)
-	    r = bfd_reloc_ok;
-
-	  /* If we've already issued an error for an undefined symbol,
-             don't issue another useless error.  */
-	  if (undefined_error
-	      && (r == bfd_reloc_undefined || r == bfd_reloc_overflow))
-	    r = bfd_reloc_ok;
-
-	  if (SGI_COMPAT (abfd)
-	      && scpt != NULL
-	      && (input_section->flags & SEC_ALLOC) != 0)
-	    {
-	      Elf32_crinfo cptrel;
-	      bfd_byte *cr;
-
-	      /* Make an entry of compact relocation info.  */
-	      mips_elf_set_cr_format (cptrel, CRF_MIPS_LONG);
-	      cptrel.vaddr = (rel->r_offset
-			      + input_section->output_section->vma
-			      + input_section->output_offset);
-
-	      switch (r_type)
-		{
-		case R_MIPS_26:
-		  mips_elf_set_cr_type (cptrel, CRT_MIPS_JMPAD);
-		  /* XXX How should we set dist2to in this case. */
-		  mips_elf_set_cr_dist2to (cptrel, 8);
-		  cptrel.konst = addend + relocation;
-		  cr = scpt->contents + sizeof (Elf32_External_compact_rel);
-		  bfd_elf32_swap_crinfo_out (output_bfd, &cptrel,
-					     ((Elf32_External_crinfo *) cr
-					      + scpt->reloc_count));
-		  ++scpt->reloc_count;
-		  break;
-
-		case R_MIPS_GPREL16:
-		case R_MIPS_LITERAL:
-		case R_MIPS_GPREL32:
-		  mips_elf_set_cr_type (cptrel, CRT_MIPS_GPHI_LO);
-		  cptrel.konst = gp - cptrel.vaddr;
-		  mips_elf_set_cr_dist2to (cptrel, 4);
-		  cr = scpt->contents + sizeof (Elf32_External_compact_rel);
-		  bfd_elf32_swap_crinfo_out (output_bfd, &cptrel,
-					     ((Elf32_External_crinfo *) cr
-					      + scpt->reloc_count));
-		  ++scpt->reloc_count;
-		  break;
-
-		default:
-		  break;
-		}
-	    }
+	default:
+	  abort ();
+	  break;
 	}
 
-      if (r != bfd_reloc_ok)
+      /* If we've got another relocation for the address, keep going
+	 until we reach the last one.  */
+      if (use_saved_addend_p)
 	{
-	  switch (r)
-	    {
-	    default:
-	    case bfd_reloc_outofrange:
-	      abort ();
-	    case bfd_reloc_overflow:
-	      {
-		const char *name;
-
-		if (h != NULL)
-		  name = h->root.root.string;
-		else
-		  {
-		    name = bfd_elf_string_from_elf_section (input_bfd,
-							    symtab_hdr->sh_link,
-							    sym->st_name);
-		    if (name == NULL)
-		      return false;
-		    if (*name == '\0')
-		      name = bfd_section_name (input_bfd, sec);
-		  }
-		if (! ((*info->callbacks->reloc_overflow)
-		       (info, name, howto->name, (bfd_vma) 0,
-			input_bfd, input_section, rel->r_offset)))
-		  return false;
-	      }
-	      break;
-	    }
+	  addend = value;
+	  continue;
 	}
+
+      if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd))
+	/* See the comment above about using R_MIPS_64 in the 32-bit
+	   ABI.  Until now, we've been using the HOWTO for R_MIPS_32;
+	   that calculated the right value.  Now, however, we
+	   sign-extend the 32-bit result to 64-bits, and store it as a
+	   64-bit value.  We are especially generous here in that we
+	   go to extreme lengths to support this usage on systems with
+	   only a 32-bit VMA.  */
+	{
+#ifdef BFD64
+	  /* Just sign-extend the value, and then fall through to the
+	     normal case, using the R_MIPS_64 howto.  That will store
+	     the 64-bit value into a 64-bit area.  */
+	  value = mips_elf_sign_extend (value, 64);
+	  howto = elf_mips_howto_table + R_MIPS_64;
+#else /* !BFD64 */
+	  /* In the 32-bit VMA case, we must handle sign-extension and
+	     endianness manually.  */
+	  bfd_vma sign_bits;
+	  bfd_vma low_bits;
+	  bfd_vma high_bits;
+
+	  if (value & 0x80000000)
+	    sign_bits = 0xffffffff;
+	  else
+	    sign_bits = 0;
+
+	  /* If only a 32-bit VMA is available do two separate
+	     stores.  */
+	  if (bfd_big_endian (input_bfd))
+	    {
+	      /* Store the sign-bits (which are most significant)
+		 first.  */
+	      low_bits = sign_bits;
+	      high_bits = value;
+	    }
+	  else
+	    {
+	      low_bits = value;
+	      high_bits = sign_bits;
+	    }
+	  bfd_put_32 (input_bfd, low_bits, 
+		      contents + rel->r_offset);
+	  bfd_put_32 (input_bfd, high_bits, 
+		      contents + rel->r_offset + 4);
+	  continue;
+#endif /* !BFD64 */
+	}
+
+      /* Actually perform the relocation.  */
+      if (!mips_elf_perform_relocation (info, howto, rel, value, input_bfd, 
+					input_section, contents,
+					require_jalx))
+	return false;
     }
 
   return true;
@@ -5665,11 +6727,11 @@
    also where we undo the increment of the value for a mips16 symbol.  */
 
 /*ARGSIGNORED*/
-static boolean
-mips_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     const char *name;
+boolean
+_bfd_mips_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
      Elf_Internal_Sym *sym;
      asection *input_sec;
 {
@@ -5692,12 +6754,15 @@
 /* The name of the dynamic interpreter.  This is put in the .interp
    section.  */
 
-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
+#define ELF_DYNAMIC_INTERPRETER(abfd) 		\
+   (ABI_N32_P (abfd) ? "/usr/lib32/libc.so.1" 	\
+    : ABI_64_P (abfd) ? "/usr/lib64/libc.so.1" 	\
+    : "/usr/lib/libc.so.1")
 
 /* Create dynamic sections when linking against a dynamic object.  */
 
-static boolean
-mips_elf_create_dynamic_sections (abfd, info)
+boolean
+_bfd_mips_elf_create_dynamic_sections (abfd, info)
      bfd *abfd;
      struct bfd_link_info *info;
 {
@@ -5721,28 +6786,42 @@
   if (! mips_elf_create_got_section (abfd, info))
     return false;
 
+  /* Create the .msym section on IRIX6.  It is used by the dynamic
+     linker to speed up dynamic relocations, and to avoid computing
+     the ELF hash for symbols.  */
+  if (IRIX_COMPAT (abfd) == ict_irix6
+      && !mips_elf_create_msym_section (abfd))
+    return false;
+  
   /* Create .stub section.  */
-  if (bfd_get_section_by_name (abfd, ".stub") == NULL)
+  if (bfd_get_section_by_name (abfd, 
+			       MIPS_ELF_STUB_SECTION_NAME (abfd)) == NULL)
     {
-      s = bfd_make_section (abfd, ".stub");
+      s = bfd_make_section (abfd, MIPS_ELF_STUB_SECTION_NAME (abfd));
       if (s == NULL
-	  || ! bfd_set_section_flags (abfd, s, flags)
-	  || ! bfd_set_section_alignment (abfd, s, 2))
+	  || ! bfd_set_section_flags (abfd, s, flags | SEC_CODE)
+	  || ! bfd_set_section_alignment (abfd, s,
+					  MIPS_ELF_LOG_FILE_ALIGN (abfd)))
 	return false;
     }
 
-  if (SGI_COMPAT (abfd)
+  if (IRIX_COMPAT (abfd) == ict_irix5
       && !info->shared
       && bfd_get_section_by_name (abfd, ".rld_map") == NULL)
     {
       s = bfd_make_section (abfd, ".rld_map");
       if (s == NULL
 	  || ! bfd_set_section_flags (abfd, s, flags & ~SEC_READONLY)
-	  || ! bfd_set_section_alignment (abfd, s, 2))
+	  || ! bfd_set_section_alignment (abfd, s,
+					  MIPS_ELF_LOG_FILE_ALIGN (abfd)))
 	return false;
     }
 
-  if (SGI_COMPAT (abfd))
+  /* On IRIX5, we adjust add some additional symbols and change the
+     alignments of several sections.  There is no ABI documentation
+     indicating that this is necessary on IRIX6, nor any evidence that
+     the linker takes such action.  */
+  if (IRIX_COMPAT (abfd) == ict_irix5)
     {
       for (namep = mips_elf_dynsym_rtproc_names; *namep != NULL; namep++)
 	{
@@ -5832,7 +6911,7 @@
 static boolean
 mips_elf_create_compact_rel_section (abfd, info)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
 {
   flagword flags;
   register asection *s;
@@ -5845,7 +6924,8 @@
       s = bfd_make_section (abfd, ".compact_rel");
       if (s == NULL
 	  || ! bfd_set_section_flags (abfd, s, flags)
-	  || ! bfd_set_section_alignment (abfd, s, 2))
+	  || ! bfd_set_section_alignment (abfd, s,
+					  MIPS_ELF_LOG_FILE_ALIGN (abfd)))
 	return false;
 
       s->_raw_size = sizeof (Elf32_External_compact_rel);
@@ -5867,7 +6947,7 @@
   struct mips_got_info *g;
 
   /* This function may be called more than once.  */
-  if (bfd_get_section_by_name (abfd, ".got") != NULL)
+  if (mips_elf_got_section (abfd))
     return true;
 
   flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
@@ -5898,13 +6978,13 @@
     return false;
 
   /* The first several global offset table entries are reserved.  */
-  s->_raw_size = MIPS_RESERVED_GOTNO * 4;
+  s->_raw_size = MIPS_RESERVED_GOTNO * MIPS_ELF_GOT_SIZE (abfd);
 
   g = (struct mips_got_info *) bfd_alloc (abfd,
 					  sizeof (struct mips_got_info));
   if (g == NULL)
     return false;
-  g->global_gotsym = 0;
+  g->global_gotsym = NULL;
   g->local_gotno = MIPS_RESERVED_GOTNO;
   g->assigned_gotno = MIPS_RESERVED_GOTNO;
   if (elf_section_data (s) == NULL)
@@ -5915,15 +6995,66 @@
 	return false;
     }
   elf_section_data (s)->tdata = (PTR) g;
+  elf_section_data (s)->this_hdr.sh_flags 
+    |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
 
   return true;
 }
 
+/* Returns the .msym section for ABFD, creating it if it does not
+   already exist.  Returns NULL to indicate error.  */
+
+static asection *
+mips_elf_create_msym_section (abfd)
+     bfd *abfd;
+{
+  asection *s;
+
+  s = bfd_get_section_by_name (abfd, MIPS_ELF_MSYM_SECTION_NAME (abfd));
+  if (!s) 
+    {
+      s = bfd_make_section (abfd, MIPS_ELF_MSYM_SECTION_NAME (abfd));
+      if (!s
+	  || !bfd_set_section_flags (abfd, s, 
+				     SEC_ALLOC
+				     | SEC_LOAD
+				     | SEC_HAS_CONTENTS
+				     | SEC_LINKER_CREATED 
+				     | SEC_READONLY)
+	  || !bfd_set_section_alignment (abfd, s,
+					 MIPS_ELF_LOG_FILE_ALIGN (abfd)))
+	return NULL;
+    }
+
+  return s;
+}
+
+/* Add room for N relocations to the .rel.dyn section in ABFD.  */
+
+static void
+mips_elf_allocate_dynamic_relocations (abfd, n)
+     bfd *abfd;
+     unsigned int n;
+{
+  asection *s;
+
+  s = bfd_get_section_by_name (abfd, MIPS_ELF_REL_DYN_SECTION_NAME (abfd));
+  BFD_ASSERT (s != NULL);
+  
+  if (s->_raw_size == 0)
+    {
+      /* Make room for a null element. */
+      s->_raw_size += MIPS_ELF_REL_SIZE (abfd);
+      ++s->reloc_count;
+    }
+  s->_raw_size += n * MIPS_ELF_REL_SIZE (abfd);
+}
+
 /* Look through the relocs for a section during the first phase, and
    allocate space in the global offset table.  */
 
-static boolean
-mips_elf_check_relocs (abfd, info, sec, relocs)
+boolean
+_bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
      bfd *abfd;
      struct bfd_link_info *info;
      asection *sec;
@@ -5939,6 +7070,7 @@
   const Elf_Internal_Rela *rel_end;
   asection *sgot;
   asection *sreloc;
+  struct elf_backend_data *bed;
 
   if (info->relocateable)
     return true;
@@ -6023,7 +7155,7 @@
 	      asection **n;
 
 	      if (elf_bad_symtab (abfd))
-		symcount = symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
+		symcount = symtab_hdr->sh_size / symtab_hdr->sh_entsize;
 	      else
 		symcount = symtab_hdr->sh_info;
 	      n = (asection **) bfd_zalloc (abfd,
@@ -6113,7 +7245,7 @@
     }
   else
     {
-      sgot = bfd_get_section_by_name (dynobj, ".got");
+      sgot = mips_elf_got_section (dynobj);
       if (sgot == NULL)
 	g = NULL;
       else
@@ -6125,14 +7257,16 @@
     }
 
   sreloc = NULL;
-
-  rel_end = relocs + sec->reloc_count;
-  for (rel = relocs; rel < rel_end; rel++)
+  bed = get_elf_backend_data (abfd);
+  rel_end = relocs + sec->reloc_count * bed->s->int_rels_per_ext_rel;
+  for (rel = relocs; rel < rel_end; ++rel)
     {
       unsigned long r_symndx;
+      int r_type;
       struct elf_link_hash_entry *h;
 
       r_symndx = ELF32_R_SYM (rel->r_info);
+      r_type = ELF32_R_TYPE (rel->r_info);
 
       if (r_symndx < extsymoff)
 	h = NULL;
@@ -6151,7 +7285,7 @@
       /* Some relocs require a global offset table.  */
       if (dynobj == NULL || sgot == NULL)
 	{
-	  switch (ELF32_R_TYPE (rel->r_info))
+	  switch (r_type)
 	    {
 	    case R_MIPS_GOT16:
 	    case R_MIPS_CALL16:
@@ -6159,19 +7293,19 @@
 	    case R_MIPS_CALL_LO16:
 	    case R_MIPS_GOT_HI16:
 	    case R_MIPS_GOT_LO16:
+	    case R_MIPS_GOT_PAGE:
+	    case R_MIPS_GOT_OFST:
+	    case R_MIPS_GOT_DISP:
 	      if (dynobj == NULL)
 		elf_hash_table (info)->dynobj = dynobj = abfd;
 	      if (! mips_elf_create_got_section (dynobj, info))
 		return false;
-	      sgot = bfd_get_section_by_name (dynobj, ".got");
-	      BFD_ASSERT (sgot != NULL);
-	      BFD_ASSERT (elf_section_data (sgot) != NULL);
-	      g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
-	      BFD_ASSERT (g != NULL);
+	      g = mips_elf_got_info (dynobj, &sgot);
 	      break;
 
 	    case R_MIPS_32:
 	    case R_MIPS_REL32:
+	    case R_MIPS_64:
 	      if (dynobj == NULL
 		  && (info->shared || h != NULL)
 		  && (sec->flags & SEC_ALLOC) != 0)
@@ -6183,13 +7317,28 @@
 	    }
 	}
 
-      switch (ELF32_R_TYPE (rel->r_info))
+      if (!h && (r_type == R_MIPS_CALL_LO16
+		 || r_type == R_MIPS_GOT_LO16
+		 || r_type == R_MIPS_GOT_DISP))
+	{
+	  /* We may need a local GOT entry for this relocation.  We
+	     don't count R_MIPS_HI16 or R_MIPS_GOT16 relocations
+	     because they are always followed by a R_MIPS_LO16
+	     relocation for the value.  We don't R_MIPS_GOT_PAGE
+	     because we can estimate the maximum number of pages
+	     needed by looking at the size of the segment.
+
+	     This estimation is very conservative since we can merge
+	     duplicate entries in the GOT.  In order to be less
+	     conservative, we could actually build the GOT here,
+	     rather than in relocate_section.  */
+	  g->local_gotno++;
+	  sgot->_raw_size += MIPS_ELF_GOT_SIZE (dynobj);
+	}
+
+      switch (r_type)
 	{
 	case R_MIPS_CALL16:
-	case R_MIPS_CALL_HI16:
-	case R_MIPS_CALL_LO16:
-	  /* This symbol requires a global offset table entry.  */
-
 	  if (h == NULL)
 	    {
 	      (*_bfd_error_handler)
@@ -6198,27 +7347,13 @@
 	      bfd_set_error (bfd_error_bad_value);
 	      return false;
 	    }
+	  /* Fall through.  */
 
-	  /* Make sure this symbol is output as a dynamic symbol.  */
-	  if (h->dynindx == -1)
-	    {
-	      if (! bfd_elf32_link_record_dynamic_symbol (info, h))
-		return false;
-	    }
-
-	  if (h->got.offset != (bfd_vma) -1)
-	    {
-	      /* We have already allocated space in the .got.  */
-	      break;
-	    }
-
-	  /* Note the index of the first global got symbol in .dynsym.  */
-	  if (g->global_gotsym == 0
-	      || g->global_gotsym > (unsigned long) h->dynindx)
-	    g->global_gotsym = h->dynindx;
-
-	  /* Make this symbol to have the corresponding got entry.  */
-	  h->got.offset = 0;
+	case R_MIPS_CALL_HI16:
+	case R_MIPS_CALL_LO16:
+	  /* This symbol requires a global offset table entry.  */
+	  if (!mips_elf_record_global_got_symbol (h, info, g))
+	    return false;
 
 	  /* We need a stub, not a plt entry for the undefined
 	     function.  But we record it as if it needs plt.  See
@@ -6231,42 +7366,21 @@
 	case R_MIPS_GOT16:
 	case R_MIPS_GOT_HI16:
 	case R_MIPS_GOT_LO16:
+	case R_MIPS_GOT_DISP:
 	  /* This symbol requires a global offset table entry.  */
-
-	  if (h != NULL)
-	    {
-	      /* Make sure this symbol is output as a dynamic symbol.  */
-	      if (h->dynindx == -1)
-		{
-		  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
-		    return false;
-		}
-
-	      if (h->got.offset != (bfd_vma) -1)
-		{
-		  /* We have already allocated space in the .got.  */
-		  break;
-		}
-	      /* Note the index of the first global got symbol in
-                 .dynsym.  */
-	      if (g->global_gotsym == 0
-		  || g->global_gotsym > (unsigned long) h->dynindx)
-		g->global_gotsym = h->dynindx;
-
-	      /* Make this symbol to be the global got symbol.  */
-	      h->got.offset = 0;
-	    }
-
+	  if (h && !mips_elf_record_global_got_symbol (h, info, g))
+	    return false;
 	  break;
 
 	case R_MIPS_32:
 	case R_MIPS_REL32:
+	case R_MIPS_64:
 	  if ((info->shared || h != NULL)
 	      && (sec->flags & SEC_ALLOC) != 0)
 	    {
 	      if (sreloc == NULL)
 		{
-		  const char *name = ".rel.dyn";
+		  const char *name = MIPS_ELF_REL_DYN_SECTION_NAME (dynobj);
 
 		  sreloc = bfd_get_section_by_name (dynobj, name);
 		  if (sreloc == NULL)
@@ -6286,19 +7400,11 @@
 		    }
 		}
 	      if (info->shared)
-		{
-		  /* When creating a shared object, we must copy these
-		     reloc types into the output file as R_MIPS_REL32
-		     relocs.  We make room for this reloc in the
-		     .rel.dyn reloc section */
-		  if (sreloc->_raw_size == 0)
-		    {
-		      /* Add a null element. */
-		      sreloc->_raw_size += sizeof (Elf32_External_Rel);
-		      ++sreloc->reloc_count;
-		    }
-		  sreloc->_raw_size += sizeof (Elf32_External_Rel);
-		}
+		/* When creating a shared object, we must copy these
+		   reloc types into the output file as R_MIPS_REL32
+		   relocs.  We make room for this reloc in the
+		   .rel.dyn reloc section.  */
+		mips_elf_allocate_dynamic_relocations (dynobj, 1);
 	      else
 		{
 		  struct mips_elf_link_hash_entry *hmips;
@@ -6306,21 +7412,27 @@
 		  /* We only need to copy this reloc if the symbol is
                      defined in a dynamic object.  */
 		  hmips = (struct mips_elf_link_hash_entry *) h;
-		  ++hmips->mips_32_relocs;
+		  ++hmips->possibly_dynamic_relocs;
 		}
+	     
+	      /* Even though we don't directly need a GOT entry for
+		 this symbol, a symbol must have a dynamic symbol
+		 table index greater that DT_GOTSYM if there are
+		 dynamic relocations against it.  */
+	      if (!mips_elf_record_global_got_symbol (h, info, g))
+		return false;
 	    }
 
-	  if (SGI_COMPAT (abfd))
+	  if (SGI_COMPAT (dynobj))
 	    mips_elf_hash_table (info)->compact_rel_size +=
 	      sizeof (Elf32_External_crinfo);
-
 	  break;
 
 	case R_MIPS_26:
 	case R_MIPS_GPREL16:
 	case R_MIPS_LITERAL:
 	case R_MIPS_GPREL32:
-	  if (SGI_COMPAT (abfd))
+	  if (SGI_COMPAT (dynobj))
 	    mips_elf_hash_table (info)->compact_rel_size +=
 	      sizeof (Elf32_External_crinfo);
 	  break;
@@ -6347,7 +7459,7 @@
          symbol, then we will need the fn_stub if there is one.
          References from a stub section do not count. */
       if (h != NULL
-	  && ELF32_R_TYPE (rel->r_info) != R_MIPS16_26
+	  && r_type != R_MIPS16_26
 	  && strncmp (bfd_get_section_name (abfd, sec), FN_STUB,
 		      sizeof FN_STUB - 1) != 0
 	  && strncmp (bfd_get_section_name (abfd, sec), CALL_STUB,
@@ -6368,10 +7480,10 @@
 /* Return the section that should be marked against GC for a given
    relocation.  */
 
-static asection *
-mips_elf_gc_mark_hook (abfd, info, rel, h, sym)
+asection *
+_bfd_mips_elf_gc_mark_hook (abfd, info, rel, h, sym)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      Elf_Internal_Rela *rel;
      struct elf_link_hash_entry *h;
      Elf_Internal_Sym *sym;
@@ -6417,12 +7529,12 @@
 
 /* Update the got entry reference counts for the section being removed.  */
 
-static boolean
-mips_elf_gc_sweep_hook (abfd, info, sec, relocs)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     asection *sec;
-     const Elf_Internal_Rela *relocs;
+boolean
+_bfd_mips_elf_gc_sweep_hook (abfd, info, sec, relocs)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
 {
 #if 0
   Elf_Internal_Shdr *symtab_hdr;
@@ -6466,8 +7578,8 @@
    change the definition to something the rest of the link can
    understand.  */
 
-static boolean
-mips_elf_adjust_dynamic_symbol (info, h)
+boolean
+_bfd_mips_elf_adjust_dynamic_symbol (info, h)
      struct bfd_link_info *info;
      struct elf_link_hash_entry *h;
 {
@@ -6493,20 +7605,10 @@
      file.  */
   hmips = (struct mips_elf_link_hash_entry *) h;
   if (! info->relocateable
-      && hmips->mips_32_relocs != 0
+      && hmips->possibly_dynamic_relocs != 0
       && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
-    {
-      s = bfd_get_section_by_name (dynobj, ".rel.dyn");
-      BFD_ASSERT (s != NULL);
-
-      if (s->_raw_size == 0)
-	{
-	  /* Make room for a null element. */
-	  s->_raw_size += sizeof (Elf32_External_Rel);
-	  ++s->reloc_count;
-	}
-      s->_raw_size += hmips->mips_32_relocs * sizeof (Elf32_External_Rel);
-    }
+    mips_elf_allocate_dynamic_relocations (dynobj, 
+					   hmips->possibly_dynamic_relocs);
 
   /* For a function, create a stub, if needed. */
   if (h->type == STT_FUNC
@@ -6522,7 +7624,8 @@
       if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
 	{
 	  /* We need .stub section.  */
-	  s = bfd_get_section_by_name (dynobj, ".stub");
+	  s = bfd_get_section_by_name (dynobj, 
+				       MIPS_ELF_STUB_SECTION_NAME (dynobj));
 	  BFD_ASSERT (s != NULL);
 
 	  h->root.u.def.section = s;
@@ -6565,8 +7668,8 @@
 static boolean mips_elf_check_mips16_stubs
   PARAMS ((struct mips_elf_link_hash_entry *, PTR));
 
-static boolean
-mips_elf_always_size_sections (output_bfd, info)
+boolean
+_bfd_mips_elf_always_size_sections (output_bfd, info)
      bfd *output_bfd;
      struct bfd_link_info *info;
 {
@@ -6595,7 +7698,7 @@
 static boolean
 mips_elf_check_mips16_stubs (h, data)
      struct mips_elf_link_hash_entry *h;
-     PTR data;
+     PTR data ATTRIBUTE_UNUSED;
 {
   if (h->fn_stub != NULL
       && ! h->need_fn_stub)
@@ -6641,15 +7744,14 @@
 
 /* Set the sizes of the dynamic sections.  */
 
-static boolean
-mips_elf_size_dynamic_sections (output_bfd, info)
+boolean
+_bfd_mips_elf_size_dynamic_sections (output_bfd, info)
      bfd *output_bfd;
      struct bfd_link_info *info;
 {
   bfd *dynobj;
   asection *s;
   boolean reltext;
-  asection *sgot;
   struct mips_got_info *g;
 
   dynobj = elf_hash_table (info)->dynobj;
@@ -6662,43 +7764,13 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
-	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+	  s->_raw_size 
+	    = strlen (ELF_DYNAMIC_INTERPRETER (output_bfd)) + 1;
+	  s->contents 
+	    = (bfd_byte *) ELF_DYNAMIC_INTERPRETER (output_bfd);
 	}
     }
 
-  /* Recompute the size of .got for local entires (reserved and
-     hipages) if needed.  To estimate it, get the upper bound of total
-     size of loadable sections.  */
-  sgot = bfd_get_section_by_name (dynobj, ".got");
-
-  if (sgot != NULL)
-    {
-      bfd_size_type loadable_size = 0;
-      bfd_size_type local_gotno;
-      struct _bfd *sub;
-
-      BFD_ASSERT (elf_section_data (sgot) != NULL);
-      g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
-      BFD_ASSERT (g != NULL);
-
-      for (sub = info->input_bfds; sub; sub = sub->link_next)
-	for (s = sub->sections; s != NULL; s = s->next)
-	  {
-	    if ((s->flags & SEC_ALLOC) == 0)
-	      continue;
-	    loadable_size += (s->_raw_size + 0xf) & ~0xf;
-	  }
-
-      loadable_size += MIPS_FUNCTION_STUB_SIZE;
-
-      /* Assume there are two loadable segments consisting of
-	 contiguous sections.  Is 5 enough? */
-      local_gotno = (loadable_size >> 16) + 5 + MIPS_RESERVED_GOTNO;
-      g->local_gotno = local_gotno;
-      sgot->_raw_size += local_gotno * 4;
-    }
-
   /* The check_relocs and adjust_dynamic_symbol entry points have
      determined the sizes of the various dynamic sections.  Allocate
      memory for them.  */
@@ -6749,30 +7821,65 @@
 	      if ((target != NULL
 		   && (target->flags & SEC_READONLY) != 0
 		   && (target->flags & SEC_ALLOC) != 0)
-		  || strcmp (outname, ".rel.dyn") == 0)
+		  || strcmp (outname, 
+			     MIPS_ELF_REL_DYN_SECTION_NAME (output_bfd)) == 0)
 		reltext = true;
 
 	      /* We use the reloc_count field as a counter if we need
 		 to copy relocs into the output file.  */
-	      if (strcmp (name, ".rel.dyn") != 0)
+	      if (strcmp (name, 
+			  MIPS_ELF_REL_DYN_SECTION_NAME (output_bfd)) != 0)
 		s->reloc_count = 0;
 	    }
 	}
       else if (strncmp (name, ".got", 4) == 0)
 	{
 	  int i;
+ 	  bfd_size_type loadable_size = 0;
+ 	  bfd_size_type local_gotno;
+ 	  struct _bfd *sub;
 
-	  BFD_ASSERT (elf_section_data (s) != NULL);
+ 	  BFD_ASSERT (elf_section_data (s) != NULL);
 	  g = (struct mips_got_info *) elf_section_data (s)->tdata;
-	  BFD_ASSERT (g != NULL);
+ 	  BFD_ASSERT (g != NULL);
 
-	  /* Fix the size of .got section for the correspondence of
-	     global symbols and got entries. This adds some useless
-	     got entries. Is this required by ABI really?  */
-	  i = elf_hash_table (info)->dynsymcount - g->global_gotsym;
-	  s->_raw_size += i * 4;
+ 	  /* Calculate the total loadable size of the output.  That
+ 	     will give us the maximum number of GOT_PAGE entries
+ 	     required.  */
+ 	  for (sub = info->input_bfds; sub; sub = sub->link_next)
+ 	    {
+ 	      asection *subsection;
+ 
+ 	      for (subsection = sub->sections; 
+ 		   subsection; 
+ 		   subsection = subsection->next)
+ 		{
+ 		  if ((subsection->flags & SEC_ALLOC) == 0)
+ 		    continue;
+ 		  loadable_size += (subsection->_raw_size + 0xf) & ~0xf;
+ 		}
+ 	    }
+ 	  loadable_size += MIPS_FUNCTION_STUB_SIZE;
+
+ 	  /* Assume there are two loadable segments consisting of
+ 	     contiguous sections.  Is 5 enough? */
+ 	  local_gotno = (loadable_size >> 16) + 5;
+ 	  g->local_gotno += local_gotno;
+ 	  s->_raw_size += local_gotno * MIPS_ELF_GOT_SIZE (dynobj);
+
+ 	  /* There has to be a global GOT entry for every symbol with
+ 	     a dynamic symbol table index of DT_MIPS_GOTSYM or
+ 	     higher.  Therefore, it make sense to put those symbols
+ 	     that need GOT entries at the end of the symbol table.  We
+ 	     do that here.  */
+ 	  if (!mips_elf_sort_hash_table (info, 1))
+ 	    return false;
+
+ 	  i = elf_hash_table (info)->dynsymcount - g->global_gotsym->dynindx;
+	  g->global_gotno = i;
+	  s->_raw_size += i * MIPS_ELF_GOT_SIZE (dynobj);
 	}
-      else if (strncmp (name, ".stub", 5) == 0)
+      else if (strcmp (name, MIPS_ELF_STUB_SECTION_NAME (output_bfd)) == 0)
 	{
 	  /* Irix rld assumes that the function stub isn't at the end
 	     of .text section. So put a dummy. XXX  */
@@ -6789,6 +7896,11 @@
       else if (SGI_COMPAT (output_bfd)
 	       && strncmp (name, ".compact_rel", 12) == 0)
 	s->_raw_size += mips_elf_hash_table (info)->compact_rel_size;
+      else if (strcmp (name, MIPS_ELF_MSYM_SECTION_NAME (output_bfd))
+	       == 0)
+	s->_raw_size = (sizeof (Elf32_External_Msym) 
+			* (elf_hash_table (info)->dynsymcount
+			   + bfd_count_sections (output_bfd)));
       else if (strncmp (name, ".init", 5) != 0)
 	{
 	  /* It's not one of our sections, so don't allocate space.  */
@@ -6802,13 +7914,12 @@
 	}
 
       /* Allocate memory for the section contents.  */
-      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
       if (s->contents == NULL && s->_raw_size != 0)
 	{
 	  bfd_set_error (bfd_error_no_memory);
 	  return false;
 	}
-      memset (s->contents, 0, s->_raw_size);
     }
 
   if (elf_hash_table (info)->dynamic_sections_created)
@@ -6824,206 +7935,166 @@
 	    {
 	      /* SGI object has the equivalence of DT_DEBUG in the
 		 DT_MIPS_RLD_MAP entry.  */
-	      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_RLD_MAP, 0))
+	      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP, 0))
 		return false;
 	    }
 	  else
-	    if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0))
+	    if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0))
 	      return false;
 	}
 
       if (reltext)
 	{
-	  if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0))
 	    return false;
 	}
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0))
 	return false;
 
-      if (bfd_get_section_by_name (dynobj, ".rel.dyn"))
+      if (bfd_get_section_by_name (dynobj,
+				   MIPS_ELF_REL_DYN_SECTION_NAME (dynobj)))
 	{
-	  if (! bfd_elf32_add_dynamic_entry (info, DT_REL, 0))
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0))
 	    return false;
 
-	  if (! bfd_elf32_add_dynamic_entry (info, DT_RELSZ, 0))
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0))
 	    return false;
 
-	  if (! bfd_elf32_add_dynamic_entry (info, DT_RELENT, 0))
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0))
 	    return false;
 	}
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_CONFLICTNO, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_CONFLICTNO, 0))
 	return false;
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_LIBLISTNO, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LIBLISTNO, 0))
 	return false;
 
       if (bfd_get_section_by_name (dynobj, ".conflict") != NULL)
 	{
-	  if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_CONFLICT, 0))
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_CONFLICT, 0))
 	    return false;
 
 	  s = bfd_get_section_by_name (dynobj, ".liblist");
 	  BFD_ASSERT (s != NULL);
 
-	  if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_LIBLIST, 0))
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LIBLIST, 0))
 	    return false;
 	}
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_RLD_VERSION, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_VERSION, 0))
 	return false;
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_FLAGS, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_FLAGS, 0))
 	return false;
 
 #if 0
       /* Time stamps in executable files are a bad idea.  */
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_TIME_STAMP, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_TIME_STAMP, 0))
 	return false;
 #endif
 
 #if 0 /* FIXME  */
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_ICHECKSUM, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_ICHECKSUM, 0))
 	return false;
 #endif
 
 #if 0 /* FIXME  */
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_IVERSION, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_IVERSION, 0))
 	return false;
 #endif
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_BASE_ADDRESS, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_BASE_ADDRESS, 0))
 	return false;
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_LOCAL_GOTNO, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LOCAL_GOTNO, 0))
 	return false;
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_SYMTABNO, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_SYMTABNO, 0))
 	return false;
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_UNREFEXTNO, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_UNREFEXTNO, 0))
 	return false;
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_GOTSYM, 0))
+      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_GOTSYM, 0))
 	return false;
 
-      if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_HIPAGENO, 0))
+      if (IRIX_COMPAT (dynobj) == ict_irix5
+	  && ! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_HIPAGENO, 0))
 	return false;
 
-#if 0 /* (SGI_COMPAT) */
-      if (! bfd_get_section_by_name (dynobj, ".init"))
-	if (! bfd_elf32_add_dynamic_entry (info, DT_INIT, 0))
-	  return false;
+      if (IRIX_COMPAT (dynobj) == ict_irix6
+	  && (bfd_get_section_by_name 
+	      (dynobj, MIPS_ELF_OPTIONS_SECTION_NAME (dynobj)))
+	  && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_OPTIONS, 0))
+	return false;
 
-      if (! bfd_get_section_by_name (dynobj, ".fini"))
-	if (! bfd_elf32_add_dynamic_entry (info, DT_FINI, 0))
-	  return false;
-#endif
+      if (bfd_get_section_by_name (dynobj, 
+				   MIPS_ELF_MSYM_SECTION_NAME (dynobj))
+	  && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_MSYM, 0))
+	return false;
     }
 
-  /* If we use dynamic linking, we generate a section symbol for each
-     output section.  These are local symbols, which means that they
-     must come first in the dynamic symbol table.
-     That means we must increment the dynamic symbol index of every
-     other dynamic symbol.  */
-  {
-    unsigned int c, i;
-    struct mips_got_info *g;
-
-    c = 0;
-    if (elf_hash_table (info)->dynamic_sections_created)
-      {
-#if 0
-	/* We no longer try to restrict the set of sections which get
-           dynamic symbol table entries, since it fails if we have
-           other random sections which need dynamic relocations.  */
-	const char * const *namep;
-	bfd_size_type strindex;
-	struct bfd_strtab_hash *dynstr;
-
-	if (SGI_COMPAT (output_bfd))
-	  {
-	    c = SIZEOF_MIPS_DYNSYM_SECNAMES - 1;
-	    elf_link_hash_traverse (elf_hash_table (info),
-				    mips_elf_adjust_dynindx,
-				    (PTR) &c);
-	    elf_hash_table (info)->dynsymcount += c;
-
-	    dynstr = elf_hash_table (info)->dynstr;
-	    BFD_ASSERT (dynstr != NULL);
-
-	    for (i = 1, namep = mips_elf_dynsym_sec_names;
-		 *namep != NULL;
-		 i++, namep++)
-	      {
-		s = bfd_get_section_by_name (output_bfd, *namep);
-		if (s != NULL)
-		  elf_section_data (s)->dynindx = i;
-
-		strindex = _bfd_stringtab_add (dynstr, *namep, true, false);
-		if (strindex == (bfd_size_type) -1)
-		  return false;
-
-		mips_elf_hash_table (info)->dynsym_sec_strindex[i] = strindex;
-	      }
-	  }
-	else
-#endif /* 0 */
-	  {
-	    c = bfd_count_sections (output_bfd);
-	    elf_link_hash_traverse (elf_hash_table (info),
-				    mips_elf_adjust_dynindx,
-				    (PTR) &c);
-	    elf_hash_table (info)->dynsymcount += c;
-
-	    for (i = 1, s = output_bfd->sections; s != NULL; s = s->next, i++)
-	      {
-		elf_section_data (s)->dynindx = i;
-		/* These symbols will have no names, so we don't need to
-		   fiddle with dynstr_index.  */
-	      }
-	  }
-      }
-
-    if (sgot != NULL)
-      {
-	BFD_ASSERT (elf_section_data (sgot) != NULL);
-	g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
-	BFD_ASSERT (g != NULL);
-
-	/* If there are no global got symbols, fake the last symbol so
-	   for safety.  */
-	if (g->global_gotsym)
-	  g->global_gotsym += c;
-	else
-	  g->global_gotsym = elf_hash_table (info)->dynsymcount - 1;
-      }
-  }
-
   return true;
 }
 
-/* Increment the index of a dynamic symbol by a given amount.  Called
-   via elf_link_hash_traverse.  */
+/* If NAME is one of the special IRIX6 symbols defined by the linker,
+   adjust it appropriately now.  */
 
-static boolean
-mips_elf_adjust_dynindx (h, cparg)
-     struct elf_link_hash_entry *h;
-     PTR cparg;
+static void
+mips_elf_irix6_finish_dynamic_symbol (abfd, name, sym)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     const char *name;
+     Elf_Internal_Sym *sym;
 {
-  unsigned int *cp = (unsigned int *) cparg;
+  /* The linker script takes care of providing names and values for
+     these, but we must place them into the right sections.  */
+  static const char* const text_section_symbols[] = {
+    "_ftext",
+    "_etext",
+    "__dso_displacement",
+    "__elf_header",
+    "__program_header_table",
+    NULL
+  };
 
-  if (h->dynindx != -1)
-    h->dynindx += *cp;
-  return true;
+  static const char* const data_section_symbols[] = {
+    "_fdata",
+    "_edata",
+    "_end",
+    "_fbss",
+    NULL
+  };
+
+  const char* const *p;
+  int i;
+
+  for (i = 0; i < 2; ++i)
+    for (p = (i == 0) ? text_section_symbols : data_section_symbols; 
+	 *p;
+	 ++p)
+      if (strcmp (*p, name) == 0)
+	{
+	  /* All of these symbols are given type STT_SECTION by the
+	     IRIX6 linker.  */
+	  sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION);
+	  
+	  /* The IRIX linker puts these symbols in special sections.  */
+	  if (i == 0)
+	    sym->st_shndx = SHN_MIPS_TEXT;
+	  else
+	    sym->st_shndx = SHN_MIPS_DATA;
+	  
+	  break;
+	}
 }
 
 /* Finish up dynamic symbol handling.  We set the contents of various
    dynamic sections here.  */
 
-static boolean
-mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
+boolean
+_bfd_mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
      bfd *output_bfd;
      struct bfd_link_info *info;
      struct elf_link_hash_entry *h;
@@ -7032,11 +8103,14 @@
   bfd *dynobj;
   bfd_vma gval;
   asection *sgot;
+  asection *smsym;
   struct mips_got_info *g;
   const char *name;
+  struct mips_elf_link_hash_entry *mh;
 
   dynobj = elf_hash_table (info)->dynobj;
   gval = sym->st_value;
+  mh = (struct mips_elf_link_hash_entry *) h;
 
   if (h->plt.offset != (bfd_vma) -1)
     {
@@ -7048,7 +8122,8 @@
 
       BFD_ASSERT (h->dynindx != -1);
 
-      s = bfd_get_section_by_name (dynobj, ".stub");
+      s = bfd_get_section_by_name (dynobj, 
+				   MIPS_ELF_STUB_SECTION_NAME (dynobj));
       BFD_ASSERT (s != NULL);
 
       /* Fill the stub.  */
@@ -7082,25 +8157,47 @@
 
   BFD_ASSERT (h->dynindx != -1);
 
-  sgot = bfd_get_section_by_name (dynobj, ".got");
+  sgot = mips_elf_got_section (dynobj);
   BFD_ASSERT (sgot != NULL);
   BFD_ASSERT (elf_section_data (sgot) != NULL);
   g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
   BFD_ASSERT (g != NULL);
 
-  if ((unsigned long) h->dynindx >= g->global_gotsym)
+  /* Run through the global symbol table, creating GOT entries for all
+     the symbols that need them.  */
+  if (h->dynindx >= g->global_gotsym->dynindx)
     {
-      bfd_size_type offset;
+      bfd_vma offset;
+      bfd_vma value;
 
-      /* This symbol has an entry in the global offset table.  Set its
-	 value to the corresponding got entry, if needed.  */
-      if (h->got.offset == (bfd_vma) -1)
-	{
-	  offset = (h->dynindx - g->global_gotsym + g->local_gotno) * 4;
-	  BFD_ASSERT (g->local_gotno * 4 <= offset
-		      && offset < sgot->_raw_size);
-	  bfd_put_32 (output_bfd, gval, sgot->contents + offset);
-	}
+      if (sym->st_value)
+	value = sym->st_value;
+      else
+	/* For an entity defined in a shared object, this will be
+	   NULL.  (For functions in shared objects for
+	   which we have created stubs, ST_VALUE will be non-NULL.
+	   That's because such the functions are now no longer defined
+	   in a shared object.)  */
+	value = h->root.u.def.value;
+
+      offset = mips_elf_global_got_index (dynobj, h);
+      MIPS_ELF_PUT_WORD (output_bfd, value, sgot->contents + offset);
+    }
+
+  /* Create a .msym entry, if appropriate.  */
+  smsym = bfd_get_section_by_name (dynobj, 
+				   MIPS_ELF_MSYM_SECTION_NAME (dynobj));
+  if (smsym)
+    {
+      Elf32_Internal_Msym msym;
+
+      msym.ms_hash_value = bfd_elf_hash (h->root.root.string);
+      /* It is undocumented what the `1' indicates, but IRIX6 uses
+	 this value.  */
+      msym.ms_info = ELF32_MS_INFO (mh->min_dyn_reloc_index, 1);
+      bfd_mips_elf_swap_msym_out 
+	(dynobj, &msym,
+	 ((Elf32_External_Msym *) smsym->contents) + h->dynindx);
     }
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
@@ -7146,6 +8243,10 @@
 	}
     }
 
+  /* Handle the IRIX6-specific symbols.  */
+  if (IRIX_COMPAT (output_bfd) == ict_irix6)
+    mips_elf_irix6_finish_dynamic_symbol (output_bfd, name, sym);
+
   if (SGI_COMPAT (output_bfd)
       && ! info->shared)
     {
@@ -7162,8 +8263,10 @@
       else if (mips_elf_hash_table (info)->use_rld_obj_head
 	       && strcmp (name, "__rld_obj_head") == 0)
 	{
-	  asection *s = bfd_get_section_by_name (dynobj, ".rld_map");
-	  BFD_ASSERT (s != NULL);
+	  /* IRIX6 does not use a .rld_map section.  */
+	  if (IRIX_COMPAT (output_bfd) == ict_irix5)
+	    BFD_ASSERT (bfd_get_section_by_name (dynobj, ".rld_map") 
+			!= NULL);
 	  mips_elf_hash_table (info)->rld_value = sym->st_value;
 	}
     }
@@ -7178,8 +8281,8 @@
 
 /* Finish up the dynamic sections.  */
 
-static boolean
-mips_elf_finish_dynamic_sections (output_bfd, info)
+boolean
+_bfd_mips_elf_finish_dynamic_sections (output_bfd, info)
      bfd *output_bfd;
      struct bfd_link_info *info;
 {
@@ -7192,7 +8295,7 @@
 
   sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
 
-  sgot = bfd_get_section_by_name (dynobj, ".got");
+  sgot = mips_elf_got_section (dynobj);
   if (sgot == NULL)
     g = NULL;
   else
@@ -7204,39 +8307,41 @@
 
   if (elf_hash_table (info)->dynamic_sections_created)
     {
-      Elf32_External_Dyn *dyncon, *dynconend;
+      bfd_byte *b;
 
       BFD_ASSERT (sdyn != NULL);
       BFD_ASSERT (g != NULL);
 
-      dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
-      for (; dyncon < dynconend; dyncon++)
+      for (b = sdyn->contents;
+	   b < sdyn->contents + sdyn->_raw_size;
+	   b += MIPS_ELF_DYN_SIZE (dynobj))
 	{
 	  Elf_Internal_Dyn dyn;
 	  const char *name;
 	  size_t elemsize;
 	  asection *s;
+	  boolean swap_out_p;
 
-	  bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+	  /* Read in the current dynamic entry.  */
+	  (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn);
+	  
+	  /* Assume that we're going to modify it and write it out.  */
+	  swap_out_p = true;
 
 	  switch (dyn.d_tag)
 	    {
-	    default:
-	      break;
-
 	    case DT_RELENT:
-	      s = bfd_get_section_by_name (dynobj, ".rel.dyn");
+	      s = (bfd_get_section_by_name 
+		   (dynobj,
+		    MIPS_ELF_REL_DYN_SECTION_NAME (dynobj)));
 	      BFD_ASSERT (s != NULL);
-	      dyn.d_un.d_val = sizeof (Elf32_External_Rel);
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+	      dyn.d_un.d_val = MIPS_ELF_REL_SIZE (dynobj);
 	      break;
 
 	    case DT_STRSZ:
 	      /* Rewrite DT_STRSZ.  */
 	      dyn.d_un.d_val =
 		_bfd_stringtab_size (elf_hash_table (info)->dynstr);
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_PLTGOT:
@@ -7251,17 +8356,14 @@
 	      s = bfd_get_section_by_name (output_bfd, name);
 	      BFD_ASSERT (s != NULL);
 	      dyn.d_un.d_ptr = s->vma;
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_MIPS_RLD_VERSION:
 	      dyn.d_un.d_val = 1; /* XXX */
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_MIPS_FLAGS:
 	      dyn.d_un.d_val = RHF_NOTPOT; /* XXX */
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_MIPS_CONFLICTNO:
@@ -7283,38 +8385,35 @@
 		}
 	      else
 		    dyn.d_un.d_val = 0;
-
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_MIPS_TIME_STAMP:
 	      time ((time_t *) &dyn.d_un.d_val);
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_MIPS_ICHECKSUM:
 	      /* XXX FIXME: */
+	      swap_out_p = false;
 	      break;
 
 	    case DT_MIPS_IVERSION:
 	      /* XXX FIXME: */
+	      swap_out_p = false;
 	      break;
 
 	    case DT_MIPS_BASE_ADDRESS:
 	      s = output_bfd->sections;
 	      BFD_ASSERT (s != NULL);
 	      dyn.d_un.d_ptr = s->vma & ~(0xffff);
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_MIPS_LOCAL_GOTNO:
 	      dyn.d_un.d_val = g->local_gotno;
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_MIPS_SYMTABNO:
 	      name = ".dynsym";
-	      elemsize = sizeof (Elf32_External_Sym);
+	      elemsize = MIPS_ELF_SYM_SIZE (output_bfd);
 	      s = bfd_get_section_by_name (output_bfd, name);
 	      BFD_ASSERT (s != NULL);
 
@@ -7322,34 +8421,47 @@
 		dyn.d_un.d_val = s->_cooked_size / elemsize;
 	      else
 		dyn.d_un.d_val = s->_raw_size / elemsize;
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_MIPS_UNREFEXTNO:
-#if 0
-	      dyn.d_un.d_val = SIZEOF_MIPS_DYNSYM_SECNAMES;
-#else
-	      dyn.d_un.d_val = bfd_count_sections (output_bfd);
-#endif
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+	      /* The index into the dynamic symbol table which is the
+		 entry of the first external symbol that is not
+		 referenced within the same object.  */
+	      dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1;
 	      break;
 
 	    case DT_MIPS_GOTSYM:
-	      dyn.d_un.d_val = g->global_gotsym;
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+	      dyn.d_un.d_val = g->global_gotsym->dynindx;
 	      break;
 
 	    case DT_MIPS_HIPAGENO:
 	      dyn.d_un.d_val = g->local_gotno - MIPS_RESERVED_GOTNO;
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_MIPS_RLD_MAP:
 	      dyn.d_un.d_ptr = mips_elf_hash_table (info)->rld_value;
-	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
+	    case DT_MIPS_OPTIONS:
+	      s = (bfd_get_section_by_name 
+		   (output_bfd, MIPS_ELF_OPTIONS_SECTION_NAME (output_bfd)));
+	      dyn.d_un.d_ptr = s->vma;
+	      break;
+
+	    case DT_MIPS_MSYM:
+	      s = (bfd_get_section_by_name 
+		   (output_bfd, MIPS_ELF_MSYM_SECTION_NAME (output_bfd)));
+	      dyn.d_un.d_ptr = s->vma;
+	      break;
+
+	    default:
+	      swap_out_p = false;
+	      break;
 	    }
+
+	  if (swap_out_p)
+	    (*get_elf_backend_data (dynobj)->s->swap_dyn_out) 
+	      (dynobj, &dyn, b);
 	}
     }
 
@@ -7358,106 +8470,41 @@
      This isn't the case of Irix rld. */
   if (sgot != NULL && sgot->_raw_size > 0)
     {
-      bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
-      bfd_put_32 (output_bfd, (bfd_vma) 0x80000000, sgot->contents + 4);
+      MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0, sgot->contents);
+      MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000, 
+			 sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
     }
 
   if (sgot != NULL)
-    elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
+    elf_section_data (sgot->output_section)->this_hdr.sh_entsize
+      = MIPS_ELF_GOT_SIZE (output_bfd);
 
   {
-    asection *sdynsym;
+    asection *smsym;
     asection *s;
-    Elf_Internal_Sym sym;
     Elf32_compact_rel cpt;
 
-    /* Set up the section symbols for the output sections. SGI sets
-       the STT_NOTYPE attribute for these symbols.  Should we do so?  */
+    /* ??? The section symbols for the output sections were set up in
+       _bfd_elf_final_link.  SGI sets the STT_NOTYPE attribute for these
+       symbols.  Should we do so?  */
 
-    sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
-    if (sdynsym != NULL)
+    smsym = bfd_get_section_by_name (dynobj, 
+				     MIPS_ELF_MSYM_SECTION_NAME (dynobj));
+    if (smsym != NULL)
       {
-#if 0
-	const char *name;
-	const char * const * namep = mips_elf_dynsym_sec_names;
-	unsigned int i;
-	bfd_vma last;
-	long dindx;
+	Elf32_Internal_Msym msym;
 
-	/* We no longer try to restrict the set of sections which get
-           dynamic symbol table entries, since it fails if we have
-           other random sections which need dynamic relocations.  */
-	if (SGI_COMPAT (output_bfd))
+	msym.ms_hash_value = 0;
+	msym.ms_info = ELF32_MS_INFO (0, 1);
+
+	for (s = output_bfd->sections; s != NULL; s = s->next)
 	  {
-	    sym.st_size = 0;
-	    sym.st_name = 0;
-	    sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE);
-	    sym.st_other = 0;
+	    long dynindx = elf_section_data (s)->dynindx;
 
-	    i = 0;
-	    last = 0;
-	    dindx = 0;
-	    while ((name = *namep++) != NULL)
-	      {
-		s = bfd_get_section_by_name (output_bfd, name);
-		if (s != NULL)
-		  {
-		    sym.st_value = s->vma;
-		    dindx = elf_section_data (s)->dynindx;
-		    last = s->vma + s->_raw_size;
-		  }
-		else
-		  {
-		    sym.st_value = last;
-		    dindx++;
-		  }
-
-		sym.st_shndx = (i < MIPS_TEXT_DYNSYM_SECNO
-				? SHN_MIPS_TEXT
-				: SHN_MIPS_DATA);
-		++i;
-		sym.st_name =
-		  mips_elf_hash_table (info)->dynsym_sec_strindex[dindx];
-
-		bfd_elf32_swap_symbol_out (output_bfd, &sym,
-					   (((Elf32_External_Sym *)
-					     sdynsym->contents)
-					    + dindx));
-	      }
-
-	    /* Set the sh_info field of the output .dynsym section to
-	       the index of the first global symbol.  */
-	    elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
-	      SIZEOF_MIPS_DYNSYM_SECNAMES;
-	  }
-	else
-#endif /* 0 */
-	  {
-	    sym.st_size = 0;
-	    sym.st_name = 0;
-	    sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
-	    sym.st_other = 0;
-
-	    for (s = output_bfd->sections; s != NULL; s = s->next)
-	      {
-		int indx;
-
-		sym.st_value = s->vma;
-
-		indx = elf_section_data (s)->this_idx;
-		BFD_ASSERT (indx > 0);
-		sym.st_shndx = indx;
-
-		bfd_elf32_swap_symbol_out (output_bfd, &sym,
-					   (((Elf32_External_Sym *)
-					     sdynsym->contents)
-					    + elf_section_data (s)->dynindx));
-	      }
-
-	    /* Set the sh_info field of the output .dynsym section to
-	       the index of the first global symbol.  */
-	    elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
-	      bfd_count_sections (output_bfd) + 1;
+	    bfd_mips_elf_swap_msym_out 
+	      (output_bfd, &msym,
+	       (((Elf32_External_Msym *) smsym->contents)
+		+ dynindx));
 	  }
       }
 
@@ -7479,7 +8526,8 @@
 					     s->contents));
 
 	    /* Clean up a dummy stub function entry in .text.  */
-	    s = bfd_get_section_by_name (dynobj, ".stub");
+	    s = bfd_get_section_by_name (dynobj, 
+					 MIPS_ELF_STUB_SECTION_NAME (dynobj));
 	    if (s != NULL)
 	      {
 		file_ptr dummy_offset;
@@ -7493,9 +8541,10 @@
       }
 
     /* Clean up a first relocation in .rel.dyn.  */
-    s = bfd_get_section_by_name (dynobj, ".rel.dyn");
+    s = bfd_get_section_by_name (dynobj, 
+				 MIPS_ELF_REL_DYN_SECTION_NAME (dynobj));
     if (s != NULL && s->_raw_size > 0)
-      memset (s->contents, 0, sizeof (Elf32_External_Rel));
+      memset (s->contents, 0, MIPS_ELF_REL_SIZE (dynobj));
   }
 
   return true;
@@ -7743,30 +8792,52 @@
 #define elf_backend_collect		true
 #define elf_backend_type_change_ok	true
 #define elf_backend_can_gc_sections	true
-#define elf_info_to_howto		0
+#define elf_info_to_howto		mips_info_to_howto_rela
 #define elf_info_to_howto_rel		mips_info_to_howto_rel
 #define elf_backend_sym_is_global	mips_elf_sym_is_global
-#define elf_backend_object_p		mips_elf32_object_p
-#define elf_backend_section_from_shdr	mips_elf32_section_from_shdr
+#define elf_backend_object_p		_bfd_mips_elf_object_p
+#define elf_backend_section_from_shdr	_bfd_mips_elf_section_from_shdr
 #define elf_backend_fake_sections	_bfd_mips_elf_fake_sections
 #define elf_backend_section_from_bfd_section \
 					_bfd_mips_elf_section_from_bfd_section
-#define elf_backend_section_processing	mips_elf32_section_processing
+#define elf_backend_section_processing	_bfd_mips_elf_section_processing
 #define elf_backend_symbol_processing	_bfd_mips_elf_symbol_processing
 #define elf_backend_additional_program_headers \
-					mips_elf_additional_program_headers
-#define elf_backend_modify_segment_map	mips_elf_modify_segment_map
+					_bfd_mips_elf_additional_program_headers
+#define elf_backend_modify_segment_map	_bfd_mips_elf_modify_segment_map
 #define elf_backend_final_write_processing \
 					_bfd_mips_elf_final_write_processing
 #define elf_backend_ecoff_debug_swap	&mips_elf32_ecoff_debug_swap
+#define elf_backend_add_symbol_hook	_bfd_mips_elf_add_symbol_hook
+#define elf_backend_create_dynamic_sections \
+					_bfd_mips_elf_create_dynamic_sections
+#define elf_backend_check_relocs	_bfd_mips_elf_check_relocs
+#define elf_backend_adjust_dynamic_symbol \
+					_bfd_mips_elf_adjust_dynamic_symbol
+#define elf_backend_always_size_sections \
+					_bfd_mips_elf_always_size_sections
+#define elf_backend_size_dynamic_sections \
+					_bfd_mips_elf_size_dynamic_sections
+#define elf_backend_relocate_section	_bfd_mips_elf_relocate_section
+#define elf_backend_link_output_symbol_hook \
+					_bfd_mips_elf_link_output_symbol_hook
+#define elf_backend_finish_dynamic_symbol \
+					_bfd_mips_elf_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_sections \
+					_bfd_mips_elf_finish_dynamic_sections
+#define elf_backend_gc_mark_hook	_bfd_mips_elf_gc_mark_hook
+#define elf_backend_gc_sweep_hook	_bfd_mips_elf_gc_sweep_hook
+
+#define elf_backend_got_header_size	(4*MIPS_RESERVED_GOTNO)
+#define elf_backend_plt_header_size	0
 
 #define bfd_elf32_bfd_is_local_label_name \
 					mips_elf_is_local_label_name
 #define bfd_elf32_find_nearest_line	_bfd_mips_elf_find_nearest_line
 #define bfd_elf32_set_section_contents	_bfd_mips_elf_set_section_contents
 #define bfd_elf32_bfd_link_hash_table_create \
-					mips_elf_link_hash_table_create
-#define bfd_elf32_bfd_final_link	mips_elf_final_link
+					_bfd_mips_elf_link_hash_table_create
+#define bfd_elf32_bfd_final_link	_bfd_mips_elf_final_link
 #define bfd_elf32_bfd_copy_private_bfd_data \
 					_bfd_mips_elf_copy_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data \
@@ -7774,27 +8845,4 @@
 #define bfd_elf32_bfd_set_private_flags	_bfd_mips_elf_set_private_flags
 #define bfd_elf32_bfd_print_private_bfd_data \
 					_bfd_mips_elf_print_private_bfd_data
-#define elf_backend_add_symbol_hook	mips_elf_add_symbol_hook
-#define elf_backend_create_dynamic_sections \
-					mips_elf_create_dynamic_sections
-#define elf_backend_check_relocs	mips_elf_check_relocs
-#define elf_backend_adjust_dynamic_symbol \
-					mips_elf_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
-					mips_elf_always_size_sections
-#define elf_backend_size_dynamic_sections \
-					mips_elf_size_dynamic_sections
-#define elf_backend_relocate_section	mips_elf_relocate_section
-#define elf_backend_link_output_symbol_hook \
-					mips_elf_link_output_symbol_hook
-#define elf_backend_finish_dynamic_symbol \
-					mips_elf_finish_dynamic_symbol
-#define elf_backend_finish_dynamic_sections \
-					mips_elf_finish_dynamic_sections
-#define elf_backend_gc_mark_hook	mips_elf_gc_mark_hook
-#define elf_backend_gc_sweep_hook	mips_elf_gc_sweep_hook
-
-#define elf_backend_got_header_size	(4*MIPS_RESERVED_GOTNO)
-#define elf_backend_plt_header_size	0
-
 #include "elf32-target.h"
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 25bb24a..83689c2 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -80,8 +80,6 @@
 static boolean ppc_elf_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *,
 						      struct elf_link_hash_entry *));
 
-static boolean ppc_elf_adjust_dynindx PARAMS ((struct elf_link_hash_entry *, PTR));
-
 static boolean ppc_elf_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *));
 
 static boolean ppc_elf_relocate_section PARAMS ((bfd *,
@@ -1231,7 +1229,7 @@
 
 static reloc_howto_type *
 ppc_elf_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE;
@@ -1307,7 +1305,7 @@
 
 static void
 ppc_elf_info_to_howto (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf32_Internal_Rela *dst;
 {
@@ -1323,13 +1321,13 @@
 static bfd_reloc_status_type
 ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section,
 			 output_bfd, error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
-     PTR data;
+     PTR data ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma relocation;
 
@@ -1523,7 +1521,7 @@
 
 static boolean
 ppc_elf_fake_sections (abfd, shdr, asect)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      Elf32_Internal_Shdr *shdr;
      asection *asect;
 {
@@ -1640,7 +1638,7 @@
 
 static boolean
 ppc_elf_modify_segment_map (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
   return true;
 }
@@ -1881,27 +1879,6 @@
 }
 
 
-/* Increment the index of a dynamic symbol by a given amount.  Called
-   via elf_link_hash_traverse.  */
-
-static boolean
-ppc_elf_adjust_dynindx (h, cparg)
-     struct elf_link_hash_entry *h;
-     PTR cparg;
-{
-  int *cp = (int *) cparg;
-
-#ifdef DEBUG
-  fprintf (stderr, "ppc_elf_adjust_dynindx called, h->dynindx = %d, *cp = %d\n", h->dynindx, *cp);
-#endif
-
-  if (h->dynindx != -1)
-    h->dynindx += *cp;
-
-  return true;
-}
-
-
 /* Set the sizes of the dynamic sections.  */
 
 static boolean
@@ -2083,43 +2060,6 @@
 	}
     }
 
-  /* If we are generating a shared library, we generate a section
-     symbol for each output section.  These are local symbols, which
-     means that they must come first in the dynamic symbol table.
-     That means we must increment the dynamic symbol index of every
-     other dynamic symbol.
-
-     FIXME: We assume that there will never be relocations to
-     locations in linker-created sections that do not have
-     externally-visible names. Instead, we should work out precisely
-     which sections relocations are targetted at.  */
-  if (info->shared)
-    {
-      int c;
-
-      for (c = 0, s = output_bfd->sections; s != NULL; s = s->next)
-	{
-	  if ((s->flags & SEC_LINKER_CREATED) != 0
-	      || (s->flags & SEC_ALLOC) == 0)
-	    {
-	      elf_section_data (s)->dynindx = -1;
-	      continue;
-	    }
-
-	  /* These symbols will have no names, so we don't need to
-	     fiddle with dynstr_index.  */
-
-	  elf_section_data (s)->dynindx = c + 1;
-
-	  c++;
-	}
-
-      elf_link_hash_traverse (elf_hash_table (info),
-			      ppc_elf_adjust_dynindx,
-			      (PTR) &c);
-      elf_hash_table (info)->dynsymcount += c;
-    }
-
   return true;
 }
 
@@ -2523,7 +2463,7 @@
 static asection *
 ppc_elf_gc_mark_hook (abfd, info, rel, h, sym)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      Elf_Internal_Rela *rel;
      struct elf_link_hash_entry *h;
      Elf_Internal_Sym *sym;
@@ -2570,7 +2510,7 @@
 static boolean
 ppc_elf_gc_sweep_hook (abfd, info, sec, relocs)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      asection *sec;
      const Elf_Internal_Rela *relocs;
 {
@@ -2637,8 +2577,8 @@
      bfd *abfd;
      struct bfd_link_info *info;
      const Elf_Internal_Sym *sym;
-     const char **namep;
-     flagword *flagsp;
+     const char **namep ATTRIBUTE_UNUSED;
+     flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
      bfd_vma *valp;
 {
@@ -2924,54 +2864,6 @@
       elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
     }
 
-  if (info->shared)
-    {
-      asection *sdynsym;
-      asection *s;
-      Elf_Internal_Sym sym;
-      int maxdindx = 0;
-
-      /* Set up the section symbols for the output sections.  */
-
-      sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
-      BFD_ASSERT (sdynsym != NULL);
-
-      sym.st_size = 0;
-      sym.st_name = 0;
-      sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
-      sym.st_other = 0;
-
-      for (s = output_bfd->sections; s != NULL; s = s->next)
-	{
-	  int indx, dindx;
-
-	  sym.st_value = s->vma;
-
-	  indx = elf_section_data (s)->this_idx;
-	  dindx = elf_section_data (s)->dynindx;
-	  if (dindx != -1)
-	    {
-	      BFD_ASSERT(indx > 0);
-	      BFD_ASSERT(dindx > 0);
-
-	      if (dindx > maxdindx)
-		maxdindx = dindx;
-
-	      sym.st_shndx = indx;
-
-	      bfd_elf32_swap_symbol_out (output_bfd, &sym,
-					 (PTR) (((Elf32_External_Sym *)
-						 sdynsym->contents)
-						+ dindx));
-	    }
-	}
-
-      /* Set the sh_info field of the output .dynsym section to the
-         index of the first global symbol.  */
-      elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
-	maxdindx + 1;
-    }
-
   return true;
 }
 
@@ -3200,13 +3092,13 @@
 	    relocation = 0;
 	  else
 	    {
-	      (*info->callbacks->undefined_symbol)(info,
-						   h->root.root.string,
-						   input_bfd,
-						   input_section,
-						   rel->r_offset);
-	      ret = false;
-	      continue;
+	      if (! (*info->callbacks->undefined_symbol)(info,
+							 h->root.root.string,
+							 input_bfd,
+							 input_section,
+							 rel->r_offset))
+		return false;
+	      relocation = 0;
 	    }
 	}
 
@@ -3230,12 +3122,12 @@
 		  || h->root.type == bfd_link_hash_defweak)
 	      && sec->output_section == NULL)
 	    {
-	      (*info->callbacks->undefined_symbol) (info,
-						    h->root.root.string,
-						    input_bfd,
-						    input_section,
-						    rel->r_offset);
-	      ret = false;
+	      if (! (*info->callbacks->undefined_symbol) (info,
+							  h->root.root.string,
+							  input_bfd,
+							  input_section,
+							  rel->r_offset))
+		return false;
 	      continue;
 	    }
 	  break;
@@ -3751,47 +3643,52 @@
 				    relocation,
 				    addend);
 
-      if (r != bfd_reloc_ok)
+      if (r == bfd_reloc_ok)
+	;
+      else if (r == bfd_reloc_overflow)
 	{
-	  ret = false;
-	  switch (r)
+	  const char *name;
+
+	  if (h != NULL)
 	    {
-	    default:
-	      break;
+	      if (h->root.type == bfd_link_hash_undefweak
+		  && howto->pc_relative)
+		{
+		  /* Assume this is a call protected by other code that
+		     detect the symbol is undefined.  If this is the case,
+		     we can safely ignore the overflow.  If not, the
+		     program is hosed anyway, and a little warning isn't
+		     going to help.  */
 
-	    case bfd_reloc_overflow:
-	      {
-		const char *name;
+		  continue;
+		}
 
-		if (h != NULL)
-		  name = h->root.root.string;
-		else
-		  {
-		    name = bfd_elf_string_from_elf_section (input_bfd,
-							    symtab_hdr->sh_link,
-							    sym->st_name);
-		    if (name == NULL)
-		      break;
+	      name = h->root.root.string;
+	    }
+	  else
+	    {
+	      name = bfd_elf_string_from_elf_section (input_bfd,
+						      symtab_hdr->sh_link,
+						      sym->st_name);
+	      if (name == NULL)
+		continue;
+	      if (*name == '\0')
+		name = bfd_section_name (input_bfd, sec);
+	    }
 
-		    if (*name == '\0')
-		      name = bfd_section_name (input_bfd, sec);
-		  }
-
-		(*info->callbacks->reloc_overflow)(info,
+	  if (! (*info->callbacks->reloc_overflow)(info,
 						   name,
 						   howto->name,
 						   (bfd_vma) 0,
 						   input_bfd,
 						   input_section,
-						   offset);
-	      }
-	      break;
-
-	    }
+						   offset))
+	    return false;
 	}
+      else
+	ret = false;
     }
 
-
 #ifdef DEBUG
   fprintf (stderr, "\n");
 #endif
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index ebbe352..ea5bd9f 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -1,5 +1,5 @@
 /* Hitachi SH specific support for 32-bit ELF
-   Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Contributed by Ian Lance Taylor, Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -207,21 +207,21 @@
 	 0xff,			/* dst_mask */
 	 true),			/* pcrel_offset */
 
-  { 10 },
-  { 11 },
-  { 12 },
-  { 13 },
-  { 14 },
-  { 15 },
-  { 16 },
-  { 17 },
-  { 18 },
-  { 19 },
-  { 20 },
-  { 21 },
-  { 22 },
-  { 23 },
-  { 24 },
+  EMPTY_HOWTO (10),
+  EMPTY_HOWTO (11),
+  EMPTY_HOWTO (12),
+  EMPTY_HOWTO (13),
+  EMPTY_HOWTO (14),
+  EMPTY_HOWTO (15),
+  EMPTY_HOWTO (16),
+  EMPTY_HOWTO (17),
+  EMPTY_HOWTO (18),
+  EMPTY_HOWTO (19),
+  EMPTY_HOWTO (20),
+  EMPTY_HOWTO (21),
+  EMPTY_HOWTO (22),
+  EMPTY_HOWTO (23),
+  EMPTY_HOWTO (24),
 
   /* The remaining relocs are a GNU extension used for relaxing.  The
      final pass of the linker never needs to do anything with any of
@@ -426,7 +426,7 @@
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   unsigned long insn;
   bfd_vma sym_value;
@@ -497,13 +497,13 @@
 static bfd_reloc_status_type
 sh_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section,
 		     output_bfd, error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   if (output_bfd != NULL)
     reloc_entry->address += input_section->output_offset;
@@ -548,7 +548,7 @@
 
 static reloc_howto_type *
 sh_elf_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -566,7 +566,7 @@
 
 static void
 sh_elf_info_to_howto (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf_Internal_Rela *dst;
 {
@@ -1161,13 +1161,15 @@
 	case R_SH_SWITCH32:
 	  /* These relocs types represent
 	       .word L2-L1
-	     The r_offset field holds the difference between the reloc
+	     The r_addend field holds the difference between the reloc
 	     address and L1.  That is the start of the reloc, and
 	     adding in the contents gives us the top.  We must adjust
-	     both the r_offset field and the section contents.  */
+	     both the r_offset field and the section contents.
+	     N.B. in gas / coff bfd, the elf bfd r_addend is called r_offset,
+	     and the elf bfd r_offset is called r_vaddr.  */
 
-	  start = irel->r_offset;
-	  stop = (bfd_vma) ((bfd_signed_vma) start - (long) irel->r_addend);
+	  stop = irel->r_offset;
+	  start = (bfd_vma) ((bfd_signed_vma) stop - (long) irel->r_addend);
 
 	  if (start > addr
 	      && start < toaddr
@@ -1178,8 +1180,6 @@
 		   && (start <= addr || start >= toaddr))
 	    irel->r_addend -= count;
 
-	  start = stop;
-
 	  if (ELF32_R_TYPE (irel->r_info) == (int) R_SH_SWITCH16)
 	    voff = bfd_get_signed_16 (abfd, contents + nraddr);
 	  else if (ELF32_R_TYPE (irel->r_info) == (int) R_SH_SWITCH8)
@@ -1307,6 +1307,56 @@
 	{
 	  Elf_Internal_Sym sym;
 
+	  /* Dwarf line numbers use R_SH_SWITCH32 relocs.  */
+	  if (ELF32_R_TYPE (irelscan->r_info) == (int) R_SH_SWITCH32)
+	    {
+	      bfd_vma start, stop;
+	      bfd_signed_vma voff;
+
+	      if (ocontents == NULL)
+		{
+		  if (elf_section_data (o)->this_hdr.contents != NULL)
+		    ocontents = elf_section_data (o)->this_hdr.contents;
+		  else
+		    {
+		      /* We always cache the section contents.
+                         Perhaps, if info->keep_memory is false, we
+                         should free them, if we are permitted to,
+                         when we leave sh_coff_relax_section.  */
+		      ocontents = (bfd_byte *) bfd_malloc (o->_raw_size);
+		      if (ocontents == NULL)
+			return false;
+		      if (! bfd_get_section_contents (abfd, o, ocontents,
+						      (file_ptr) 0,
+						      o->_raw_size))
+			return false;
+		      elf_section_data (o)->this_hdr.contents = ocontents;
+		    }
+		}
+
+	      stop = irelscan->r_offset;
+	      start
+		= (bfd_vma) ((bfd_signed_vma) stop - (long) irelscan->r_addend);
+
+	      /* STOP is in a different section, so it won't change.  */
+	      if (start > addr && start < toaddr)
+		irelscan->r_addend += count;
+
+	      voff = bfd_get_signed_32 (abfd, ocontents + irelscan->r_offset);
+	      stop = (bfd_vma) ((bfd_signed_vma) start + voff);
+
+	      if (start > addr
+		  && start < toaddr
+		  && (stop <= addr || stop >= toaddr))
+		bfd_put_signed_32 (abfd, voff + count,
+				   ocontents + irelscan->r_offset);
+	      else if (stop > addr
+		       && stop < toaddr
+		       && (start <= addr || start >= toaddr))
+		bfd_put_signed_32 (abfd, voff - count,
+				   ocontents + irelscan->r_offset);
+	    }
+
 	  if (ELF32_R_TYPE (irelscan->r_info) != (int) R_SH_DIR32)
 	    continue;
 
@@ -1621,7 +1671,7 @@
 static boolean
 sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 			 contents, relocs, local_syms, local_sections)
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
      bfd *input_bfd;
      asection *input_section;
@@ -1927,7 +1977,7 @@
 static asection *
 sh_elf_gc_mark_hook (abfd, info, rel, h, sym)
        bfd *abfd;
-       struct bfd_link_info *info;
+       struct bfd_link_info *info ATTRIBUTE_UNUSED;
        Elf_Internal_Rela *rel;
        struct elf_link_hash_entry *h;
        Elf_Internal_Sym *sym;
@@ -1949,6 +1999,9 @@
 
           case bfd_link_hash_common:
             return h->root.u.c.p->section;
+
+	  default:
+	    break;
           }
        }
      }
@@ -1967,10 +2020,10 @@
 
 static boolean
 sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     asection *sec;
-     const Elf_Internal_Rela *relocs;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
 {
   /* we don't use got and plt entries for sh. */
   return true;
@@ -2050,6 +2103,8 @@
 #define elf_backend_relocate_section	sh_elf_relocate_section
 #define bfd_elf32_bfd_get_relocated_section_contents \
 					sh_elf_get_relocated_section_contents
+#define bfd_elf32_bfd_merge_private_bfd_data \
+					_bfd_generic_verify_endian_match
 
 #define elf_backend_gc_mark_hook        sh_elf_gc_mark_hook
 #define elf_backend_gc_sweep_hook       sh_elf_gc_sweep_hook
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index ec57c8c..2118c70 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -33,8 +33,6 @@
 	   const Elf_Internal_Rela *));
 static boolean elf32_sparc_adjust_dynamic_symbol
   PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-static boolean elf32_sparc_adjust_dynindx
-  PARAMS ((struct elf_link_hash_entry *, PTR));
 static boolean elf32_sparc_size_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
 static boolean elf32_sparc_relocate_section
@@ -182,7 +180,7 @@
 
 static reloc_howto_type *
 elf32_sparc_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
@@ -211,12 +209,24 @@
 
 static void
 elf32_sparc_info_to_howto (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf_Internal_Rela *dst;
 {
-  BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_SPARC_max);
-  cache_ptr->howto = &_bfd_sparc_elf_howto_table[ELF32_R_TYPE(dst->r_info)];
+  switch (ELF32_R_TYPE(dst->r_info))
+    {
+    case R_SPARC_GNU_VTINHERIT:
+      cache_ptr->howto = &elf32_sparc_vtinherit_howto;
+      break;
+
+    case R_SPARC_GNU_VTENTRY:
+      cache_ptr->howto = &elf32_sparc_vtentry_howto;
+      break;
+
+    default:
+      BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_SPARC_max_std);
+      cache_ptr->howto = &_bfd_sparc_elf_howto_table[ELF32_R_TYPE(dst->r_info)];
+    }
 }
 
 /* For unsupported relocs.  */
@@ -229,13 +239,13 @@
 			     input_section,
 			     output_bfd,
 			     error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   return bfd_reloc_notsupported;
 }
@@ -256,7 +266,7 @@
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma relocation;
   bfd_vma x;
@@ -596,7 +606,7 @@
 static asection *
 elf32_sparc_gc_mark_hook (abfd, info, rel, h, sym)
        bfd *abfd;
-       struct bfd_link_info *info;
+       struct bfd_link_info *info ATTRIBUTE_UNUSED;
        Elf_Internal_Rela *rel;
        struct elf_link_hash_entry *h;
        Elf_Internal_Sym *sym;
@@ -619,6 +629,9 @@
 
           case bfd_link_hash_common:
             return h->root.u.c.p->section;
+
+	  default:
+	    break;
           }
        }
      }
@@ -640,7 +653,7 @@
 static boolean
 elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      asection *sec;
      const Elf_Internal_Rela *relocs;
 {
@@ -1028,51 +1041,6 @@
 	}
     }
 
-  /* If we are generating a shared library, we generate a section
-     symbol for each output section for which we might need to copy
-     relocs.  These are local symbols, which means that they must come
-     first in the dynamic symbol table.  That means we must increment
-     the dynamic symbol index of every other dynamic symbol.  */
-  if (info->shared)
-    {
-      int c;
-
-      c = 0;
-      for (s = output_bfd->sections; s != NULL; s = s->next)
-	{
-	  if ((s->flags & SEC_LINKER_CREATED) != 0
-	      || (s->flags & SEC_ALLOC) == 0)
-	    continue;
-
-	  elf_section_data (s)->dynindx = c + 1;
-
-	  /* These symbols will have no names, so we don't need to
-             fiddle with dynstr_index.  */
-
-	  ++c;
-	}
-
-      elf_link_hash_traverse (elf_hash_table (info),
-			      elf32_sparc_adjust_dynindx,
-			      (PTR) &c);
-      elf_hash_table (info)->dynsymcount += c;
-    }
-
-  return true;
-}
-
-/* Increment the index of a dynamic symbol by a given amount.  Called
-   via elf_link_hash_traverse.  */
-
-static boolean
-elf32_sparc_adjust_dynindx (h, cparg)
-     struct elf_link_hash_entry *h;
-     PTR cparg;
-{
-  int *cp = (int *) cparg;
-
-  if (h->dynindx != -1)
-    h->dynindx += *cp;
   return true;
 }
 
@@ -1134,7 +1102,7 @@
           || r_type == R_SPARC_GNU_VTENTRY)
         continue;
 
-      if (r_type < 0 || r_type >= (int) R_SPARC_max)
+      if (r_type < 0 || r_type >= (int) R_SPARC_max_std)
 	{
 	  bfd_set_error (bfd_error_bad_value);
 	  return false;
@@ -1835,50 +1803,6 @@
 
   elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
 
-  if (info->shared)
-    {
-      asection *sdynsym;
-      asection *s;
-      Elf_Internal_Sym sym;
-      int c;
-
-      /* Set up the section symbols for the output sections.  */
-
-      sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
-      BFD_ASSERT (sdynsym != NULL);
-
-      sym.st_size = 0;
-      sym.st_name = 0;
-      sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
-      sym.st_other = 0;
-
-      c = 0;
-      for (s = output_bfd->sections; s != NULL; s = s->next)
-	{
-	  int indx;
-
-	  if (elf_section_data (s)->dynindx == 0)
-	    continue;
-
-	  sym.st_value = s->vma;
-
-	  indx = elf_section_data (s)->this_idx;
-	  BFD_ASSERT (indx > 0);
-	  sym.st_shndx = indx;
-
-	  bfd_elf32_swap_symbol_out (output_bfd, &sym,
-				     (PTR) (((Elf32_External_Sym *)
-					     sdynsym->contents)
-					    + elf_section_data (s)->dynindx));
-
-	  ++c;
-	}
-
-      /* Set the sh_info field of the output .dynsym section to the
-         index of the first global symbol.  */
-      elf_section_data (sdynsym->output_section)->this_hdr.sh_info = c + 1;
-    }
-
   return true;
 }
 
@@ -1898,7 +1822,8 @@
      bfd *obfd;
 {
   boolean error;
-  static int previous_ibfd_e_flags = -1;
+  /* FIXME: This should not be static.  */
+  static unsigned long previous_ibfd_e_flags = (unsigned long) -1;
 
   if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
       || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
@@ -1946,7 +1871,7 @@
 
   if (((elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA)
        != previous_ibfd_e_flags)
-      && previous_ibfd_e_flags >= 0)
+      && previous_ibfd_e_flags != (unsigned long) -1)
     {
       (*_bfd_error_handler)
 	(_("%s: linking little endian files with big endian files"),
@@ -1994,7 +1919,7 @@
 static void
 elf32_sparc_final_write_processing (abfd, linker)
      bfd *abfd;
-     boolean linker;
+     boolean linker ATTRIBUTE_UNUSED;
 {
   switch (bfd_get_mach (abfd))
     {
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index e71353d..119e598 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -1,5 +1,5 @@
 /* V850-specific support for 32-bit ELF
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -143,7 +143,7 @@
 	 complain_overflow_dont,	/* complain_on_overflow */
 	 v850_elf_reloc,		/* special_function */
 	 "R_V850_HI16_S",		/* name */
-	 true,				/* partial_inplace */
+	 false,				/* partial_inplace */
 	 0xffff,			/* src_mask */
 	 0xffff,			/* dst_mask */
 	 false),			/* pcrel_offset */
@@ -158,7 +158,7 @@
 	 complain_overflow_dont,	/* complain_on_overflow */
 	 v850_elf_reloc,		/* special_function */
 	 "R_V850_HI16",			/* name */
-	 true,				/* partial_inplace */
+	 false,				/* partial_inplace */
 	 0xffff,			/* src_mask */
 	 0xffff,			/* dst_mask */
 	 false),			/* pcrel_offset */
@@ -173,7 +173,7 @@
 	 complain_overflow_dont,	/* complain_on_overflow */
 	 v850_elf_reloc,		/* special_function */
 	 "R_V850_LO16",			/* name */
-	 true,				/* partial_inplace */
+	 false,				/* partial_inplace */
 	 0xffff,			/* src_mask */
 	 0xffff,			/* dst_mask */
 	 false),			/* pcrel_offset */
@@ -188,7 +188,7 @@
 	 complain_overflow_dont,	/* complain_on_overflow */
 	 v850_elf_reloc,		/* special_function */
 	 "R_V850_32",			/* name */
-	 true,				/* partial_inplace */
+	 false,				/* partial_inplace */
 	 0xffffffff,			/* src_mask */
 	 0xffffffff,			/* dst_mask */
 	 false),			/* pcrel_offset */
@@ -203,7 +203,7 @@
 	 complain_overflow_dont,	/* complain_on_overflow */
 	 bfd_elf_generic_reloc,		/* special_function */
 	 "R_V850_16",			/* name */
-	 true,				/* partial_inplace */
+	 false,				/* partial_inplace */
 	 0xffff,			/* src_mask */
 	 0xffff,			/* dst_mask */
 	 false),			/* pcrel_offset */
@@ -218,7 +218,7 @@
 	 complain_overflow_dont,	/* complain_on_overflow */
 	 bfd_elf_generic_reloc,		/* special_function */
 	 "R_V850_8",			/* name */
-	 true,				/* partial_inplace */
+	 false,				/* partial_inplace */
 	 0xff,				/* src_mask */
 	 0xff,				/* dst_mask */
 	 false),			/* pcrel_offset */
@@ -509,7 +509,7 @@
 /* Map a bfd relocation into the appropriate howto structure */
 static reloc_howto_type *
 v850_elf_reloc_type_lookup (abfd, code)
-     bfd *                     abfd;
+     bfd *                     abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type  code;
 {
   unsigned int i;
@@ -533,7 +533,7 @@
 /* Set the howto pointer for an V850 ELF reloc.  */
 static void
 v850_elf_info_to_howto_rel (abfd, cache_ptr, dst)
-     bfd *                 abfd;
+     bfd *                 abfd ATTRIBUTE_UNUSED;
      arelent *             cache_ptr;
      Elf32_Internal_Rel *  dst;
 {
@@ -547,7 +547,7 @@
 /* Set the howto pointer for a V850 ELF reloc (type RELA). */
 static void
 v850_elf_info_to_howto_rela (abfd, cache_ptr, dst)
-     bfd *                 abfd;
+     bfd *                 abfd ATTRIBUTE_UNUSED;
      arelent *             cache_ptr;
      Elf32_Internal_Rela   *dst;
 {
@@ -797,7 +797,6 @@
   hi16s_location * entry;
   hi16s_location * previous = NULL;
   hi16s_location * prev;
-  int              i;
   bfd_byte *       addr;
   
   /* Search the table.  Record the most recent entry that matches.  */
@@ -1253,13 +1252,13 @@
 /* Insert the addend into the instruction.  */
 static bfd_reloc_status_type
 v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err)
-     bfd *       abfd;
+     bfd *       abfd ATTRIBUTE_UNUSED;
      arelent *   reloc;
      asymbol *   symbol;
-     PTR         data;
+     PTR         data ATTRIBUTE_UNUSED;
      asection *  isection;
      bfd *       obfd;
-     char **     err;
+     char **     err ATTRIBUTE_UNUSED;
 {
   long relocation;
   
@@ -1327,7 +1326,7 @@
 /*ARGSUSED*/
 static boolean
 v850_elf_is_local_label_name (abfd, name)
-     bfd *         abfd;
+     bfd *         abfd ATTRIBUTE_UNUSED;
      const char *  name;
 {
   return (   (name[0] == '.' && (name[1] == 'L' || name[1] == '.'))
@@ -1342,7 +1341,7 @@
 				    addend, info, sym_sec, is_local)
      reloc_howto_type *      howto;
      bfd *                   input_bfd;
-     bfd *                   output_bfd;
+     bfd *                   output_bfd ATTRIBUTE_UNUSED;
      asection *              input_section;
      bfd_byte *              contents;
      bfd_vma                 offset;
@@ -1350,7 +1349,7 @@
      bfd_vma                 addend;
      struct bfd_link_info *  info;
      asection *              sym_sec;
-     int                     is_local;
+     int                     is_local ATTRIBUTE_UNUSED;
 {
   unsigned long  r_type   = howto->type;
   bfd_byte *     hit_data = contents + offset;
@@ -1369,6 +1368,10 @@
 		+ input_section->output_offset
 		+ offset);
 
+      /* If the sign extension will corrupt the value then we have overflowed.  */
+      if (((value & 0xff000000) != 0x0) && ((value & 0xff000000) != 0xff000000))
+	return bfd_reloc_overflow;
+      
       value = SEXT24 (value);  /* Only the bottom 24 bits of the PC are valid */
       break;
       
@@ -1713,10 +1716,10 @@
 
 static boolean
 v850_elf_gc_sweep_hook (abfd, info, sec, relocs)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     asection *sec;
-     const Elf_Internal_Rela *relocs;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
 {
   /* No got and plt entries for v850-elf */
   return true;
@@ -1725,7 +1728,7 @@
 static asection *
 v850_elf_gc_mark_hook (abfd, info, rel, h, sym)
        bfd *abfd;
-       struct bfd_link_info *info;
+       struct bfd_link_info *info ATTRIBUTE_UNUSED;
        Elf_Internal_Rela *rel;
        struct elf_link_hash_entry *h;
        Elf_Internal_Sym *sym;
@@ -1747,6 +1750,9 @@
 
           case bfd_link_hash_common:
             return h->root.u.c.p->section;
+
+	  default:
+	    break;
           }
        }
      }
@@ -1781,7 +1787,7 @@
 static void
 v850_elf_final_write_processing (abfd, linker)
      bfd *   abfd;
-     boolean linker;
+     boolean linker ATTRIBUTE_UNUSED;
 {
   unsigned long val;
 
@@ -1934,8 +1940,8 @@
 
 static boolean
 v850_elf_section_from_bfd_section (abfd, hdr, sec, retval)
-     bfd *                 abfd;
-     Elf32_Internal_Shdr * hdr;
+     bfd *                 abfd ATTRIBUTE_UNUSED;
+     Elf32_Internal_Shdr * hdr ATTRIBUTE_UNUSED;
      asection *            sec;
      int *                 retval;
 {
@@ -2053,10 +2059,10 @@
 static boolean
 v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd *                    abfd;
-     struct bfd_link_info *   info;
+     struct bfd_link_info *   info ATTRIBUTE_UNUSED;
      const Elf_Internal_Sym * sym;
-     const char **            namep;
-     flagword *               flagsp;
+     const char **            namep ATTRIBUTE_UNUSED;
+     flagword *               flagsp ATTRIBUTE_UNUSED;
      asection **              secp;
      bfd_vma *                valp;
 {
@@ -2114,9 +2120,9 @@
 /*ARGSIGNORED*/
 static boolean
 v850_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec)
-     bfd *                  abfd;
-     struct bfd_link_info * info;
-     const char *           name;
+     bfd *                  abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info * info ATTRIBUTE_UNUSED;
+     const char *           name ATTRIBUTE_UNUSED;
      Elf_Internal_Sym *     sym;
      asection *             input_sec;
 {
@@ -2169,7 +2175,7 @@
    section name, which is a hack, but ought to work.  */
 static boolean
 v850_elf_fake_sections (abfd, hdr, sec)
-     bfd *                 abfd;
+     bfd *                 abfd ATTRIBUTE_UNUSED;
      Elf32_Internal_Shdr * hdr;
      asection *            sec;
 {
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 1964f86..2a0cdb5 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -115,8 +115,6 @@
   PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *));
 static boolean elf64_alpha_size_dynamic_sections
   PARAMS((bfd *, struct bfd_link_info *));
-static boolean elf64_alpha_adjust_dynindx
-  PARAMS((struct elf_link_hash_entry *, PTR));
 static boolean elf64_alpha_relocate_section
   PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
 	  Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
@@ -3264,34 +3262,6 @@
 	}
     }
 
-  /* If we are generating a shared library, we generate a section
-     symbol for each output section.  These are local symbols, which
-     means that they must come first in the dynamic symbol table.
-     That means we must increment the dynamic symbol index of every
-     other dynamic symbol.  */
-  if (info->shared)
-    {
-      long c[2], i;
-      asection *p;
-
-      c[0] = 0;
-      c[1] = bfd_count_sections (output_bfd);
-
-      elf_hash_table (info)->dynsymcount += c[1];
-      elf_link_hash_traverse (elf_hash_table(info),
-			      elf64_alpha_adjust_dynindx,
-			      (PTR) c);
-
-      for (i = 1, p = output_bfd->sections;
-	   p != NULL;
-	   p = p->next, i++)
-	{
-	  elf_section_data (p)->dynindx = i;
-	  /* These symbols will have no names, so we don't need to
-	     fiddle with dynstr_index.  */
-	}
-    }
-
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       /* Add some entries to the .dynamic section.  We fill in the
@@ -3332,22 +3302,6 @@
   return true;
 }
 
-/* Increment the index of a dynamic symbol by a given amount.  Called
-   via elf_link_hash_traverse.  */
-
-static boolean
-elf64_alpha_adjust_dynindx (h, cparg)
-     struct elf_link_hash_entry *h;
-     PTR cparg;
-{
-  long *cp = (long *)cparg;
-
-  if (h->dynindx >= cp[0])
-    h->dynindx += cp[1];
-
-  return true;
-}
-
 /* Relocate an Alpha ELF section.  */
 
 static boolean
@@ -3423,6 +3377,12 @@
 	     anything, unless the reloc is against a section symbol,
 	     in which case we have to adjust according to where the
 	     section symbol winds up in the output section.  */
+
+	  /* The symbol associated with GPDISP and LITUSE is 
+	     immaterial.  Only the addend is significant.  */
+	  if (r_type == R_ALPHA_GPDISP || r_type == R_ALPHA_LITUSE)
+	    continue;
+
 	  if (r_symndx < symtab_hdr->sh_info)
 	    {
 	      sym = local_syms + r_symndx;
@@ -3985,44 +3945,6 @@
 	}
     }
 
-  if (info->shared)
-    {
-      asection *sdynsym;
-      asection *s;
-      Elf_Internal_Sym sym;
-
-      /* Set up the section symbols for the output sections.  */
-
-      sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
-      BFD_ASSERT (sdynsym != NULL);
-
-      sym.st_size = 0;
-      sym.st_name = 0;
-      sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
-      sym.st_other = 0;
-
-      for (s = output_bfd->sections; s != NULL; s = s->next)
-	{
-	  int indx;
-
-	  sym.st_value = s->vma;
-
-	  indx = elf_section_data (s)->this_idx;
-	  BFD_ASSERT (indx > 0);
-	  sym.st_shndx = indx;
-
-	  bfd_elf64_swap_symbol_out (output_bfd, &sym,
-				     (PTR) (((Elf64_External_Sym *)
-					     sdynsym->contents)
-					    + elf_section_data (s)->dynindx));
-	}
-
-      /* Set the sh_info field of the output .dynsym section to the
-         index of the first global symbol.  */
-      elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
-	bfd_count_sections (output_bfd) + 1;
-    }
-
   return true;
 }
 
diff --git a/bfd/elf64-gen.c b/bfd/elf64-gen.c
index 2f470ff..78dc09d 100644
--- a/bfd/elf64-gen.c
+++ b/bfd/elf64-gen.c
@@ -64,6 +64,7 @@
 #define TARGET_BIG_NAME			"elf64-big"
 #define ELF_ARCH			bfd_arch_unknown
 #define ELF_MACHINE_CODE		EM_NONE
+#define ELF_MAXPAGESIZE			0x1
 #define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
 #define elf_info_to_howto		elf_generic_info_to_howto
 #define elf_info_to_howto_rel		elf_generic_info_to_howto_rel
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 9fb8bb9..6fc0dcd 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -1,6 +1,8 @@
 /* MIPS-specific support for 64-bit ELF
-   Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Ian Lance Taylor, Cygnus Support
+   Linker support added by Mark Mitchell, CodeSourcery, LLC.
+   <mark@codesourcery.com>
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -52,14 +54,20 @@
 static void mips_elf64_swap_reloca_in
   PARAMS ((bfd *, const Elf64_Mips_External_Rela *,
 	   Elf64_Mips_Internal_Rela *));
-#if 0
 static void mips_elf64_swap_reloc_out
   PARAMS ((bfd *, const Elf64_Mips_Internal_Rel *,
 	   Elf64_Mips_External_Rel *));
-#endif
 static void mips_elf64_swap_reloca_out
   PARAMS ((bfd *, const Elf64_Mips_Internal_Rela *,
 	   Elf64_Mips_External_Rela *));
+static void mips_elf64_be_swap_reloc_in
+  PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rel *));
+static void mips_elf64_be_swap_reloc_out
+  PARAMS ((bfd *, const Elf_Internal_Rel *, bfd_byte *));
+static void mips_elf64_be_swap_reloca_in
+  PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+static void mips_elf64_be_swap_reloca_out
+  PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
 static reloc_howto_type *mips_elf64_reloc_type_lookup
   PARAMS ((bfd *, bfd_reloc_code_real_type));
 static long mips_elf64_get_reloc_upper_bound PARAMS ((bfd *, asection *));
@@ -68,10 +76,6 @@
 static boolean mips_elf64_slurp_reloc_table
   PARAMS ((bfd *, asection *, asymbol **, boolean));
 static void mips_elf64_write_relocs PARAMS ((bfd *, asection *, PTR));
-static boolean mips_elf64_section_from_shdr
-  PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
-static boolean mips_elf64_section_processing
-  PARAMS ((bfd *, Elf_Internal_Shdr *));
 static boolean mips_elf64_slurp_armap PARAMS ((bfd *));
 static boolean mips_elf64_write_armap
   PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
@@ -80,6 +84,9 @@
    from smaller values.  Start with zero, widen, *then* decrement.  */
 #define MINUS_ONE	(((bfd_vma)0) - 1)
 
+/* The number of local .got entries we reserve.  */
+#define MIPS_RESERVED_GOTNO (2)
+
 /* The relocation table used for SHT_REL sections.  */
 
 static reloc_howto_type mips_elf64_howto_table_rel[] =
@@ -614,7 +621,23 @@
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0,			/* dst_mask */
-	 false)			/* pcrel_offset */
+	 false),		/* pcrel_offset */
+
+  /* Protected jump conversion.  This is an optimization hint.  No 
+     relocation is required for correctness.  */
+  HOWTO (R_MIPS_JALR,	        /* type */
+	 0,			/* rightshift */
+	 0,			/* size (0 = byte, 1 = short, 2 = long) */
+	 0,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_MIPS_JALR",	        /* name */
+	 false,			/* partial_inplace */
+	 0x00000000,		/* src_mask */
+	 0x00000000,		/* dst_mask */
+	 false),		/* pcrel_offset */
 };
 
 /* The relocation table used for SHT_RELA sections.  */
@@ -1152,7 +1175,23 @@
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0,			/* dst_mask */
-	 false)			/* pcrel_offset */
+	 false),		/* pcrel_offset */
+
+  /* Protected jump conversion.  This is an optimization hint.  No 
+     relocation is required for correctness.  */
+  HOWTO (R_MIPS_JALR,	        /* type */
+	 0,			/* rightshift */
+	 0,			/* size (0 = byte, 1 = short, 2 = long) */
+	 0,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_MIPS_JALR",	        /* name */
+	 false,			/* partial_inplace */
+	 0x00000000,		/* src_mask */
+	 0x00000000,		/* dst_mask */
+	 false),		/* pcrel_offset */
 };
 
 /* Swap in a MIPS 64-bit Rel reloc.  */
@@ -1188,10 +1227,6 @@
   dst->r_addend = bfd_h_get_signed_64 (abfd, (bfd_byte *) src->r_addend);
 }
 
-#if 0
-
-/* This is not currently used.  */
-
 /* Swap out a MIPS 64-bit Rel reloc.  */
 
 static void
@@ -1208,8 +1243,6 @@
   bfd_h_put_8 (abfd, src->r_type, (bfd_byte *) dst->r_type);
 }
 
-#endif /* 0 */
-
 /* Swap out a MIPS 64-bit Rela reloc.  */
 
 static void
@@ -1227,6 +1260,96 @@
   bfd_h_put_64 (abfd, src->r_addend, (bfd_byte *) dst->r_addend);
 }
 
+/* Swap in a MIPS 64-bit Rel reloc.  */
+
+static void
+mips_elf64_be_swap_reloc_in (abfd, src, dst)
+     bfd *abfd;
+     const bfd_byte *src;
+     Elf_Internal_Rel *dst;
+{
+  Elf64_Mips_Internal_Rel mirel;
+
+  mips_elf64_swap_reloc_in (abfd, 
+			    (const Elf64_Mips_External_Rel *) src,
+			    &mirel);
+
+  dst[0].r_offset = mirel.r_offset;
+  dst[0].r_info = ELF32_R_INFO (mirel.r_sym, mirel.r_type);
+  dst[1].r_offset = mirel.r_offset;
+  dst[1].r_info = ELF32_R_INFO (mirel.r_ssym, mirel.r_type2);
+  dst[2].r_offset = mirel.r_offset;
+  dst[2].r_info = ELF32_R_INFO (STN_UNDEF, mirel.r_type3);
+}
+
+/* Swap in a MIPS 64-bit Rela reloc.  */
+
+static void
+mips_elf64_be_swap_reloca_in (abfd, src, dst)
+     bfd *abfd;
+     const bfd_byte *src;
+     Elf_Internal_Rela *dst;
+{
+  Elf64_Mips_Internal_Rela mirela;
+
+  mips_elf64_swap_reloca_in (abfd, 
+			     (const Elf64_Mips_External_Rela *) src,
+			     &mirela);
+
+  dst[0].r_offset = mirela.r_offset;
+  dst[0].r_info = ELF32_R_INFO (mirela.r_sym, mirela.r_type);
+  dst[0].r_addend = mirela.r_addend;
+  dst[1].r_offset = mirela.r_offset;
+  dst[1].r_info = ELF32_R_INFO (mirela.r_ssym, mirela.r_type2);
+  dst[1].r_addend = 0;
+  dst[2].r_offset = mirela.r_offset;
+  dst[2].r_info = ELF32_R_INFO (STN_UNDEF, mirela.r_type3);
+  dst[2].r_addend = 0;
+}
+
+/* Swap out a MIPS 64-bit Rel reloc.  */
+
+static void
+mips_elf64_be_swap_reloc_out (abfd, src, dst)
+     bfd *abfd;
+     const Elf_Internal_Rel *src;
+     bfd_byte *dst;
+{
+  Elf64_Mips_Internal_Rel mirel;
+
+  mirel.r_offset = src->r_offset;
+  mirel.r_type = ELF32_R_TYPE (src->r_info);
+  mirel.r_sym = ELF32_R_SYM (src->r_info);
+  mirel.r_type2 = R_MIPS_NONE;
+  mirel.r_ssym = STN_UNDEF;
+  mirel.r_type3 = R_MIPS_NONE;
+
+  mips_elf64_swap_reloc_out (abfd, &mirel, 
+			     (Elf64_Mips_External_Rel *) dst);
+}
+
+/* Swap out a MIPS 64-bit Rela reloc.  */
+
+static void
+mips_elf64_be_swap_reloca_out (abfd, src, dst)
+     bfd *abfd;
+     const Elf_Internal_Rela *src;
+     bfd_byte *dst;
+{
+  Elf64_Mips_Internal_Rela mirela;
+
+  mirela.r_offset = src->r_offset;
+  mirela.r_type = ELF32_R_TYPE (src->r_info);
+  mirela.r_addend = src->r_addend;
+  mirela.r_sym = ELF32_R_SYM (src->r_info);
+  mirela.r_type2 = R_MIPS_NONE;
+  mirela.r_ssym = STN_UNDEF;
+  mirela.r_type3 = R_MIPS_NONE;
+
+  mips_elf64_swap_reloca_out (abfd, &mirela, 
+			      (Elf64_Mips_External_Rela *) dst);
+}
+
 /* A mapping from BFD reloc types to MIPS ELF reloc types.  */
 
 struct elf_reloc_map
@@ -1255,7 +1378,11 @@
   { BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
   { BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 },
   { BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 },
-  { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 }
+  { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 },
+  { BFD_RELOC_MIPS_SUB, R_MIPS_SUB },
+  { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE },
+  { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST },
+  { BFD_RELOC_MIPS_GOT_DISP, R_MIPS_GOT_DISP }
 };
 
 /* Given a BFD reloc type, return a howto structure.  */
@@ -1688,115 +1815,6 @@
 	      == count);
 }
 
-/* Handle a 64-bit MIPS ELF specific section.  */
-
-static boolean
-mips_elf64_section_from_shdr (abfd, hdr, name)
-     bfd *abfd;
-     Elf_Internal_Shdr *hdr;
-     char *name;
-{
-  if (! _bfd_mips_elf_section_from_shdr (abfd, hdr, name))
-    return false;
-
-  /* For a SHT_MIPS_OPTIONS section, look for a ODK_REGINFO entry, and
-     set the gp value based on what we find.  We may see both
-     SHT_MIPS_REGINFO and SHT_MIPS_OPTIONS/ODK_REGINFO; in that case,
-     they should agree.  */
-  if (hdr->sh_type == SHT_MIPS_OPTIONS)
-    {
-      bfd_byte *contents, *l, *lend;
-
-      contents = (bfd_byte *) bfd_malloc (hdr->sh_size);
-      if (contents == NULL)
-	return false;
-      if (! bfd_get_section_contents (abfd, hdr->bfd_section, contents,
-				      (file_ptr) 0, hdr->sh_size))
-	{
-	  free (contents);
-	  return false;
-	}
-      l = contents;
-      lend = contents + hdr->sh_size;
-      while (l + sizeof (Elf_External_Options) <= lend)
-	{
-	  Elf_Internal_Options intopt;
-
-	  bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l,
-					&intopt);
-	  if (intopt.kind == ODK_REGINFO)
-	    {
-	      Elf64_Internal_RegInfo intreg;
-
-	      bfd_mips_elf64_swap_reginfo_in
-		(abfd,
-		 ((Elf64_External_RegInfo *)
-		  (l + sizeof (Elf_External_Options))),
-		 &intreg);
-	      elf_gp (abfd) = intreg.ri_gp_value;
-	    }
-	  l += intopt.size;
-	}
-      free (contents);
-    }
-
-  return true;
-}
-
-/* Work over a section just before writing it out.  We update the GP
-   value in the SHT_MIPS_OPTIONS section based on the value we are
-   using.  */
-
-static boolean
-mips_elf64_section_processing (abfd, hdr)
-     bfd *abfd;
-     Elf_Internal_Shdr *hdr;
-{
-  if (hdr->sh_type == SHT_MIPS_OPTIONS
-      && hdr->bfd_section != NULL
-      && elf_section_data (hdr->bfd_section) != NULL
-      && elf_section_data (hdr->bfd_section)->tdata != NULL)
-    {
-      bfd_byte *contents, *l, *lend;
-
-      /* We stored the section contents in the elf_section_data tdata
-	 field in the set_section_contents routine.  We save the
-	 section contents so that we don't have to read them again.
-	 At this point we know that elf_gp is set, so we can look
-	 through the section contents to see if there is an
-	 ODK_REGINFO structure.  */
-
-      contents = (bfd_byte *) elf_section_data (hdr->bfd_section)->tdata;
-      l = contents;
-      lend = contents + hdr->sh_size;
-      while (l + sizeof (Elf_External_Options) <= lend)
-	{
-	  Elf_Internal_Options intopt;
-
-	  bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l,
-					&intopt);
-	  if (intopt.kind == ODK_REGINFO)
-	    {
-	      bfd_byte buf[8];
-
-	      if (bfd_seek (abfd,
-			    (hdr->sh_offset
-			     + (l - contents)
-			     + sizeof (Elf_External_Options)
-			     + (sizeof (Elf64_External_RegInfo) - 8)),
-			     SEEK_SET) == -1)
-		return false;
-	      bfd_h_put_64 (abfd, elf_gp (abfd), buf);
-	      if (bfd_write (buf, 1, 8, abfd) != 8)
-		return false;
-	    }
-	  l += intopt.size;
-	}
-    }
-
-  return _bfd_mips_elf_section_processing (abfd, hdr);
-}
-
 /* Irix 6 defines a brand new archive map format, so that they can
    have archives more than 4 GB in size.  */
 
@@ -2063,6 +2081,8 @@
   sizeof (Elf64_External_Sym),
   sizeof (Elf64_External_Dyn),
   sizeof (Elf_External_Note),
+  4,            /* hash-table entry size */
+  3,            /* internal relocations per external relocations */
   64,		/* arch_size */
   8,		/* file_align */
   ELFCLASS64,
@@ -2073,7 +2093,12 @@
   bfd_elf64_swap_symbol_out,
   mips_elf64_slurp_reloc_table,
   bfd_elf64_slurp_symbol_table,
-  bfd_elf64_swap_dyn_in
+  bfd_elf64_swap_dyn_in,
+  bfd_elf64_swap_dyn_out,
+  mips_elf64_be_swap_reloc_in,
+  mips_elf64_be_swap_reloc_out,
+  mips_elf64_be_swap_reloca_in,
+  mips_elf64_be_swap_reloca_out
 };
 
 #define TARGET_LITTLE_SYM		bfd_elf64_littlemips_vec
@@ -2082,29 +2107,67 @@
 #define TARGET_BIG_NAME			"elf64-bigmips"
 #define ELF_ARCH			bfd_arch_mips
 #define ELF_MACHINE_CODE		EM_MIPS
+
 #define ELF_MAXPAGESIZE			0x1000
+
+#define elf_backend_collect		true
+#define elf_backend_type_change_ok	true
+#define elf_backend_can_gc_sections	true
 #define elf_backend_size_info		mips_elf64_size_info
 #define elf_backend_object_p		_bfd_mips_elf_object_p
-#define elf_backend_section_from_shdr	mips_elf64_section_from_shdr
+#define elf_backend_section_from_shdr	_bfd_mips_elf_section_from_shdr
 #define elf_backend_fake_sections	_bfd_mips_elf_fake_sections
 #define elf_backend_section_from_bfd_section \
 					_bfd_mips_elf_section_from_bfd_section
-#define elf_backend_section_processing	mips_elf64_section_processing
+#define elf_backend_section_processing	_bfd_mips_elf_section_processing
 #define elf_backend_symbol_processing	_bfd_mips_elf_symbol_processing
+#define elf_backend_additional_program_headers \
+					_bfd_mips_elf_additional_program_headers
+#define elf_backend_modify_segment_map	_bfd_mips_elf_modify_segment_map
 #define elf_backend_final_write_processing \
 					_bfd_mips_elf_final_write_processing
 #define elf_backend_ecoff_debug_swap	&mips_elf64_ecoff_debug_swap
+#define elf_backend_add_symbol_hook	_bfd_mips_elf_add_symbol_hook
+#define elf_backend_create_dynamic_sections \
+					_bfd_mips_elf_create_dynamic_sections
+#define elf_backend_check_relocs	_bfd_mips_elf_check_relocs
+#define elf_backend_adjust_dynamic_symbol \
+					_bfd_mips_elf_adjust_dynamic_symbol
+#define elf_backend_always_size_sections \
+					_bfd_mips_elf_always_size_sections
+#define elf_backend_size_dynamic_sections \
+					_bfd_mips_elf_size_dynamic_sections
+#define elf_backend_relocate_section    _bfd_mips_elf_relocate_section
+#define elf_backend_link_output_symbol_hook \
+					_bfd_mips_elf_link_output_symbol_hook
+#define elf_backend_finish_dynamic_symbol \
+					_bfd_mips_elf_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_sections \
+					_bfd_mips_elf_finish_dynamic_sections
+#define elf_backend_gc_mark_hook	_bfd_mips_elf_gc_mark_hook
+#define elf_backend_gc_sweep_hook	_bfd_mips_elf_gc_sweep_hook
+#define elf_backend_got_header_size	(4*MIPS_RESERVED_GOTNO)
+#define elf_backend_plt_header_size	0
+#define elf_backend_may_use_rel_p       1
 
+/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit 
+   MIPS-specific function only applies to IRIX5, which had no 64-bit
+   ABI.  */
 #define bfd_elf64_find_nearest_line	_bfd_mips_elf_find_nearest_line
-#define bfd_elf64_get_reloc_upper_bound mips_elf64_get_reloc_upper_bound
-#define bfd_elf64_bfd_reloc_type_lookup	mips_elf64_reloc_type_lookup
 #define bfd_elf64_set_section_contents	_bfd_mips_elf_set_section_contents
+#define bfd_elf64_bfd_link_hash_table_create \
+					_bfd_mips_elf_link_hash_table_create
+#define bfd_elf64_bfd_final_link	_bfd_mips_elf_final_link
 #define bfd_elf64_bfd_copy_private_bfd_data \
 					_bfd_mips_elf_copy_private_bfd_data
 #define bfd_elf64_bfd_merge_private_bfd_data \
 					_bfd_mips_elf_merge_private_bfd_data
 #define bfd_elf64_bfd_set_private_flags	_bfd_mips_elf_set_private_flags
+#define bfd_elf64_bfd_print_private_bfd_data \
+					_bfd_mips_elf_print_private_bfd_data
 
+#define bfd_elf64_get_reloc_upper_bound mips_elf64_get_reloc_upper_bound
+#define bfd_elf64_bfd_reloc_type_lookup	mips_elf64_reloc_type_lookup
 #define bfd_elf64_archive_functions
 #define bfd_elf64_archive_slurp_armap	mips_elf64_slurp_armap
 #define bfd_elf64_archive_slurp_extended_name_table \
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index 17fe98d..255713e 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -51,8 +51,6 @@
   PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *));
 static boolean sparc64_elf_size_dynamic_sections
   PARAMS((bfd *, struct bfd_link_info *));
-static boolean sparc64_elf_adjust_dynindx
-  PARAMS((struct elf_link_hash_entry *, PTR));
 
 static boolean sparc64_elf_merge_private_bfd_data
   PARAMS ((bfd *, bfd *));
@@ -61,6 +59,15 @@
   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
 	   Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
 static boolean sparc64_elf_object_p PARAMS ((bfd *));
+static long sparc64_elf_get_reloc_upper_bound PARAMS ((bfd *, asection *));
+static long sparc64_elf_get_dynamic_reloc_upper_bound PARAMS ((bfd *));
+static boolean sparc64_elf_slurp_one_reloc_table
+  PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, asymbol **, boolean));
+static boolean sparc64_elf_slurp_reloc_table
+  PARAMS ((bfd *, asection *, asymbol **, boolean));
+static long sparc64_elf_canonicalize_dynamic_reloc
+  PARAMS ((bfd *, arelent **, asymbol **));
+static void sparc64_elf_write_relocs PARAMS ((bfd *, asection *, PTR));
 
 /* The relocation "howto" table.  */
 
@@ -213,8 +220,380 @@
      arelent *cache_ptr;
      Elf64_Internal_Rela *dst;
 {
-  BFD_ASSERT (ELF64_R_TYPE (dst->r_info) < (unsigned int) R_SPARC_max);
-  cache_ptr->howto = &sparc64_elf_howto_table[ELF64_R_TYPE (dst->r_info)];
+  BFD_ASSERT (ELF64_R_TYPE_ID (dst->r_info) < (unsigned int) R_SPARC_max_std);
+  cache_ptr->howto = &sparc64_elf_howto_table[ELF64_R_TYPE_ID (dst->r_info)];
+}
+
+/* Due to the way how we handle R_SPARC_OLO10, each entry in a SHT_RELA
+   section can represent up to two relocs, we must tell the user to allocate
+   more space.  */
+   
+static long
+sparc64_elf_get_reloc_upper_bound (abfd, sec)
+     bfd *abfd;
+     asection *sec;
+{
+  return (sec->reloc_count * 2 + 1) * sizeof (arelent *);
+}
+
+static long
+sparc64_elf_get_dynamic_reloc_upper_bound (abfd)
+     bfd *abfd;
+{
+  return _bfd_elf_get_dynamic_reloc_upper_bound (abfd) * 2;
+}
+
+/* Read  relocations for ASECT from REL_HDR.  There are RELOC_COUNT of 
+   them.  We cannot use generic elf routines for this,  because R_SPARC_OLO10
+   has secondary addend in ELF64_R_TYPE_DATA.  We handle it as two relocations
+   for the same location,  R_SPARC_LO10 and R_SPARC_13.  */
+
+static boolean
+sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic)
+     bfd *abfd;
+     asection *asect;
+     Elf_Internal_Shdr *rel_hdr;
+     asymbol **symbols;
+     boolean dynamic;
+{
+  struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
+  PTR allocated = NULL;
+  bfd_byte *native_relocs;
+  arelent *relent;
+  unsigned int i;
+  int entsize;
+  bfd_size_type count;
+  arelent *relents;
+
+  allocated = (PTR) bfd_malloc ((size_t) rel_hdr->sh_size);
+  if (allocated == NULL)
+    goto error_return;
+
+  if (bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0
+      || (bfd_read (allocated, 1, rel_hdr->sh_size, abfd)
+	  != rel_hdr->sh_size))
+    goto error_return;
+
+  native_relocs = (bfd_byte *) allocated;
+
+  relents = asect->relocation + asect->reloc_count;
+
+  entsize = rel_hdr->sh_entsize;
+  BFD_ASSERT (entsize == sizeof (Elf64_External_Rela));
+  
+  count = rel_hdr->sh_size / entsize;
+
+  for (i = 0, relent = relents; i < count;
+       i++, relent++, native_relocs += entsize)
+    {
+      Elf_Internal_Rela rela;
+
+      bfd_elf64_swap_reloca_in (abfd, (Elf64_External_Rela *) native_relocs, &rela);
+
+      /* The address of an ELF reloc is section relative for an object
+	 file, and absolute for an executable file or shared library.
+	 The address of a normal BFD reloc is always section relative,
+	 and the address of a dynamic reloc is absolute..  */
+      if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0 || dynamic)
+	relent->address = rela.r_offset;
+      else
+	relent->address = rela.r_offset - asect->vma;
+
+      if (ELF64_R_SYM (rela.r_info) == 0)
+	relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+      else
+	{
+	  asymbol **ps, *s;
+
+	  ps = symbols + ELF64_R_SYM (rela.r_info) - 1;
+	  s = *ps;
+
+	  /* Canonicalize ELF section symbols.  FIXME: Why?  */
+	  if ((s->flags & BSF_SECTION_SYM) == 0)
+	    relent->sym_ptr_ptr = ps;
+	  else
+	    relent->sym_ptr_ptr = s->section->symbol_ptr_ptr;
+	}
+
+      relent->addend = rela.r_addend;
+
+      BFD_ASSERT (ELF64_R_TYPE_ID (rela.r_info) < (unsigned int) R_SPARC_max_std);
+      if (ELF64_R_TYPE_ID (rela.r_info) == R_SPARC_OLO10)
+	{
+	  relent->howto = &sparc64_elf_howto_table[R_SPARC_LO10];
+	  relent[1].address = relent->address;
+	  relent++;
+	  relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+	  relent->addend = ELF64_R_TYPE_DATA (rela.r_info);
+	  relent->howto = &sparc64_elf_howto_table[R_SPARC_13];
+	}
+      else
+	relent->howto = &sparc64_elf_howto_table[ELF64_R_TYPE_ID (rela.r_info)];
+    }
+
+  asect->reloc_count += relent - relents;
+
+  if (allocated != NULL)
+    free (allocated);
+
+  return true;
+
+ error_return:
+  if (allocated != NULL)
+    free (allocated);
+  return false;
+}
+
+/* Read in and swap the external relocs.  */
+
+static boolean
+sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
+     bfd *abfd;
+     asection *asect;
+     asymbol **symbols;
+     boolean dynamic;
+{
+  struct bfd_elf_section_data * const d = elf_section_data (asect);
+  Elf_Internal_Shdr *rel_hdr;
+  Elf_Internal_Shdr *rel_hdr2;
+
+  if (asect->relocation != NULL)
+    return true;
+
+  if (! dynamic)
+    {
+      if ((asect->flags & SEC_RELOC) == 0
+	  || asect->reloc_count == 0)
+	return true;
+
+      rel_hdr = &d->rel_hdr;
+      rel_hdr2 = d->rel_hdr2;
+
+      BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset
+		  || (rel_hdr2 && asect->rel_filepos == rel_hdr2->sh_offset));
+    }
+  else
+    {
+      /* Note that ASECT->RELOC_COUNT tends not to be accurate in this
+	 case because relocations against this section may use the
+	 dynamic symbol table, and in that case bfd_section_from_shdr
+	 in elf.c does not update the RELOC_COUNT.  */
+      if (asect->_raw_size == 0)
+	return true;
+
+      rel_hdr = &d->this_hdr;
+      asect->reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize;
+      rel_hdr2 = NULL;
+    }
+
+  asect->relocation = ((arelent *) 
+		       bfd_alloc (abfd, 
+				  asect->reloc_count * 2 * sizeof (arelent)));
+  if (asect->relocation == NULL)
+    return false;
+
+  /* The sparc64_elf_slurp_one_reloc_table routine increments reloc_count.  */
+  asect->reloc_count = 0;
+    
+  if (!sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols,
+					  dynamic))
+    return false;
+  
+  if (rel_hdr2 
+      && !sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr2, symbols,
+					     dynamic))
+    return false;
+
+  return true;
+}
+
+/* Canonicalize the dynamic relocation entries.  Note that we return
+   the dynamic relocations as a single block, although they are
+   actually associated with particular sections; the interface, which
+   was designed for SunOS style shared libraries, expects that there
+   is only one set of dynamic relocs.  Any section that was actually
+   installed in the BFD, and has type SHT_REL or SHT_RELA, and uses
+   the dynamic symbol table, is considered to be a dynamic reloc
+   section.  */
+
+static long
+sparc64_elf_canonicalize_dynamic_reloc (abfd, storage, syms)
+     bfd *abfd;
+     arelent **storage;
+     asymbol **syms;
+{
+  asection *s;
+  long ret;
+
+  if (elf_dynsymtab (abfd) == 0)
+    {
+      bfd_set_error (bfd_error_invalid_operation);
+      return -1;
+    }
+
+  ret = 0;
+  for (s = abfd->sections; s != NULL; s = s->next)
+    {
+      if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd)
+	  && (elf_section_data (s)->this_hdr.sh_type == SHT_RELA))
+	{
+	  arelent *p;
+	  long count, i;
+
+	  if (! sparc64_elf_slurp_reloc_table (abfd, s, syms, true))
+	    return -1;
+	  count = s->reloc_count;
+	  p = s->relocation;
+	  for (i = 0; i < count; i++)
+	    *storage++ = p++;
+	  ret += count;
+	}
+    }
+
+  *storage = NULL;
+
+  return ret;
+}
+
+/* Write out the relocs.  */
+
+static void
+sparc64_elf_write_relocs (abfd, sec, data)
+     bfd *abfd;
+     asection *sec;
+     PTR data;
+{
+  boolean *failedp = (boolean *) data;
+  Elf_Internal_Shdr *rela_hdr;
+  Elf64_External_Rela *outbound_relocas;
+  unsigned int idx, count;
+  asymbol *last_sym = 0;
+  int last_sym_idx = 0;
+
+  /* If we have already failed, don't do anything.  */
+  if (*failedp)
+    return;
+
+  if ((sec->flags & SEC_RELOC) == 0)
+    return;
+
+  /* The linker backend writes the relocs out itself, and sets the
+     reloc_count field to zero to inhibit writing them here.  Also,
+     sometimes the SEC_RELOC flag gets set even when there aren't any
+     relocs.  */
+  if (sec->reloc_count == 0)
+    return;
+
+  /* We can combine two relocs that refer to the same address
+     into R_SPARC_OLO10 if first one is R_SPARC_LO10 and the
+     latter is R_SPARC_13 with no associated symbol.  */
+  count = 0;
+  for (idx = 0; idx < sec->reloc_count; idx++)
+    {
+      bfd_vma addr;
+      unsigned int i;
+
+      ++count;
+
+      addr = sec->orelocation[idx]->address;
+      if (sec->orelocation[idx]->howto->type == R_SPARC_LO10
+	  && idx < sec->reloc_count - 1)
+	{
+	  arelent *r = sec->orelocation[idx + 1];
+
+	  if (r->howto->type == R_SPARC_13
+	      && r->address == addr
+	      && bfd_is_abs_section ((*r->sym_ptr_ptr)->section)
+	      && (*r->sym_ptr_ptr)->value == 0)
+	    ++idx;
+	}
+    }
+
+  rela_hdr = &elf_section_data (sec)->rel_hdr;
+
+  rela_hdr->sh_size = rela_hdr->sh_entsize * count;
+  rela_hdr->contents = (PTR) bfd_alloc (abfd, rela_hdr->sh_size);
+  if (rela_hdr->contents == NULL)
+    {
+      *failedp = true;
+      return;
+    }
+
+  /* Figure out whether the relocations are RELA or REL relocations.  */
+  if (rela_hdr->sh_type != SHT_RELA)
+    abort ();
+
+  /* orelocation has the data, reloc_count has the count... */
+  outbound_relocas = (Elf64_External_Rela *) rela_hdr->contents;
+
+  for (idx = 0; idx < sec->reloc_count; idx++)
+    {
+      Elf_Internal_Rela dst_rela;
+      Elf64_External_Rela *src_rela;
+      arelent *ptr;
+      asymbol *sym;
+      int n;
+
+      ptr = sec->orelocation[idx];
+      src_rela = outbound_relocas + idx;
+
+      /* The address of an ELF reloc is section relative for an object
+	 file, and absolute for an executable file or shared library.
+	 The address of a BFD reloc is always section relative.  */
+      if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
+	dst_rela.r_offset = ptr->address;
+      else
+	dst_rela.r_offset = ptr->address + sec->vma;
+
+      sym = *ptr->sym_ptr_ptr;
+      if (sym == last_sym)
+	n = last_sym_idx;
+      else if (bfd_is_abs_section (sym->section) && sym->value == 0)
+	n = STN_UNDEF;
+      else
+	{
+	  last_sym = sym;
+	  n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym);
+	  if (n < 0)
+	    {
+	      *failedp = true;
+	      return;
+	    }
+	  last_sym_idx = n;
+	}
+
+      if ((*ptr->sym_ptr_ptr)->the_bfd != NULL
+	  && (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec
+	  && ! _bfd_elf_validate_reloc (abfd, ptr))
+	{
+	  *failedp = true;
+	  return;
+	}
+
+      if (ptr->howto->type == R_SPARC_LO10
+	  && idx < sec->reloc_count - 1)
+	{
+	  arelent *r = sec->orelocation[idx + 1];
+
+	  if (r->howto->type == R_SPARC_13
+	      && r->address == ptr->address
+	      && bfd_is_abs_section ((*r->sym_ptr_ptr)->section)
+	      && (*r->sym_ptr_ptr)->value == 0)
+	    {
+	      idx++;
+	      dst_rela.r_info
+		= ELF64_R_INFO (n, ELF64_R_TYPE_INFO (r->addend,
+						      R_SPARC_OLO10));
+	    }
+	  else
+	    dst_rela.r_info = ELF64_R_INFO (n, R_SPARC_LO10);
+	}
+      else
+	dst_rela.r_info = ELF64_R_INFO (n, ptr->howto->type);
+
+      dst_rela.r_addend = ptr->addend;
+      bfd_elf64_swap_reloca_out (abfd, &dst_rela, src_rela);
+    }
 }
 
 /* Utility for performing the standard initial work of an instruction
@@ -570,7 +949,7 @@
       else
 	h = sym_hashes[r_symndx - symtab_hdr->sh_info];
 
-      switch (ELF64_R_TYPE (rel->r_info))
+      switch (ELF64_R_TYPE_ID (rel->r_info))
 	{
 	case R_SPARC_GOT10:
 	case R_SPARC_GOT13:
@@ -809,7 +1188,7 @@
 	default:
 	  (*_bfd_error_handler)(_("%s: check_relocs: unhandled reloc type %d"),
 				bfd_get_filename(abfd),
-				ELF64_R_TYPE (rel->r_info));
+				ELF64_R_TYPE_ID (rel->r_info));
 	  return false;
 	}
     }
@@ -1127,9 +1506,7 @@
 	  if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0)
 	      || ! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0)
 	      || ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
-	      || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0)
-	      || ! bfd_elf64_add_dynamic_entry (info, DT_SPARC_PLTFMT,
-						(info->shared != 0) + 1))
+	      || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0))
 	    return false;
 	}
 
@@ -1146,54 +1523,8 @@
 	}
     }
 
-  /* If we are generating a shared library, we generate a section
-     symbol for each output section for which we might need to copy
-     relocs.  These are local symbols, which means that they must come
-     first in the dynamic symbol table.  That means we must increment
-     the dynamic symbol index of every other dynamic symbol.  */
-  if (info->shared)
-    {
-      int c;
-
-      c = 0;
-      for (s = output_bfd->sections; s != NULL; s = s->next)
-	{
-	  if ((s->flags & SEC_LINKER_CREATED) != 0
-	      || (s->flags & SEC_ALLOC) == 0)
-	    continue;
-
-	  elf_section_data (s)->dynindx = c + 1;
-
-	  /* These symbols will have no names, so we don't need to
-             fiddle with dynstr_index.  */
-
-	  ++c;
-	}
-
-      elf_link_hash_traverse (elf_hash_table (info),
-			      sparc64_elf_adjust_dynindx,
-			      (PTR) &c);
-      elf_hash_table (info)->dynsymcount += c;
-    }
-
   return true;
 }
-
-/* Increment the index of a dynamic symbol by a given amount.  Called
-   via elf_link_hash_traverse.  */
-
-static boolean
-sparc64_elf_adjust_dynindx (h, cparg)
-     struct elf_link_hash_entry *h;
-     PTR cparg;
-{
-  int *cp = (int *) cparg;
-
-  if (h->dynindx != -1)
-    h->dynindx += *cp;
-  return true;
-}
-
 
 /* Relocate a SPARC64 ELF section.  */
 
@@ -1245,8 +1576,8 @@
       bfd_vma relocation;
       bfd_reloc_status_type r;
 
-      r_type = ELF64_R_TYPE (rel->r_info);
-      if (r_type < 0 || r_type >= (int) R_SPARC_max)
+      r_type = ELF64_R_TYPE_ID (rel->r_info);
+      if (r_type < 0 || r_type >= (int) R_SPARC_max_std)
 	{
 	  bfd_set_error (bfd_error_bad_value);
 	  return false;
@@ -1531,7 +1862,11 @@
 				 & ELF_LINK_HASH_DEF_REGULAR) == 0))
 		  {
 		    BFD_ASSERT (h->dynindx != -1);
-		    outrel.r_info = ELF64_R_INFO (h->dynindx, r_type);
+		    outrel.r_info
+		      = ELF64_R_INFO (h->dynindx,
+				      ELF64_R_TYPE_INFO (
+					ELF64_R_TYPE_DATA (rel->r_info),
+							   r_type));
 		    outrel.r_addend = rel->r_addend;
 		  }
 		else
@@ -1581,7 +1916,11 @@
 			      }
 			  }
 
-			outrel.r_info = ELF64_R_INFO (indx, r_type);
+			outrel.r_info
+			  = ELF64_R_INFO (indx,
+					  ELF64_R_TYPE_INFO (
+					    ELF64_R_TYPE_DATA (rel->r_info),
+							       r_type));
 
 			/* For non-RELATIVE dynamic relocations, we keep the
 			   same symbol, and so generally the same addend.  But
@@ -1605,7 +1944,7 @@
 		   reloc in an unallocated section.  */
 		if (skip
 		    || (input_section->flags & SEC_ALLOC) != 0
-		    || ELF64_R_TYPE (outrel.r_info) != R_SPARC_RELATIVE)
+		    || ELF64_R_TYPE_ID (outrel.r_info) != R_SPARC_RELATIVE)
 		  continue;
 	      }
 	    break;
@@ -2090,50 +2429,6 @@
 
   elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 8;
 
-  if (info->shared)
-    {
-      asection *sdynsym;
-      asection *s;
-      Elf_Internal_Sym sym;
-      int c;
-
-      /* Set up the section symbols for the output sections.  */
-
-      sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
-      BFD_ASSERT (sdynsym != NULL);
-
-      sym.st_size = 0;
-      sym.st_name = 0;
-      sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
-      sym.st_other = 0;
-
-      c = 0;
-      for (s = output_bfd->sections; s != NULL; s = s->next)
-	{
-	  int indx;
-
-	  if (elf_section_data (s)->dynindx == 0)
-	    continue;
-
-	  sym.st_value = s->vma;
-
-	  indx = elf_section_data (s)->this_idx;
-	  BFD_ASSERT (indx > 0);
-	  sym.st_shndx = indx;
-
-	  bfd_elf64_swap_symbol_out (output_bfd, &sym,
-				     (PTR) (((Elf64_External_Sym *)
-					     sdynsym->contents)
-					    + elf_section_data (s)->dynindx));
-
-	  ++c;
-	}
-
-      /* Set the sh_info field of the output .dynsym section to the
-         index of the first global symbol.  */
-      elf_section_data (sdynsym->output_section)->this_hdr.sh_info = c + 1;
-    }
-
   return true;
 }
 
@@ -2225,6 +2520,45 @@
   return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, mach);
 }
 
+/* Relocations in the 64 bit SPARC ELF ABI are more complex than in
+   standard ELF, because R_SPARC_OLO10 has secondary addend in
+   ELF64_R_TYPE_DATA field.  This structure is used to redirect the
+   relocation handling routines.  */
+
+const struct elf_size_info sparc64_elf_size_info =
+{
+  sizeof (Elf64_External_Ehdr),
+  sizeof (Elf64_External_Phdr),
+  sizeof (Elf64_External_Shdr),
+  sizeof (Elf64_External_Rel),
+  sizeof (Elf64_External_Rela),
+  sizeof (Elf64_External_Sym),
+  sizeof (Elf64_External_Dyn),
+  sizeof (Elf_External_Note),
+  8,		/* hash-table entry size */
+  /* internal relocations per external relocations.
+     For link purposes we use just 1 internal per
+     1 external, for assembly and slurp symbol table
+     we use 2. */
+  1,
+  64,		/* arch_size */
+  8,		/* file_align */
+  ELFCLASS64,
+  EV_CURRENT,
+  bfd_elf64_write_out_phdrs,
+  bfd_elf64_write_shdrs_and_ehdr,
+  sparc64_elf_write_relocs,
+  bfd_elf64_swap_symbol_out,
+  sparc64_elf_slurp_reloc_table,
+  bfd_elf64_slurp_symbol_table,
+  bfd_elf64_swap_dyn_in,
+  bfd_elf64_swap_dyn_out,
+  NULL,
+  NULL,
+  NULL,
+  NULL
+};
+
 #define TARGET_BIG_SYM	bfd_elf64_sparc_vec
 #define TARGET_BIG_NAME	"elf64-sparc"
 #define ELF_ARCH	bfd_arch_sparc
@@ -2238,6 +2572,12 @@
 
 #define elf_info_to_howto \
   sparc64_elf_info_to_howto
+#define bfd_elf64_get_reloc_upper_bound \
+  sparc64_elf_get_reloc_upper_bound
+#define bfd_elf64_get_dynamic_reloc_upper_bound \
+  sparc64_elf_get_dynamic_reloc_upper_bound
+#define bfd_elf64_canonicalize_dynamic_reloc \
+  sparc64_elf_canonicalize_dynamic_reloc
 #define bfd_elf64_bfd_reloc_type_lookup \
   sparc64_elf_reloc_type_lookup
 
@@ -2259,6 +2599,8 @@
 #define bfd_elf64_bfd_merge_private_bfd_data \
   sparc64_elf_merge_private_bfd_data
 
+#define elf_backend_size_info \
+  sparc64_elf_size_info
 #define elf_backend_object_p \
   sparc64_elf_object_p
 
diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c
index 5952e74..38778b7 100644
--- a/bfd/elfarm-nabi.c
+++ b/bfd/elfarm-nabi.c
@@ -35,8 +35,10 @@
 #define TARGET_BIG_NAME                 "elf32-bigarm"
 
 #define elf_info_to_howto               0
-#define elf_info_to_howto_rel           elf32_arm_info_to_howto_rel 
+#define elf_info_to_howto_rel           elf32_arm_info_to_howto
 
+#define ARM_ELF_ABI_VERSION		0
+#define ARM_ELF_OS_ABI_VERSION		ELFOSABI_ARM
 
 static reloc_howto_type * elf32_arm_reloc_type_lookup
   PARAMS ((bfd * abfd, bfd_reloc_code_real_type code));
@@ -574,8 +576,8 @@
 
  
 static void
-elf32_arm_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
-     bfd * abfd;
+elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
+     bfd * abfd ATTRIBUTE_UNUSED;
      arelent * bfd_reloc;
      Elf32_Internal_Rel * elf_reloc;
 {
@@ -639,7 +641,7 @@
 
 static reloc_howto_type *
 elf32_arm_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
diff --git a/bfd/elfarm-oabi.c b/bfd/elfarm-oabi.c
index f219b92..72f62f2 100644
--- a/bfd/elfarm-oabi.c
+++ b/bfd/elfarm-oabi.c
@@ -23,6 +23,10 @@
 #include "libbfd.h"
 #include "elf-bfd.h"
 
+#ifndef NUM_ELEM
+#define NUM_ELEM(a) (sizeof (a) / sizeof (a)[0])
+#endif
+
 #define USE_RELA
 
 #define TARGET_LITTLE_SYM               bfd_elf32_littlearm_oabi_vec
@@ -33,6 +37,9 @@
 #define elf_info_to_howto               elf32_arm_info_to_howto
 #define elf_info_to_howto_rel           0
 
+#define ARM_ELF_ABI_VERSION		0
+#define ARM_ELF_OS_ABI_VERSION		0
+
 static reloc_howto_type elf32_arm_howto_table[] =
 {
   /* No relocation */
@@ -173,7 +180,7 @@
 	 0,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_dont,	/* complain_on_overflow */
+	 complain_overflow_dont,/* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_ARM_SBREL32",	/* name */
 	 false,			/* partial_inplace */
@@ -254,7 +261,24 @@
          0,                     /* src_mask */
          0,                     /* dst_mask */
          false),                /* pcrel_offset */
- 
+
+  /* XXX - gap in index numbering here.  */
+  
+  HOWTO (R_ARM_PLT32,		/* type */
+         2,                     /* rightshift */
+         2,                     /* size (0 = byte, 1 = short, 2 = long) */
+         26,                    /* bitsize */
+         true,			/* pc_relative */
+         0,                     /* bitpos */
+         complain_overflow_bitfield,/* complain_on_overflow */
+         bfd_elf_generic_reloc, /* special_function */
+         "R_ARM_PLT32",		/* name */
+         true,			/* partial_inplace */
+         0x00ffffff,		/* src_mask */
+         0x00ffffff,		/* dst_mask */
+         true),			/* pcrel_offset */
+  
+  /* XXX - gap in index numbering here.  */
 
   HOWTO (R_ARM_RREL32,		/* type */
 	 0,			/* rightshift */
@@ -310,22 +334,38 @@
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0,			/* dst_mask */
-	 false),		/* pcrel_offset */
-
+	 false)			/* pcrel_offset */
 };
 
+/* Locate a reloc in the howto table.  This function must be used
+   when the entry number is is > R_ARM_GNU_VTINHERIT.  */
+static reloc_howto_type *
+find_howto (r_type)
+     unsigned int r_type;
+{
+  int i;
+  
+  for (i = NUM_ELEM (elf32_arm_howto_table); i--;)
+    if (elf32_arm_howto_table [i].type == r_type)
+      return elf32_arm_howto_table + i;
+
+  return NULL;
+}
+
 static void
 elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *bfd_reloc;
      Elf32_Internal_Rela *elf_reloc;
 {
   unsigned int r_type;
 
   r_type = ELF32_R_TYPE (elf_reloc->r_info);
-  /* fixme: need range test */
-  /* BFD_ASSERT (r_type < (unsigned int) R_ELF32_ARM_MAX); */
-  bfd_reloc->howto = &elf32_arm_howto_table[r_type];
+
+  if (r_type <= R_ARM_GNU_VTINHERIT)
+    bfd_reloc->howto = & elf32_arm_howto_table[r_type];
+  else
+    bfd_reloc->howto = find_howto (r_type);
 }
 
 struct elf32_arm_reloc_map
@@ -336,38 +376,37 @@
 
 static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
 {
-  {BFD_RELOC_NONE, R_ARM_NONE,},
-  {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24,},
-  {BFD_RELOC_32, R_ARM_ABS32,},
-  {BFD_RELOC_32_PCREL, R_ARM_REL32,},
-  {BFD_RELOC_8, R_ARM_ABS8,},
-  {BFD_RELOC_16, R_ARM_ABS16,},
-  {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12,},
-  {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5,},
-  {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22,},
-  {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT },
-  {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY },
-  {BFD_RELOC_NONE, R_ARM_SBREL32,},
-  {BFD_RELOC_NONE, R_ARM_AMP_VCALL9,},
-  {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11,},
-  {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9,}
+  {BFD_RELOC_NONE,                 R_ARM_NONE },
+  {BFD_RELOC_ARM_PCREL_BRANCH,     R_ARM_PC24 },
+  {BFD_RELOC_32,                   R_ARM_ABS32 },
+  {BFD_RELOC_32_PCREL,             R_ARM_REL32 },
+  {BFD_RELOC_8,                    R_ARM_ABS8 },
+  {BFD_RELOC_16,                   R_ARM_ABS16 },
+  {BFD_RELOC_ARM_OFFSET_IMM,       R_ARM_ABS12 },
+  {BFD_RELOC_ARM_THUMB_OFFSET,     R_ARM_THM_ABS5 },
+  {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 },
+  {BFD_RELOC_NONE,                 R_ARM_SBREL32 },
+  {BFD_RELOC_NONE,                 R_ARM_AMP_VCALL9 },
+  {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 },
+  {BFD_RELOC_THUMB_PCREL_BRANCH9,  R_ARM_THM_PC9 },  
+  {BFD_RELOC_VTABLE_INHERIT,       R_ARM_GNU_VTINHERIT },
+  {BFD_RELOC_VTABLE_ENTRY,         R_ARM_GNU_VTENTRY }
 };
 
 static reloc_howto_type *
 elf32_arm_reloc_type_lookup (abfd, code)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   unsigned int i;
 
-  for (i = 0;
-     i < sizeof (elf32_arm_reloc_map) / sizeof (struct elf32_arm_reloc_map);
-       i++)
-    {
-      if (elf32_arm_reloc_map[i].bfd_reloc_val == code)
-	return & elf32_arm_howto_table[elf32_arm_reloc_map[i].elf_reloc_val];
-    }
+  for (i = NUM_ELEM (elf32_arm_reloc_map); i--;)
+    if (elf32_arm_reloc_map[i].bfd_reloc_val == code)
+      return & elf32_arm_howto_table [elf32_arm_reloc_map[i].elf_reloc_val];
 
+  if (code == BFD_RELOC_ARM_PLT32)
+    return find_howto (R_ARM_PLT32);
+  
   return NULL;
 }
 
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 22f6488..adbafd8 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -1,5 +1,6 @@
 /* ELF executable support for BFD.
-   Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software
+   Foundation, Inc.
 
    Written by Fred Fish @ Cygnus Support, from information published
    in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -129,6 +130,8 @@
 #define elf_gc_common_final_link	NAME(_bfd_elf,gc_common_final_link)
 #define elf_gc_record_vtinherit		NAME(_bfd_elf,gc_record_vtinherit)
 #define elf_gc_record_vtentry		NAME(_bfd_elf,gc_record_vtentry)
+#define elf_link_record_local_dynamic_symbol \
+  NAME(_bfd_elf,link_record_local_dynamic_symbol)
 
 #if ARCH_SIZE == 64
 #define ELF_R_INFO(X,Y)	ELF64_R_INFO(X,Y)
@@ -162,6 +165,9 @@
 
 #define section_from_elf_index bfd_section_from_elf_index
 
+static boolean elf_slurp_reloc_table_from_section 
+  PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, bfd_size_type,
+	   arelent *, asymbol **, boolean));
 static boolean elf_slurp_reloc_table
   PARAMS ((bfd *, asection *, asymbol **, boolean));
 
@@ -419,11 +425,13 @@
 }
 
 INLINE void
-elf_swap_dyn_out (abfd, src, dst)
+elf_swap_dyn_out (abfd, src, p)
      bfd *abfd;
      const Elf_Internal_Dyn *src;
-     Elf_External_Dyn *dst;
+     PTR p;
 {
+  Elf_External_Dyn *dst = (Elf_External_Dyn *) p;
+
   put_word (abfd, src->d_tag, dst->d_tag);
   put_word (abfd, src->d_un.d_val, dst->d_un.d_val);
 }
@@ -729,7 +737,7 @@
   Elf_External_Rela *outbound_relocas;
   Elf_External_Rel *outbound_relocs;
   unsigned int idx;
-  int use_rela_p = get_elf_backend_data (abfd)->use_rela_p;
+  int use_rela_p;
   asymbol *last_sym = 0;
   int last_sym_idx = 0;
 
@@ -757,6 +765,16 @@
       return;
     }
 
+  /* Figure out whether the relocations are RELA or REL relocations.  */
+  if (rela_hdr->sh_type == SHT_RELA)
+    use_rela_p = true;
+  else if (rela_hdr->sh_type == SHT_REL)
+    use_rela_p = false;
+  else
+    /* Every relocation section should be either an SHT_RELA or an
+       SHT_REL section.  */
+    abort ();
+
   /* orelocation has the data, reloc_count has the count... */
   if (use_rela_p)
     {
@@ -1185,50 +1203,27 @@
   return -1;
 }
 
-/* Read in and swap the external relocs.  */
+/* Read  relocations for ASECT from REL_HDR.  There are RELOC_COUNT of 
+   them.  */
 
 static boolean
-elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
+elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count,
+				    relents, symbols, dynamic)
      bfd *abfd;
      asection *asect;
+     Elf_Internal_Shdr *rel_hdr;
+     bfd_size_type reloc_count;
+     arelent *relents;
      asymbol **symbols;
      boolean dynamic;
 {
   struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
-  struct bfd_elf_section_data * const d = elf_section_data (asect);
-  Elf_Internal_Shdr *rel_hdr;
-  bfd_size_type reloc_count;
   PTR allocated = NULL;
   bfd_byte *native_relocs;
-  arelent *relents;
   arelent *relent;
   unsigned int i;
   int entsize;
 
-  if (asect->relocation != NULL)
-    return true;
-
-  if (! dynamic)
-    {
-      if ((asect->flags & SEC_RELOC) == 0
-	  || asect->reloc_count == 0)
-	return true;
-
-      rel_hdr = &d->rel_hdr;
-      reloc_count = asect->reloc_count;
-
-      BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset
-		  && reloc_count == rel_hdr->sh_size / rel_hdr->sh_entsize);
-    }
-  else
-    {
-      if (asect->_raw_size == 0)
-	return true;
-
-      rel_hdr = &d->this_hdr;
-      reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize;
-    }
-
   allocated = (PTR) bfd_malloc ((size_t) rel_hdr->sh_size);
   if (allocated == NULL)
     goto error_return;
@@ -1240,10 +1235,6 @@
 
   native_relocs = (bfd_byte *) allocated;
 
-  relents = (arelent *) bfd_alloc (abfd, reloc_count * sizeof (arelent));
-  if (relents == NULL)
-    goto error_return;
-
   entsize = rel_hdr->sh_entsize;
   BFD_ASSERT (entsize == sizeof (Elf_External_Rel)
 	      || entsize == sizeof (Elf_External_Rela));
@@ -1298,8 +1289,6 @@
 	(*ebd->elf_info_to_howto_rel) (abfd, relent, &rel);
     }
 
-  asect->relocation = relents;
-
   if (allocated != NULL)
     free (allocated);
 
@@ -1311,6 +1300,82 @@
   return false;
 }
 
+/* Read in and swap the external relocs.  */
+
+static boolean
+elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
+     bfd *abfd;
+     asection *asect;
+     asymbol **symbols;
+     boolean dynamic;
+{
+  struct bfd_elf_section_data * const d = elf_section_data (asect);
+  Elf_Internal_Shdr *rel_hdr;
+  Elf_Internal_Shdr *rel_hdr2;
+  bfd_size_type reloc_count;
+  bfd_size_type reloc_count2;
+  arelent *relents;
+
+  if (asect->relocation != NULL)
+    return true;
+
+  if (! dynamic)
+    {
+      if ((asect->flags & SEC_RELOC) == 0
+	  || asect->reloc_count == 0)
+	return true;
+
+      rel_hdr = &d->rel_hdr;
+      reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize;
+      rel_hdr2 = d->rel_hdr2;
+      reloc_count2 = (rel_hdr2 
+		      ? (rel_hdr2->sh_size / rel_hdr2->sh_entsize)
+		      : 0);
+
+      BFD_ASSERT (asect->reloc_count == reloc_count + reloc_count2);
+      BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset
+		  || (rel_hdr2 && asect->rel_filepos == rel_hdr2->sh_offset));
+
+    }
+  else
+    {
+      /* Note that ASECT->RELOC_COUNT tends not to be accurate in this
+	 case because relocations against this section may use the
+	 dynamic symbol table, and in that case bfd_section_from_shdr
+	 in elf.c does not update the RELOC_COUNT.  */
+      if (asect->_raw_size == 0)
+	return true;
+
+      rel_hdr = &d->this_hdr;
+      reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize;
+      rel_hdr2 = NULL;
+      reloc_count2 = 0;
+    }
+
+  relents = ((arelent *) 
+	     bfd_alloc (abfd, 
+			(reloc_count + reloc_count2) * sizeof (arelent)));
+  if (relents == NULL)
+    return false;
+
+  if (!elf_slurp_reloc_table_from_section (abfd, asect,
+					   rel_hdr, reloc_count,
+					   relents,
+					   symbols, dynamic))
+    return false;
+  
+  if (rel_hdr2 
+      && !elf_slurp_reloc_table_from_section (abfd, asect,
+					      rel_hdr2, reloc_count2,
+					      relents + reloc_count,
+					      symbols, dynamic))
+    return false;
+
+  
+  asect->relocation = relents;
+  return true;
+}
+
 #ifdef DEBUG
 static void
 elf_debug_section (num, hdr)
@@ -1439,7 +1504,8 @@
   sizeof (Elf_External_Sym),
   sizeof (Elf_External_Dyn),
   sizeof (Elf_External_Note),
-
+  ARCH_SIZE / 8,
+  1,
   ARCH_SIZE, FILE_ALIGN,
   ELFCLASS, EV_CURRENT,
   elf_write_out_phdrs,
@@ -1448,5 +1514,10 @@
   elf_swap_symbol_out,
   elf_slurp_reloc_table,
   elf_slurp_symbol_table,
-  elf_swap_dyn_in
+  elf_swap_dyn_in,
+  elf_swap_dyn_out,
+  NULL,
+  NULL,
+  NULL,
+  NULL
 };
diff --git a/bfd/elflink.c b/bfd/elflink.c
index dc0b042..c30915b 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1,5 +1,5 @@
 /* ELF linking support for BFD.
-   Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -100,7 +100,7 @@
   flagword flags, pltflags;
   register asection *s;
   struct elf_backend_data *bed = get_elf_backend_data (abfd);
-  int ptralign;
+  int ptralign = 0;
 
   switch (bed->s->arch_size)
     {
@@ -147,7 +147,8 @@
 	return false;
     }
 
-  s = bfd_make_section (abfd, bed->use_rela_p ? ".rela.plt" : ".rel.plt");
+  s = bfd_make_section (abfd, 
+			bed->default_use_rela_p ? ".rela.plt" : ".rel.plt");
   if (s == NULL
       || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
       || ! bfd_set_section_alignment (abfd, s, ptralign))
@@ -156,18 +157,20 @@
   if (! _bfd_elf_create_got_section (abfd, info))
     return false;
 
-  /* The .dynbss section is a place to put symbols which are defined
-     by dynamic objects, are referenced by regular objects, and are
-     not functions.  We must allocate space for them in the process
-     image and use a R_*_COPY reloc to tell the dynamic linker to
-     initialize them at run time.  The linker script puts the .dynbss
-     section into the .bss section of the final image.  */
-  s = bfd_make_section (abfd, ".dynbss");
-  if (s == NULL
-      || ! bfd_set_section_flags (abfd, s, SEC_ALLOC))
-    return false;
+  if (bed->want_dynbss)
+    {
+      /* The .dynbss section is a place to put symbols which are defined
+	 by dynamic objects, are referenced by regular objects, and are
+	 not functions.  We must allocate space for them in the process
+	 image and use a R_*_COPY reloc to tell the dynamic linker to
+	 initialize them at run time.  The linker script puts the .dynbss
+	 section into the .bss section of the final image.  */
+      s = bfd_make_section (abfd, ".dynbss");
+      if (s == NULL
+	  || ! bfd_set_section_flags (abfd, s, SEC_ALLOC))
+	return false;
 
-  /* The .rel[a].bss section holds copy relocs.  This section is not
+      /* The .rel[a].bss section holds copy relocs.  This section is not
      normally needed.  We need to create it here, though, so that the
      linker will map it to an output section.  We can't just create it
      only if we need it, because we will not know whether we need it
@@ -178,13 +181,16 @@
      be needed, we can discard it later.  We will never need this
      section when generating a shared object, since they do not use
      copy relocs.  */
-  if (! info->shared)
-    {
-      s = bfd_make_section (abfd, bed->use_rela_p ? ".rela.bss" : ".rel.bss");
-      if (s == NULL
-	  || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
-	  || ! bfd_set_section_alignment (abfd, s, ptralign))
-	return false;
+      if (! info->shared)
+	{
+	  s = bfd_make_section (abfd, 
+				(bed->default_use_rela_p 
+				 ? ".rela.bss" : ".rel.bss")); 
+	  if (s == NULL
+	      || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+	      || ! bfd_set_section_alignment (abfd, s, ptralign))
+	    return false;
+	}
     }
 
   return true;
@@ -256,8 +262,84 @@
 
   return true;
 }
+
+/* Return the dynindex of a local dynamic symbol.  */
+
+long
+_bfd_elf_link_lookup_local_dynindx (info, input_bfd, input_indx)
+     struct bfd_link_info *info;
+     bfd *input_bfd;
+     long input_indx;
+{
+  struct elf_link_local_dynamic_entry *e;
+
+  for (e = elf_hash_table (info)->dynlocal; e ; e = e->next)
+    if (e->input_bfd == input_bfd && e->input_indx == input_indx)
+      return e->dynindx;
+  return -1;
+}
+
+/* This function is used to renumber the dynamic symbols, if some of
+   them are removed because they are marked as local.  This is called
+   via elf_link_hash_traverse.  */
+
+static boolean elf_link_renumber_hash_table_dynsyms
+  PARAMS ((struct elf_link_hash_entry *, PTR));
+
+static boolean
+elf_link_renumber_hash_table_dynsyms (h, data)
+     struct elf_link_hash_entry *h;
+     PTR data;
+{
+  size_t *count = (size_t *) data;
+
+  if (h->dynindx != -1)
+    h->dynindx = ++(*count);
+
+  return true;
+}
+
+/* Assign dynsym indicies.  In a shared library we generate a section
+   symbol for each output section, which come first.  Next come all of
+   the back-end allocated local dynamic syms, followed by the rest of
+   the global symbols.  */
+
+unsigned long
+_bfd_elf_link_renumber_dynsyms (output_bfd, info)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
+{
+  unsigned long dynsymcount = 0;
+
+  if (info->shared)
+    {
+      asection *p;
+      for (p = output_bfd->sections; p ; p = p->next)
+	elf_section_data (p)->dynindx = ++dynsymcount;
+    }
+
+  if (elf_hash_table (info)->dynlocal)
+    {
+      struct elf_link_local_dynamic_entry *p;
+      for (p = elf_hash_table (info)->dynlocal; p ; p = p->next)
+	p->dynindx = ++dynsymcount;
+    }
+
+  elf_link_hash_traverse (elf_hash_table (info),
+			  elf_link_renumber_hash_table_dynsyms,
+			  &dynsymcount);
+
+  /* There is an unused NULL entry at the head of the table which
+     we must account for in our count.  Unless there weren't any
+     symbols, which means we'll have no table at all.  */
+  if (dynsymcount != 0)
+    ++dynsymcount;
+
+  return elf_hash_table (info)->dynsymcount = dynsymcount;
+}
 
-/* Create a special linker section, or return a pointer to a linker section already created  */
+/* Create a special linker section, or return a pointer to a linker
+   section already created */
 
 elf_linker_section_t *
 _bfd_elf_create_linker_section (abfd, info, which, defaults)
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 32bfab0..6fb9bba 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -48,10 +48,17 @@
   PARAMS ((struct elf_link_hash_entry *, PTR));
 static boolean elf_link_assign_sym_version
   PARAMS ((struct elf_link_hash_entry *, PTR));
-static boolean elf_link_renumber_dynsyms
-  PARAMS ((struct elf_link_hash_entry *, PTR));
 static boolean elf_collect_hash_codes
   PARAMS ((struct elf_link_hash_entry *, PTR));
+static boolean elf_link_read_relocs_from_section 
+  PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *));
+static void elf_link_output_relocs
+  PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *));
+static boolean elf_link_size_reloc_section
+  PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
+static void elf_link_adjust_relocs 
+  PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int, 
+	   struct elf_link_hash_entry **));
 
 /* Given an ELF BFD, add symbols to the global hash table as
    appropriate.  */
@@ -358,6 +365,17 @@
       break;
     }
 
+  /* In cases involving weak versioned symbols, we may wind up trying
+     to merge a symbol with itself.  Catch that here, to avoid the
+     confusion that results if we try to override a symbol with
+     itself.  The additional tests catch cases like
+     _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a
+     dynamic object, which we do want to handle here.  */
+  if (abfd == oldbfd
+      && ((abfd->flags & DYNAMIC) == 0
+	  || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
+    return true;
+
   /* NEWDYN and OLDDYN indicate whether the new or old symbol,
      respectively, is from a dynamic object.  */
 
@@ -484,14 +502,19 @@
      represent variables; this can cause confusion in principle, but
      any such confusion would seem to indicate an erroneous program or
      shared library.  We also permit a common symbol in a regular
-     object to override a weak symbol in a shared object.  */
+     object to override a weak symbol in a shared object.
+
+     We prefer a non-weak definition in a shared library to a weak
+     definition in the executable.  */
 
   if (newdyn
       && newdef
       && (olddef
 	  || (h->root.type == bfd_link_hash_common
 	      && (bind == STB_WEAK
-		  || ELF_ST_TYPE (sym->st_info) == STT_FUNC))))
+		  || ELF_ST_TYPE (sym->st_info) == STT_FUNC)))
+      && (h->root.type != bfd_link_hash_defweak
+	  || bind == STB_WEAK))
     {
       *override = true;
       newdef = false;
@@ -535,7 +558,10 @@
 
      As above, we again permit a common symbol in a regular object to
      override a definition in a shared object if the shared object
-     symbol is a function or is weak.  */
+     symbol is a function or is weak.
+
+     As above, we permit a non-weak definition in a shared object to
+     override a weak definition in a regular object.  */
 
   if (! newdyn
       && (newdef
@@ -544,7 +570,9 @@
 		  || h->type == STT_FUNC)))
       && olddyn
       && olddef
-      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+      && (bind != STB_WEAK
+	  || h->root.type == bfd_link_hash_defweak))
     {
       /* Change the hash table entry to undefined, and let
 	 _bfd_generic_link_add_one_symbol do the right thing with the
@@ -618,6 +646,41 @@
       h->verinfo.vertree = NULL;
     }
 
+  /* Handle the special case of a weak definition in a regular object
+     followed by a non-weak definition in a shared object.  In this
+     case, we prefer the definition in the shared object.  */
+  if (olddef
+      && h->root.type == bfd_link_hash_defweak
+      && newdef
+      && newdyn
+      && bind != STB_WEAK)
+    {
+      /* To make this work we have to frob the flags so that the rest
+         of the code does not think we are using the regular
+         definition.  */
+      h->elf_link_hash_flags &= ~ ELF_LINK_HASH_DEF_REGULAR;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+
+      /* If H is the target of an indirection, we want the caller to
+         use H rather than the indirect symbol.  Otherwise if we are
+         defining a new indirect symbol we will wind up attaching it
+         to the entry we are overriding.  */
+      *sym_hash = h;
+    }
+
+  /* Handle the special case of a non-weak definition in a shared
+     object followed by a weak definition in a regular object.  In
+     this case we prefer to definition in the shared object.  To make
+     this work we have to tell the caller to not treat the new symbol
+     as a definition.  */
+  if (olddef
+      && olddyn
+      && h->root.type != bfd_link_hash_defweak
+      && newdef
+      && ! newdyn
+      && bind == STB_WEAK)
+    *override = true;
+
   return true;
 }
 
@@ -1937,16 +2000,18 @@
       && ! _bfd_elf_link_record_dynamic_symbol (info, h))
     return false;
 
+  bed = get_elf_backend_data (abfd);
+
   s = bfd_make_section (abfd, ".hash");
   if (s == NULL
       || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
       || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
     return false;
+  elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry;
 
   /* Let the backend create the rest of the sections.  This lets the
      backend set the right flags.  The backend will normally create
      the .got and .plt sections.  */
-  bed = get_elf_backend_data (abfd);
   if (! (*bed->elf_backend_create_dynamic_sections) (abfd, info))
     return false;
 
@@ -1989,14 +2054,170 @@
 
   return true;
 }
+
+/* Record a new local dynamic symbol.  */
+
+boolean
+elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx)
+     struct bfd_link_info *info;
+     bfd *input_bfd;
+     long input_indx;
+{
+  struct elf_link_local_dynamic_entry *entry;
+  struct elf_link_hash_table *eht;
+  struct bfd_strtab_hash *dynstr;
+  Elf_External_Sym esym;
+  unsigned long dynstr_index;
+  char *name;
+
+  /* See if the entry exists already.  */
+  for (entry = elf_hash_table (info)->dynlocal; entry ; entry = entry->next)
+    if (entry->input_bfd == input_bfd && entry->input_indx == input_indx)
+      return true;
+
+  entry = (struct elf_link_local_dynamic_entry *)
+    bfd_alloc (input_bfd, sizeof (*entry));
+  if (entry == NULL)
+    return false;
+
+  /* Go find the symbol, so that we can find it's name.  */
+  if (bfd_seek (input_bfd,
+		(elf_tdata (input_bfd)->symtab_hdr.sh_offset
+		 + input_indx * sizeof (Elf_External_Sym)),
+		SEEK_SET) != 0
+      || (bfd_read (&esym, sizeof (Elf_External_Sym), 1, input_bfd)
+	  != sizeof (Elf_External_Sym)))
+    return false;
+  elf_swap_symbol_in (input_bfd, &esym, &entry->isym);
+
+  name = (bfd_elf_string_from_elf_section
+	  (input_bfd, elf_tdata (input_bfd)->symtab_hdr.sh_link,
+	   entry->isym.st_name));
+
+  dynstr = elf_hash_table (info)->dynstr;
+  if (dynstr == NULL)
+    {
+      /* Create a strtab to hold the dynamic symbol names.  */
+      elf_hash_table (info)->dynstr = dynstr = _bfd_elf_stringtab_init ();
+      if (dynstr == NULL)
+	return false;
+    }
+
+  dynstr_index = _bfd_stringtab_add (dynstr, name, true, false);
+  if (dynstr_index == (unsigned long) -1)
+    return false;
+  entry->isym.st_name = dynstr_index;
+
+  eht = elf_hash_table (info);
+
+  entry->next = eht->dynlocal;
+  eht->dynlocal = entry;
+  entry->input_bfd = input_bfd;
+  entry->input_indx = input_indx;
+  eht->dynsymcount++;
+
+  /* The dynindx will be set at the end of size_dynamic_sections.  */
+
+  return true;
+}
 
 
-/* Read and swap the relocs for a section.  They may have been cached.
-   If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are not NULL,
-   they are used as buffers to read into.  They are known to be large
-   enough.  If the INTERNAL_RELOCS relocs argument is NULL, the return
-   value is allocated using either malloc or bfd_alloc, according to
-   the KEEP_MEMORY argument.  */
+/* Read and swap the relocs from the section indicated by SHDR.  This
+   may be either a REL or a RELA section.  The relocations are
+   translated into RELA relocations and stored in INTERNAL_RELOCS,
+   which should have already been allocated to contain enough space.
+   The EXTERNAL_RELOCS are a buffer where the external form of the
+   relocations should be stored.
+
+   Returns false if something goes wrong.  */
+
+static boolean
+elf_link_read_relocs_from_section (abfd, shdr, external_relocs,
+				   internal_relocs)
+     bfd *abfd;
+     Elf_Internal_Shdr *shdr;
+     PTR external_relocs;
+     Elf_Internal_Rela *internal_relocs;
+{
+  struct elf_backend_data *bed;
+
+  /* If there aren't any relocations, that's OK.  */
+  if (!shdr)
+    return true;
+
+  /* Position ourselves at the start of the section.  */
+  if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0)
+    return false;
+
+  /* Read the relocations.  */
+  if (bfd_read (external_relocs, 1, shdr->sh_size, abfd)
+      != shdr->sh_size)
+    return false;
+
+  bed = get_elf_backend_data (abfd);
+
+  /* Convert the external relocations to the internal format.  */
+  if (shdr->sh_entsize == sizeof (Elf_External_Rel))
+    {
+      Elf_External_Rel *erel;
+      Elf_External_Rel *erelend;
+      Elf_Internal_Rela *irela;
+      Elf_Internal_Rel *irel;
+
+      erel = (Elf_External_Rel *) external_relocs;
+      erelend = erel + shdr->sh_size / shdr->sh_entsize;
+      irela = internal_relocs;
+      irel = bfd_alloc (abfd, (bed->s->int_rels_per_ext_rel
+			       * sizeof (Elf_Internal_Rel)));
+      for (; erel < erelend; erel++, irela += bed->s->int_rels_per_ext_rel)
+	{
+	  unsigned char i;
+
+	  if (bed->s->swap_reloc_in)
+	    (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, irel);
+	  else
+	    elf_swap_reloc_in (abfd, erel, irel);
+
+	  for (i = 0; i < bed->s->int_rels_per_ext_rel; ++i)
+	    {
+	      irela[i].r_offset = irel[i].r_offset;
+	      irela[i].r_info = irel[i].r_info;
+	      irela[i].r_addend = 0;
+	    }
+	}
+    }
+  else
+    {
+      Elf_External_Rela *erela;
+      Elf_External_Rela *erelaend;
+      Elf_Internal_Rela *irela;
+
+      BFD_ASSERT (shdr->sh_entsize == sizeof (Elf_External_Rela));
+
+      erela = (Elf_External_Rela *) external_relocs;
+      erelaend = erela + shdr->sh_size / shdr->sh_entsize;
+      irela = internal_relocs;
+      for (; erela < erelaend; erela++, irela += bed->s->int_rels_per_ext_rel)
+	{
+	  if (bed->s->swap_reloca_in)
+	    (*bed->s->swap_reloca_in) (abfd, (bfd_byte *) erela, irela);
+	  else
+	    elf_swap_reloca_in (abfd, erela, irela);
+	}
+    }
+
+  return true;
+}
+
+/* Read and swap the relocs for a section O.  They may have been
+   cached.  If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are
+   not NULL, they are used as buffers to read into.  They are known to
+   be large enough.  If the INTERNAL_RELOCS relocs argument is NULL,
+   the return value is allocated using either malloc or bfd_alloc,
+   according to the KEEP_MEMORY argument.  If O has two relocation
+   sections (both REL and RELA relocations), then the REL_HDR
+   relocations will appear first in INTERNAL_RELOCS, followed by the
+   REL_HDR2 relocations.  */
 
 Elf_Internal_Rela *
 NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs,
@@ -2010,6 +2231,7 @@
   Elf_Internal_Shdr *rel_hdr;
   PTR alloc1 = NULL;
   Elf_Internal_Rela *alloc2 = NULL;
+  struct elf_backend_data *bed = get_elf_backend_data (abfd);
 
   if (elf_section_data (o)->relocs != NULL)
     return elf_section_data (o)->relocs;
@@ -2023,7 +2245,8 @@
     {
       size_t size;
 
-      size = o->reloc_count * sizeof (Elf_Internal_Rela);
+      size = (o->reloc_count * bed->s->int_rels_per_ext_rel 
+	      * sizeof (Elf_Internal_Rela));
       if (keep_memory)
 	internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size);
       else
@@ -2034,53 +2257,27 @@
 
   if (external_relocs == NULL)
     {
-      alloc1 = (PTR) bfd_malloc ((size_t) rel_hdr->sh_size);
+      size_t size = (size_t) rel_hdr->sh_size;
+
+      if (elf_section_data (o)->rel_hdr2)
+	size += (size_t) elf_section_data (o)->rel_hdr2->sh_size;
+      alloc1 = (PTR) bfd_malloc (size);
       if (alloc1 == NULL)
 	goto error_return;
       external_relocs = alloc1;
     }
 
-  if ((bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0)
-      || (bfd_read (external_relocs, 1, rel_hdr->sh_size, abfd)
-	  != rel_hdr->sh_size))
+  if (!elf_link_read_relocs_from_section (abfd, rel_hdr,
+					  external_relocs,
+					  internal_relocs))
     goto error_return;
-
-  /* Swap in the relocs.  For convenience, we always produce an
-     Elf_Internal_Rela array; if the relocs are Rel, we set the addend
-     to 0.  */
-  if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
-    {
-      Elf_External_Rel *erel;
-      Elf_External_Rel *erelend;
-      Elf_Internal_Rela *irela;
-
-      erel = (Elf_External_Rel *) external_relocs;
-      erelend = erel + o->reloc_count;
-      irela = internal_relocs;
-      for (; erel < erelend; erel++, irela++)
-	{
-	  Elf_Internal_Rel irel;
-
-	  elf_swap_reloc_in (abfd, erel, &irel);
-	  irela->r_offset = irel.r_offset;
-	  irela->r_info = irel.r_info;
-	  irela->r_addend = 0;
-	}
-    }
-  else
-    {
-      Elf_External_Rela *erela;
-      Elf_External_Rela *erelaend;
-      Elf_Internal_Rela *irela;
-
-      BFD_ASSERT (rel_hdr->sh_entsize == sizeof (Elf_External_Rela));
-
-      erela = (Elf_External_Rela *) external_relocs;
-      erelaend = erela + o->reloc_count;
-      irela = internal_relocs;
-      for (; erela < erelaend; erela++, irela++)
-	elf_swap_reloca_in (abfd, erela, irela);
-    }
+  if (!elf_link_read_relocs_from_section 
+      (abfd, 
+       elf_section_data (o)->rel_hdr2,
+       ((bfd_byte *) external_relocs) + rel_hdr->sh_size,
+       internal_relocs + (rel_hdr->sh_size / rel_hdr->sh_entsize
+			  * bed->s->int_rels_per_ext_rel)))
+    goto error_return;
 
   /* Cache the results for next time, if we can.  */
   if (keep_memory)
@@ -2109,7 +2306,7 @@
 /*ARGSUSED*/
 boolean
 NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide)
-     bfd *output_bfd;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
      const char *name;
      boolean provide;
@@ -2182,8 +2379,6 @@
   struct bfd_elf_version_tree *verdefs;
   /* Whether we are exporting all dynamic symbols.  */
   boolean export_dynamic;
-  /* Whether we removed any symbols from the dynamic symbol table.  */
-  boolean removed_dynamic;
   /* Whether we had a failure.  */
   boolean failed;
 };
@@ -2228,7 +2423,7 @@
      struct bfd_link_info *info;
 {
   size_t dynsymcount = elf_hash_table (info)->dynsymcount;
-  size_t best_size;
+  size_t best_size = 0;
   unsigned long int *hashcodes;
   unsigned long int *hashcodesp;
   unsigned long int i;
@@ -2381,7 +2576,6 @@
   bfd_size_type soname_indx;
   bfd *dynobj;
   struct elf_backend_data *bed;
-  bfd_size_type old_dynsymcount;
   struct elf_assign_sym_version_info asvinfo;
 
   *sinterpptr = NULL;
@@ -2486,7 +2680,6 @@
       asvinfo.info = info;
       asvinfo.verdefs = verdefs;
       asvinfo.export_dynamic = export_dynamic;
-      asvinfo.removed_dynamic = false;
       asvinfo.failed = false;
 
       elf_link_hash_traverse (elf_hash_table (info),
@@ -2508,8 +2701,14 @@
       /* Add some entries to the .dynamic section.  We fill in some of the
 	 values later, in elf_bfd_final_link, but we must add the entries
 	 now so that we know the final size of the .dynamic section.  */
-      h =  elf_link_hash_lookup (elf_hash_table (info), "_init", false,
-				false, false);
+
+      /* If there are initialization and/or finalization functions to
+	 call then add the corresponding DT_INIT/DT_FINI entries.  */
+      h = (info->init_function
+	   ? elf_link_hash_lookup (elf_hash_table (info), 
+				   info->init_function, false,
+				   false, false)
+	   : NULL);
       if (h != NULL
 	  && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
 					| ELF_LINK_HASH_DEF_REGULAR)) != 0)
@@ -2517,8 +2716,11 @@
 	  if (! elf_add_dynamic_entry (info, DT_INIT, 0))
 	    return false;
 	}
-      h =  elf_link_hash_lookup (elf_hash_table (info), "_fini", false,
-				 false, false);
+      h = (info->fini_function
+	   ? elf_link_hash_lookup (elf_hash_table (info), 
+				   info->fini_function, false,
+				   false, false)
+	   : NULL);
       if (h != NULL
 	  && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
 					| ELF_LINK_HASH_DEF_REGULAR)) != 0)
@@ -2526,6 +2728,7 @@
 	  if (! elf_add_dynamic_entry (info, DT_FINI, 0))
 	    return false;
 	}
+
       strsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr);
       if (! elf_add_dynamic_entry (info, DT_HASH, 0)
 	  || ! elf_add_dynamic_entry (info, DT_STRTAB, 0)
@@ -2538,7 +2741,6 @@
 
   /* The backend must work out the sizes of all the other dynamic
      sections.  */
-  old_dynsymcount = elf_hash_table (info)->dynsymcount;
   if (bed->elf_backend_size_dynamic_sections
       && ! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info))
     return false;
@@ -2549,6 +2751,7 @@
       asection *s;
       size_t bucketcount = 0;
       Elf_Internal_Sym isym;
+      size_t hash_entry_size;
 
       /* Set up the version definition section.  */
       s = bfd_get_section_by_name (dynobj, ".gnu.version_d");
@@ -2559,17 +2762,7 @@
       verdefs = asvinfo.verdefs;
 
       if (verdefs == NULL)
-	{
-	  asection **spp;
-
-	  /* Don't include this section in the output file.  */
-	  for (spp = &output_bfd->sections;
-	       *spp != s->output_section;
-	       spp = &(*spp)->next)
-	    ;
-	  *spp = s->output_section->next;
-	  --output_bfd->section_count;
-	}
+	_bfd_strip_section_from_output (s);
       else
 	{
 	  unsigned int cdefs;
@@ -2579,23 +2772,6 @@
 	  Elf_Internal_Verdef def;
 	  Elf_Internal_Verdaux defaux;
 
-	  if (asvinfo.removed_dynamic)
-	    {
-	      /* Some dynamic symbols were changed to be local
-		 symbols.  In this case, we renumber all of the
-		 dynamic symbols, so that we don't have a hole.  If
-		 the backend changed dynsymcount, then assume that the
-		 new symbols are at the start.  This is the case on
-		 the MIPS.  FIXME: The names of the removed symbols
-		 will still be in the dynamic string table, wasting
-		 space.  */
-	      elf_hash_table (info)->dynsymcount =
-		1 + (elf_hash_table (info)->dynsymcount - old_dynsymcount);
-	      elf_link_hash_traverse (elf_hash_table (info),
-				      elf_link_renumber_dynsyms,
-				      (PTR) info);
-	    }
-
 	  cdefs = 0;
 	  size = 0;
 
@@ -2635,7 +2811,7 @@
 
 	  if (soname_indx != (bfd_size_type) -1)
 	    {
-	      def.vd_hash = bfd_elf_hash ((const unsigned char *) soname);
+	      def.vd_hash = bfd_elf_hash (soname);
 	      defaux.vda_name = soname_indx;
 	    }
 	  else
@@ -2644,7 +2820,7 @@
 	      bfd_size_type indx;
 
 	      name = output_bfd->filename;
-	      def.vd_hash = bfd_elf_hash ((const unsigned char *) name);
+	      def.vd_hash = bfd_elf_hash (name);
 	      indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr,
 					    name, true, false);
 	      if (indx == (bfd_size_type) -1)
@@ -2692,7 +2868,7 @@
 		def.vd_flags |= VER_FLG_WEAK;
 	      def.vd_ndx = t->vernum + 1;
 	      def.vd_cnt = cdeps + 1;
-	      def.vd_hash = bfd_elf_hash ((const unsigned char *) t->name);
+	      def.vd_hash = bfd_elf_hash (t->name);
 	      def.vd_aux = sizeof (Elf_External_Verdef);
 	      if (t->next != NULL)
 		def.vd_next = (sizeof (Elf_External_Verdef)
@@ -2762,19 +2938,7 @@
 				(PTR) &sinfo);
 
 	if (elf_tdata (output_bfd)->verref == NULL)
-	  {
-	    asection **spp;
-
-	    /* We don't have any version definitions, so we can just
-               remove the section.  */
-
-	    for (spp = &output_bfd->sections;
-		 *spp != s->output_section;
-		 spp = &(*spp)->next)
-	      ;
-	    *spp = s->output_section->next;
-	    --output_bfd->section_count;
-	  }
+	  _bfd_strip_section_from_output (s);
 	else
 	  {
 	    Elf_Internal_Verneed *t;
@@ -2840,8 +3004,7 @@
 
 		for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
 		  {
-		    a->vna_hash = bfd_elf_hash ((const unsigned char *)
-						a->vna_nodename);
+		    a->vna_hash = bfd_elf_hash (a->vna_nodename);
 		    indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr,
 					       a->vna_nodename, true, false);
 		    if (indx == (bfd_size_type) -1)
@@ -2866,7 +3029,12 @@
 	  }
       }
 
-      dynsymcount = elf_hash_table (info)->dynsymcount;
+      /* Assign dynsym indicies.  In a shared library we generate a 
+	 section symbol for each output section, which come first.
+	 Next come all of the back-end allocated local dynamic syms,
+	 followed by the rest of the global symbols.  */
+
+      dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info);
 
       /* Work out the size of the symbol version section.  */
       s = bfd_get_section_by_name (dynobj, ".gnu.version");
@@ -2874,16 +3042,10 @@
       if (dynsymcount == 0
 	  || (verdefs == NULL && elf_tdata (output_bfd)->verref == NULL))
 	{
-	  asection **spp;
-
-	  /* We don't need any symbol versions; just discard the
-             section.  */
-	  for (spp = &output_bfd->sections;
-	       *spp != s->output_section;
-	       spp = &(*spp)->next)
-	    ;
-	  *spp = s->output_section->next;
-	  --output_bfd->section_count;
+	  _bfd_strip_section_from_output (s);
+	  /* The DYNSYMCOUNT might have changed if we were going to
+	     output a dynamic symbol table entry for S.  */
+	  dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info);
 	}
       else
 	{
@@ -2925,14 +3087,16 @@
 
       s = bfd_get_section_by_name (dynobj, ".hash");
       BFD_ASSERT (s != NULL);
-      s->_raw_size = (2 + bucketcount + dynsymcount) * (ARCH_SIZE / 8);
+      hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize;
+      s->_raw_size = ((2 + bucketcount + dynsymcount) * hash_entry_size);
       s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
       if (s->contents == NULL)
 	return false;
       memset (s->contents, 0, (size_t) s->_raw_size);
 
-      put_word (output_bfd, bucketcount, s->contents);
-      put_word (output_bfd, dynsymcount, s->contents + (ARCH_SIZE / 8));
+      bfd_put (8 * hash_entry_size, output_bfd, bucketcount, s->contents);
+      bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, 
+	       s->contents + hash_entry_size);
 
       elf_hash_table (info)->bucketcount = bucketcount;
 
@@ -3365,7 +3529,6 @@
 			      && info->shared
 			      && ! sinfo->export_dynamic)
 			    {
-			      sinfo->removed_dynamic = true;
 			      h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
 			      h->elf_link_hash_flags &=~
 				ELF_LINK_HASH_NEEDS_PLT;
@@ -3481,7 +3644,6 @@
 			  && info->shared
 			  && ! sinfo->export_dynamic)
 			{
-			  sinfo->removed_dynamic = true;
 			  h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
 			  h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
 			  h->dynindx = -1;
@@ -3506,7 +3668,6 @@
 	      && info->shared
 	      && ! sinfo->export_dynamic)
 	    {
-	      sinfo->removed_dynamic = true;
 	      h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
 	      h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
 	      h->dynindx = -1;
@@ -3519,26 +3680,6 @@
 
   return true;
 }
-
-/* This function is used to renumber the dynamic symbols, if some of
-   them are removed because they are marked as local.  This is called
-   via elf_link_hash_traverse.  */
-
-static boolean
-elf_link_renumber_dynsyms (h, data)
-     struct elf_link_hash_entry *h;
-     PTR data;
-{
-  struct bfd_link_info *info = (struct bfd_link_info *) data;
-
-  if (h->dynindx != -1)
-    {
-      h->dynindx = elf_hash_table (info)->dynsymcount;
-      ++elf_hash_table (info)->dynsymcount;
-    }
-
-  return true;
-}
 
 /* Final phase of ELF linker.  */
 
@@ -3606,6 +3747,97 @@
   struct elf_final_link_info *finfo;
 };
 
+/* Compute the size of, and allocate space for, REL_HDR which is the
+   section header for a section containing relocations for O.  */
+
+static boolean
+elf_link_size_reloc_section (abfd, rel_hdr, o)
+     bfd *abfd;
+     Elf_Internal_Shdr *rel_hdr;
+     asection *o;
+{
+  register struct elf_link_hash_entry **p, **pend;
+
+  /* We are overestimating the size required for the relocation
+     sections, in the case that we are using both REL and RELA
+     relocations for a single section.  In that case, RELOC_COUNT will
+     be the total number of relocations required, and we allocate
+     space for that many REL relocations as well as that many RELA
+     relocations.  This approximation is wasteful of disk space.
+     However, until we keep track of how many of each kind of
+     relocation is required, it's difficult to calculate the right
+     value.  */
+  rel_hdr->sh_size = rel_hdr->sh_entsize * o->reloc_count;
+
+  /* The contents field must last into write_object_contents, so we
+     allocate it with bfd_alloc rather than malloc.  */
+  rel_hdr->contents = (PTR) bfd_alloc (abfd, rel_hdr->sh_size);
+  if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0)
+    return false;
+
+  p = ((struct elf_link_hash_entry **)
+       bfd_malloc (o->reloc_count
+		   * sizeof (struct elf_link_hash_entry *)));
+  if (p == NULL && o->reloc_count != 0)
+    return false;
+
+  elf_section_data (o)->rel_hashes = p;
+  pend = p + o->reloc_count;
+  for (; p < pend; p++)
+    *p = NULL;
+
+  return true;
+}
+
+/* When performing a relocateable link, the input relocations are
+   preserved.  But, if they reference global symbols, the indices
+   referenced must be updated.  Update all the relocations in
+   REL_HDR (there are COUNT of them), using the data in REL_HASH.  */
+
+static void
+elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash)
+     bfd *abfd;
+     Elf_Internal_Shdr *rel_hdr;
+     unsigned int count;
+     struct elf_link_hash_entry **rel_hash;
+{
+  unsigned int i;
+
+  for (i = 0; i < count; i++, rel_hash++)
+    {
+      if (*rel_hash == NULL)
+	continue;
+
+      BFD_ASSERT ((*rel_hash)->indx >= 0);
+
+      if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
+	{
+	  Elf_External_Rel *erel;
+	  Elf_Internal_Rel irel;
+	  
+	  erel = (Elf_External_Rel *) rel_hdr->contents + i;
+	  elf_swap_reloc_in (abfd, erel, &irel);
+	  irel.r_info = ELF_R_INFO ((*rel_hash)->indx,
+				    ELF_R_TYPE (irel.r_info));
+	  elf_swap_reloc_out (abfd, &irel, erel);
+	}
+      else
+	{
+	  Elf_External_Rela *erela;
+	  Elf_Internal_Rela irela;
+	  
+	  BFD_ASSERT (rel_hdr->sh_entsize
+		      == sizeof (Elf_External_Rela));
+	  
+	  erela = (Elf_External_Rela *) rel_hdr->contents + i;
+	  elf_swap_reloca_in (abfd, erela, &irela);
+	  irela.r_info = ELF_R_INFO ((*rel_hash)->indx,
+				     ELF_R_TYPE (irela.r_info));
+	  elf_swap_reloca_out (abfd, &irela, erela);
+	}
+    }
+}
+
 /* Do the final step of an ELF link.  */
 
 boolean
@@ -3767,32 +3999,16 @@
     {
       if ((o->flags & SEC_RELOC) != 0)
 	{
-	  Elf_Internal_Shdr *rel_hdr;
-	  register struct elf_link_hash_entry **p, **pend;
-
-	  rel_hdr = &elf_section_data (o)->rel_hdr;
-
-	  rel_hdr->sh_size = rel_hdr->sh_entsize * o->reloc_count;
-
-	  /* The contents field must last into write_object_contents,
-	     so we allocate it with bfd_alloc rather than malloc.  */
-	  rel_hdr->contents = (PTR) bfd_alloc (abfd, rel_hdr->sh_size);
-	  if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0)
+	  if (!elf_link_size_reloc_section (abfd,
+					    &elf_section_data (o)->rel_hdr,
+					    o))
 	    goto error_return;
 
-	  p = ((struct elf_link_hash_entry **)
-	       bfd_malloc (o->reloc_count
-			   * sizeof (struct elf_link_hash_entry *)));
-	  if (p == NULL && o->reloc_count != 0)
+	  if (elf_section_data (o)->rel_hdr2
+	      && !elf_link_size_reloc_section (abfd,
+					       elf_section_data (o)->rel_hdr2,
+					       o))
 	    goto error_return;
-	  elf_section_data (o)->rel_hashes = p;
-	  pend = p + o->reloc_count;
-	  for (; p < pend; p++)
-	    *p = NULL;
-
-	  /* Use the reloc_count field as an index when outputting the
-	     relocs.  */
-	  o->reloc_count = 0;
 	}
     }
 
@@ -3895,7 +4111,8 @@
   finfo.external_relocs = (PTR) bfd_malloc (max_external_reloc_size);
   finfo.internal_relocs = ((Elf_Internal_Rela *)
 			   bfd_malloc (max_internal_reloc_count
-				       * sizeof (Elf_Internal_Rela)));
+				       * sizeof (Elf_Internal_Rela)
+				       * bed->s->int_rels_per_ext_rel));
   finfo.external_syms = ((Elf_External_Sym *)
 			 bfd_malloc (max_sym_count
 				     * sizeof (Elf_External_Sym)));
@@ -3986,11 +4203,77 @@
 	return false;
     }
 
-  /* The sh_info field records the index of the first non local
-     symbol.  */
+  /* The sh_info field records the index of the first non local symbol.  */
   symtab_hdr->sh_info = bfd_get_symcount (abfd);
+
   if (dynamic)
-    elf_section_data (finfo.dynsym_sec->output_section)->this_hdr.sh_info = 1;
+    {
+      Elf_Internal_Sym sym;
+      Elf_External_Sym *dynsym =
+	(Elf_External_Sym *)finfo.dynsym_sec->contents;
+      unsigned long last_local = 0;
+
+      /* Write out the section symbols for the output sections.  */
+      if (info->shared)
+	{
+	  asection *s;
+
+	  sym.st_size = 0;
+	  sym.st_name = 0;
+	  sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
+	  sym.st_other = 0;
+
+	  for (s = abfd->sections; s != NULL; s = s->next)
+	    {
+	      int indx;
+	      indx = elf_section_data (s)->this_idx;
+	      BFD_ASSERT (indx > 0);
+	      sym.st_shndx = indx;
+	      sym.st_value = s->vma;
+
+	      elf_swap_symbol_out (abfd, &sym,
+				   dynsym + elf_section_data (s)->dynindx);
+	    }
+
+	  last_local = bfd_count_sections (abfd);
+	}
+
+      /* Write out the local dynsyms.  */
+      if (elf_hash_table (info)->dynlocal)
+	{
+	  struct elf_link_local_dynamic_entry *e;
+	  for (e = elf_hash_table (info)->dynlocal; e ; e = e->next)
+	    {
+	      asection *s;
+
+	      sym.st_size = e->isym.st_size;
+	      sym.st_other = e->isym.st_other;
+
+	      /* Note that we saved a word of storage and overwrote
+                 the original st_name with the dynstr_index.  */
+	      sym.st_name = e->isym.st_name;
+
+	      /* Whatever binding the symbol had before, it's now local.  */
+	      sym.st_info = ELF_ST_INFO (STB_LOCAL,
+					 ELF_ST_TYPE (e->isym.st_info));
+
+	      s = bfd_section_from_elf_index (e->input_bfd, e->isym.st_shndx);
+
+	      sym.st_shndx = elf_section_data (s->output_section)->this_idx;
+	      sym.st_value = (s->output_section->vma
+			      + s->output_offset
+			      + e->isym.st_value);
+
+	      if (last_local < e->dynindx)
+		last_local = e->dynindx;
+
+	      elf_swap_symbol_out (abfd, &sym, dynsym + e->dynindx);
+	    }
+	}
+
+      elf_section_data (finfo.dynsym_sec->output_section)
+	->this_hdr.sh_info = last_local;
+    }
 
   /* We get the global symbols from the hash table.  */
   eoinfo.failed = false;
@@ -4035,47 +4318,17 @@
   /* Adjust the relocs to have the correct symbol indices.  */
   for (o = abfd->sections; o != NULL; o = o->next)
     {
-      struct elf_link_hash_entry **rel_hash;
-      Elf_Internal_Shdr *rel_hdr;
-
       if ((o->flags & SEC_RELOC) == 0)
 	continue;
 
-      rel_hash = elf_section_data (o)->rel_hashes;
-      rel_hdr = &elf_section_data (o)->rel_hdr;
-      for (i = 0; i < o->reloc_count; i++, rel_hash++)
-	{
-	  if (*rel_hash == NULL)
-	    continue;
-
-	  BFD_ASSERT ((*rel_hash)->indx >= 0);
-
-	  if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
-	    {
-	      Elf_External_Rel *erel;
-	      Elf_Internal_Rel irel;
-
-	      erel = (Elf_External_Rel *) rel_hdr->contents + i;
-	      elf_swap_reloc_in (abfd, erel, &irel);
-	      irel.r_info = ELF_R_INFO ((*rel_hash)->indx,
-					ELF_R_TYPE (irel.r_info));
-	      elf_swap_reloc_out (abfd, &irel, erel);
-	    }
-	  else
-	    {
-	      Elf_External_Rela *erela;
-	      Elf_Internal_Rela irela;
-
-	      BFD_ASSERT (rel_hdr->sh_entsize
-			  == sizeof (Elf_External_Rela));
-
-	      erela = (Elf_External_Rela *) rel_hdr->contents + i;
-	      elf_swap_reloca_in (abfd, erela, &irela);
-	      irela.r_info = ELF_R_INFO ((*rel_hash)->indx,
-					 ELF_R_TYPE (irela.r_info));
-	      elf_swap_reloca_out (abfd, &irela, erela);
-	    }
-	}
+      elf_link_adjust_relocs (abfd, &elf_section_data (o)->rel_hdr, 
+			      elf_section_data (o)->rel_count,
+			      elf_section_data (o)->rel_hashes);
+      if (elf_section_data (o)->rel_hdr2 != NULL)
+	elf_link_adjust_relocs (abfd, elf_section_data (o)->rel_hdr2,
+				elf_section_data (o)->rel_count2,
+				(elf_section_data (o)->rel_hashes 
+				 + elf_section_data (o)->rel_count));
 
       /* Set the reloc_count field to 0 to prevent write_relocs from
 	 trying to swap the relocs out itself.  */
@@ -4106,15 +4359,11 @@
 	    {
 	    default:
 	      break;
-
-	      /* SVR4 linkers seem to set DT_INIT and DT_FINI based on
-                 magic _init and _fini symbols.  This is pretty ugly,
-                 but we are compatible.  */
 	    case DT_INIT:
-	      name = "_init";
+	      name = info->init_function;
 	      goto get_sym;
 	    case DT_FINI:
-	      name = "_fini";
+	      name = info->fini_function;
 	    get_sym:
 	      {
 		struct elf_link_hash_entry *h;
@@ -4423,7 +4672,6 @@
      warnings for them.  */
   if (! finfo->info->relocateable
       && ! (finfo->info->shared
-	    && !finfo->info->symbolic
 	    && !finfo->info->no_undefined)
       && h->root.type == bfd_link_hash_undefined
       && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
@@ -4594,6 +4842,7 @@
     {
       size_t bucketcount;
       size_t bucket;
+      size_t hash_entry_size;
       bfd_byte *bucketpos;
       bfd_vma chain;
 
@@ -4606,13 +4855,15 @@
 
       bucketcount = elf_hash_table (finfo->info)->bucketcount;
       bucket = h->elf_hash_value % bucketcount;
+      hash_entry_size 
+	= elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize;
       bucketpos = ((bfd_byte *) finfo->hash_sec->contents
-		   + (bucket + 2) * (ARCH_SIZE / 8));
-      chain = get_word (finfo->output_bfd, bucketpos);
-      put_word (finfo->output_bfd, h->dynindx, bucketpos);
-      put_word (finfo->output_bfd, chain,
-		((bfd_byte *) finfo->hash_sec->contents
-		 + (bucketcount + 2 + h->dynindx) * (ARCH_SIZE / 8)));
+		   + (bucket + 2) * hash_entry_size);
+      chain = bfd_get (8 * hash_entry_size, finfo->output_bfd, bucketpos);
+      bfd_put (8 * hash_entry_size, finfo->output_bfd, h->dynindx, bucketpos);
+      bfd_put (8 * hash_entry_size, finfo->output_bfd, chain,
+	       ((bfd_byte *) finfo->hash_sec->contents
+		+ (bucketcount + 2 + h->dynindx) * hash_entry_size));
 
       if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL)
 	{
@@ -4659,6 +4910,76 @@
   return true;
 }
 
+/* Copy the relocations indicated by the INTERNAL_RELOCS (which
+   originated from the section given by INPUT_REL_HDR) to the
+   OUTPUT_BFD.  */
+
+static void
+elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, 
+			internal_relocs)
+     bfd *output_bfd;
+     asection *input_section;
+     Elf_Internal_Shdr *input_rel_hdr;
+     Elf_Internal_Rela *internal_relocs;
+{
+  Elf_Internal_Rela *irela;
+  Elf_Internal_Rela *irelaend;
+  Elf_Internal_Shdr *output_rel_hdr;
+  asection *output_section;
+  unsigned int *rel_countp = NULL;
+
+  output_section = input_section->output_section;
+  output_rel_hdr = NULL;
+
+  if (elf_section_data (output_section)->rel_hdr.sh_entsize 
+      == input_rel_hdr->sh_entsize)
+    {
+      output_rel_hdr = &elf_section_data (output_section)->rel_hdr;
+      rel_countp = &elf_section_data (output_section)->rel_count;
+    }
+  else if (elf_section_data (output_section)->rel_hdr2
+	   && (elf_section_data (output_section)->rel_hdr2->sh_entsize
+	       == input_rel_hdr->sh_entsize))
+    {
+      output_rel_hdr = elf_section_data (output_section)->rel_hdr2;
+      rel_countp = &elf_section_data (output_section)->rel_count2;
+    }
+
+  BFD_ASSERT (output_rel_hdr != NULL);
+  
+  irela = internal_relocs;
+  irelaend = irela + input_rel_hdr->sh_size / input_rel_hdr->sh_entsize;
+  if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
+    {
+      Elf_External_Rel *erel;
+
+      erel = ((Elf_External_Rel *) output_rel_hdr->contents + *rel_countp);
+      for (; irela < irelaend; irela++, erel++)
+	{
+	  Elf_Internal_Rel irel;
+
+	  irel.r_offset = irela->r_offset;
+	  irel.r_info = irela->r_info;
+	  BFD_ASSERT (irela->r_addend == 0);
+	  elf_swap_reloc_out (output_bfd, &irel, erel);
+	}
+    }
+  else
+    {
+      Elf_External_Rela *erela;
+
+      BFD_ASSERT (input_rel_hdr->sh_entsize
+		  == sizeof (Elf_External_Rela));
+      erela = ((Elf_External_Rela *) output_rel_hdr->contents + *rel_countp);
+      for (; irela < irelaend; irela++, erela++)
+	elf_swap_reloca_out (output_bfd, irela, erela);
+    }
+
+  /* Bump the counter, so that we know where to add the next set of
+     relocations.  */
+  *rel_countp += input_rel_hdr->sh_size / input_rel_hdr->sh_entsize;
+}
+
 /* Link an input file into the linker output file.  This function
    handles all the sections and relocations of the input file at once.
    This is so that we only have to read the local symbols once, and
@@ -4684,10 +5005,11 @@
   long *pindex;
   asection **ppsection;
   asection *o;
+  struct elf_backend_data *bed;
 
   output_bfd = finfo->output_bfd;
-  relocate_section =
-    get_elf_backend_data (output_bfd)->elf_backend_relocate_section;
+  bed = get_elf_backend_data (output_bfd);
+  relocate_section = bed->elf_backend_relocate_section;
 
   /* If this is a dynamic object, we don't want to do anything here:
      we don't want the local symbols, and we don't want the section
@@ -4920,14 +5242,15 @@
 	      Elf_Internal_Rela *irelaend;
 	      struct elf_link_hash_entry **rel_hash;
 	      Elf_Internal_Shdr *input_rel_hdr;
-	      Elf_Internal_Shdr *output_rel_hdr;
 
 	      /* Adjust the reloc addresses and symbol indices.  */
 
 	      irela = internal_relocs;
-	      irelaend = irela + o->reloc_count;
+	      irelaend = 
+		irela + o->reloc_count * bed->s->int_rels_per_ext_rel;
 	      rel_hash = (elf_section_data (o->output_section)->rel_hashes
-			  + o->output_section->reloc_count);
+			  + elf_section_data (o->output_section)->rel_count
+			  + elf_section_data (o->output_section)->rel_count2);
 	      for (; irela < irelaend; irela++, rel_hash++)
 		{
 		  unsigned long r_symndx;
@@ -5051,40 +5374,16 @@
 
 	      /* Swap out the relocs.  */
 	      input_rel_hdr = &elf_section_data (o)->rel_hdr;
-	      output_rel_hdr = &elf_section_data (o->output_section)->rel_hdr;
-	      BFD_ASSERT (output_rel_hdr->sh_entsize
-			  == input_rel_hdr->sh_entsize);
-	      irela = internal_relocs;
-	      irelaend = irela + o->reloc_count;
-	      if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
-		{
-		  Elf_External_Rel *erel;
-
-		  erel = ((Elf_External_Rel *) output_rel_hdr->contents
-			  + o->output_section->reloc_count);
-		  for (; irela < irelaend; irela++, erel++)
-		    {
-		      Elf_Internal_Rel irel;
-
-		      irel.r_offset = irela->r_offset;
-		      irel.r_info = irela->r_info;
-		      BFD_ASSERT (irela->r_addend == 0);
-		      elf_swap_reloc_out (output_bfd, &irel, erel);
-		    }
-		}
-	      else
-		{
-		  Elf_External_Rela *erela;
-
-		  BFD_ASSERT (input_rel_hdr->sh_entsize
-			      == sizeof (Elf_External_Rela));
-		  erela = ((Elf_External_Rela *) output_rel_hdr->contents
-			   + o->output_section->reloc_count);
-		  for (; irela < irelaend; irela++, erela++)
-		    elf_swap_reloca_out (output_bfd, irela, erela);
-		}
-
-	      o->output_section->reloc_count += o->reloc_count;
+	      elf_link_output_relocs (output_bfd, o, 
+				      input_rel_hdr,
+				      internal_relocs);
+	      internal_relocs 
+		+= input_rel_hdr->sh_size / input_rel_hdr->sh_entsize;
+	      input_rel_hdr = elf_section_data (o)->rel_hdr2;
+	      if (input_rel_hdr)
+		elf_link_output_relocs (output_bfd, o, 
+					input_rel_hdr,
+					internal_relocs);
 	    }
 	}
 
@@ -5141,7 +5440,8 @@
 
   /* Figure out the symbol index.  */
   rel_hash_ptr = (elf_section_data (output_section)->rel_hashes
-		  + output_section->reloc_count);
+		  + elf_section_data (output_section)->rel_count
+		  + elf_section_data (output_section)->rel_count2);
   if (link_order->type == bfd_section_reloc_link_order)
     {
       indx = link_order->u.reloc.p->u.section->target_index;
@@ -5250,7 +5550,7 @@
       irel.r_offset = offset;
       irel.r_info = ELF_R_INFO (indx, howto->type);
       erel = ((Elf_External_Rel *) rel_hdr->contents
-	      + output_section->reloc_count);
+	      + elf_section_data (output_section)->rel_count);
       elf_swap_reloc_out (output_bfd, &irel, erel);
     }
   else
@@ -5262,11 +5562,11 @@
       irela.r_info = ELF_R_INFO (indx, howto->type);
       irela.r_addend = addend;
       erela = ((Elf_External_Rela *) rel_hdr->contents
-	       + output_section->reloc_count);
+	       + elf_section_data (output_section)->rel_count);
       elf_swap_reloca_out (output_bfd, &irela, erela);
     }
 
-  ++output_section->reloc_count;
+  ++elf_section_data (output_section)->rel_count;
 
   return true;
 }
@@ -5486,8 +5786,8 @@
 	      elf_swap_reloca_out (output_bfd, &outrel,
 				   (((Elf_External_Rela *)
 				     lsect->section->contents)
-				    + lsect->section->reloc_count));
-	      ++lsect->section->reloc_count;
+				    + elf_section_data (lsect->section)->rel_count));
+	      ++elf_section_data (lsect->section)->rel_count;
 	    }
 	}
     }
@@ -5559,6 +5859,7 @@
       size_t extsymoff;
       Elf_External_Sym *locsyms, *freesyms = NULL;
       bfd *input_bfd = sec->owner;
+      struct elf_backend_data *bed = get_elf_backend_data (input_bfd);
 
       /* GCFIXME: how to arrange so that relocs and symbols are not
 	 reread continually?  */
@@ -5602,7 +5903,7 @@
 	  ret = false;
 	  goto out1;
 	}
-      relend = relstart + sec->reloc_count;
+      relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel;
 
       for (rel = relstart; rel < relend; rel++)
 	{
@@ -5808,6 +6109,7 @@
   asection *sec;
   bfd_vma hstart, hend;
   Elf_Internal_Rela *relstart, *relend, *rel;
+  struct elf_backend_data *bed;
 
   /* Take care of both those symbols that do not describe vtables as
      well as those that are not loaded.  */
@@ -5825,7 +6127,8 @@
 	      (sec->owner, sec, NULL, (Elf_Internal_Rela *) NULL, true));
   if (!relstart)
     return *(boolean *)okp = false;
-  relend = relstart + sec->reloc_count;
+  bed = get_elf_backend_data (sec->owner);
+  relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel;
 
   for (rel = relstart; rel < relend; ++rel)
     if (rel->r_offset >= hstart && rel->r_offset < hend)
@@ -5959,8 +6262,8 @@
 
 boolean
 elf_gc_record_vtentry (abfd, sec, h, addend)
-     bfd *abfd;
-     asection *sec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
      struct elf_link_hash_entry *h;
      bfd_vma addend;
 {
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 9acabd1..d40a870 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -80,6 +80,9 @@
 #ifndef elf_backend_plt_alignment
 #define elf_backend_plt_alignment 2
 #endif
+#ifndef elf_backend_want_dynbss
+#define elf_backend_want_dynbss 1
+#endif
 
 #define bfd_elfNN_bfd_debug_info_start	bfd_void
 #define bfd_elfNN_bfd_debug_info_end	bfd_void
@@ -202,6 +205,7 @@
 #endif
 
 #ifndef ELF_MAXPAGESIZE
+  #error ELF_MAXPAGESIZE is not defined
 #define ELF_MAXPAGESIZE 1
 #endif
 
@@ -290,6 +294,31 @@
 #ifndef elf_backend_plt_header_size
 #define elf_backend_plt_header_size	0
 #endif
+#ifndef elf_backend_post_process_headers
+#define elf_backend_post_process_headers	NULL
+#endif
+
+/* Previously, backends could only use SHT_REL or SHT_RELA relocation
+   sections, but not both.  They defined USE_REL to indicate SHT_REL
+   sections, and left it undefined to indicated SHT_RELA sections.
+   For backwards compatibility, we still support this usage.  */
+#ifndef USE_REL
+#define USE_REL 0
+#else
+#undef USE_REL
+#define USE_REL 1
+#endif 
+
+/* Use these in new code.  */
+#ifndef elf_backend_may_use_rel_p 
+#define elf_backend_may_use_rel_p USE_REL
+#endif 
+#ifndef elf_backend_may_use_rela_p
+#define elf_backend_may_use_rela_p !USE_REL
+#endif
+#ifndef elf_backend_default_use_rela_p 
+#define elf_backend_default_use_rela_p !USE_REL
+#endif
 
 #ifndef ELF_MACHINE_ALT1
 #define ELF_MACHINE_ALT1 0
@@ -307,11 +336,6 @@
 
 static CONST struct elf_backend_data elfNN_bed =
 {
-#ifdef USE_REL
-  0,				/* use_rela_p */
-#else
-  1,				/* use_rela_p */
-#endif
   ELF_ARCH,			/* arch */
   ELF_MACHINE_CODE,		/* elf_machine_code */
   ELF_MAXPAGESIZE,		/* maxpagesize */
@@ -344,6 +368,7 @@
   elf_backend_modify_segment_map,
   elf_backend_gc_mark_hook,
   elf_backend_gc_sweep_hook,
+  elf_backend_post_process_headers,
   elf_backend_ecoff_debug_swap,
   ELF_MACHINE_ALT1,
   ELF_MACHINE_ALT2,
@@ -351,14 +376,23 @@
   elf_backend_got_symbol_offset,
   elf_backend_got_header_size,
   elf_backend_plt_header_size,
+  elf_backend_may_use_rel_p,
+  elf_backend_may_use_rela_p,
+  elf_backend_default_use_rela_p,
   elf_backend_want_got_plt,
   elf_backend_plt_readonly,
   elf_backend_want_plt_sym,
   elf_backend_plt_not_loaded,
   elf_backend_plt_alignment,
-  elf_backend_can_gc_sections
+  elf_backend_can_gc_sections,
+  elf_backend_want_dynbss
 };
 
+/* Forward declaration for use when initialising alternative_target field.  */
+#ifdef TARGET_LITTLE_SYM
+extern const bfd_target TARGET_LITTLE_SYM;
+#endif
+
 #ifdef TARGET_BIG_SYM
 const bfd_target TARGET_BIG_SYM =
 {
@@ -442,8 +476,15 @@
       BFD_JUMP_TABLE_LINK (bfd_elfNN),
       BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN),
 
+  /* Alternative endian target.  */
+#ifdef TARGET_LITTLE_SYM
+  & TARGET_LITTLE_SYM,
+#else
+  NULL,
+#endif
+
   /* backend_data: */
-  (PTR) &elfNN_bed,
+  (PTR) &elfNN_bed
 };
 #endif
 
@@ -530,7 +571,14 @@
       BFD_JUMP_TABLE_LINK (bfd_elfNN),
       BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN),
 
+  /* Alternative endian target.  */
+#ifdef TARGET_BIG_SYM
+  & TARGET_BIG_SYM,
+#else
+  NULL,
+#endif
+  
   /* backend_data: */
-  (PTR) &elfNN_bed,
+  (PTR) &elfNN_bed
 };
 #endif
diff --git a/bfd/epoc-pe-arm.c b/bfd/epoc-pe-arm.c
index ea89a0b..48a277a 100644
--- a/bfd/epoc-pe-arm.c
+++ b/bfd/epoc-pe-arm.c
@@ -25,6 +25,12 @@
 #define TARGET_BIG_SYM       arm_epoc_pe_big_vec
 #define TARGET_BIG_NAME      "epoc-pe-arm-big"
 
+#define bfd_arm_allocate_interworking_sections \
+	bfd_arm_epoc_pe_allocate_interworking_sections
+#define bfd_arm_get_bfd_for_interworking \
+	bfd_arm_epoc_pe_get_bfd_for_interworking
+#define bfd_arm_process_before_allocation \
+	bfd_arm_epoc_pe_process_before_allocation
 
 #include "pe-arm.c"
 
diff --git a/bfd/hash.c b/bfd/hash.c
index 4c6e987..173eaf7 100644
--- a/bfd/hash.c
+++ b/bfd/hash.c
@@ -1,5 +1,5 @@
 /* hash.c -- hash table routines for BFD
-   Copyright (C) 1993, 94, 95, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 97, 1999 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -73,7 +73,7 @@
 	The function <<bfd_hash_table_init>> take as an argument a
 	function to use to create new entries.  For a basic hash
 	table, use the function <<bfd_hash_newfunc>>.  @xref{Deriving
-	a New Hash Table Type} for why you would want to use a
+	a New Hash Table Type}, for why you would want to use a
 	different value for this argument.
 
 @findex bfd_hash_allocate
@@ -450,7 +450,7 @@
 bfd_hash_newfunc (entry, table, string)
      struct bfd_hash_entry *entry;
      struct bfd_hash_table *table;
-     const char *string;
+     const char *string ATTRIBUTE_UNUSED;
 {
   if (entry == (struct bfd_hash_entry *) NULL)
     entry = ((struct bfd_hash_entry *)
diff --git a/bfd/hosts/alphalinux.h b/bfd/hosts/alphalinux.h
index d9ba1b7..09b8d69 100644
--- a/bfd/hosts/alphalinux.h
+++ b/bfd/hosts/alphalinux.h
@@ -1,6 +1,6 @@
 /* Linux dumps "struct task_struct" at the end of the core-file.  This
-   structure is currently 920 bytes long, but we allow up to 1024
+   structure is currently 1080 bytes long, but we allow up to 4096
    bytes to allow for some future growth.  */
-#define TRAD_CORE_EXTRA_SIZE_ALLOWED		1024
+#define TRAD_CORE_EXTRA_SIZE_ALLOWED		4096
 #define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(abfd) \
   ((abfd)->tdata.trad_core_data->u.signal)
diff --git a/bfd/hp300hpux.c b/bfd/hp300hpux.c
index 9552318..0772d4f 100644
--- a/bfd/hp300hpux.c
+++ b/bfd/hp300hpux.c
@@ -1,5 +1,5 @@
 /* BFD backend for hp-ux 9000/300
-   Copyright (C) 1990, 1991, 1994, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1990, 91, 94, 95, 97, 1999 Free Software Foundation, Inc.
    Written by Glenn Engel.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -336,9 +336,9 @@
 
 static void
 convert_sym_type (sym_pointer, cache_ptr, abfd)
-     struct external_nlist *sym_pointer;
+     struct external_nlist *sym_pointer ATTRIBUTE_UNUSED;
      aout_symbol_type *cache_ptr;
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
   int name_type;
   int new_type;
@@ -626,7 +626,7 @@
      struct hp300hpux_reloc *bytes;
      arelent *cache_ptr;
      asymbol **symbols;
-     bfd_size_type symcount;
+     bfd_size_type symcount ATTRIBUTE_UNUSED;
 {
   int r_index;
   int r_extern = 0;
diff --git a/bfd/hppabsd-core.c b/bfd/hppabsd-core.c
index a7c22f5..0a3e6b2 100644
--- a/bfd/hppabsd-core.c
+++ b/bfd/hppabsd-core.c
@@ -298,6 +298,8 @@
        BFD_JUMP_TABLE_LINK (_bfd_nolink),
        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+    NULL,
+    
     (PTR) 0			/* backend_data */
 };
 #endif
diff --git a/bfd/hpux-core.c b/bfd/hpux-core.c
index 6be709f..bfaa2c2 100644
--- a/bfd/hpux-core.c
+++ b/bfd/hpux-core.c
@@ -400,5 +400,7 @@
        BFD_JUMP_TABLE_LINK (_bfd_nolink),
        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+    NULL,
+    
     (PTR) 0			/* backend_data */
 };
diff --git a/bfd/i386linux.c b/bfd/i386linux.c
index 804bdcd..5df2a11 100644
--- a/bfd/i386linux.c
+++ b/bfd/i386linux.c
@@ -1,5 +1,6 @@
 /* BFD back-end for linux flavored i386 a.out binaries.
-   Copyright (C) 1992, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -297,7 +298,7 @@
 static boolean
 linux_link_create_dynamic_sections (abfd, info)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
 {
   flagword flags;
   register asection *s;
diff --git a/bfd/i386lynx.c b/bfd/i386lynx.c
index 1f0344e..a999dd0 100644
--- a/bfd/i386lynx.c
+++ b/bfd/i386lynx.c
@@ -1,5 +1,6 @@
 /* BFD back-end for i386 a.out binaries under LynxOS.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1999
+   Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -324,7 +325,7 @@
      struct reloc_ext_external *bytes;
      arelent *cache_ptr;
      asymbol **symbols;
-     bfd_size_type symcount;
+     bfd_size_type symcount ATTRIBUTE_UNUSED;
 {
   int r_index;
   int r_extern;
@@ -348,7 +349,7 @@
      struct reloc_std_external *bytes;
      arelent *cache_ptr;
      asymbol **symbols;
-     bfd_size_type symcount;
+     bfd_size_type symcount ATTRIBUTE_UNUSED;
 {
   int r_index;
   int r_extern;
diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c
index c6f24b2..c9ec864 100644
--- a/bfd/i386msdos.c
+++ b/bfd/i386msdos.c
@@ -1,5 +1,6 @@
 /* BFD back-end for MS-DOS executables.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Bryan Ford of the University of Utah.
 
    Contributed by the Center for Software Science at the
@@ -58,8 +59,8 @@
 
 static int
 msdos_sizeof_headers (abfd, exec)
-     bfd *abfd;
-     boolean exec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean exec ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -238,6 +239,8 @@
   BFD_JUMP_TABLE_LINK (msdos),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0
 };
 
diff --git a/bfd/i386os9k.c b/bfd/i386os9k.c
index 2a01f5b..0aadee5 100644
--- a/bfd/i386os9k.c
+++ b/bfd/i386os9k.c
@@ -1,5 +1,5 @@
 /* BFD back-end for os9000 i386 binaries.
-   Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 98, 1999 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -305,8 +305,8 @@
 
 static int
 os9k_sizeof_headers (ignore_abfd, ignore)
-     bfd *ignore_abfd;
-     boolean ignore;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
+     boolean ignore ATTRIBUTE_UNUSED;
 {
   return sizeof (struct internal_exec);
 }
@@ -367,5 +367,7 @@
      BFD_JUMP_TABLE_LINK (os9k),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0,
 };
diff --git a/bfd/ieee.c b/bfd/ieee.c
index 126b136..aebc064 100644
--- a/bfd/ieee.c
+++ b/bfd/ieee.c
@@ -1,5 +1,5 @@
 /* BFD back-end for ieee-695 objects.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    Written by Steve Chamberlain of Cygnus Support.
@@ -685,7 +685,7 @@
 	    max_index,
 	    this_type
 )
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      ieee_data_type *ieee;
      ieee_symbol_type *last_symbol;
      unsigned int *symbol_count;
@@ -1010,7 +1010,7 @@
   static bfd dummy_bfd;
   static asymbol empty_symbol =
   /* the_bfd, name, value, attr, section */
-  {&dummy_bfd, " ieee empty", (symvalue) 0, BSF_DEBUGGING, bfd_abs_section_ptr};
+  {&dummy_bfd, " ieee empty", (symvalue) 0, BSF_DEBUGGING, bfd_abs_section_ptr, { 0 }};
 
   if (abfd->symcount)
     {
@@ -1652,7 +1652,7 @@
 
 void
 ieee_get_symbol_info (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -1665,7 +1665,7 @@
 
 void
 ieee_print_symbol (ignore_abfd, afile, symbol, how)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      PTR afile;
      asymbol *symbol;
      bfd_print_symbol_type how;
@@ -3163,7 +3163,7 @@
 
 static void
 relocate_debug (output, input)
-     bfd *output;
+     bfd *output ATTRIBUTE_UNUSED;
      bfd *input;
 {
 #define IBS 400
@@ -3762,13 +3762,13 @@
 			filename_ptr,
 			functionname_ptr,
 			line_ptr)
-     bfd *abfd;
-     asection *section;
-     asymbol **symbols;
-     bfd_vma offset;
-     const char **filename_ptr;
-     const char **functionname_ptr;
-     unsigned int *line_ptr;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
+     asymbol **symbols ATTRIBUTE_UNUSED;
+     bfd_vma offset ATTRIBUTE_UNUSED;
+     const char **filename_ptr ATTRIBUTE_UNUSED;
+     const char **functionname_ptr ATTRIBUTE_UNUSED;
+     unsigned int *line_ptr ATTRIBUTE_UNUSED;
 {
   return false;
 }
@@ -3807,8 +3807,8 @@
 
 static int
 ieee_sizeof_headers (abfd, x)
-     bfd *abfd;
-     boolean x;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean x ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -3966,5 +3966,7 @@
   BFD_JUMP_TABLE_LINK (ieee),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0
 };
diff --git a/bfd/ihex.c b/bfd/ihex.c
index b9953d3..17740d8 100644
--- a/bfd/ihex.c
+++ b/bfd/ihex.c
@@ -1,5 +1,5 @@
 /* BFD back-end for Intel Hex objects.
-   Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -947,8 +947,8 @@
 /*ARGSUSED*/
 static int
 ihex_sizeof_headers (abfd, exec)
-     bfd *abfd;
-     boolean exec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean exec ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -1037,5 +1037,7 @@
   BFD_JUMP_TABLE_LINK (ihex),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0
 };
diff --git a/bfd/irix-core.c b/bfd/irix-core.c
index 964ca20..006e6a7 100644
--- a/bfd/irix-core.c
+++ b/bfd/irix-core.c
@@ -270,6 +270,8 @@
        BFD_JUMP_TABLE_LINK (_bfd_nolink),
        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+    NULL,
+    
     (PTR) 0			/* backend_data */
 };
 
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index cb4a4df..f2ac823 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -1,6 +1,7 @@
 /* libbfd.h -- Declarations used by bfd library *implementation*.
    (This include file is not for users of the library.)
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 ** NOTE: libbfd.h is a GENERATED file.  Don't change it; instead,
@@ -364,7 +365,7 @@
 /* Find the nearest line using DWARF 2 debugging information.  */
 extern boolean _bfd_dwarf2_find_nearest_line
   PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
-	   const char **, unsigned int *));
+	   const char **, unsigned int *, unsigned int));
 
 /* A routine to create entries for a bfd_link_hash_table.  */
 extern struct bfd_hash_entry *_bfd_link_hash_newfunc
@@ -478,6 +479,9 @@
 
 /* Write out a string table.  */
 extern boolean _bfd_stringtab_emit PARAMS ((bfd *, struct bfd_strtab_hash *));
+
+/* Check that endianness of input and output file match.  */
+extern boolean _bfd_generic_verify_endian_match PARAMS ((bfd *, bfd *));
 
 /* Macros to tell if bfds are read or write enabled.
 
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index 8abd1f5..d2baa5b 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -1,5 +1,5 @@
 /* Assorted BFD support routines, only used internally.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -45,7 +45,7 @@
 /*ARGSUSED*/
 boolean
 bfd_false (ignore)
-     bfd *ignore;
+     bfd *ignore ATTRIBUTE_UNUSED;
 {
   bfd_set_error (bfd_error_invalid_operation);
   return false;
@@ -57,7 +57,7 @@
 /*ARGSUSED*/
 boolean
 bfd_true (ignore)
-     bfd *ignore;
+     bfd *ignore ATTRIBUTE_UNUSED;
 {
   return true;
 }
@@ -68,7 +68,7 @@
 /*ARGSUSED*/
 PTR
 bfd_nullvoidptr (ignore)
-     bfd *ignore;
+     bfd *ignore ATTRIBUTE_UNUSED;
 {
   bfd_set_error (bfd_error_invalid_operation);
   return NULL;
@@ -77,7 +77,7 @@
 /*ARGSUSED*/
 int 
 bfd_0 (ignore)
-     bfd *ignore;
+     bfd *ignore ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -85,7 +85,7 @@
 /*ARGSUSED*/
 unsigned int 
 bfd_0u (ignore)
-     bfd *ignore;
+     bfd *ignore ATTRIBUTE_UNUSED;
 {
    return 0;
 }
@@ -93,7 +93,7 @@
 /*ARGUSED*/
 long
 bfd_0l (ignore)
-     bfd *ignore;
+     bfd *ignore ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -104,7 +104,7 @@
 /*ARGSUSED*/
 long
 _bfd_n1 (ignore_abfd)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
 {
   bfd_set_error (bfd_error_invalid_operation);
   return -1;
@@ -113,15 +113,15 @@
 /*ARGSUSED*/
 void 
 bfd_void (ignore)
-     bfd *ignore;
+     bfd *ignore ATTRIBUTE_UNUSED;
 {
 }
 
 /*ARGSUSED*/
 boolean
 _bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd)
-     bfd *ignore_core_bfd;
-     bfd *ignore_exec_bfd;
+     bfd *ignore_core_bfd ATTRIBUTE_UNUSED;
+     bfd *ignore_exec_bfd ATTRIBUTE_UNUSED;
 {
   bfd_set_error (bfd_error_invalid_operation);
   return false;
@@ -133,7 +133,7 @@
 /*ARGSUSED*/
 char *
 _bfd_nocore_core_file_failing_command (ignore_abfd)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
 {
   bfd_set_error (bfd_error_invalid_operation);
   return (char *)NULL;
@@ -145,7 +145,7 @@
 /*ARGSUSED*/
 int
 _bfd_nocore_core_file_failing_signal (ignore_abfd)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
 {
   bfd_set_error (bfd_error_invalid_operation);
   return 0;
@@ -154,7 +154,7 @@
 /*ARGSUSED*/
 const bfd_target *
 _bfd_dummy_target (ignore_abfd)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
 {
   bfd_set_error (bfd_error_wrong_format);
   return 0;
@@ -792,7 +792,7 @@
 .{* Byte swapping macros for user section data.  *}
 .
 .#define bfd_put_8(abfd, val, ptr) \
-.                (*((unsigned char *)(ptr)) = (unsigned char)(val))
+.                ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val)))
 .#define bfd_put_signed_8 \
 .		bfd_put_8
 .#define bfd_get_8(abfd, ptr) \
@@ -827,6 +827,20 @@
 .#define bfd_get_signed_64(abfd, ptr) \
 .		 BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
 .
+.#define bfd_get(bits, abfd, ptr)				\
+.                ((bits) == 8 ? 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))
+.
 */ 
 
 /*
@@ -989,7 +1003,7 @@
 
 bfd_vma
 bfd_getb64 (addr)
-     register const bfd_byte *addr;
+     register const bfd_byte *addr ATTRIBUTE_UNUSED;
 {
 #ifdef BFD64
   bfd_vma low, high;
@@ -1013,7 +1027,7 @@
 
 bfd_vma
 bfd_getl64 (addr)
-     register const bfd_byte *addr;
+     register const bfd_byte *addr ATTRIBUTE_UNUSED;
 {
 #ifdef BFD64
   bfd_vma low, high;
@@ -1037,7 +1051,7 @@
 
 bfd_signed_vma
 bfd_getb_signed_64 (addr)
-     register const bfd_byte *addr;
+     register const bfd_byte *addr ATTRIBUTE_UNUSED;
 {
 #ifdef BFD64
   bfd_vma low, high;
@@ -1061,7 +1075,7 @@
 
 bfd_signed_vma
 bfd_getl_signed_64 (addr)
-     register const bfd_byte *addr;
+     register const bfd_byte *addr ATTRIBUTE_UNUSED;
 {
 #ifdef BFD64
   bfd_vma low, high;
@@ -1106,8 +1120,8 @@
 
 void
 bfd_putb64 (data, addr)
-     bfd_vma data;
-     register bfd_byte *addr;
+     bfd_vma data ATTRIBUTE_UNUSED;
+     register bfd_byte *addr ATTRIBUTE_UNUSED;
 {
 #ifdef BFD64
   addr[0] = (bfd_byte)(data >> (7*8));
@@ -1125,8 +1139,8 @@
 
 void
 bfd_putl64 (data, addr)
-     bfd_vma data;
-     register bfd_byte *addr;
+     bfd_vma data ATTRIBUTE_UNUSED;
+     register bfd_byte *addr ATTRIBUTE_UNUSED;
 {
 #ifdef BFD64
   addr[7] = (bfd_byte)(data >> (7*8));
@@ -1163,11 +1177,11 @@
 
 boolean
 _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count)
-     bfd *abfd;
-     sec_ptr section;
-     bfd_window *w;
-     file_ptr offset;
-     bfd_size_type count;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     sec_ptr section ATTRIBUTE_UNUSED;
+     bfd_window *w ATTRIBUTE_UNUSED;
+     file_ptr offset ATTRIBUTE_UNUSED;
+     bfd_size_type count ATTRIBUTE_UNUSED;
 {
 #ifdef USE_MMAP
   if (count == 0)
@@ -1261,3 +1275,26 @@
   return (name[0] == locals_prefix);
 }
 
+/*  Can be used from / for bfd_merge_private_bfd_data to check that
+    endianness matches between input and output file.  Returns
+    true for a match, otherwise returns false and emits an error.  */
+boolean
+_bfd_generic_verify_endian_match (ibfd, obfd)
+     bfd *ibfd;
+     bfd *obfd;
+{
+  if (ibfd->xvec->byteorder != obfd->xvec->byteorder
+      && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
+    {
+      (*_bfd_error_handler)
+	("%s: compiled for a %s endian system and target is %s endian",
+	 bfd_get_filename (ibfd),
+	 bfd_big_endian (ibfd) ? "big" : "little",
+	 bfd_big_endian (obfd) ? "big" : "little");
+
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
+
+  return true;
+}
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index f804bde..5fc3f38 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -1,6 +1,7 @@
 /* libbfd.h -- Declarations used by bfd library *implementation*.
    (This include file is not for users of the library.)
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 ** NOTE: libbfd.h is a GENERATED file.  Don't change it; instead,
@@ -364,7 +365,7 @@
 /* Find the nearest line using DWARF 2 debugging information.  */
 extern boolean _bfd_dwarf2_find_nearest_line
   PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
-	   const char **, unsigned int *));
+	   const char **, unsigned int *, unsigned int));
 
 /* A routine to create entries for a bfd_link_hash_table.  */
 extern struct bfd_hash_entry *_bfd_link_hash_newfunc
@@ -478,6 +479,9 @@
 
 /* Write out a string table.  */
 extern boolean _bfd_stringtab_emit PARAMS ((bfd *, struct bfd_strtab_hash *));
+
+/* Check that endianness of input and output file match.  */
+extern boolean _bfd_generic_verify_endian_match PARAMS ((bfd *, bfd *));
 
 /* Macros to tell if bfds are read or write enabled.
 
@@ -679,6 +683,10 @@
   "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_386_GOT32",
   "BFD_RELOC_386_PLT32",
@@ -733,6 +741,7 @@
   "BFD_RELOC_CTOR",
   "BFD_RELOC_ARM_PCREL_BRANCH",
   "BFD_RELOC_ARM_IMMEDIATE",
+  "BFD_RELOC_ARM_ADRL_IMMEDIATE",
   "BFD_RELOC_ARM_OFFSET_IMM",
   "BFD_RELOC_ARM_SHIFT_IMM",
   "BFD_RELOC_ARM_SWI",
@@ -836,6 +845,7 @@
   "BFD_RELOC_MCORE_PCREL_IMM4BY2",
   "BFD_RELOC_MCORE_PCREL_32",
   "BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2",
+  "BFD_RELOC_MCORE_RVA",
   "BFD_RELOC_VTABLE_INHERIT",
   "BFD_RELOC_VTABLE_ENTRY",
  "@@overflow: BFD_RELOC_UNUSED@@",
diff --git a/bfd/libhppa.h b/bfd/libhppa.h
index 35b40ef..6027094 100644
--- a/bfd/libhppa.h
+++ b/bfd/libhppa.h
@@ -1,5 +1,6 @@
 /* HP PA-RISC SOM object file format:  definitions internal to BFD.
-   Copyright (C) 1990, 91, 92, 93, 94 , 95, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 98, 1999
+   Free Software Foundation, Inc.
 
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
@@ -192,7 +193,7 @@
 #define HPPA_R_ARG_RELOC(a)	(((a) >> 22) & 0x3FF)
 #define HPPA_R_CONSTANT(a)	((((int)(a)) << 10) >> 10)
 #define HPPA_R_ADDEND(r,c)	(((r) << 22) + ((c) & 0x3FFFFF))
-#define HPPA_WIDE               (0) /* PSW W-bit, need to check! FIXME */
+#define HPPA_WIDE	       (0) /* PSW W-bit, need to check! FIXME */
 
 /* These macros get bit fields using HP's numbering (MSB = 0),
  * but note that "MASK" assumes that the LSB bits are what's
@@ -202,17 +203,17 @@
 #define GET_FIELD(X, FROM, TO) \
   ((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1))
 #endif  
-#define GET_BIT( X, WHICH ) \
-  GET_FIELD( X, WHICH, WHICH )
+#define GET_BIT(X, WHICH) \
+  GET_FIELD (X, WHICH, WHICH)
 
-#define MASK( SIZE ) \
+#define MASK(SIZE) \
   (~((-1) << SIZE))
   
-#define CATENATE( X, XSIZE, Y, YSIZE ) \
-  (((X & MASK( XSIZE )) << YSIZE) | (Y & MASK( YSIZE )))
+#define CATENATE(X, XSIZE, Y, YSIZE) \
+  (((X & MASK (XSIZE)) << YSIZE) | (Y & MASK (YSIZE)))
 
-#define ELEVEN( X ) \
-  CATENATE( GET_BIT( X, 10 ), 1, GET_FIELD( X, 0, 9 ), 10)
+#define ELEVEN(X) \
+  CATENATE (GET_BIT (X, 10), 1, GET_FIELD (X, 0, 9), 10)
   
 /* Some functions to manipulate PA instructions.  */
 
@@ -233,7 +234,7 @@
 assemble_3 (x)
      unsigned int x;
 {
-  return (((x & 1) << 2) | ((x & 6) >> 1)) & 7;
+  return CATENATE (GET_BIT (x, 2), 1, GET_FIELD (x, 0, 1), 2);
 }
 
 static INLINE void
@@ -244,7 +245,7 @@
   *r = (((x & 4) >> 2) | ((x & 3) << 1)) & 7;
 }
 
-static INLINE unsigned int      /* PA 2.0 */
+static INLINE unsigned int
 assemble_6 (x, y)
      unsigned int x, y;
 {
@@ -255,9 +256,8 @@
 assemble_12 (x, y)
      unsigned int x, y;
 {
-  return CATENATE( CATENATE( y,                1,
-                             GET_BIT( x, 10 ), 1), 2,
-                   GET_FIELD( x, 0, 9 ),           9);
+  return CATENATE (CATENATE (y, 1, GET_BIT (x, 10), 1), 2,
+ 		   GET_FIELD (x, 0, 9), 9);
 }
 
 static INLINE void
@@ -269,53 +269,40 @@
   *x = ((as12 & 0x3ff) << 1) | ((as12 & 0x400) >> 10);
 }
 
-static INLINE unsigned long     /* PA 2.0 */
+static INLINE unsigned long
 assemble_16 (x, y)
      unsigned int x, y;
 {
   /* Depends on PSW W-bit !*/
   unsigned int temp;
 
-  if( HPPA_WIDE ) {
-      temp = CATENATE( CATENATE( GET_BIT( y, 13 ), 1,
-                                 (GET_BIT( y, 13 )^GET_BIT( x, 0)), 1 ), 2,
-                       CATENATE( (GET_BIT( y, 13 )^GET_BIT( x, 1)), 1,
-                                 GET_FIELD( y, 0, 12 ), 13 ), 14 );
-  }
-  else { 
-      temp = CATENATE( CATENATE( GET_BIT( y, 13 ), 1,
-                                 GET_BIT( y, 13 ), 1 ), 2,
-                       CATENATE( GET_BIT( y, 13 ), 1,
-                                 GET_FIELD( y, 0, 12 ), 13 ), 14 );
-  }
+  if (HPPA_WIDE)
+    temp = CATENATE (CATENATE (GET_BIT (y, 13), 1,
+			       (GET_BIT (y, 13) ^ GET_BIT (x, 0)), 1), 2,
+		     CATENATE ((GET_BIT (y, 13) ^ GET_BIT (x, 1)), 1,
+			       GET_FIELD (y, 0, 12), 13), 14);
+  else
+    temp = CATENATE (CATENATE (GET_BIT (y, 13), 1, GET_BIT (y, 13), 1), 2,
+		     CATENATE (GET_BIT (y, 13), 1, GET_FIELD (y, 0, 12), 13), 14);
 
-  return sign_extend( temp, 16 );
+  return sign_extend (temp, 16);
 }
 
 
-static INLINE unsigned long     /* PA 2.0 */
+static INLINE unsigned long
 assemble_16a (x, y, z)
      unsigned int x, y, z;
 {
   /* Depends on PSW W-bit !*/
   unsigned int temp;
 
-  if( HPPA_WIDE ) {
-      temp = CATENATE( CATENATE( z,                   1,
-                                 (z^GET_BIT( x, 0 )), 1),  2,
-                                 
-                       CATENATE( (z^GET_BIT( x, 1 )), 1,
-                                 y,                   11), 12);
-  }
-  else {
-      temp = CATENATE( CATENATE( z, 1,
-                                 z, 1), 2,
-                       CATENATE( z, 1,
-                                 y, 11), 12);
+  if (HPPA_WIDE)
+    temp = CATENATE (CATENATE (z, 1, (z ^ GET_BIT (x, 0)), 1), 2,
+		     CATENATE ((z ^ GET_BIT (x, 1)), 1, y, 11), 12);
+  else 
+      temp = CATENATE (CATENATE (z, 1, z, 1), 2, CATENATE (z, 1, y, 11), 12);
 
-  }
-
-  return sign_extend( (temp << 2), 16 );
+  return sign_extend ((temp << 2), 16);
 }
 
 static INLINE unsigned long
@@ -323,12 +310,9 @@
      unsigned int x, y, z;
 {
   unsigned long temp;
-  int           q;
 
-  temp = CATENATE( CATENATE( z, q,
-                             x, q), q,
-                   CATENATE( GET_BIT( y, 1 ), 1,
-                             GET_FIELD( y, 0, 9 ), 10), 11);
+  temp = CATENATE (CATENATE (z, 1, x, 5), 6,
+		   CATENATE (GET_BIT (y, 10), 1, GET_FIELD (y, 0, 9), 10), 11);
   
   return temp;
 }
@@ -358,18 +342,16 @@
   return temp & 0x1fffff;
 }
 
-static INLINE unsigned long     /* PA 2.0 */
+static INLINE unsigned long
 assemble_22 (a,b,c,d)
      unsigned int a,b,c,d;
 {
   unsigned long temp;
   
-  temp = CATENATE( CATENATE( d, 1,
-                             a, 5 ), 6,
-                   CATENATE( b, 5,
-                             ELEVEN( c ), 11 ), 16 );
+  temp = CATENATE (CATENATE (d, 1, a, 5), 6,
+		   CATENATE (b, 5, ELEVEN (c), 11), 16);
 
-  return sign_extend( temp, 22 );
+  return sign_extend (temp, 22);
 }
 
 static INLINE void
@@ -458,7 +440,7 @@
 {
   switch (r_field)
     {
-    case e_fsel:		/* F  : no change                      */
+    case e_fsel:		/* F  : no change		      */
     case e_nsel:		/* N  : no change		       */
       value += constant_value;
       break;
@@ -471,7 +453,7 @@
       value = (value & 0xfffff800) >> 11;
       break;
 
-    case e_rssel:		/* RS : Sign extend from bit 21        */
+    case e_rssel:		/* RS : Sign extend from bit 21	*/
       value += constant_value;
       if (value & 0x00000400)
 	value |= 0xfffff800;
@@ -485,19 +467,19 @@
       value = (value & 0xfffff800) >> 11;
       break;
 
-    case e_rsel:		/* R  : Set bits 0-20 to zero          */
+    case e_rsel:		/* R  : Set bits 0-20 to zero	  */
       value += constant_value;
       value = value & 0x7ff;
       break;
 
     case e_ldsel:		/* LD : Add 0x800, arithmetic shift
-				   right 11 bits                  */
+				   right 11 bits		  */
       value += constant_value;
       value += 0x800;
       value = (value & 0xfffff800) >> 11;
       break;
 
-    case e_rdsel:		/* RD : Set bits 0-20 to one           */
+    case e_rdsel:		/* RD : Set bits 0-20 to one	   */
       value += constant_value;
       value |= 0xfffff800;
       break;
@@ -629,7 +611,7 @@
    
 static INLINE unsigned long
 hppa_rebuild_insn (abfd, insn, value, r_format)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      unsigned long insn;
      unsigned long value;
      unsigned long r_format;
diff --git a/bfd/linker.c b/bfd/linker.c
index 947514c..edf96fe 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -1,5 +1,6 @@
 /* linker.c -- BFD linker routines
-   Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -74,7 +75,7 @@
 @cindex target vector (_bfd_link_hash_table_create)
 	The linker routines must create a hash table, which must be
 	derived from <<struct bfd_link_hash_table>> described in
-	<<bfdlink.c>>.  @xref{Hash Tables} for information on how to
+	<<bfdlink.c>>.  @xref{Hash Tables}, for information on how to
 	create a derived hash table.  This entry point is called using
 	the target vector of the linker output file.
 
@@ -1748,8 +1749,8 @@
 	case MDEF:
 	  /* Handle a multiple definition.  */
 	  {
-	    asection *msec;
-	    bfd_vma mval;
+	    asection *msec = NULL;
+	    bfd_vma mval = 0;
 
 	    switch (h->type)
 	      {
@@ -2602,7 +2603,7 @@
 static boolean
 default_fill_link_order (abfd, info, sec, link_order)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      asection *sec;
      struct bfd_link_order *link_order;
 {
@@ -2797,8 +2798,8 @@
 
 boolean
 _bfd_generic_link_split_section (abfd, sec)
-     bfd *abfd;
-     asection *sec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
 {
   return false;
 }
diff --git a/bfd/m68klinux.c b/bfd/m68klinux.c
index c8f47a8..2251757 100644
--- a/bfd/m68klinux.c
+++ b/bfd/m68klinux.c
@@ -1,5 +1,6 @@
 /* BFD back-end for linux flavored m68k a.out binaries.
-   Copyright (C) 1992, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -301,7 +302,7 @@
 static boolean
 linux_link_create_dynamic_sections (abfd, info)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
 {
   flagword flags;
   register asection *s;
diff --git a/bfd/mipsbsd.c b/bfd/mipsbsd.c
index e7ba68d..7a680fb 100644
--- a/bfd/mipsbsd.c
+++ b/bfd/mipsbsd.c
@@ -1,5 +1,5 @@
 /* BFD backend for MIPS BSD (a.out) binaries.
-   Copyright (C) 1993, 94, 95, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 97, 98, 1999 Free Software Foundation, Inc.
    Written by Ralph Campbell.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -187,10 +187,10 @@
  */
 static bfd_reloc_status_type
 mips_fix_jmp_addr (abfd,reloc_entry,symbol,data,input_section,output_bfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      struct symbol_cache_entry *symbol;
-     PTR data;
+     PTR data ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd *output_bfd;
 {
@@ -240,13 +240,13 @@
 static bfd_reloc_status_type
 mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section,
 		 output_bfd, error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc_entry;
      asymbol *symbol;
-     PTR data;
-     asection *input_section;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma relocation;
  
@@ -389,6 +389,8 @@
   0				/* finish_dynamic_link */
 };
 
+extern const bfd_target aout_mips_big_vec;
+
 const bfd_target aout_mips_little_vec =
 {
   "a.out-mips-little",		/* name */
@@ -425,7 +427,9 @@
      BFD_JUMP_TABLE_LINK (MY),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
-  (PTR) MY_backend_data,
+  & aout_mips_big_vec,
+  
+  (PTR) MY_backend_data
 };
 
 const bfd_target aout_mips_big_vec =
@@ -464,5 +468,7 @@
      BFD_JUMP_TABLE_LINK (MY),
      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
-  (PTR) MY_backend_data,
+  & aout_mips_little_vec,
+  
+  (PTR) MY_backend_data
 };
diff --git a/bfd/netbsd-core.c b/bfd/netbsd-core.c
index 21b184d..828c2a1 100644
--- a/bfd/netbsd-core.c
+++ b/bfd/netbsd-core.c
@@ -247,5 +247,7 @@
        BFD_JUMP_TABLE_LINK (_bfd_nolink),
        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+    NULL,
+    
     (PTR) 0			/* backend_data */
 };
diff --git a/bfd/nlm-target.h b/bfd/nlm-target.h
index 6f1d47d..5c1e255 100644
--- a/bfd/nlm-target.h
+++ b/bfd/nlm-target.h
@@ -55,6 +55,10 @@
    There are two such structures here:  one for big-endian machines and
    one for little-endian machines.   */
 
+/* Forward declaration for use when initialising alternative_target field.  */
+#ifdef TARGET_LITTLE_SYM
+extern const bfd_target TARGET_LITTLE_SYM;
+#endif
 
 #ifdef TARGET_BIG_SYM
 const bfd_target TARGET_BIG_SYM =
@@ -137,6 +141,13 @@
   BFD_JUMP_TABLE_LINK (nlm),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  /* Alternative endian target.  */
+#ifdef TARGET_LITTLE_SYM
+  & TARGET_LITTLE_SYM,
+#else
+  NULL,
+#endif
+  
   /* backend_data: */
   (PTR) TARGET_BACKEND_DATA
 };
@@ -223,6 +234,13 @@
   BFD_JUMP_TABLE_LINK (nlm),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  /* Alternative endian target.  */
+#ifdef TARGET_BIG_SYM
+  & TARGET_BIG_SYM,
+#else
+  NULL,
+#endif
+  
   /* backend_data: */
   (PTR) TARGET_BACKEND_DATA
 };
diff --git a/bfd/nlm32-ppc.c b/bfd/nlm32-ppc.c
index ecf2de8..5af4834 100644
--- a/bfd/nlm32-ppc.c
+++ b/bfd/nlm32-ppc.c
@@ -1,5 +1,5 @@
 /* Support for 32-bit PowerPC NLM (NetWare Loadable Module)
-   Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -639,11 +639,11 @@
 
 static boolean
 nlm_powerpc_mangle_relocs (abfd, sec, data, offset, count)
-     bfd *abfd;
-     asection *sec;
-     PTR data;
-     bfd_vma offset;
-     bfd_size_type count;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     bfd_vma offset ATTRIBUTE_UNUSED;
+     bfd_size_type count ATTRIBUTE_UNUSED;
 {
   return true;
 }
diff --git a/bfd/nlm32-sparc.c b/bfd/nlm32-sparc.c
index 5963adb..ab4d80a 100644
--- a/bfd/nlm32-sparc.c
+++ b/bfd/nlm32-sparc.c
@@ -1,5 +1,5 @@
 /* Support for 32-bit SPARC NLM (NetWare Loadable Module)
-   Copyright (C) 1993 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 1995, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -118,7 +118,7 @@
 static boolean
 nlm_sparc_read_reloc (abfd, sym, secp, rel)
      bfd *abfd;
-     nlmNAME(symbol_type) *sym;
+     nlmNAME(symbol_type) *sym ATTRIBUTE_UNUSED;
      asection **secp;
      arelent *rel;
 {
@@ -232,11 +232,11 @@
 
 static boolean
 nlm_sparc_mangle_relocs (abfd, sec, data, offset, count)
-     bfd *abfd;
-     asection *sec;
-     PTR data;
-     bfd_vma offset;
-     bfd_size_type count;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     bfd_vma offset ATTRIBUTE_UNUSED;
+     bfd_size_type count ATTRIBUTE_UNUSED;
 {
   return true;
 }
diff --git a/bfd/nlmcode.h b/bfd/nlmcode.h
index 63ac0c3..ad1a2f8 100644
--- a/bfd/nlmcode.h
+++ b/bfd/nlmcode.h
@@ -1,5 +1,5 @@
 /* NLM (NetWare Loadable Module) executable support for BFD.
-   Copyright (C) 1993, 94, 95, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 98, 1999 Free Software Foundation, Inc.
 
    Written by Fred Fish @ Cygnus Support, using ELF support as the
    template.
@@ -971,7 +971,7 @@
 
 void
 nlm_get_symbol_info (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -982,7 +982,7 @@
 
 void
 nlm_print_symbol (abfd, afile, symbol, how)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      PTR afile;
      asymbol *symbol;
      bfd_print_symbol_type how;
diff --git a/bfd/oasys.c b/bfd/oasys.c
index b51560e..e69053b 100644
--- a/bfd/oasys.c
+++ b/bfd/oasys.c
@@ -1,5 +1,5 @@
 /* BFD back-end for oasys objects.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support, <sac@cygnus.com>.
 
@@ -515,7 +515,7 @@
 
 static void
 oasys_get_symbol_info (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -526,7 +526,7 @@
 
 static void
 oasys_print_symbol (ignore_abfd, afile, symbol, how)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      PTR afile;
      asymbol *symbol;
      bfd_print_symbol_type how;
@@ -844,10 +844,10 @@
 
 long
 oasys_canonicalize_reloc (ignore_abfd, section, relptr, symbols)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      sec_ptr section;
      arelent **relptr;
-     asymbol **symbols;
+     asymbol **symbols ATTRIBUTE_UNUSED;
 {
   unsigned int reloc_count = 0;
   oasys_reloc_type *src = (oasys_reloc_type *) (section->relocation);
@@ -1403,13 +1403,13 @@
 			 filename_ptr,
 			 functionname_ptr,
 			 line_ptr)
-     bfd *abfd;
-     asection *section;
-     asymbol **symbols;
-     bfd_vma offset;
-     char **filename_ptr;
-     char **functionname_ptr;
-     unsigned int *line_ptr;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
+     asymbol **symbols ATTRIBUTE_UNUSED;
+     bfd_vma offset ATTRIBUTE_UNUSED;
+     char **filename_ptr ATTRIBUTE_UNUSED;
+     char **functionname_ptr ATTRIBUTE_UNUSED;
+     unsigned int *line_ptr ATTRIBUTE_UNUSED;
 {
   return false;
 
@@ -1436,8 +1436,8 @@
 
 static int
 oasys_sizeof_headers (abfd, exec)
-     bfd *abfd;
-     boolean exec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean exec ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -1531,5 +1531,7 @@
   BFD_JUMP_TABLE_LINK (oasys),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0
 };
diff --git a/bfd/osf-core.c b/bfd/osf-core.c
index 671f4af..4f4fc12 100644
--- a/bfd/osf-core.c
+++ b/bfd/osf-core.c
@@ -250,5 +250,7 @@
        BFD_JUMP_TABLE_LINK (_bfd_nolink),
        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+    NULL,
+    
     (PTR) 0			/* backend_data */
 };
diff --git a/bfd/pe-arm.c b/bfd/pe-arm.c
index d315888..f8a0481 100644
--- a/bfd/pe-arm.c
+++ b/bfd/pe-arm.c
@@ -31,4 +31,13 @@
 #define PCRELOFFSET          true
 #define COFF_LONG_SECTION_NAMES
 
+#ifndef bfd_arm_allocate_interworking_sections 
+#define bfd_arm_allocate_interworking_sections \
+	bfd_arm_pe_allocate_interworking_sections
+#define bfd_arm_get_bfd_for_interworking \
+	bfd_arm_pe_get_bfd_for_interworking
+#define bfd_arm_process_before_allocation \
+	bfd_arm_pe_process_before_allocation
+#endif
+	
 #include "coff-arm.c"
diff --git a/bfd/peicode.h b/bfd/peicode.h
index 79d16e5..3adb2d8 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -1,5 +1,5 @@
 /* Support for the generic parts of most COFF variants, for BFD.
-   Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -504,6 +504,7 @@
     {
       in->n_value = 0x0;
 
+#if 0
       /* FIXME: This is clearly wrong.  The problem seems to be that
          undefined C_SECTION symbols appear in the first object of a
          MS generated .lib file, and the symbols are not defined
@@ -518,6 +519,56 @@
       /*      in->n_scnum = 3; */
       /*    else */
       /*      in->n_scnum = 2; */
+#else
+      /* Create synthetic empty sections as needed.  DJ */
+      if (in->n_scnum == 0)
+	{
+	  asection *sec;
+	  for (sec=abfd->sections; sec; sec=sec->next)
+	    {
+	      if (strcmp (sec->name, in->n_name) == 0)
+		{
+		  in->n_scnum = sec->target_index;
+		  break;
+		}
+	    }
+	}
+      if (in->n_scnum == 0)
+	{
+	  int unused_section_number = 0;
+	  asection *sec;
+	  char *name;
+	  for (sec=abfd->sections; sec; sec=sec->next)
+	    if (unused_section_number <= sec->target_index)
+	      unused_section_number = sec->target_index+1;
+
+	  name = bfd_alloc (abfd, strlen (in->n_name) + 10);
+	  if (name == NULL)
+	    return;
+	  strcpy (name, in->n_name);
+	  sec = bfd_make_section_anyway (abfd, name);
+
+	  sec->vma = 0;
+	  sec->lma = 0;
+	  sec->_cooked_size = 0;
+	  sec->_raw_size = 0;
+	  sec->filepos = 0;
+	  sec->rel_filepos = 0;
+	  sec->reloc_count = 0;
+	  sec->line_filepos = 0;
+	  sec->lineno_count = 0;
+	  sec->userdata = NULL;
+	  sec->next = (asection *) NULL;
+	  sec->flags = 0;
+	  sec->alignment_power = 2;
+	  sec->flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD;
+
+	  sec->target_index = unused_section_number;
+
+	  in->n_scnum = unused_section_number;
+	}
+      in->n_sclass = C_STAT;
+#endif
     }
 
 #ifdef coff_swap_sym_in_hook
@@ -567,8 +618,8 @@
      PTR 	      ext1;
      int             type;
      int             class;
-     int	      indx;
-     int	      numaux;
+     int	      indx ATTRIBUTE_UNUSED;
+     int	      numaux ATTRIBUTE_UNUSED;
      PTR 	      in1;
 {
   AUXENT    *ext = (AUXENT *)ext1;
@@ -650,8 +701,8 @@
      PTR 	inp;
      int   type;
      int   class;
-     int   indx;
-     int   numaux;
+     int   indx ATTRIBUTE_UNUSED;
+     int   numaux ATTRIBUTE_UNUSED;
      PTR	extp;
 {
   union internal_auxent *in = (union internal_auxent *)inp;
@@ -1184,7 +1235,11 @@
     else if (strcmp (scnhdr_int->s_name, ".rsrc")  == 0)
       flags |= IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_SHARED;
     else
-      flags |= IMAGE_SCN_MEM_READ;
+      {
+	flags |= IMAGE_SCN_MEM_READ;
+	if (! (flags & SEC_READONLY))
+	  flags |= IMAGE_SCN_MEM_WRITE;
+      }
 
     bfd_h_put_32(abfd, flags, (bfd_byte *) scnhdr_ext->s_flags);
   }
@@ -2019,7 +2074,7 @@
 pe_mkobject_hook (abfd, filehdr, aouthdr)
      bfd * abfd;
      PTR filehdr;
-     PTR aouthdr;
+     PTR aouthdr ATTRIBUTE_UNUSED;
 {
   struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
   pe_data_type *pe;
diff --git a/bfd/po/POTFILES.in b/bfd/po/POTFILES.in
index ae49966..008f987 100644
--- a/bfd/po/POTFILES.in
+++ b/bfd/po/POTFILES.in
@@ -1,9 +1,6 @@
-archures.c
-bfd-in2.h
 aix386-core.c
 aout-adobe.c
 aout-arm.c
-aout-encap.c
 aout-ns32k.c
 aout-sparcle.c
 aout-target.h
@@ -14,7 +11,7 @@
 aoutf1.h
 aoutx.h
 archive.c
-bfd-in.h
+archures.c
 bfd.c
 binary.c
 bout.c
@@ -36,10 +33,8 @@
 coff-i960.c
 coff-m68k.c
 coff-m88k.c
-coff-mcore.c
 coff-mips.c
 coff-pmac.c
-coff-ppc.c
 coff-rs6000.c
 coff-sh.c
 coff-sparc.c
@@ -55,9 +50,6 @@
 coffgen.c
 cofflink.c
 coffswap.h
-cpu-m10300.c
-cpu-m32r.c
-cpu-mips.c
 corefile.c
 cpu-a29k.c
 cpu-alpha.c
@@ -73,37 +65,34 @@
 cpu-i860.c
 cpu-i960.c
 cpu-m10200.c
-cpu-sh.c
-elf-m10300.c
+cpu-m10300.c
+cpu-m32r.c
 cpu-m68k.c
 cpu-m88k.c
 cpu-mcore.c
-elf32-m32r.c
+cpu-mips.c
 cpu-ns32k.c
 cpu-powerpc.c
 cpu-rs6000.c
-libbfd.h
+cpu-sh.c
 cpu-sparc.c
 cpu-tic30.c
 cpu-tic80.c
 cpu-v850.c
 cpu-vax.c
-elf32-mips.c
 cpu-w65.c
 cpu-we32k.c
 cpu-z8k.c
 demo64.c
-dwarf1.c
 dwarf2.c
 ecoff.c
 ecofflink.c
 ecoffswap.h
 elf-bfd.h
 elf-m10200.c
-libhppa.h
+elf-m10300.c
 elf.c
 elf32-arc.c
-elf32-arm.h
 elf32-d10v.c
 elf32-d30v.c
 elf32-fr30.c
@@ -112,11 +101,12 @@
 elf32-hppa.h
 elf32-i386.c
 elf32-i860.c
-reloc.c
+elf32-i960.c
+elf32-m32r.c
 elf32-m68k.c
 elf32-m88k.c
 elf32-mcore.c
-targets.c
+elf32-mips.c
 elf32-ppc.c
 elf32-sh.c
 elf32-sparc.c
@@ -130,23 +120,14 @@
 elfarm-nabi.c
 elfarm-oabi.c
 elfcode.h
-elfcore.h
 elflink.c
-elflink.h
-elfxx-target.h
-epoc-pe-arm.c
-epoc-pei-arm.c
 format.c
-freebsd.h
-gen-aout.c
 genlink.h
 go32stub.h
 hash.c
-host-aout.c
 hp300bsd.c
 hp300hpux.c
 hppa_stubs.h
-hppabsd-core.c
 hpux-core.c
 i386aout.c
 i386bsd.c
@@ -163,11 +144,11 @@
 init.c
 irix-core.c
 libaout.h
-libbfd-in.h
 libbfd.c
-libcoff-in.h
+libbfd.h
 libcoff.h
 libecoff.h
+libhppa.h
 libieee.h
 libnlm.h
 liboasys.h
@@ -177,10 +158,8 @@
 m68klinux.c
 m68klynx.c
 m68knetbsd.c
-doc/chew.c
 m88kmach3.c
 mipsbsd.c
-netbsd-core.c
 netbsd.h
 newsos3.c
 nlm-target.h
@@ -192,7 +171,6 @@
 nlm32.c
 nlm64.c
 nlmcode.h
-nlmswap.h
 ns32k.h
 ns32knetbsd.c
 oasys.c
@@ -207,12 +185,10 @@
 pei-i386.c
 pei-mcore.c
 pei-ppc.c
-peicode.h
 ppcboot.c
-ptrace-core.c
+reloc.c
 reloc16.c
 riscix.c
-rs6000-core.c
 sco5-core.c
 section.c
 som.c
@@ -225,7 +201,7 @@
 stabs.c
 sunos.c
 syms.c
-sysdep.h
+targets.c
 tekhex.c
 trad-core.c
 vaxnetbsd.c
@@ -237,28 +213,3 @@
 vms.c
 vms.h
 xcofflink.c
-hosts/alphalinux.h
-hosts/alphavms.h
-hosts/decstation.h
-hosts/delta68.h
-hosts/dpx2.h
-hosts/hp300bsd.h
-hosts/i386bsd.h
-hosts/i386linux.h
-hosts/i386mach3.h
-hosts/i386sco.h
-hosts/i860mach3.h
-hosts/m68kaux.h
-hosts/m68klinux.h
-hosts/m88kmach3.h
-hosts/mipsbsd.h
-hosts/mipsmach3.h
-hosts/news-mips.h
-hosts/news.h
-hosts/pc532mach.h
-hosts/riscos.h
-hosts/symmetry.h
-hosts/tahoe.h
-hosts/vaxbsd.h
-hosts/vaxult.h
-hosts/vaxult2.h
diff --git a/bfd/po/bfd.pot b/bfd/po/bfd.pot
index f7ffbb4..f4cda19 100644
--- a/bfd/po/bfd.pot
+++ b/bfd/po/bfd.pot
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-04-18 18:26-0400\n"
+"POT-Creation-Date: 1999-06-03 02:55-0700\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -39,16 +39,16 @@
 msgid "%s: relocateable link from %s to %s not supported"
 msgstr ""
 
-#: archive.c:1716
+#: archive.c:1724
 msgid "Warning: writing archive was slow: rewriting timestamp\n"
 msgstr ""
 
-#: archive.c:1987
+#: archive.c:1990
 msgid "Reading archive file mod timestamp"
 msgstr ""
 
 #. FIXME: bfd can't call perror.
-#: archive.c:2011
+#: archive.c:2014
 msgid "Writing updated armap timestamp"
 msgstr ""
 
@@ -166,7 +166,7 @@
 msgid "using multiple gp values"
 msgstr ""
 
-#: coff-alpha.c:1992 coff-mips.c:1435 elf32-mips.c:5175
+#: coff-alpha.c:1992 coff-mips.c:1435 elf32-mips.c:4924
 msgid "GP relative relocation when GP not defined"
 msgstr ""
 
@@ -180,26 +180,26 @@
 msgid "%s: unable to find ARM glue '%s' for `%s'"
 msgstr ""
 
-#: coff-arm.c:1192 coff-arm.c:1286
+#: coff-arm.c:1188 coff-arm.c:1282
 #, c-format
 msgid "%s(%s): warning: interworking not enabled."
 msgstr ""
 
-#: coff-arm.c:1196
+#: coff-arm.c:1192
 #, c-format
 msgid "  first occurrence: %s: arm call to thumb"
 msgstr ""
 
-#: coff-arm.c:1290
+#: coff-arm.c:1286
 #, c-format
 msgid "  first occurrence: %s: thumb call to arm"
 msgstr ""
 
-#: coff-arm.c:1293
+#: coff-arm.c:1289
 msgid "  consider relinking with --support-old-code enabled"
 msgstr ""
 
-#: coff-arm.c:1581 coff-tic80.c:682 cofflink.c:2722
+#: coff-arm.c:1575 coff-tic80.c:682 cofflink.c:2722
 #, c-format
 msgid "%s: bad reloc address 0x%lx in section `%s'"
 msgstr ""
@@ -296,7 +296,7 @@
 msgid "uncertain calling convention for non-COFF symbol"
 msgstr ""
 
-#: coff-mips.c:875 elf32-mips.c:1183
+#: coff-mips.c:875 elf32-mips.c:1136
 msgid "GP relative relocation when _gp not defined"
 msgstr ""
 
@@ -324,27 +324,27 @@
 msgid "ignoring reloc %s\n"
 msgstr ""
 
-#: coffcode.h:3413
+#: coffcode.h:3441
 #, c-format
 msgid "%s: warning: illegal symbol index %ld in line numbers"
 msgstr ""
 
-#: coffcode.h:3427
+#: coffcode.h:3455
 #, c-format
 msgid "%s: warning: duplicate line number information for `%s'"
 msgstr ""
 
-#: coffcode.h:3748
+#: coffcode.h:3781
 #, c-format
 msgid "%s: Unrecognized storage class %d for %s symbol `%s'"
 msgstr ""
 
-#: coffcode.h:3932
+#: coffcode.h:3965
 #, c-format
 msgid "%s: warning: illegal symbol index %ld in relocs"
 msgstr ""
 
-#: coffcode.h:3970
+#: coffcode.h:4003
 #, c-format
 msgid "%s: illegal relocation type %d at address 0x%lx"
 msgstr ""
@@ -364,12 +364,12 @@
 msgid "%s: relocs in section `%s', but it has no contents"
 msgstr ""
 
-#: coffswap.h:879
+#: coffswap.h:888
 #, c-format
 msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
 msgstr ""
 
-#: coffswap.h:892
+#: coffswap.h:901
 #, c-format
 msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
 msgstr ""
@@ -388,34 +388,38 @@
 msgid "Dwarf Error: Invalid or unhandled FORM value: %d."
 msgstr ""
 
-#: dwarf2.c:720
+#: dwarf2.c:687
+msgid "Dwarf Error: mangled line number section (bad file number)."
+msgstr ""
+
+#: dwarf2.c:738
 msgid "Dwarf Error: Can't find .debug_line section."
 msgstr ""
 
-#: dwarf2.c:881
+#: dwarf2.c:903
 msgid "Dwarf Error: mangled line number section."
 msgstr ""
 
-#: dwarf2.c:1054 dwarf2.c:1201
+#: dwarf2.c:1097 dwarf2.c:1244
 #, c-format
 msgid "Dwarf Error: Could not find abbrev number %d."
 msgstr ""
 
-#: dwarf2.c:1162
+#: dwarf2.c:1205
 #, c-format
 msgid ""
 "Dwarf Error: found dwarf version '%hu', this reader only handles version 2 "
 "information."
 msgstr ""
 
-#: dwarf2.c:1169
+#: dwarf2.c:1212
 #, c-format
 msgid ""
 "Dwarf Error: found address size '%u', this reader can not handle sizes "
 "greater than '%u'."
 msgstr ""
 
-#: dwarf2.c:1192
+#: dwarf2.c:1235
 #, c-format
 msgid "Dwarf Error: Bad abbrev number: %d."
 msgstr ""
@@ -534,56 +538,56 @@
 msgid "  required from %s:\n"
 msgstr ""
 
-#: elf.c:1882
+#: elf.c:1887
 #, c-format
 msgid ""
 "creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = "
 "0x%.8lx\n"
 msgstr ""
 
-#: elf.c:2481
+#: elf.c:2490
 #, c-format
 msgid "%s: Not enough room for program headers (allocated %u, need %u)"
 msgstr ""
 
-#: elf.c:2584
+#: elf.c:2593
 #, c-format
 msgid "%s: Not enough room for program headers, try linking with -N"
 msgstr ""
 
-#: elf.c:2710
+#: elf.c:2719
 #, c-format
 msgid "Error: First section in segment (%s) starts at 0x%x"
 msgstr ""
 
-#: elf.c:2713
+#: elf.c:2722
 #, c-format
 msgid "       whereas segment starts at 0x%x"
 msgstr ""
 
-#: elf.c:2983
+#: elf.c:2992
 #, c-format
 msgid "%s: warning: allocated section `%s' not in segment"
 msgstr ""
 
-#: elf.c:3350
+#: elf.c:3365
 #, c-format
 msgid "%s: symbol `%s' required but not present"
 msgstr ""
 
-#: elf.c:3359
+#: elf.c:3374
 #, c-format
 msgid ""
 "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = "
 "0x%.8lx%s\n"
 msgstr ""
 
-#: elf.c:3501
+#: elf.c:3516
 #, c-format
 msgid "%s: warning: Empty loadable segment detected\n"
 msgstr ""
 
-#: elf.c:4774
+#: elf.c:4792
 #, c-format
 msgid "%s: unsupported relocation type %s"
 msgstr ""
@@ -616,17 +620,870 @@
 msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)"
 msgstr ""
 
-#: elf32-m32r.c:1906
+#: elf32-m32r.c:1900
 #, c-format
 msgid "%s: Instruction set mismatch with previous modules"
 msgstr ""
 
-#: elf32-m32r.c:1929
+#: elf32-m32r.c:1923
 #, c-format
 msgid "private flags = %lx"
 msgstr ""
 
-#: elf32-m32r.c:1934
+#: elf32-m32r.c:1928
 msgid ": m32r instructions"
 msgstr ""
 
+#. Ignore init flag - it may not be set, despite the flags field containing valid data.
+#: elf32-m68k.c:432 elf32-mips.c:2300
+#, c-format
+msgid "private flags = %lx:"
+msgstr ""
+
+#: elf32-m68k.c:435
+msgid " [cpu32]"
+msgstr ""
+
+#: elf32-mcore.c:330
+#, c-format
+msgid "%s: compiled for a %s endian system and target is %s endian.\n"
+msgstr ""
+
+#: elf32-mcore.c:374 elf32-mcore.c:502
+#, c-format
+msgid "%s: Relocation %s (%d) is not currently supported.\n"
+msgstr ""
+
+#: elf32-mcore.c:461
+#, c-format
+msgid "%s: Unknown relocation type %d\n"
+msgstr ""
+
+#: elf32-mips.c:1296
+msgid "32bits gp relative relocation occurs for an external symbol"
+msgstr ""
+
+#: elf32-mips.c:1445
+#, c-format
+msgid "Linking mips16 objects into %s format is not supported"
+msgstr ""
+
+#: elf32-mips.c:2141 elf32-ppc.c:1410
+#, c-format
+msgid "%s: compiled for a big endian system and target is little endian"
+msgstr ""
+
+#: elf32-mips.c:2143 elf32-ppc.c:1412
+#, c-format
+msgid "%s: compiled for a little endian system and target is big endian"
+msgstr ""
+
+#: elf32-mips.c:2190
+#, c-format
+msgid "%s: linking PIC files with non-PIC files"
+msgstr ""
+
+#: elf32-mips.c:2200
+#, c-format
+msgid "%s: linking abicalls files with non-abicalls files"
+msgstr ""
+
+#: elf32-mips.c:2230
+#, c-format
+msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)"
+msgstr ""
+
+#: elf32-mips.c:2239
+#, c-format
+msgid "%s: ISA mismatch (%d) with previous modules (%d)"
+msgstr ""
+
+#: elf32-mips.c:2258
+#, c-format
+msgid "%s: ABI mismatch: linking %s module with previous %s modules"
+msgstr ""
+
+#: elf32-mips.c:2272 elf32-ppc.c:1479 elf64-sparc.c:2199
+#, c-format
+msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
+msgstr ""
+
+#: elf32-mips.c:2303
+msgid " [abi=O32]"
+msgstr ""
+
+#: elf32-mips.c:2305
+msgid " [abi=O64]"
+msgstr ""
+
+#: elf32-mips.c:2307
+msgid " [abi=EABI32]"
+msgstr ""
+
+#: elf32-mips.c:2309
+msgid " [abi=EABI64]"
+msgstr ""
+
+#: elf32-mips.c:2311
+msgid " [abi unknown]"
+msgstr ""
+
+#: elf32-mips.c:2313
+msgid " [no abi set]"
+msgstr ""
+
+#: elf32-mips.c:2316
+msgid " [mips1]"
+msgstr ""
+
+#: elf32-mips.c:2318
+msgid " [mips2]"
+msgstr ""
+
+#: elf32-mips.c:2320
+msgid " [mips3]"
+msgstr ""
+
+#: elf32-mips.c:2322
+msgid " [mips4]"
+msgstr ""
+
+#: elf32-mips.c:2324
+msgid " [unknown ISA]"
+msgstr ""
+
+#: elf32-mips.c:2327
+msgid " [32bitmode]"
+msgstr ""
+
+#: elf32-mips.c:2329
+msgid " [not 32bitmode]"
+msgstr ""
+
+#: elf32-mips.c:3897
+msgid "static procedure (no name)"
+msgstr ""
+
+#: elf32-mips.c:4470 elf64-alpha.c:4425
+#, c-format
+msgid "%s: illegal section name `%s'"
+msgstr ""
+
+#: elf32-mips.c:4777
+msgid "more got entries are needed for hipage relocations"
+msgstr ""
+
+#: elf32-mips.c:5081
+msgid "_gp_disp used when GP not defined"
+msgstr ""
+
+#: elf32-mips.c:5498
+#, c-format
+msgid "%s: %s+0x%lx: jump to mips16 routine which is not jal"
+msgstr ""
+
+#: elf32-mips.c:6253
+#, c-format
+msgid "%s: CALL16 reloc at 0x%lx not against global symbol"
+msgstr ""
+
+#: elf32-ppc.c:1445
+#, c-format
+msgid ""
+"%s: compiled with -mrelocatable and linked with modules compiled normally"
+msgstr ""
+
+#: elf32-ppc.c:1453
+#, c-format
+msgid ""
+"%s: compiled normally and linked with modules compiled with -mrelocatable"
+msgstr ""
+
+#: elf32-ppc.c:1580
+#, c-format
+msgid "%s: Unknown special linker type %d"
+msgstr ""
+
+#: elf32-ppc.c:2311 elf32-ppc.c:2345 elf32-ppc.c:2380
+#, c-format
+msgid "%s: relocation %s cannot be used when making a shared object"
+msgstr ""
+
+#: elf32-ppc.c:3216
+#, c-format
+msgid "%s: unknown relocation type %d for symbol %s"
+msgstr ""
+
+#: elf32-ppc.c:3583 elf32-ppc.c:3605 elf32-ppc.c:3654
+#, c-format
+msgid ""
+"%s: The target (%s) of a %s relocation is in the wrong output section (%s)"
+msgstr ""
+
+#: elf32-ppc.c:3720
+#, c-format
+msgid "%s: Relocation %s is not yet supported for symbol %s."
+msgstr ""
+
+#: elf32-sh.c:673
+#, c-format
+msgid "%s: 0x%lx: warning: bad R_SH_USES offset"
+msgstr ""
+
+#: elf32-sh.c:685
+#, c-format
+msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"
+msgstr ""
+
+#: elf32-sh.c:702
+#, c-format
+msgid "%s: 0x%lx: warning: bad R_SH_USES load offset"
+msgstr ""
+
+#: elf32-sh.c:717
+#, c-format
+msgid "%s: 0x%lx: warning: could not find expected reloc"
+msgstr ""
+
+#: elf32-sh.c:754
+#, c-format
+msgid "%s: 0x%lx: warning: symbol in unexpected section"
+msgstr ""
+
+#: elf32-sh.c:876
+#, c-format
+msgid "%s: 0x%lx: warning: could not find expected COUNT reloc"
+msgstr ""
+
+#: elf32-sh.c:885
+#, c-format
+msgid "%s: 0x%lx: warning: bad count"
+msgstr ""
+
+#: elf32-sh.c:1271 elf32-sh.c:1608
+#, c-format
+msgid "%s: 0x%lx: fatal: reloc overflow while relaxing"
+msgstr ""
+
+#: elf32-sparc.c:1502 elf64-sparc.c:1577
+#, c-format
+msgid "%s: probably compiled without -fPIC?"
+msgstr ""
+
+#: elf32-sparc.c:1923
+#, c-format
+msgid "%s: compiled for a v8plus system and target is v8"
+msgstr ""
+
+#: elf32-sparc.c:1932
+#, c-format
+msgid "%s: compiled for a v8plusa system and target is v8plus"
+msgstr ""
+
+#: elf32-sparc.c:1940
+#, c-format
+msgid "%s: compiled for a 64 bit system and target is 32 bit"
+msgstr ""
+
+#: elf32-sparc.c:1952
+#, c-format
+msgid "%s: linking little endian files with big endian files"
+msgstr ""
+
+#: elf32-v850.c:680
+#, c-format
+msgid "Variable `%s' cannot occupy in multiple small data regions"
+msgstr ""
+
+#: elf32-v850.c:683
+#, c-format
+msgid ""
+"Variable `%s' can only be in one of the small, zero, and tiny data regions"
+msgstr ""
+
+#: elf32-v850.c:686
+#, c-format
+msgid ""
+"Variable `%s' cannot be in both small and zero data regions simultaneously"
+msgstr ""
+
+#: elf32-v850.c:689
+#, c-format
+msgid ""
+"Variable `%s' cannot be in both small and tiny data regions simultaneously"
+msgstr ""
+
+#: elf32-v850.c:692
+#, c-format
+msgid ""
+"Variable `%s' cannot be in both zero and tiny data regions simultaneously"
+msgstr ""
+
+#: elf32-v850.c:1071
+msgid "FAILED to find previous HI16 reloc\n"
+msgstr ""
+
+#: elf32-v850.c:1686
+msgid "could not locate special linker symbol __gp"
+msgstr ""
+
+#: elf32-v850.c:1690
+msgid "could not locate special linker symbol __ep"
+msgstr ""
+
+#: elf32-v850.c:1694
+msgid "could not locate special linker symbol __ctbp"
+msgstr ""
+
+#: elf32-v850.c:1880
+#, c-format
+msgid "%s: Architecture mismatch with previous modules"
+msgstr ""
+
+#: elf32-v850.c:1899
+#, c-format
+msgid "private flags = %lx: "
+msgstr ""
+
+#: elf32-v850.c:1904
+msgid "v850 architecture"
+msgstr ""
+
+#: elf32-v850.c:1905
+msgid "v850e architecture"
+msgstr ""
+
+#: elf32-v850.c:1906
+msgid "v850ea architecture"
+msgstr ""
+
+#: elf64-alpha.c:949
+msgid "GPDISP relocation did not find ldah and lda instructions"
+msgstr ""
+
+#: elf64-alpha.c:2990
+#, c-format
+msgid "%s: .got subsegment exceeds 64K (size %d)"
+msgstr ""
+
+#: elf64-sparc.c:810
+#, c-format
+msgid "%s: check_relocs: unhandled reloc type %d"
+msgstr ""
+
+#: elf64-sparc.c:2181
+#, c-format
+msgid "%s: linking UltraSPARC specific with HAL specific code"
+msgstr ""
+
+#: elfcode.h:1034
+#, c-format
+msgid "%s: version count (%ld) does not match symbol count (%ld)"
+msgstr ""
+
+#: elflink.c:318
+#, c-format
+msgid "%s: Section %s is already to large to put hole of %ld bytes in"
+msgstr ""
+
+#: i386linux.c:449 m68klinux.c:453 sparclinux.c:451
+#, c-format
+msgid "Output file requires shared library `%s'\n"
+msgstr ""
+
+#: i386linux.c:457 m68klinux.c:461 sparclinux.c:459
+#, c-format
+msgid "Output file requires shared library `%s.so.%s'\n"
+msgstr ""
+
+#: i386linux.c:645 i386linux.c:695 m68klinux.c:652 m68klinux.c:700
+#: sparclinux.c:648 sparclinux.c:698
+#, c-format
+msgid "Symbol %s not defined for fixups\n"
+msgstr ""
+
+#: i386linux.c:719 m68klinux.c:724 sparclinux.c:722
+msgid "Warning: fixup count mismatch\n"
+msgstr ""
+
+#: ieee.c:167
+#, c-format
+msgid "%s: string too long (%d chars, max 65535)"
+msgstr ""
+
+#: ieee.c:297
+#, c-format
+msgid "%s: unrecognized symbol `%s' flags 0x%x"
+msgstr ""
+
+#: ieee.c:793
+#, c-format
+msgid "%s: unimplemented ATI record  %u for symbol %u"
+msgstr ""
+
+#: ieee.c:818
+#, c-format
+msgid "%s: unexpected ATN type %d in external part"
+msgstr ""
+
+#: ieee.c:840
+#, c-format
+msgid "%s: unexpected type after ATN"
+msgstr ""
+
+#: ihex.c:259
+#, c-format
+msgid "%s:%d: unexpected character `%s' in Intel Hex file\n"
+msgstr ""
+
+#: ihex.c:369
+#, c-format
+msgid "%s:%d: bad checksum in Intel Hex file (expected %u, found %u)"
+msgstr ""
+
+#: ihex.c:421
+#, c-format
+msgid "%s:%d: bad extended address record length in Intel Hex file"
+msgstr ""
+
+#: ihex.c:438
+#, c-format
+msgid "%s:%d: bad extended start address length in Intel Hex file"
+msgstr ""
+
+#: ihex.c:455
+#, c-format
+msgid "%s:%d: bad extended linear address record length in Intel Hex file"
+msgstr ""
+
+#: ihex.c:472
+#, c-format
+msgid "%s:%d: bad extended linear start address length in Intel Hex file"
+msgstr ""
+
+#: ihex.c:489
+#, c-format
+msgid "%s:%d: unrecognized ihex type %u in Intel Hex file\n"
+msgstr ""
+
+#: ihex.c:609
+#, c-format
+msgid "%s: internal error in ihex_read_section"
+msgstr ""
+
+#: ihex.c:644
+#, c-format
+msgid "%s: bad section length in ihex_read_section"
+msgstr ""
+
+#: ihex.c:858
+#, c-format
+msgid "%s: address 0x%s out of range for Intex Hex file"
+msgstr ""
+
+#: libbfd.c:481
+#, c-format
+msgid "not mapping: data=%lx mapped=%d\n"
+msgstr ""
+
+#: libbfd.c:484
+msgid "not mapping: env var not set\n"
+msgstr ""
+
+#: linker.c:2672
+#, c-format
+msgid "Attempt to do relocateable link with %s input and %s output"
+msgstr ""
+
+#: oasys.c:1016
+#, c-format
+msgid "%s: can not represent section `%s' in oasys"
+msgstr ""
+
+#: osf-core.c:146
+#, c-format
+msgid "Unhandled OSF/1 core file section type %d\n"
+msgstr ""
+
+#: ppcboot.c:418
+msgid ""
+"\n"
+"ppcboot header:\n"
+msgstr ""
+
+#: ppcboot.c:419
+#, c-format
+msgid "Entry offset        = 0x%.8lx (%ld)\n"
+msgstr ""
+
+#: ppcboot.c:420
+#, c-format
+msgid "Length              = 0x%.8lx (%ld)\n"
+msgstr ""
+
+#: ppcboot.c:423
+#, c-format
+msgid "Flag field          = 0x%.2x\n"
+msgstr ""
+
+#: ppcboot.c:429
+#, c-format
+msgid "Partition name      = \"%s\"\n"
+msgstr ""
+
+#: ppcboot.c:448
+#, c-format
+msgid ""
+"\n"
+"Partition[%d] start  = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
+msgstr ""
+
+#: ppcboot.c:454
+#, c-format
+msgid "Partition[%d] end    = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
+msgstr ""
+
+#: ppcboot.c:460
+#, c-format
+msgid "Partition[%d] sector = 0x%.8lx (%ld)\n"
+msgstr ""
+
+#: ppcboot.c:461
+#, c-format
+msgid "Partition[%d] length = 0x%.8lx (%ld)\n"
+msgstr ""
+
+#: som.c:5276
+msgid "som_sizeof_headers unimplemented"
+msgstr ""
+
+#: srec.c:290
+#, c-format
+msgid "%s:%d: Unexpected character `%s' in S-record file\n"
+msgstr ""
+
+#: syms.c:922
+msgid "Unsupported .stab relocation"
+msgstr ""
+
+#: vms-gsd.c:694
+#, c-format
+msgid "unknown gsd/egsd subtype %d"
+msgstr ""
+
+#: vms-hdr.c:407
+msgid "Object module NOT error-free !\n"
+msgstr ""
+
+#: vms-misc.c:539
+#, c-format
+msgid "Stack overflow (%d) in _bfd_vms_push"
+msgstr ""
+
+#: vms-misc.c:558
+msgid "Stack underflow in _bfd_vms_pop"
+msgstr ""
+
+#: vms-misc.c:929
+msgid "_bfd_vms_output_counted called with zero bytes"
+msgstr ""
+
+#: vms-misc.c:934
+msgid "_bfd_vms_output_counted called with too many bytes"
+msgstr ""
+
+#: vms-misc.c:1069
+#, c-format
+msgid "Symbol %s replaced by %s\n"
+msgstr ""
+
+#: vms-misc.c:1133
+#, c-format
+msgid "failed to enter %s"
+msgstr ""
+
+#: vms-tir.c:69
+msgid "No Mem !"
+msgstr ""
+
+#: vms-tir.c:309
+msgid "Bad section index in ETIR_S_C_STA_PQ"
+msgstr ""
+
+#: vms-tir.c:324
+#, c-format
+msgid "Unsupported STA cmd %d"
+msgstr ""
+
+#: vms-tir.c:329 vms-tir.c:1289
+#, c-format
+msgid "Reserved STA cmd %d"
+msgstr ""
+
+#: vms-tir.c:436
+#, c-format
+msgid "ETIR_S_C_STO_GBL: no symbol \"%s\""
+msgstr ""
+
+#: vms-tir.c:457
+#, c-format
+msgid "ETIR_S_C_STO_CA: no symbol \"%s\""
+msgstr ""
+
+#: vms-tir.c:470
+msgid "ETIR_S_C_STO_RB/AB: Not supported"
+msgstr ""
+
+#: vms-tir.c:528
+msgid "ETIR_S_C_STO_LP_PSB: Not supported"
+msgstr ""
+
+#: vms-tir.c:534
+msgid "ETIR_S_C_STO_HINT_GBL: not implemented"
+msgstr ""
+
+#: vms-tir.c:540
+msgid "ETIR_S_C_STO_HINT_PS: not implemented"
+msgstr ""
+
+#: vms-tir.c:544 vms-tir.c:1462
+#, c-format
+msgid "Reserved STO cmd %d"
+msgstr ""
+
+#: vms-tir.c:657
+msgid "ETIR_S_C_OPR_INSV: Not supported"
+msgstr ""
+
+#: vms-tir.c:675
+msgid "ETIR_S_C_OPR_USH: Not supported"
+msgstr ""
+
+#: vms-tir.c:681
+msgid "ETIR_S_C_OPR_ROT: Not supported"
+msgstr ""
+
+#: vms-tir.c:700
+msgid "ETIR_S_C_OPR_REDEF: Not supported"
+msgstr ""
+
+#: vms-tir.c:706
+msgid "ETIR_S_C_OPR_DFLIT: Not supported"
+msgstr ""
+
+#: vms-tir.c:710 vms-tir.c:1658
+#, c-format
+msgid "Reserved OPR cmd %d"
+msgstr ""
+
+#: vms-tir.c:779 vms-tir.c:1728
+#, c-format
+msgid "Reserved CTL cmd %d"
+msgstr ""
+
+#: vms-tir.c:808
+msgid "ETIR_S_C_STC_LP: not supported"
+msgstr ""
+
+#: vms-tir.c:826
+msgid "ETIR_S_C_STC_GBL: not supported"
+msgstr ""
+
+#: vms-tir.c:834
+msgid "ETIR_S_C_STC_GCA: not supported"
+msgstr ""
+
+#: vms-tir.c:843
+msgid "ETIR_S_C_STC_PS: not supported"
+msgstr ""
+
+#.
+#. * stack byte from image
+#. * arg: -
+#. *
+#.
+#: vms-tir.c:1189
+msgid "Stack-from-image not implemented"
+msgstr ""
+
+#: vms-tir.c:1209
+msgid "Stack-entry-mask not fully implemented"
+msgstr ""
+
+#.
+#. * compare procedure argument
+#. * arg: cs	symbol name
+#. *	by	argument index
+#. *	da	argument descriptor
+#. *
+#. * compare argument descriptor with symbol argument (ARG$V_PASSMECH)
+#. * and stack TRUE (args match) or FALSE (args dont match) value
+#.
+#: vms-tir.c:1225
+msgid "PASSMECH not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1245
+msgid "Stack-local-symbol not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1260
+msgid "Stack-literal not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1282
+msgid "Stack-local-symbol-entry-point-mask not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1458
+#, c-format
+msgid "Unimplemented STO cmd %d"
+msgstr ""
+
+#: vms-tir.c:1598
+msgid "TIR_S_C_OPR_ASH incomplete"
+msgstr ""
+
+#: vms-tir.c:1612
+msgid "TIR_S_C_OPR_USH incomplete"
+msgstr ""
+
+#: vms-tir.c:1626
+msgid "TIR_S_C_OPR_ROT incomplete"
+msgstr ""
+
+#.
+#. * redefine symbol to current location
+#.
+#: vms-tir.c:1647
+msgid "TIR_S_C_OPR_REDEF not supported"
+msgstr ""
+
+#.
+#. * define a literal
+#.
+#: vms-tir.c:1654
+msgid "TIR_S_C_OPR_DFLIT not supported"
+msgstr ""
+
+#: vms-tir.c:1709
+msgid "TIR_S_C_CTL_DFLOC not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1717
+msgid "TIR_S_C_CTL_STLOC not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1725
+msgid "TIR_S_C_CTL_STKDL not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1780
+#, c-format
+msgid "Obj code %d not found"
+msgstr ""
+
+#: vms-tir.c:2129
+#, c-format
+msgid "SEC_RELOC with no relocs in section %s"
+msgstr ""
+
+#: vms-tir.c:2403
+#, c-format
+msgid "Unhandled relocation %s"
+msgstr ""
+
+#: xcofflink.c:1661
+#, c-format
+msgid "%s: `%s' has line numbers but no enclosing section"
+msgstr ""
+
+#: xcofflink.c:1713
+#, c-format
+msgid "%s: class %d symbol `%s' has no aux entries"
+msgstr ""
+
+#: xcofflink.c:1736
+#, c-format
+msgid "%s: symbol `%s' has unrecognized csect type %d"
+msgstr ""
+
+#: xcofflink.c:1748
+#, c-format
+msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"
+msgstr ""
+
+#: xcofflink.c:1787
+#, c-format
+msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d"
+msgstr ""
+
+#: xcofflink.c:1911
+#, c-format
+msgid "%s: symbol `%s' has unrecognized smclas %d"
+msgstr ""
+
+#: xcofflink.c:1930
+#, c-format
+msgid "%s: csect `%s' not in enclosing section"
+msgstr ""
+
+#: xcofflink.c:2034
+#, c-format
+msgid "%s: misplaced XTY_LD `%s'"
+msgstr ""
+
+#: xcofflink.c:2345
+#, c-format
+msgid "%s: reloc %s:%d not in csect"
+msgstr ""
+
+#: xcofflink.c:2480
+#, c-format
+msgid "%s: XCOFF shared object when not producing XCOFF output"
+msgstr ""
+
+#: xcofflink.c:2501
+#, c-format
+msgid "%s: dynamic object with no .loader section"
+msgstr ""
+
+#: xcofflink.c:3141
+#, c-format
+msgid "%s: no such symbol"
+msgstr ""
+
+#: xcofflink.c:3728
+#, c-format
+msgid "warning: attempt to export undefined symbol `%s'"
+msgstr ""
+
+#: xcofflink.c:4704
+#, c-format
+msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling"
+msgstr ""
+
+#: xcofflink.c:5529 xcofflink.c:5885 xcofflink.c:5922 xcofflink.c:6239
+#, c-format
+msgid "%s: loader reloc in unrecognized section `%s'"
+msgstr ""
+
+#: xcofflink.c:5551 xcofflink.c:6250
+#, c-format
+msgid "%s: `%s' in loader reloc but not loader sym"
+msgstr ""
+
+#: xcofflink.c:5566
+#, c-format
+msgid "%s: loader reloc in read-only section %s"
+msgstr ""
+
+#: xcofflink.c:6446
+#, c-format
+msgid "%s: unsupported relocation type 0x%02x"
+msgstr ""
+
+#: xcofflink.c:6492
+#, c-format
+msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
+msgstr ""
diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c
index cbda407..d9db826 100644
--- a/bfd/ppcboot.c
+++ b/bfd/ppcboot.c
@@ -1,5 +1,5 @@
 /* BFD back-end for PPCbug boot records.
-   Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Michael Meissner, Cygnus Support, <meissner@cygnus.com>
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -225,7 +225,7 @@
 static boolean
 ppcboot_get_section_contents (abfd, section, location, offset, count)
      bfd *abfd;
-     asection *section;
+     asection *section ATTRIBUTE_UNUSED;
      PTR location;
      file_ptr offset;
      bfd_size_type count;
@@ -241,7 +241,7 @@
 
 static long
 ppcboot_get_symtab_upper_bound (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
   return (PPCBOOT_SYMS + 1) * sizeof (asymbol *);
 }
@@ -340,7 +340,7 @@
 
 static void
 ppcboot_get_symbol_info (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -395,8 +395,8 @@
 
 static int
 ppcboot_sizeof_headers (abfd, exec)
-     bfd *abfd;
-     boolean exec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean exec ATTRIBUTE_UNUSED;
 {
   return sizeof (ppcboot_hdr_t);
 }
@@ -531,5 +531,7 @@
   BFD_JUMP_TABLE_LINK (ppcboot),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   NULL
 };
diff --git a/bfd/ptrace-core.c b/bfd/ptrace-core.c
index 2b4fdbb..0969dce 100644
--- a/bfd/ptrace-core.c
+++ b/bfd/ptrace-core.c
@@ -224,6 +224,8 @@
        BFD_JUMP_TABLE_LINK (_bfd_nolink),
        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+    NULL,
+    
     (PTR) 0			/* backend_data */
 };
 
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 8885814..a1713b2 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -389,6 +389,14 @@
 
 .#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
 .
+
+DESCRIPTION
+	This is used to fill in an empty howto entry in an array.
+
+.#define EMPTY_HOWTO(C) \
+.  HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false)
+.
+
 DESCRIPTION
 	Helper routine to turn a symbol into a relocation value.
 
@@ -1405,7 +1413,7 @@
      bfd_byte *location;
 {
   int size;
-  bfd_vma x;
+  bfd_vma x = 0;
   boolean overflow;
   unsigned int rightshift = howto->rightshift;
   unsigned int bitpos = howto->bitpos;
@@ -1560,6 +1568,15 @@
 
 	  /* We just assume (b & ~ fieldmask) == 0.  */
 
+	  /* We explicitly permit wrap around if this relocation
+	     covers the high bit of an address.  The Linux kernel
+	     relies on it, and it is the only way to write assembler
+	     code which can run when loaded at a location 0x80000000
+	     away from the location at which it is linked.  */
+	  if (howto->bitsize + rightshift
+	      == bfd_arch_bits_per_address (input_bfd))
+	    break;
+
 	  sum = a + b;
 	  if (sum < a || (sum & ~ fieldmask) != 0)
 	    {
@@ -2028,6 +2045,14 @@
   BFD_RELOC_MIPS_CALL_HI16
 ENUMX
   BFD_RELOC_MIPS_CALL_LO16
+ENUMX
+  BFD_RELOC_MIPS_SUB
+ENUMX
+  BFD_RELOC_MIPS_GOT_PAGE
+ENUMX
+  BFD_RELOC_MIPS_GOT_OFST
+ENUMX
+  BFD_RELOC_MIPS_GOT_DISP
 COMMENT
 ENUMDOC
   MIPS ELF relocations.
@@ -2158,6 +2183,8 @@
 ENUM
   BFD_RELOC_ARM_IMMEDIATE
 ENUMX
+  BFD_RELOC_ARM_ADRL_IMMEDIATE
+ENUMX
   BFD_RELOC_ARM_OFFSET_IMM
 ENUMX
   BFD_RELOC_ARM_SHIFT_IMM
@@ -2537,6 +2564,8 @@
   BFD_RELOC_MCORE_PCREL_32
 ENUMX
   BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2
+ENUMX
+  BFD_RELOC_MCORE_RVA
 ENUMDOC
   Motorola Mcore relocations.
   
@@ -2680,9 +2709,9 @@
 /*ARGSUSED*/
 boolean
 bfd_generic_relax_section (abfd, section, link_info, again)
-     bfd *abfd;
-     asection *section;
-     struct bfd_link_info *link_info;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
      boolean *again;
 {
   *again = false;
@@ -2705,8 +2734,8 @@
 /*ARGSUSED*/
 boolean
 bfd_generic_gc_sections (abfd, link_info)
-     bfd *abfd;
-     struct bfd_link_info *link_info;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
 {
   return true;
 }
diff --git a/bfd/riscix.c b/bfd/riscix.c
index f5ab49a..b3eb18c 100644
--- a/bfd/riscix.c
+++ b/bfd/riscix.c
@@ -1,5 +1,5 @@
 /* BFD back-end for RISC iX (Acorn, arm) binaries.
-   Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
    
 This file is part of BFD, the Binary File Descriptor library.
@@ -154,7 +154,7 @@
   HOWTO( 5,              0,  1,   16, true,  0, complain_overflow_signed,  0,"DISP16",    true, 0x0000ffff,0x0000ffff, true),
   HOWTO( 6,              0,  2,   32, true,  0, complain_overflow_signed,  0,"DISP32",    true, 0xffffffff,0xffffffff, true),
   HOWTO( 7,              2,  3,   26, false, 0, complain_overflow_signed,  riscix_fix_pcrel_26_done, "ARM26D",true,0x00ffffff,0x00ffffff, false),
-  {-1},
+  EMPTY_HOWTO (-1),
   HOWTO( 9,              0, -1,   16, false, 0, complain_overflow_bitfield,0,"NEG16",        true, 0x0000ffff,0x0000ffff, false),
   HOWTO( 10,              0, -2,   32, false, 0, complain_overflow_bitfield,0,"NEG32",        true, 0xffffffff,0xffffffff, false)
 };
@@ -166,13 +166,13 @@
 static bfd_reloc_status_type
 riscix_fix_pcrel_26_done (abfd, reloc_entry, symbol, data, input_section,
 			  output_bfd, error_message)
-     bfd *abfd;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc_entry ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *input_section ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   /* This is dead simple at present.  */
   return bfd_reloc_ok;
@@ -187,7 +187,7 @@
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_vma relocation;
   bfd_size_type addr = reloc_entry->address;
diff --git a/bfd/sco5-core.c b/bfd/sco5-core.c
index f10c8f1..46c97d2 100644
--- a/bfd/sco5-core.c
+++ b/bfd/sco5-core.c
@@ -425,5 +425,7 @@
        BFD_JUMP_TABLE_LINK (_bfd_nolink),
        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+    NULL,
+    
     (PTR) 0                     /* backend_data */
 };
diff --git a/bfd/section.c b/bfd/section.c
index 18778b5..3e0aa2b 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -1,5 +1,5 @@
 /* Object file "section" support for the BFD library.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -307,6 +307,10 @@
 .	{* This section should not be subject to garbage collection.  *}
 .#define SEC_KEEP 0x1000000
 .
+.	{* This section contains "short" data, and should be placed
+.	   "near" the GP.  *}
+.#define SEC_SHORT 0x2000000
+.
 .	{*  End of section flags.  *}
 .
 .	{* Some internal packed boolean fields.  *}
@@ -482,10 +486,14 @@
 static const asymbol global_syms[] =
 {
  /* the_bfd, name, value, attr, section [, udata] */
-  {0, BFD_COM_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_com_section},
-  {0, BFD_UND_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_und_section},
-  {0, BFD_ABS_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_abs_section},
-  {0, BFD_IND_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_ind_section},
+  {0, BFD_COM_SECTION_NAME, 0, BSF_SECTION_SYM,
+   (asection *) &bfd_com_section, { 0 }},
+  {0, BFD_UND_SECTION_NAME, 0, BSF_SECTION_SYM,
+   (asection *) &bfd_und_section, { 0 }},
+  {0, BFD_ABS_SECTION_NAME, 0, BSF_SECTION_SYM,
+   (asection *) &bfd_abs_section, { 0 }},
+  {0, BFD_IND_SECTION_NAME, 0, BSF_SECTION_SYM,
+   (asection *) &bfd_ind_section, { 0 }},
 };
 
 #define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX)	\
@@ -733,7 +741,7 @@
 /*ARGSUSED*/
 boolean
 bfd_set_section_flags (abfd, section, flags)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      sec_ptr section;
      flagword flags;
 {
@@ -1046,30 +1054,32 @@
   asection **spp, *os;
   struct bfd_link_order *p, *pp;
 
+  /* Excise the input section from the link order.  */
   os = s->output_section;
   for (p = os->link_order_head, pp = NULL; p != NULL; pp = p, p = p->next)
     if (p->type == bfd_indirect_link_order
 	&& p->u.indirect.section == s)
       {
-	/* Excise the input section.  */
 	if (pp)
 	  pp->next = p->next;
 	else
 	  os->link_order_head = p->next;
 	if (!p->next)
 	  os->link_order_tail = pp;
-
-	if (!os->link_order_head)
-	  {
-	    /* Excise the output section.  */
-	    for (spp = &os->owner->sections; *spp; spp = &(*spp)->next)
-	      if (*spp == os)
-		{
-		  *spp = os->next;
-		  os->owner->section_count--;
-		  break;
-		}
-	  }
 	break;
       }
+
+  /* If the output section is empty, remove it too.  Careful about sections
+     that have been discarded in the link script -- they are mapped to 
+     bfd_abs_section, which has no owner.  */
+  if (!os->link_order_head && os->owner)
+    {
+      for (spp = &os->owner->sections; *spp; spp = &(*spp)->next)
+	if (*spp == os)
+	  {
+	    *spp = os->next;
+	    os->owner->section_count--;
+	    break;
+	  }
+    }
 }
diff --git a/bfd/som.c b/bfd/som.c
index b5786b5..4f6b11f 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -440,9 +440,7 @@
   1,    "Lb4*=Mb1+L*=",	/* 0x2b */
   2,    "Lb4*=Md1+4*=",	/* 0x2c */
   3,    "Ld1+=Me1+=",	/* 0x2d */
-  /* R_SHORT_PCREL_MODE */
   0,   	"",	        /* 0x2e */
-  /* R_LONG_PCREL_MODE */
   0,   	"",	        /* 0x2f */
   /* R_PCREL_CALL */
   0,    "L4=RD=Sb=",	/* 0x30 */
@@ -459,8 +457,9 @@
   1,    "L4=RD8<b+=Sb=",/* 0x3b */
   0,    "L4=RD8<b+=Sd=",/* 0x3c */
   1,    "L4=RD8<b+=Sd=",/* 0x3d */
-  /* R_RESERVED */
+  /* R_SHORT_PCREL_MODE */
   0,    "",	        /* 0x3e */
+  /* R_LONG_PCREL_MODE */
   0,    "",	        /* 0x3f */
   /* R_ABS_CALL */
   0,    "L4=RD=Sb=",	/* 0x40 */
@@ -6258,6 +6257,8 @@
   BFD_JUMP_TABLE_LINK (som),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0
 };
 
diff --git a/bfd/sparclinux.c b/bfd/sparclinux.c
index 86d4e7e..73a29b3 100644
--- a/bfd/sparclinux.c
+++ b/bfd/sparclinux.c
@@ -1,5 +1,6 @@
 /* BFD back-end for linux flavored sparc a.out binaries.
-   Copyright (C) 1992, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -299,7 +300,7 @@
 static boolean
 linux_link_create_dynamic_sections (abfd, info)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
 {
   flagword flags;
   register asection *s;
diff --git a/bfd/srec.c b/bfd/srec.c
index 70d2f96..aefdc64 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -1139,8 +1139,8 @@
 /*ARGSUSED*/
 static int
 srec_sizeof_headers (abfd, exec)
-     bfd *abfd;
-     boolean exec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean exec ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -1209,7 +1209,7 @@
 /*ARGSUSED*/
 static void
 srec_get_symbol_info (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -1219,7 +1219,7 @@
 /*ARGSUSED*/
 static void
 srec_print_symbol (ignore_abfd, afile, symbol, how)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      PTR afile;
      asymbol *symbol;
      bfd_print_symbol_type how;
@@ -1318,6 +1318,8 @@
   BFD_JUMP_TABLE_LINK (srec),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0
 };
 
@@ -1373,5 +1375,7 @@
   BFD_JUMP_TABLE_LINK (srec),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0
 };
diff --git a/bfd/stabs.c b/bfd/stabs.c
index ffc000d..ea4da8f 100644
--- a/bfd/stabs.c
+++ b/bfd/stabs.c
@@ -1,5 +1,5 @@
 /* Stabs in sections linking support.
-   Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -619,8 +619,8 @@
 
 bfd_vma
 _bfd_stab_section_offset (output_bfd, psinfo, stabsec, psecinfo, offset)
-     bfd *output_bfd;
-     PTR *psinfo;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     PTR *psinfo ATTRIBUTE_UNUSED;
      asection *stabsec;
      PTR *psecinfo;
      bfd_vma offset;
diff --git a/bfd/sunos.c b/bfd/sunos.c
index e34f878..ada6857 100644
--- a/bfd/sunos.c
+++ b/bfd/sunos.c
@@ -1,5 +1,5 @@
 /* BFD backend for SunOS binaries.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -1257,7 +1257,7 @@
 /*ARGSUSED*/
 struct bfd_link_needed_list *
 bfd_sunos_get_needed_list (abfd, info)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      struct bfd_link_info *info;
 {
   if (info->hash->creator != &MY(vec))
@@ -1607,7 +1607,7 @@
 sunos_scan_std_relocs (info, abfd, sec, relocs, rel_size)
      struct bfd_link_info *info;
      bfd *abfd;
-     asection *sec;
+     asection *sec ATTRIBUTE_UNUSED;
      const struct reloc_std_external *relocs;
      bfd_size_type rel_size;
 {
@@ -1767,7 +1767,7 @@
 sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size)
      struct bfd_link_info *info;
      bfd *abfd;
-     asection *sec;
+     asection *sec ATTRIBUTE_UNUSED;
      const struct reloc_ext_external *relocs;
      bfd_size_type rel_size;
 {
@@ -2173,8 +2173,8 @@
 /*ARGSUSED*/
 static boolean
 sunos_link_dynamic_object (info, abfd)
-     struct bfd_link_info *info;
-     bfd *abfd;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
   return true;
 }
@@ -2427,7 +2427,7 @@
      asection *input_section;
      struct aout_link_hash_entry *harg;
      PTR reloc;
-     bfd_byte *contents;
+     bfd_byte *contents ATTRIBUTE_UNUSED;
      boolean *skip;
      bfd_vma *relocationp;
 {
diff --git a/bfd/syms.c b/bfd/syms.c
index f69d1f2..108e3ea 100644
--- a/bfd/syms.c
+++ b/bfd/syms.c
@@ -1,5 +1,5 @@
 /* Generic symbol-table support for the BFD library.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -698,10 +698,10 @@
 /*ARGSUSED*/
 asymbol *
 _bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym)
-     bfd *abfd;
-     boolean dynamic;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean dynamic ATTRIBUTE_UNUSED;
      const PTR minisym;
-     asymbol *sym;
+     asymbol *sym ATTRIBUTE_UNUSED;
 {
   return *(asymbol **) minisym;
 }
@@ -796,7 +796,8 @@
 {
   struct stab_find_info *info;
   bfd_size_type stabsize, strsize;
-  bfd_byte *stab, *str, *last_stab;
+  bfd_byte *stab, *str;
+  bfd_byte *last_stab = NULL;
   bfd_size_type stroff;
   struct indexentry *indexentry;
   char *directory_name, *file_name;
@@ -1032,23 +1033,24 @@
 		  file_name = NULL;
 		  saw_fun = 1;
 		}
-	      else {
-		last_stab = stab;
-		if (stab + STABSIZE >= info->stabs + stabsize
-		    || *(stab + STABSIZE + TYPEOFF) != N_SO)
-		  {
-		    directory_name = NULL;
-		  }
-		else
-		  {
-		    /* Two consecutive N_SOs are a directory and a file
-		       name.  */
-		    stab += STABSIZE;
-		    directory_name = file_name;
-		    file_name = ((char *) str
-				 + bfd_get_32 (abfd, stab + STRDXOFF));
-		  }
-	      }
+	      else
+		{
+		  last_stab = stab;
+		  if (stab + STABSIZE >= info->stabs + stabsize
+		      || *(stab + STABSIZE + TYPEOFF) != N_SO)
+		    {
+		      directory_name = NULL;
+		    }
+		  else
+		    {
+		      /* Two consecutive N_SOs are a directory and a
+			 file name.  */
+		      stab += STABSIZE;
+		      directory_name = file_name;
+		      file_name = ((char *) str
+				   + bfd_get_32 (abfd, stab + STRDXOFF));
+		    }
+		}
 	      break;
 
 	    case N_SOL:
diff --git a/bfd/targets.c b/bfd/targets.c
index bb6e51d..f7ad7b0 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -1,5 +1,5 @@
 /* Generic target-file-type support for the BFD library.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -460,10 +460,21 @@
 .    PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
 .
 
+A pointer to an alternative bfd_target in case the current one is not
+satisfactory.  This can happen when the target cpu supports both big
+and little endian code, and target chosen by the linker has the wrong
+endianness.  The function open_output() in ld/ldlang.c uses this field
+to find an alternative output format that is suitable.
+
+. {* 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.
 
 . PTR backend_data;
+. 
 .} bfd_target;
 
 */
@@ -507,6 +518,7 @@
 extern const bfd_target bfd_elf32_hppa_vec;
 extern const bfd_target bfd_elf32_i386_vec;
 extern const bfd_target bfd_elf32_i860_vec;
+extern const bfd_target bfd_elf32_i960_vec;
 extern const bfd_target bfd_elf32_little_generic_vec;
 extern const bfd_target bfd_elf32_littlemips_vec;
 extern const bfd_target bfd_elf64_littlemips_vec;
@@ -680,6 +692,7 @@
 	&bfd_elf32_hppa_vec,
 	&bfd_elf32_i386_vec,
 	&bfd_elf32_i860_vec,
+	&bfd_elf32_i960_vec,
 	&bfd_elf32_little_generic_vec,
 	&bfd_elf32_littlearc_vec,
         &bfd_elf32_littlearm_vec,
@@ -1077,3 +1090,32 @@
 
   return name_list;
 }
+
+/*
+FUNCTION
+	bfd_seach_for_target
+
+SYNOPSIS
+	const bfd_target * bfd_search_for_target (int (* search_func)(const bfd_target *, void *), void *);
+
+DESCRIPTION
+	Return a pointer to the first transfer vector in the list of
+	transfer vectors maintained by BFD that produces a non-zero
+	result when passed to the function @var{search_func}.  The
+	parameter @var{data} is passed, unexamined, to the search
+	function.
+*/
+
+const bfd_target *
+bfd_search_for_target (search_func, data)
+     int (* search_func) PARAMS ((const bfd_target * target, void * data));
+     void * data;
+{
+  const bfd_target * const * target;
+
+  for (target = bfd_target_vector; * target != NULL; target ++)
+    if (search_func (* target, data))
+      return * target;
+
+  return NULL;
+}
diff --git a/bfd/tekhex.c b/bfd/tekhex.c
index c88fe2d..b1ffe75 100644
--- a/bfd/tekhex.c
+++ b/bfd/tekhex.c
@@ -1,5 +1,6 @@
 /* BFD backend for Extended Tektronix Hex Format  objects.
-   Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -599,7 +600,7 @@
      bfd *abfd;
      asection *section;
      PTR locationp;
-     file_ptr offset;
+     file_ptr offset ATTRIBUTE_UNUSED;
      bfd_size_type count;
      boolean get;
 {
@@ -928,8 +929,8 @@
 
 static int
 tekhex_sizeof_headers (abfd, exec)
-     bfd *abfd;
-     boolean exec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean exec ATTRIBUTE_UNUSED;
 
 {
   return 0;
@@ -951,7 +952,7 @@
 
 static void
 tekhex_get_symbol_info (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -960,7 +961,7 @@
 
 static void
 tekhex_print_symbol (ignore_abfd, filep, symbol, how)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      PTR filep;
      asymbol *symbol;
      bfd_print_symbol_type how;
@@ -1061,5 +1062,7 @@
   BFD_JUMP_TABLE_LINK (tekhex),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0
 };
diff --git a/bfd/trad-core.c b/bfd/trad-core.c
index 21d920b..2a6f69b 100644
--- a/bfd/trad-core.c
+++ b/bfd/trad-core.c
@@ -1,5 +1,5 @@
 /* BFD back end for traditional Unix core files (U-area and raw sections)
-   Copyright 1988, 89, 91, 92, 93, 94, 95, 96, 1998
+   Copyright 1988, 89, 91, 92, 93, 94, 95, 96, 98, 1999
    Free Software Foundation, Inc.
    Written by John Gilmore of Cygnus Support.
 
@@ -105,22 +105,24 @@
 	bfd_set_error (bfd_error_system_call);
 	return 0;
       }
-    if (NBPG * (UPAGES + u.u_dsize
+    if ((unsigned long) (NBPG * (UPAGES + u.u_dsize
 #ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE
-		- u.u_tsize
+				 - u.u_tsize
 #endif
-		+ u.u_ssize) > statbuf.st_size)
+				 + u.u_ssize))
+	> (unsigned long) statbuf.st_size)
       {
 	bfd_set_error (bfd_error_file_truncated);
 	return 0;
       }
 #ifndef TRAD_CORE_ALLOW_ANY_EXTRA_SIZE
-    if (NBPG * (UPAGES + u.u_dsize + u.u_ssize)
+    if ((unsigned long) (NBPG * (UPAGES + u.u_dsize + u.u_ssize)
 #ifdef TRAD_CORE_EXTRA_SIZE_ALLOWED
 	/* Some systems write the file too big.  */
-	+ TRAD_CORE_EXTRA_SIZE_ALLOWED
+			 + TRAD_CORE_EXTRA_SIZE_ALLOWED
 #endif
-	< statbuf.st_size)
+			 )
+	< (unsigned long) statbuf.st_size)
       {
 	/* The file is too big.  Maybe it's not a core file
 	   or we otherwise have bad values for u_dsize and u_ssize).  */
@@ -239,7 +241,7 @@
 /* ARGSUSED */
 int
 trad_unix_core_file_failing_signal (ignore_abfd)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
 {
 #ifdef TRAD_UNIX_CORE_FILE_FAILING_SIGNAL
   return TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(ignore_abfd);
@@ -251,7 +253,8 @@
 /* ARGSUSED */
 boolean
 trad_unix_core_file_matches_executable_p  (core_bfd, exec_bfd)
-     bfd *core_bfd, *exec_bfd;
+     bfd *core_bfd ATTRIBUTE_UNUSED;
+     bfd *exec_bfd ATTRIBUTE_UNUSED;
 {
   return true;		/* FIXME, We have no way of telling at this point */
 }
@@ -312,5 +315,7 @@
        BFD_JUMP_TABLE_LINK (_bfd_nolink),
        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+    NULL,
+    
     (PTR) 0			/* backend_data */
 };
diff --git a/bfd/versados.c b/bfd/versados.c
index 0dcd108..27f4f88 100644
--- a/bfd/versados.c
+++ b/bfd/versados.c
@@ -1,5 +1,5 @@
 /* BFD back-end for VERSAdos-E objects.
-   Copyright 1995, 96, 1997 Free Software Foundation, Inc.
+   Copyright 1995, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
 
    Versados is a Motorola trademark.
@@ -690,11 +690,11 @@
 
 static boolean
 versados_set_section_contents (abfd, section, location, offset, bytes_to_do)
-     bfd *abfd;
-     sec_ptr section;
-     PTR location;
-     file_ptr offset;
-     bfd_size_type bytes_to_do;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     sec_ptr section ATTRIBUTE_UNUSED;
+     PTR location ATTRIBUTE_UNUSED;
+     file_ptr offset ATTRIBUTE_UNUSED;
+     bfd_size_type bytes_to_do ATTRIBUTE_UNUSED;
 {
   return false;
 }
@@ -703,8 +703,8 @@
 /*ARGSUSED */
 static int
 versados_sizeof_headers (abfd, exec)
-     bfd *abfd;
-     boolean exec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean exec ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -756,7 +756,7 @@
 /*ARGSUSED */
 void
 versados_get_symbol_info (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -766,7 +766,7 @@
 /*ARGSUSED */
 void
 versados_print_symbol (ignore_abfd, afile, symbol, how)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      PTR afile;
      asymbol *symbol;
      bfd_print_symbol_type how;
@@ -788,7 +788,7 @@
 
 long
 versados_get_reloc_upper_bound (abfd, asect)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      sec_ptr asect;
 {
   return (asect->reloc_count + 1) * sizeof (arelent *);
@@ -919,5 +919,7 @@
   BFD_JUMP_TABLE_LINK (versados),
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
+  NULL,
+  
   (PTR) 0
 };
diff --git a/bfd/vms-gsd.c b/bfd/vms-gsd.c
index 6a52462..ac3fe69 100644
--- a/bfd/vms-gsd.c
+++ b/bfd/vms-gsd.c
@@ -1,6 +1,6 @@
 /* vms-gsd.c -- BFD back-end for VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright 1996, 1997, 1998 Free Software Foundation Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation Inc.
 
    go and read the openVMS linker manual (esp. appendix B)
    if you don't know what's going on here :-)
@@ -282,7 +282,7 @@
   vms_symbol_entry *entry;
   unsigned long base_addr;
   unsigned long align_addr;
-  static int psect_idx = 0;
+  static unsigned int psect_idx = 0;
 
 #if VMS_DEBUG
   vms_debug (2, "GSD/EGSD (%d/%x)\n", objtype, objtype);
@@ -354,7 +354,8 @@
 	      section = bfd_make_section (abfd, name);
 	      if (!section)
 		{
-		  fprintf (stderr, "bfd_make_section (%s) failed\n", name);
+		  (*_bfd_error_handler) (_("bfd_make_section (%s) failed"),
+					 name);
 		  return -1;
 		}
 	      old_flags = bfd_getl16 (vms_rec + 2);
@@ -366,7 +367,9 @@
 		new_flags |= SEC_IS_COMMON;
 	      if (!bfd_set_section_flags (abfd, section, new_flags))
 		{
-		  fprintf (stderr, "bfd_set_section_flags (%s, %x) failed\n", name, new_flags);
+		  (*_bfd_error_handler)
+		    (_("bfd_set_section_flags (%s, %x) failed"),
+		     name, new_flags);
 		  return -1;
 		}
 	      section->alignment_power = vms_rec[1];
@@ -400,7 +403,12 @@
 		  section->contents = old_section->contents;
 		  if (section->_raw_size < old_section->_raw_size)
 		    {
-		      fprintf (stderr, "Size mismatch section %s=%d, %s=%d\n", old_section->name, old_section->_raw_size, section->name, section->_raw_size);
+		      (*_bfd_error_handler)
+			(_("Size mismatch section %s=%lx, %s=%lx"),
+			 old_section->name,
+			 (unsigned long) old_section->_raw_size,
+			 section->name,
+			 (unsigned long) section->_raw_size);
 		      return -1;
 		    }
 		  else if (section->_raw_size > old_section->_raw_size)
@@ -716,16 +724,15 @@
 int
 _bfd_vms_write_gsd (abfd, objtype)
      bfd *abfd;
-     int objtype;
+     int objtype ATTRIBUTE_UNUSED;
 {
   asection *section;
   asymbol *symbol;
-  int symnum;
+  unsigned int symnum;
   int last_index = -1;
   char dummy_name[10];
   char *sname;
   flagword new_flags, old_flags;
-  char *nptr, *uptr;
 
 #if VMS_DEBUG
   vms_debug (2, "vms_write_gsd (%p, %d)\n", abfd, objtype);
diff --git a/bfd/vms-hdr.c b/bfd/vms-hdr.c
index 01d20aa..3b36b32 100644
--- a/bfd/vms-hdr.c
+++ b/bfd/vms-hdr.c
@@ -1,6 +1,6 @@
 /* vms-hdr.c -- BFD back-end for VMS/VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
    HDR record handling functions
    EMH record handling functions
@@ -249,7 +249,7 @@
      int objtype;
 {
   asymbol *symbol;
-  int symnum;
+  unsigned int symnum;
   int had_case = 0;
   int had_file = 0;
 
@@ -334,8 +334,6 @@
 
       if (symbol->flags & BSF_FILE)
 	{
-	  char *s;
-
 	  if (strncmp ((char *)symbol->name, "<CASE:", 6) == 0)
 	    {
 	      PRIV(flag_hash_long_names) = symbol->name[6] - '0';
diff --git a/bfd/vms-misc.c b/bfd/vms-misc.c
index a5fdae4..311192c 100644
--- a/bfd/vms-misc.c
+++ b/bfd/vms-misc.c
@@ -1,6 +1,6 @@
 /* vms-misc.c -- Miscellaneous functions for VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
    Written by Klaus K"ampf (kkaempf@rmi.de)
 
@@ -198,11 +198,12 @@
 	  bfd_set_error (bfd_error_no_memory);
 	  return (struct bfd_hash_entry *)NULL;
 	}
+      entry = (struct bfd_hash_entry *) ret;
     }
 
   /* Call the allocation method of the base class.  */
 
-  ret = (vms_symbol_entry *) bfd_hash_newfunc ((struct bfd_hash_entry *)ret, table, string);
+  ret = (vms_symbol_entry *) bfd_hash_newfunc (entry, table, string);
 #if VMS_DEBUG
   vms_debug (6, "_bfd_vms_hash_newfunc ret %p\n", ret);
 #endif
@@ -219,7 +220,7 @@
 
 void
 _bfd_vms_get_header_values (abfd, buf, type, length)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      unsigned char *buf;
      int *type;
      int *length;
@@ -343,7 +344,8 @@
   /* read the record header on Alpha.  */
 
   if ((test_len != 0)
-      && (bfd_read (PRIV(vms_buf), 1, test_len, abfd) != test_len))
+      && (bfd_read (PRIV(vms_buf), 1, test_len, abfd)
+	  != (bfd_size_type) test_len))
     {
       bfd_set_error (bfd_error_file_truncated);
       return 0;
@@ -418,7 +420,8 @@
 #if VMS_DEBUG
       vms_debug (10, "bfd_read remaining %d\n", remaining);
 #endif
-      if (bfd_read (vms_buf + test_len, 1, remaining, abfd) != remaining)
+      if (bfd_read (vms_buf + test_len, 1, remaining, abfd) !=
+	  (bfd_size_type) remaining)
 	{
 	  bfd_set_error (bfd_error_file_truncated);
 	  return 0;
@@ -1007,10 +1010,8 @@
      const char *in;
      int maxlen;
 {
-  long int init;
   long int result;
   int in_len;
-  char *pnt = 0;
   char *new_name;
   const char *old_name;
   int i;
@@ -1054,7 +1055,7 @@
 
   if ((in_len > maxlen)
       && PRIV(flag_hash_long_names))
-    sprintf (out, "_%08x", result);
+    sprintf (out, "_%08lx", result);
   else
     *out = 0;
 
diff --git a/bfd/vms-tir.c b/bfd/vms-tir.c
index 782f52b..124b1b3 100644
--- a/bfd/vms-tir.c
+++ b/bfd/vms-tir.c
@@ -1,6 +1,6 @@
 /* vms-tir.c -- BFD back-end for VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
    TIR record handling functions
    ETIR record handling functions
@@ -61,7 +61,7 @@
   int offset;
 
   offset = PRIV(image_ptr) - PRIV(image_section)->contents;
-  if ((offset + size) > PRIV(image_section)->_raw_size)
+  if ((bfd_size_type) (offset + size) > PRIV(image_section)->_raw_size)
     {
       PRIV(image_section)->contents = bfd_realloc (PRIV(image_section)->contents, offset + size);
       if (PRIV(image_section)->contents == 0)
@@ -121,7 +121,7 @@
     bfd *abfd;
     unsigned char *ptr;
     int size;
-    int offset;
+    int offset ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   _bfd_vms_debug (8, "image_dump from (%p, %d) to (%p)\n", ptr, size, PRIV(image_ptr));
@@ -301,7 +301,7 @@
       case ETIR_S_C_STA_PQ:
   	{
 	  uquad dummy;
-	  int psect;
+	  unsigned int psect;
 
 	  psect = bfd_getl32 (ptr);
 	  if (psect >= PRIV(section_count))
@@ -559,7 +559,7 @@
 etir_opr (abfd, cmd, ptr)
      bfd *abfd;
      int cmd;
-     unsigned char *ptr;
+     unsigned char *ptr ATTRIBUTE_UNUSED;
 {
   long op1, op2;
 
@@ -791,7 +791,7 @@
 etir_stc (abfd, cmd, ptr)
      bfd *abfd;
      int cmd;
-     unsigned char *ptr;
+     unsigned char *ptr ATTRIBUTE_UNUSED;
 {
 
 #if VMS_DEBUG
@@ -907,7 +907,7 @@
 
 static asection *
 new_section (abfd, idx)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      int idx;
 {
   asection *section;
@@ -947,10 +947,8 @@
 static int
 alloc_section (abfd, idx)
      bfd *abfd;
-     int idx;
+     unsigned int idx;
 {
-  asection *section;
-
 #if VMS_DEBUG
   _bfd_vms_debug (4,  "alloc_section %d\n", idx);
 #endif
@@ -1060,7 +1058,7 @@
 	 */
   	{
 	  unsigned long dummy;
-	  int psect;
+	  unsigned int psect;
 
 	  if (cmd == TIR_S_C_STA_PB)
 	    psect = *ptr++;
@@ -1092,7 +1090,7 @@
 	 */
   	{
 	  unsigned long dummy;
-	  int psect;
+	  unsigned int psect;
 
 	  if (cmd == TIR_S_C_STA_PW)
 	    psect = *ptr++;
@@ -1124,7 +1122,7 @@
 	 */
   	{
 	  unsigned long dummy;
-	  int psect;
+	  unsigned int psect;
 
 	  if (cmd == TIR_S_C_STA_PL)
 	    psect = *ptr++;
@@ -1672,7 +1670,7 @@
  */
 {
   unsigned long dummy;
-  int psect;
+  unsigned int psect;
 
 #if VMS_DEBUG
   _bfd_vms_debug (5, "tir_ctl %d\n", *ptr);
@@ -1942,7 +1940,7 @@
 int
 _bfd_vms_slurp_dbg (abfd, objtype)
      bfd *abfd;
-     int objtype;
+     int objtype ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   _bfd_vms_debug (2, "DBG/EDBG\n");
@@ -1960,8 +1958,8 @@
 
 int
 _bfd_vms_slurp_tbt (abfd, objtype)
-     bfd *abfd;
-     int objtype;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     int objtype ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   _bfd_vms_debug (2, "TBT/ETBT\n");
@@ -1978,8 +1976,8 @@
 
 int
 _bfd_vms_slurp_lnk (abfd, objtype)
-     bfd *abfd;
-     int objtype;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     int objtype ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   _bfd_vms_debug (2, "LNK\n");
@@ -2094,7 +2092,7 @@
 int
 _bfd_vms_write_tir (abfd, objtype)
      bfd *abfd;
-     int objtype;
+     int objtype ATTRIBUTE_UNUSED;
 {
   asection *section;
   vms_section *sptr;
@@ -2177,10 +2175,10 @@
 		  for (;;)
 		    {
 		      bfd_size_type addr = (*rptr)->address;
-		      int len = bfd_get_reloc_size ((*rptr)->howto);
+		      bfd_size_type len = bfd_get_reloc_size ((*rptr)->howto);
 		      if (sptr->offset < addr)		/* sptr starts before reloc */
 			{
-			  int before = addr - sptr->offset;
+			  bfd_size_type before = addr - sptr->offset;
 			  if (sptr->size <= before)		/* complete before */
 			    {
 			      sto_imm (abfd, sptr, vaddr, section->index);
@@ -2463,8 +2461,8 @@
 
 int
 _bfd_vms_write_tbt (abfd, objtype)
-     bfd *abfd;
-     int objtype;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     int objtype ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   _bfd_vms_debug (2, "vms_write_tbt (%p, %d)\n", abfd, objtype);
@@ -2478,8 +2476,8 @@
 
 int
 _bfd_vms_write_dbg (abfd, objtype)
-     bfd *abfd;
-     int objtype;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     int objtype ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   _bfd_vms_debug (2, "vms_write_dbg (%p, objtype)\n", abfd, objtype);
diff --git a/bfd/vms.c b/bfd/vms.c
index a5fc13a..f0ea63f 100644
--- a/bfd/vms.c
+++ b/bfd/vms.c
@@ -1,6 +1,6 @@
 /* vms.c -- BFD back-end for VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
    Written by Klaus K"ampf (kkaempf@rmi.de)
 
@@ -26,7 +26,7 @@
 #include "vms.h"
 
 static boolean vms_initialize PARAMS ((bfd *));
-static int priv_section_count;
+static unsigned int priv_section_count;
 static boolean fill_section_ptr PARAMS ((struct bfd_hash_entry *, PTR));
 static boolean vms_fixup_sections PARAMS ((bfd *));
 static boolean copy_symbols PARAMS ((struct bfd_hash_entry *, PTR));
@@ -132,11 +132,10 @@
 
 const bfd_target vms_alpha_vec =
 {
-
   "vms-alpha",			/* name */
   bfd_target_evax_flavour,
-  false,			/* data byte order is little */
-  false,			/* header byte order is little */
+  BFD_ENDIAN_LITTLE,		/* data byte order is little */
+  BFD_ENDIAN_LITTLE,		/* header byte order is little */
 
   (HAS_RELOC | HAS_SYMS
    | WP_TEXT | D_PAGED),	/* object flags */
@@ -170,16 +169,17 @@
   BFD_JUMP_TABLE_LINK (vms),
   BFD_JUMP_TABLE_DYNAMIC (vms),
 
+  NULL,
+  
   (PTR) 0
 };
 
 const bfd_target vms_vax_vec =
 {
-
   "vms-vax",			/* name */
   bfd_target_ovax_flavour,
-  false,			/* data byte order is little */
-  false,			/* header byte order is little */
+  BFD_ENDIAN_LITTLE,		/* data byte order is little */
+  BFD_ENDIAN_LITTLE,		/* header byte order is little */
 
   (HAS_RELOC | HAS_SYMS 	/* object flags */
    | WP_TEXT | D_PAGED
@@ -215,6 +215,8 @@
   BFD_JUMP_TABLE_LINK (vms),
   BFD_JUMP_TABLE_DYNAMIC (vms),
 
+  NULL,
+  
   (PTR) 0
 };
 
@@ -331,7 +333,7 @@
 
   /* fill forward references (these contain section number, not section ptr).  */
 
-  if ((int)sec < priv_section_count)
+  if ((unsigned int) sec < priv_section_count)
     {
       sec = ((vms_symbol_entry *)entry)->symbol->section =
 	((asection **)sections)[(int)sec];
@@ -357,8 +359,6 @@
 vms_fixup_sections (abfd)
      bfd *abfd;
 {
-  asection *s;
-
   if (PRIV(fixup_done))
     return true;
 
@@ -538,7 +538,7 @@
 
 static const struct bfd_target *
 vms_archive_p (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_archive_p(%p)\n", abfd);
@@ -646,7 +646,6 @@
 {
   asection *sec;
   vms_section *es, *es1;
-  vms_reloc *er, *er1;
   int i;
 
 #if VMS_DEBUG
@@ -722,7 +721,7 @@
 /* Ask the BFD to free all cached information.  */
 static boolean
 vms_bfd_free_cached_info (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_free_cached_info(%p)\n", abfd);
@@ -769,11 +768,11 @@
 
 static boolean
 vms_get_section_contents (abfd, section, buf, offset, buf_size)
-     bfd *abfd;
-     asection *section;
-     PTR buf;
-     file_ptr offset;
-     bfd_size_type buf_size;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
+     PTR buf ATTRIBUTE_UNUSED;
+     file_ptr offset ATTRIBUTE_UNUSED;
+     bfd_size_type buf_size ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_get_section_contents(%p, %s, %p, off %ld, size %d)\n",
@@ -791,11 +790,11 @@
 
 static boolean
 vms_get_section_contents_in_window (abfd, section, w, offset, count)
-     bfd *abfd;
-     asection *section;
-     bfd_window *w;
-     file_ptr offset;
-     bfd_size_type count;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
+     bfd_window *w ATTRIBUTE_UNUSED;
+     file_ptr offset ATTRIBUTE_UNUSED;
+     bfd_size_type count ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_get_section_contents_in_window(%p, %s, %p, off %ld, count %d)\n",
@@ -814,8 +813,8 @@
 
 static boolean
 vms_bfd_copy_private_bfd_data (src, dest)
-     bfd *src;
-     bfd *dest;
+     bfd *src ATTRIBUTE_UNUSED;
+     bfd *dest ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_copy_private_bfd_data(%p, %p)\n", src, dest);
@@ -833,8 +832,8 @@
 
 static boolean
 vms_bfd_merge_private_bfd_data (ibfd, obfd)
-     bfd *ibfd;
-     bfd *obfd;
+     bfd *ibfd ATTRIBUTE_UNUSED;
+     bfd *obfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1,"vms_bfd_merge_private_bfd_data(%p, %p)\n", ibfd, obfd);
@@ -852,8 +851,8 @@
 
 static boolean
 vms_bfd_set_private_flags (abfd, flags)
-     bfd *abfd;
-     flagword flags;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     flagword flags ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1,"vms_bfd_set_private_flags(%p, %lx)\n", abfd, (long)flags);
@@ -867,10 +866,10 @@
 
 static boolean
 vms_bfd_copy_private_section_data (srcbfd, srcsec, dstbfd, dstsec)
-     bfd *srcbfd;
-     asection *srcsec;
-     bfd *dstbfd;
-     asection *dstsec;
+     bfd *srcbfd ATTRIBUTE_UNUSED;
+     asection *srcsec ATTRIBUTE_UNUSED;
+     bfd *dstbfd ATTRIBUTE_UNUSED;
+     asection *dstsec ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_copy_private_section_data(%p, %s, %p, %s)\n",
@@ -884,10 +883,10 @@
 
 static boolean 
 vms_bfd_copy_private_symbol_data (ibfd, isym, obfd, osym)
-     bfd *ibfd;
-     asymbol *isym;
-     bfd *obfd;
-     asymbol *osym;
+     bfd *ibfd ATTRIBUTE_UNUSED;
+     asymbol *isym ATTRIBUTE_UNUSED;
+     bfd *obfd ATTRIBUTE_UNUSED;
+     asymbol *osym ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_copy_private_symbol_data(%p, %s, %p, %s)\n",
@@ -903,7 +902,7 @@
 
 static char *
 vms_core_file_failing_command (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_core_file_failing_command(%p)\n", abfd);
@@ -917,7 +916,7 @@
 
 static int
 vms_core_file_failing_signal (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_core_file_failing_signal(%p)\n", abfd);
@@ -931,8 +930,8 @@
 
 static boolean
 vms_core_file_matches_executable_p (abfd, bbfd)
-     bfd *abfd;
-     bfd *bbfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     bfd *bbfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_core_file_matches_executable_p(%p, %p)\n", abfd, bbfd);
@@ -947,7 +946,7 @@
 
 static boolean
 vms_slurp_armap (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_slurp_armap(%p)\n", abfd);
@@ -961,7 +960,7 @@
 
 static boolean
 vms_slurp_extended_name_table (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_slurp_extended_name_table(%p)\n", abfd);
@@ -975,10 +974,10 @@
 
 static boolean
 vms_construct_extended_name_table (abfd, tabloc, tablen, name)
-     bfd *abfd;
-     char **tabloc;
-     bfd_size_type *tablen;
-     const char **name;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     char **tabloc ATTRIBUTE_UNUSED;
+     bfd_size_type *tablen ATTRIBUTE_UNUSED;
+     const char **name ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_construct_extended_name_table(%p)\n", abfd);
@@ -991,9 +990,9 @@
 
 static void
 vms_truncate_arname (abfd, pathname, arhdr)
-     bfd *abfd;
-     CONST char *pathname;
-     char *arhdr;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     CONST char *pathname ATTRIBUTE_UNUSED;
+     char *arhdr ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_truncate_arname(%p, %s, %s)\n", abfd, pathname, arhdr);
@@ -1006,11 +1005,11 @@
 
 static boolean
 vms_write_armap (arch, elength, map, orl_count, stridx)
-     bfd *arch;
-     unsigned int elength;
-     struct orl *map;
-     unsigned int orl_count;
-     int stridx;
+     bfd *arch ATTRIBUTE_UNUSED;
+     unsigned int elength ATTRIBUTE_UNUSED;
+     struct orl *map ATTRIBUTE_UNUSED;
+     unsigned int orl_count ATTRIBUTE_UNUSED;
+     int stridx ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_write_armap(%p, %d, %p, %d %d)\n",
@@ -1023,7 +1022,7 @@
 
 static PTR
 vms_read_ar_hdr (abfd)
-    bfd * abfd;
+    bfd * abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_read_ar_hdr(%p)\n", abfd);
@@ -1040,8 +1039,8 @@
 
 static bfd *
 vms_openr_next_archived_file (arch, prev)
-     bfd *arch;
-     bfd *prev;
+     bfd *arch ATTRIBUTE_UNUSED;
+     bfd *prev ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_openr_next_archived_file(%p, %p)\n", arch, prev);
@@ -1084,7 +1083,7 @@
 
 static boolean
 vms_update_armap_timestamp (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_update_armap_timestamp(%p)\n", abfd);
@@ -1193,7 +1192,7 @@
 
 static void
 vms_print_symbol (abfd, file, symbol, how)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      PTR file;
      asymbol *symbol;
      bfd_print_symbol_type how;
@@ -1241,7 +1240,7 @@
 
 static void
 vms_get_symbol_info (abfd, symbol, ret)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -1288,7 +1287,7 @@
 
 static boolean
 vms_bfd_is_local_label_name (abfd, name)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      const char *name;
 {
 #if VMS_DEBUG
@@ -1302,8 +1301,8 @@
 
 static alent *
 vms_get_lineno (abfd, symbol)
-     bfd *abfd;
-     asymbol *symbol;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asymbol *symbol ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_get_lineno(%p, %p)\n", abfd, symbol);
@@ -1318,13 +1317,13 @@
 
 static boolean
 vms_find_nearest_line (abfd, section, symbols, offset, file, func, line)
-     bfd *abfd;
-     asection *section;
-     asymbol **symbols;
-     bfd_vma offset;
-     CONST char **file;
-     CONST char **func;
-     unsigned int *line;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
+     asymbol **symbols ATTRIBUTE_UNUSED;
+     bfd_vma offset ATTRIBUTE_UNUSED;
+     CONST char **file ATTRIBUTE_UNUSED;
+     CONST char **func ATTRIBUTE_UNUSED;
+     unsigned int *line ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_find_nearest_line(%p, %s, %p, %ld, <ret>, <ret>, <ret>)\n",
@@ -1340,9 +1339,9 @@
 
 static asymbol *
 vms_bfd_make_debug_symbol (abfd, ptr, size)
-     bfd *abfd;
-     void *ptr;
-     unsigned long size;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     void *ptr ATTRIBUTE_UNUSED;
+     unsigned long size ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_make_debug_symbol(%p, %p, %ld)\n", abfd, ptr, size);
@@ -1393,8 +1392,8 @@
 
 static long
 vms_get_reloc_upper_bound (abfd, section)
-     bfd *abfd;
-     asection *section;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_get_reloc_upper_bound(%p, %s)\n", abfd, section->name);
@@ -1411,10 +1410,10 @@
 
 static long
 vms_canonicalize_reloc (abfd, section, location, symbols)
-     bfd *abfd;
-     asection *section;
-     arelent **location;
-     asymbol **symbols;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
+     arelent **location ATTRIBUTE_UNUSED;
+     asymbol **symbols ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_canonicalize_reloc(%p, %s, <ret>, <ret>)\n", abfd, section->name);
@@ -1429,13 +1428,13 @@
 
 static bfd_reloc_status_type
 reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message)
-     bfd *abfd;
-     arelent *reloc;
-     asymbol *sym;
-     PTR data;
-     asection *sec;
-     bfd *output_bfd;
-     char **error_message;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *reloc ATTRIBUTE_UNUSED;
+     asymbol *sym ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     char **error_message ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "reloc_nil(abfd %p, output_bfd %p)\n", abfd, output_bfd);
@@ -1679,7 +1678,7 @@
 
 static const struct reloc_howto_struct *
 vms_bfd_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   int alpha_type;
@@ -1721,8 +1720,8 @@
 static boolean
 vms_set_arch_mach (abfd, arch, mach)
      bfd *abfd;
-     enum bfd_architecture arch;
-     unsigned long mach;
+     enum bfd_architecture arch ATTRIBUTE_UNUSED;
+     unsigned long mach ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_set_arch_mach(%p, %d, %ld)\n", abfd, arch, mach);
@@ -1765,8 +1764,8 @@
 
 static int
 vms_sizeof_headers (abfd, reloc)
-     bfd *abfd;
-     boolean reloc;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean reloc ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_sizeof_headers(%p, %s)\n", abfd, (reloc)?"True":"False");
@@ -1781,12 +1780,12 @@
 static bfd_byte *
 vms_bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
 					 relocateable, symbols)
-     bfd *abfd;
-     struct bfd_link_info *link_info;
-     struct bfd_link_order *link_order;
-     bfd_byte *data;
-     boolean relocateable;
-     asymbol **symbols;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+     struct bfd_link_order *link_order ATTRIBUTE_UNUSED;
+     bfd_byte *data ATTRIBUTE_UNUSED;
+     boolean relocateable ATTRIBUTE_UNUSED;
+     asymbol **symbols ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_get_relocated_section_contents(%p, %p, %p, %p, %s, %p)\n",
@@ -1800,10 +1799,10 @@
 
 static boolean
 vms_bfd_relax_section (abfd, section, link_info, again)
-     bfd *abfd;
-     asection *section;
-     struct bfd_link_info *link_info;
-     boolean *again;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+     boolean *again ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_relax_section(%p, %s, %p, <ret>)\n",
@@ -1814,8 +1813,8 @@
 
 static boolean
 vms_bfd_gc_sections (abfd, link_info)
-     bfd *abfd;
-     struct bfd_link_info *link_info;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_gc_sections(%p, %p)\n", abfd, link_info);
@@ -1829,7 +1828,7 @@
 
 static struct bfd_link_hash_table *
 vms_bfd_link_hash_table_create (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_link_hash_table_create(%p)\n", abfd);
@@ -1842,8 +1841,8 @@
 
 static boolean
 vms_bfd_link_add_symbols (abfd, link_info)
-     bfd *abfd;
-     struct bfd_link_info *link_info;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_link_add_symbols(%p, %p)\n", abfd, link_info);
@@ -1857,8 +1856,8 @@
 
 static boolean
 vms_bfd_final_link (abfd, link_info)
-     bfd *abfd;
-     struct bfd_link_info *link_info;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_final_link(%p, %p)\n", abfd, link_info);
@@ -1870,8 +1869,8 @@
 
 static boolean
 vms_bfd_link_split_section (abfd, section)
-     bfd *abfd;
-     asection *section;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_link_split_section(%p, %s)\n", abfd, section->name);
@@ -1885,7 +1884,7 @@
 
 static long
 vms_get_dynamic_symtab_upper_bound (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_get_dynamic_symtab_upper_bound(%p)\n", abfd);
@@ -1895,8 +1894,8 @@
 
 static boolean
 vms_bfd_print_private_bfd_data (abfd, file)
-    bfd *abfd;
-    void *file;
+    bfd *abfd ATTRIBUTE_UNUSED;
+    void *file ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_bfd_print_private_bfd_data(%p)\n", abfd);
@@ -1909,8 +1908,8 @@
 
 static long
 vms_canonicalize_dynamic_symtab (abfd, symbols)
-     bfd *abfd;
-     asymbol **symbols;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asymbol **symbols ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_canonicalize_dynamic_symtab(%p, <ret>)\n", abfd);
@@ -1923,7 +1922,7 @@
 
 static long
 vms_get_dynamic_reloc_upper_bound (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_get_dynamic_reloc_upper_bound(%p)\n", abfd);
@@ -1936,9 +1935,9 @@
 
 static long
 vms_canonicalize_dynamic_reloc (abfd, arel, symbols)
-     bfd *abfd;
-     arelent **arel;
-     asymbol **symbols;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent **arel ATTRIBUTE_UNUSED;
+     asymbol **symbols ATTRIBUTE_UNUSED;
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_canonicalize_dynamic_reloc(%p)\n", abfd);
diff --git a/bfd/vms.h b/bfd/vms.h
index d6bdd02..7143986 100644
--- a/bfd/vms.h
+++ b/bfd/vms.h
@@ -1,6 +1,6 @@
 #undef vms
 /* vms.h -- Header file for VMS (Alpha and Vax) support.
-   Copyright 1996, 1997 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
    Written by Klaus K"ampf (kkaempf@rmi.de)
 
@@ -583,7 +583,7 @@
 
   struct hdr_struc hdr_data;		/* data from HDR/EMH record  */
   struct eom_struc eom_data;		/* data from EOM/EEOM record  */
-  int section_count;			/* # of sections in following array  */
+  unsigned int section_count;		/* # of sections in following array  */
   asection **sections;			/* array of GSD/EGSD sections  */
   int gsd_sym_count;			/* # of GSD/EGSD symbols  */
   asymbol **symbols;			/* vector of GSD/EGSD symbols  */
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index c882d23..9ec75bd 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -1,5 +1,5 @@
 /* POWER/PowerPC XCOFF linker support.
-   Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>, Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -3061,7 +3061,7 @@
      bfd *output_bfd;
      struct bfd_link_info *info;
      struct bfd_link_hash_entry *harg;
-     boolean syscall;
+     boolean syscall ATTRIBUTE_UNUSED;
 {
   struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg;
 
@@ -3272,10 +3272,15 @@
   xcoff_hash_table (info)->file_align = file_align;
   xcoff_hash_table (info)->textro = textro;
 
-  hentry = xcoff_link_hash_lookup (xcoff_hash_table (info), entry,
-				   false, false, true);
-  if (hentry != NULL)
-    hentry->flags |= XCOFF_ENTRY;
+  if (entry == NULL)
+    hentry = NULL;
+  else
+    {
+      hentry = xcoff_link_hash_lookup (xcoff_hash_table (info), entry,
+				       false, false, true);
+      if (hentry != NULL)
+	hentry->flags |= XCOFF_ENTRY;
+    }
 
   /* Garbage collect unused sections.  */
   if (info->relocateable
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index b8a3d27..954e3d4 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,352 @@
+1999-07-16  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* readelf.c (get_machine_flags): Print EF_SPARC_SUN_US3.
+
+1999-07-15  Ian Lance Taylor  <ian@zembu.com>
+
+	* configure.in: Bump version number to 2.9.5.
+	* configure: Rebuild.
+
+1999-07-14  Richard Henderson  <rth@cygnus.com>
+
+	* objdump.c (dump_section_header): Print SEC_SHORT.
+
+1999-07-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
+	as appropriate.  Add variable initializations.  Add casts.
+	* objdump.c (disassemble_bytes): Change j to bfd_vma.
+	* readelf.c (process_syminfo): Change i to unsigned int.
+	(display_debug_info): Change abbrev_number to unsigned long.
+	(process_mips_specific): Change fcnt to size_t.
+
+1999-07-09  Nick Clifton  <nickc@cygnus.com>
+
+	* readelf.c: Only support decoding 64bit ELF files if the compiler
+	supports a 64 bit data type.
+	Add -I equivalent for --histogram.
+	Add -A command-line option to display architecture specific information.
+
+1999-07-08  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* readelf.c (guess_is_rela): Sparcv9 and v8plus use rela.
+	(dump_relocations): Use ELF64_R_TYPE_ID for Sparc, for R_SPARC_OLO10
+	print the secondary addend.
+	(get_machine_flags): Print Sparc machine flags.
+	(get_symbol_type): Print STT_REGISTER.
+
+1999-07-08  Ian Lance Taylor  <ian@zembu.com>
+
+	* stabs.c (parse_stab_type): Fix handling of template names with
+	template parameters containing `::'.
+	(stab_demangle_type): Handle a qualified name in a pointer to
+	member.
+
+1999-06-23  Ian Lance Taylor  <ian@zembu.com>
+
+	* Makefile.am (dlltool_SOURCES): Add dyn-string.c.
+	* Makefile.in: Rebuild.
+
+1999-06-23  Mumit Khan  <khan@xraylith.wisc.edu>
+
+	* configure.in (HAVE_EXECUTABLE_SUFFIX): Define.
+	* dlltool.c (look_for_prog): Use HAVE_EXECUTABLE_SUFFIX.
+	* dllwrap.c (look_for_prog): Likewise.
+	* resrc.c (look_for_default): Likewise.
+	* configure, config.in: Rebuild.
+
+1999-06-22  Ian Lance Taylor  <ian@zembu.com>
+
+	Based on patches from Mumit Khan <khan@xraylith.wisc.EDU>:
+	* configure.in: Define EXECUTABLE_SUFFIX.
+	* dlltool.c: Include "dyn-string.h".  Include <stdarg.h> based on
+	ANSI_PROTOTYPES, not __STDC__.
+	(outfile): Remove.
+	(gen_exp_file): Change uses of outfile to use alloca.
+	(make_one_lib_file, make_head, make_tail): Likewise.
+	(gen_lib_file): Likewise.
+	(look_for_prog): New static function.
+	(deduce_name): Rewrite to use look_for_prog.
+	(mcore_elf_gen_out_file): Use dyn_string_t rather than outfile.
+	* dllwrap.c: Don't include <stdio.h>, <errno.h>, <string.h>,
+	<stdlib.h>, or <unistd.h>.  Include <sys/stat.h> and either
+	<stdarg.h> or <varargs.h>.
+	(driver_name): Initialize to NULL, not "gcc".
+	(dlltool_name): Initialize to NULL, not "dlltool".
+	(display, inform, look_for_prog, deduce_name): New static
+	functions.
+	(usage): Mention -mno-cygwin.
+	(OPTION_MNO_CYGWIN): Define.
+	(main): Handle -mno-cygwin.  Deduce driver_name and dlltool_name.
+	* resrc.c (look_for_default): Make static.  Remove unused local
+	path.  Check using EXECUTABLE_SUFFIX.
+	(read_rc_file): Allocate enough space to hold EXECUTABLE_SUFFIX.
+	* Makefile.am: Rebuild dependencies.
+	(dllwrap_LDADD): Add $(INTLLIBS).
+	* configure, Makefile.in, config.in: Rebuild.
+
+Mon Jun 21 16:49:11 1999  Jeffrey A Law  (law@cygnus.com)
+
+        * readelf.c (dump_relocations): Use elf_hppa_reloc_type instead of
+        elf32_hppa_reloc_type.
+
+1999-06-17  Nick Clifton  <nickc@cygnus.com>
+
+	* dlltool.c (mcore_elf_gen_out_file): Link object files with the
+	.exp file, not the .lib file.
+
+Fri Jun 18 20:17:51 1999  Mumit Khan  <khan@xraylith.wisc.edu>
+
+	* deflex.l: Accept single-character symbol names.
+
+1999-06-16  Nick Clifton  <nickc@cygnus.com>
+
+	* readelf.c (get_symbol_type): Detect ARM symbols typed as Thumb
+	functions. 
+
+1999-06-14  Nick Clifton  <nickc@cygnus.com>
+
+	* objdump.c (disassembler_options): New variable.
+	(usage): Document new -M/--disassembler-options option.
+	(long_options): Add --disassembler-options.
+	(disassemble_data): Initialise disassembler_options field of
+	disassembler_info structure.
+	(main): Add parsing of -M option.
+	
+	* binutils.texi: Document new command line switch to objdump.
+
+	* NEWS: Describe new command line switch to objdump.
+
+
+Mon Jun 14 10:27:54 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* binutils.texi: Fix typos.
+
+1999-06-13  Ian Lance Taylor  <ian@zembu.com>
+
+	* objdump.c (disassemble_bytes): If the disassembler returns an
+	error, print out anything it may have printed to the buffer.  From
+	H.J. Lu <hjl@gnu.org>.
+
+	* defparse.y (explist): Remove separate expline to eliminate
+	shift/reduce conflict.
+
+	From Kai-Uwe Rommel <rommel@ars.de>:
+	* defparse.y: Add tokens NONSHARED, SINGLE, MULTIPLE,
+	INITINSTANCE, INITGLOBAL, TERMINSTANCE, and TERMGLOBAL.
+	(command): Add option_list after LIBRARY.
+	(attr): Accept and ignore NONSHARED, SINGLE, and MULTIPLE.
+	(option_list, option): New nonterminals.
+	* deflex.l: Recognize NONSHARED, SINGLE, MULTIPLE, INITINSTANCE,
+	INITGLOBAL, TERMINSTANCE, and TERMGLOBAL.
+
+1999-06-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* ar.c (O_BINARY): Define as 0 if not defined.
+	(ranlib_touch): Open file with O_BINARY.
+
+	* rename.c (O_BINARY): Define as 0 if not defined.
+	(simple_copy): Open files with O_BINARY.
+
+	Based on patch from H. Peter Anvin <hpa@transmeta.com>:
+	* objcopy.c (struct section_list): Add copy field.
+	(sections_copied): New static variable.
+	(copy_options): Add "only-section".
+	(copy_usage): Mention -j and --only-section.
+	(find_section_list): Initialize copy field.
+	(is_strip_section): Check for copying sections.
+	(copy_object): Check sections_copied when calling filter_symbols.
+	(setup_section): Check for copying sections.
+	(copy_section): Likewise.
+	(copy_main): Handle -j/--only-section.
+	* binutils.texi, objcopy.1: Document -j/--only-section.
+
+	* configure.in: If frexp is not available, check in -lm.
+	* configure: Rebuild.
+
+	* readelf.c (get_elf_class): Use correct printf format for type.
+	(get_data_encoding): Likewise.
+	(get_osabi_name): Likewise.
+	(process_file_header): Don't pass an extra argument to printf.
+	(process_dynamic_segment): Cast dynamic_size to long before
+	printing.
+	(decode_location_expression): Cast byte_get to long before
+	printing.
+
+Wed Jun  9 11:40:16 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* readelf.c (dump_section): Cast values from byte_get to
+ 	[unsigned] long for printing, in case it is wider than long.
+	(display_block): Likewise.
+	(read_and_display_attr): Likewise.
+	(decode_location_expression): Likewise.  Don't depend on
+ 	evaluation order.
+
+Mon Jun  7 12:14:57 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* windres.c (usage): Fix typo.
+
+1999-06-04  Nick Clifton  <nickc@cygnus.com>
+
+	* readelf.c: Use 64bit wide fields in internal strcutures even if
+	targetting a 32bit architecture.
+	(dump_relocations): Take a new parameter - the number of symbols
+	in the symbol table.
+
+1999-06-04  Nick Clifton  <nickc@cygnus.com>
+
+	* readelf.c: Add support for 64bit ELF files.
+
+1999-06-03  Nick Clifton  <nickc@cygnus.com>
+
+	* dlltool.c (mcore_elf_gen_out_file): Use constants for temporary
+	file names. 
+
+Wed Jun  2 12:34:36 1999  Richard Henderson  <rth@cygnus.com>
+
+	* dlltool.c (gen_exp_file): Revert 19990411 change.
+
+Mon May 31 09:56:22 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* readelf.c (process_relocs): Determine type of reloc from
+	DT_PLTREL and from section type.
+
+1999-05-29  Nick Clifton  <nickc@cygnus.com>
+
+	* readelf.c (get_elf_class): Display unknown class number.
+	(get_data_encoding): Display unknown encoding number.
+	(get_osabi_name): Display unknown ABI number.
+	(process_file_header): Display unknown version number.
+
+1999-05-29  Nick Clifton  <nickc@cygnus.com>
+
+	* readelf.c (dump_relocations): Fix typo.
+
+1999-05-28  Nick Clifton  <nickc@cygnus.com>
+
+	* readelf.c (dump_relocations): Add extra parameter: is_rela to
+	specify the kind of relocations to be dumped.  Call guess_is_rela
+	if this parameter has a value of UNKNOWN.
+	(guess_is_rela): New function:  Guess the kind of reloc being used
+	baced on the machine number.
+	(process_relocs): Determine type of reloc before calling
+	dump_relocations.
+
+1999-05-28  Ian Lance Taylor  <ian@zembu.com>
+
+	* readelf.c: Include "elf/i960.h".
+	(dump_relocations): Handle EM_960.
+
+Thu May 27 11:58:33 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* objcopy.c (copy_archive): Preserve dates of archive members if
+	requested.
+
+	* readelf.c (dump_relocations): Always print the addend on RELA
+	systems even if there is no symbol.
+	(process_program_headers): Reset dynamic_size before looping
+	through the program headers.
+	(process_version_sections): Cast sh_offset to unsigned long for
+	printing in case bfd_vma is wider.
+	(process_symbol_table): Use get_symbol_index_type when printing
+	st_shndx.
+
+1999-05-17  DJ Delorie  <dj@cygnus.com>
+
+	* windres.c: add verbose option
+	(main): process verbose option
+	* resrc.c (look_for_default): new.  Look for the default
+	preprocessor in a given location.
+	(read_rc_file): for foo/bar-windres, look for foo/bar-gcc,
+	foo/gcc (in case of foo/windres), and then gcc (the old default).
+
+1999-05-16  Nick Clifton  <nickc@cygnus.com>
+
+	* dlltool.c (deduce_name): New function: Deduce name of program to
+	run.
+	(mcore_elf_out_file): New variable: Name of mcore-elf output file.
+	(mcore_elf_linker): New variable: Name of linker to use.
+	(mcore_elf_linker_flags): New variable: Linker flags to pass.
+	(scan_obj_file): Cache filenames if necessary.
+	(usage): Document new command line options.
+	(main): Support new command line options: -M (generate an
+	mcore-elf output file) -L (name of linker to use) -F (flags to
+	pass to linker). 
+	(mcore_elf_cache_filename): Store a filename in a cache.
+	(mcore_elf_gen_out_file): New function: Generate an output file
+	per the mcore-elf spec.
+
+1999-05-15  Nick Clifton  <nickc@cygnus.com>
+
+	* configure.in (BUILD_MISC): Build dlltool for mcore
+	* configure: Regenerate.
+	* dlltool.c: Update example in comment.
+	(DLLTOOL_MCORE): Define.
+	(DLLTOOL_MCORE_ELF): Define.
+	(DRECTVE_SECTION_NAME): Define.
+	(mcore_be_jtab, mcore_le_jtab): Binary for performing an mcore
+	jump to address.
+	(mtable): Add entries for mcore variants.
+	(rvaafter, rvabefore, asm_prefix): Add mcore suppport.
+	(scan_drectve_symbols): Use DRECTVE_SECTION_NAME.
+	(make_head, make_tail): Cope if file cannot be created.
+	(usage): Improve layout.
+	
+1999-05-13  DJ Delorie  <dj@cygnus.com>
+
+	* rclex.l: add code to suppress certain output from cpp, replace
+	all returns with MAYBE_RETURN
+	(MAYBE_RETURN): new, implement the suppression by returning
+	IGNORED_TOKEN as needed.
+	(cpp_line): remember which file we're in, mark data from included
+	*.h files for suppression.
+	* rcparse.y (input): allow IGNORED_TOKEN outside of known constructs
+
+1999-05-10  DJ Delorie  <dj@cygnus.com>
+
+	* windres.c (quot): Quote shell metacharacters in a string
+	(main): quote parameters to cpp that might have metacharacters in
+	them.  Allow -D as an alias for --define to allow for sharing make
+	macros with gcc.
+
+	* objdump.c (dump_reloc_set): don't core if howto->name is NULL
+
+	* Makefile.am: Give rescoff.c a cpu-specific -D so it can set
+	the correct BFD.
+	* Makefile.in: ditto
+	* rescoff.c (write_coff_file): Set the correct BFD
+
+1999-05-06  Ian Lance Taylor  <ian@zembu.com>
+
+	* rename.c (smart_rename): Fix test of whether file exists.
+
+1999-05-06  Nick Clifton  <nickc@cygnus.com>
+
+	* objdump.c (disassemble_data): Set display_endian based on target
+	endianism.
+
+1999-05-05  Catherine Moore  <clm@cygnus.com>
+
+	* dlltool.c (interwork): Remove.
+	(arm_interwork_jtab): Use bx insn.
+	(thumb_jtab): Likewise.
+	(MARM_INTERWORK): New machine type.
+	(rvaafter): Handle it.
+	(rvabefore) Likewise.
+	(asm_prefix): Likewise.
+	(gen_exp_type): Check machine type instead of
+	interwork flag.
+	(make_one_lib_file): Likewise.
+	(make_head): Likewise.
+	(make_tail): Likewise.
+	(usage): Update machine types.
+	(main): Remove -interwork support.
+
+1999-05-05  Catherine Moore  <clm@cygnus.com>
+ 
+        * readelf.c (get_machine_flags):  Check for EF_CPU32.
+        (get_data_encoding): Fix typo.
+ 
 1999-04-26  Tom Tromey  <tromey@cygnus.com>
 
 	* aclocal.m4, configure: Updated for new version of libtool.
diff --git a/binutils/Makefile.am b/binutils/Makefile.am
index 4f3014f..a01f9ed 100644
--- a/binutils/Makefile.am
+++ b/binutils/Makefile.am
@@ -234,12 +234,15 @@
 
 srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
 
-dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
+dlltool_SOURCES = dlltool.c defparse.y deflex.l dyn-string.c $(BULIBS)
 dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
 
 dlltool.o:dlltool.c
 	$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
 
+rescoff.o:rescoff.c
+	$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
+
 coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
 
 sysdump_SOURCES = sysdump.c $(BULIBS)
@@ -257,7 +260,7 @@
 windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
 
 dllwrap_SOURCES = dllwrap.c dyn-string.c 
-dllwrap_LDADD = $(LIBIBERTY)
+dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS)
 
 
 DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
@@ -378,7 +381,8 @@
   debug.h
 dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/fopen-same.h \
-  $(INCDIR)/getopt.h $(INCDIR)/demangle.h dlltool.h
+  $(INCDIR)/getopt.h $(INCDIR)/demangle.h dyn-string.h \
+  dlltool.h
 filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   bucomm.h config.h $(INCDIR)/fopen-same.h
 ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/ieee.h \
@@ -459,8 +463,8 @@
   $(INCDIR)/elf/sparc.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/d10v.h \
   $(INCDIR)/elf/d30v.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/mn10200.h \
   $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/arc.h \
-  $(INCDIR)/elf/fr30.h bucomm.h config.h $(INCDIR)/fopen-same.h \
-  $(INCDIR)/getopt.h
+  $(INCDIR)/elf/fr30.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/i960.h \
+  bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h
 resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
   windres.h winduni.h
diff --git a/binutils/Makefile.in b/binutils/Makefile.in
index c32ae4d..fd7488f 100644
--- a/binutils/Makefile.in
+++ b/binutils/Makefile.in
@@ -267,7 +267,7 @@
 
 srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
 
-dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
+dlltool_SOURCES = dlltool.c defparse.y deflex.l dyn-string.c $(BULIBS)
 dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
 
 coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
@@ -282,7 +282,7 @@
 windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
 
 dllwrap_SOURCES = dllwrap.c dyn-string.c 
-dllwrap_LDADD = $(LIBIBERTY)
+dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS)
 
 DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
 	syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c
@@ -331,8 +331,8 @@
 coffdump_LDADD = $(LDADD)
 coffdump_DEPENDENCIES =  ../bfd/libbfd.la ../libiberty/libiberty.a
 coffdump_LDFLAGS = 
-dlltool_OBJECTS =  dlltool.o defparse.o deflex.o bucomm.o version.o \
-filemode.o
+dlltool_OBJECTS =  dlltool.o defparse.o deflex.o dyn-string.o bucomm.o \
+version.o filemode.o
 dlltool_DEPENDENCIES =  ../bfd/libbfd.la ../libiberty/libiberty.a
 dlltool_LDFLAGS = 
 windres_OBJECTS =  windres.o resrc.o rescoff.o resbin.o rcparse.o \
@@ -412,7 +412,7 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = tar
+TAR = gtar
 GZIP_ENV = --best
 SOURCES = $(nlmconv_SOURCES) $(srconv_SOURCES) $(sysdump_SOURCES) $(coffdump_SOURCES) $(dlltool_SOURCES) $(windres_SOURCES) $(dllwrap_SOURCES) $(size_SOURCES) $(objdump_SOURCES) $(ar_SOURCES) $(strings_SOURCES) $(ranlib_SOURCES) $(c__filt_SOURCES) $(objcopy_SOURCES) $(addr2line_SOURCES) $(readelf_SOURCES) $(nm_new_SOURCES) $(strip_new_SOURCES)
 OBJECTS = $(nlmconv_OBJECTS) $(srconv_OBJECTS) $(sysdump_OBJECTS) $(coffdump_OBJECTS) $(dlltool_OBJECTS) $(windres_OBJECTS) $(dllwrap_OBJECTS) $(size_OBJECTS) $(objdump_OBJECTS) $(ar_OBJECTS) $(strings_OBJECTS) $(ranlib_OBJECTS) $(c__filt_OBJECTS) $(objcopy_OBJECTS) $(addr2line_OBJECTS) $(readelf_OBJECTS) $(nm_new_OBJECTS) $(strip_new_OBJECTS)
@@ -1125,13 +1125,15 @@
 dlltool.o:dlltool.c
 	$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
 
+rescoff.o:rescoff.c
+	$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
+
 # coff/sym.h and coff/ecoff.h won't be found by the automatic dependency
 # scripts, since they are only included conditionally.
 nlmconv.o: nlmconv.c $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
 	ldname=`echo ld | sed '$(transform)'`; \
 	$(COMPILE) -c -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(srcdir)/nlmconv.c
 
-
 diststuff: $(DISTSTUFF) info
 
 # Targets to rebuild dependencies in this Makefile.
@@ -1237,7 +1239,8 @@
   debug.h
 dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/fopen-same.h \
-  $(INCDIR)/getopt.h $(INCDIR)/demangle.h dlltool.h
+  $(INCDIR)/getopt.h $(INCDIR)/demangle.h dyn-string.h \
+  dlltool.h
 filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   bucomm.h config.h $(INCDIR)/fopen-same.h
 ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/ieee.h \
@@ -1318,8 +1321,8 @@
   $(INCDIR)/elf/sparc.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/d10v.h \
   $(INCDIR)/elf/d30v.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/mn10200.h \
   $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/arc.h \
-  $(INCDIR)/elf/fr30.h bucomm.h config.h $(INCDIR)/fopen-same.h \
-  $(INCDIR)/getopt.h
+  $(INCDIR)/elf/fr30.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/i960.h \
+  bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h
 resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
   windres.h winduni.h
diff --git a/binutils/NEWS b/binutils/NEWS
index 76dcebd..eb27ad5 100644
--- a/binutils/NEWS
+++ b/binutils/NEWS
@@ -2,8 +2,13 @@
 
 Changes in binutils 2.10:
 
-* objdump support for -mi386:intel which causes disassembly to be displayed with
-  intel syntax.
+* New command line switch to objdump -M (or --disassembler-options) which takes
+  a parameter which can then be interpreted on a per-target basis by the
+  disassembler.  Used by ARM targets to select register name sets, ISA, APCS or
+  raw verions.
+  
+* objdump support for -mi386:intel which causes disassembly to be displayed
+  with intel syntax.
 
 * New program: readelf.  This displays the contents of ELF format files,
   regardless of target machine.
@@ -18,6 +23,9 @@
 * dlltool now takes --export-all-symbols, --no-export-all-symbols,
   --exclude-symbols, and --no-default-excludes options.
 
+* objcopy now takes a -j/--only-section option to copy only the specified
+  sections.
+
 Changes in binutils 2.9:
 
 * Added windres program, which can be used to manipulate resources in WIN32
diff --git a/binutils/addr2line.c b/binutils/addr2line.c
index 3cee867..72707c2 100644
--- a/binutils/addr2line.c
+++ b/binutils/addr2line.c
@@ -123,7 +123,7 @@
 find_address_in_section (abfd, section, data)
      bfd *abfd;
      asection *section;
-     PTR data;
+     PTR data ATTRIBUTE_UNUSED;
 {
   bfd_vma vma;
   bfd_size_type size;
diff --git a/binutils/ar.c b/binutils/ar.c
index c951ef7..3e9dcef 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -40,6 +40,12 @@
 #define EXT_NAME_LEN 6		/* ditto for *NIX */
 #endif
 
+/* We need to open files in binary modes on system where that makes a
+   difference.  */
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
 #define BUFSIZE 8192
 
 /* Kludge declaration from BFD!  This is ugly!  FIXME!  XXX */
@@ -1296,7 +1302,7 @@
   bfd *arch;
   char **matching;
 
-  f = open (archname, O_RDWR, 0);
+  f = open (archname, O_RDWR | O_BINARY, 0);
   if (f < 0)
     {
       bfd_set_error (bfd_error_system_call);
diff --git a/binutils/arparse.y b/binutils/arparse.y
index d6c7600..a5e90fa 100644
--- a/binutils/arparse.y
+++ b/binutils/arparse.y
@@ -193,7 +193,7 @@
 
 static int
 yyerror (x)
-     const char *x;
+     const char *x ATTRIBUTE_UNUSED;
 {
   extern int linenumber;
 
diff --git a/binutils/arsup.c b/binutils/arsup.c
index 38fd695..d6809fc 100644
--- a/binutils/arsup.c
+++ b/binutils/arsup.c
@@ -1,5 +1,6 @@
 /* arsup.c - Archive support for MRI compatibility
-   Copyright (C) 1992, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
 
@@ -95,7 +96,7 @@
 static void
 ar_directory_doer (abfd, ignore)
      bfd *abfd;
-     bfd *ignore;
+     bfd *ignore ATTRIBUTE_UNUSED;
 {
     print_arelt_descr(outfile, abfd, verbose);
 }
diff --git a/binutils/binutils.texi b/binutils/binutils.texi
index 5f7c646..535df3f 100644
--- a/binutils/binutils.texi
+++ b/binutils/binutils.texi
@@ -554,7 +554,7 @@
 @item LIST
 Display full contents of the current archive, in ``verbose'' style
 regardless of the state of @code{VERBOSE}.  The effect is like @samp{ar
-tv @var{archive}}).  (This single command is a @sc{gnu} @code{ld}
+tv @var{archive}}.  (This single command is a @sc{gnu} @code{ar}
 enhancement, rather than present for MRI compatibility.)
 
 Requires prior use of @code{OPEN} or @code{CREATE}.
@@ -837,6 +837,7 @@
         [ -x | --discard-all ]  [ -X | --discard-locals ]
         [ -b @var{byte} | --byte=@var{byte} ]
         [ -i @var{interleave} | --interleave=@var{interleave} ]
+        [ -j @var{sectionname} | --only-section=@var{sectionname} ]
         [ -R @var{sectionname} | --remove-section=@var{sectionname} ]
         [ -p | --preserve-dates ] [ --debugging ]
         [ --gap-fill=@var{val} ] [ --pad-to=@var{address} ]
@@ -905,6 +906,12 @@
 file; i.e., simply transfer data from source to destination with no
 translation.  @xref{Target Selection}, for more information.
 
+@item -j @var{sectionname}
+@itemx --only-section=@var{sectionname}
+Copy only the named section from the input file to the output file.
+This option may be given more than once.  Note that using this option
+inappropriately may make the output file unusable.
+
 @item -R @var{sectionname}
 @itemx --remove-section=@var{sectionname}
 Remove any section named @var{sectionname} from the output file.  This
@@ -1130,6 +1137,7 @@
         [ -j @var{section} | --section=@var{section} ]
         [ -l | --line-numbers ] [ -S | --source ]
         [ -m @var{machine} | --architecture=@var{machine} ]
+        [ -M @var{options} | --disassembler-options=@var{options}]
         [ -p | --private-headers ]
         [ -r | --reloc ] [ -R | --dynamic-reloc ]
         [ -s | --full-contents ]  [ --stabs ]
@@ -1288,6 +1296,21 @@
 architecture information, such as S-records.  You can list the available
 architectures with the @samp{-i} option.
 
+@item -M @var{options}
+@itemx --disassembler-options=@var{options}
+Pass target specific information to the disassembler.  Only supported on
+some targets.
+
+If the target is an ARM architecture then this switch can be used to
+select which register name set is used during disassembler.  Specifying
+@samp{--disassembler-options=reg-name-std} (the default) will select the
+register names as used in ARM's instruction set documentation, but with
+register 13 called 'sp', register 14 called 'lr' and register 15 called
+'pc'.  Specifying @samp{--disassembler-options=reg-names-apcs} will
+select the name set used by the ARM Procedure Call Standard, whilst
+specifying @samp{--disassembler-options=reg-names-raw} will just use
+@samp{r} followed by the register number.
+
 @item -p
 @itemx --private-headers
 Print information that is specific to the object file format.  The exact
@@ -2048,10 +2071,15 @@
 option.  @code{windres} will also search this directory when looking for
 files named in the @code{rc} file.
 
-@item --define @var{sym[=val]}
+@item -D @var{target}
+@itemx --define @var{sym[=val]}
 Specify a @code{-D} option to pass to the preprocessor when reading an
 @code{rc} file.
 
+@item -v
+Enable verbose mode.  This tells you what the preprocessor is if you
+didn't specify one.
+
 @item --language @var{val}
 Specify the default language to use when reading an @code{rc} file.
 @var{val} should be a hexadecimal language code.  The low eight bits are
diff --git a/binutils/config.in b/binutils/config.in
index 38272dd..3c26c5c 100644
--- a/binutils/config.in
+++ b/binutils/config.in
@@ -151,6 +151,12 @@
 /* Define as 1 if you have gettext and don't want to use GNU gettext. */
 #undef HAVE_GETTEXT
 
+/* Does the platform use an executable suffix? */
+#undef HAVE_EXECUTABLE_SUFFIX
+
+/* Suffix used for executables, if any. */
+#undef EXECUTABLE_SUFFIX
+
 /* Is the type time_t defined in <time.h>? */
 #undef HAVE_TIME_T_IN_TIME_H
 
diff --git a/binutils/configure b/binutils/configure
index 594e154..d4c77e6 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -49,6 +49,7 @@
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -163,6 +164,7 @@
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
+  --site-file=FILE        use FILE as the site file
   --version               print the version of autoconf that created configure
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -333,6 +335,11 @@
   -site=* | --site=* | --sit=*)
     site="$ac_optarg" ;;
 
+  -site-file | --site-file | --site-fil | --site-fi | --site-f)
+    ac_prev=sitefile ;;
+  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+    sitefile="$ac_optarg" ;;
+
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -498,12 +505,16 @@
 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+  if test -z "$CONFIG_SITE"; then
+    if test "x$prefix" != xNONE; then
+      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+    else
+      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+    fi
   fi
+else
+  CONFIG_SITE="$sitefile"
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
@@ -590,7 +601,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:594: checking host system type" >&5
+echo "configure:605: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -611,7 +622,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:615: checking target system type" >&5
+echo "configure:626: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -629,7 +640,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:633: checking build system type" >&5
+echo "configure:644: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -664,7 +675,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:668: checking for a BSD compatible install" >&5
+echo "configure:679: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -717,7 +728,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:721: checking whether build environment is sane" >&5
+echo "configure:732: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -774,7 +785,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:778: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:789: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -803,7 +814,7 @@
 
 PACKAGE=binutils
 
-VERSION=2.9.4
+VERSION=2.9.5
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -820,7 +831,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:824: checking for working aclocal" >&5
+echo "configure:835: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -833,7 +844,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:837: checking for working autoconf" >&5
+echo "configure:848: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -846,7 +857,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:850: checking for working automake" >&5
+echo "configure:861: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -859,7 +870,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:863: checking for working autoheader" >&5
+echo "configure:874: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -872,7 +883,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:876: checking for working makeinfo" >&5
+echo "configure:887: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -958,7 +969,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:962: checking for $ac_word" >&5
+echo "configure:973: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -988,7 +999,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:992: checking for $ac_word" >&5
+echo "configure:1003: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1018,7 +1029,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1022: checking for $ac_word" >&5
+echo "configure:1033: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1069,7 +1080,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1073: checking for $ac_word" >&5
+echo "configure:1084: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1101,7 +1112,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1105: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1116: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1112,12 +1123,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1116 "configure"
+#line 1127 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1143,12 +1154,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1147: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1158: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1152: checking whether we are using GNU C" >&5
+echo "configure:1163: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1157,7 +1168,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1176,7 +1187,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1180: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1191: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1219,7 +1230,7 @@
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1223: checking for ld used by GCC" >&5
+echo "configure:1234: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
     # Accept absolute paths.
@@ -1243,10 +1254,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1247: checking for GNU ld" >&5
+echo "configure:1258: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1250: checking for non-GNU ld" >&5
+echo "configure:1261: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1282,7 +1293,7 @@
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1286: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1297: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1298,7 +1309,7 @@
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1302: checking for BSD-compatible nm" >&5
+echo "configure:1313: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1336,7 +1347,7 @@
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:1340: checking command to parse $NM output" >&5
+echo "configure:1351: checking command to parse $NM output" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1399,11 +1410,11 @@
 int main(){nm_test_var='a';nm_test_func;return 0;}
 EOF
 
-  if { (eval echo configure:1403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:1414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     # Now try to grab the symbols.
     ac_nlist=conftest.nm
   
-    if { (eval echo configure:1407: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+    if { (eval echo configure:1418: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
 
       # Try sorting and uniquifying the output.
       if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
@@ -1455,7 +1466,7 @@
 	  ac_save_CFLAGS="$CFLAGS"
 	  LIBS="conftestm.$ac_objext"
 	  CFLAGS="$CFLAGS$no_builtin_flag"
-	  if { (eval echo configure:1459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+	  if { (eval echo configure:1470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
 	    ac_pipe_works=yes
 	  else
 	    echo "configure: failed program was:" >&5
@@ -1501,7 +1512,7 @@
 echo "$ac_t""$ac_result" 1>&6
 
 echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
-echo "configure:1505: checking for _ prefix in compiled symbols" >&5
+echo "configure:1516: checking for _ prefix in compiled symbols" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1510,10 +1521,10 @@
 void nm_test_func(){}
 int main(){nm_test_func;return 0;}
 EOF
-if { (eval echo configure:1514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   # Now try to grab the symbols.
   ac_nlist=conftest.nm
-  if { (eval echo configure:1517: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+  if { (eval echo configure:1528: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
     # See whether the symbols have a leading underscore.
     if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
       ac_cv_sys_symbol_underscore=yes
@@ -1539,7 +1550,7 @@
 USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1543: checking whether ln -s works" >&5
+echo "configure:1554: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1581,8 +1592,8 @@
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1585 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1596 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1603,19 +1614,19 @@
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1607: checking whether the C compiler needs -belf" >&5
+echo "configure:1618: checking whether the C compiler needs -belf" >&5
 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1612 "configure"
+#line 1623 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -1638,7 +1649,7 @@
   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1642: checking for $ac_word" >&5
+echo "configure:1653: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1670,7 +1681,7 @@
   # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1674: checking for $ac_word" >&5
+echo "configure:1685: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1705,7 +1716,7 @@
 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
 set dummy ${ac_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1709: checking for $ac_word" >&5
+echo "configure:1720: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1737,7 +1748,7 @@
   # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1741: checking for $ac_word" >&5
+echo "configure:1752: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1902,7 +1913,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1906: checking for $ac_word" >&5
+echo "configure:1917: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1932,7 +1943,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1936: checking for $ac_word" >&5
+echo "configure:1947: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1983,7 +1994,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1987: checking for $ac_word" >&5
+echo "configure:1998: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2015,7 +2026,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2019: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2030: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2026,12 +2037,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 2030 "configure"
+#line 2041 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2057,12 +2068,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2061: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2072: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2066: checking whether we are using GNU C" >&5
+echo "configure:2077: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2071,7 +2082,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2090,7 +2101,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2094: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2105: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2127,7 +2138,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2131: checking for $ac_word" >&5
+echo "configure:2142: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2158,7 +2169,7 @@
 test -n "$YACC" || YACC="yacc"
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2162: checking how to run the C preprocessor" >&5
+echo "configure:2173: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2173,13 +2184,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2177 "configure"
+#line 2188 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2190,13 +2201,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2194 "configure"
+#line 2205 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2207,13 +2218,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2211 "configure"
+#line 2222 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2243,7 +2254,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2247: checking for $ac_word" >&5
+echo "configure:2258: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2276,7 +2287,7 @@
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2280: checking for $ac_word" >&5
+echo "configure:2291: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2310,7 +2321,7 @@
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:2314: checking for yywrap in -l$ac_lib" >&5
+echo "configure:2325: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2318,7 +2329,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2322 "configure"
+#line 2333 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2329,7 +2340,7 @@
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:2333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2352,7 +2363,7 @@
 fi
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:2356: checking lex output file root" >&5
+echo "configure:2367: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2373,7 +2384,7 @@
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:2377: checking whether yytext is a pointer" >&5
+echo "configure:2388: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2385,14 +2396,14 @@
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 2389 "configure"
+#line 2400 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -2416,7 +2427,7 @@
 
 ALL_LINGUAS=
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:2420: checking for POSIXized ISC" >&5
+echo "configure:2431: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -2437,12 +2448,12 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2441: checking for ANSI C header files" >&5
+echo "configure:2452: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2446 "configure"
+#line 2457 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2450,7 +2461,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2467,7 +2478,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2471 "configure"
+#line 2482 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2485,7 +2496,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2489 "configure"
+#line 2500 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2506,7 +2517,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2510 "configure"
+#line 2521 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2517,7 +2528,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2541,12 +2552,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2545: checking for working const" >&5
+echo "configure:2556: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2550 "configure"
+#line 2561 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2595,7 +2606,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2616,21 +2627,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2620: checking for inline" >&5
+echo "configure:2631: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 2627 "configure"
+#line 2638 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2656,12 +2667,12 @@
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2660: checking for off_t" >&5
+echo "configure:2671: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2665 "configure"
+#line 2676 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2689,12 +2700,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2693: checking for size_t" >&5
+echo "configure:2704: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2698 "configure"
+#line 2709 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2724,19 +2735,19 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2728: checking for working alloca.h" >&5
+echo "configure:2739: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2733 "configure"
+#line 2744 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:2740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -2757,12 +2768,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2761: checking for alloca" >&5
+echo "configure:2772: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2766 "configure"
+#line 2777 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -2790,7 +2801,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:2794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -2822,12 +2833,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2826: checking whether alloca needs Cray hooks" >&5
+echo "configure:2837: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2831 "configure"
+#line 2842 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -2852,12 +2863,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2856: checking for $ac_func" >&5
+echo "configure:2867: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2861 "configure"
+#line 2872 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2880,7 +2891,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2907,7 +2918,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2911: checking stack direction for C alloca" >&5
+echo "configure:2922: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2915,7 +2926,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2919 "configure"
+#line 2930 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -2934,7 +2945,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:2938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -2959,17 +2970,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2963: checking for $ac_hdr" >&5
+echo "configure:2974: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2968 "configure"
+#line 2979 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2984: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2998,12 +3009,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3002: checking for $ac_func" >&5
+echo "configure:3013: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3007 "configure"
+#line 3018 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3026,7 +3037,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3051,7 +3062,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3055: checking for working mmap" >&5
+echo "configure:3066: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3059,7 +3070,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3063 "configure"
+#line 3074 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3199,7 +3210,7 @@
 }
 
 EOF
-if { (eval echo configure:3203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -3227,17 +3238,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3231: checking for $ac_hdr" >&5
+echo "configure:3242: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3236 "configure"
+#line 3247 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3267,12 +3278,12 @@
 __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3271: checking for $ac_func" >&5
+echo "configure:3282: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3276 "configure"
+#line 3287 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3295,7 +3306,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3324,12 +3335,12 @@
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3328: checking for $ac_func" >&5
+echo "configure:3339: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3333 "configure"
+#line 3344 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3352,7 +3363,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3386,19 +3397,19 @@
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3390: checking for LC_MESSAGES" >&5
+echo "configure:3401: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3395 "configure"
+#line 3406 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:3402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -3419,7 +3430,7 @@
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3423: checking whether NLS is requested" >&5
+echo "configure:3434: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -3439,7 +3450,7 @@
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3443: checking whether included gettext is requested" >&5
+echo "configure:3454: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -3458,17 +3469,17 @@
 
 	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3462: checking for libintl.h" >&5
+echo "configure:3473: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3467 "configure"
+#line 3478 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3485,19 +3496,19 @@
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:3489: checking for gettext in libc" >&5
+echo "configure:3500: checking for gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3494 "configure"
+#line 3505 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libc=yes
 else
@@ -3513,7 +3524,7 @@
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 	     echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3517: checking for bindtextdomain in -lintl" >&5
+echo "configure:3528: checking for bindtextdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3521,7 +3532,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3525 "configure"
+#line 3536 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3532,7 +3543,7 @@
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3548,19 +3559,19 @@
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3552: checking for gettext in libintl" >&5
+echo "configure:3563: checking for gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3557 "configure"
+#line 3568 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libintl=yes
 else
@@ -3588,7 +3599,7 @@
 	      # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3592: checking for $ac_word" >&5
+echo "configure:3603: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3622,12 +3633,12 @@
 		for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3626: checking for $ac_func" >&5
+echo "configure:3637: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3631 "configure"
+#line 3642 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3650,7 +3661,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3677,7 +3688,7 @@
 		# Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3681: checking for $ac_word" >&5
+echo "configure:3692: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3713,7 +3724,7 @@
 		# Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3717: checking for $ac_word" >&5
+echo "configure:3728: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3745,7 +3756,7 @@
 fi
 
 		cat > conftest.$ac_ext <<EOF
-#line 3749 "configure"
+#line 3760 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3753,7 +3764,7 @@
 			       return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:3757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
 		   DATADIRNAME=share
@@ -3785,7 +3796,7 @@
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3789: checking for $ac_word" >&5
+echo "configure:3800: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3819,7 +3830,7 @@
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3823: checking for $ac_word" >&5
+echo "configure:3834: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3855,7 +3866,7 @@
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3859: checking for $ac_word" >&5
+echo "configure:3870: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3945,7 +3956,7 @@
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3949: checking for catalogs to be installed" >&5
+echo "configure:3960: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -3973,17 +3984,17 @@
       if test "$CATOBJEXT" = ".cat"; then
 	 ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:3977: checking for linux/version.h" >&5
+echo "configure:3988: checking for linux/version.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3982 "configure"
+#line 3993 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4046,7 +4057,7 @@
   
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4050: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4061: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -4069,12 +4080,12 @@
   
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:4073: checking for Cygwin environment" >&5
+echo "configure:4084: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4078 "configure"
+#line 4089 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4085,7 +4096,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:4089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -4102,19 +4113,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:4106: checking for mingw32 environment" >&5
+echo "configure:4117: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4111 "configure"
+#line 4122 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:4118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -4133,7 +4144,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:4137: checking for executable suffix" >&5
+echo "configure:4148: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4143,7 +4154,7 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:4147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:4158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -4163,6 +4174,16 @@
 echo "$ac_t""${ac_cv_exeext}" 1>&6
 ac_exeext=$EXEEXT
 
+if test -n "$EXEEXT"; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_EXECUTABLE_SUFFIX 1
+EOF
+
+fi
+cat >> confdefs.h <<EOF
+#define EXECUTABLE_SUFFIX "${EXEEXT}"
+EOF
+
 
 # host-specific stuff:
 
@@ -4176,7 +4197,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4180: checking for $ac_word" >&5
+echo "configure:4201: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4215,7 +4236,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:4219: checking for a BSD compatible install" >&5
+echo "configure:4240: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4282,7 +4303,7 @@
   EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
   echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:4286: checking for build system executable suffix" >&5
+echo "configure:4307: checking for build system executable suffix" >&5
 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4307,17 +4328,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4311: checking for $ac_hdr" >&5
+echo "configure:4332: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4316 "configure"
+#line 4337 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4344,12 +4365,12 @@
 done
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:4348: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:4369: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4353 "configure"
+#line 4374 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -4365,7 +4386,7 @@
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:4369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -4388,19 +4409,19 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:4392: checking for working alloca.h" >&5
+echo "configure:4413: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4397 "configure"
+#line 4418 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:4404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -4421,12 +4442,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:4425: checking for alloca" >&5
+echo "configure:4446: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4430 "configure"
+#line 4451 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -4454,7 +4475,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:4458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -4486,12 +4507,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:4490: checking whether alloca needs Cray hooks" >&5
+echo "configure:4511: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4495 "configure"
+#line 4516 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -4516,12 +4537,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4520: checking for $ac_func" >&5
+echo "configure:4541: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4525 "configure"
+#line 4546 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4544,7 +4565,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4571,7 +4592,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:4575: checking stack direction for C alloca" >&5
+echo "configure:4596: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4579,7 +4600,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 4583 "configure"
+#line 4604 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -4598,7 +4619,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:4602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -4622,12 +4643,12 @@
 for ac_func in sbrk utimes
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4626: checking for $ac_func" >&5
+echo "configure:4647: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4631 "configure"
+#line 4652 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4650,7 +4671,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4675,20 +4696,84 @@
 done
 
 
+# Some systems have frexp only in -lm, not in -lc.
+
+echo $ac_n "checking for library containing frexp""... $ac_c" 1>&6
+echo "configure:4703: checking for library containing frexp" >&5
+if eval "test \"`echo '$''{'ac_cv_search_frexp'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_frexp="no"
+cat > conftest.$ac_ext <<EOF
+#line 4710 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char frexp();
+
+int main() {
+frexp()
+; return 0; }
+EOF
+if { (eval echo configure:4721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_frexp="none required"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+test "$ac_cv_search_frexp" = "no" && for i in -lm; do
+LIBS="-l$i  $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4732 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char frexp();
+
+int main() {
+frexp()
+; return 0; }
+EOF
+if { (eval echo configure:4743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_frexp="-l$i"
+break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+LIBS="$ac_func_search_save_LIBS"
+fi
+
+echo "$ac_t""$ac_cv_search_frexp" 1>&6
+if test "$ac_cv_search_frexp" != "no"; then
+  test "$ac_cv_search_frexp" = "none required" || LIBS="$ac_cv_search_frexp $LIBS"
+  
+else :
+  
+fi
+
 echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6
-echo "configure:4680: checking for time_t in time.h" >&5
+echo "configure:4765: checking for time_t in time.h" >&5
 if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4685 "configure"
+#line 4770 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 time_t i;
 ; return 0; }
 EOF
-if { (eval echo configure:4692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bu_cv_decl_time_t_time_h=yes
 else
@@ -4709,19 +4794,19 @@
 fi
 
 echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:4713: checking for time_t in sys/types.h" >&5
+echo "configure:4798: checking for time_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4718 "configure"
+#line 4803 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 time_t i;
 ; return 0; }
 EOF
-if { (eval echo configure:4725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bu_cv_decl_time_t_types_h=yes
 else
@@ -4744,12 +4829,12 @@
 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
 # by default.
 echo $ac_n "checking for utime.h""... $ac_c" 1>&6
-echo "configure:4748: checking for utime.h" >&5
+echo "configure:4833: checking for utime.h" >&5
 if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4753 "configure"
+#line 4838 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_TIME_H
@@ -4760,7 +4845,7 @@
 struct utimbuf s;
 ; return 0; }
 EOF
-if { (eval echo configure:4764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bu_cv_header_utime_h=yes
 else
@@ -4781,12 +4866,12 @@
 fi
 
 echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6
-echo "configure:4785: checking whether fprintf must be declared" >&5
+echo "configure:4870: checking whether fprintf must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4790 "configure"
+#line 4875 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4807,7 +4892,7 @@
 char *(*pfn) = (char *(*)) fprintf
 ; return 0; }
 EOF
-if { (eval echo configure:4811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_fprintf=no
 else
@@ -4828,12 +4913,12 @@
 fi
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4832: checking whether strstr must be declared" >&5
+echo "configure:4917: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4837 "configure"
+#line 4922 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4854,7 +4939,7 @@
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:4858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -4875,12 +4960,12 @@
 fi
 
 echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-echo "configure:4879: checking whether sbrk must be declared" >&5
+echo "configure:4964: checking whether sbrk must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4884 "configure"
+#line 4969 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4901,7 +4986,7 @@
 char *(*pfn) = (char *(*)) sbrk
 ; return 0; }
 EOF
-if { (eval echo configure:4905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_sbrk=no
 else
@@ -4922,12 +5007,12 @@
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:4926: checking whether getenv must be declared" >&5
+echo "configure:5011: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4931 "configure"
+#line 5016 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4948,7 +5033,7 @@
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:4952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -4969,12 +5054,12 @@
 fi
 
 echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6
-echo "configure:4973: checking whether environ must be declared" >&5
+echo "configure:5058: checking whether environ must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4978 "configure"
+#line 5063 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4995,7 +5080,7 @@
 char *(*pfn) = (char *(*)) environ
 ; return 0; }
 EOF
-if { (eval echo configure:4999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_environ=no
 else
@@ -5102,6 +5187,15 @@
 	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
 	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
 	 ;;
+	mcore-*pe)
+  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
+	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+	 ;;
+	mcore-*elf)
+  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
+	 ;;
 	esac
     fi
 done
diff --git a/binutils/configure.in b/binutils/configure.in
index 298dcd8..c4ee803 100644
--- a/binutils/configure.in
+++ b/binutils/configure.in
@@ -5,7 +5,7 @@
 
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(binutils, 2.9.4)
+AM_INIT_AUTOMAKE(binutils, 2.9.5)
 
 AM_PROG_LIBTOOL
 
@@ -44,6 +44,12 @@
 
 AM_MAINTAINER_MODE
 AC_EXEEXT
+if test -n "$EXEEXT"; then
+  AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
+	    [Does the platform use an executable suffix?])
+fi
+AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
+		   [Suffix used for executables, if any.])
 
 # host-specific stuff:
 
@@ -64,6 +70,9 @@
 AC_FUNC_ALLOCA
 AC_CHECK_FUNCS(sbrk utimes)
 
+# Some systems have frexp only in -lm, not in -lc.
+AC_SEARCH_LIBS(frexp, -lm)
+
 AC_MSG_CHECKING(for time_t in time.h)
 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
@@ -189,6 +198,15 @@
 	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
 	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
 	 ;;
+	mcore-*pe)
+  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
+	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+	 ;;
+	mcore-*elf)
+  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
+	 ;;
 	esac
     fi
 done
diff --git a/binutils/debug.c b/binutils/debug.c
index 173d627..dad4559 100644
--- a/binutils/debug.c
+++ b/binutils/debug.c
@@ -1,5 +1,5 @@
 /* debug.c -- Handle generic debugging information.
-   Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -603,7 +603,7 @@
 
 static struct debug_name *
 debug_add_to_namespace (info, nsp, name, kind, linkage)
-     struct debug_handle *info;
+     struct debug_handle *info ATTRIBUTE_UNUSED;
      struct debug_namespace **nsp;
      const char *name;
      enum debug_object_kind kind;
@@ -1039,8 +1039,8 @@
 
 boolean
 debug_start_common_block (handle, name)
-     PTR handle;
-     const char *name;
+     PTR handle ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
 {
   /* FIXME */
   debug_error (_("debug_start_common_block: not implemented"));
@@ -1051,8 +1051,8 @@
 
 boolean
 debug_end_common_block (handle, name)
-     PTR handle;
-     const char *name;
+     PTR handle ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
 {
   /* FIXME */
   debug_error (_("debug_end_common_block: not implemented"));
@@ -1143,10 +1143,10 @@
 
 boolean
 debug_record_label (handle, name, type, addr)
-     PTR handle;
-     const char *name;
-     debug_type type;
-     bfd_vma addr;
+     PTR handle ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
+     debug_type type ATTRIBUTE_UNUSED;
+     bfd_vma addr ATTRIBUTE_UNUSED;
 {
   /* FIXME.  */
   debug_error (_("debug_record_label not implemented"));
@@ -1219,7 +1219,7 @@
 /*ARGSUSED*/
 static struct debug_type *
 debug_make_type (info, kind, size)
-     struct debug_handle *info;
+     struct debug_handle *info ATTRIBUTE_UNUSED;
      enum debug_type_kind kind;
      unsigned int size;
 {
@@ -1781,7 +1781,7 @@
 /*ARGSUSED*/
 debug_baseclass
 debug_make_baseclass (handle, type, bitpos, virtual, visibility)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_type type;
      bfd_vma bitpos;
      boolean virtual;
@@ -1809,7 +1809,7 @@
 /*ARGSUSED*/
 debug_field
 debug_make_field (handle, name, type, bitpos, bitsize, visibility)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      const char *name;
      debug_type type;
      bfd_vma bitpos;
@@ -1840,7 +1840,7 @@
 /*ARGSUSED*/
 debug_field
 debug_make_static_member (handle, name, type, physname, visibility)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      const char *name;
      debug_type type;
      const char *physname;
@@ -1866,7 +1866,7 @@
 /*ARGSUSED*/
 debug_method
 debug_make_method (handle, name, variants)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      const char *name;
      debug_method_variant *variants;
 {
@@ -1894,7 +1894,7 @@
 debug_method_variant
 debug_make_method_variant (handle, physname, type, visibility, constp,
 			   volatilep, voffset, context)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      const char *physname;
      debug_type type;
      enum debug_visibility visibility;
@@ -1926,7 +1926,7 @@
 debug_method_variant
 debug_make_static_method_variant (handle, physname, type, visibility,
 				  constp, volatilep)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      const char *physname;
      debug_type type;
      enum debug_visibility visibility;
@@ -2058,7 +2058,7 @@
 /*ARGSUSED*/
 boolean
 debug_record_type_size (handle, type, size)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_type type;
      unsigned int size;
 {
@@ -2394,7 +2394,7 @@
 /*ARGSUSED*/
 debug_type
 debug_get_field_type (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL)
@@ -2407,7 +2407,7 @@
 /*ARGSUSED*/
 const char *
 debug_get_field_name (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL)
@@ -2420,7 +2420,7 @@
 /*ARGSUSED*/
 bfd_vma
 debug_get_field_bitpos (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL || field->static_member)
@@ -2433,7 +2433,7 @@
 /*ARGSUSED*/
 bfd_vma
 debug_get_field_bitsize (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL || field->static_member)
@@ -2446,7 +2446,7 @@
 /*ARGSUSED*/
 enum debug_visibility
 debug_get_field_visibility (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL)
@@ -2458,7 +2458,7 @@
 
 const char *
 debug_get_field_physname (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL || ! field->static_member)
@@ -2598,7 +2598,7 @@
 {
   unsigned int i;
   int is;
-  const char *tag;
+  const char *tag = NULL;
 
   /* If we have a name for this type, just output it.  We only output
      typedef names after they have been defined.  We output type tags
@@ -2648,7 +2648,6 @@
   if (name != NULL)
     name->mark = info->mark;
 
-  tag = NULL;
   if (name != NULL
       && type->kind != DEBUG_KIND_NAMED
       && type->kind != DEBUG_KIND_TAGGED)
diff --git a/binutils/deflex.l b/binutils/deflex.l
index e7fa362..15a43c0 100644
--- a/binutils/deflex.l
+++ b/binutils/deflex.l
@@ -1,6 +1,6 @@
 %{/* deflex.l - Lexer for .def files */
 
-/*   Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+/*   Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
 
@@ -50,11 +50,18 @@
 "WRITE"		{ return WRITE;}
 "EXECUTE"	{ return EXECUTE;}
 "SHARED"	{ return SHARED;}
+"NONSHARED"	{ return NONSHARED;}
+"SINGLE"	{ return SINGLE;}
+"MULTIPLE"	{ return MULTIPLE;}
+"INITINSTANCE"	{ return INITINSTANCE;}
+"INITGLOBAL"	{ return INITGLOBAL;}
+"TERMINSTANCE"	{ return TERMINSTANCE;}
+"TERMGLOBAL"	{ return TERMGLOBAL;}
 
 [0-9][x0-9A-Fa-f]* { yylval.number = strtol (yytext,0,0); 
 		return NUMBER; }
 
-[A-Za-z$:\-\_?][A-Za-z0-9/$:\-\_@?]+ { 	
+[A-Za-z$:\-\_?][A-Za-z0-9/$:\-\_@?]* { 	
 		yylval.id =  xstrdup (yytext);
 		return ID;
 		}
diff --git a/binutils/defparse.y b/binutils/defparse.y
index 1cb6360..5718d46 100644
--- a/binutils/defparse.y
+++ b/binutils/defparse.y
@@ -1,6 +1,6 @@
 %{ /* defparse.y - parser for .def files */
 
-/*   Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+/*   Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
 
@@ -30,7 +30,8 @@
 
 %token NAME, LIBRARY, DESCRIPTION, STACKSIZE, HEAPSIZE, CODE, DATA
 %token SECTIONS, EXPORTS, IMPORTS, VERSIONK, BASE, CONSTANT
-%token READ WRITE EXECUTE SHARED NONAME
+%token READ WRITE EXECUTE SHARED NONSHARED NONAME
+%token SINGLE MULTIPLE INITINSTANCE INITGLOBAL TERMINSTANCE TERMGLOBAL
 %token <id> ID
 %token <number> NUMBER
 %type  <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT opt_DATA
@@ -45,7 +46,7 @@
 
 command: 
 		NAME opt_name opt_base { def_name ($2, $3); }
-	|	LIBRARY opt_name opt_base { def_library ($2, $3); }
+	|	LIBRARY opt_name opt_base option_list { def_library ($2, $3); }
 	|	EXPORTS explist 
 	|	DESCRIPTION ID { def_description ($2);}
 	|	STACKSIZE NUMBER opt_number { def_stacksize ($2, $3);}
@@ -61,7 +62,6 @@
 
 explist:
 		/* EMPTY */
-	|	expline
 	|	explist expline
 	;
 
@@ -108,10 +108,13 @@
 	;
 	
 attr:
-		READ { $$ = 1;}
-	|	WRITE { $$ = 2;}	
-	|	EXECUTE { $$=4;}
-	|	SHARED { $$=8;}
+		READ { $$ = 1; }
+	|	WRITE { $$ = 2; }
+	|	EXECUTE { $$ = 4; }
+	|	SHARED { $$ = 8; }
+	|	NONSHARED { $$ = 0; }
+	|	SINGLE { $$ = 0; }
+	|	MULTIPLE { $$ = 0; }
 	;
 
 opt_CONSTANT:
@@ -153,5 +156,14 @@
 	|	{ $$=-1;}
 	;
 
-	
+option_list:
+		/* empty */
+	|	option_list opt_comma option
+	;
 
+option:
+		INITINSTANCE
+	|	INITGLOBAL
+	|	TERMINSTANCE
+	|	TERMGLOBAL
+	;
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index ed5cf5e..6f8a26c 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -121,16 +121,16 @@
      printf ("hello from the dll and the other entry point %s\n", s);
    }
 
-   printf()
+   int printf (void)
    {
      return 9;
    }
 
- main.c
-
-   void main()
+ themain.c:
+   int main (void)
    {
-     cdef();
+     cdef ();
+     return 0;
    }
 
  thedll.def
@@ -164,7 +164,7 @@
    gcc -c themain.c
 
  # link the executable with the import library
-   ld -e main -Tthemain.ld -o themain.exe themain.o thedll.a
+   gcc -o themain.exe themain.o thedll.a
 
  */
 
@@ -221,11 +221,14 @@
 #include "bucomm.h"
 #include "getopt.h"
 #include "demangle.h"
+#include "dyn-string.h"
 #include "dlltool.h"
 
 #include <ctype.h>
 #include <time.h>
-#ifdef __STDC__
+#include <sys/stat.h>
+
+#ifdef ANSI_PROTOTYPES
 #include <stdarg.h>
 #else
 #include <varargs.h>
@@ -236,6 +239,15 @@
 #include "coff/internal.h"
 #endif
 
+/* Forward references.  */
+static char *look_for_prog PARAMS ((const char *, const char *, int));
+static char *deduce_name PARAMS ((const char *));
+
+#ifdef DLLTOOL_MCORE_ELF
+static void mcore_elf_cache_filename (char *);
+static void mcore_elf_gen_out_file (void);
+#endif
+     
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #else /* ! HAVE_SYS_WAIT_H */
@@ -304,7 +316,7 @@
 
 static iheadtype *import_list = NULL;
 
-static char *as_name = "as";
+static char *as_name = NULL;
 static char * as_flags = "";
 
 static int no_idata4;
@@ -319,10 +331,6 @@
 static int add_underscore = 0;
 static int dontdeltemps = 0;
 
-#ifdef DLLTOOL_ARM
-static int interwork = 0;
-#endif 
-
 /* True if we should export all symbols.  Otherwise, we only export
    symbols listed in .drectve sections or in the def file.  */
 static boolean export_all_symbols;
@@ -345,10 +353,6 @@
 static FILE *output_def;
 static FILE *base_file;
 
-#ifdef DLLTOOL_BEOS
-static const char *mname = "beos";
-#endif
-
 #ifdef DLLTOOL_ARM
 static const char *mname = "arm";
 #endif
@@ -361,6 +365,23 @@
 static const char *mname = "ppc";
 #endif
 
+#ifdef DLLTOOL_MCORE
+static const char * mname = "mcore";
+#endif
+
+#ifdef DLLTOOL_MCORE_ELF
+static const char * mname = "mcore-elf";
+static char * mcore_elf_out_file = NULL;
+static char * mcore_elf_linker   = NULL;
+static char * mcore_elf_linker_flags = NULL;
+
+#define DRECTVE_SECTION_NAME ((machine == MMCORE_ELF || machine == MMCORE_ELF_LE) ? ".exports" : ".drectve")
+#endif
+
+#ifndef DRECTVE_SECTION_NAME
+#define DRECTVE_SECTION_NAME ".drectve"
+#endif
+
 #define PATHMAX 250		/* What's the right name for this ? */
 
 #define TMP_ASM		"dc.s"
@@ -370,8 +391,7 @@
 #define TMP_TAIL_O	"dt.o"
 #define TMP_STUB	"ds"
 
-/* This bit of assemly does jmp * ....
-s set how_jtab_roff to mark where the 32bit abs branch should go */
+/* This bit of assemly does jmp * .... */
 static const unsigned char i386_jtab[] =
 {
   0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90
@@ -379,22 +399,44 @@
 
 static const unsigned char arm_jtab[] =
 {
-  0x00, 0xc0, 0x9f, 0xe5,
-  0x00, 0xf0, 0x9c, 0xe5,
+  0x00, 0xc0, 0x9f, 0xe5,	/* ldr  ip, [pc] */
+  0x00, 0xf0, 0x9c, 0xe5,	/* ldr  pc, [ip] */
+  0,    0,    0,    0
+};
+
+static const unsigned char arm_interwork_jtab[] =
+{
+  0x04, 0xc0, 0x9f, 0xe5,	/* ldr  ip, [pc] */
+  0x00, 0xc0, 0x9c, 0xe5,	/* ldr  ip, [ip] */
+  0x1c, 0xff, 0x2f, 0xe1,	/* bx   ip       */
   0,    0,    0,    0
 };
 
 static const unsigned char thumb_jtab[] =
 {
-  0xc0, 0xb4,
-  0x02, 0x4e,
-  0x36, 0x68,
-  0x01, 0x96,
-  0x40, 0xbd,
-  0xc0, 0x46,
+  0x40, 0xb4,           /* push {r6}         */
+  0x02, 0x4e,           /* ldr  r6, [pc, #8] */
+  0x36, 0x68,           /* ldr  r6, [r6]     */
+  0xb4, 0x46,           /* mov  ip, r6       */
+  0x40, 0xbc,           /* pop  {r6}         */
+  0x60, 0x47,           /* bx   ip           */
   0,    0,    0,    0
 };
 
+static const unsigned char mcore_be_jtab[] =
+{
+  0x70, 0x01,            /* jmpi 1     */
+  0x12, 0x11,            /* nop */
+  0x00, 0x00, 0x00, 0x00 /* <address>  */  
+};
+
+static const unsigned char mcore_le_jtab[] =
+{
+  0x01, 0x70,            /* jmpi 1     */
+  0x11, 0x12,            /* nop */
+  0x00, 0x00, 0x00, 0x00 /* <address>  */  
+};
+
 /* This is the glue sequence for PowerPC PE. There is a  */
 /* tocrel16-tocdefn reloc against the first instruction. */
 /* We also need a IMGLUE reloc against the glue function */
@@ -417,12 +459,6 @@
 static bfd_vma ppc_glue_insn = 0x80410004;
 #endif
 
-/* The outfile array must be big enough to contain a fully
-   qualified path name, plus an arbitary series of command
-   line switches.  We hope that PATH_MAX times two will be
-   enough.  */
-static char outfile [PATHMAX * 2];
-
 struct mac
   {
     const char *type;
@@ -469,12 +505,52 @@
   {
 #define MTHUMB 3
     "thumb", ".byte", ".short", ".long", ".asciz", "@",
-    "push\t{r6, r7}\n\tldr\tr6, [pc, #8]\n\tldr\tr6, [r6]\n\tstr\tr6, [sp, #4]\n\tpop\t{r6, pc}\n\tnop",
+    "push\t{r6}\n\tldr\tr6, [pc, #8]\n\tldr\tr6, [r6]\n\tmov\tip, r6\n\tpop\t{r6}\n\tbx\tip",
     ".global", ".space", ".align\t2",".align\t4","pe-arm-little", bfd_arch_arm,
     thumb_jtab, sizeof (thumb_jtab), 12
   }
   ,
-{    0}
+#define MARM_INTERWORK 4
+  {
+    "arm_interwork", ".byte", ".short", ".long", ".asciz", "@",
+    "ldr\tip,[pc]\n\tldr\tip,[ip]\n\tbx\tip\n\t.long",
+    ".global", ".space", ".align\t2",".align\t4","pe-arm-little", bfd_arch_arm,
+    arm_interwork_jtab, sizeof (arm_interwork_jtab), 12
+  }
+  ,
+  {
+#define MMCORE_BE 5
+    "mcore", ".byte", ".short", ".long", ".asciz", "//",
+    "jmpi\t1\n\tnop\n\t.long",
+    ".global", ".space", ".align\t2",".align\t4","pe-mcore-big", bfd_arch_mcore,
+    mcore_be_jtab, sizeof (mcore_be_jtab), 8
+  }
+  ,
+  {
+#define MMCORE_LE 6
+    "mcore-le", ".byte", ".short", ".long", ".asciz", "//",
+    "jmpi\t1\n\tnop\n\t.long",
+    ".global", ".space", ".align\t2",".align\t4","pe-mcore-little", bfd_arch_mcore,
+    mcore_le_jtab, sizeof (mcore_le_jtab), 8
+  }
+  ,
+  {
+#define MMCORE_ELF 7
+    "mcore-elf", ".byte", ".short", ".long", ".asciz", "//",
+    "jmpi\t1\n\tnop\n\t.long",
+    ".global", ".space", ".align\t2",".align\t4","elf32-mcore-big", bfd_arch_mcore,
+    mcore_be_jtab, sizeof (mcore_be_jtab), 8
+  }
+  ,
+  {
+#define MMCORE_ELF_LE 8
+    "mcore-elf-le", ".byte", ".short", ".long", ".asciz", "//",
+    "jmpi\t1\n\tnop\n\t.long",
+    ".global", ".space", ".align\t2",".align\t4","elf32-mcore-little", bfd_arch_mcore,
+    mcore_le_jtab, sizeof (mcore_le_jtab), 8
+  }
+  ,
+ {    0}
 };
 
 typedef struct dlist
@@ -621,6 +697,11 @@
     case M386:
     case MPPC:
     case MTHUMB:
+    case MARM_INTERWORK:
+    case MMCORE_BE:
+    case MMCORE_LE:
+    case MMCORE_ELF:
+    case MMCORE_ELF_LE:
       break;
     default:
       /* xgettext:c-format */
@@ -640,6 +721,11 @@
     case M386:
     case MPPC:
     case MTHUMB:
+    case MARM_INTERWORK:
+    case MMCORE_BE:
+    case MMCORE_LE:
+    case MMCORE_ELF:
+    case MMCORE_ELF_LE:
       return ".rva\t";
     default:
       /* xgettext:c-format */
@@ -658,6 +744,11 @@
     case MARM:
     case MPPC:
     case MTHUMB:
+    case MARM_INTERWORK:
+    case MMCORE_BE:
+    case MMCORE_LE:
+    case MMCORE_ELF:
+    case MMCORE_ELF_LE:
       break;
     case M386:
       return "_";
@@ -681,12 +772,12 @@
 #define ASM_RVA_BEFORE 	rvabefore(machine)
 #define ASM_RVA_AFTER  	rvaafter(machine)
 #define ASM_PREFIX	asm_prefix(machine)
-#define ASM_ALIGN_LONG mtable[machine].how_align_long
+#define ASM_ALIGN_LONG  mtable[machine].how_align_long
 #define HOW_BFD_TARGET  0  /* always default*/
-#define HOW_BFD_ARCH   mtable[machine].how_bfd_arch
-#define HOW_JTAB       mtable[machine].how_jtab
-#define HOW_JTAB_SIZE      mtable[machine].how_jtab_size
-#define HOW_JTAB_ROFF      mtable[machine].how_jtab_roff
+#define HOW_BFD_ARCH    mtable[machine].how_bfd_arch
+#define HOW_JTAB        mtable[machine].how_jtab
+#define HOW_JTAB_SIZE   mtable[machine].how_jtab_size
+#define HOW_JTAB_ROFF   mtable[machine].how_jtab_roff
 static char **oav;
 
 void
@@ -1071,9 +1162,9 @@
   char *     buf;
   char *     p;
   char *     e;
-  
+
   /* Look for .drectve's */
-  s = bfd_get_section_by_name (abfd, ".drectve");
+  s = bfd_get_section_by_name (abfd, DRECTVE_SECTION_NAME);
   
   if (s == NULL)
     return;
@@ -1084,8 +1175,8 @@
   bfd_get_section_contents (abfd, s, buf, 0, size);
       
   /* xgettext:c-format */
-  inform (_("Sucking in info from .drective section in %s\n"),
-	  bfd_get_filename (abfd));
+  inform (_("Sucking in info from %s section in %s\n"),
+	  DRECTVE_SECTION_NAME, bfd_get_filename (abfd));
 
   /* Search for -export: strings */
   p = buf;
@@ -1327,7 +1418,7 @@
   /* FIXME: we ought to read in and block out the base relocations */
 
   /* xgettext:c-format */
-  inform (_("%s: Done reading %s\n"), bfd_get_filename (abfd));
+  inform (_("Done reading %s\n"), bfd_get_filename (abfd));
 }
 
 static void
@@ -1353,10 +1444,20 @@
 	  bfd_close (arfile);
 	  arfile = bfd_openr_next_archived_file (f, arfile);
 	}
+      
+#ifdef DLLTOOL_MCORE_ELF
+      if (mcore_elf_out_file)
+	inform (_("Cannot produce mcore-elf dll from archive file: %s"), filename);
+#endif
     }
   else if (bfd_check_format (f, bfd_object))
     {
       scan_open_obj_file (f);
+
+#ifdef DLLTOOL_MCORE_ELF
+      if (mcore_elf_out_file)
+	mcore_elf_cache_filename ((char *) filename);
+#endif
     }
 
   bfd_close (f);
@@ -1582,6 +1683,7 @@
   int i;
   export_type *exp;
   dlist_type *dl;
+  char *cmd;
 
   /* xgettext:c-format */
   inform (_("Generating export file: %s\n"), exp_name);
@@ -1647,8 +1749,8 @@
 		}
 	    }
 	  fprintf (f, "\t%s%s%s%s\t%s %d\n", ASM_RVA_BEFORE,
-		   ASM_PREFIX,
-		   exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal);
+                   ASM_PREFIX,
+                   exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal);
 	  i++;
 	}
 
@@ -1678,12 +1780,13 @@
 
       if (a_list)
 	{
-	  fprintf (f, "\t.section .drectve\n");
+	  fprintf (f, "\t.section %s\n", DRECTVE_SECTION_NAME);
 	  for (dl = a_list; dl; dl = dl->next)
 	    {
 	      fprintf (f, "\t%s\t\"%s\"\n", ASM_TEXT, dl->text);
 	    }
 	}
+      
       if (d_list)
 	{
 	  fprintf (f, "\t.section .rdata\n");
@@ -1765,8 +1868,6 @@
 	  int src;
 	  int dst = 0;
 	  int last = -1;
-	  int totsize = 0;
-
 	  qsort (copy, num_entries, sizeof (long), sfunc);
 	  /* Delete duplcates */
 	  for (src = 0; src < num_entries; src++)
@@ -1780,31 +1881,18 @@
 	  on_page = 0;
 	  for (j = 0; j < num_entries; j++)
 	    {
-	      totsize += 2;
 	      addr = copy[j];
 	      if ((addr & PAGE_MASK) != page_addr)
 		{
-		  totsize += 8 + (on_page & 1)*2;
 		  flush_page (f, need, page_addr, on_page);
 		  on_page = 0;
 		  page_addr = addr & PAGE_MASK;
 		}
 	      need[on_page++] = addr;
 	    }
-
-	  /* Pad the section to an even 32-byte boundary.  This will make
-	     the BeOS loader much happier, and shouldn't matter for other
-	     OSes. */
-	  while ((totsize + 8 + (on_page & 1)*2) % 32 != 0)
-	    {
-	      /* 0x0000 is an absolute relocation that should be ignored.  */
-	      need[on_page++] = 0x0000;
-	      totsize += 2;
-	    }
-
 	  flush_page (f, need, page_addr, on_page);
 
-	  /* fprintf (f, "\t%s\t0,0\t%s End\n", ASM_LONG, ASM_C);*/
+/*	  fprintf (f, "\t%s\t0,0\t%s End\n", ASM_LONG, ASM_C);*/
 	}
     }
 
@@ -1813,15 +1901,17 @@
   fclose (f);
 
   /* assemble the file */
-  sprintf (outfile, "%s -o %s %s", as_flags, exp_name, TMP_ASM);
+  cmd = (char *) alloca (strlen (as_flags) + strlen (exp_name)
+			 + sizeof TMP_ASM + 50);
+  sprintf (cmd, "%s -o %s %s", as_flags, exp_name, TMP_ASM);
 
 #ifdef DLLTOOL_ARM
-  if (interwork)
-    strcat (outfile, " -mthumb-interwork");
+  if (machine == MARM_INTERWORK || machine == MTHUMB)
+    strcat (cmd, " -mthumb-interwork");
 #endif
-  
-  run (as_name, outfile);
-  
+
+  run (as_name, cmd);
+
   if (dontdeltemps == 0)
     unlink (TMP_ASM);
   
@@ -2001,10 +2091,14 @@
 {
 #if 0
     {
+      char *name;
       FILE *f;
-      char *prefix="d";
-      sprintf (outfile, "%ss%05d.s", prefix, i);
-      f = fopen (outfile, FOPEN_WT);
+      const char *prefix = "d";
+      char *cmd;
+
+      name = (char *) alloca (strlen (prefix) + 10);
+      sprintf (name, "%ss%05d.s", prefix, i);
+      f = fopen (name, FOPEN_WT);
       fprintf (f, "\t.text\n");
       fprintf (f, "\t%s\t%s%s\n", ASM_GLOBAL, ASM_PREFIX, exp->name);
       fprintf (f, "\t%s\t__imp_%s\n", ASM_GLOBAL, exp->name);
@@ -2039,15 +2133,16 @@
 
       fclose (f);
 
-      sprintf (outfile, "%s -o %ss%05d.o %ss%d.s",
+      cmd = (char *) alloca (strlen (as_flags) + 2 * strlen (prefix) + 50);
+      sprintf (cmd, "%s -o %ss%05d.o %ss%d.s",
 	       as_flags, prefix, i, prefix, i);
 
 #ifdef DLLTOOL_ARM
-      if (interwork)
-	strcat (outfile, " -mthumb-interwork");
+      if (machine == MARM_INTERWORK || machine == MTHUMB)
+	strcat (cmd, " -mthumb-interwork");
 #endif
   
-      run (as_name, outfile);
+      run (as_name, cmd);
     }
 #else /* if 0 */
     {
@@ -2087,7 +2182,7 @@
       bfd_set_arch_mach (abfd, HOW_BFD_ARCH, 0);
 
 #ifdef DLLTOOL_ARM
-      if (interwork)
+      if (machine == MARM_INTERWORK || machine == MTHUMB)
 	bfd_set_private_flags (abfd, F_INTERWORK);
 #endif
       
@@ -2460,8 +2555,15 @@
 static bfd *
 make_head ()
 {
-  FILE *  f = fopen (TMP_HEAD_S, FOPEN_WT);
+  FILE *f = fopen (TMP_HEAD_S, FOPEN_WT);
+  char *cmd;
 
+  if (f == NULL)
+    {
+      fatal (_("failed to open temporary head file: %s"), TMP_HEAD_S);
+      return NULL;
+    }
+  
   fprintf (f, "%s IMAGE_IMPORT_DESCRIPTOR\n", ASM_C);
   fprintf (f, "\t.section	.idata$2\n");
 
@@ -2493,6 +2595,7 @@
       fprintf (f, "\t%s\t0\n", ASM_LONG);
       fprintf (f, "fthunk:\n");
     }
+  
   if (!no_idata4)
     {
       fprintf (f, "\t.section\t.idata$4\n");
@@ -2501,30 +2604,41 @@
       fprintf (f, "\t.section	.idata$4\n");
       fprintf (f, "hname:\n");
     }
+  
   fclose (f);
 
-  sprintf (outfile, "%s -o %s %s", as_flags, TMP_HEAD_O, TMP_HEAD_S);
+  cmd = (char *) alloca (strlen (as_flags) + sizeof TMP_HEAD_O
+			 + sizeof TMP_HEAD_S + 50);
+  sprintf (cmd, "%s -o %s %s", as_flags, TMP_HEAD_O, TMP_HEAD_S);
   
 #ifdef DLLTOOL_ARM
-  if (interwork)
-    strcat (outfile, " -mthumb-interwork");
+  if (machine == MARM_INTERWORK || machine == MTHUMB)
+    strcat (cmd, " -mthumb-interwork");
 #endif
   
-  run (as_name, outfile);
+  run (as_name, cmd);
 
-  return  bfd_openr (TMP_HEAD_O, HOW_BFD_TARGET);
+  return bfd_openr (TMP_HEAD_O, HOW_BFD_TARGET);
 }
 
 static bfd *
 make_tail ()
 {
-  FILE *  f = fopen (TMP_TAIL_S, FOPEN_WT);
+  FILE *f = fopen (TMP_TAIL_S, FOPEN_WT);
+  char *cmd;
 
+  if (f == NULL)
+    {
+      fatal (_("failed to open temporary tail file: %s"), TMP_TAIL_S);
+      return NULL;
+    }
+  
   if (!no_idata4)
     {
       fprintf (f, "\t.section	.idata$4\n");
       fprintf (f, "\t%s\t0\n", ASM_LONG);
     }
+  
   if (!no_idata5)
     {
       fprintf (f, "\t.section	.idata$5\n");
@@ -2562,14 +2676,16 @@
 
   fclose (f);
 
-  sprintf (outfile, "%s -o %s %s", as_flags, TMP_TAIL_O, TMP_TAIL_S);
+  cmd = (char *) alloca (strlen (as_flags) + sizeof TMP_TAIL_O
+			 + sizeof TMP_TAIL_S + 50);
+  sprintf (cmd, "%s -o %s %s", as_flags, TMP_TAIL_O, TMP_TAIL_S);
   
 #ifdef DLLTOOL_ARM
-  if (interwork)
-    strcat (outfile, " -mthumb-interwork");
+  if (machine == MARM_INTERWORK || MTHUMB)
+    strcat (cmd, " -mthumb-interwork");
 #endif
   
-  run (as_name, outfile);
+  run (as_name, cmd);
   
   return  bfd_openr (TMP_TAIL_O, HOW_BFD_TARGET);
 }
@@ -2644,12 +2760,15 @@
 
   if (dontdeltemps < 2)
     {
+      char *name;
+
+      name = (char *) alloca (sizeof TMP_STUB + 10);
       for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
 	{
-	  sprintf (outfile, "%s%05d.o", TMP_STUB, i);
-	  if (unlink (outfile) < 0)
+	  sprintf (name, "%s%05d.o", TMP_STUB, i);
+	  if (unlink (name) < 0)
 	    /* xgettext:c-format */
-	    warn (_("cannot delete %s: %s\n"), outfile, strerror (errno));
+	    warn (_("cannot delete %s: %s\n"), name, strerror (errno));
 	}
     }
   
@@ -2938,17 +3057,18 @@
   /* xgetext:c-format */
   fprintf (file, _("Usage %s <options> <object-files>\n"), program_name);
   /* xgetext:c-format */
-  fprintf (file, _("   -m --machine <machine>    Create {arm, i386, ppc, thumb} DLL. [default: %s]\n"), mname);
+  fprintf (file, _("   -m --machine <machine>    Create as DLL for <machine>.  [default: %s]\n"), mname);
+  fprintf (file, _("        possible <machine>: arm[_interwork], i386, mcore[-elf][-le], ppc, thumb\n"));
   fprintf (file, _("   -e --output-exp <outname> Generate an export file.\n"));
   fprintf (file, _("   -l --output-lib <outname> Generate an interface library.\n"));
   fprintf (file, _("   -a --add-indirect         Add dll indirects to export file.\n"));
   fprintf (file, _("   -D --dllname <name>       Name of input dll to put into interface lib.\n"));
   fprintf (file, _("   -d --input-def <deffile>  Name of .def file to be read in.\n"));
   fprintf (file, _("   -z --output-def <deffile> Name of .def file to be created.\n"));
-  fprintf (file, _("   --export-all-symbols      Export all symbols to .def\n"));
-  fprintf (file, _("   --no-export-all-symbols   Only export listed symbols\n"));
-  fprintf (file, _("   --exclude-symbols <list>  Don't export <list>\n"));
-  fprintf (file, _("   --no-default-excludes     Clear default exclude symbols\n"));
+  fprintf (file, _("      --export-all-symbols   Export all symbols to .def\n"));
+  fprintf (file, _("      --no-export-all-symbols  Only export listed symbols\n"));
+  fprintf (file, _("      --exclude-symbols <list> Don't export <list>\n"));
+  fprintf (file, _("      --no-default-excludes  Clear default exclude symbols\n"));
   fprintf (file, _("   -b --base-file <basefile> Read linker generated base file.\n"));
   fprintf (file, _("   -x --no-idata4            Don't generate idata$4 section.\n"));
   fprintf (file, _("   -c --no-idata5            Don't generate idata$5 section.\n"));
@@ -2957,14 +3077,15 @@
   fprintf (file, _("   -A --add-stdcall-alias    Add aliases without @<n>.\n"));
   fprintf (file, _("   -S --as <name>            Use <name> for assembler.\n"));
   fprintf (file, _("   -f --as-flags <flags>     Pass <flags> to the assembler.\n"));
-#ifdef DLLTOOL_ARM
-  fprintf (file, _("   -i --interwork            Support ARM/Thumb interworking.\n"));
-#endif
   fprintf (file, _("   -n --no-delete            Keep temp files (repeat for extra preservation).\n"));
   fprintf (file, _("   -v --verbose              Be verbose.\n"));
   fprintf (file, _("   -V --version              Display the program version.\n"));
   fprintf (file, _("   -h --help                 Display this information.\n"));
-  
+#ifdef DLLTOOL_MCORE_ELF
+  fprintf (file, _("   -M --mcore-elf <outname>  Process mcore-elf object files into <outname>.\n"));
+  fprintf (file, _("   -L --linker <name>        Use <name> as the linker.\n"));
+  fprintf (file, _("   -F --linker-flags <flags> Pass <flags> to the linker.\n"));
+#endif
   exit (status);
 }
 
@@ -2972,15 +3093,13 @@
 #define OPTION_NO_EXPORT_ALL_SYMS	(OPTION_EXPORT_ALL_SYMS + 1)
 #define OPTION_EXCLUDE_SYMS		(OPTION_NO_EXPORT_ALL_SYMS + 1)
 #define OPTION_NO_DEFAULT_EXCLUDES	(OPTION_EXCLUDE_SYMS + 1)
-#define OPTION_NO_IDATA4		'x'
-#define OPTION_NO_IDATA5		'c'
 
 static const struct option long_options[] =
 {
   {"no-delete", no_argument, NULL, 'n'},
   {"dllname", required_argument, NULL, 'D'},
-  {"no-idata4", no_argument, NULL, OPTION_NO_IDATA4},
-  {"no-idata5", no_argument, NULL, OPTION_NO_IDATA5},
+  {"no-idata4", no_argument, NULL, 'x'},
+  {"no-idata5", no_argument, NULL, 'c'},
   {"output-exp", required_argument, NULL, 'e'},
   {"output-def", required_argument, NULL, 'z'},
   {"export-all-symbols", no_argument, NULL, OPTION_EXPORT_ALL_SYMS},
@@ -3001,9 +3120,7 @@
   {"base-file", required_argument, NULL, 'b'},
   {"as", required_argument, NULL, 'S'},
   {"as-flags", required_argument, NULL, 'f'},
-#ifdef DLLTOOL_ARM
-  {"interwork", no_argument, NULL, 'i'},
-#endif
+  {"mcore-elf", required_argument, NULL, 'M'},
   {0}
 };
 
@@ -3024,18 +3141,17 @@
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
-  while ((c = getopt_long (ac, av, "xcz:S:aD:l:e:nkAvVb:Uh?m:d:f:i",
+  while ((c = getopt_long (ac, av,
+#ifdef DLLTOOL_MCORE_ELF			   
+			   "m:e:l:aD:d:z:b:xcuUkAS:f:nvVhM:L:F:",
+#else
+			   "m:e:l:aD:d:z:b:xcuUkAS:f:nvVh",
+#endif
 			   long_options, 0))
 	 != EOF)
     {
       switch (c)
 	{
-	case OPTION_NO_IDATA4:
-	  no_idata4 = 1;
-	  break;
-	case OPTION_NO_IDATA5:
-	  no_idata5 = 1;
-	  break;
 	case OPTION_EXPORT_ALL_SYMS:
 	  export_all_symbols = true;
 	  break;
@@ -3048,6 +3164,12 @@
 	case OPTION_NO_DEFAULT_EXCLUDES:
 	  do_default_excludes = false;
 	  break;
+	case 'x':
+	  no_idata4 = 1;
+	  break;
+	case 'c':
+	  no_idata5 = 1;
+	  break;
 	case 'S':
 	  as_name = optarg;
 	  break;
@@ -3085,18 +3207,6 @@
 	case 'V':
 	  print_version (program_name);
 	  break;
-#ifdef DLLTOOL_ARM
-	case 'i':
-	  interwork = 1;
-	  break;
-#endif
-	case 'y':
-#if 0
-	  /* We don't currently define YYDEBUG when building
-             defparse.y.  */
-	  yydebug = 1;
-#endif
-	  break;
 	case 'U':
 	  add_underscore = 1;
 	  break;
@@ -3120,6 +3230,17 @@
 	    fatal (_("Unable to open base-file: %s"), optarg);
 
 	  break;
+#ifdef DLLTOOL_MCORE_ELF
+	case 'M':
+	  mcore_elf_out_file = optarg;
+	  break;
+	case 'L':
+	  mcore_elf_linker = optarg;
+	  break;
+	case 'F':
+	  mcore_elf_linker_flags = optarg;
+	  break;
+#endif
 	default:
 	  usage (stderr, 1);
 	  break;
@@ -3127,10 +3248,8 @@
     }
 
   for (i = 0; mtable[i].type; i++)
-    {
-      if (strcmp (mtable[i].type, mname) == 0)
-	break;
-    }
+    if (strcmp (mtable[i].type, mname) == 0)
+      break;
 
   if (!mtable[i].type)
     /* xgettext:c-format */
@@ -3138,12 +3257,6 @@
 
   machine = i;
 
-#ifdef DLLTOOL_ARM
-  /* Always enable interworking for Thumb targets.  */
-  if (machine == MTHUMB && (! interwork))
-    interwork = 1;
-#endif
-  
   if (!dll_name && exp_name)
     {
       int len = strlen (exp_name) + 5;
@@ -3152,6 +3265,9 @@
       strcat (dll_name, ".dll");
     }
 
+  if (as_name == NULL)
+    as_name = deduce_name ("as");
+  
   /* Don't use the default exclude list if we're reading only the
      symbols in the .drectve section.  The default excludes are meant
      to avoid exporting DLL entry point and Cygwin32 impure_ptr.  */
@@ -3194,6 +3310,256 @@
   
   if (output_def)
     gen_def_file ();
-
+  
+#ifdef DLLTOOL_MCORE_ELF
+  if (mcore_elf_out_file)
+    mcore_elf_gen_out_file ();
+#endif
+  
   return 0;
 }
+
+/* Look for the program formed by concatenating PROG_NAME and the
+   string running from PREFIX to END_PREFIX.  If the concatenated
+   string contains a '/', try appending EXECUTABLE_SUFFIX if it is
+   appropriate.  */
+
+static char *
+look_for_prog (prog_name, prefix, end_prefix)
+     const char *prog_name;
+     const char *prefix;
+     int end_prefix;
+{
+  struct stat s;
+  char *cmd;
+
+  cmd = xmalloc (strlen (prefix) 
+                 + strlen (prog_name) 
+#ifdef HAVE_EXECUTABLE_SUFFIX
+                 + strlen (EXECUTABLE_SUFFIX) 
+#endif
+		 + 10);
+  strcpy (cmd, prefix);
+
+  sprintf (cmd + end_prefix, "%s", prog_name);
+
+  if (strchr (cmd, '/') != NULL)
+    {
+      int found;
+
+      found = (stat (cmd, &s) == 0
+#ifdef HAVE_EXECUTABLE_SUFFIX
+               || stat (strcat (cmd, EXECUTABLE_SUFFIX), &s) == 0
+#endif
+	       );
+
+      if (! found)
+        {
+	  /* xgettext:c-format */
+	  inform (_("Tried file: %s"), cmd);
+	  free (cmd);
+	  return NULL;
+	}
+    }
+
+  /* xgettext:c-format */
+  inform (_("Using file: %s"), cmd);
+
+  return cmd;
+}
+
+/* Deduce the name of the program we are want to invoke.
+   PROG_NAME is the basic name of the program we want to run,
+   eg "as" or "ld".  The catch is that we might want actually
+   run "i386-pe-as" or "ppc-pe-ld".  
+
+   If argv[0] contains the full path, then try to find the program
+   in the same place, with and then without a target-like prefix.
+
+   Given, argv[0] = /usr/local/bin/i586-cygwin32-dlltool,
+   deduce_name("as") uses the following search order: 
+
+     /usr/local/bin/i586-cygwin32-as
+     /usr/local/bin/as
+     as
+   
+   If there's an EXECUTABLE_SUFFIX, it'll use that as well; for each
+   name, it'll try without and then with EXECUTABLE_SUFFIX.
+
+   Given, argv[0] = i586-cygwin32-dlltool, it will not even try "as"
+   as the fallback, but rather return i586-cygwin32-as.
+     
+   Oh, and given, argv[0] = dlltool, it'll return "as".
+
+   Returns a dynamically allocated string.  */
+
+static char *
+deduce_name (prog_name)
+     const char *prog_name;
+{
+  char *cmd;
+  char *dash, *slash, *cp;
+
+  dash = NULL;
+  slash = NULL;
+  for (cp = program_name; *cp != '\0'; ++cp)
+    {
+      if (*cp == '-')
+	dash = cp;
+      if (
+#if defined(__DJGPP__) || defined (__CYGWIN__) || defined(__WIN32__)
+	  *cp == ':' || *cp == '\\' ||
+#endif
+	  *cp == '/')
+	{
+	  slash = cp;
+	  dash = NULL;
+	}
+    }
+
+  cmd = NULL;
+
+  if (dash != NULL)
+    {
+      /* First, try looking for a prefixed PROG_NAME in the
+         PROGRAM_NAME directory, with the same prefix as PROGRAM_NAME.  */
+      cmd = look_for_prog (prog_name, program_name, dash - program_name + 1);
+    }
+
+  if (slash != NULL && cmd == NULL)
+    {
+      /* Next, try looking for a PROG_NAME in the same directory as
+         that of this program.  */
+      cmd = look_for_prog (prog_name, program_name, slash - program_name + 1);
+    }
+
+  if (cmd == NULL)
+    {
+      /* Just return PROG_NAME as is.  */
+      cmd = xstrdup (prog_name);
+    }
+
+  return cmd;
+}
+
+#ifdef DLLTOOL_MCORE_ELF
+typedef struct fname_cache
+{
+  char *               filename;
+  struct fname_cache * next;
+}
+fname_cache;
+
+static fname_cache fnames;
+
+static void
+mcore_elf_cache_filename (char * filename)
+{
+  fname_cache * ptr;
+
+  ptr = & fnames;
+
+  while (ptr->next != NULL)
+    ptr = ptr->next;
+
+  ptr->filename = filename;
+  ptr->next     = (fname_cache *) malloc (sizeof (fname_cache));
+  if (ptr->next != NULL)
+    ptr->next->next = NULL;
+}
+
+#define MCORE_ELF_TMP_OBJ "mcoreelf.o"
+#define MCORE_ELF_TMP_EXP "mcoreelf.exp"
+#define MCORE_ELF_TMP_LIB "mcoreelf.lib"
+
+static void
+mcore_elf_gen_out_file (void)
+{
+  fname_cache * ptr;
+  dyn_string_t ds;
+
+  /* Step one.  Run 'ld -r' on the input object files in order to resolve
+     any internal references and to generate a single .exports section.  */
+  ptr = & fnames;
+
+  ds = dyn_string_new (100);
+  dyn_string_append (ds, "-r ");
+
+  if (mcore_elf_linker_flags != NULL)
+    dyn_string_append (ds, mcore_elf_linker_flags);
+  
+  while (ptr->next != NULL)
+    {
+      dyn_string_append (ds, ptr->filename);
+      dyn_string_append (ds, " ");
+
+      ptr = ptr->next;
+    }
+
+  dyn_string_append (ds, "-o ");
+  dyn_string_append (ds, MCORE_ELF_TMP_OBJ);
+
+  if (mcore_elf_linker == NULL)
+    mcore_elf_linker = deduce_name ("ld");
+  
+  run (mcore_elf_linker, ds->s);
+
+  dyn_string_delete (ds);
+
+  /* Step two. Create a .exp file and a .lib file from the temporary file. 
+     Do this by recursively invoking dlltool....*/
+  ds = dyn_string_new (100);
+
+  dyn_string_append (ds, "-S ");
+  dyn_string_append (ds, as_name);
+  
+  dyn_string_append (ds, " -e ");
+  dyn_string_append (ds, MCORE_ELF_TMP_EXP);
+  dyn_string_append (ds, " -l ");
+  dyn_string_append (ds, MCORE_ELF_TMP_LIB);
+  dyn_string_append (ds, " " );
+  dyn_string_append (ds, MCORE_ELF_TMP_OBJ);
+
+  if (verbose)
+    dyn_string_append (ds, " -v");
+  
+  if (dontdeltemps)
+    {
+      dyn_string_append (ds, " -n");
+  
+      if (dontdeltemps > 1)
+	dyn_string_append (ds, " -n");
+    }
+
+  /* XXX - FIME: ought to check/copy other command line options as well.  */
+  
+  run (program_name, ds->s);
+
+  dyn_string_delete (ds);
+
+  /* Step four. Feed the .exp and object files to ld -shared to create the dll.  */
+  ds = dyn_string_new (100);
+
+  dyn_string_append (ds, "-shared ");
+
+  if (mcore_elf_linker_flags)
+    dyn_string_append (ds, mcore_elf_linker_flags);
+
+  dyn_string_append (ds, " ");
+  dyn_string_append (ds, MCORE_ELF_TMP_EXP);
+  dyn_string_append (ds, " ");
+  dyn_string_append (ds, MCORE_ELF_TMP_OBJ);
+  dyn_string_append (ds, " -o ");
+  dyn_string_append (ds, mcore_elf_out_file);
+
+  run (mcore_elf_linker, ds->s);
+
+  dyn_string_delete (ds);
+
+  if (dontdeltemps == 0)
+    unlink (MCORE_ELF_TMP_EXP);
+
+  if (dontdeltemps < 2)
+    unlink (MCORE_ELF_TMP_OBJ);
+}
+#endif /* DLLTOOL_MCORE_ELF */
diff --git a/binutils/dllwrap.c b/binutils/dllwrap.c
index 574611b..84606fb 100644
--- a/binutils/dllwrap.c
+++ b/binutils/dllwrap.c
@@ -26,21 +26,10 @@
 #endif
 #endif
 
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
 #include "bfd.h"
 #include "libiberty.h"
 #include "bucomm.h"
@@ -49,6 +38,13 @@
 
 #include <ctype.h>
 #include <time.h>
+#include <sys/stat.h>
+
+#ifdef ANSI_PROTOTYPES
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
 
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
@@ -83,7 +79,7 @@
 #endif /* ! HAVE_SYS_WAIT_H */
 
 static char *program_version = "0.2.4";
-static char *driver_name = "gcc";
+static char *driver_name = NULL;
 static char *cygwin_driver_flags = 
   "-Wl,--dll -nostartfiles";
 static char *mingw32_driver_flags = "-mdll";
@@ -91,7 +87,7 @@
 
 static char *entry_point;
 
-static char *dlltool_name = "dlltool";
+static char *dlltool_name = NULL;
 
 static char *target = TARGET;
 
@@ -122,11 +118,186 @@
 
 static int run PARAMS ((const char *, char *));
 static void usage PARAMS ((FILE *, int));
+static void display PARAMS ((const char *, va_list));
+static void inform PARAMS ((const char *, ...));
+static char *look_for_prog PARAMS ((const char *, const char *, int));
+static char *deduce_name PARAMS ((const char *));
 static void delete_temp_files PARAMS ((void));
 static void cleanup_and_exit PARAMS ((int status));
 
 /**********************************************************************/
 
+/* Please keep the following 4 routines in sync with dlltool.c:
+     display ()
+     inform ()
+     look_for_prog ()
+     deduce_name ()
+   It's not worth the hassle to break these out since dllwrap will
+   (hopefully) soon be retired in favor of `ld --shared.  */
+
+static void
+display (message, args)
+     const char * message;
+     va_list      args;
+{
+  if (program_name != NULL)
+    fprintf (stderr, "%s: ", program_name);
+
+  vfprintf (stderr, message, args);
+
+  if (message [strlen (message) - 1] != '\n')
+    fputc ('\n', stderr);
+}  
+
+
+static void
+#ifdef __STDC__
+inform (const char * message, ...)
+#else
+inform (message, va_alist)
+     const char * message;
+     va_dcl
+#endif
+{
+  va_list args;
+  
+  if (!verbose)
+    return;
+
+#ifdef __STDC__
+  va_start (args, message);
+#else
+  va_start (args);
+#endif
+
+  display (message, args);
+  
+  va_end (args);
+}
+
+/* Look for the program formed by concatenating PROG_NAME and the
+   string running from PREFIX to END_PREFIX.  If the concatenated
+   string contains a '/', try appending EXECUTABLE_SUFFIX if it is
+   appropriate.  */
+
+static char *
+look_for_prog (prog_name, prefix, end_prefix)
+     const char *prog_name;
+     const char *prefix;
+     int end_prefix;
+{
+  struct stat s;
+  char *cmd;
+
+  cmd = xmalloc (strlen (prefix) 
+                 + strlen (prog_name) 
+#ifdef HAVE_EXECUTABLE_SUFFIX
+                 + strlen (EXECUTABLE_SUFFIX) 
+#endif
+		 + 10);
+  strcpy (cmd, prefix);
+
+  sprintf (cmd + end_prefix, "%s", prog_name);
+
+  if (strchr (cmd, '/') != NULL)
+    {
+      int found;
+
+      found = (stat (cmd, &s) == 0
+#ifdef HAVE_EXECUTABLE_SUFFIX
+               || stat (strcat (cmd, EXECUTABLE_SUFFIX), &s) == 0
+#endif
+	       );
+
+      if (! found)
+        {
+	  /* xgettext:c-format */
+	  inform (_("Tried file: %s"), cmd);
+	  free (cmd);
+	  return NULL;
+	}
+    }
+
+  /* xgettext:c-format */
+  inform (_("Using file: %s"), cmd);
+
+  return cmd;
+}
+
+/* Deduce the name of the program we are want to invoke.
+   PROG_NAME is the basic name of the program we want to run,
+   eg "as" or "ld".  The catch is that we might want actually
+   run "i386-pe-as" or "ppc-pe-ld".  
+
+   If argv[0] contains the full path, then try to find the program
+   in the same place, with and then without a target-like prefix.
+
+   Given, argv[0] = /usr/local/bin/i586-cygwin32-dlltool,
+   deduce_name("as") uses the following search order: 
+
+     /usr/local/bin/i586-cygwin32-as
+     /usr/local/bin/as
+     as
+   
+   If there's an EXECUTABLE_SUFFIX, it'll use that as well; for each
+   name, it'll try without and then with EXECUTABLE_SUFFIX.
+
+   Given, argv[0] = i586-cygwin32-dlltool, it will not even try "as"
+   as the fallback, but rather return i586-cygwin32-as.
+     
+   Oh, and given, argv[0] = dlltool, it'll return "as".
+
+   Returns a dynamically allocated string.  */
+
+static char *
+deduce_name (prog_name)
+     const char *prog_name;
+{
+  char *cmd;
+  char *dash, *slash, *cp;
+
+  dash = NULL;
+  slash = NULL;
+  for (cp = program_name; *cp != '\0'; ++cp)
+    {
+      if (*cp == '-')
+	dash = cp;
+      if (
+#if defined(__DJGPP__) || defined (__CYGWIN__) || defined(__WIN32__)
+	  *cp == ':' || *cp == '\\' ||
+#endif
+	  *cp == '/')
+	{
+	  slash = cp;
+	  dash = NULL;
+	}
+    }
+
+  cmd = NULL;
+
+  if (dash != NULL)
+    {
+      /* First, try looking for a prefixed PROG_NAME in the
+         PROGRAM_NAME directory, with the same prefix as PROGRAM_NAME.  */
+      cmd = look_for_prog (prog_name, program_name, dash - program_name + 1);
+    }
+
+  if (slash != NULL && cmd == NULL)
+    {
+      /* Next, try looking for a PROG_NAME in the same directory as
+         that of this program.  */
+      cmd = look_for_prog (prog_name, program_name, slash - program_name + 1);
+    }
+
+  if (cmd == NULL)
+    {
+      /* Just return PROG_NAME as is.  */
+      cmd = xstrdup (prog_name);
+    }
+
+  return cmd;
+}
+
 static void
 delete_temp_files ()
 {
@@ -341,6 +512,7 @@
   fprintf (file, "   --image-base <base>    Specify image base address\n");
   fprintf (file, "   --target <machine>     i386-cygwin32 or i386-mingw32\n");
   fprintf (file, "   --dry-run              Show what needs to be run\n");
+  fprintf (file, "   --mno-cygwin           Create Mingw DLL\n");
   fprintf (file, "  Options passed to DLLTOOL:\n");
   fprintf (file, "   --machine <machine>\n");
   fprintf (file, "   --output-exp <outname> Generate export file.\n");
@@ -381,9 +553,10 @@
 #define OPTION_ENTRY		(OPTION_DLLTOOL_NAME + 1)
 #define OPTION_IMAGE_BASE	(OPTION_ENTRY + 1)
 #define OPTION_TARGET		(OPTION_IMAGE_BASE + 1)
+#define OPTION_MNO_CYGWIN	(OPTION_TARGET + 1)
 
 /* DLLTOOL options. */
-#define OPTION_NODELETE		(OPTION_TARGET + 1)
+#define OPTION_NODELETE		(OPTION_MNO_CYGWIN + 1)
 #define OPTION_DLLNAME		(OPTION_NODELETE + 1)
 #define OPTION_NO_IDATA4 	(OPTION_DLLNAME + 1)
 #define OPTION_NO_IDATA5	(OPTION_NO_IDATA4 + 1)
@@ -568,6 +741,9 @@
 	case OPTION_TARGET:
 	  target = optarg;
 	  break;
+	case OPTION_MNO_CYGWIN:
+	  target = "i386-mingw32";
+	  break;
 	case OPTION_BASE_FILE:
 	  base_file_name = optarg;
 	  delete_base_file = 0;
@@ -614,7 +790,7 @@
 	    } 
 	}
     }
-  
+
   /* sanity checks. */
   if (! dll_name && ! dll_file_name)
     {
@@ -631,7 +807,14 @@
     {
       dll_file_name = xstrdup (dll_name);
     }
-  
+
+  /* Deduce driver-name and dlltool-name from our own. */
+  if (driver_name == NULL)
+    driver_name = deduce_name ("gcc");
+
+  if (dlltool_name == NULL)
+    dlltool_name = deduce_name ("dlltool");
+
   if (! def_file_seen)
     {
       char *fileprefix = choose_temp_base ();
diff --git a/binutils/filemode.c b/binutils/filemode.c
index 58b52ba..f9811bc 100644
--- a/binutils/filemode.c
+++ b/binutils/filemode.c
@@ -1,5 +1,5 @@
 /* filemode.c -- make a string describing file modes
-   Copyright (C) 1985, 90, 91, 94, 95, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1985, 90, 91, 94, 95, 97, 1999 Free Software Foundation, Inc.
 
    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
@@ -230,8 +230,8 @@
 
 static void
 setst (bits, chars)
-     unsigned long bits;
-     char *chars;
+     unsigned long bits ATTRIBUTE_UNUSED;
+     char *chars ATTRIBUTE_UNUSED;
 {
 #ifdef S_ISUID
   if (bits & S_ISUID)
diff --git a/binutils/ieee.c b/binutils/ieee.c
index 17a5b88..c036928 100644
--- a/binutils/ieee.c
+++ b/binutils/ieee.c
@@ -1,5 +1,5 @@
 /* ieee.c -- Read and write IEEE-695 debugging information.
-   Copyright (C) 1996, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -4104,7 +4104,7 @@
 /*ARGSUSED*/
 static boolean
 ieee_init_buffer (info, buflist)
-     struct ieee_handle *info;
+     struct ieee_handle *info ATTRIBUTE_UNUSED;
      struct ieee_buflist *buflist;
 {
   buflist->head = NULL;
@@ -4145,7 +4145,7 @@
 /*ARGSUSED*/
 static boolean
 ieee_append_buffer (info, mainbuf, newbuf)
-     struct ieee_handle *info;
+     struct ieee_handle *info ATTRIBUTE_UNUSED;
      struct ieee_buflist *mainbuf;
      struct ieee_buflist *newbuf;
 {
@@ -5135,7 +5135,7 @@
 
 static void
 ieee_add_bb11_blocks (abfd, sec, data)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      PTR data;
 {
@@ -5258,8 +5258,8 @@
 /*ARGSUSED*/
 static boolean
 ieee_start_source (p, filename)
-     PTR p;
-     const char *filename;
+     PTR p ATTRIBUTE_UNUSED;
+     const char *filename ATTRIBUTE_UNUSED;
 {
   return true;
 }
@@ -5725,7 +5725,7 @@
      PTR p;
      bfd_signed_vma low;
      bfd_signed_vma high;
-     boolean stringp;
+     boolean stringp ATTRIBUTE_UNUSED;
 {
   struct ieee_handle *info = (struct ieee_handle *) p;
   unsigned int eleindx;
@@ -5792,7 +5792,7 @@
 static boolean
 ieee_set_type (p, bitstringp)
      PTR p;
-     boolean bitstringp;
+     boolean bitstringp ATTRIBUTE_UNUSED;
 {
   struct ieee_handle *info = (struct ieee_handle *) p;
   boolean localp;
@@ -7012,7 +7012,7 @@
 static boolean
 ieee_tag (p, name)
      PTR p;
-     const char *name;
+     const char *name ATTRIBUTE_UNUSED;
 {
   struct ieee_handle *info = (struct ieee_handle *) p;
 
@@ -7026,9 +7026,9 @@
 
 static boolean
 ieee_int_constant (p, name, val)
-     PTR p;
-     const char *name;
-     bfd_vma val;
+     PTR p ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
+     bfd_vma val ATTRIBUTE_UNUSED;
 {
   /* FIXME.  */
   return true;
@@ -7038,9 +7038,9 @@
 
 static boolean
 ieee_float_constant (p, name, val)
-     PTR p;
-     const char *name;
-     double val;
+     PTR p ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
+     double val ATTRIBUTE_UNUSED;
 {
   /* FIXME.  */
   return true;
@@ -7051,8 +7051,8 @@
 static boolean
 ieee_typed_constant (p, name, val)
      PTR p;
-     const char *name;
-     bfd_vma val;
+     const char *name ATTRIBUTE_UNUSED;
+     bfd_vma val ATTRIBUTE_UNUSED;
 {
   struct ieee_handle *info = (struct ieee_handle *) p;
 
diff --git a/binutils/nm.c b/binutils/nm.c
index c51b7fb..884f0b8 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -1305,13 +1305,13 @@
 
 static void
 print_archive_filename_sysv (filename)
-     char *filename;
+     char *filename ATTRIBUTE_UNUSED;
 {
 }
 
 static void
 print_archive_filename_posix (filename)
-     char *filename;
+     char *filename ATTRIBUTE_UNUSED;
 {
 }
 
@@ -1319,7 +1319,7 @@
 
 static void
 print_archive_member_bsd (archive, filename)
-     char *archive;
+     char *archive ATTRIBUTE_UNUSED;
      CONST char *filename;
 {
   if (!filename_per_symbol)
diff --git a/binutils/objcopy.1 b/binutils/objcopy.1
index aee7760..68b98d3 100644
--- a/binutils/objcopy.1
+++ b/binutils/objcopy.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1991, 93, 94, 95, 96, 97, 1998 Free Software Foundation
+.\" Copyright (c) 1991, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation
 .\" See section COPYING for conditions for redistribution
 .TH objcopy 1 "October 1994" "cygnus support" "GNU Development Tools"
 .de BP
@@ -18,6 +18,7 @@
 .RB "[\|" \-F\ \fIbfdname\fR\ |\ \fB\-\-target=\fIbfdname\fR "\|]" 
 .RB "[\|" \-I\ \fIbfdname\fR\ |\ \fB\-\-input\-target=\fIbfdname\fR "\|]" 
 .RB "[\|" \-O\ \fIbfdname\fR\ |\ \fB\-\-output\-target=\fIbfdname\fR "\|]" 
+.RB "[\|" \-j\ \fIsectionname\fR\ |\ \fB\-\-only\-section=\fIsectionname\fR "\|]"
 .RB "[\|" \-R\ \fIsectionname\fR\ |\ \fB\-\-remove\-section=\fIsectionname\fR "\|]"
 .RB "[\|" \-S\fR\ |\ \fB\-\-strip\-all\fR "\|]" 
 .RB "[\|" \-g\fR\ |\ \fB\-\-strip\-debug\fR "\|]" 
@@ -123,6 +124,12 @@
 as the object format for both the input and the output file; i.e.
 simply transfer data from source to destination with no translation.
 .TP
+.B \-j \fIsectionname\fR, \fB\-\-only\-section=\fIsectionname
+Copy only the named section from the input file to the output file,
+discarding all other sections.  This option may be given more than
+once.  Note that using this option inappropriately may make the output
+file unusable.
+.TP
 .B \-R \fIsectionname\fR, \fB\-\-remove-section=\fIsectionname
 Remove the named section from the file.  This option may be given more
 than once.  Note that using this option inappropriately may make the
@@ -301,7 +308,7 @@
 \&, Roland H. Pesch (June 1993).
 
 .SH COPYING
-Copyright (c) 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
+Copyright (c) 1993, 94, 95, 96, 97, 98, 1999 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
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 5fd7777..6137f11 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -111,6 +111,7 @@
   const char *          name;      /* Section name.  */
   boolean               used;      /* Whether this entry was used.  */
   boolean               remove;    /* Whether to remove this section.  */
+  boolean		copy;      /* Whether to copy this section.  */
   enum change_action    change_vma;/* Whether to change or set VMA.  */
   bfd_vma 		vma_val;   /* Amount to change by or set to.  */
   enum change_action    change_lma;/* Whether to change or set LMA.  */
@@ -121,6 +122,7 @@
 
 static struct section_list *change_sections;
 static boolean sections_removed;
+static boolean sections_copied;
 
 /* Changes to the start address.  */
 static bfd_vma change_start = 0;
@@ -246,6 +248,7 @@
   {"debugging", no_argument, 0, OPTION_DEBUGGING},
   {"discard-all", no_argument, 0, 'x'},
   {"discard-locals", no_argument, 0, 'X'},
+  {"only-section", required_argument, 0, 'j'},
   {"format", required_argument, 0, 'F'}, /* Obsolete */
   {"gap-fill", required_argument, 0, OPTION_GAP_FILL},
   {"help", no_argument, 0, 'h'},
@@ -292,10 +295,12 @@
 {
   fprintf (stream, _("\
 Usage: %s [-vVSpgxX] [-I bfdname] [-O bfdname] [-F bfdname] [-b byte]\n\
-       [-R section] [-i interleave] [--interleave=interleave] [--byte=byte]\n\
+       [-j section] [-R section]\n\
+       [-i interleave] [--interleave=interleave] [--byte=byte]\n\
        [--input-target=bfdname] [--output-target=bfdname] [--target=bfdname]\n\
        [--strip-all] [--strip-debug] [--strip-unneeded] [--discard-all]\n\
-       [--discard-locals] [--debugging] [--remove-section=section]\n"),
+       [--discard-locals] [--debugging]\n\
+       [--only-section=section] [--remove-section=section]\n"),
 	   program_name);
   fprintf (stream, _("\
        [--gap-fill=val] [--pad-to=address] [--preserve-dates]\n\
@@ -411,6 +416,7 @@
   p->name = name;
   p->used = false;
   p->remove = false;
+  p->copy = false;
   p->change_vma = CHANGE_IGNORE;
   p->change_lma = CHANGE_IGNORE;
   p->vma_val = 0;
@@ -461,7 +467,7 @@
 
 static boolean
 is_strip_section (abfd, sec)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
 {
   struct section_list *p;
@@ -474,10 +480,15 @@
 	  || convert_debugging))
     return true;
 
-  if (! sections_removed)
+  if (! sections_removed && ! sections_copied)
     return false;
+
   p = find_section_list (bfd_get_section_name (abfd, sec), false);
-  return p != NULL && p->remove ? true : false;
+  if (sections_removed && p != NULL && p->remove)
+    return true;
+  if (sections_copied && (p == NULL || ! p->copy))
+    return true;
+  return false;
 }
 
 /* Choose which symbol entries to copy; put the result in OSYMS.
@@ -594,7 +605,7 @@
 
   for (; from < end; from += interleave)
     *to++ = *from;
-  if (*size % interleave > copy_byte)
+  if (*size % interleave > (bfd_size_type) copy_byte)
     *size = (*size / interleave) + 1;
   else
     *size /= interleave;
@@ -816,6 +827,7 @@
       || localize_specific_list != NULL
       || weaken_specific_list != NULL
       || sections_removed
+      || sections_copied
       || convert_debugging
       || change_leading_char
       || remove_leading_char
@@ -962,6 +974,16 @@
 				  (char *) NULL);
       bfd *output_bfd = bfd_openw (output_name, output_target);
       bfd *last_element;
+      struct stat buf;
+      int stat_status = 0;
+
+      if (preserve_dates)
+	{
+	  stat_status = bfd_stat_arch_elt (this_element, &buf);
+	  if (stat_status != 0)
+	    non_fatal (_("internal stat error on %s"),
+		       bfd_get_filename (this_element));
+	}
 
       l = (struct name_list *) xmalloc (sizeof (struct name_list));
       l->name = output_name;
@@ -984,6 +1006,9 @@
 	  status = 1;
 	}
 
+      if (preserve_dates && stat_status == 0)
+	set_times (output_name, &buf);
+
       /* Open the newly output file and attach to our list.  */
       output_bfd = bfd_openr (output_name, output_target);
 
@@ -1114,7 +1139,9 @@
   if (p != NULL)
     p->used = true;
 
-  if (p != NULL && p->remove)
+  if (sections_removed && p != NULL && p->remove)
+    return;
+  if (sections_copied && (p == NULL || ! p->copy))
     return;
 
   osection = bfd_make_section_anyway (obfd, bfd_section_name (ibfd, isection));
@@ -1243,7 +1270,9 @@
 
   p = find_section_list (bfd_section_name (ibfd, isection), false);
 
-  if (p != NULL && p->remove)
+  if (sections_removed && p != NULL && p->remove)
+    return;
+  if (sections_copied && (p == NULL || ! p->copy))
     return;
 
   osection = isection->output_section;
@@ -1331,7 +1360,7 @@
 
 static void
 get_sections (obfd, osection, secppparg)
-     bfd *obfd;
+     bfd *obfd ATTRIBUTE_UNUSED;
      asection *osection;
      PTR secppparg;
 {
@@ -1438,8 +1467,8 @@
 write_debugging_info (obfd, dhandle, symcountp, symppp)
      bfd *obfd;
      PTR dhandle;
-     long *symcountp;
-     asymbol ***symppp;
+     long *symcountp ATTRIBUTE_UNUSED;
+     asymbol ***symppp ATTRIBUTE_UNUSED;
 {
   if (bfd_get_flavour (obfd) == bfd_target_ieee_flavour)
     return write_ieee_debugging_info (obfd, dhandle);
@@ -1644,7 +1673,7 @@
   struct section_list *p;
   struct stat statbuf;
 
-  while ((c = getopt_long (argc, argv, "b:i:I:K:N:s:O:d:F:L:R:SpgxXVvW:",
+  while ((c = getopt_long (argc, argv, "b:i:I:j:K:N:s:O:d:F:L:R:SpgxXVvW:",
 			   copy_options, (int *) 0)) != EOF)
     {
       switch (c)
@@ -1670,8 +1699,17 @@
 	case 'F':
 	  input_target = output_target = optarg;
 	  break;
+	case 'j':
+	  p = find_section_list (optarg, true);
+	  if (p->remove)
+	    fatal (_("%s both copied and removed"), optarg);
+	  p->copy = true;
+	  sections_copied = true;
+	  break;
 	case 'R':
 	  p = find_section_list (optarg, true);
+	  if (p->copy)
+	    fatal (_("%s both copied and removed"), optarg);
 	  p->remove = true;
 	  sections_removed = true;
 	  break;
@@ -1769,15 +1807,21 @@
 	    const char *s;
 	    int len;
 	    char *name;
-	    char *option;
+	    char *option = NULL;
 	    bfd_vma val;
-	    enum change_action what;
+	    enum change_action what = CHANGE_IGNORE;
 	    
 	    switch (c)
 	      {
-	      case OPTION_CHANGE_SECTION_ADDRESS: option = "--change-section-address"; break;
-	      case OPTION_CHANGE_SECTION_LMA: option = "--change-section-lma"; break;
-	      case OPTION_CHANGE_SECTION_VMA: option = "--change-section-vma"; break;
+	      case OPTION_CHANGE_SECTION_ADDRESS:
+		option = "--change-section-address";
+		break;
+	      case OPTION_CHANGE_SECTION_LMA:
+		option = "--change-section-lma";
+		break;
+	      case OPTION_CHANGE_SECTION_VMA:
+		option = "--change-section-vma";
+		break;
 	      }
 	    
 	    s = strchr (optarg, '=');
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 3f9e8c4..4cff97b 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -83,6 +83,9 @@
 /* Architecture to disassemble for, or default if NULL.  */
 static char *machine = (char *) NULL;
 
+/* Target specific options to the disassembler.  */
+static char *disassembler_options = (char *) NULL;
+
 /* Endianness to disassemble for, or default if BFD_ENDIAN_UNKNOWN.  */
 static enum bfd_endian endian = BFD_ENDIAN_UNKNOWN;
 
@@ -217,7 +220,8 @@
      int status;
 {
   fprintf (stream, _("\
-Usage: %s [-ahifCdDprRtTxsSlw] [-b bfdname] [-m machine] [-j section-name]\n\
+Usage: %s [-ahifCdDprRtTxsSlw] [-b bfdname] [-m machine] \n\
+       [-j section-name] [-M disassembler-options]\n\
        [--archive-headers] [--target=bfdname] [--debugging] [--disassemble]\n\
        [--disassemble-all] [--disassemble-zeroes] [--file-headers]\n\
        [--section-headers] [--headers]\n\
@@ -255,6 +259,7 @@
   {"demangle", no_argument, &do_demangle, 1},
   {"disassemble", no_argument, NULL, 'd'},
   {"disassemble-all", no_argument, NULL, 'D'},
+  {"disassembler-options", required_argument, NULL, 'M'},
   {"disassemble-zeroes", no_argument, &disassemble_zeroes, 1},
   {"dynamic-reloc", no_argument, NULL, 'R'},
   {"dynamic-syms", no_argument, NULL, 'T'},
@@ -284,9 +289,9 @@
 
 static void
 dump_section_header (abfd, section, ignored)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *section;
-     PTR ignored;
+     PTR ignored ATTRIBUTE_UNUSED;
 {
   char *comma = "";
 
@@ -324,6 +329,7 @@
   PF (SEC_NEVER_LOAD, "NEVER_LOAD");
   PF (SEC_EXCLUDE, "EXCLUDE");
   PF (SEC_SORT_ENTRIES, "SORT_ENTRIES");
+  PF (SEC_SHORT, "SHORT");
 
   if ((section->flags & SEC_LINK_ONCE) != 0)
     {
@@ -1134,7 +1140,7 @@
 
   n = strlen (buf);
 
-  while ((f->buffer + f->size) - f->current < n + 1)
+  while ((size_t) ((f->buffer + f->size) - f->current) < n + 1)
     {
       size_t curroff;
 
@@ -1305,11 +1311,16 @@
 	      if (info->bytes_per_line != 0)
 		bytes_per_line = info->bytes_per_line;
 	      if (bytes < 0)
-		break;
+		{
+		  if (sfile.current != sfile.buffer)
+		    printf ("%s\n", sfile.buffer);
+		  free (sfile.buffer);
+		  break;
+		}
 	    }
 	  else
 	    {
-	      long j;
+	      bfd_vma j;
 
 	      bytes = bytes_per_line;
 	      if (i + bytes > stop)
@@ -1329,7 +1340,7 @@
 	      ? show_raw_insn > 0
 	      : show_raw_insn >= 0)
 	    {
-	      long j;
+	      bfd_vma j;
 
 	      /* If ! prefix_addresses and ! wide_output, we print
                  bytes_per_line bytes per line.  */
@@ -1389,7 +1400,7 @@
 	    {
 	      while (pb < bytes)
 		{
-		  long j;
+		  bfd_vma j;
 		  char *s;
 
 		  putchar ('\n');
@@ -1559,10 +1570,12 @@
   disasm_info.flavour = bfd_get_flavour (abfd);
   disasm_info.arch = bfd_get_arch (abfd);
   disasm_info.mach = bfd_get_mach (abfd);
+  disasm_info.disassembler_options = disassembler_options;
+  
   if (bfd_big_endian (abfd))
-    disasm_info.endian = BFD_ENDIAN_BIG;
+    disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_BIG;
   else if (bfd_little_endian (abfd))
-    disasm_info.endian = BFD_ENDIAN_LITTLE;
+    disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_LITTLE;
   else
     /* ??? Aborting here seems too drastic.  We could default to big or little
        instead.  */
@@ -1859,7 +1872,7 @@
 print_section_stabs (abfd, stabsect_name, strsect_name)
      bfd *abfd;
      const char *stabsect_name;
-     const char *strsect_name;
+     const char *strsect_name ATTRIBUTE_UNUSED;
 {
   int i;
   unsigned file_string_table_offset = 0, next_file_string_table_offset = 0;
@@ -2215,7 +2228,7 @@
 /* Should perhaps share code and display with nm? */
 static void
 dump_symbols (abfd, dynamic)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      boolean dynamic;
 {
   asymbol **current;
@@ -2468,7 +2481,10 @@
       if (sym_name)
 	{
 	  printf_vma (q->address);
-	  printf (" %-16s  ", q->howto->name);
+	  if (q->howto->name)
+	    printf (" %-16s  ", q->howto->name);
+	  else
+	    printf (" %-16d  ", q->howto->type);
 	  objdump_print_symname (abfd, (struct disassemble_info *) NULL,
 				 *q->sym_ptr_ptr);
 	}
@@ -2686,7 +2702,7 @@
   bfd_init ();
   set_default_bfd_target ();
 
-  while ((c = getopt_long (argc, argv, "pib:m:VCdDlfahrRtTxsSj:wE:",
+  while ((c = getopt_long (argc, argv, "pib:m:M:VCdDlfahrRtTxsSj:wE:",
 			   long_options, (int *) 0))
 	 != EOF)
     {
@@ -2699,6 +2715,9 @@
 	case 'm':
 	  machine = optarg;
 	  break;
+	case 'M':
+	  disassembler_options = optarg;
+	  break;
 	case 'j':
 	  only = optarg;
 	  break;
diff --git a/binutils/po/POTFILES.in b/binutils/po/POTFILES.in
index 47f3860..a3a0586 100644
--- a/binutils/po/POTFILES.in
+++ b/binutils/po/POTFILES.in
@@ -1,4 +1,3 @@
-readelf.c
 addr2line.c
 ar.c
 arsup.c
@@ -10,6 +9,7 @@
 coffgrok.c
 coffgrok.h
 debug.c
+debug.c
 debug.h
 dlltool.c
 dlltool.h
@@ -18,6 +18,7 @@
 dyn-string.h
 filemode.c
 ieee.c
+ieee.c
 is-ranlib.c
 is-strip.c
 maybe-ranlib.c
@@ -31,7 +32,10 @@
 objdump.c
 prdbg.c
 rdcoff.c
+rdcoff.c
 rddbg.c
+rddbg.c
+readelf.c
 rename.c
 resbin.c
 rescoff.c
@@ -40,6 +44,7 @@
 size.c
 srconv.c
 stabs.c
+stabs.c
 strings.c
 sysdump.c
 version.c
@@ -48,5 +53,3 @@
 winduni.c
 winduni.h
 wrstabs.c
-testsuite/binutils-all/readelf.h
-testsuite/binutils-all/testprog.c
diff --git a/binutils/po/binutils.pot b/binutils/po/binutils.pot
index beeb383..97795cb 100644
--- a/binutils/po/binutils.pot
+++ b/binutils/po/binutils.pot
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-04-26 10:11-0600\n"
+"POT-Creation-Date: 1999-06-03 02:58-0700\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -23,7 +23,7 @@
 msgstr ""
 
 #: addr2line.c:83 ar.c:255 nlmconv.c:1141 nm.c:304 objcopy.c:318 objcopy.c:337
-#: objdump.c:236 readelf.c:1133 size.c:89 strings.c:512 windres.c:723
+#: objdump.c:236 readelf.c:1168 size.c:89 strings.c:512 windres.c:730
 msgid "Report bugs to bug-gnu-utils@gnu.org\n"
 msgstr ""
 
@@ -158,7 +158,7 @@
 msgid "%s: internal error -- this option not implemented\n"
 msgstr ""
 
-#: ar.c:730 ar.c:782 ar.c:1212
+#: ar.c:730 ar.c:782 ar.c:1212 objcopy.c:972
 #, c-format
 msgid "internal stat error on %s"
 msgstr ""
@@ -402,290 +402,323 @@
 msgid "debug_write_type: illegal type encountered"
 msgstr ""
 
-#: dlltool.c:627 dlltool.c:646 dlltool.c:666
+#: dlltool.c:711 dlltool.c:735 dlltool.c:760
 #, c-format
 msgid "Internal error: Unknown machine type: %d\n"
 msgstr ""
 
-#: dlltool.c:700
+#: dlltool.c:794
 #, c-format
 msgid "Can't open def file: %s"
 msgstr ""
 
-#: dlltool.c:705
+#: dlltool.c:799
 #, c-format
 msgid "Processing def file: %s"
 msgstr ""
 
-#: dlltool.c:709
+#: dlltool.c:803
 msgid "Processed def file"
 msgstr ""
 
-#: dlltool.c:734
+#: dlltool.c:828
 #, c-format
 msgid "Syntax error in def file %s:%d\n"
 msgstr ""
 
-#: dlltool.c:767
+#: dlltool.c:861
 #, c-format
 msgid "NAME: %s base: %x"
 msgstr ""
 
-#: dlltool.c:770
+#: dlltool.c:864
 msgid "Can't have LIBRARY and NAME\n"
 msgstr ""
 
-#: dlltool.c:786
+#: dlltool.c:880
 #, c-format
 msgid "LIBRARY: %s base: %x"
 msgstr ""
 
-#: dlltool.c:789
+#: dlltool.c:883
 #, c-format
 msgid "%s: Can't have LIBRARY and NAME\n"
 msgstr ""
 
-#: dlltool.c:1044
+#: dlltool.c:1138
 #, c-format
 msgid "wait: %s"
 msgstr ""
 
-#: dlltool.c:1049
+#: dlltool.c:1143
 #, c-format
 msgid "subprocess got fatal signal %d"
 msgstr ""
 
-#: dlltool.c:1055
+#: dlltool.c:1149
 #, c-format
 msgid "%s exited with status %d\n"
 msgstr ""
 
-#: dlltool.c:1087
+#: dlltool.c:1181
 #, c-format
-msgid "Sucking in info from .drective section in %s\n"
+msgid "Sucking in info from %s section in %s\n"
 msgstr ""
 
-#: dlltool.c:1197
+#: dlltool.c:1291
 #, c-format
 msgid "Excluding symbol: %s\n"
 msgstr ""
 
-#: dlltool.c:1292 dlltool.c:1303 nm.c:902 nm.c:913 objdump.c:379 objdump.c:396
+#: dlltool.c:1386 dlltool.c:1397 nm.c:902 nm.c:913 objdump.c:379 objdump.c:396
 #, c-format
 msgid "%s: no symbols\n"
 msgstr ""
 
 #. FIXME: we ought to read in and block out the base relocations
-#: dlltool.c:1330
+#: dlltool.c:1424
 #, c-format
-msgid "%s: Done reading %s\n"
+msgid "Done reading %s\n"
 msgstr ""
 
-#: dlltool.c:1341
+#: dlltool.c:1435
 #, c-format
 msgid "Unable to open object file: %s"
 msgstr ""
 
-#: dlltool.c:1344
+#: dlltool.c:1438
 #, c-format
 msgid "Scanning object file %s"
 msgstr ""
 
-#: dlltool.c:1434
+#: dlltool.c:1453
+#, c-format
+msgid "Cannot produce mcore-elf dll from archive file: %s"
+msgstr ""
+
+#: dlltool.c:1538
 msgid "Adding exports to output file"
 msgstr ""
 
-#: dlltool.c:1479
+#: dlltool.c:1583
 msgid "Added exports to output file"
 msgstr ""
 
-#: dlltool.c:1587
+#: dlltool.c:1691
 #, c-format
 msgid "Generating export file: %s\n"
 msgstr ""
 
-#: dlltool.c:1592
+#: dlltool.c:1696
 #, c-format
 msgid "Unable to open temporary assembler file: %s"
 msgstr ""
 
-#: dlltool.c:1595
+#: dlltool.c:1699
 #, c-format
 msgid "Opened temporary file: %s"
 msgstr ""
 
-#: dlltool.c:1828
+#: dlltool.c:1918
 msgid "Generated exports file"
 msgstr ""
 
-#: dlltool.c:2081
+#: dlltool.c:2171
 #, c-format
 msgid "bfd_open failed open stub file: %s"
 msgstr ""
 
-#: dlltool.c:2084
+#: dlltool.c:2174
 #, c-format
 msgid "Creating stub file: %s"
 msgstr ""
 
-#: dlltool.c:2593
+#: dlltool.c:2557
+#, c-format
+msgid "failed to open temporary head file: %s"
+msgstr ""
+
+#: dlltool.c:2623
+#, c-format
+msgid "failed to open temporary tail file: %s"
+msgstr ""
+
+#: dlltool.c:2698
 #, c-format
 msgid "Can't open .lib file: %s"
 msgstr ""
 
-#: dlltool.c:2596
+#: dlltool.c:2701
 #, c-format
 msgid "Creating library file: %s\n"
 msgstr ""
 
-#: dlltool.c:2652
+#: dlltool.c:2757
 #, c-format
 msgid "cannot delete %s: %s\n"
 msgstr ""
 
-#: dlltool.c:2656
+#: dlltool.c:2761
 msgid "Created lib file"
 msgstr ""
 
-#: dlltool.c:2757
+#: dlltool.c:2862
 #, c-format
 msgid "Warning, ignoring duplicate EXPORT %s %d,%d\n"
 msgstr ""
 
-#: dlltool.c:2763
+#: dlltool.c:2868
 #, c-format
 msgid "Error, duplicate EXPORT with oridinals: %s"
 msgstr ""
 
-#: dlltool.c:2890
+#: dlltool.c:2995
 msgid "Processing definitions"
 msgstr ""
 
-#: dlltool.c:2928
+#: dlltool.c:3033
 msgid "Processed definitions"
 msgstr ""
 
 #. xgetext:c-format
-#: dlltool.c:2939
+#: dlltool.c:3044
 #, c-format
 msgid "Usage %s <options> <object-files>\n"
 msgstr ""
 
 #. xgetext:c-format
-#: dlltool.c:2941
+#: dlltool.c:3046
 #, c-format
 msgid ""
-"   -m --machine <machine>    Create {arm, i386, ppc, thumb} DLL. [default: "
-"%s]\n"
+"   -m --machine <machine>    Create as DLL for <machine>.  [default: %s]\n"
 msgstr ""
 
-#: dlltool.c:2942
+#: dlltool.c:3047
+msgid ""
+"        possible <machine>: arm[_interwork], i386, mcore[-elf][-le], ppc, "
+"thumb\n"
+msgstr ""
+
+#: dlltool.c:3048
 msgid "   -e --output-exp <outname> Generate an export file.\n"
 msgstr ""
 
-#: dlltool.c:2943
+#: dlltool.c:3049
 msgid "   -l --output-lib <outname> Generate an interface library.\n"
 msgstr ""
 
-#: dlltool.c:2944
+#: dlltool.c:3050
 msgid "   -a --add-indirect         Add dll indirects to export file.\n"
 msgstr ""
 
-#: dlltool.c:2945
+#: dlltool.c:3051
 msgid ""
 "   -D --dllname <name>       Name of input dll to put into interface lib.\n"
 msgstr ""
 
-#: dlltool.c:2946
+#: dlltool.c:3052
 msgid "   -d --input-def <deffile>  Name of .def file to be read in.\n"
 msgstr ""
 
-#: dlltool.c:2947
+#: dlltool.c:3053
 msgid "   -z --output-def <deffile> Name of .def file to be created.\n"
 msgstr ""
 
-#: dlltool.c:2948
-msgid "   --export-all-symbols      Export all symbols to .def\n"
+#: dlltool.c:3054
+msgid "      --export-all-symbols   Export all symbols to .def\n"
 msgstr ""
 
-#: dlltool.c:2949
-msgid "   --no-export-all-symbols   Only export listed symbols\n"
+#: dlltool.c:3055
+msgid "      --no-export-all-symbols  Only export listed symbols\n"
 msgstr ""
 
-#: dlltool.c:2950
-msgid "   --exclude-symbols <list>  Don't export <list>\n"
+#: dlltool.c:3056
+msgid "      --exclude-symbols <list> Don't export <list>\n"
 msgstr ""
 
-#: dlltool.c:2951
-msgid "   --no-default-excludes     Clear default exclude symbols\n"
+#: dlltool.c:3057
+msgid "      --no-default-excludes  Clear default exclude symbols\n"
 msgstr ""
 
-#: dlltool.c:2952
+#: dlltool.c:3058
 msgid "   -b --base-file <basefile> Read linker generated base file.\n"
 msgstr ""
 
-#: dlltool.c:2953
+#: dlltool.c:3059
 msgid "   -x --no-idata4            Don't generate idata$4 section.\n"
 msgstr ""
 
-#: dlltool.c:2954
+#: dlltool.c:3060
 msgid "   -c --no-idata5            Don't generate idata$5 section.\n"
 msgstr ""
 
-#: dlltool.c:2955
+#: dlltool.c:3061
 msgid ""
 "   -U --add-underscore       Add underscores to symbols in interface "
 "library.\n"
 msgstr ""
 
-#: dlltool.c:2956
+#: dlltool.c:3062
 msgid "   -k --kill-at              Kill @<n> from exported names.\n"
 msgstr ""
 
-#: dlltool.c:2957
+#: dlltool.c:3063
 msgid "   -A --add-stdcall-alias    Add aliases without @<n>.\n"
 msgstr ""
 
-#: dlltool.c:2958
+#: dlltool.c:3064
 msgid "   -S --as <name>            Use <name> for assembler.\n"
 msgstr ""
 
-#: dlltool.c:2959
+#: dlltool.c:3065
 msgid "   -f --as-flags <flags>     Pass <flags> to the assembler.\n"
 msgstr ""
 
-#: dlltool.c:2961
-msgid "   -i --interwork            Support ARM/Thumb interworking.\n"
-msgstr ""
-
-#: dlltool.c:2963
+#: dlltool.c:3066
 msgid ""
 "   -n --no-delete            Keep temp files (repeat for extra "
 "preservation).\n"
 msgstr ""
 
-#: dlltool.c:2964
+#: dlltool.c:3067
 msgid "   -v --verbose              Be verbose.\n"
 msgstr ""
 
-#: dlltool.c:2965
+#: dlltool.c:3068
 msgid "   -V --version              Display the program version.\n"
 msgstr ""
 
-#: dlltool.c:2966
+#: dlltool.c:3069
 msgid "   -h --help                 Display this information.\n"
 msgstr ""
 
-#: dlltool.c:3120
+#: dlltool.c:3071
+msgid ""
+"   -M --mcore-elf <outname>  Process mcore-elf object files into <outname>.\n"
+msgstr ""
+
+#: dlltool.c:3072
+msgid "   -L --linker <name>        Use <name> as the linker.\n"
+msgstr ""
+
+#: dlltool.c:3073
+msgid "   -F --linker-flags <flags> Pass <flags> to the linker.\n"
+msgstr ""
+
+#: dlltool.c:3216
 #, c-format
 msgid "Unable to open base-file: %s"
 msgstr ""
 
-#: dlltool.c:3137
+#: dlltool.c:3242
 #, c-format
 msgid "Machine '%s' not supported"
 msgstr ""
 
+#: dlltool.c:3385
+msgid "buffer overflow\n"
+msgstr ""
+
 #: ieee.c:316
 msgid "unexpected end of debugging information"
 msgstr ""
@@ -1273,87 +1306,87 @@
 msgid "cannot mkdir %s for archive copying (error: %s)"
 msgstr ""
 
-#: objcopy.c:1204
+#: objcopy.c:1217
 #, c-format
 msgid "%s: section `%s': error in %s: %s"
 msgstr ""
 
-#: objcopy.c:1476
+#: objcopy.c:1489
 #, c-format
 msgid "%s: can't create debugging section: %s"
 msgstr ""
 
-#: objcopy.c:1491
+#: objcopy.c:1504
 #, c-format
 msgid "%s: can't set debugging section contents: %s"
 msgstr ""
 
-#: objcopy.c:1500
+#: objcopy.c:1513
 #, c-format
 msgid "%s: don't know how to write debugging information for %s"
 msgstr ""
 
-#: objcopy.c:1605
+#: objcopy.c:1618
 #, c-format
 msgid "%s: cannot stat: %s"
 msgstr ""
 
-#: objcopy.c:1655
+#: objcopy.c:1668
 msgid "byte number must be non-negative"
 msgstr ""
 
-#: objcopy.c:1660
+#: objcopy.c:1673
 msgid "interleave must be positive"
 msgstr ""
 
-#: objcopy.c:1729
+#: objcopy.c:1742
 msgid "bad format for --add-section NAME=FILENAME"
 msgstr ""
 
-#: objcopy.c:1732
+#: objcopy.c:1745
 #, c-format
 msgid "cannot stat: %s: %s"
 msgstr ""
 
-#: objcopy.c:1750
+#: objcopy.c:1763
 #, c-format
 msgid "cannot open: %s: %s"
 msgstr ""
 
-#: objcopy.c:1754
+#: objcopy.c:1767
 #, c-format
 msgid "%s: fread failed"
 msgstr ""
 
-#: objcopy.c:1791
+#: objcopy.c:1804
 #, c-format
 msgid "bad format for %s"
 msgstr ""
 
-#: objcopy.c:1855
+#: objcopy.c:1868
 #, c-format
 msgid "Warning: truncating gap-fill from 0x%s to 0x%x"
 msgstr ""
 
-#: objcopy.c:1879
+#: objcopy.c:1892
 msgid "bad format for --set-section-flags"
 msgstr ""
 
-#: objcopy.c:1909
+#: objcopy.c:1922
 msgid "byte number must be less than interleave"
 msgstr ""
 
-#: objcopy.c:1928
+#: objcopy.c:1941
 #, c-format
 msgid "Cannot stat: %s: %s"
 msgstr ""
 
-#: objcopy.c:1968
+#: objcopy.c:1981
 #, c-format
 msgid "Warning: --change-section-vma %s%c0x%s never used"
 msgstr ""
 
-#: objcopy.c:1981
+#: objcopy.c:1994
 #, c-format
 msgid "Warning: --change-section-lma %s%c0x%s never used"
 msgstr ""
@@ -1484,17 +1517,17 @@
 msgid "Contents of section %s:\n"
 msgstr ""
 
-#: objdump.c:2661
+#: objdump.c:2664
 #, c-format
 msgid "BFD header file version %s\n"
 msgstr ""
 
-#: objdump.c:2786
+#: objdump.c:2789
 #, c-format
 msgid "%s: unrecognized -E option\n"
 msgstr ""
 
-#: objdump.c:2797
+#: objdump.c:2800
 #, c-format
 msgid "%s: unrecognized --endian type `%s'\n"
 msgstr ""
@@ -1533,884 +1566,889 @@
 msgid "Last stabs entries before error:\n"
 msgstr ""
 
-#: readelf.c:229 readelf.c:255
+#: readelf.c:237 readelf.c:263
 #, c-format
 msgid "%s: Error: "
 msgstr ""
 
-#: readelf.c:241 readelf.c:270
+#: readelf.c:249 readelf.c:278
 #, c-format
 msgid "%s: Warning: "
 msgstr ""
 
-#: readelf.c:300 readelf.c:325
+#: readelf.c:308 readelf.c:333
 #, c-format
 msgid "Unhandled data length: %d\n"
 msgstr ""
 
-#: readelf.c:420
+#: readelf.c:372
 msgid "Don't know about relocations on this machine architecture\n"
 msgstr ""
 
-#: readelf.c:426
+#: readelf.c:410 readelf.c:439
+msgid "out of memory parsing relocs"
+msgstr ""
+
+#: readelf.c:456
 msgid ""
 "  Offset    Info  Type            Symbol's Value  Symbol's Name          "
 "Addend\n"
 msgstr ""
 
-#: readelf.c:429
+#: readelf.c:459
 msgid "  Offset    Info  Type            Symbol's Value  Symbol's Name\n"
 msgstr ""
 
-#: readelf.c:533
+#: readelf.c:567
 #, c-format
 msgid "unrecognised: %-7lx"
 msgstr ""
 
-#: readelf.c:551
+#: readelf.c:585
 #, c-format
 msgid "<string table index %3ld>"
 msgstr ""
 
-#: readelf.c:703
+#: readelf.c:739
 #, c-format
 msgid "Processor Specific: %lx"
 msgstr ""
 
-#: readelf.c:706
+#: readelf.c:742
 #, c-format
 msgid "Operating System specific: %lx"
 msgstr ""
 
-#: readelf.c:708 readelf.c:961
+#: readelf.c:744 readelf.c:996
 #, c-format
 msgid "<unknown>: %lx"
 msgstr ""
 
-#: readelf.c:722
+#: readelf.c:758
 msgid "NONE (None)"
 msgstr ""
 
-#: readelf.c:723
+#: readelf.c:759
 msgid "REL (Relocatable file)"
 msgstr ""
 
-#: readelf.c:724
+#: readelf.c:760
 msgid "EXEC (Executable file)"
 msgstr ""
 
-#: readelf.c:725
+#: readelf.c:761
 msgid "DYN (Shared object file)"
 msgstr ""
 
-#: readelf.c:726
+#: readelf.c:762
 msgid "CORE (Core file)"
 msgstr ""
 
-#: readelf.c:730
+#: readelf.c:766
 #, c-format
 msgid "Processor Specific: (%x)"
 msgstr ""
 
-#: readelf.c:732
+#: readelf.c:768
 #, c-format
 msgid "OS Specific: (%x)"
 msgstr ""
 
-#: readelf.c:734 readelf.c:793 readelf.c:897 readelf.c:1072
+#: readelf.c:770 readelf.c:829 readelf.c:932 readelf.c:1107
 #, c-format
 msgid "<unknown>: %x"
 msgstr ""
 
-#: readelf.c:747
+#: readelf.c:783
 msgid "None"
 msgstr ""
 
-#: readelf.c:894
+#: readelf.c:929
 msgid "ELFDATA2LSB (little endian)"
 msgstr ""
 
-#: readelf.c:895
+#: readelf.c:930
 msgid "ELFDATA2MSB (big endian)"
 msgstr ""
 
-#: readelf.c:1108
+#: readelf.c:1143
 msgid "Usage: readelf {options} elf-file(s)\n"
 msgstr ""
 
-#: readelf.c:1109
+#: readelf.c:1144
 msgid "  Options are:\n"
 msgstr ""
 
-#: readelf.c:1110
+#: readelf.c:1145
 msgid ""
 "  -a or --all               Equivalent to: -h -l -S -s -r -d -V --histogram\n"
 msgstr ""
 
-#: readelf.c:1111
+#: readelf.c:1146
 msgid "  -h or --file-header       Display the ELF file header\n"
 msgstr ""
 
-#: readelf.c:1112
+#: readelf.c:1147
 msgid "  -l or --program-headers or --segments\n"
 msgstr ""
 
-#: readelf.c:1113
+#: readelf.c:1148
 msgid "                            Display the program headers\n"
 msgstr ""
 
-#: readelf.c:1114
+#: readelf.c:1149
 msgid "  -S or --section-headers or --sections\n"
 msgstr ""
 
-#: readelf.c:1115
+#: readelf.c:1150
 msgid "                            Display the sections' header\n"
 msgstr ""
 
-#: readelf.c:1116
+#: readelf.c:1151
 msgid "  -e or --headers           Equivalent to: -h -l -S\n"
 msgstr ""
 
-#: readelf.c:1117
+#: readelf.c:1152
 msgid "  -s or --syms or --symbols Display the symbol table\n"
 msgstr ""
 
-#: readelf.c:1118
+#: readelf.c:1153
 msgid "  -r or --relocs            Display the relocations (if present)\n"
 msgstr ""
 
-#: readelf.c:1119
+#: readelf.c:1154
 msgid "  -d or --dynamic           Display the dynamic segment (if present)\n"
 msgstr ""
 
-#: readelf.c:1120
+#: readelf.c:1155
 msgid "  -V or --version-info      Display the version sections (if present)\n"
 msgstr ""
 
-#: readelf.c:1121
+#: readelf.c:1156
 msgid ""
 "  -D or --use-dynamic       Use the dynamic section info when displaying "
 "symbols\n"
 msgstr ""
 
-#: readelf.c:1122
+#: readelf.c:1157
 msgid "  -x <number> or --hex-dump=<number>\n"
 msgstr ""
 
-#: readelf.c:1123
+#: readelf.c:1158
 msgid "                            Dump the contents of section <number>\n"
 msgstr ""
 
-#: readelf.c:1124
+#: readelf.c:1159
 msgid "  -w[liapr] or --debug-dump[=line,=info,=abbrev,=pubnames,=ranges]\n"
 msgstr ""
 
-#: readelf.c:1125
+#: readelf.c:1160
 msgid ""
 "                            Display the contents of DWARF2 debug sections\n"
 msgstr ""
 
-#: readelf.c:1127
+#: readelf.c:1162
 msgid "  -i <number> or --instruction-dump=<number>\n"
 msgstr ""
 
-#: readelf.c:1128
+#: readelf.c:1163
 msgid ""
 "                            Disassemble the contents of section <number>\n"
 msgstr ""
 
-#: readelf.c:1130
+#: readelf.c:1165
 msgid "        --histogram         Display histogram of bucket list lengths\n"
 msgstr ""
 
-#: readelf.c:1131
+#: readelf.c:1166
 msgid "  -v or --version           Display the version number of readelf\n"
 msgstr ""
 
-#: readelf.c:1132
+#: readelf.c:1167
 msgid "  -H or --help              Display this information\n"
 msgstr ""
 
-#: readelf.c:1150
+#: readelf.c:1185
 msgid "Out of memory allocating dump request table."
 msgstr ""
 
-#: readelf.c:1274
+#: readelf.c:1309
 #, c-format
 msgid "Unrecognised debug option '%s'\n"
 msgstr ""
 
-#: readelf.c:1299
+#: readelf.c:1334
 #, c-format
 msgid "Invalid option '-%c'\n"
 msgstr ""
 
-#: readelf.c:1312
+#: readelf.c:1347
 msgid "Nothing to do.\n"
 msgstr ""
 
-#: readelf.c:1323 readelf.c:1336 readelf.c:2459
+#: readelf.c:1360 readelf.c:1377 readelf.c:2531
 msgid "none"
 msgstr ""
 
-#: readelf.c:1324
+#: readelf.c:1361
 msgid "ELF32"
 msgstr ""
 
-#: readelf.c:1325
+#: readelf.c:1362
 msgid "ELF64"
 msgstr ""
 
-#: readelf.c:1326 readelf.c:1339 readelf.c:1352
-msgid "<unknown>"
+#: readelf.c:1364 readelf.c:1381 readelf.c:1398
+#, c-format
+msgid "<unknown: %lx>"
 msgstr ""
 
-#: readelf.c:1337
-msgid "2's compilment, little endian"
-msgstr ""
-
-#: readelf.c:1338
-msgid "2's compilment, big endian"
-msgstr ""
-
-#: readelf.c:1349
-msgid "UNIX - System V"
-msgstr ""
-
-#: readelf.c:1350
-msgid "UNIX - HP-UX"
-msgstr ""
-
-#: readelf.c:1351
-msgid "Standalone App"
-msgstr ""
-
-#: readelf.c:1366
-msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
-msgstr ""
-
-#: readelf.c:1374
-msgid "ELF Header:\n"
-msgstr ""
-
-#: readelf.c:1375
-msgid "  Magic:   "
+#: readelf.c:1378
+msgid "2's complement, little endian"
 msgstr ""
 
 #: readelf.c:1379
+msgid "2's complement, big endian"
+msgstr ""
+
+#: readelf.c:1394
+msgid "UNIX - System V"
+msgstr ""
+
+#: readelf.c:1395
+msgid "UNIX - HP-UX"
+msgstr ""
+
+#: readelf.c:1396
+msgid "Standalone App"
+msgstr ""
+
+#: readelf.c:1413
+msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
+msgstr ""
+
+#: readelf.c:1421
+msgid "ELF Header:\n"
+msgstr ""
+
+#: readelf.c:1422
+msgid "  Magic:   "
+msgstr ""
+
+#: readelf.c:1426
 #, c-format
 msgid "  Class:                             %s\n"
 msgstr ""
 
-#: readelf.c:1381 readelf.c:1397
+#: readelf.c:1428 readelf.c:1445
 #, c-format
 msgid "  Data:                              %s\n"
 msgstr ""
 
-#: readelf.c:1383
+#: readelf.c:1430
 #, c-format
 msgid "  Version:                           %d %s\n"
 msgstr ""
 
-#: readelf.c:1387
+#: readelf.c:1435
 #, c-format
 msgid "  OS/ABI:                            %s\n"
 msgstr ""
 
-#: readelf.c:1389
+#: readelf.c:1437
 #, c-format
 msgid "  ABI Version:                       %d\n"
 msgstr ""
 
-#: readelf.c:1391
+#: readelf.c:1439
 #, c-format
 msgid "  Type:                              %s\n"
 msgstr ""
 
-#: readelf.c:1393
+#: readelf.c:1441
 #, c-format
 msgid "  Machine:                           %s\n"
 msgstr ""
 
-#: readelf.c:1395
+#: readelf.c:1443
 #, c-format
 msgid "  Version:                           0x%lx\n"
 msgstr ""
 
-#: readelf.c:1399
+#: readelf.c:1447
 #, c-format
 msgid "  Entry point address:               0x%lx\n"
 msgstr ""
 
-#: readelf.c:1401
+#: readelf.c:1449
 #, c-format
 msgid "  Start of program headers:          %ld (bytes into file)\n"
 msgstr ""
 
-#: readelf.c:1403
+#: readelf.c:1451
 #, c-format
 msgid "  Start of section headers:          %ld (bytes into file)\n"
 msgstr ""
 
-#: readelf.c:1405
+#: readelf.c:1453
 #, c-format
 msgid "  Flags:                             0x%lx%s\n"
 msgstr ""
 
-#: readelf.c:1408
+#: readelf.c:1456
 #, c-format
 msgid "  Size of this header:               %ld (bytes)\n"
 msgstr ""
 
-#: readelf.c:1410
+#: readelf.c:1458
 #, c-format
 msgid "  Size of program headers:           %ld (bytes)\n"
 msgstr ""
 
-#: readelf.c:1412
+#: readelf.c:1460
 #, c-format
 msgid "  Number of program headers:         %ld\n"
 msgstr ""
 
-#: readelf.c:1414
+#: readelf.c:1462
 #, c-format
 msgid "  Size of section headers:           %ld (bytes)\n"
 msgstr ""
 
-#: readelf.c:1416
+#: readelf.c:1464
 #, c-format
 msgid "  Number of section headers:         %ld\n"
 msgstr ""
 
-#: readelf.c:1418
+#: readelf.c:1466
 #, c-format
 msgid "  Section header string table index: %ld\n"
 msgstr ""
 
-#: readelf.c:1428
+#: readelf.c:1476
 msgid "Not a 32 bit ELF file\n"
 msgstr ""
 
-#: readelf.c:1448
+#: readelf.c:1496
 msgid ""
 "\n"
 "There are no program headers in this file.\n"
 msgstr ""
 
-#: readelf.c:1454
+#: readelf.c:1502
 #, c-format
 msgid ""
 "\n"
 "Elf file is %s\n"
 msgstr ""
 
-#: readelf.c:1455
+#: readelf.c:1503
 #, c-format
 msgid "Entry point 0x%lx\n"
 msgstr ""
 
-#: readelf.c:1456
+#: readelf.c:1504
 #, c-format
 msgid "There are %d program headers, starting at offset %lx:\n"
 msgstr ""
 
-#: readelf.c:1469 readelf.c:1619 readelf.c:1662 readelf.c:2018 readelf.c:2142
-#: readelf.c:3043 readelf.c:3057
+#: readelf.c:1517 readelf.c:1668 readelf.c:1711 readelf.c:2090 readelf.c:2214
+#: readelf.c:3115 readelf.c:3129
 msgid "Out of memory\n"
 msgstr ""
 
-#: readelf.c:1492
+#: readelf.c:1540
 #, c-format
 msgid ""
 "\n"
 "Program Header%s:\n"
 msgstr ""
 
-#: readelf.c:1494
+#: readelf.c:1542
 msgid ""
 "  Type        Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align\n"
 msgstr ""
 
-#: readelf.c:1529
+#: readelf.c:1578
 msgid "more than one dynamic segment\n"
 msgstr ""
 
-#: readelf.c:1537
+#: readelf.c:1586
 msgid "Unable to find program interpreter name\n"
 msgstr ""
 
-#: readelf.c:1544
+#: readelf.c:1593
 #, c-format
 msgid ""
 "\n"
 "      [Requesting program interpreter: %s]"
 msgstr ""
 
-#: readelf.c:1562
+#: readelf.c:1611
 msgid ""
 "\n"
 " Section to Segment mapping:\n"
 msgstr ""
 
-#: readelf.c:1563
+#: readelf.c:1612
 msgid "  Segment Sections...\n"
 msgstr ""
 
-#: readelf.c:1697
+#: readelf.c:1746
 msgid ""
 "\n"
 "There are no sections in this file.\n"
 msgstr ""
 
-#: readelf.c:1703
+#: readelf.c:1752
 #, c-format
 msgid "There are %d section headers, starting at offset %lx:\n"
 msgstr ""
 
-#: readelf.c:1737
+#: readelf.c:1786
 msgid "File contains multiple dynamic symbol tables\n"
 msgstr ""
 
-#: readelf.c:1750
+#: readelf.c:1799
 msgid "File contains multiple dynamic string tables\n"
 msgstr ""
 
-#: readelf.c:1777
+#: readelf.c:1826
 #, c-format
 msgid ""
 "\n"
 "Section Header%s:\n"
 msgstr ""
 
-#: readelf.c:1779
+#: readelf.c:1828
 msgid ""
 "  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk "
 "Inf Al\n"
 msgstr ""
 
-#: readelf.c:1844
+#: readelf.c:1909
 #, c-format
 msgid ""
 "\n"
 "Relocation section at offset 0x%lx contains %ld bytes:\n"
 msgstr ""
 
-#: readelf.c:1851
+#: readelf.c:1916
 msgid ""
 "\n"
 "There are no dynamic relocations in this file.\n"
 msgstr ""
 
-#: readelf.c:1877
+#: readelf.c:1943
 msgid ""
 "\n"
 "Relocation section "
 msgstr ""
 
-#: readelf.c:1884
+#: readelf.c:1954
 #, c-format
 msgid " at offset 0x%lx contains %lu entries:\n"
 msgstr ""
 
-#: readelf.c:1910
+#: readelf.c:1982
 msgid ""
 "\n"
 "There are no relocations in this file.\n"
 msgstr ""
 
-#: readelf.c:1998
+#: readelf.c:2070
 msgid ""
 "\n"
 "There is no dynamic segment in this file.\n"
 msgstr ""
 
-#: readelf.c:2056
+#: readelf.c:2128
 msgid "Unable to seek to end of file!"
 msgstr ""
 
-#: readelf.c:2062
+#: readelf.c:2134
 msgid "Unable to determine the number of symbols to load\n"
 msgstr ""
 
-#: readelf.c:2092
+#: readelf.c:2164
 msgid "Unable to seek to end of file\n"
 msgstr ""
 
-#: readelf.c:2098
+#: readelf.c:2170
 msgid "Unable to determine the length of the dynamic string table\n"
 msgstr ""
 
-#: readelf.c:2159
+#: readelf.c:2231
 #, c-format
 msgid ""
 "\n"
 "Dynamic segment at offset 0x%x contains %d entries:\n"
 msgstr ""
 
-#: readelf.c:2162
+#: readelf.c:2234
 msgid "  Tag        Type                         Name/Value\n"
 msgstr ""
 
-#: readelf.c:2169
+#: readelf.c:2241
 #, c-format
 msgid "  0x%-8.8lx (%s)%*s"
 msgstr ""
 
-#: readelf.c:2182
+#: readelf.c:2254
 msgid "Auxiliary library"
 msgstr ""
 
-#: readelf.c:2184
+#: readelf.c:2256
 msgid "Filter library"
 msgstr ""
 
-#: readelf.c:2196 readelf.c:2217 readelf.c:2243
+#: readelf.c:2268 readelf.c:2289 readelf.c:2315
 msgid "Flags:"
 msgstr ""
 
-#: readelf.c:2198 readelf.c:2219 readelf.c:2245
+#: readelf.c:2270 readelf.c:2291 readelf.c:2317
 msgid " None\n"
 msgstr ""
 
-#: readelf.c:2348
+#: readelf.c:2420
 #, c-format
 msgid "Shared library: [%s]"
 msgstr ""
 
-#: readelf.c:2353
+#: readelf.c:2425
 msgid " program interpreter\n"
 msgstr ""
 
-#: readelf.c:2357
+#: readelf.c:2429
 #, c-format
 msgid "Library soname: [%s]\n"
 msgstr ""
 
-#: readelf.c:2361
+#: readelf.c:2433
 #, c-format
 msgid "Library rpath: [%s]\n"
 msgstr ""
 
-#: readelf.c:2413
+#: readelf.c:2485
 #, c-format
 msgid "Not needed object: [%s]\n"
 msgstr ""
 
-#: readelf.c:2505
+#: readelf.c:2577
 #, c-format
 msgid ""
 "\n"
 "Version definition section '%s' contains %ld entries:\n"
 msgstr ""
 
-#: readelf.c:2508
+#: readelf.c:2580
 msgid "  Addr: 0x"
 msgstr ""
 
-#: readelf.c:2510 readelf.c:2699
+#: readelf.c:2582 readelf.c:2771
 #, c-format
 msgid "  Offset: %#08lx  Link: %lx (%s)\n"
 msgstr ""
 
-#: readelf.c:2540
+#: readelf.c:2612
 #, c-format
 msgid "  %#06x: Rev: %d  Flags: %s"
 msgstr ""
 
-#: readelf.c:2543
+#: readelf.c:2615
 #, c-format
 msgid "  Index: %d  Cnt: %d  "
 msgstr ""
 
-#: readelf.c:2554
+#: readelf.c:2626
 #, c-format
 msgid "Name: %s\n"
 msgstr ""
 
-#: readelf.c:2556
+#: readelf.c:2628
 #, c-format
 msgid "Name index: %ld\n"
 msgstr ""
 
-#: readelf.c:2571
+#: readelf.c:2643
 #, c-format
 msgid "  %#06x: Parent %d: %s\n"
 msgstr ""
 
-#: readelf.c:2574
+#: readelf.c:2646
 #, c-format
 msgid "  %#06x: Parent %d, name index: %ld\n"
 msgstr ""
 
-#: readelf.c:2593
+#: readelf.c:2665
 #, c-format
 msgid ""
 "\n"
 "Version needs section '%s' contains %ld entries:\n"
 msgstr ""
 
-#: readelf.c:2596
+#: readelf.c:2668
 msgid " Addr: 0x"
 msgstr ""
 
-#: readelf.c:2598
+#: readelf.c:2670
 #, c-format
 msgid "  Offset: %#08lx  Link to section: %ld (%s)\n"
 msgstr ""
 
-#: readelf.c:2624
+#: readelf.c:2696
 #, c-format
 msgid "  %#06x: Version: %d"
 msgstr ""
 
-#: readelf.c:2627
+#: readelf.c:2699
 #, c-format
 msgid "  File: %s"
 msgstr ""
 
-#: readelf.c:2629
+#: readelf.c:2701
 #, c-format
 msgid "  File: %lx"
 msgstr ""
 
-#: readelf.c:2631
+#: readelf.c:2703
 #, c-format
 msgid "  Cnt: %d\n"
 msgstr ""
 
-#: readelf.c:2649
+#: readelf.c:2721
 #, c-format
 msgid "  %#06x: Name: %s"
 msgstr ""
 
-#: readelf.c:2652
+#: readelf.c:2724
 #, c-format
 msgid "  %#06x: Name index: %lx"
 msgstr ""
 
-#: readelf.c:2655
+#: readelf.c:2727
 #, c-format
 msgid "  Flags: %s  Version: %d\n"
 msgstr ""
 
-#: readelf.c:2694
+#: readelf.c:2766
 #, c-format
 msgid ""
 "\n"
 "Version symbols section '%s' contains %d entries:\n"
 msgstr ""
 
-#: readelf.c:2697
+#: readelf.c:2769
 msgid " Addr: "
 msgstr ""
 
-#: readelf.c:2726
+#: readelf.c:2798
 msgid "   0 (*local*)    "
 msgstr ""
 
-#: readelf.c:2730
+#: readelf.c:2802
 msgid "   1 (*global*)   "
 msgstr ""
 
-#: readelf.c:2953
+#: readelf.c:3025
 msgid ""
 "\n"
 "No version information found in this file.\n"
 msgstr ""
 
-#: readelf.c:2966
+#: readelf.c:3038
 msgid "LOCAL"
 msgstr ""
 
-#: readelf.c:2967
+#: readelf.c:3039
 msgid "GLOBAL"
 msgstr ""
 
-#: readelf.c:2968
+#: readelf.c:3040
 msgid "WEAK"
 msgstr ""
 
-#: readelf.c:2971 readelf.c:2995
+#: readelf.c:3043 readelf.c:3067
 #, c-format
 msgid "<processor specific>: %d"
 msgstr ""
 
-#: readelf.c:2973 readelf.c:2997
+#: readelf.c:3045 readelf.c:3069
 #, c-format
 msgid "<OS specific>: %d"
 msgstr ""
 
-#: readelf.c:2975 readelf.c:2999
+#: readelf.c:3047 readelf.c:3071
 #, c-format
 msgid "<unknown>: %d"
 msgstr ""
 
-#: readelf.c:2988
+#: readelf.c:3060
 msgid "NOTYPE"
 msgstr ""
 
-#: readelf.c:2989
+#: readelf.c:3061
 msgid "OBJECT"
 msgstr ""
 
-#: readelf.c:2990
+#: readelf.c:3062
 msgid "FUNC"
 msgstr ""
 
-#: readelf.c:2991
+#: readelf.c:3063
 msgid "SECTION"
 msgstr ""
 
-#: readelf.c:2992
+#: readelf.c:3064
 msgid "FILE"
 msgstr ""
 
-#: readelf.c:3049
+#: readelf.c:3121
 msgid "Unable to read in dynamic data\n"
 msgstr ""
 
-#: readelf.c:3091
+#: readelf.c:3163
 msgid "Unable to seek to start of dynamic information"
 msgstr ""
 
-#: readelf.c:3097
+#: readelf.c:3169
 msgid "Failed to read in number of buckets\n"
 msgstr ""
 
-#: readelf.c:3103
+#: readelf.c:3175
 msgid "Failed to read in number of chains\n"
 msgstr ""
 
-#: readelf.c:3123
+#: readelf.c:3195
 msgid ""
 "\n"
 "Symbol table for image:\n"
 msgstr ""
 
-#: readelf.c:3124
+#: readelf.c:3196
 msgid "  Num Buc:    Value  Size   Type   Bind Ot Ndx Name\n"
 msgstr ""
 
-#: readelf.c:3169
+#: readelf.c:3241
 #, c-format
 msgid ""
 "\n"
 "Symbol table '%s' contains %lu entries:\n"
 msgstr ""
 
-#: readelf.c:3172
+#: readelf.c:3244
 msgid "  Num:    Value  Size Type    Bind   Ot  Ndx Name\n"
 msgstr ""
 
-#: readelf.c:3291
+#: readelf.c:3356
 msgid "bad dynamic symbol"
 msgstr ""
 
-#: readelf.c:3350
+#: readelf.c:3415
 msgid ""
 "\n"
 "Dynamic symbol information is not available for displaying symbols.\n"
 msgstr ""
 
-#: readelf.c:3362
+#: readelf.c:3427
 #, c-format
 msgid ""
 "\n"
 "Histogram for bucket list length (total of %d buckets):\n"
 msgstr ""
 
-#: readelf.c:3364
+#: readelf.c:3429
 msgid " Length  Number     %% of total  Coverage\n"
 msgstr ""
 
-#: readelf.c:3369 readelf.c:3388 readelf.c:5271 readelf.c:5461
+#: readelf.c:3434 readelf.c:3453 readelf.c:5336 readelf.c:5526
 msgid "Out of memory"
 msgstr ""
 
-#: readelf.c:3434
+#: readelf.c:3499
 #, c-format
 msgid ""
 "\n"
 "Dynamic info segment at offset 0x%lx contains %d entries:\n"
 msgstr ""
 
-#: readelf.c:3437
+#: readelf.c:3502
 msgid " Num: Name                           BoundTo     Flags\n"
 msgstr ""
 
-#: readelf.c:3485
+#: readelf.c:3550
 #, c-format
 msgid ""
 "\n"
 "Assembly dump of section %s\n"
 msgstr ""
 
-#: readelf.c:3508
+#: readelf.c:3573
 #, c-format
 msgid ""
 "\n"
 "Section '%s' has no data to dump.\n"
 msgstr ""
 
-#: readelf.c:3513
+#: readelf.c:3578
 #, c-format
 msgid ""
 "\n"
 "Hex dump of section '%s':\n"
 msgstr ""
 
-#: readelf.c:3663
+#: readelf.c:3728
 msgid "badly formed extended line op encountered!"
 msgstr ""
 
-#: readelf.c:3670
+#: readelf.c:3735
 #, c-format
 msgid "  Extended opcode %d: "
 msgstr ""
 
-#: readelf.c:3675
+#: readelf.c:3740
 msgid ""
 "End of Sequence\n"
 "\n"
 msgstr ""
 
-#: readelf.c:3682
+#: readelf.c:3747
 #, c-format
 msgid "set Address to 0x%lx\n"
 msgstr ""
 
-#: readelf.c:3687
+#: readelf.c:3752
 msgid "  define new File Table entry\n"
 msgstr ""
 
-#: readelf.c:3688 readelf.c:3806
+#: readelf.c:3753 readelf.c:3871
 msgid "  Entry\tDir\tTime\tSize\tName\n"
 msgstr ""
 
-#: readelf.c:3690
+#: readelf.c:3755
 #, c-format
 msgid "   %d\t"
 msgstr ""
 
-#: readelf.c:3693 readelf.c:3695 readelf.c:3697 readelf.c:3818 readelf.c:3820
-#: readelf.c:3822
+#: readelf.c:3758 readelf.c:3760 readelf.c:3762 readelf.c:3883 readelf.c:3885
+#: readelf.c:3887
 #, c-format
 msgid "%lu\t"
 msgstr ""
 
-#: readelf.c:3698
+#: readelf.c:3763
 #, c-format
 msgid ""
 "%s\n"
 "\n"
 msgstr ""
 
-#: readelf.c:3702
+#: readelf.c:3767
 #, c-format
 msgid "UNKNOWN: length %d\n"
 msgstr ""
 
-#: readelf.c:3724
+#: readelf.c:3789
 #, c-format
 msgid ""
 "\n"
@@ -2418,421 +2456,421 @@
 "\n"
 msgstr ""
 
-#: readelf.c:3736
+#: readelf.c:3801
 msgid "The line info appears to be corrupt - the section is too small\n"
 msgstr ""
 
-#: readelf.c:3744
+#: readelf.c:3809
 msgid "Only DWARF version 2 line info is currently supported.\n"
 msgstr ""
 
-#: readelf.c:3759
+#: readelf.c:3824
 #, c-format
 msgid "  Length:                      %ld\n"
 msgstr ""
 
-#: readelf.c:3760
+#: readelf.c:3825
 #, c-format
 msgid "  DWARF Version:               %d\n"
 msgstr ""
 
-#: readelf.c:3761
+#: readelf.c:3826
 #, c-format
 msgid "  Prolgue Length:              %d\n"
 msgstr ""
 
-#: readelf.c:3762
+#: readelf.c:3827
 #, c-format
 msgid "  Minimum Instruction Length:  %d\n"
 msgstr ""
 
-#: readelf.c:3763
+#: readelf.c:3828
 #, c-format
 msgid "  Initial value of 'is_stmt':  %d\n"
 msgstr ""
 
-#: readelf.c:3764
+#: readelf.c:3829
 #, c-format
 msgid "  Line Base:                   %d\n"
 msgstr ""
 
-#: readelf.c:3765
+#: readelf.c:3830
 #, c-format
 msgid "  Line Range:                  %d\n"
 msgstr ""
 
-#: readelf.c:3766
+#: readelf.c:3831
 #, c-format
 msgid "  Opcode Base:                 %d\n"
 msgstr ""
 
-#: readelf.c:3775
+#: readelf.c:3840
 msgid ""
 "\n"
 " Opcodes:\n"
 msgstr ""
 
-#: readelf.c:3778
+#: readelf.c:3843
 #, c-format
 msgid "  Opcode %d has %d args\n"
 msgstr ""
 
-#: readelf.c:3784
+#: readelf.c:3849
 msgid ""
 "\n"
 " The Directory Table is empty.\n"
 msgstr ""
 
-#: readelf.c:3787
+#: readelf.c:3852
 msgid ""
 "\n"
 " The Directory Table:\n"
 msgstr ""
 
-#: readelf.c:3791
+#: readelf.c:3856
 #, c-format
 msgid "  %s\n"
 msgstr ""
 
-#: readelf.c:3802
+#: readelf.c:3867
 msgid ""
 "\n"
 " The File Name Table is empty.\n"
 msgstr ""
 
-#: readelf.c:3805
+#: readelf.c:3870
 msgid ""
 "\n"
 " The File Name Table:\n"
 msgstr ""
 
-#: readelf.c:3813
+#: readelf.c:3878
 #, c-format
 msgid "  %d\t"
 msgstr ""
 
-#: readelf.c:3824
+#: readelf.c:3889
 #, c-format
 msgid "%s\n"
 msgstr ""
 
 #. Now display the statements.
-#: readelf.c:3832
+#: readelf.c:3897
 msgid ""
 "\n"
 " Line Number Statements:\n"
 msgstr ""
 
-#: readelf.c:3850
+#: readelf.c:3915
 msgid "  Copy\n"
 msgstr ""
 
-#: readelf.c:3857
+#: readelf.c:3922
 #, c-format
 msgid "  Advance PC by %d to %lx\n"
 msgstr ""
 
-#: readelf.c:3865
+#: readelf.c:3930
 #, c-format
 msgid "  Advance Line by %d to %d\n"
 msgstr ""
 
-#: readelf.c:3872
+#: readelf.c:3937
 #, c-format
 msgid "  Set File Name to entry %d in the File Name Table\n"
 msgstr ""
 
-#: readelf.c:3880
+#: readelf.c:3945
 #, c-format
 msgid "  Set column to %d\n"
 msgstr ""
 
-#: readelf.c:3887
+#: readelf.c:3952
 #, c-format
 msgid "  Set is_stmt to %d\n"
 msgstr ""
 
-#: readelf.c:3892
+#: readelf.c:3957
 msgid "  Set basic block\n"
 msgstr ""
 
-#: readelf.c:3899
+#: readelf.c:3964
 #, c-format
 msgid "  Advance PC by constant %d to 0x%lx\n"
 msgstr ""
 
-#: readelf.c:3907
+#: readelf.c:3972
 #, c-format
 msgid "  Advance PC by fixed size amount %d to 0x%lx\n"
 msgstr ""
 
-#: readelf.c:3915
+#: readelf.c:3980
 #, c-format
 msgid "  Special opcode %d: advance Address by %d to 0x%lx"
 msgstr ""
 
-#: readelf.c:3919
+#: readelf.c:3984
 #, c-format
 msgid " and Line by %d to %d\n"
 msgstr ""
 
-#: readelf.c:3942 readelf.c:4361
+#: readelf.c:4007 readelf.c:4426
 #, c-format
 msgid ""
 "Contents of the %s section:\n"
 "\n"
 msgstr ""
 
-#: readelf.c:3961
+#: readelf.c:4026
 msgid "Only DWARF 2 pubnames are currently supported"
 msgstr ""
 
-#: readelf.c:3965
+#: readelf.c:4030
 #, c-format
 msgid "  Length:                              %ld\n"
 msgstr ""
 
-#: readelf.c:3967
+#: readelf.c:4032
 #, c-format
 msgid "  Version:                             %d\n"
 msgstr ""
 
-#: readelf.c:3969
+#: readelf.c:4034
 #, c-format
 msgid "  Offset into .debug_info section:     %ld\n"
 msgstr ""
 
-#: readelf.c:3971
+#: readelf.c:4036
 #, c-format
 msgid "  Size of area in .debug_info section: %ld\n"
 msgstr ""
 
-#: readelf.c:3974
+#: readelf.c:4039
 msgid ""
 "\n"
 "    Offset\tName\n"
 msgstr ""
 
-#: readelf.c:4056
+#: readelf.c:4121
 #, c-format
 msgid "Unknown TAG value: %lx"
 msgstr ""
 
-#: readelf.c:4151
+#: readelf.c:4216
 #, c-format
 msgid "Unknown AT value: %lx"
 msgstr ""
 
-#: readelf.c:4188
+#: readelf.c:4253
 #, c-format
 msgid "Unknown FORM value: %lx"
 msgstr ""
 
-#: readelf.c:4367
+#: readelf.c:4432
 msgid "  Number TAG\n"
 msgstr ""
 
-#: readelf.c:4373
+#: readelf.c:4438
 #, c-format
 msgid "   %ld      %s    [%s]\n"
 msgstr ""
 
-#: readelf.c:4376
+#: readelf.c:4441
 msgid "has children"
 msgstr ""
 
-#: readelf.c:4376
+#: readelf.c:4441
 msgid "no children"
 msgstr ""
 
-#: readelf.c:4380
+#: readelf.c:4445
 #, c-format
 msgid "    %-18s %s\n"
 msgstr ""
 
-#: readelf.c:4399
+#: readelf.c:4464
 #, c-format
 msgid " %lu byte block: "
 msgstr ""
 
-#: readelf.c:4568
+#: readelf.c:4633
 msgid "(User defined location op)"
 msgstr ""
 
-#: readelf.c:4570
+#: readelf.c:4635
 msgid "(Unknown location op)"
 msgstr ""
 
-#: readelf.c:4687
+#: readelf.c:4752
 #, c-format
 msgid "Unable to handle FORM: %d"
 msgstr ""
 
-#: readelf.c:4691
+#: readelf.c:4756
 #, c-format
 msgid "Unrecognised form: %d"
 msgstr ""
 
-#: readelf.c:4704
+#: readelf.c:4769
 msgid "(not inlined)"
 msgstr ""
 
-#: readelf.c:4705
+#: readelf.c:4770
 msgid "(inlined)"
 msgstr ""
 
-#: readelf.c:4706
+#: readelf.c:4771
 msgid "(declared as inline but ignored)"
 msgstr ""
 
-#: readelf.c:4707
+#: readelf.c:4772
 msgid "(declared as inline and inlined)"
 msgstr ""
 
-#: readelf.c:4708
+#: readelf.c:4773
 #, c-format
 msgid "  (Unknown inline attribute value: %lx)"
 msgstr ""
 
-#: readelf.c:4838 readelf.c:4962
+#: readelf.c:4903 readelf.c:5027
 #, c-format
 msgid ""
 "The section %s contains:\n"
 "\n"
 msgstr ""
 
-#: readelf.c:4860
+#: readelf.c:4925
 msgid "Only version 2 DWARF debug information is currently supported.\n"
 msgstr ""
 
-#: readelf.c:4864
+#: readelf.c:4929
 msgid "  Compilation Unit:\n"
 msgstr ""
 
-#: readelf.c:4865
+#: readelf.c:4930
 #, c-format
 msgid "   Length:        %ld\n"
 msgstr ""
 
-#: readelf.c:4866
+#: readelf.c:4931
 #, c-format
 msgid "   Version:       %d\n"
 msgstr ""
 
-#: readelf.c:4867
+#: readelf.c:4932
 #, c-format
 msgid "   Abbrev Offset: %ld\n"
 msgstr ""
 
-#: readelf.c:4868
+#: readelf.c:4933
 #, c-format
 msgid "   Pointer Size:  %d\n"
 msgstr ""
 
-#: readelf.c:4888
+#: readelf.c:4953
 msgid "Unable to locate .debug_abbrev section!\n"
 msgstr ""
 
-#: readelf.c:4928
+#: readelf.c:4993
 #, c-format
 msgid "Unable to locate entry %d in the abbreviation table\n"
 msgstr ""
 
-#: readelf.c:4933
+#: readelf.c:4998
 #, c-format
 msgid " <%d><%x>: Abbrev Number: %d (%s)\n"
 msgstr ""
 
-#: readelf.c:4980
+#: readelf.c:5045
 #, c-format
 msgid "  Length:                   %ld\n"
 msgstr ""
 
-#: readelf.c:4981
+#: readelf.c:5046
 #, c-format
 msgid "  Version:                  %d\n"
 msgstr ""
 
-#: readelf.c:4982
+#: readelf.c:5047
 #, c-format
 msgid "  Offset into .debug_info:  %lx\n"
 msgstr ""
 
-#: readelf.c:4983
+#: readelf.c:5048
 #, c-format
 msgid "  Pointer Size:             %d\n"
 msgstr ""
 
-#: readelf.c:4984
+#: readelf.c:5049
 #, c-format
 msgid "  Segment Size:             %d\n"
 msgstr ""
 
-#: readelf.c:4986
+#: readelf.c:5051
 msgid ""
 "\n"
 "    Address  Length\n"
 msgstr ""
 
-#: readelf.c:5021
+#: readelf.c:5086
 #, c-format
 msgid "Displaying the debug contents of section %s is not yet supported.\n"
 msgstr ""
 
-#: readelf.c:5063
+#: readelf.c:5128
 #, c-format
 msgid ""
 "\n"
 "Section '%s' has no debugging data.\n"
 msgstr ""
 
-#: readelf.c:5079
+#: readelf.c:5144
 #, c-format
 msgid "Unrecognised debug section: %s\n"
 msgstr ""
 
-#: readelf.c:5118
+#: readelf.c:5183
 msgid "Some sections were not dumped because they do not exist!\n"
 msgstr ""
 
-#: readelf.c:5293
+#: readelf.c:5358
 #, c-format
 msgid ""
 "\n"
 "Section '%s' contains %d entries:\n"
 msgstr ""
 
-#: readelf.c:5454
+#: readelf.c:5519
 msgid "conflict list with without table"
 msgstr ""
 
-#: readelf.c:5482
+#: readelf.c:5547
 #, c-format
 msgid ""
 "\n"
 "Section '.conflict' contains %d entries:\n"
 msgstr ""
 
-#: readelf.c:5483
+#: readelf.c:5548
 msgid "  Num:    Index       Value  Name"
 msgstr ""
 
-#: readelf.c:5560
+#: readelf.c:5625
 #, c-format
 msgid "Cannot stat input file %s.\n"
 msgstr ""
 
-#: readelf.c:5567
+#: readelf.c:5632
 #, c-format
 msgid "Input file %s not found.\n"
 msgstr ""
 
-#: readelf.c:5573
+#: readelf.c:5638
 #, c-format
 msgid "%s: Failed to read file header\n"
 msgstr ""
 
-#: readelf.c:5587
+#: readelf.c:5652
 #, c-format
 msgid ""
 "\n"
@@ -3125,51 +3163,51 @@
 msgid "filename required for COFF output"
 msgstr ""
 
-#: rescoff.c:729
+#: rescoff.c:734
 msgid "can't get BFD_RELOC_RVA relocation type"
 msgstr ""
 
-#: resrc.c:150
+#: resrc.c:253
 #, c-format
 msgid "can't popen `%s': %s"
 msgstr ""
 
-#: resrc.c:163
+#: resrc.c:266
 #, c-format
 msgid "%s: warning: preprocessor failed\n"
 msgstr ""
 
-#: resrc.c:208
+#: resrc.c:311
 #, c-format
 msgid "%s: unexpected EOF"
 msgstr ""
 
-#: resrc.c:265
+#: resrc.c:368
 #, c-format
 msgid "%s: read of %lu returned %lu"
 msgstr ""
 
-#: resrc.c:307 resrc.c:538 resrc.c:811 resrc.c:965
+#: resrc.c:410 resrc.c:641 resrc.c:914 resrc.c:1068
 #, c-format
 msgid "stat failed on bitmap file `%s': %s"
 msgstr ""
 
-#: resrc.c:360
+#: resrc.c:463
 #, c-format
 msgid "cursor file `%s' does not contain cursor data"
 msgstr ""
 
-#: resrc.c:392 resrc.c:682
+#: resrc.c:495 resrc.c:785
 #, c-format
 msgid "%s: fseek to %lu failed: %s"
 msgstr ""
 
-#: resrc.c:651
+#: resrc.c:754
 #, c-format
 msgid "icon file `%s' does not contain icon data"
 msgstr ""
 
-#: resrc.c:1170
+#: resrc.c:1273
 #, c-format
 msgid "can't open `%s' for output: %s"
 msgstr ""
@@ -3347,50 +3385,50 @@
 "the GNU General Public License.  This program has absolutely no warranty.\n"
 msgstr ""
 
-#: windres.c:228
+#: windres.c:233
 #, c-format
 msgid "can't open %s `%s': %s"
 msgstr ""
 
-#: windres.c:407
+#: windres.c:412
 msgid ": expected to be a directory\n"
 msgstr ""
 
-#: windres.c:419
+#: windres.c:424
 msgid ": expected to be a leaf\n"
 msgstr ""
 
-#: windres.c:428
+#: windres.c:433
 #, c-format
 msgid "%s: warning: "
 msgstr ""
 
-#: windres.c:430
+#: windres.c:435
 msgid ": duplicate value\n"
 msgstr ""
 
-#: windres.c:593
+#: windres.c:598
 #, c-format
 msgid "%s: unknown format type `%s'\n"
 msgstr ""
 
-#: windres.c:594
+#: windres.c:599
 #, c-format
 msgid "%s: supported formats:"
 msgstr ""
 
 #. Otherwise, we give up.
-#: windres.c:681
+#: windres.c:686
 #, c-format
 msgid "can not determine type of file `%s'; use the -I option"
 msgstr ""
 
-#: windres.c:695
+#: windres.c:700
 #, c-format
 msgid "Usage: %s [options] [input-file] [output-file]\n"
 msgstr ""
 
-#: windres.c:697
+#: windres.c:702
 msgid ""
 "Options:\n"
 "  -i FILE, --input FILE       Name input file\n"
@@ -3402,28 +3440,30 @@
 "  -F TARGET, --target TARGET  Specify COFF target\n"
 "  --preprocessor PROGRAM      Program to use to preprocess rc file\n"
 "  --include-dir DIR           Include directory when preprocessing rc file\n"
-"  --define SYM[=VAL]          Define SYM when preprocessing rc file\n"
-"  --language VAL              Set language when reading rc file\n"
+"  -DSYM[=VAL], --define SYM[=VAL]\n"
+"                              Define SYM when preprocessing rc file\n"
+"  -v                          Verbose - tells you what it's doing\n"
+"\n"
 msgstr ""
 
-#: windres.c:711
+#: windres.c:718
 msgid "  --yydebug                   Turn on parser debugging\n"
 msgstr ""
 
-#: windres.c:714
+#: windres.c:721
 msgid ""
 "  --help                      Print this help message\n"
 "  --version                   Print version information\n"
 msgstr ""
 
-#: windres.c:717
+#: windres.c:724
 msgid ""
 "FORMAT is one of rc, res, or coff, and is deduced from the file name\n"
 "extension if not specified.  A single file name is an input file.\n"
 "No input-file is stdin, default rc.  No output-file is stdout, default rc.\n"
 msgstr ""
 
-#: windres.c:918
+#: windres.c:963
 msgid "no resources"
 msgstr ""
 
diff --git a/binutils/prdbg.c b/binutils/prdbg.c
index 958cbd2..abd684d 100644
--- a/binutils/prdbg.c
+++ b/binutils/prdbg.c
@@ -1,5 +1,5 @@
 /* prdbg.c -- Print out generic debugging information.
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -985,7 +985,7 @@
      struct pr_handle *info;
      enum debug_visibility visibility;
 {
-  const char *s;
+  const char *s = NULL;
   char *t;
   unsigned int len;
 
@@ -1602,7 +1602,7 @@
 static boolean
 pr_tag (p, name)
      PTR p;
-     const char *name;
+     const char *name ATTRIBUTE_UNUSED;
 {
   struct pr_handle *info = (struct pr_handle *) p;
   char *t;
@@ -1856,7 +1856,7 @@
 /*ARGSUSED*/
 static boolean
 pr_end_function (p)
-     PTR p;
+     PTR p ATTRIBUTE_UNUSED;
 {
   return true;
 }
diff --git a/binutils/rclex.l b/binutils/rclex.l
index 06a6607..47b479b 100644
--- a/binutils/rclex.l
+++ b/binutils/rclex.l
@@ -37,6 +37,23 @@
 
 static int rcdata_mode;
 
+/* Whether we are supressing lines from cpp (including windows.h or
+   headers from your C sources may bring in externs and typedefs).
+   When active, we return IGNORED_TOKEN, which lets us ignore these
+   outside of resource constructs.  Thus, it isn't required to protect
+   all the non-preprocessor lines in your header files with #ifdef
+   RC_INVOKED.  It also means your RC file can't include other RC
+   files if they're named "*.h".  Sorry.  Name them *.rch or whatever.  */
+
+static int suppress_cpp_data;
+
+#define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x)
+
+/* The first filename we detect in the cpp output.  We use this to
+   tell included files from the original file.  */
+
+static char *initial_fn;
+
 /* List of allocated strings.  */
 
 struct alloc_string
@@ -57,82 +74,82 @@
 
 %%
 
-"BEGIN"			{ return BEG; }
-"{"			{ return BEG; }
-"END"			{ return END; }
-"}"			{ return END; }
-"ACCELERATORS"		{ return ACCELERATORS; }
-"VIRTKEY"		{ return VIRTKEY; }
-"ASCII"			{ return ASCII; }
-"NOINVERT"		{ return NOINVERT; }
-"SHIFT"			{ return SHIFT; }
-"CONTROL"		{ return CONTROL; }
-"ALT"			{ return ALT; }
-"BITMAP"		{ return BITMAP; }
-"CURSOR"		{ return CURSOR; }
-"DIALOG"		{ return DIALOG; }
-"DIALOGEX"		{ return DIALOGEX; }
-"EXSTYLE"		{ return EXSTYLE; }
-"CAPTION"		{ return CAPTION; }
-"CLASS"			{ return CLASS; }
-"STYLE"			{ return STYLE; }
-"AUTO3STATE"		{ return AUTO3STATE; }
-"AUTOCHECKBOX"		{ return AUTOCHECKBOX; }
-"AUTORADIOBUTTON"	{ return AUTORADIOBUTTON; }
-"CHECKBOX"		{ return CHECKBOX; }
-"COMBOBOX"		{ return COMBOBOX; }
-"CTEXT"			{ return CTEXT; }
-"DEFPUSHBUTTON"		{ return DEFPUSHBUTTON; }
-"EDITTEXT"		{ return EDITTEXT; }
-"GROUPBOX"		{ return GROUPBOX; }
-"LISTBOX"		{ return LISTBOX; }
-"LTEXT"			{ return LTEXT; }
-"PUSHBOX"		{ return PUSHBOX; }
-"PUSHBUTTON"		{ return PUSHBUTTON; }
-"RADIOBUTTON"		{ return RADIOBUTTON; }
-"RTEXT"			{ return RTEXT; }
-"SCROLLBAR"		{ return SCROLLBAR; }
-"STATE3"		{ return STATE3; }
-"USERBUTTON"		{ return USERBUTTON; }
-"BEDIT"			{ return BEDIT; }
-"HEDIT"			{ return HEDIT; }
-"IEDIT"			{ return IEDIT; }
-"FONT"			{ return FONT; }
-"ICON"			{ return ICON; }
-"LANGUAGE"		{ return LANGUAGE; }
-"CHARACTERISTICS"	{ return CHARACTERISTICS; }
-"VERSION"		{ return VERSIONK; }
-"MENU"			{ return MENU; }
-"MENUEX"		{ return MENUEX; }
-"MENUITEM"		{ return MENUITEM; }
-"SEPARATOR"		{ return SEPARATOR; }
-"POPUP"			{ return POPUP; }
-"CHECKED"		{ return CHECKED; }
-"GRAYED"		{ return GRAYED; }
-"HELP"			{ return HELP; }
-"INACTIVE"		{ return INACTIVE; }
-"MENUBARBREAK"		{ return MENUBARBREAK; }
-"MENUBREAK"		{ return MENUBREAK; }
-"MESSAGETABLE"		{ return MESSAGETABLE; }
-"RCDATA"		{ return RCDATA; }
-"STRINGTABLE"		{ return STRINGTABLE; }
-"VERSIONINFO"		{ return VERSIONINFO; }
-"FILEVERSION"		{ return FILEVERSION; }
-"PRODUCTVERSION"	{ return PRODUCTVERSION; }
-"FILEFLAGSMASK"		{ return FILEFLAGSMASK; }
-"FILEFLAGS"		{ return FILEFLAGS; }
-"FILEOS"		{ return FILEOS; }
-"FILETYPE"		{ return FILETYPE; }
-"FILESUBTYPE"		{ return FILESUBTYPE; }
-"VALUE"			{ return VALUE; }
-"MOVEABLE"		{ return MOVEABLE; }
-"FIXED"			{ return FIXED; }
-"PURE"			{ return PURE; }
-"IMPURE"		{ return IMPURE; }
-"PRELOAD"		{ return PRELOAD; }
-"LOADONCALL"		{ return LOADONCALL; }
-"DISCARDABLE"		{ return DISCARDABLE; }
-"NOT"			{ return NOT; }
+"BEGIN"			{ MAYBE_RETURN (BEG); }
+"{"			{ MAYBE_RETURN (BEG); }
+"END"			{ MAYBE_RETURN (END); }
+"}"			{ MAYBE_RETURN (END); }
+"ACCELERATORS"		{ MAYBE_RETURN (ACCELERATORS); }
+"VIRTKEY"		{ MAYBE_RETURN (VIRTKEY); }
+"ASCII"			{ MAYBE_RETURN (ASCII); }
+"NOINVERT"		{ MAYBE_RETURN (NOINVERT); }
+"SHIFT"			{ MAYBE_RETURN (SHIFT); }
+"CONTROL"		{ MAYBE_RETURN (CONTROL); }
+"ALT"			{ MAYBE_RETURN (ALT); }
+"BITMAP"		{ MAYBE_RETURN (BITMAP); }
+"CURSOR"		{ MAYBE_RETURN (CURSOR); }
+"DIALOG"		{ MAYBE_RETURN (DIALOG); }
+"DIALOGEX"		{ MAYBE_RETURN (DIALOGEX); }
+"EXSTYLE"		{ MAYBE_RETURN (EXSTYLE); }
+"CAPTION"		{ MAYBE_RETURN (CAPTION); }
+"CLASS"			{ MAYBE_RETURN (CLASS); }
+"STYLE"			{ MAYBE_RETURN (STYLE); }
+"AUTO3STATE"		{ MAYBE_RETURN (AUTO3STATE); }
+"AUTOCHECKBOX"		{ MAYBE_RETURN (AUTOCHECKBOX); }
+"AUTORADIOBUTTON"	{ MAYBE_RETURN (AUTORADIOBUTTON); }
+"CHECKBOX"		{ MAYBE_RETURN (CHECKBOX); }
+"COMBOBOX"		{ MAYBE_RETURN (COMBOBOX); }
+"CTEXT"			{ MAYBE_RETURN (CTEXT); }
+"DEFPUSHBUTTON"		{ MAYBE_RETURN (DEFPUSHBUTTON); }
+"EDITTEXT"		{ MAYBE_RETURN (EDITTEXT); }
+"GROUPBOX"		{ MAYBE_RETURN (GROUPBOX); }
+"LISTBOX"		{ MAYBE_RETURN (LISTBOX); }
+"LTEXT"			{ MAYBE_RETURN (LTEXT); }
+"PUSHBOX"		{ MAYBE_RETURN (PUSHBOX); }
+"PUSHBUTTON"		{ MAYBE_RETURN (PUSHBUTTON); }
+"RADIOBUTTON"		{ MAYBE_RETURN (RADIOBUTTON); }
+"RTEXT"			{ MAYBE_RETURN (RTEXT); }
+"SCROLLBAR"		{ MAYBE_RETURN (SCROLLBAR); }
+"STATE3"		{ MAYBE_RETURN (STATE3); }
+"USERBUTTON"		{ MAYBE_RETURN (USERBUTTON); }
+"BEDIT"			{ MAYBE_RETURN (BEDIT); }
+"HEDIT"			{ MAYBE_RETURN (HEDIT); }
+"IEDIT"			{ MAYBE_RETURN (IEDIT); }
+"FONT"			{ MAYBE_RETURN (FONT); }
+"ICON"			{ MAYBE_RETURN (ICON); }
+"LANGUAGE"		{ MAYBE_RETURN (LANGUAGE); }
+"CHARACTERISTICS"	{ MAYBE_RETURN (CHARACTERISTICS); }
+"VERSION"		{ MAYBE_RETURN (VERSIONK); }
+"MENU"			{ MAYBE_RETURN (MENU); }
+"MENUEX"		{ MAYBE_RETURN (MENUEX); }
+"MENUITEM"		{ MAYBE_RETURN (MENUITEM); }
+"SEPARATOR"		{ MAYBE_RETURN (SEPARATOR); }
+"POPUP"			{ MAYBE_RETURN (POPUP); }
+"CHECKED"		{ MAYBE_RETURN (CHECKED); }
+"GRAYED"		{ MAYBE_RETURN (GRAYED); }
+"HELP"			{ MAYBE_RETURN (HELP); }
+"INACTIVE"		{ MAYBE_RETURN (INACTIVE); }
+"MENUBARBREAK"		{ MAYBE_RETURN (MENUBARBREAK); }
+"MENUBREAK"		{ MAYBE_RETURN (MENUBREAK); }
+"MESSAGETABLE"		{ MAYBE_RETURN (MESSAGETABLE); }
+"RCDATA"		{ MAYBE_RETURN (RCDATA); }
+"STRINGTABLE"		{ MAYBE_RETURN (STRINGTABLE); }
+"VERSIONINFO"		{ MAYBE_RETURN (VERSIONINFO); }
+"FILEVERSION"		{ MAYBE_RETURN (FILEVERSION); }
+"PRODUCTVERSION"	{ MAYBE_RETURN (PRODUCTVERSION); }
+"FILEFLAGSMASK"		{ MAYBE_RETURN (FILEFLAGSMASK); }
+"FILEFLAGS"		{ MAYBE_RETURN (FILEFLAGS); }
+"FILEOS"		{ MAYBE_RETURN (FILEOS); }
+"FILETYPE"		{ MAYBE_RETURN (FILETYPE); }
+"FILESUBTYPE"		{ MAYBE_RETURN (FILESUBTYPE); }
+"VALUE"			{ MAYBE_RETURN (VALUE); }
+"MOVEABLE"		{ MAYBE_RETURN (MOVEABLE); }
+"FIXED"			{ MAYBE_RETURN (FIXED); }
+"PURE"			{ MAYBE_RETURN (PURE); }
+"IMPURE"		{ MAYBE_RETURN (IMPURE); }
+"PRELOAD"		{ MAYBE_RETURN (PRELOAD); }
+"LOADONCALL"		{ MAYBE_RETURN (LOADONCALL); }
+"DISCARDABLE"		{ MAYBE_RETURN (DISCARDABLE); }
+"NOT"			{ MAYBE_RETURN (NOT); }
 
 "BLOCK"[ \t\n]*"\""[^\#\n]*"\"" {
 			  char *s, *send;
@@ -146,11 +163,11 @@
 			  if (strncmp (s, "StringFileInfo",
 				       sizeof "StringFileInfo" - 1) == 0
 			      && s + sizeof "StringFileInfo" - 1 == send)
-			    return BLOCKSTRINGFILEINFO;
+			    MAYBE_RETURN (BLOCKSTRINGFILEINFO);
 			  else if (strncmp (s, "VarFileInfo",
 					    sizeof "VarFileInfo" - 1) == 0
 				   && s + sizeof "VarFileInfo" - 1 == send)
-			    return BLOCKVARFILEINFO;
+			    MAYBE_RETURN (BLOCKVARFILEINFO);
 			  else
 			    {
 			      char *r;
@@ -159,7 +176,7 @@
 			      strncpy (r, s, send - s);
 			      r[send - s] = '\0';
 			      yylval.s = r;
-			      return BLOCK;
+			      MAYBE_RETURN (BLOCK);
 			    }
 			}
 
@@ -170,13 +187,13 @@
 [0-9][x0-9A-Fa-f]*L	{
 			  yylval.i.val = strtoul (yytext, 0, 0);
 			  yylval.i.dword = 1;
-			  return NUMBER;
+			  MAYBE_RETURN (NUMBER);
 			}
 
 [0-9][x0-9A-Fa-f]*	{
 			  yylval.i.val = strtoul (yytext, 0, 0);
 			  yylval.i.dword = 0;
-			  return NUMBER;
+			  MAYBE_RETURN (NUMBER);
 			}
 
 ("\""[^\"\n]*"\""[ \t]*)+ {
@@ -187,13 +204,13 @@
 			  if (! rcdata_mode)
 			    {
 			      yylval.s = s;
-			      return QUOTEDSTRING;
+			      MAYBE_RETURN (QUOTEDSTRING);
 			    }
 			  else
 			    {
 			      yylval.ss.length = length;
 			      yylval.ss.s = s;
-			      return SIZEDSTRING;
+			      MAYBE_RETURN (SIZEDSTRING);
 			    }
 			}
 
@@ -209,12 +226,12 @@
 			  s = get_string (strlen (yytext) + 1);
 			  strcpy (s, yytext);
 			  yylval.s = s;
-			  return STRING;
+			  MAYBE_RETURN (STRING);
 			}
 
 [\n]			{ ++rc_lineno; }
 [ \t\r]+		{ /* ignore whitespace */ }
-.			{ return *yytext; }
+.			{ MAYBE_RETURN (*yytext); }
 
 %%
 #ifndef yywrap
@@ -263,6 +280,20 @@
 
   free (rc_filename);
   rc_filename = fn;
+
+  if (!initial_fn)
+    {
+      initial_fn = xmalloc (strlen (fn) + 1);
+      strcpy(initial_fn, fn);
+    }
+
+  /* Allow the initial file, regardless of name.  Suppress all other
+     files if they end in ".h" (this allows included "*.rc") */
+  if (strcmp (initial_fn, fn) == 0
+      || strcmp (fn + strlen (fn) - 2, ".h") != 0)
+    suppress_cpp_data = 0;
+  else
+    suppress_cpp_data = 1;
 }
 
 /* Handle a quoted string.  The quotes are stripped.  A pair of quotes
diff --git a/binutils/rcparse.y b/binutils/rcparse.y
index 67079a5..03cbbdc 100644
--- a/binutils/rcparse.y
+++ b/binutils/rcparse.y
@@ -122,6 +122,7 @@
 %token <s> QUOTEDSTRING STRING
 %token <i> NUMBER
 %token <ss> SIZEDSTRING
+%token IGNORED_TOKEN
 
 %type <pacc> acc_entries
 %type <acc> acc_entry acc_event
@@ -167,6 +168,7 @@
 	| input newcmd stringtable
 	| input newcmd user
 	| input newcmd versioninfo
+	| input newcmd IGNORED_TOKEN
 	;
 
 newcmd:
diff --git a/binutils/rdcoff.c b/binutils/rdcoff.c
index ee68bc6..d1ee6e6 100644
--- a/binutils/rdcoff.c
+++ b/binutils/rdcoff.c
@@ -1,5 +1,5 @@
 /* stabs.c -- Parse COFF debugging information
-   Copyright (C) 1996, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -498,7 +498,7 @@
 parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
      bfd *abfd;
      struct coff_symbols *symbols;
-     struct coff_types *types;
+     struct coff_types *types ATTRIBUTE_UNUSED;
      union internal_auxent *pauxent;
      PTR dhandle;
 {
@@ -569,7 +569,7 @@
 static boolean
 parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
 		   within_function)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      struct coff_types *types;
      asymbol *sym;
      long coff_symno;
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 549bf1a..266db75 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -27,6 +27,14 @@
 #include <stdio.h>
 #include <time.h>
 
+#if __GNUC__ >= 2
+/* Define BFD64 here, even if our default architecture is 32 bit ELF
+   as this will allow us to read in and parse 64bit and 32bit ELF files.
+   Only do this if we belive that the compiler can support a 64 bit
+   data type.  For now we only rely on GCC being able to do this.  */
+#define BFD64
+#endif
+
 #include "bfd.h"
 
 #include "elf/common.h"
@@ -58,6 +66,7 @@
 #include "elf/arc.h"
 #include "elf/fr30.h"
 #include "elf/mcore.h"
+#include "elf/i960.h"
 
 #include "bucomm.h"
 #include "getopt.h"
@@ -70,11 +79,12 @@
 
 char *          	program_name = "readelf";
 unsigned int    	dynamic_addr;
-unsigned int    	dynamic_size;
+bfd_size_type  		dynamic_size;
 unsigned int    	rela_addr;
 unsigned int    	rela_size;
 char *          	dynamic_strings;
 char *			string_table;
+unsigned long           num_dynamic_syms;
 Elf_Internal_Sym * 	dynamic_symbols;
 Elf_Internal_Syminfo *	dynamic_syminfo;
 unsigned long   	dynamic_syminfo_offset;
@@ -103,7 +113,8 @@
 int                     do_debug_lines;
 int                     do_debug_pubnames;
 int                     do_debug_aranges;
-int			binary_class;
+int                     do_arch;
+int			is_32bit_elf;
 
 /* A dynamic array of flags indicating which sections require dumping.  */
 char *			dump_sects = NULL;
@@ -114,38 +125,45 @@
 #define DEBUG_DUMP	(1 << 2)
 
 /* Forward declarations for dumb compilers.  */
-static unsigned long (*   byte_get)                   PARAMS ((unsigned char *, int));
-static const char *       get_mips_dynamic_type       PARAMS ((unsigned long type));
-static const char *       get_dynamic_type            PARAMS ((unsigned long type));
-static int                dump_relocations            PARAMS ((FILE *, unsigned long, unsigned long, Elf_Internal_Sym *, char *));
-static char *             get_file_type               PARAMS ((unsigned e_type));
-static char *             get_machine_name            PARAMS ((unsigned e_machine));
-static char *             get_machine_data            PARAMS ((unsigned e_data));
-static char *             get_machine_flags           PARAMS ((unsigned, unsigned e_machine));
-static const char *       get_mips_segment_type       PARAMS ((unsigned long type));
-static const char *       get_segment_type            PARAMS ((unsigned long p_type));
-static const char *       get_mips_section_type_name  PARAMS ((unsigned int sh_type));
-static const char *       get_section_type_name       PARAMS ((unsigned int sh_type));
-static char *             get_symbol_binding          PARAMS ((unsigned int binding));
-static char *             get_symbol_type             PARAMS ((unsigned int type));
+static bfd_vma (*         byte_get)                   PARAMS ((unsigned char *, int));
+static bfd_vma            byte_get_little_endian      PARAMS ((unsigned char *, int));
+static bfd_vma            byte_get_big_endian         PARAMS ((unsigned char *, int));
+static const char *       get_mips_dynamic_type       PARAMS ((unsigned long));
+static const char *       get_dynamic_type            PARAMS ((unsigned long));
+static int                dump_relocations            PARAMS ((FILE *, unsigned long, unsigned long, Elf_Internal_Sym *, unsigned long, char *, int));
+static char *             get_file_type               PARAMS ((unsigned));
+static char *             get_machine_name            PARAMS ((unsigned));
+static char *             get_machine_flags           PARAMS ((unsigned, unsigned));
+static const char *       get_mips_segment_type       PARAMS ((unsigned long));
+static const char *       get_segment_type            PARAMS ((unsigned long));
+static const char *       get_mips_section_type_name  PARAMS ((unsigned int));
+static const char *       get_section_type_name       PARAMS ((unsigned int));
+static char *             get_symbol_binding          PARAMS ((unsigned int));
+static char *             get_symbol_type             PARAMS ((unsigned int));
 static void               usage                       PARAMS ((void));
-static void               parse_args                  PARAMS ((int argc, char ** argv));
+static void               parse_args                  PARAMS ((int, char **));
 static int                process_file_header         PARAMS ((void));
 static int                process_program_headers     PARAMS ((FILE *));
 static int                process_section_headers     PARAMS ((FILE *));
-static void               dynamic_segment_mips_val    PARAMS ((Elf_Internal_Dyn *entry));
+static void               dynamic_segment_mips_val    PARAMS ((Elf_Internal_Dyn *));
 static int                process_dynamic_segment     PARAMS ((FILE *));
 static int                process_symbol_table        PARAMS ((FILE *));
 static int                process_section_contents    PARAMS ((FILE *));
-static void               process_file                PARAMS ((char * file_name));
+static void               process_file                PARAMS ((char *));
 static int                process_relocs              PARAMS ((FILE *));
 static int                process_version_sections    PARAMS ((FILE *));
-static char *             get_ver_flags               PARAMS ((unsigned int flags));
-static char *             get_symbol_index_type       PARAMS ((unsigned int type));
-static int                get_section_headers         PARAMS ((FILE * file));
-static int                get_file_header             PARAMS ((FILE * file));
-static Elf_Internal_Sym * get_elf_symbols             PARAMS ((FILE * file, unsigned long offset, unsigned long number));
-static int *              get_dynamic_data            PARAMS ((FILE * file, unsigned int number));
+static char *             get_ver_flags               PARAMS ((unsigned int));
+static char *             get_symbol_index_type       PARAMS ((unsigned int));
+static int                get_32bit_section_headers   PARAMS ((FILE *));
+static int                get_64bit_section_headers   PARAMS ((FILE *));
+static int		  get_32bit_program_headers   PARAMS ((FILE *, Elf_Internal_Phdr *));
+static int		  get_64bit_program_headers   PARAMS ((FILE *, Elf_Internal_Phdr *));
+static int                get_file_header             PARAMS ((FILE *));
+static Elf_Internal_Sym * get_32bit_elf_symbols       PARAMS ((FILE *, unsigned long, unsigned long));
+static Elf_Internal_Sym * get_64bit_elf_symbols       PARAMS ((FILE *, unsigned long, unsigned long));
+static int *              get_dynamic_data            PARAMS ((FILE *, unsigned int));
+static int                get_32bit_dynamic_segment   PARAMS ((FILE *));
+static int                get_64bit_dynamic_segment   PARAMS ((FILE *));
 #ifdef SUPPORT_DISASSEMBLY
 static int 	          disassemble_section         PARAMS ((Elf32_Internal_Shdr *, FILE *));
 #endif
@@ -173,15 +191,36 @@
 static const char *       get_elf_class               PARAMS ((unsigned char));
 static const char *       get_data_encoding           PARAMS ((unsigned char));
 static const char *       get_osabi_name              PARAMS ((unsigned char));
+static int		  guess_is_rela               PARAMS ((unsigned long));
 
 typedef int Elf32_Word;
 
+#ifndef TRUE
+#define TRUE     1
+#define FALSE    0
+#endif
+#define UNKNOWN -1
+
 #define SECTION_NAME(X) 	(string_table + (X)->sh_name)
 
 #define DT_VERSIONTAGIDX(tag)	(DT_VERNEEDNUM - (tag))	/* Reverse order! */
 
 #define BYTE_GET(field) 	byte_get (field, sizeof (field))
 
+/* If we can support a 64 bit data type then BFD64 should be defined
+   and sizeof (bfd_vma) == 8.  In this case when translating from an
+   external 8 byte field to an internal field, we can assume that the
+   internal field is also 8 bytes wide and so we can extact all the data.
+   If, however, BFD64 is not defined, then we must assume that the
+   internal data structure only has 4 byte wide fields that are the
+   equivalent of the 8 byte wide external counterparts, and so we must
+   truncate the data.  */
+#ifdef  BFD64
+#define BYTE_GET8(field) 	byte_get (field, -8)
+#else
+#define BYTE_GET8(field) 	byte_get (field, 8)
+#endif
+
 #define NUM_ELEM(array) 	(sizeof (array) / sizeof ((array)[0]))
 
 #define GET_DATA_ALLOC(offset, size, var, type, reason)			\
@@ -220,6 +259,11 @@
       return 0;								\
     }
 
+#define GET_ELF_SYMBOLS(file, offset, size)			\
+  (is_32bit_elf ? get_32bit_elf_symbols (file, offset, size)	\
+   : get_64bit_elf_symbols (file, offset, size))
+
+
 #ifdef ANSI_PROTOTYPES
 static void
 error (const char * message, ...)
@@ -276,7 +320,7 @@
 }
 #endif
 
-static unsigned long int
+static bfd_vma
 byte_get_little_endian (field, size)
      unsigned char * field;
      int             size;
@@ -290,19 +334,39 @@
       return  ((unsigned int) (field [0]))
 	|    (((unsigned int) (field [1])) << 8);
 
+    case 8:
+      /* We want to extract data from an 8 byte wide field and
+	 place it into a 4 byte wide field.  Since this is a little
+	 endian source we can juts use the 4 byte extraction code.  */
+      /* Fall through.  */
     case 4:
       return  ((unsigned long) (field [0]))
 	|    (((unsigned long) (field [1])) << 8)
 	|    (((unsigned long) (field [2])) << 16)
 	|    (((unsigned long) (field [3])) << 24);
 
+#ifdef BFD64
+    case -8:
+      /* This is a special case, generated by the BYTE_GET8 macro.
+	 It means that we are loading an 8 byte value from a field
+	 in an external structure into an 8 byte value in a field
+	 in an internal strcuture.  */
+      return  ((bfd_vma) (field [0]))
+	|    (((bfd_vma) (field [1])) << 8)
+	|    (((bfd_vma) (field [2])) << 16)
+	|    (((bfd_vma) (field [3])) << 24)
+	|    (((bfd_vma) (field [4])) << 32)
+	|    (((bfd_vma) (field [5])) << 40)
+	|    (((bfd_vma) (field [6])) << 48)
+	|    (((bfd_vma) (field [7])) << 56);
+#endif
     default:
       error (_("Unhandled data length: %d\n"), size);
-      abort();
+      abort ();
     }
 }
 
-static unsigned long int
+static bfd_vma
 byte_get_big_endian (field, size)
      unsigned char * field;
      int             size;
@@ -321,66 +385,59 @@
 	|   (((unsigned long) (field [1])) << 16)
 	|   (((unsigned long) (field [0])) << 24);
 
+    case 8:
+      /* Although we are extracing data from an 8 byte wide field, we
+	 are returning only 4 bytes of data.  */
+      return ((unsigned long) (field [7]))
+	|   (((unsigned long) (field [6])) << 8)
+	|   (((unsigned long) (field [5])) << 16)
+	|   (((unsigned long) (field [4])) << 24);
+
+#ifdef BFD64
+    case -8:
+      /* This is a special case, generated by the BYTE_GET8 macro.
+	 It means that we are loading an 8 byte value from a field
+	 in an external structure into an 8 byte value in a field
+	 in an internal strcuture.  */
+      return ((bfd_vma) (field [7]))
+	|   (((bfd_vma) (field [6])) << 8)
+	|   (((bfd_vma) (field [5])) << 16)
+	|   (((bfd_vma) (field [4])) << 24)
+	|   (((bfd_vma) (field [3])) << 32)
+	|   (((bfd_vma) (field [2])) << 40)
+	|   (((bfd_vma) (field [1])) << 48)
+	|   (((bfd_vma) (field [0])) << 56);
+#endif
+      
     default:
       error (_("Unhandled data length: %d\n"), size);
-      abort();
+      abort ();
     }
 }
 
 
-/* Display the contents of the relocation data
-   found at the specified offset.  */
+/* Guess the relocation sized based on the sized commonly used by the specific machine.  */
 static int
-dump_relocations (file, rel_offset, rel_size, symtab, strtab)
-     FILE *                 file;
-     unsigned long          rel_offset;
-     unsigned long          rel_size;
-     Elf_Internal_Sym *     symtab;
-     char *                 strtab;
+guess_is_rela (e_machine)
+     unsigned long e_machine;
 {
-  unsigned int        i;
-  int                 is_rela;
-  Elf_Internal_Rel *  rels;
-  Elf_Internal_Rela * relas;
-
-
-  /* Compute number of relocations and read them in.  */
-  switch (elf_header.e_machine)
+  switch (e_machine)
     {
       /* Targets that use REL relocations.  */
     case EM_ARM:
     case EM_386:
     case EM_486:
+    case EM_960:
     case EM_CYGNUS_M32R:
     case EM_CYGNUS_D10V:
     case EM_MIPS:
     case EM_MIPS_RS4_BE:
-      {
-	Elf32_External_Rel * erels;
-
-	GET_DATA_ALLOC (rel_offset, rel_size, erels,
-			Elf32_External_Rel *, "relocs");
-
-	rel_size = rel_size / sizeof (Elf32_External_Rel);
-
-	rels = (Elf_Internal_Rel *) malloc (rel_size *
-					    sizeof (Elf_Internal_Rel));
-
-	for (i = 0; i < rel_size; i++)
-	  {
-	    rels[i].r_offset = BYTE_GET (erels[i].r_offset);
-	    rels[i].r_info   = BYTE_GET (erels[i].r_info);
-	  }
-
-	free (erels);
-
-	is_rela = 0;
-	relas   = (Elf_Internal_Rela *) rels;
-      }
-    break;
-
+      return FALSE;
+      
       /* Targets that use RELA relocations.  */
     case EM_68K:
+    case EM_SPARC32PLUS:
+    case EM_SPARCV9:
     case EM_SPARC:
     case EM_PPC:
     case EM_CYGNUS_V850:
@@ -391,34 +448,152 @@
     case EM_SH:
     case EM_ALPHA:
     case EM_MCORE:
-      {
-	Elf32_External_Rela * erelas;
-
-	GET_DATA_ALLOC (rel_offset, rel_size, erelas,
-			Elf32_External_Rela *, "relocs");
-
-	rel_size = rel_size / sizeof (Elf32_External_Rela);
-
-	relas = (Elf_Internal_Rela *) malloc (rel_size *
-					      sizeof (Elf_Internal_Rela));
-
-	for (i = 0; i < rel_size; i++)
-	  {
-	    relas[i].r_offset = BYTE_GET (erelas[i].r_offset);
-	    relas[i].r_info   = BYTE_GET (erelas[i].r_info);
-	    relas[i].r_addend = BYTE_GET (erelas[i].r_addend);
-	  }
-
-	free (erelas);
-
-	is_rela = 1;
-	rels    = (Elf_Internal_Rel *) relas;
-      }
-    break;
-
+      return TRUE;
+      
     default:
       warn (_("Don't know about relocations on this machine architecture\n"));
-      return 0;
+      return FALSE;
+    }
+}
+
+/* Display the contents of the relocation data found at the specified offset.  */
+static int
+dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela)
+     FILE *             file;
+     unsigned long      rel_offset;
+     unsigned long      rel_size;
+     Elf_Internal_Sym * symtab;
+     unsigned long      nsyms;
+     char *             strtab;
+     int                is_rela;
+{
+  unsigned int        i;
+  Elf_Internal_Rel *  rels;
+  Elf_Internal_Rela * relas;
+
+  
+  if (is_rela == UNKNOWN)
+    is_rela = guess_is_rela (elf_header.e_machine);
+
+  if (is_rela)
+    {
+      if (is_32bit_elf)
+	{
+	  Elf32_External_Rela * erelas;
+	  
+	  GET_DATA_ALLOC (rel_offset, rel_size, erelas,
+			  Elf32_External_Rela *, "relocs");
+	  
+	  rel_size = rel_size / sizeof (Elf32_External_Rela);
+	  
+	  relas = (Elf_Internal_Rela *)
+	    malloc (rel_size * sizeof (Elf_Internal_Rela));
+      
+	  if (relas == NULL)
+	    {
+	      error(_("out of memory parsing relocs"));
+	      return 0;
+	    }
+	  
+	  for (i = 0; i < rel_size; i++)
+	    {
+	      relas[i].r_offset = BYTE_GET (erelas[i].r_offset);
+	      relas[i].r_info   = BYTE_GET (erelas[i].r_info);
+	      relas[i].r_addend = BYTE_GET (erelas[i].r_addend);
+	    }
+      
+	  free (erelas);
+      
+	  rels = (Elf_Internal_Rel *) relas;
+	}
+      else
+	{
+	  Elf64_External_Rela * erelas;
+	  
+	  GET_DATA_ALLOC (rel_offset, rel_size, erelas,
+			  Elf64_External_Rela *, "relocs");
+	  
+	  rel_size = rel_size / sizeof (Elf64_External_Rela);
+	  
+	  relas = (Elf_Internal_Rela *)
+	    malloc (rel_size * sizeof (Elf_Internal_Rela));
+      
+	  if (relas == NULL)
+	    {
+	      error(_("out of memory parsing relocs"));
+	      return 0;
+	    }
+	  
+	  for (i = 0; i < rel_size; i++)
+	    {
+	      relas[i].r_offset = BYTE_GET8 (erelas[i].r_offset);
+	      relas[i].r_info   = BYTE_GET8 (erelas[i].r_info);
+	      relas[i].r_addend = BYTE_GET8 (erelas[i].r_addend);
+	    }
+      
+	  free (erelas);
+      
+	  rels = (Elf_Internal_Rel *) relas;
+	}
+    }
+  else
+    {
+      if (is_32bit_elf)
+	{
+	  Elf32_External_Rel * erels;
+
+	  GET_DATA_ALLOC (rel_offset, rel_size, erels,
+			  Elf32_External_Rel *, "relocs");
+	  
+	  rel_size = rel_size / sizeof (Elf32_External_Rel);
+	  
+	  rels = (Elf_Internal_Rel *)
+	    malloc (rel_size * sizeof (Elf_Internal_Rel));
+	  
+	  if (rels == NULL)
+	    {
+	      error(_("out of memory parsing relocs"));
+	      return 0;
+	    }
+	  
+	  for (i = 0; i < rel_size; i++)
+	    {
+	      rels[i].r_offset = BYTE_GET (erels[i].r_offset);
+	      rels[i].r_info   = BYTE_GET (erels[i].r_info);
+	    }
+	  
+	  free (erels);
+	  
+	  relas = (Elf_Internal_Rela *) rels;
+	}
+      else
+	{
+	  Elf64_External_Rel * erels;
+
+	  GET_DATA_ALLOC (rel_offset, rel_size, erels,
+			  Elf64_External_Rel *, "relocs");
+	  
+	  rel_size = rel_size / sizeof (Elf64_External_Rel);
+	  
+	  rels = (Elf_Internal_Rel *)
+	    malloc (rel_size * sizeof (Elf_Internal_Rel));
+	  
+	  if (rels == NULL)
+	    {
+	      error(_("out of memory parsing relocs"));
+	      return 0;
+	    }
+	  
+	  for (i = 0; i < rel_size; i++)
+	    {
+	      rels[i].r_offset = BYTE_GET8 (erels[i].r_offset);
+	      rels[i].r_info   = BYTE_GET8 (erels[i].r_info);
+	    }
+	  
+	  free (erels);
+	  
+	  relas = (Elf_Internal_Rela *) rels;
+	}
     }
 
   if (is_rela)
@@ -430,11 +605,12 @@
 
   for (i = 0; i < rel_size; i++)
     {
-      const char *  rtype;
-      unsigned long offset;
-      unsigned long info;
-      int           symtab_index;
-
+      const char * rtype;
+      bfd_vma      offset;
+      bfd_vma      info;
+      bfd_vma      symtab_index;
+      bfd_vma      type;
+      
       if (is_rela)
 	{
 	  offset = relas [i].r_offset;
@@ -445,9 +621,32 @@
 	  offset = rels [i].r_offset;
 	  info   = rels [i].r_info;
 	}
+      
+      if (is_32bit_elf)
+	{
+	  type         = ELF32_R_TYPE (info);
+	  symtab_index = ELF32_R_SYM  (info);
+	}
+      else
+	{
+	  if (elf_header.e_machine == EM_SPARCV9)
+	    type       = ELF64_R_TYPE_ID (info);
+	  else
+	    type       = ELF64_R_TYPE (info);
+	  /* The #ifdef BFD64 below is to prevent a compile time warning.
+	     We know that if we do not have a 64 bit data type that we
+	     will never execute this code anyway.  */
+#ifdef BFD64 
+	  symtab_index = ELF64_R_SYM  (info);
+#endif
+	}
 
+#ifdef _bfd_int64_low
+      printf ("  %8.8lx  %5.5lx ", _bfd_int64_low (offset), _bfd_int64_low (info));
+#else
       printf ("  %8.8lx  %5.5lx ", offset, info);
-
+#endif
+      
       switch (elf_header.e_machine)
 	{
 	default:
@@ -455,106 +654,129 @@
 	  break;
 
 	case EM_CYGNUS_M32R:
-	  rtype = elf_m32r_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_m32r_reloc_type (type);
 	  break;
 
 	case EM_386:
 	case EM_486:
-	  rtype = elf_i386_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_i386_reloc_type (type);
 	  break;
 
 	case EM_68K:
-	  rtype = elf_m68k_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_m68k_reloc_type (type);
 	  break;
 
+	case EM_960:
+	  rtype = elf_i960_reloc_type (type);
+	  break;
+
+	case EM_OLD_SPARCV9:
+	case EM_SPARC32PLUS:
+	case EM_SPARCV9:
 	case EM_SPARC:
-	  rtype = elf_sparc_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_sparc_reloc_type (type);
 	  break;
 
 	case EM_CYGNUS_V850:
-	  rtype = v850_reloc_type (ELF32_R_TYPE (info));
+	  rtype = v850_reloc_type (type);
 	  break;
 
 	case EM_CYGNUS_D10V:
-	  rtype = elf_d10v_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_d10v_reloc_type (type);
 	  break;
 
 	case EM_CYGNUS_D30V:
-	  rtype = elf_d30v_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_d30v_reloc_type (type);
 	  break;
 
 	case EM_SH:
-	  rtype = elf_sh_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_sh_reloc_type (type);
 	  break;
 
 	case EM_CYGNUS_MN10300:
-	  rtype = elf_mn10300_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_mn10300_reloc_type (type);
 	  break;
 
 	case EM_CYGNUS_MN10200:
-	  rtype = elf_mn10200_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_mn10200_reloc_type (type);
 	  break;
 
 	case EM_CYGNUS_FR30:
-	  rtype = elf_fr30_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_fr30_reloc_type (type);
 	  break;
 
 	case EM_MCORE:
-	  rtype = elf_mcore_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_mcore_reloc_type (type);
 	  break;
 
 	case EM_PPC:
-	  rtype = elf_ppc_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_ppc_reloc_type (type);
 	  break;
 
 	case EM_MIPS:
 	case EM_MIPS_RS4_BE:
-	  rtype = elf_mips_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_mips_reloc_type (type);
 	  break;
 
 	case EM_ALPHA:
-	  rtype = elf_alpha_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_alpha_reloc_type (type);
 	  break;
 
 	case EM_ARM:
-	  rtype = elf_arm_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_arm_reloc_type (type);
 	  break;
 
 	case EM_CYGNUS_ARC:
-	  rtype = elf_arc_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_arc_reloc_type (type);
 	  break;
 
 	case EM_PARISC:
-	  rtype = elf32_hppa_reloc_type (ELF32_R_TYPE (info));
+	  rtype = elf_hppa_reloc_type (type);
 	  break;
 	}
 
       if (rtype == NULL)
-	printf (_("unrecognised: %-7lx"), ELF32_R_TYPE (info));
+#ifdef _bfd_int64_low	
+	printf (_("unrecognised: %-7lx"), _bfd_int64_low (type));
+#else
+	printf (_("unrecognised: %-7lx"), type);
+#endif
       else
 	printf ("%-21.21s", rtype);
 
-      symtab_index = ELF32_R_SYM (info);
-
-      if (symtab_index && symtab != NULL)
+      if (symtab_index)
 	{
-	  Elf_Internal_Sym * psym;
+	  if (symtab != NULL)
+	    {
+	      if (symtab_index >= nsyms)
+		printf (" bad symbol index: %08lx", (unsigned long) symtab_index);
+	      else
+		{
+		  Elf_Internal_Sym * psym;
 
-	  psym = symtab + symtab_index;
-
-	  printf (" %08lx  ", (unsigned long) psym->st_value);
-
-	  if (psym->st_name == 0)
-	    printf ("%-25.25s",
-		    SECTION_NAME (section_headers + psym->st_shndx));
-	  else if (strtab == NULL)
-	    printf (_("<string table index %3ld>"), psym->st_name);
-	  else
-	    printf ("%-25.25s", strtab + psym->st_name);
-
-	  if (is_rela)
-	    printf (" + %lx", (unsigned long) relas [i].r_addend);
+		  psym = symtab + symtab_index;
+		  
+		  printf (" %08lx  ", (unsigned long) psym->st_value);
+		  
+		  if (psym->st_name == 0)
+		    printf ("%-25.25s",
+			    SECTION_NAME (section_headers + psym->st_shndx));
+		  else if (strtab == NULL)
+		    printf (_("<string table index %3ld>"), psym->st_name);
+		  else
+		    printf ("%-25.25s", strtab + psym->st_name);
+		  
+		  if (is_rela)
+		    printf (" + %lx", (unsigned long) relas [i].r_addend);
+		}
+	    }
 	}
+      else if (is_rela)
+	printf ("%34c%lx", ' ', (unsigned long) relas[i].r_addend);
+
+      if (elf_header.e_machine == EM_SPARCV9
+	  && !strcmp (rtype, "R_SPARC_OLO10"))
+	printf (" + %lx", (unsigned long) ELF64_R_TYPE_DATA (info));
 
       putchar ('\n');
     }
@@ -810,6 +1032,11 @@
 	default:
 	  break;
 
+        case EM_68K:
+          if (e_flags & EF_CPU32)
+            strcat (buf, ", cpu32");
+          break;
+
 	case EM_PPC:
 	  if (e_flags & EF_PPC_EMB)
 	    strcat (buf, ", emb");
@@ -871,28 +1098,38 @@
 	  if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4)
 	    strcat (buf, ", mips4");
 	  break;
+
+	case EM_SPARCV9:
+	  if (e_flags & EF_SPARC_32PLUS)
+	    strcat (buf, ", v8+");
+
+	  if (e_flags & EF_SPARC_SUN_US1)
+	    strcat (buf, ", ultrasparcI");
+
+	  if (e_flags & EF_SPARC_SUN_US3)
+	    strcat (buf, ", ultrasparcIII");
+
+	  if (e_flags & EF_SPARC_HAL_R1)
+	    strcat (buf, ", halr1");
+
+	  if (e_flags & EF_SPARC_LEDATA)
+	    strcat (buf, ", ledata");
+
+	  if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_TSO)
+	    strcat (buf, ", tso");
+
+	  if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_PSO)
+	    strcat (buf, ", pso");
+
+	  if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_RMO)
+	    strcat (buf, ", rmo");
+	  break;
 	}
     }
 
   return buf;
 }
 
-static char *
-get_machine_data (e_data)
-     unsigned e_data;
-{
-  static char buff [32];
-
-  switch (e_data)
-    {
-    case ELFDATA2LSB: return _("ELFDATA2LSB (little endian)");
-    case ELFDATA2MSB: return _("ELFDATA2MSB (big endian)");
-    default:
-      sprintf (buff, _("<unknown>: %x"), e_data);
-      return buff;
-    }
-}
-
 static const char *
 get_mips_segment_type (type)
      unsigned long type;
@@ -1075,7 +1312,7 @@
   {"file-header",      no_argument, 0, 'h'},
   {"program-headers",  no_argument, 0, 'l'},
   {"headers",          no_argument, 0, 'e'},
-  {"histogram",        no_argument, & do_histogram, 1},
+  {"histogram",        no_argument, 0, 'I'},
   {"segments",         no_argument, 0, 'l'},
   {"sections",         no_argument, 0, 'S'},
   {"section-headers",  no_argument, 0, 'S'},
@@ -1083,6 +1320,7 @@
   {"syms",             no_argument, 0, 's'},
   {"relocs",           no_argument, 0, 'r'},
   {"dynamic",          no_argument, 0, 'd'},
+  {"arch-specific",    no_argument, 0, 'A'},
   {"version-info",     no_argument, 0, 'V'},
   {"use-dynamic",      no_argument, 0, 'D'},
   {"hex-dump",         required_argument, 0, 'x'},
@@ -1101,7 +1339,7 @@
 {
   fprintf (stdout, _("Usage: readelf {options} elf-file(s)\n"));
   fprintf (stdout, _("  Options are:\n"));
-  fprintf (stdout, _("  -a or --all               Equivalent to: -h -l -S -s -r -d -V --histogram\n"));
+  fprintf (stdout, _("  -a or --all               Equivalent to: -h -l -S -s -r -d -V -A -I\n"));
   fprintf (stdout, _("  -h or --file-header       Display the ELF file header\n"));
   fprintf (stdout, _("  -l or --program-headers or --segments\n"));
   fprintf (stdout, _("                            Display the program headers\n"));
@@ -1112,6 +1350,7 @@
   fprintf (stdout, _("  -r or --relocs            Display the relocations (if present)\n"));
   fprintf (stdout, _("  -d or --dynamic           Display the dynamic segment (if present)\n"));
   fprintf (stdout, _("  -V or --version-info      Display the version sections (if present)\n"));
+  fprintf (stdout, _("  -A or --arch-specific     Display architecture specific information (if any).\n"));
   fprintf (stdout, _("  -D or --use-dynamic       Use the dynamic section info when displaying symbols\n"));
   fprintf (stdout, _("  -x <number> or --hex-dump=<number>\n"));
   fprintf (stdout, _("                            Dump the contents of section <number>\n"));
@@ -1121,7 +1360,7 @@
   fprintf (stdout, _("  -i <number> or --instruction-dump=<number>\n"));
   fprintf (stdout, _("                            Disassemble the contents of section <number>\n"));
 #endif
-  fprintf (stdout, _("        --histogram         Display histogram of bucket list lengths\n"));
+  fprintf (stdout, _("  -I or --histogram         Display histogram of bucket list lengths\n"));
   fprintf (stdout, _("  -v or --version           Display the version number of readelf\n"));
   fprintf (stdout, _("  -H or --help              Display this information\n"));
   fprintf (stdout, _("Report bugs to bug-gnu-utils@gnu.org\n"));
@@ -1171,7 +1410,7 @@
     usage ();
 
   while ((c = getopt_long
-	  (argc, argv, "ersahldSDw::x:i:vV", options, NULL)) != EOF)
+	  (argc, argv, "ersahldSDAIw::x:i:vV", options, NULL)) != EOF)
     {
       char *    cp;
       int	section;
@@ -1194,12 +1433,16 @@
 	  do_segments ++;
 	  do_version ++;
 	  do_histogram ++;
+	  do_arch ++;
 	  break;
 	case 'e':
 	  do_header ++;
 	  do_sections ++;
 	  do_segments ++;
 	  break;
+	case 'A':
+	  do_arch ++;
+	  break;
 	case 'D':
 	  do_using_dynamic ++;
 	  break;
@@ -1221,6 +1464,9 @@
 	case 'd':
 	  do_dynamic ++;
 	  break;
+	case 'I':
+	  do_histogram ++;
+	  break;
 	case 'x':
 	  do_dump ++;
 	  section = strtoul (optarg, & cp, 0);
@@ -1299,7 +1545,7 @@
 
   if (!do_dynamic && !do_syms && !do_reloc && !do_sections
       && !do_segments && !do_header && !do_dump && !do_version
-      && !do_histogram && !do_debugging)
+      && !do_histogram && !do_debugging && !do_arch)
     usage ();
   else if (argc < 3)
     {
@@ -1312,12 +1558,16 @@
 get_elf_class (elf_class)
      unsigned char elf_class;
 {
+  static char buff [32];
+  
   switch (elf_class)
     {
     case ELFCLASSNONE: return _("none");
     case ELFCLASS32:   return _("ELF32");
     case ELFCLASS64:   return _("ELF64");
-    default:           return _("<unknown>");
+    default:
+      sprintf (buff, _("<unknown: %x>"), elf_class);
+      return buff;
     }
 }
 
@@ -1325,12 +1575,16 @@
 get_data_encoding (encoding)
      unsigned char encoding;
 {
+  static char buff [32];
+  
   switch (encoding)
     {
     case ELFDATANONE: return _("none");
-    case ELFDATA2LSB: return _("2's compilment, little endian");
-    case ELFDATA2MSB: return _("2's compilment, big endian");
-    default:          return _("<unknown>");
+    case ELFDATA2LSB: return _("2's complement, little endian");
+    case ELFDATA2MSB: return _("2's complement, big endian");
+    default:          
+      sprintf (buff, _("<unknown: %x>"), encoding);
+      return buff;
     }
 }
 
@@ -1338,12 +1592,16 @@
 get_osabi_name (osabi)
      unsigned char osabi;
 {
+  static char buff [32];
+  
   switch (osabi)
     {
     case ELFOSABI_SYSV:       return _("UNIX - System V");
     case ELFOSABI_HPUX:       return _("UNIX - HP-UX");
     case ELFOSABI_STANDALONE: return _("Standalone App");
-    default:                  return _("<unknown>");
+    default:
+      sprintf (buff, _("<unknown: %x>"), osabi);
+      return buff;
     }
 }
 
@@ -1376,8 +1634,11 @@
 	      get_data_encoding (elf_header.e_ident [EI_DATA]));
       printf (_("  Version:                           %d %s\n"),
 	      elf_header.e_ident [EI_VERSION],
-	      elf_header.e_ident [EI_VERSION] == EV_CURRENT ? "(current)" :
-	      elf_header.e_ident [EI_VERSION] != EV_NONE ? "<unknown>" : "");
+	      (elf_header.e_ident [EI_VERSION] == EV_CURRENT
+	       ? "(current)"
+	       : (elf_header.e_ident [EI_VERSION] != EV_NONE
+		  ? "<unknown: %lx>"
+		  : "")));
       printf (_("  OS/ABI:                            %s\n"),
 	      get_osabi_name (elf_header.e_ident [EI_OSABI]));
       printf (_("  ABI Version:                       %d\n"),
@@ -1388,8 +1649,6 @@
 	      get_machine_name (elf_header.e_machine));
       printf (_("  Version:                           0x%lx\n"),
 	      (unsigned long) elf_header.e_version);
-      printf (_("  Data:                              %s\n"),
-	      get_machine_data (elf_header.e_ident [EI_DATA]));
       printf (_("  Entry point address:               0x%lx\n"),
 	      (unsigned long) elf_header.e_entry);
       printf (_("  Start of program headers:          %ld (bytes into file)\n"),
@@ -1412,29 +1671,84 @@
       printf (_("  Section header string table index: %ld\n"),
 	      (long) elf_header.e_shstrndx);
     }
-
-  /* Test class after dumping header so that at least the header can be
-     display on 64 bit binaries.  */
   
-  binary_class = elf_header.e_ident [EI_CLASS];
-  if (binary_class != ELFCLASS32)
-    {
-      error (_("Not a 32 bit ELF file\n"));
-      return 0;
-    }
-
   return 1;
 }
 
 
 static int
+get_32bit_program_headers (file, program_headers)
+     FILE * file;
+     Elf_Internal_Phdr * program_headers;
+{
+  Elf32_External_Phdr * phdrs;
+  Elf32_External_Phdr * external;
+  Elf32_Internal_Phdr * internal;
+  unsigned int          i;
+  
+  GET_DATA_ALLOC (elf_header.e_phoff,
+		  elf_header.e_phentsize * elf_header.e_phnum,
+		  phdrs, Elf32_External_Phdr *, "program headers");
+
+  for (i = 0, internal = program_headers, external = phdrs;
+       i < elf_header.e_phnum;
+       i ++, internal ++, external ++)
+    {
+      internal->p_type   = BYTE_GET (external->p_type);
+      internal->p_offset = BYTE_GET (external->p_offset);
+      internal->p_vaddr  = BYTE_GET (external->p_vaddr);
+      internal->p_paddr  = BYTE_GET (external->p_paddr);
+      internal->p_filesz = BYTE_GET (external->p_filesz);
+      internal->p_memsz  = BYTE_GET (external->p_memsz);
+      internal->p_flags  = BYTE_GET (external->p_flags);
+      internal->p_align  = BYTE_GET (external->p_align);
+    }
+
+  free (phdrs);
+
+  return 1;
+}
+
+static int
+get_64bit_program_headers (file, program_headers)
+     FILE * file;
+     Elf_Internal_Phdr * program_headers;
+{
+  Elf64_External_Phdr * phdrs;
+  Elf64_External_Phdr * external;
+  Elf64_Internal_Phdr * internal;
+  unsigned int          i;
+  
+  GET_DATA_ALLOC (elf_header.e_phoff,
+		  elf_header.e_phentsize * elf_header.e_phnum,
+		  phdrs, Elf64_External_Phdr *, "program headers");
+
+  for (i = 0, internal = program_headers, external = phdrs;
+       i < elf_header.e_phnum;
+       i ++, internal ++, external ++)
+    {
+      internal->p_type   = BYTE_GET (external->p_type);
+      internal->p_flags  = BYTE_GET (external->p_flags);
+      internal->p_offset = BYTE_GET8 (external->p_offset);
+      internal->p_vaddr  = BYTE_GET8 (external->p_vaddr);
+      internal->p_paddr  = BYTE_GET8 (external->p_paddr);
+      internal->p_filesz = BYTE_GET8 (external->p_filesz);
+      internal->p_memsz  = BYTE_GET8 (external->p_memsz);
+      internal->p_align  = BYTE_GET8 (external->p_align);
+    }
+
+  free (phdrs);
+
+  return 1;
+}
+
+static int
 process_program_headers (file)
      FILE * file;
 {
-  Elf32_External_Phdr * phdrs;
-  Elf32_Internal_Phdr * program_headers;
-  Elf32_Internal_Phdr * segment;
-  unsigned int	        i;
+  Elf_Internal_Phdr * program_headers;
+  Elf_Internal_Phdr * segment;
+  unsigned int	      i;
 
   if (elf_header.e_phnum == 0)
     {
@@ -1451,12 +1765,8 @@
 	      elf_header.e_phnum, (unsigned long) elf_header.e_phoff);
     }
 
-  GET_DATA_ALLOC (elf_header.e_phoff,
-		  elf_header.e_phentsize * elf_header.e_phnum,
-		  phdrs, Elf32_External_Phdr *, "program headers");
-
-  program_headers = (Elf32_Internal_Phdr *) malloc
-    (elf_header.e_phnum * sizeof (Elf32_Internal_Phdr));
+  program_headers = (Elf_Internal_Phdr *) malloc
+    (elf_header.e_phnum * sizeof (Elf_Internal_Phdr));
 
   if (program_headers == NULL)
     {
@@ -1464,22 +1774,17 @@
       return 0;
     }
 
-  for (i = 0, segment = program_headers;
-       i < elf_header.e_phnum;
-       i ++, segment ++)
+  if (is_32bit_elf)
+    i = get_32bit_program_headers (file, program_headers);
+  else
+    i = get_64bit_program_headers (file, program_headers);
+
+  if (i == 0)
     {
-      segment->p_type   = BYTE_GET (phdrs[i].p_type);
-      segment->p_offset = BYTE_GET (phdrs[i].p_offset);
-      segment->p_vaddr  = BYTE_GET (phdrs[i].p_vaddr);
-      segment->p_paddr  = BYTE_GET (phdrs[i].p_paddr);
-      segment->p_filesz = BYTE_GET (phdrs[i].p_filesz);
-      segment->p_memsz  = BYTE_GET (phdrs[i].p_memsz);
-      segment->p_flags  = BYTE_GET (phdrs[i].p_flags);
-      segment->p_align  = BYTE_GET (phdrs[i].p_align);
+      free (program_headers);
+      return 0;
     }
-
-  free (phdrs);
-
+  
   if (do_segments)
     {
       printf
@@ -1490,6 +1795,7 @@
 
   loadaddr = -1;
   dynamic_addr = 0;
+  dynamic_size = 0;
 
   for (i = 0, segment = program_headers;
        i < elf_header.e_phnum;
@@ -1560,8 +1866,8 @@
 
       for (i = 0; i < elf_header.e_phnum; i++)
 	{
-	  int        j;
-	  Elf32_Internal_Shdr * section;
+	  int                 j;
+	  Elf_Internal_Shdr * section;
 
 	  segment = program_headers + i;
 	  section = section_headers;
@@ -1577,7 +1883,7 @@
 		      ? (section->sh_addr >= segment->p_vaddr
 			 && section->sh_addr + section->sh_size
 			 <= segment->p_vaddr + segment->p_memsz)
-		      : (section->sh_offset >= segment->p_offset
+		      : ((bfd_vma) section->sh_offset >= segment->p_offset
 			 && (section->sh_offset + section->sh_size
 			     <= segment->p_offset + segment->p_filesz))))
 		printf ("%s ", SECTION_NAME (section));
@@ -1594,7 +1900,7 @@
 
 
 static int
-get_section_headers (file)
+get_32bit_section_headers (file)
      FILE * file;
 {
   Elf32_External_Shdr * shdrs;
@@ -1605,8 +1911,8 @@
 		  elf_header.e_shentsize * elf_header.e_shnum,
 		  shdrs, Elf32_External_Shdr *, "section headers");
 
-  section_headers = (Elf32_Internal_Shdr *) malloc
-    (elf_header.e_shnum * sizeof (Elf32_Internal_Shdr));
+  section_headers = (Elf_Internal_Shdr *) malloc
+    (elf_header.e_shnum * sizeof (Elf_Internal_Shdr));
 
   if (section_headers == NULL)
     {
@@ -1635,8 +1941,50 @@
   return 1;
 }
 
+static int
+get_64bit_section_headers (file)
+     FILE * file;
+{
+  Elf64_External_Shdr * shdrs;
+  Elf64_Internal_Shdr * internal;
+  unsigned int          i;
+
+  GET_DATA_ALLOC (elf_header.e_shoff,
+		  elf_header.e_shentsize * elf_header.e_shnum,
+		  shdrs, Elf64_External_Shdr *, "section headers");
+
+  section_headers = (Elf_Internal_Shdr *) malloc
+    (elf_header.e_shnum * sizeof (Elf_Internal_Shdr));
+
+  if (section_headers == NULL)
+    {
+      error (_("Out of memory\n"));
+      return 0;
+    }
+
+  for (i = 0, internal = section_headers;
+       i < elf_header.e_shnum;
+       i ++, internal ++)
+    {
+      internal->sh_name      = BYTE_GET (shdrs[i].sh_name);
+      internal->sh_type      = BYTE_GET (shdrs[i].sh_type);
+      internal->sh_flags     = BYTE_GET8 (shdrs[i].sh_flags);
+      internal->sh_addr      = BYTE_GET8 (shdrs[i].sh_addr);
+      internal->sh_size      = BYTE_GET8 (shdrs[i].sh_size);
+      internal->sh_entsize   = BYTE_GET8 (shdrs[i].sh_entsize);
+      internal->sh_link      = BYTE_GET (shdrs[i].sh_link);
+      internal->sh_info      = BYTE_GET (shdrs[i].sh_info);
+      internal->sh_offset    = BYTE_GET (shdrs[i].sh_offset);
+      internal->sh_addralign = BYTE_GET (shdrs[i].sh_addralign);
+    }
+
+  free (shdrs);
+
+  return 1;
+}
+
 static Elf_Internal_Sym *
-get_elf_symbols (file, offset, number)
+get_32bit_elf_symbols (file, offset, number)
      FILE * file;
      unsigned long offset;
      unsigned long number;
@@ -1676,12 +2024,53 @@
   return isyms;
 }
 
+static Elf_Internal_Sym *
+get_64bit_elf_symbols (file, offset, number)
+     FILE * file;
+     unsigned long offset;
+     unsigned long number;
+{
+  Elf64_External_Sym * esyms;
+  Elf_Internal_Sym *   isyms;
+  Elf_Internal_Sym *   psym;
+  unsigned int         j;
+
+  GET_DATA_ALLOC (offset, number * sizeof (Elf64_External_Sym),
+		  esyms, Elf64_External_Sym *, "symbols");
+
+  isyms = (Elf_Internal_Sym *) malloc (number * sizeof (Elf_Internal_Sym));
+
+  if (isyms == NULL)
+    {
+      error (_("Out of memory\n"));
+      free (esyms);
+
+      return NULL;
+    }
+
+  for (j = 0, psym = isyms;
+       j < number;
+       j ++, psym ++)
+    {
+      psym->st_name  = BYTE_GET (esyms[j].st_name);
+      psym->st_info  = BYTE_GET (esyms[j].st_info);
+      psym->st_other = BYTE_GET (esyms[j].st_other);
+      psym->st_shndx = BYTE_GET (esyms[j].st_shndx);
+      psym->st_value = BYTE_GET8 (esyms[j].st_value);
+      psym->st_size  = BYTE_GET8 (esyms[j].st_size);
+    }
+
+  free (esyms);
+
+  return isyms;
+}
+
 static int
 process_section_headers (file)
      FILE * file;
 {
-  Elf32_Internal_Shdr * section;
-  int        i;
+  Elf_Internal_Shdr * section;
+  int                 i;
 
   section_headers = NULL;
 
@@ -1694,10 +2083,15 @@
     }
 
   if (do_sections && !do_header)
-    printf (_("There are %d section headers, starting at offset %lx:\n"),
+    printf (_("There are %d section headers, starting at offset 0x%lx:\n"),
 	    elf_header.e_shnum, (unsigned long) elf_header.e_shoff);
 
-  if (! get_section_headers (file))
+  if (is_32bit_elf)
+    {
+      if (! get_32bit_section_headers (file))
+	return 0;
+    }
+  else if (! get_64bit_section_headers (file))
     return 0;
 
   /* Read in the string table, so that we have names to display.  */
@@ -1718,6 +2112,7 @@
   dynamic_symbols = NULL;
   dynamic_strings = NULL;
   dynamic_syminfo = NULL;
+  
   for (i = 0, section = section_headers;
        i < elf_header.e_shnum;
        i ++, section ++)
@@ -1732,9 +2127,9 @@
 	      continue;
 	    }
 
-	  dynamic_symbols = get_elf_symbols
-	    (file, section->sh_offset,
-	     section->sh_size / section->sh_entsize);
+	  num_dynamic_syms = section->sh_size / section->sh_entsize;
+	  dynamic_symbols =
+	    GET_ELF_SYMBOLS (file, section->sh_offset, num_dynamic_syms);
 	}
       else if (section->sh_type == SHT_STRTAB
 	       && strcmp (name, ".dynstr") == 0)
@@ -1813,6 +2208,8 @@
 
   if (do_using_dynamic)
     {
+      int is_rela = FALSE;
+
       rel_size   = 0;
       rel_offset = 0;
 
@@ -1820,16 +2217,31 @@
 	{
 	  rel_offset = dynamic_info[DT_REL];
 	  rel_size   = dynamic_info[DT_RELSZ];
+	  is_rela    = FALSE;
 	}
       else if (dynamic_info [DT_RELA])
 	{
 	  rel_offset = dynamic_info[DT_RELA];
 	  rel_size   = dynamic_info[DT_RELASZ];
+	  is_rela    = TRUE;
 	}
       else if (dynamic_info[DT_JMPREL])
 	{
 	  rel_offset = dynamic_info[DT_JMPREL];
 	  rel_size   = dynamic_info[DT_PLTRELSZ];
+	  
+	  switch (dynamic_info[DT_PLTREL])
+	    {
+	    case DT_REL:
+	      is_rela = FALSE;
+	      break;
+	    case DT_RELA:
+	      is_rela = TRUE;
+	      break;
+	    default:
+	      is_rela = UNKNOWN;
+	      break;
+	    }
 	}
 
       if (rel_size)
@@ -1839,7 +2251,7 @@
 	     rel_offset, rel_size);
 
 	  dump_relocations (file, rel_offset - loadaddr, rel_size,
-			    dynamic_symbols, dynamic_strings);
+			    dynamic_symbols, num_dynamic_syms, dynamic_strings, is_rela);
 	}
       else
 	printf (_("\nThere are no dynamic relocations in this file.\n"));
@@ -1867,7 +2279,9 @@
 	      Elf32_Internal_Shdr * symsec;
 	      Elf_Internal_Sym *    symtab;
 	      char *                strtab;
-
+	      int                   is_rela;
+	      unsigned long         nsyms;
+	      
 	      printf (_("\nRelocation section "));
 
 	      if (string_table == NULL)
@@ -1880,8 +2294,8 @@
 
 	      symsec = section_headers + section->sh_link;
 
-	      symtab = get_elf_symbols (file, symsec->sh_offset,
-					symsec->sh_size / symsec->sh_entsize);
+	      nsyms = symsec->sh_size / symsec->sh_entsize;
+	      symtab = GET_ELF_SYMBOLS (file, symsec->sh_offset, nsyms);
 
 	      if (symtab == NULL)
 		continue;
@@ -1890,8 +2304,10 @@
 
 	      GET_DATA_ALLOC (strsec->sh_offset, strsec->sh_size, strtab,
 			      char *, "string table");
+	      
+	      is_rela = section->sh_type == SHT_RELA;
 
-	      dump_relocations (file, rel_offset, rel_size, symtab, strtab);
+	      dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela);
 
 	      free (strtab);
 	      free (symtab);
@@ -1977,31 +2393,22 @@
     }
 }
 
-/* Parse the dynamic segment */
 static int
-process_dynamic_segment (file)
+get_32bit_dynamic_segment (file)
      FILE * file;
 {
-  Elf_Internal_Dyn *    entry;
-  Elf32_External_Dyn *  edyn;
-  unsigned int i;
-
-  if (dynamic_size == 0)
-    {
-      if (do_dynamic)
-	printf (_("\nThere is no dynamic segment in this file.\n"));
-
-      return 1;
-    }
-
+  Elf32_External_Dyn * edyn;
+  Elf_Internal_Dyn *   entry;
+  bfd_size_type        i;
+  
   GET_DATA_ALLOC (dynamic_addr, dynamic_size,
 		  edyn, Elf32_External_Dyn *, "dynamic segment");
   
   /* SGI's ELF has more than one section in the DYNAMIC segment.  Determine
-     how large .dynamic is now.  We can do this even before the byte
+     how large this .dynamic is now.  We can do this even before the byte
      swapping since the DT_NULL tag is recognizable.  */
   dynamic_size = 0;
-  while (*(Elf32_Word *) edyn[dynamic_size++].d_tag != DT_NULL)
+  while (*(Elf32_Word *) edyn [dynamic_size++].d_tag != DT_NULL)
     ;
 
   dynamic_segment = (Elf_Internal_Dyn *)
@@ -2024,6 +2431,74 @@
 
   free (edyn);
 
+  return 1;
+}
+
+static int
+get_64bit_dynamic_segment (file)
+     FILE * file;
+{
+  Elf64_External_Dyn * edyn;
+  Elf_Internal_Dyn *   entry;
+  bfd_size_type        i;
+  
+  GET_DATA_ALLOC (dynamic_addr, dynamic_size,
+		  edyn, Elf64_External_Dyn *, "dynamic segment");
+  
+  /* SGI's ELF has more than one section in the DYNAMIC segment.  Determine
+     how large this .dynamic is now.  We can do this even before the byte
+     swapping since the DT_NULL tag is recognizable.  */
+  dynamic_size = 0;
+  while (*(bfd_vma *) edyn [dynamic_size ++].d_tag != DT_NULL)
+    ;
+
+  dynamic_segment = (Elf_Internal_Dyn *)
+    malloc (dynamic_size * sizeof (Elf_Internal_Dyn));
+
+  if (dynamic_segment == NULL)
+    {
+      error (_("Out of memory\n"));
+      free (edyn);
+      return 0;
+    }
+
+  for (i = 0, entry = dynamic_segment;
+       i < dynamic_size;
+       i ++, entry ++)
+    {
+      entry->d_tag      = BYTE_GET8 (edyn [i].d_tag);
+      entry->d_un.d_val = BYTE_GET8 (edyn [i].d_un.d_val);
+    }
+
+  free (edyn);
+
+  return 1;
+}
+
+/* Parse and display the contents of the dynamic segment.  */
+static int
+process_dynamic_segment (file)
+     FILE * file;
+{
+  Elf_Internal_Dyn * entry;
+  bfd_size_type      i;
+
+  if (dynamic_size == 0)
+    {
+      if (do_dynamic)
+	printf (_("\nThere is no dynamic segment in this file.\n"));
+
+      return 1;
+    }
+
+  if (is_32bit_elf)
+    {
+      if (! get_32bit_dynamic_segment (file))
+	return 0;
+    }
+  else if (! get_64bit_dynamic_segment (file))
+    return 0;
+
   /* Find the appropriate symbol table.  */
   if (dynamic_symbols == NULL)
     {
@@ -2032,7 +2507,6 @@
 	   ++i, ++ entry)
 	{
 	  unsigned long        offset;
-	  long                 num_syms;
 
 	  if (entry->d_tag != DT_SYMTAB)
 	    continue;
@@ -2043,21 +2517,23 @@
 	     we default to reading in the entire file (!) and
 	     processing that.  This is overkill, I know, but it
 	     should work. */
-
 	  offset = entry->d_un.d_val - loadaddr;
 
 	  if (fseek (file, 0, SEEK_END))
 	    error (_("Unable to seek to end of file!"));
 
-	  num_syms = (ftell (file) - offset) / sizeof (Elf32_External_Sym);
+	  if (is_32bit_elf)
+	    num_dynamic_syms = (ftell (file) - offset) / sizeof (Elf32_External_Sym);
+	  else
+	    num_dynamic_syms = (ftell (file) - offset) / sizeof (Elf64_External_Sym);
 
-	  if (num_syms < 1)
+	  if (num_dynamic_syms < 1)
 	    {
 	      error (_("Unable to determine the number of symbols to load\n"));
 	      continue;
 	    }
 
-	  dynamic_symbols = get_elf_symbols (file, offset, num_syms);
+	  dynamic_symbols = GET_ELF_SYMBOLS (file, offset, num_dynamic_syms);
 	}
     }
 
@@ -2123,8 +2599,8 @@
 
       if (dynamic_syminfo_offset != 0 && syminsz != 0)
 	{
-	  Elf_External_Syminfo *extsyminfo;
-	  Elf_Internal_Syminfo *syminfo;
+	  Elf_External_Syminfo * extsyminfo;
+	  Elf_Internal_Syminfo * syminfo;
 
 	  /* There is a syminfo section.  Read the data.  */
 	  GET_DATA_ALLOC (dynamic_syminfo_offset, syminsz, extsyminfo,
@@ -2150,8 +2626,8 @@
     }
 
   if (do_dynamic && dynamic_addr)
-    printf (_("\nDynamic segment at offset 0x%x contains %d entries:\n"),
-	    dynamic_addr, dynamic_size);
+    printf (_("\nDynamic segment at offset 0x%x contains %ld entries:\n"),
+	    dynamic_addr, (long) dynamic_size);
   if (do_dynamic)
     printf (_("  Tag        Type                         Name/Value\n"));
 
@@ -2502,7 +2978,7 @@
 	    printf (_("  Addr: 0x"));
 	    printf_vma (section->sh_addr);
 	    printf (_("  Offset: %#08lx  Link: %lx (%s)\n"),
-		    section->sh_offset, section->sh_link,
+		    (unsigned long) section->sh_offset, section->sh_link,
 		    SECTION_NAME (section_headers + section->sh_link));
 
 	    GET_DATA_ALLOC (section->sh_offset, section->sh_size,
@@ -2590,7 +3066,7 @@
 	    printf (_(" Addr: 0x"));
 	    printf_vma (section->sh_addr);
 	    printf (_("  Offset: %#08lx  Link to section: %ld (%s)\n"),
-		    section->sh_offset, section->sh_link,
+		    (unsigned long) section->sh_offset, section->sh_link,
 		    SECTION_NAME (section_headers + section->sh_link));
 
 	    GET_DATA_ALLOC (section->sh_offset, section->sh_size,
@@ -2676,9 +3152,8 @@
 
 	    found = 1;
 
-	    symbols = get_elf_symbols
-	      (file, link_section->sh_offset,
-	       link_section->sh_size / link_section->sh_entsize);
+	    symbols = GET_ELF_SYMBOLS (file, link_section->sh_offset,
+				       link_section->sh_size / link_section->sh_entsize);
 
 	    string_sec = section_headers + link_section->sh_link;
 
@@ -2691,7 +3166,7 @@
 	    printf (_(" Addr: "));
 	    printf_vma (section->sh_addr);
 	    printf (_("  Offset: %#08lx  Link: %lx (%s)\n"),
-		    section->sh_offset, section->sh_link,
+		    (unsigned long) section->sh_offset, section->sh_link,
 		    SECTION_NAME (link_section));
 
 	    GET_DATA_ALLOC (version_info [DT_VERSIONTAGIDX (DT_VERSYM)]
@@ -2986,7 +3461,15 @@
     case STT_FILE:     return _("FILE");
     default:
       if (type >= STT_LOPROC && type <= STT_HIPROC)
-	sprintf (buff, _("<processor specific>: %d"), type);
+	{
+	  if (elf_header.e_machine == EM_ARM && type == STT_ARM_TFUNC)
+	    return _("THUMB_FUNC");
+	    
+	  if (elf_header.e_machine == EM_SPARCV9 && type == STT_REGISTER)
+	    return _("REGISTER");
+	  
+	  sprintf (buff, _("<processor specific>: %d"), type);
+	}
       else if (type >= STT_LOOS && type <= STT_HIOS)
 	sprintf (buff, _("<OS specific>: %d"), type);
       else
@@ -3069,7 +3552,7 @@
   Elf32_Internal_Shdr *   section;
   char   nb [4];
   char   nc [4];
-  int    nbuckets;
+  int    nbuckets = 0;
   int    nchains;
   int *  buckets = NULL;
   int *  chains = NULL;
@@ -3166,7 +3649,7 @@
 	  fputs (_("  Num:    Value  Size Type    Bind   Ot  Ndx Name\n"),
 		 stdout);
 
-	  symtab = get_elf_symbols (file, section->sh_offset,
+	  symtab = GET_ELF_SYMBOLS (file, section->sh_offset,
 				    section->sh_size / section->sh_entsize);
 	  if (symtab == NULL)
 	    continue;
@@ -3195,14 +3678,7 @@
 		      get_symbol_binding (ELF_ST_BIND (psym->st_info)),
 		      psym->st_other);
 
-	      if (psym->st_shndx == 0)
-		fputs (" UND", stdout);
-	      else if ((psym->st_shndx & 0xffff) == 0xfff1)
-		fputs (" ABS", stdout);
-	      else if ((psym->st_shndx & 0xffff) == 0xfff2)
-		fputs (" COM", stdout);
-	      else
-		printf ("%4x", psym->st_shndx);
+	      printf ("%4s", get_symbol_index_type (psym->st_shndx));
 
 	      printf (" %s", strtab + psym->st_name);
 
@@ -3411,9 +3887,9 @@
 
 static int
 process_syminfo (file)
-     FILE * file;
+     FILE * file ATTRIBUTE_UNUSED;
 {
-  int i;
+  unsigned int i;
 
   if (dynamic_syminfo == NULL
       || !do_dynamic)
@@ -3490,8 +3966,8 @@
      Elf32_Internal_Shdr * section;
      FILE * file;
 {
-  int             bytes;
-  int             addr;
+  bfd_size_type   bytes;
+  bfd_vma         addr;
   unsigned char * data;
   unsigned char * start;
 
@@ -3521,10 +3997,11 @@
 
       lbytes = (bytes > 16 ? 16 : bytes);
 
-      printf ("  0x%8.8x ", addr);
+      printf ("  0x%8.8lx ", (unsigned long) addr);
 
       switch (elf_header.e_ident [EI_DATA])
 	{
+	default:
 	case ELFDATA2LSB:
 	  for (j = 15; j >= 0; j --)
 	    {
@@ -3705,7 +4182,7 @@
 display_debug_lines (section, start, file)
      Elf32_Internal_Shdr * section;
      unsigned char *       start;
-     FILE *                file;
+     FILE *                file ATTRIBUTE_UNUSED;
 {
   DWARF2_External_LineInfo * external;
   DWARF2_Internal_LineInfo   info;
@@ -3925,7 +4402,7 @@
 display_debug_pubnames (section, start, file)
      Elf32_Internal_Shdr * section;
      unsigned char *       start;
-     FILE *                file;
+     FILE *                file ATTRIBUTE_UNUSED;
 {
   DWARF2_External_PubNames * external;
   DWARF2_Internal_PubNames   pubnames;
@@ -4347,7 +4824,7 @@
 display_debug_abbrev (section, start, file)
      Elf32_Internal_Shdr * section;
      unsigned char *       start;
-     FILE *                file;
+     FILE *                file ATTRIBUTE_UNUSED;
 {
   abbrev_entry * entry;
   unsigned char * end = start + section->sh_size;
@@ -4393,7 +4870,7 @@
   printf (_(" %lu byte block: "), length);
 
   while (length --)
-    printf ("%lx ", byte_get (data ++, 1));
+    printf ("%lx ", (unsigned long) byte_get (data ++, 1));
 
   return data;
 }
@@ -4405,156 +4882,451 @@
 {
   unsigned char op;
   int           bytes_read;
+  unsigned long uvalue;
 
   op = * data ++;
 
   switch (op)
     {
-    case DW_OP_addr:	printf ("DW_OP_addr: %lx", byte_get (data, pointer_size)); break;
-    case DW_OP_deref:	printf ("DW_OP_deref"); break;
-    case DW_OP_const1u:	printf ("DW_OP_const1u: %lu", byte_get (data, 1)); break;
-    case DW_OP_const1s:	printf ("DW_OP_const1s: %ld", (long) byte_get (data, 1)); break;
-    case DW_OP_const2u:	printf ("DW_OP_const2u: %lu", byte_get (data, 2)); break;
-    case DW_OP_const2s:	printf ("DW_OP_const2s: %ld", (long) byte_get (data, 2)); break;
-    case DW_OP_const4u:	printf ("DW_OP_const4u: %lu", byte_get (data, 4)); break;
-    case DW_OP_const4s:	printf ("DW_OP_const4s: %ld", (long) byte_get (data, 4)); break;
-    case DW_OP_const8u:	printf ("DW_OP_const8u: %lu %lu", byte_get (data, 4), byte_get (data + 4, 4)); break;
-    case DW_OP_const8s:	printf ("DW_OP_const8s: %ld %ld", byte_get (data, 4), byte_get (data + 4, 4)); break;
-    case DW_OP_constu:	printf ("DW_OP_constu: %lu", read_leb128 (data, NULL, 0)); break;
-    case DW_OP_consts:	printf ("DW_OP_consts: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_dup:	printf ("DW_OP_dup"); break;
-    case DW_OP_drop:	printf ("DW_OP_drop"); break;
-    case DW_OP_over:	printf ("DW_OP_over"); break;
-    case DW_OP_pick:	printf ("DW_OP_pick: %ld", byte_get (data, 1)); break;
-    case DW_OP_swap:	printf ("DW_OP_swap"); break;
-    case DW_OP_rot:	printf ("DW_OP_rot"); break;
-    case DW_OP_xderef:	printf ("DW_OP_xderef"); break;
-    case DW_OP_abs:	printf ("DW_OP_abs"); break;
-    case DW_OP_and:	printf ("DW_OP_and"); break;
-    case DW_OP_div:	printf ("DW_OP_div"); break;
-    case DW_OP_minus:	printf ("DW_OP_minus"); break;
-    case DW_OP_mod:	printf ("DW_OP_mod"); break;
-    case DW_OP_mul:	printf ("DW_OP_mul"); break;
-    case DW_OP_neg:	printf ("DW_OP_neg"); break;
-    case DW_OP_not:	printf ("DW_OP_not"); break;
-    case DW_OP_or:	printf ("DW_OP_or"); break;
-    case DW_OP_plus:	printf ("DW_OP_plus"); break;
-    case DW_OP_plus_uconst:	printf ("DW_OP_plus_uconst: %lu", read_leb128 (data, NULL, 0)); break;
-    case DW_OP_shl:	printf ("DW_OP_shl"); break;
-    case DW_OP_shr:	printf ("DW_OP_shr"); break;
-    case DW_OP_shra:	printf ("DW_OP_shra"); break;
-    case DW_OP_xor:	printf ("DW_OP_xor"); break;
-    case DW_OP_bra:	printf ("DW_OP_bra: %ld", byte_get (data, 2)); break;
-    case DW_OP_eq:	printf ("DW_OP_eq"); break;
-    case DW_OP_ge:	printf ("DW_OP_ge"); break;
-    case DW_OP_gt:	printf ("DW_OP_gt"); break;
-    case DW_OP_le:	printf ("DW_OP_le"); break;
-    case DW_OP_lt:	printf ("DW_OP_lt"); break;
-    case DW_OP_ne:	printf ("DW_OP_ne"); break;
-    case DW_OP_skip:	printf ("DW_OP_skip: %ld", byte_get (data, 2)); break;
-    case DW_OP_lit0:	printf ("DW_OP_lit0"); break;
-    case DW_OP_lit1:	printf ("DW_OP_lit1"); break;
-    case DW_OP_lit2:	printf ("DW_OP_lit2"); break;
-    case DW_OP_lit3:	printf ("DW_OP_lit3"); break;
-    case DW_OP_lit4:	printf ("DW_OP_lit4"); break;
-    case DW_OP_lit5:	printf ("DW_OP_lit5"); break;
-    case DW_OP_lit6:	printf ("DW_OP_lit6"); break;
-    case DW_OP_lit7:	printf ("DW_OP_lit7"); break;
-    case DW_OP_lit8:	printf ("DW_OP_lit8"); break;
-    case DW_OP_lit9:	printf ("DW_OP_lit9"); break;
-    case DW_OP_lit10:	printf ("DW_OP_lit10"); break;
-    case DW_OP_lit11:	printf ("DW_OP_lit11"); break;
-    case DW_OP_lit12:	printf ("DW_OP_lit12"); break;
-    case DW_OP_lit13:	printf ("DW_OP_lit13"); break;
-    case DW_OP_lit14:	printf ("DW_OP_lit14"); break;
-    case DW_OP_lit15:	printf ("DW_OP_lit15"); break;
-    case DW_OP_lit16:	printf ("DW_OP_lit16"); break;
-    case DW_OP_lit17:	printf ("DW_OP_lit17"); break;
-    case DW_OP_lit18:	printf ("DW_OP_lit18"); break;
-    case DW_OP_lit19:	printf ("DW_OP_lit19"); break;
-    case DW_OP_lit20:	printf ("DW_OP_lit20"); break;
-    case DW_OP_lit21:	printf ("DW_OP_lit21"); break;
-    case DW_OP_lit22:	printf ("DW_OP_lit22"); break;
-    case DW_OP_lit23:	printf ("DW_OP_lit23"); break;
-    case DW_OP_lit24:	printf ("DW_OP_lit24"); break;
-    case DW_OP_lit25:	printf ("DW_OP_lit25"); break;
-    case DW_OP_lit26:	printf ("DW_OP_lit26"); break;
-    case DW_OP_lit27:	printf ("DW_OP_lit27"); break;
-    case DW_OP_lit28:	printf ("DW_OP_lit28"); break;
-    case DW_OP_lit29:	printf ("DW_OP_lit29"); break;
-    case DW_OP_lit30:	printf ("DW_OP_lit30"); break;
-    case DW_OP_lit31:	printf ("DW_OP_lit31"); break;
-    case DW_OP_reg0:	printf ("DW_OP_reg0"); break;
-    case DW_OP_reg1:	printf ("DW_OP_reg1"); break;
-    case DW_OP_reg2:	printf ("DW_OP_reg2"); break;
-    case DW_OP_reg3:	printf ("DW_OP_reg3"); break;
-    case DW_OP_reg4:	printf ("DW_OP_reg4"); break;
-    case DW_OP_reg5:	printf ("DW_OP_reg5"); break;
-    case DW_OP_reg6:	printf ("DW_OP_reg6"); break;
-    case DW_OP_reg7:	printf ("DW_OP_reg7"); break;
-    case DW_OP_reg8:	printf ("DW_OP_reg8"); break;
-    case DW_OP_reg9:	printf ("DW_OP_reg9"); break;
-    case DW_OP_reg10:	printf ("DW_OP_reg10"); break;
-    case DW_OP_reg11:	printf ("DW_OP_reg11"); break;
-    case DW_OP_reg12:	printf ("DW_OP_reg12"); break;
-    case DW_OP_reg13:	printf ("DW_OP_reg13"); break;
-    case DW_OP_reg14:	printf ("DW_OP_reg14"); break;
-    case DW_OP_reg15:	printf ("DW_OP_reg15"); break;
-    case DW_OP_reg16:	printf ("DW_OP_reg16"); break;
-    case DW_OP_reg17:	printf ("DW_OP_reg17"); break;
-    case DW_OP_reg18:	printf ("DW_OP_reg18"); break;
-    case DW_OP_reg19:	printf ("DW_OP_reg19"); break;
-    case DW_OP_reg20:	printf ("DW_OP_reg20"); break;
-    case DW_OP_reg21:	printf ("DW_OP_reg21"); break;
-    case DW_OP_reg22:	printf ("DW_OP_reg22"); break;
-    case DW_OP_reg23:	printf ("DW_OP_reg23"); break;
-    case DW_OP_reg24:	printf ("DW_OP_reg24"); break;
-    case DW_OP_reg25:	printf ("DW_OP_reg25"); break;
-    case DW_OP_reg26:	printf ("DW_OP_reg26"); break;
-    case DW_OP_reg27:	printf ("DW_OP_reg27"); break;
-    case DW_OP_reg28:	printf ("DW_OP_reg28"); break;
-    case DW_OP_reg29:	printf ("DW_OP_reg29"); break;
-    case DW_OP_reg30:	printf ("DW_OP_reg30"); break;
-    case DW_OP_reg31:	printf ("DW_OP_reg31"); break;
-    case DW_OP_breg0:	printf ("DW_OP_breg0: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg1:	printf ("DW_OP_breg1: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg2:	printf ("DW_OP_breg2: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg3:	printf ("DW_OP_breg3: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg4:	printf ("DW_OP_breg4: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg5:	printf ("DW_OP_breg5: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg6:	printf ("DW_OP_breg6: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg7:	printf ("DW_OP_breg7: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg8:	printf ("DW_OP_breg8: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg9:	printf ("DW_OP_breg9: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg10:	printf ("DW_OP_breg10: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg11:	printf ("DW_OP_breg11: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg12:	printf ("DW_OP_breg12: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg13:	printf ("DW_OP_breg13: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg14:	printf ("DW_OP_breg14: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg15:	printf ("DW_OP_breg15: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg16:	printf ("DW_OP_breg16: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg17:	printf ("DW_OP_breg17: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg18:	printf ("DW_OP_breg18: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg19:	printf ("DW_OP_breg19: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg20:	printf ("DW_OP_breg20: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg21:	printf ("DW_OP_breg21: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg22:	printf ("DW_OP_breg22: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg23:	printf ("DW_OP_breg23: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg24:	printf ("DW_OP_breg24: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg25:	printf ("DW_OP_breg25: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg26:	printf ("DW_OP_breg26: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg27:	printf ("DW_OP_breg27: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg28:	printf ("DW_OP_breg28: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg29:	printf ("DW_OP_breg29: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg30:	printf ("DW_OP_breg30: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_breg31:	printf ("DW_OP_breg31: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_regx:	printf ("DW_OP_regx: %lu", read_leb128 (data, NULL, 0)); break;
-    case DW_OP_fbreg:	printf ("DW_OP_fbreg: %ld", read_leb128 (data, NULL, 1)); break;
-    case DW_OP_bregx:	printf ("DW_OP_bregx: %lu %ld", read_leb128 (data, & bytes_read, 0), read_leb128 (data + bytes_read, NULL, 1)); break;
-    case DW_OP_piece:	printf ("DW_OP_piece: %lu", read_leb128 (data, NULL, 0)); break;
-    case DW_OP_deref_size:	printf ("DW_OP_deref_size: %ld", byte_get (data, 1)); break;
-    case DW_OP_xderef_size:	printf ("DW_OP_xderef_size: %ld", byte_get (data, 1)); break;
-    case DW_OP_nop:	printf ("DW_OP_nop"); break;
+    case DW_OP_addr:
+      printf ("DW_OP_addr: %lx", (unsigned long) byte_get (data, pointer_size));
+      break;
+    case DW_OP_deref:
+      printf ("DW_OP_deref");
+      break;
+    case DW_OP_const1u:
+      printf ("DW_OP_const1u: %lu", (unsigned long) byte_get (data, 1));
+      break;
+    case DW_OP_const1s:
+      printf ("DW_OP_const1s: %ld", (long) byte_get (data, 1));
+      break;
+    case DW_OP_const2u:
+      printf ("DW_OP_const2u: %lu", (unsigned long) byte_get (data, 2));
+      break;
+    case DW_OP_const2s:
+      printf ("DW_OP_const2s: %ld", (long) byte_get (data, 2));
+      break;
+    case DW_OP_const4u:
+      printf ("DW_OP_const4u: %lu", (unsigned long) byte_get (data, 4));
+      break;
+    case DW_OP_const4s:
+      printf ("DW_OP_const4s: %ld", (long) byte_get (data, 4));
+      break;
+    case DW_OP_const8u:
+      printf ("DW_OP_const8u: %lu %lu", (unsigned long) byte_get (data, 4),
+	      (unsigned long) byte_get (data + 4, 4));
+      break;
+    case DW_OP_const8s:
+      printf ("DW_OP_const8s: %ld %ld", (long) byte_get (data, 4),
+	      (long) byte_get (data + 4, 4));
+      break;
+    case DW_OP_constu:
+      printf ("DW_OP_constu: %lu", read_leb128 (data, NULL, 0));
+      break;
+    case DW_OP_consts:
+      printf ("DW_OP_consts: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_dup:
+      printf ("DW_OP_dup");
+      break;
+    case DW_OP_drop:
+      printf ("DW_OP_drop");
+      break;
+    case DW_OP_over:
+      printf ("DW_OP_over");
+      break;
+    case DW_OP_pick:
+      printf ("DW_OP_pick: %ld", (unsigned long) byte_get (data, 1));
+      break;
+    case DW_OP_swap:
+      printf ("DW_OP_swap");
+      break;
+    case DW_OP_rot:
+      printf ("DW_OP_rot");
+      break;
+    case DW_OP_xderef:
+      printf ("DW_OP_xderef");
+      break;
+    case DW_OP_abs:
+      printf ("DW_OP_abs");
+      break;
+    case DW_OP_and:
+      printf ("DW_OP_and");
+      break;
+    case DW_OP_div:
+      printf ("DW_OP_div");
+      break;
+    case DW_OP_minus:
+      printf ("DW_OP_minus");
+      break;
+    case DW_OP_mod:
+      printf ("DW_OP_mod");
+      break;
+    case DW_OP_mul:
+      printf ("DW_OP_mul");
+      break;
+    case DW_OP_neg:
+      printf ("DW_OP_neg");
+      break;
+    case DW_OP_not:
+      printf ("DW_OP_not");
+      break;
+    case DW_OP_or:
+      printf ("DW_OP_or");
+      break;
+    case DW_OP_plus:
+      printf ("DW_OP_plus");
+      break;
+    case DW_OP_plus_uconst:
+      printf ("DW_OP_plus_uconst: %lu", read_leb128 (data, NULL, 0));
+      break;
+    case DW_OP_shl:
+      printf ("DW_OP_shl");
+      break;
+    case DW_OP_shr:
+      printf ("DW_OP_shr");
+      break;
+    case DW_OP_shra:
+      printf ("DW_OP_shra");
+      break;
+    case DW_OP_xor:
+      printf ("DW_OP_xor");
+      break;
+    case DW_OP_bra:
+      printf ("DW_OP_bra: %ld", (long) byte_get (data, 2));
+      break;
+    case DW_OP_eq:
+      printf ("DW_OP_eq");
+      break;
+    case DW_OP_ge:
+      printf ("DW_OP_ge");
+      break;
+    case DW_OP_gt:
+      printf ("DW_OP_gt");
+      break;
+    case DW_OP_le:
+      printf ("DW_OP_le");
+      break;
+    case DW_OP_lt:
+      printf ("DW_OP_lt");
+      break;
+    case DW_OP_ne:
+      printf ("DW_OP_ne");
+      break;
+    case DW_OP_skip:
+      printf ("DW_OP_skip: %ld", (long) byte_get (data, 2));
+      break;
+    case DW_OP_lit0:
+      printf ("DW_OP_lit0");
+      break;
+    case DW_OP_lit1:
+      printf ("DW_OP_lit1");
+      break;
+    case DW_OP_lit2:
+      printf ("DW_OP_lit2");
+      break;
+    case DW_OP_lit3:
+      printf ("DW_OP_lit3");
+      break;
+    case DW_OP_lit4:
+      printf ("DW_OP_lit4");
+      break;
+    case DW_OP_lit5:
+      printf ("DW_OP_lit5");
+      break;
+    case DW_OP_lit6:
+      printf ("DW_OP_lit6");
+      break;
+    case DW_OP_lit7:
+      printf ("DW_OP_lit7");
+      break;
+    case DW_OP_lit8:
+      printf ("DW_OP_lit8");
+      break;
+    case DW_OP_lit9:
+      printf ("DW_OP_lit9");
+      break;
+    case DW_OP_lit10:
+      printf ("DW_OP_lit10");
+      break;
+    case DW_OP_lit11:
+      printf ("DW_OP_lit11");
+      break;
+    case DW_OP_lit12:
+      printf ("DW_OP_lit12");
+      break;
+    case DW_OP_lit13:
+      printf ("DW_OP_lit13");
+      break;
+    case DW_OP_lit14:
+      printf ("DW_OP_lit14");
+      break;
+    case DW_OP_lit15:
+      printf ("DW_OP_lit15");
+      break;
+    case DW_OP_lit16:
+      printf ("DW_OP_lit16");
+      break;
+    case DW_OP_lit17:
+      printf ("DW_OP_lit17");
+      break;
+    case DW_OP_lit18:
+      printf ("DW_OP_lit18");
+      break;
+    case DW_OP_lit19:
+      printf ("DW_OP_lit19");
+      break;
+    case DW_OP_lit20:
+      printf ("DW_OP_lit20");
+      break;
+    case DW_OP_lit21:
+      printf ("DW_OP_lit21");
+      break;
+    case DW_OP_lit22:
+      printf ("DW_OP_lit22");
+      break;
+    case DW_OP_lit23:
+      printf ("DW_OP_lit23");
+      break;
+    case DW_OP_lit24:
+      printf ("DW_OP_lit24");
+      break;
+    case DW_OP_lit25:
+      printf ("DW_OP_lit25");
+      break;
+    case DW_OP_lit26:
+      printf ("DW_OP_lit26");
+      break;
+    case DW_OP_lit27:
+      printf ("DW_OP_lit27");
+      break;
+    case DW_OP_lit28:
+      printf ("DW_OP_lit28");
+      break;
+    case DW_OP_lit29:
+      printf ("DW_OP_lit29");
+      break;
+    case DW_OP_lit30:
+      printf ("DW_OP_lit30");
+      break;
+    case DW_OP_lit31:
+      printf ("DW_OP_lit31");
+      break;
+    case DW_OP_reg0:
+      printf ("DW_OP_reg0");
+      break;
+    case DW_OP_reg1:
+      printf ("DW_OP_reg1");
+      break;
+    case DW_OP_reg2:
+      printf ("DW_OP_reg2");
+      break;
+    case DW_OP_reg3:
+      printf ("DW_OP_reg3");
+      break;
+    case DW_OP_reg4:
+      printf ("DW_OP_reg4");
+      break;
+    case DW_OP_reg5:
+      printf ("DW_OP_reg5");
+      break;
+    case DW_OP_reg6:
+      printf ("DW_OP_reg6");
+      break;
+    case DW_OP_reg7:
+      printf ("DW_OP_reg7");
+      break;
+    case DW_OP_reg8:
+      printf ("DW_OP_reg8");
+      break;
+    case DW_OP_reg9:
+      printf ("DW_OP_reg9");
+      break;
+    case DW_OP_reg10:
+      printf ("DW_OP_reg10");
+      break;
+    case DW_OP_reg11:
+      printf ("DW_OP_reg11");
+      break;
+    case DW_OP_reg12:
+      printf ("DW_OP_reg12");
+      break;
+    case DW_OP_reg13:
+      printf ("DW_OP_reg13");
+      break;
+    case DW_OP_reg14:
+      printf ("DW_OP_reg14");
+      break;
+    case DW_OP_reg15:
+      printf ("DW_OP_reg15");
+      break;
+    case DW_OP_reg16:
+      printf ("DW_OP_reg16");
+      break;
+    case DW_OP_reg17:
+      printf ("DW_OP_reg17");
+      break;
+    case DW_OP_reg18:
+      printf ("DW_OP_reg18");
+      break;
+    case DW_OP_reg19:
+      printf ("DW_OP_reg19");
+      break;
+    case DW_OP_reg20:
+      printf ("DW_OP_reg20");
+      break;
+    case DW_OP_reg21:
+      printf ("DW_OP_reg21");
+      break;
+    case DW_OP_reg22:
+      printf ("DW_OP_reg22");
+      break;
+    case DW_OP_reg23:
+      printf ("DW_OP_reg23");
+      break;
+    case DW_OP_reg24:
+      printf ("DW_OP_reg24");
+      break;
+    case DW_OP_reg25:
+      printf ("DW_OP_reg25");
+      break;
+    case DW_OP_reg26:
+      printf ("DW_OP_reg26");
+      break;
+    case DW_OP_reg27:
+      printf ("DW_OP_reg27");
+      break;
+    case DW_OP_reg28:
+      printf ("DW_OP_reg28");
+      break;
+    case DW_OP_reg29:
+      printf ("DW_OP_reg29");
+      break;
+    case DW_OP_reg30:
+      printf ("DW_OP_reg30");
+      break;
+    case DW_OP_reg31:
+      printf ("DW_OP_reg31");
+      break;
+    case DW_OP_breg0:
+      printf ("DW_OP_breg0: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg1:
+      printf ("DW_OP_breg1: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg2:
+      printf ("DW_OP_breg2: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg3:
+      printf ("DW_OP_breg3: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg4:
+      printf ("DW_OP_breg4: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg5:
+      printf ("DW_OP_breg5: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg6:
+      printf ("DW_OP_breg6: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg7:
+      printf ("DW_OP_breg7: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg8:
+      printf ("DW_OP_breg8: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg9:
+      printf ("DW_OP_breg9: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg10:
+      printf ("DW_OP_breg10: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg11:
+      printf ("DW_OP_breg11: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg12:
+      printf ("DW_OP_breg12: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg13:
+      printf ("DW_OP_breg13: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg14:
+      printf ("DW_OP_breg14: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg15:
+      printf ("DW_OP_breg15: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg16:
+      printf ("DW_OP_breg16: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg17:
+      printf ("DW_OP_breg17: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg18:
+      printf ("DW_OP_breg18: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg19:
+      printf ("DW_OP_breg19: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg20:
+      printf ("DW_OP_breg20: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg21:
+      printf ("DW_OP_breg21: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg22:
+      printf ("DW_OP_breg22: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg23:
+      printf ("DW_OP_breg23: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg24:
+      printf ("DW_OP_breg24: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg25:
+      printf ("DW_OP_breg25: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg26:
+      printf ("DW_OP_breg26: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg27:
+      printf ("DW_OP_breg27: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg28:
+      printf ("DW_OP_breg28: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg29:
+      printf ("DW_OP_breg29: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg30:
+      printf ("DW_OP_breg30: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_breg31:
+      printf ("DW_OP_breg31: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_regx:
+      printf ("DW_OP_regx: %lu", read_leb128 (data, NULL, 0));
+      break;
+    case DW_OP_fbreg:
+      printf ("DW_OP_fbreg: %ld", read_leb128 (data, NULL, 1));
+      break;
+    case DW_OP_bregx:
+      uvalue = read_leb128 (data, &bytes_read, 0);
+      printf ("DW_OP_bregx: %lu %ld", uvalue,
+	      read_leb128 (data + bytes_read, NULL, 1));
+      break;
+    case DW_OP_piece:
+      printf ("DW_OP_piece: %lu", read_leb128 (data, NULL, 0));
+      break;
+    case DW_OP_deref_size:
+      printf ("DW_OP_deref_size: %ld", (long) byte_get (data, 1));
+      break;
+    case DW_OP_xderef_size:
+      printf ("DW_OP_xderef_size: %ld", (long) byte_get (data, 1));
+      break;
+    case DW_OP_nop:
+      printf ("DW_OP_nop");
+      break;
 
     default:
       if (op >= DW_OP_lo_user
@@ -4574,8 +5346,8 @@
      unsigned char * data;
      unsigned long   pointer_size;
 {
-  unsigned long   uvalue;
-  unsigned char * block_start;
+  unsigned long   uvalue = 0;
+  unsigned char * block_start = NULL;
   int             bytes_read;
   int		  is_ref = 0;
 
@@ -4626,7 +5398,7 @@
     case DW_FORM_data8:
       uvalue = byte_get (data, 4);
       printf (" %lx", uvalue);
-      printf (" %lx", byte_get (data + 4, 4));
+      printf (" %lx", (unsigned long) byte_get (data + 4, 4));
       data += 8;
       break;
 
@@ -4896,7 +5668,7 @@
       while (tags < start)
 	{
 	  int            bytes_read;
-	  int            abbrev_number;
+	  unsigned long  abbrev_number;
 	  abbrev_entry * entry;
 	  abbrev_attr  * attr;
 
@@ -4919,12 +5691,12 @@
 
 	  if (entry == NULL)
 	    {
-	      warn (_("Unable to locate entry %d in the abbreviation table\n"),
+	      warn (_("Unable to locate entry %lu in the abbreviation table\n"),
 		    abbrev_number);
 	      return 0;
 	    }
 
-	  printf (_(" <%d><%x>: Abbrev Number: %d (%s)\n"),
+	  printf (_(" <%d><%x>: Abbrev Number: %lu (%s)\n"),
 		  level, tags - section_begin - bytes_read,
 		  abbrev_number,
 		  get_TAG_name (entry->tag));
@@ -4949,7 +5721,7 @@
 display_debug_aranges (section, start, file)
      Elf32_Internal_Shdr * section;
      unsigned char *       start;
-     FILE *                file;
+     FILE *                file ATTRIBUTE_UNUSED;
 {
   unsigned char * end = start + section->sh_size;
 
@@ -5009,8 +5781,8 @@
 static int
 display_debug_not_supported (section, start, file)
      Elf32_Internal_Shdr * section;
-     unsigned char *       start;
-     FILE *                file;
+     unsigned char *       start ATTRIBUTE_UNUSED;
+     FILE *                file ATTRIBUTE_UNUSED;
 {
   printf (_("Displaying the debug contents of section %s is not yet supported.\n"),
 	    SECTION_NAME (section));
@@ -5138,9 +5910,9 @@
 
 static int
 process_mips_specific (file)
-     FILE *file;
+     FILE * file;
 {
-  Elf_Internal_Dyn *entry;
+  Elf_Internal_Dyn * entry;
   size_t liblist_offset = 0;
   size_t liblistno = 0;
   size_t conflictsno = 0;
@@ -5176,7 +5948,7 @@
 
   if (liblist_offset != 0 && liblistno != 0 && do_dynamic)
     {
-      Elf32_External_Lib *elib;
+      Elf32_External_Lib * elib;
       size_t cnt;
 
       GET_DATA_ALLOC (liblist_offset, liblistno * sizeof (Elf32_External_Lib),
@@ -5222,7 +5994,7 @@
 		  { " DELTA", LL_DELTA }
 		};
 	      int flags = liblist.l_flags;
-	      int fcnt;
+	      size_t fcnt;
 
 	      for (fcnt = 0;
 		   fcnt < sizeof (l_flags_vals) / sizeof (l_flags_vals[0]);
@@ -5244,10 +6016,10 @@
 
   if (options_offset != 0)
     {
-      Elf_External_Options *eopt;
-      Elf_Internal_Shdr *sect = section_headers;
-      Elf_Internal_Options *iopt;
-      Elf_Internal_Options *option;
+      Elf_External_Options * eopt;
+      Elf_Internal_Shdr * sect = section_headers;
+      Elf_Internal_Options * iopt;
+      Elf_Internal_Options * option;
       size_t offset;
       int cnt;
 
@@ -5270,7 +6042,7 @@
       option = iopt;
       while (offset < sect->sh_size)
 	{
-	  Elf_External_Options *eoption;
+	  Elf_External_Options * eoption;
 
 	  eoption = (Elf_External_Options *) ((char *) eopt + offset);
 
@@ -5324,16 +6096,16 @@
 	      else
 		{
 		  /* 64 bit form.  */
-		  Elf64_External_RegInfo *ereg;
+		  Elf64_External_RegInfo * ereg;
 		  Elf64_Internal_RegInfo reginfo;
 
 		  ereg = (Elf64_External_RegInfo *) (option + 1);
-		  reginfo.ri_gprmask = BYTE_GET (ereg->ri_gprmask);
+		  reginfo.ri_gprmask    = BYTE_GET (ereg->ri_gprmask);
 		  reginfo.ri_cprmask[0] = BYTE_GET (ereg->ri_cprmask[0]);
 		  reginfo.ri_cprmask[1] = BYTE_GET (ereg->ri_cprmask[1]);
 		  reginfo.ri_cprmask[2] = BYTE_GET (ereg->ri_cprmask[2]);
 		  reginfo.ri_cprmask[3] = BYTE_GET (ereg->ri_cprmask[3]);
-		  reginfo.ri_gp_value = BYTE_GET (ereg->ri_gp_value);
+		  reginfo.ri_gp_value   = BYTE_GET8 (ereg->ri_gp_value);
 
 		  printf ("GPR %08lx  GP 0x",
 			  reginfo.ri_gprmask);
@@ -5438,9 +6210,9 @@
 
   if (conflicts_offset != 0 && conflictsno != 0)
     {
-      Elf32_External_Conflict *econf32;
-      Elf64_External_Conflict *econf64;
-      Elf32_Conflict *iconf;
+      Elf32_External_Conflict * econf32;
+      Elf64_External_Conflict * econf64;
+      Elf32_Conflict * iconf;
       size_t cnt;
 
       if (dynamic_symbols == NULL)
@@ -5456,7 +6228,7 @@
 	  return 0;
 	}
 
-      if (binary_class == ELFCLASS32)
+      if (is_32bit_elf)
 	{
 	  GET_DATA_ALLOC (conflicts_offset, conflictsno * sizeof (*econf32),
 			  econf32, Elf32_External_Conflict *, "conflict");
@@ -5478,7 +6250,7 @@
 
       for (cnt = 0; cnt < conflictsno; ++cnt)
 	{
-	  Elf_Internal_Sym *psym = &dynamic_symbols[iconf[cnt]];
+	  Elf_Internal_Sym * psym = &dynamic_symbols[iconf[cnt]];
 
 	  printf ("%5u: %8lu  %#10lx  %s\n",
 		  cnt, iconf[cnt], (unsigned long) psym->st_value,
@@ -5494,8 +6266,11 @@
 
 static int
 process_arch_specific (file)
-     FILE *file;
+     FILE * file;
 {
+  if (! do_arch)
+    return 1;
+
   switch (elf_header.e_machine)
     {
     case EM_MIPS:
@@ -5512,31 +6287,76 @@
 get_file_header (file)
      FILE * file;
 {
-  Elf32_External_Ehdr ehdr;
-
-  if (fread (& ehdr, sizeof (ehdr), 1, file) != 1)
+  /* Read in the identity array.  */
+  if (fread (elf_header.e_ident, EI_NIDENT, 1, file) != 1)
     return 0;
 
-  memcpy (elf_header.e_ident, ehdr.e_ident, EI_NIDENT);
+  /* Determine how to read the rest of the header.  */
+  switch (elf_header.e_ident [EI_DATA])
+    {
+    default: /* fall through */
+    case ELFDATANONE: /* fall through */
+    case ELFDATA2LSB: byte_get = byte_get_little_endian; break;
+    case ELFDATA2MSB: byte_get = byte_get_big_endian; break;
+    }
 
-  if (elf_header.e_ident [EI_DATA] == ELFDATA2LSB)
-    byte_get = byte_get_little_endian;
+  /* For now we only support 32 bit and 64 bit ELF files.  */
+  is_32bit_elf = (elf_header.e_ident [EI_CLASS] != ELFCLASS64);
+
+  /* Read in the rest of the header.  */
+  if (is_32bit_elf)
+    {
+      Elf32_External_Ehdr ehdr32;
+
+      if (fread (ehdr32.e_type, sizeof (ehdr32) - EI_NIDENT, 1, file) != 1)
+	return 0;
+      
+      elf_header.e_type      = BYTE_GET (ehdr32.e_type);
+      elf_header.e_machine   = BYTE_GET (ehdr32.e_machine);
+      elf_header.e_version   = BYTE_GET (ehdr32.e_version);
+      elf_header.e_entry     = BYTE_GET (ehdr32.e_entry);
+      elf_header.e_phoff     = BYTE_GET (ehdr32.e_phoff);
+      elf_header.e_shoff     = BYTE_GET (ehdr32.e_shoff);
+      elf_header.e_flags     = BYTE_GET (ehdr32.e_flags);
+      elf_header.e_ehsize    = BYTE_GET (ehdr32.e_ehsize);
+      elf_header.e_phentsize = BYTE_GET (ehdr32.e_phentsize);
+      elf_header.e_phnum     = BYTE_GET (ehdr32.e_phnum);
+      elf_header.e_shentsize = BYTE_GET (ehdr32.e_shentsize);
+      elf_header.e_shnum     = BYTE_GET (ehdr32.e_shnum);
+      elf_header.e_shstrndx  = BYTE_GET (ehdr32.e_shstrndx);
+    }
   else
-    byte_get = byte_get_big_endian;
+    {
+      Elf64_External_Ehdr ehdr64;
 
-  elf_header.e_entry     = BYTE_GET (ehdr.e_entry);
-  elf_header.e_phoff     = BYTE_GET (ehdr.e_phoff);
-  elf_header.e_shoff     = BYTE_GET (ehdr.e_shoff);
-  elf_header.e_version   = BYTE_GET (ehdr.e_version);
-  elf_header.e_flags     = BYTE_GET (ehdr.e_flags);
-  elf_header.e_type      = BYTE_GET (ehdr.e_type);
-  elf_header.e_machine   = BYTE_GET (ehdr.e_machine);
-  elf_header.e_ehsize    = BYTE_GET (ehdr.e_ehsize);
-  elf_header.e_phentsize = BYTE_GET (ehdr.e_phentsize);
-  elf_header.e_phnum     = BYTE_GET (ehdr.e_phnum);
-  elf_header.e_shentsize = BYTE_GET (ehdr.e_shentsize);
-  elf_header.e_shnum     = BYTE_GET (ehdr.e_shnum);
-  elf_header.e_shstrndx  = BYTE_GET (ehdr.e_shstrndx);
+      /* If we have been compiled with sizeof (bfd_vma) == 4, then
+	 we will not be able to cope with the 64bit data found in
+	 64 ELF files.  Detect this now and abort before we start
+	 overwritting things.  */
+      if (sizeof (bfd_vma) < 8)
+	{
+	  error (_("This instance of readelf has been built without support for a\n"));
+	  error (_("64 bit data type and so it cannot read 64 bit ELF files.\n"));
+	  return 0;
+	}
+      
+      if (fread (ehdr64.e_type, sizeof (ehdr64) - EI_NIDENT, 1, file) != 1)
+	return 0;
+      
+      elf_header.e_type      = BYTE_GET (ehdr64.e_type);
+      elf_header.e_machine   = BYTE_GET (ehdr64.e_machine);
+      elf_header.e_version   = BYTE_GET (ehdr64.e_version);
+      elf_header.e_entry     = BYTE_GET8 (ehdr64.e_entry);
+      elf_header.e_phoff     = BYTE_GET8 (ehdr64.e_phoff);
+      elf_header.e_shoff     = BYTE_GET8 (ehdr64.e_shoff);
+      elf_header.e_flags     = BYTE_GET (ehdr64.e_flags);
+      elf_header.e_ehsize    = BYTE_GET (ehdr64.e_ehsize);
+      elf_header.e_phentsize = BYTE_GET (ehdr64.e_phentsize);
+      elf_header.e_phnum     = BYTE_GET (ehdr64.e_phnum);
+      elf_header.e_shentsize = BYTE_GET (ehdr64.e_shentsize);
+      elf_header.e_shnum     = BYTE_GET (ehdr64.e_shnum);
+      elf_header.e_shstrndx  = BYTE_GET (ehdr64.e_shstrndx);
+    }
 
   return 1;
 }
@@ -5628,6 +6448,7 @@
     {
       free (dynamic_symbols);
       dynamic_symbols = NULL;
+      num_dynamic_syms = 0;
     }
 
   if (dynamic_syminfo)
@@ -5639,8 +6460,8 @@
 
 #ifdef SUPPORT_DISASSEMBLY
 /* Needed by the i386 disassembler.  For extra credit, someone could
-fix this so that we insert symbolic addresses here, esp for GOT/PLT
-symbols */
+   fix this so that we insert symbolic addresses here, esp for GOT/PLT
+   symbols */
 
 void
 print_address (unsigned int addr, FILE * outfile)
diff --git a/binutils/rename.c b/binutils/rename.c
index fdc7263..78ea9fd 100644
--- a/binutils/rename.c
+++ b/binutils/rename.c
@@ -31,6 +31,12 @@
 #endif /* HAVE_UTIMES */
 #endif /* ! HAVE_GOOD_UTIME_H */
 
+/* We need to open the file in binary modes on system where that makes
+   a difference.  */
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
 static int simple_copy PARAMS ((const char *, const char *));
 
 /* The number of bytes to copy at once.  */
@@ -48,10 +54,14 @@
   int saved;
   char buf[COPY_BUF];
 
-  fromfd = open (from, O_RDONLY);
+  fromfd = open (from, O_RDONLY | O_BINARY);
   if (fromfd < 0)
     return -1;
+#ifdef O_CREAT
+  tofd = open (to, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0777);
+#else
   tofd = creat (to, 0777);
+#endif
   if (tofd < 0)
     {
       saved = errno;
@@ -139,17 +149,17 @@
      const char *to;
      int preserve_dates;
 {
-  int exists;
+  boolean exists;
   struct stat s;
   int ret = 0;
 
-  exists = lstat (to, &s);
+  exists = lstat (to, &s) == 0;
 
 #if defined (_WIN32) && !defined (__CYGWIN32__)
   /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
      fail instead.  Also, chown is not present.  */
 
-  if (exists == 0)
+  if (exists)
     remove (to);
 
   ret = rename (from, to);
@@ -163,7 +173,7 @@
 #else
   /* Use rename only if TO is not a symbolic link and has
      only one hard link.  */
-  if (exists < 0 || (!S_ISLNK (s.st_mode) && s.st_nlink == 1))
+  if (! exists || (!S_ISLNK (s.st_mode) && s.st_nlink == 1))
     {
       ret = rename (from, to);
       if (ret == 0)
diff --git a/binutils/rescoff.c b/binutils/rescoff.c
index 9a028c7..fe2487a 100644
--- a/binutils/rescoff.c
+++ b/binutils/rescoff.c
@@ -447,9 +447,14 @@
   if (! bfd_set_format (abfd, bfd_object))
     bfd_fatal ("bfd_set_format");
 
+#ifdef DLLTOOL_ARM
+  if (! bfd_set_arch_mach (abfd, bfd_arch_arm, 0))
+    bfd_fatal ("bfd_set_arch_mach(arm)");
+#else
   /* FIXME: This is obviously i386 specific.  */
   if (! bfd_set_arch_mach (abfd, bfd_arch_i386, 0))
-    bfd_fatal ("bfd_set_arch_mach");
+    bfd_fatal ("bfd_set_arch_mach(i386)");
+#endif /* arm */
 
   if (! bfd_set_file_flags (abfd, HAS_SYMS | HAS_RELOC))
     bfd_fatal ("bfd_set_file_flags");
diff --git a/binutils/resrc.c b/binutils/resrc.c
index 9ba3c11..c633c2a 100644
--- a/binutils/resrc.c
+++ b/binutils/resrc.c
@@ -1,5 +1,5 @@
 /* resrc.c -- read and write Windows rc files.
-   Copyright 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
    This file is part of GNU Binutils.
@@ -112,6 +112,8 @@
 
 /* Local functions.  */
 
+static FILE *look_for_default PARAMS ((char *, const char *, int,
+				       const char *, const char *));
 static void close_pipe PARAMS ((void));
 static void unexpected_eof PARAMS ((const char *));
 static int get_word PARAMS ((FILE *, const char *));
@@ -120,6 +122,55 @@
   PARAMS ((FILE *, unsigned char *, unsigned long, const char *));
 static void define_fontdirs PARAMS ((void));
 
+/* look for the preprocessor program */
+
+static FILE *
+look_for_default (cmd, prefix, end_prefix, preprocargs, filename)
+     char *cmd;
+     const char *prefix;
+     int end_prefix;
+     const char *preprocargs;
+     const char *filename;
+{
+  char *space;
+  int found;
+  struct stat s;
+
+  strcpy (cmd, prefix);
+
+  sprintf (cmd + end_prefix, "%s", DEFAULT_PREPROCESSOR);
+  space = strchr (cmd + end_prefix, ' ');
+  if (space)
+    *space = 0;
+
+  if (strchr (cmd, '/'))
+    {
+      found = (stat (cmd, &s) == 0
+#ifdef HAVE_EXECUTABLE_SUFFIX
+	       || stat (strcat (cmd, EXECUTABLE_SUFFIX), &s) == 0
+#endif
+	       );
+
+      if (! found)
+	{
+	  if (verbose)
+	    fprintf (stderr, "Tried `%s'\n", cmd);
+	  return NULL;
+	}
+    }
+
+  strcpy (cmd, prefix);
+
+  sprintf (cmd + end_prefix, "%s %s %s",
+	   DEFAULT_PREPROCESSOR, preprocargs, filename);
+
+  if (verbose)
+    fprintf (stderr, "Using `%s'\n", cmd);
+
+  cpp_pipe = popen (cmd, FOPEN_RT);
+  return cpp_pipe;
+}
+
 /* Read an rc file.  */
 
 struct res_directory *
@@ -131,21 +182,81 @@
 {
   char *cmd;
 
-  if (preprocessor == NULL)
-    preprocessor = DEFAULT_PREPROCESSOR;
-
   if (preprocargs == NULL)
     preprocargs = "";
   if (filename == NULL)
     filename = "-";
 
-  cmd = xmalloc (strlen (preprocessor)
-		 + strlen (preprocargs)
-		 + strlen (filename)
-		 + 10);
-  sprintf (cmd, "%s %s %s", preprocessor, preprocargs, filename);
+  if (preprocessor)
+    {
+      cmd = xmalloc (strlen (preprocessor)
+		     + strlen (preprocargs)
+		     + strlen (filename)
+		     + 10);
+      sprintf (cmd, "%s %s %s", preprocessor, preprocargs, filename);
 
-  cpp_pipe = popen (cmd, FOPEN_RT);
+      cpp_pipe = popen (cmd, FOPEN_RT);
+    }
+  else
+    {
+      char *dash, *slash, *cp;
+
+      preprocessor = DEFAULT_PREPROCESSOR;
+
+      cmd = xmalloc (strlen (program_name)
+		     + strlen (preprocessor)
+		     + strlen (preprocargs)
+		     + strlen (filename)
+#ifdef HAVE_EXECUTABLE_SUFFIX
+		     + strlen (EXECUTABLE_SUFFIX)
+#endif
+		     + 10);
+
+
+      dash = slash = 0;
+      for (cp = program_name; *cp; cp++)
+	{
+	  if (*cp == '-')
+	    dash = cp;
+	  if (
+#if defined(__DJGPP__) || defined (__CYGWIN__) || defined(__WIN32__)
+	      *cp == ':' || *cp == '\\' ||
+#endif
+	      *cp == '/')
+	    {
+	      slash = cp;
+	      dash = 0;
+	    }
+	}
+
+      cpp_pipe = 0;
+
+      if (dash)
+	{
+	  /* First, try looking for a prefixed gcc in the windres
+	     directory, with the same prefix as windres */
+
+	  cpp_pipe = look_for_default (cmd, program_name, dash-program_name+1,
+				       preprocargs, filename);
+	}
+
+      if (slash && !cpp_pipe)
+	{
+	  /* Next, try looking for a gcc in the same directory as
+             that windres */
+
+	  cpp_pipe = look_for_default (cmd, program_name, slash-program_name+1,
+				       preprocargs, filename);
+	}
+
+      if (!cpp_pipe)
+	{
+	  /* Sigh, try the default */
+
+	  cpp_pipe = look_for_default (cmd, "", 0, preprocargs, filename);
+	}
+
+    }
   if (cpp_pipe == NULL)
     fatal (_("can't popen `%s': %s"), cmd, strerror (errno));
   free (cmd);
diff --git a/binutils/size.c b/binutils/size.c
index f57c7ed..c93850c 100644
--- a/binutils/size.c
+++ b/binutils/size.c
@@ -366,9 +366,9 @@
 
 static void
 berkeley_sum (abfd, sec, ignore)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      sec_ptr sec;
-     PTR ignore;
+     PTR ignore ATTRIBUTE_UNUSED;
 {
   flagword flags;
   bfd_size_type size;
@@ -433,9 +433,9 @@
 
 static void
 sysv_internal_sizer (file, sec, ignore)
-     bfd *file;
+     bfd *file ATTRIBUTE_UNUSED;
      sec_ptr sec;
-     PTR ignore;
+     PTR ignore ATTRIBUTE_UNUSED;
 {
   bfd_size_type size = bfd_section_size (file, sec);
   if (!bfd_is_abs_section (sec)
@@ -454,9 +454,9 @@
 
 static void
 sysv_internal_printer (file, sec, ignore)
-     bfd *file;
+     bfd *file ATTRIBUTE_UNUSED;
      sec_ptr sec;
-     PTR ignore;
+     PTR ignore ATTRIBUTE_UNUSED;
 {
   bfd_size_type size = bfd_section_size (file, sec);
   if (!bfd_is_abs_section (sec)
diff --git a/binutils/stabs.c b/binutils/stabs.c
index a47b3bd..53e1070 100644
--- a/binutils/stabs.c
+++ b/binutils/stabs.c
@@ -1,5 +1,5 @@
 /* stabs.c -- Parse stabs debugging information
-   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -375,7 +375,7 @@
 /*ARGSUSED*/
 PTR
 start_stab (dhandle, abfd, sections, syms, symcount)
-     PTR dhandle;
+     PTR dhandle ATTRIBUTE_UNUSED;
      bfd *abfd;
      boolean sections;
      asymbol **syms;
@@ -1316,14 +1316,21 @@
 	    bad_stab (orig);
 	    return DEBUG_TYPE_NULL;
 	  }
-	while (q1 != NULL && p > q1 && p[1] == ':')
+	if (q1 != NULL && p > q1 && p[1] == ':')
 	  {
-	    q2 = strchr (q1, '>');
-	    if (q2 == NULL || q2 < p)
-	      break;
-	    p += 2;
-	    p = strchr (p, ':');
-	    if (p == NULL)
+	    int nest = 0;
+
+	    for (q2 = q1; *q2 != '\0'; ++q2)
+	      {
+		if (*q2 == '<')
+		  ++nest;
+		else if (*q2 == '>')
+		  --nest;
+		else if (*q2 == ':' && nest == 0)
+		  break;
+	      }
+	    p = q2;
+	    if (*p != ':')
 	      {
 		bad_stab (orig);
 		return DEBUG_TYPE_NULL;
@@ -1811,7 +1818,7 @@
 	    return debug_make_int_type (dhandle, 1, true);
 	  else if (n3 == 0xffff)
 	    return debug_make_int_type (dhandle, 2, true);
-	  else if (n3 == 0xffffffff)
+	  else if (n3 == (bfd_signed_vma) 0xffffffff)
 	    return debug_make_int_type (dhandle, 4, true);
 #ifdef BFD64
 	  else if (n3 == ((((bfd_vma) 0xffffffff) << 32) | 0xffffffff))
@@ -3432,7 +3439,7 @@
 
 static boolean
 stab_record_type (dhandle, info, typenums, type)
-     PTR dhandle;
+     PTR dhandle ATTRIBUTE_UNUSED;
      struct stab_handle *info;
      const int *typenums;
      debug_type type;
@@ -4506,7 +4513,7 @@
 
 static boolean
 stab_demangle_class (minfo, pp, pstart)
-     struct stab_demangle_info *minfo;
+     struct stab_demangle_info *minfo ATTRIBUTE_UNUSED;
      const char **pp;
      const char **pstart;
 {
@@ -4785,6 +4792,7 @@
     case 'O':
       {
 	boolean memberp, constp, volatilep;
+	debug_type class_type = DEBUG_TYPE_NULL;
 	debug_type *args;
 	boolean varargs;
 	unsigned int n;
@@ -4797,19 +4805,40 @@
 	varargs = false;
 
 	++*pp;
-	if (! isdigit ((unsigned char) **pp))
+	if (isdigit ((unsigned char) **pp))
+	  {
+	    n = stab_demangle_count (pp);
+	    if (strlen (*pp) < n)
+	      {
+		stab_bad_demangle (orig);
+		return false;
+	      }
+	    name = *pp;
+	    *pp += n;
+
+	    if (ptype != NULL)
+	      {
+		class_type = stab_find_tagged_type (minfo->dhandle,
+						    minfo->info,
+						    name, (int) n,
+						    DEBUG_KIND_CLASS);
+		if (class_type == DEBUG_TYPE_NULL)
+		  return false;
+	      }
+	  }
+	else if (**pp == 'Q')
+	  {
+	    if (! stab_demangle_qualified (minfo, pp,
+					   (ptype == NULL
+					    ? (debug_type *) NULL
+					    : &class_type)))
+	      return false;
+	  }
+	else
 	  {
 	    stab_bad_demangle (orig);
 	    return false;
 	  }
-	n = stab_demangle_count (pp);
-	if (strlen (*pp) < n)
-	  {
-	    stab_bad_demangle (orig);
-	    return false;
-	  }
-	name = *pp;
-	*pp += n;
 
 	if (memberp)
 	  {
@@ -4851,14 +4880,6 @@
 
 	if (ptype != NULL)
 	  {
-	    debug_type class_type;
-
-	    class_type = stab_find_tagged_type (minfo->dhandle, minfo->info,
-						name, (int) n,
-						DEBUG_KIND_CLASS);
-	    if (class_type == DEBUG_TYPE_NULL)
-	      return false;
-
 	    if (! memberp)
 	      *ptype = debug_make_offset_type (minfo->dhandle, class_type,
 					       *ptype);
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 15a0577..2e9f2ea 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,25 @@
+1999-06-29  Nick Clifton  <nickc@cygnus.com>
+
+	* binutils-all/objdump.exp: Add fr30 and MCore to expected cpus
+	list. 
+
+	* binutils-all/readelf.r: Do not assume a fixed number of spaces
+	in the output.
+
+1999-06-10  Nick Clifton  <nickc@cygnus.com>
+
+	* binutils-all/readelf.wi: Update to match latest output.
+	* binutils-all/readelf.h: Update to match latest output.
+
+Wed Jun  9 11:59:22 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* binutils-all/objdump.exp: Tighten regexp to match `objdump -i'
+	output to avoid massive exponential behaviour.
+
+1999-05-28  Ian Lance Taylor  <ian@zembu.com>
+
+	* binutils-all/readelf.h: Update for changes of 1999-04-08.
+
 1999-03-12  Nick Clifton  <nickc@cygnus.com>
 
 	* binutils-all/readelf.wi: Remove FR30 specific componnts.
diff --git a/binutils/testsuite/binutils-all/objdump.exp b/binutils/testsuite/binutils-all/objdump.exp
index 7c50f02..3bfb34c 100644
--- a/binutils/testsuite/binutils-all/objdump.exp
+++ b/binutils/testsuite/binutils-all/objdump.exp
@@ -33,14 +33,14 @@
 
 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -i"]
 
-set cpus_expected "(a29k|alliant|alpha|arc|arm|convex|d10v|d30v|h8|hppa|i386|i860|i960|m32r|m68k|m88k|mips|mn10200|mn10300|ns32k|powerpc|pyramid|romp|rs6000|sh|sparc|tahoe|v850|vax|we32k|z8k|z8001|z8002)"
+set cpus_expected "(a29k|alliant|alpha|arc|arm|convex|d10v|d30v|fr30|h8|hppa|i386|i860|i960|m32r|m68k|m88k|MCore|mips|mn10200|mn10300|ns32k|powerpc|pyramid|romp|rs6000|sh|sparc|tahoe|v850|vax|we32k|z8k|z8001|z8002)"
 
 # Make sure the target CPU shows up in the list.
 if ![regexp $cpus_expected $target_cpu] {
     regsub "^\[(\]" "$cpus_expected" "(${target_cpu}|" cpus_expected;
 }
 
-set want "BFD header file version.*srec.*header .* endian.*, data .* endian.*$cpus_expected"
+set want "BFD header file version.*srec\[^\n\]*\n\[^\n\]*header \[^\n\]*endian\[^\n\]*, data \[^\n\]*endian.*$cpus_expected"
 
 if [regexp $want $got] then {
     pass "objdump -i"
diff --git a/binutils/testsuite/binutils-all/readelf.h b/binutils/testsuite/binutils-all/readelf.h
index 555afe9..810eab5 100644
--- a/binutils/testsuite/binutils-all/readelf.h
+++ b/binutils/testsuite/binutils-all/readelf.h
@@ -1,9 +1,13 @@
 ELF Header:
-  Magic:   7f 45 4c 46 0[12] 0[12] 01 00 00 00 00 00 00 00 00 00 
+  Magic:   7f 45 4c 46 0[12] 0[12] 01 .. 00 00 00 00 00 00 00 00 
+  Class:                             ELF[36][24]
+  Data:                              2's complement,.* endian
+  Version:                           1 \(current\)
+  OS/ABI:                            .*
+  ABI Version:                       .*
   Type:                              REL \(Relocatable file\)
   Machine:                           .*
   Version:                           0x1
-  Data:                              ELFDATA.* endian\)
   Entry point address:               0x0
   Start of program headers:          0 \(bytes into file\)
   Start of section headers:          .* \(bytes into file\)
diff --git a/binutils/testsuite/binutils-all/readelf.r b/binutils/testsuite/binutils-all/readelf.r
index 4bea721..1349659 100644
--- a/binutils/testsuite/binutils-all/readelf.r
+++ b/binutils/testsuite/binutils-all/readelf.r
@@ -1,4 +1,4 @@
 
 Relocation section '.rel.*text' at offset 0x.* contains 1 entries:
   Offset    Info  Type            Symbol's Value  Symbol's Name.*
-  00000004  00.* R_.*           00000000  external_symbol.*
+  00000004  00.* R_.*00000000  external_symbol.*
diff --git a/binutils/testsuite/binutils-all/readelf.wi b/binutils/testsuite/binutils-all/readelf.wi
index 3cb2ecc..e022fff 100644
--- a/binutils/testsuite/binutils-all/readelf.wi
+++ b/binutils/testsuite/binutils-all/readelf.wi
@@ -5,7 +5,7 @@
    Version:       2
    Abbrev Offset: 0
    Pointer Size:  4
-    Abbrev Number: 1 \(DW_TAG_compile_unit\)
+ <.><.*>: Abbrev Number: 1 \(DW_TAG_compile_unit\)
      DW_AT_name        : .*/testprog.c	
      DW_AT_comp_dir    : .*/binutils	
      DW_AT_producer    : GNU C .*	
@@ -13,66 +13,64 @@
      DW_AT_low_pc      : 0	
      DW_AT_high_pc     : .*	
      DW_AT_stmt_list   : 0	
-    Abbrev Number: 2 \(DW_TAG_subprogram\)
+ <.><.*>: Abbrev Number: 2 \(DW_TAG_subprogram\)
      DW_AT_external    : 1	
      DW_AT_name        : fn	
      DW_AT_decl_file   : 1	
-     DW_AT_decl_line   : a	
+     DW_AT_decl_line   : 10	
      DW_AT_type        : .*	
      DW_AT_low_pc      : 0	
      DW_AT_high_pc     : .*	
      DW_AT_frame_base  : 1 byte block: .*
-    Abbrev Number: 3 \(DW_TAG_base_type\)
+ <.><.*>: Abbrev Number: 3 \(DW_TAG_base_type\)
      DW_AT_name        : int	
      DW_AT_byte_size   : 4	
      DW_AT_encoding    : 5	\(signed\)
-    Abbrev Number: 4 \(DW_TAG_subprogram\)
+ <.><.*>: Abbrev Number: 4 \(DW_TAG_subprogram\)
      DW_AT_sibling     : .*	
      DW_AT_external    : 1	
      DW_AT_name        : main	
      DW_AT_decl_file   : 1	
-     DW_AT_decl_line   : 10	
+     DW_AT_decl_line   : 16	
      DW_AT_type        : .*	
      DW_AT_low_pc      : .*	
      DW_AT_high_pc     : .*	
      DW_AT_frame_base  : 1 byte block: .*
-    Abbrev Number: 5 \(DW_TAG_lexical_block\)
+ <.><.*>: Abbrev Number: 5 \(DW_TAG_lexical_block\)
      DW_AT_low_pc      : .*	
      DW_AT_high_pc     : .*	
-
-   Extra data at end of comp unit:
- .*: Abbrev Number: 6 \(DW_TAG_variable\)
+ <.><.*>: Abbrev Number: 6 \(DW_TAG_variable\)
      DW_AT_name        : common	
      DW_AT_decl_file   : 1	
      DW_AT_decl_line   : 3	
-     DW_AT_type        : .*
+     DW_AT_type        : <.*>	
      DW_AT_external    : 1	
-     DW_AT_location    : 5 byte block: 3 . 0 0 0 	\(DW_OP_addr: 0\)
- .*: Abbrev Number: 6 \(DW_TAG_variable\)
+     DW_AT_location    : 5 byte block: 3 0 0 0 0 	\(DW_OP_addr: 0\)
+ <.><.*>: Abbrev Number: 6 \(DW_TAG_variable\)
      DW_AT_name        : global	
      DW_AT_decl_file   : 1	
      DW_AT_decl_line   : 4	
-     DW_AT_type        : .*	
+     DW_AT_type        : <.*>	
      DW_AT_external    : 1	
-     DW_AT_location    : 5 byte block: 3 . 0 0 0 	\(DW_OP_addr: 0\)
- .*: Abbrev Number: 7 \(DW_TAG_variable\)
+     DW_AT_location    : 5 byte block: 3 0 0 0 0 	\(DW_OP_addr: 0\)
+ <.><.*>: Abbrev Number: 7 \(DW_TAG_variable\)
      DW_AT_name        : local	
      DW_AT_decl_file   : 1	
      DW_AT_decl_line   : 5	
-     DW_AT_type        : .*	
+     DW_AT_type        : <.*>	
      DW_AT_location    : 5 byte block: 3 . 0 0 . 	\(DW_OP_addr: .\)
- .*: Abbrev Number: 8 \(DW_TAG_array_type\)
-     DW_AT_sibling     : .*	
-     DW_AT_type        : .*	
- .*: Abbrev Number: 9 \(DW_TAG_subrange_type\)
+ <.><.*>: Abbrev Number: 8 \(DW_TAG_array_type\)
+     DW_AT_sibling     : <.*>	
+     DW_AT_type        : <.*>	
+ <.><.*>: Abbrev Number: 9 \(DW_TAG_subrange_type\)
      DW_AT_upper_bound : 6	
- .*: Abbrev Number: 3 \(DW_TAG_base_type\)
+ <.><.*>: Abbrev Number: 3 \(DW_TAG_base_type\)
      DW_AT_name        : char	
      DW_AT_byte_size   : 1	
-     DW_AT_encoding    : .	\(.* char\)
- .*: Abbrev Number: 7 \(DW_TAG_variable\)
+     DW_AT_encoding    : 8	\(unsigned char\)
+ <.><.*>: Abbrev Number: 7 \(DW_TAG_variable\)
      DW_AT_name        : string	
      DW_AT_decl_file   : 1	
      DW_AT_decl_line   : 6	
-     DW_AT_type        : .*	
+     DW_AT_type        : <.*>	
      DW_AT_location    : 5 byte block: 3 . 0 0 . 	\(DW_OP_addr: .\)
diff --git a/binutils/windres.c b/binutils/windres.c
index 7de28c2..0ccd909 100644
--- a/binutils/windres.c
+++ b/binutils/windres.c
@@ -46,6 +46,10 @@
 #include <ctype.h>
 #include <time.h>
 
+/* used by resrc.c at least */
+
+int verbose = 0;
+
 /* An enumeration of format types.  */
 
 enum res_format
@@ -122,6 +126,7 @@
   {"output-format", required_argument, 0, 'O'},
   {"preprocessor", required_argument, 0, OPTION_PREPROCESSOR},
   {"target", required_argument, 0, 'F'},
+  {"verbose", no_argument, 0, 'v'},
   {"version", no_argument, 0, OPTION_VERSION},
   {"yydebug", no_argument, 0, OPTION_YYDEBUG},
   {0, no_argument, 0, 0}
@@ -705,7 +710,9 @@
   -F TARGET, --target TARGET  Specify COFF target\n\
   --preprocessor PROGRAM      Program to use to preprocess rc file\n\
   --include-dir DIR           Include directory when preprocessing rc file\n\
-  --define SYM[=VAL]          Define SYM when preprocessing rc file\n\
+  -DSYM[=VAL], --define SYM[=VAL]\n\
+                              Define SYM when preprocessing rc file\n\
+  -v                          Verbose - tells you what it's doing\n\
   --language VAL              Set language when reading rc file\n"));
 #ifdef YYDEBUG
   fprintf (stream, _("\
@@ -724,6 +731,34 @@
   exit (status);
 }
 
+/* Quote characters that will confuse the shell when we run the preprocessor */
+static const char *quot (string)
+     const char *string;
+{
+  static char *buf = 0;
+  static int buflen = 0;
+  int slen = strlen (string);
+  const char *src;
+  char *dest;
+
+  if ((buflen < slen * 2 + 2) || !buf)
+    {
+      buflen = slen * 2 + 2;
+      if (buf)
+	free (buf);
+      buf = (char *) xmalloc (buflen);
+    }
+
+  for (src=string, dest=buf; *src; src++, dest++)
+    {
+      if (*src == '(' || *src == ')' || *src == ' ')
+	*dest++ = '\\';
+      *dest = *src;
+    }
+  *dest = 0;
+  return buf;
+}
+
 /* The main function.  */
 
 int
@@ -739,6 +774,7 @@
   char *target;
   char *preprocessor;
   char *preprocargs;
+  const char *quotedarg;
   int language;
   struct res_directory *resources;
 
@@ -765,7 +801,7 @@
   preprocargs = NULL;
   language = -1;
 
-  while ((c = getopt_long (argc, argv, "i:o:I:O:F:", long_options,
+  while ((c = getopt_long (argc, argv, "i:o:I:O:F:D:v", long_options,
 			   (int *) 0)) != EOF)
     {
       switch (c)
@@ -794,35 +830,44 @@
 	  preprocessor = optarg;
 	  break;
 
+	case 'D':
 	case OPTION_DEFINE:
 	  if (preprocargs == NULL)
 	    {
-	      preprocargs = xmalloc (strlen (optarg) + 3);
-	      sprintf (preprocargs, "-D%s", optarg);
+	      quotedarg = quot (optarg);
+	      preprocargs = xmalloc (strlen (quotedarg) + 3);
+	      sprintf (preprocargs, "-D%s", quotedarg);
 	    }
 	  else
 	    {
 	      char *n;
 
-	      n = xmalloc (strlen (preprocargs) + strlen (optarg) + 4);
-	      sprintf (n, "%s -D%s", preprocargs, optarg);
+	      quotedarg = quot (optarg);
+	      n = xmalloc (strlen (preprocargs) + strlen (quotedarg) + 4);
+	      sprintf (n, "%s -D%s", preprocargs, quotedarg);
 	      free (preprocargs);
 	      preprocargs = n;
 	    }
 	  break;
 
+	case 'v':
+	  verbose ++;
+	  break;
+
 	case OPTION_INCLUDE_DIR:
 	  if (preprocargs == NULL)
 	    {
-	      preprocargs = xmalloc (strlen (optarg) + 3);
-	      sprintf (preprocargs, "-I%s", optarg);
+	      quotedarg = quot (optarg);
+	      preprocargs = xmalloc (strlen (quotedarg) + 3);
+	      sprintf (preprocargs, "-I%s", quotedarg);
 	    }
 	  else
 	    {
 	      char *n;
 
-	      n = xmalloc (strlen (preprocargs) + strlen (optarg) + 4);
-	      sprintf (n, "%s -I%s", preprocargs, optarg);
+	      quotedarg = quot (optarg);
+	      n = xmalloc (strlen (preprocargs) + strlen (quotedarg) + 4);
+	      sprintf (n, "%s -I%s", preprocargs, quotedarg);
 	      free (preprocargs);
 	      preprocargs = n;
 	    }
diff --git a/binutils/windres.h b/binutils/windres.h
index a3c789a..db43dd5 100644
--- a/binutils/windres.h
+++ b/binutils/windres.h
@@ -742,6 +742,8 @@
   unsigned char *data;
 };
 
+extern int verbose;
+
 /* Function declarations.  */
 
 extern struct res_directory *read_rc_file
diff --git a/binutils/wrstabs.c b/binutils/wrstabs.c
index e428174..8b51587 100644
--- a/binutils/wrstabs.c
+++ b/binutils/wrstabs.c
@@ -1,5 +1,5 @@
 /* wrstabs.c -- Output stabs debugging information
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -984,7 +984,7 @@
 stab_function_type (p, argcount, varargs)
      PTR p;
      int argcount;
-     boolean varargs;
+     boolean varargs ATTRIBUTE_UNUSED;
 {
   struct stab_write_handle *info = (struct stab_write_handle *) p;
   int i;
@@ -2383,7 +2383,7 @@
 /*ARGSUSED*/
 static boolean
 stab_end_function (p)
-     PTR p;
+     PTR p ATTRIBUTE_UNUSED;
 {
   return true;
 }
diff --git a/config.guess b/config.guess
index 3c75a80..885f661 100755
--- a/config.guess
+++ b/config.guess
@@ -576,7 +576,7 @@
 	  sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
 	  armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
 	  m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-	  elf32ppc)
+	  elf32ppc | elf32ppclinux)
 		# Determine Lib Version
 		cat >dummy.c <<EOF
 #include <features.h>
diff --git a/config.sub b/config.sub
index 3d4f5fd..5efe316 100755
--- a/config.sub
+++ b/config.sub
@@ -64,18 +64,6 @@
 	;;
 esac
 
-# CYGNUS LOCAL marketing-names
-# Here we handle any "marketing" names - translating them to
-#  standard triplets
-case $1 in 
-	mips-tx39-elf)
-		set mipstx39-unknown-elf
-                ;;
-	*)
-		;;
-esac
-# END CYGNUS LOCAL marketing-names
-
 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
@@ -110,13 +98,13 @@
 		os=
 		basic_machine=$1
 		;;
-	-sim | -cisco | -oki | -wec | -winbond )	# EGCS LOCAL
+	-sim | -cisco | -oki | -wec | -winbond)
 		os=
 		basic_machine=$1
 		;;
-	-scout)						# EGCS LOCAL
+	-scout)
 		;;
-	-wrs)						# EGCS LOCAL
+	-wrs)
 		os=vxworks
 		basic_machine=$1
 		;;
@@ -175,65 +163,18 @@
 	# Recognize the basic CPU types without company name.
 	# Some are omitted here because they have special meanings below.
 	tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
-		| arme[lb] | pyramid | mn10200 | mn10300 \
-		| tron | a29k | 580 | i960 | h8300 \
+		| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
+		| 580 | i960 | h8300 \
 		| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
-		| alpha | alphaev[45678] | alphaev56 | alphapca5[67] \
+		| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
 		| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
-		| 1750a | dsp16xx | pdp11 \
-		| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
-		| mipstx39 | mipstx39el \
-		| sparc | sparclet | sparclite | sparc64 | sparc86x | v850 \
-		| c4x)
-		basic_machine=$basic_machine-unknown
-		;;
-	m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \
-		| h8500 | w65 | fr30 | mcore) # CYGNUS / EGCS LOCAL
-		basic_machine=$basic_machine-unknown
-		;;
-	strongarm) # CYGNUS LOCAL nickc/strongarm
-		basic_machine=$basic_machine-unknown
-		;;
-	thumb)
-		basic_machine=$basic_machine-unknown
-		;;
-        # CYGNUS LOCAL vr4111/gavin
-	mips64vr4111 | mips64vr4111el)
-		basic_machine=$basic_machine-unknown
-		;;
-        # END CYGNUS LOCAL vr4111/gavin
-	mips64vr4300 | mips64vr4300el) # EGCS LOCAL jsmith/vr4300
-		basic_machine=$basic_machine-unknown
-		;;
-	mips64vr4100 | mips64vr4100el) # EGCS LOCAL jsmith/vr4100
-		basic_machine=$basic_machine-unknown
-		;;
-	mips64vr5000 | mips64vr5000el) # EGCS LOCAL ian/vr5000
-		basic_machine=$basic_machine-unknown
-		;;
-	mips16)
-		basic_machine=$basic_machine-unknown
-		;;
-	tic30) # CYGNUS LOCAL ian/tic30
-		basic_machine=$basic_machine-unknown
-		;;
-	c30) # CYGNUS LOCAL ian/tic30
-		basic_machine=tic30-unknown
-		;;
-
-	tic80)				# CYGNUS LOCAL fnf/TIc80
-		basic_machine=$basic_machine-unknown
-		;;
-	v850e)				# CYGNUS LOCAL jtc/v850
-		basic_machine=$basic_machine-unknown
-		;;
-	v850ea)				# CYGNUS LOCAL jtc/v850
-		basic_machine=$basic_machine-unknown
-		;;
-	d10v)
-		basic_machine=$basic_machine-unknown
-		;;
-	d30v)				# CYGNUS LOCAL hunt/d30v
+		| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
+		| mips64orion | mips64orionel | mipstx39 | mipstx39el \
+		| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
+		| mips64vr5000 | miprs64vr5000el | mcore \
+	        | m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \
+		| sparc | sparclet | sparclite | sparc64 | sparc86x | sparcv9 \
+		| thumb | v850 | c4x | d10v | h8500 | w65)
 		basic_machine=$basic_machine-unknown
 		;;
 	# We use `pc' rather than `unknown'
@@ -251,54 +192,24 @@
 	vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
 	      | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
 	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-	      | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
+	      | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
 	      | xmp-* | ymp-* \
-	      | hppa-* | hppa1.0-* | hppa1.1-* \
-	      | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
-	      | alpha-* | alphaev[45678]-* | alphaev56-* | alphapca5[67]-* \
-	      | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
-	      | xps100-* | clipper-* | orion-* \
+	      | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
+	      | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
+	      | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
+	      | clipper-* | orion-* \
 	      | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
-	      | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \
-	      | mips64el-* | mips64orion-* | mips64orionel-*  \
-	      | mipstx39-* | mipstx39el-* \
-	      | f301-* | arm*-* \
-	      | fr30-* | mcore-*) # CYGNUS LOCAL
-		;;
-	m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # EGCS LOCAL
-		;;
-	strongarm-*) # CYGNUS LOCAL nickc/strongarm
-		;;
-	thumb-*) # EGCS LOCAL angela/thumb
-		;;
-	v850-*) # EGCS LOCAL
-	        ;;
-	v850e-*) # CYGNUS LOCAL
-	        ;;
-	v850ea-*) # CYGNUS LOCAL
-	        ;;
-	d30v-*) # EGCS LOCAL
-	        ;;
-        # CYGNUS LOCAL vr4111/gavin
-	mips64vr4111-* | mips64vr4111el-*)
-		;;
-        # END CYGNUS LOCAL vr4111/gavin
-	mips64vr4300-* | mips64vr4300el-*) # EGCS LOCAL jsmith/vr4300
-		;;
-	mips64vr4100-* | mips64vr4100el-*) # EGCS LOCAL jsmith/vr4100
-		;;
-	mips16-*) # EGCS LOCAL krk/mips16
-		;;
-	tic30-*) # EGCS LOCAL ian/tic30
-		;;
-	c30-*) # EGCS LOCAL ian/tic30
-		basic_machine=tic30-unknown
-		;;
-	tic80-*)						# CYGNUS LOCAL fnf/TIc80
+	      | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
+	      | mips64el-* | mips64orion-* | mips64orionel-* \
+	      | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
+	      | mipstx39-* | mipstx39el-* | mcore-* \
+	      | f301-* | arm*-* | t3e-* \
+	      | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
+	      | thumb-* | v850-* | d30v-* | tic30-* | c30-* )
 		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
-	386bsd)						# EGCS LOCAL
+	386bsd)
 		basic_machine=i386-unknown
 		os=-bsd
 		;;
@@ -308,11 +219,11 @@
 	3b*)
 		basic_machine=we32k-att
 		;;
-	a29khif)					# EGCS LOCAL
+	a29khif)
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-	adobe68k)					# EGCS LOCAL
+	adobe68k)
 		basic_machine=m68010-adobe
 		os=-scout
 		;;
@@ -345,7 +256,7 @@
 		basic_machine=m68k-apollo
 		os=-sysv
 		;;
-	apollo68bsd)					# EGCS LOCAL
+	apollo68bsd)
 		basic_machine=m68k-apollo
 		os=-bsd
 		;;
@@ -425,7 +336,7 @@
 	encore | umax | mmax)
 		basic_machine=ns32k-encore
 		;;
-	es1800 | OSE68k | ose68k | ose | OSE)		# EGCS LOCAL
+	es1800 | OSE68k | ose68k | ose | OSE)
 		basic_machine=m68k-ericsson
 		os=-ose
 		;;
@@ -447,11 +358,11 @@
 		basic_machine=h8300-hitachi
 		os=-hms
 		;;
-	h8300xray)					# EGCS LOCAL
+	h8300xray)
 		basic_machine=h8300-hitachi
 		os=-xray
 		;;
-	h8500hms)					# EGCS LOCAL
+	h8500hms)
 		basic_machine=h8500-hitachi
 		os=-hms
 		;;
@@ -470,22 +381,6 @@
 		basic_machine=m68k-hp
 		os=-hpux
 		;;
-        w89k-*)						# EGCS LOCAL
-                basic_machine=hppa1.1-winbond
-                os=-proelf
-                ;;
-        op50n-*)					# EGCS LOCAL
-                basic_machine=hppa1.1-oki
-                os=-proelf
-                ;;
-        op60c-*)					# EGCS LOCAL
-                basic_machine=hppa1.1-oki
-                os=-proelf
-                ;;
-        hppro)						# EGCS LOCAL
-                basic_machine=hppa1.1-hp
-                os=-proelf
-                ;;
 	hp3k9[0-9][0-9] | hp9[0-9][0-9])
 		basic_machine=hppa1.0-hp
 		;;
@@ -495,22 +390,21 @@
 	hp9k3[2-9][0-9])
 		basic_machine=m68k-hp
 		;;
-	hp9k6[0-9][0-9] | hp6[0-9][0-9] )
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
 		basic_machine=hppa1.0-hp
 		;;
-	hp9k7[0-79][0-9] | hp7[0-79][0-9] )
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
 		basic_machine=hppa1.1-hp
 		;;
-	hp9k78[0-9] | hp78[0-9] )
+	hp9k78[0-9] | hp78[0-9])
 		# FIXME: really hppa2.0-hp
 		basic_machine=hppa1.1-hp
 		;;
-	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
-	hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
 		# FIXME: really hppa2.0-hp
 		basic_machine=hppa1.1-hp
 		;;
-	hp9k8[0-9][13679] | hp8[0-9][13679] )
+	hp9k8[0-9][13679] | hp8[0-9][13679])
 		basic_machine=hppa1.1-hp
 		;;
 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -519,10 +413,14 @@
 	hppa-next)
 		os=-nextstep3
 		;;
-	hppaosf)					# EGCS LOCAL
+	hppaosf)
 		basic_machine=hppa1.1-hp
 		os=-osf
 		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		os=-mvs
@@ -544,15 +442,15 @@
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-solaris2
 		;;
-	i386mach)					# EGCS LOCAL
+	i386mach)
 		basic_machine=i386-mach
 		os=-mach
 		;;
-	i386-vsta | vsta)				# EGCS LOCAL
+	i386-vsta | vsta)
 		basic_machine=i386-unknown
 		os=-vsta
 		;;
-	i386-go32 | go32)				# EGCS LOCAL
+	i386-go32 | go32)
 		basic_machine=i386-unknown
 		os=-go32
 		;;
@@ -588,6 +486,10 @@
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
+	*mint | *MiNT)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
 	mipsel*-linux*)
 		basic_machine=mipsel-unknown
 		os=-linux-gnu
@@ -602,12 +504,12 @@
 	mips3*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
 		;;
-	monitor)					# EGCS LOCAL
+	monitor)
 		basic_machine=m68k-rom68k
 		os=-coff
 		;;
-	msdos)						# EGCS LOCAL
-		basic_machine=i386-unknown	
+	msdos)
+		basic_machine=i386-unknown
 		os=-msdos
 		;;
 	ncr3000)
@@ -615,7 +517,7 @@
 		os=-sysv4
 		;;
 	netbsd386)
-		basic_machine=i386-unknown		# EGCS LOCAL
+		basic_machine=i386-unknown
 		os=-netbsd
 		;;
 	netwinder)
@@ -634,7 +536,7 @@
 		basic_machine=mips-sony
 		os=-newsos
 		;;
-	necv70)						# EGCS LOCAL
+	necv70)
 		basic_machine=v70-nec
 		os=-sysv
 		;;
@@ -663,18 +565,22 @@
 		basic_machine=i960-intel
 		os=-nindy
 		;;
-	mon960)						# EGCS LOCAL
+	mon960)
 		basic_machine=i960-intel
 		os=-mon960
 		;;
 	np1)
 		basic_machine=np1-gould
 		;;
-	OSE68000 | ose68000)				# EGCS LOCAL
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	OSE68000 | ose68000)
 		basic_machine=m68000-ericsson
 		os=-ose
 		;;
-	os68k)						# EGCS LOCAL
+	os68k)
 		basic_machine=m68k-none
 		os=-os68k
 		;;
@@ -704,10 +610,10 @@
 	pentiumii | pentium2)
 		basic_machine=i786-pc
 		;;
-	pentium-* | p5-* | k5-* | nexen-*)
+	pentium-* | p5-* | k5-* | k6-* | nexen-*)
 		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
-	pentiumpro-* | p6-* | k6-* | 6x86-*)
+	pentiumpro-* | p6-* | 6x86-*)
 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	pentiumii-* | pentium2-*)
@@ -731,7 +637,7 @@
 	ps2)
 		basic_machine=i386-ibm
 		;;
-	rom68k)						# EGCS LOCAL
+	rom68k)
 		basic_machine=m68k-rom68k
 		os=-coff
 		;;
@@ -741,7 +647,7 @@
 	rtpc | rtpc-*)
 		basic_machine=romp-ibm
 		;;
-	sa29200)					# EGCS LOCAL
+	sa29200)
 		basic_machine=a29k-amd
 		os=-udi
 		;;
@@ -752,7 +658,7 @@
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
-	sparclite-wrs)					# EGCS LOCAL
+	sparclite-wrs)
 		basic_machine=sparclite-wrs
 		os=-vxworks
 		;;
@@ -763,10 +669,10 @@
 	spur)
 		basic_machine=spur-unknown
 		;;
-	st2000)						# EGCS LOCAL
+	st2000)
 		basic_machine=m68k-tandem
 		;;
-	stratus)					# EGCS LOCAL
+	stratus)
 		basic_machine=i860-stratus
 		os=-sysv4
 		;;
@@ -814,6 +720,10 @@
 		basic_machine=i386-sequent
 		os=-dynix
 		;;
+	t3e)
+		basic_machine=t3e-cray
+		os=-unicos
+		;;
 	tx39)
 		basic_machine=mipstx39-unknown
 		;;
@@ -831,7 +741,7 @@
 		basic_machine=a29k-nyu
 		os=-sym1
 		;;
-	v810 | necv810)					# EGCS LOCAL
+	v810 | necv810)
 		basic_machine=v810-nec
 		os=-none
 		;;
@@ -858,9 +768,13 @@
 		basic_machine=a29k-wrs
 		os=-vxworks
 		;;
-	w65*)						# EGCS LOCAL
- 		basic_machine=w65-wdc
- 		os=-none
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
 		;;
 	xmp)
 		basic_machine=xmp-cray
@@ -869,7 +783,7 @@
         xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
-	z8k-*-coff)					# EGCS LOCAL
+	z8k-*-coff)
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
@@ -880,13 +794,13 @@
 
 # Here we handle the default manufacturer of certain CPU types.  It is in
 # some cases the only manufacturer, in others, it is the most popular.
-	w89k)						# EGCS LOCAL
+	w89k)
 		basic_machine=hppa1.1-winbond
 		;;
-	op50n)						# EGCS LOCAL
+	op50n)
 		basic_machine=hppa1.1-oki
 		;;
-	op60c)						# EGCS LOCAL
+	op60c)
 		basic_machine=hppa1.1-oki
 		;;
 	mips)
@@ -923,16 +837,16 @@
 	orion105)
 		basic_machine=clipper-highlevel
 		;;
-	mac | mpw | mac-mpw)				# EGCS LOCAL
+	mac | mpw | mac-mpw)
 		basic_machine=m68k-apple
 		;;
-	pmac | pmac-mpw)				# EGCS LOCAL
+	pmac | pmac-mpw)
 		basic_machine=powerpc-apple
 		;;
- 	c4x*)
- 		basic_machine=c4x-none
- 		os=-coff
-  		;;
+	c4x*)
+		basic_machine=c4x-none
+		os=-coff
+		;;
 	*)
 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
 		exit 1
@@ -991,18 +905,16 @@
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-	      | -interix* | -uwin* )
+	      | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
-	# EGCS LOCAL
 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug |  -netware* | -os9* | -beos* \
-	      | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+	      | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
 		;;
 	-mac*)
 		os=`echo $os | sed -e 's|mac|macos|'`
 		;;
-	# END EGCS LOCAL
 	-linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
@@ -1027,7 +939,7 @@
 	-acis*)
 		os=-aos
 		;;
-	-386bsd)					# EGCS LOCAL
+	-386bsd)
 		os=-bsd
 		;;
 	-ctix* | -uts*)
@@ -1061,15 +973,18 @@
 	# This must come after -sysvr4.
 	-sysv*)
 		;;
-	-ose*)						# EGCS LOCAL
+	-ose*)
 		os=-ose
 		;;
-	-es1800*)					# EGCS LOCAL
+	-es1800*)
 		os=-ose
 		;;
 	-xenix)
 		os=-xenix
 		;;
+        -*mint | -*MiNT)
+	        os=-mint
+		;;
 	-none)
 		;;
 	*)
@@ -1119,15 +1034,15 @@
 		# default.
 		# os=-sunos4
 		;;
-	m68*-cisco)					# EGCS LOCAL
+	m68*-cisco)
 		os=-aout
 		;;
-	mips*-cisco)					# EGCS LOCAL
+	mips*-cisco)
 		os=-elf
 		;;
-        mips*-*)                                        # EGCS LOCAL
-                os=-elf
-                ;;
+	mips*-*)
+		os=-elf
+		;;
 	*-tti)	# must be before sparc entry or we get the wrong os.
 		os=-sysv3
 		;;
@@ -1140,13 +1055,13 @@
 	*-ibm)
 		os=-aix
 		;;
-	*-wec)						# EGCS LOCAL
+	*-wec)
 		os=-proelf
 		;;
-	*-winbond)					# EGCS LOCAL
+	*-winbond)
 		os=-proelf
 		;;
-	*-oki)						# EGCS LOCAL
+	*-oki)
 		os=-proelf
 		;;
 	*-hp)
@@ -1212,15 +1127,18 @@
 	f301-fujitsu)
 		os=-uxpv
 		;;
-	*-rom68k)					# EGCS LOCAL
+	*-rom68k)
 		os=-coff
 		;;
-	*-*bug)						# EGCS LOCAL
+	*-*bug)
 		os=-coff
 		;;
-	*-apple)					# EGCS LOCAL
+	*-apple)
 		os=-macos
 		;;
+	*-atari*)
+		os=-mint
+		;;
 	*)
 		os=-none
 		;;
@@ -1278,12 +1196,15 @@
 			-aux*)
 				vendor=apple
 				;;
-			-hms*)				# EGCS LOCAL
+			-hms*)
 				vendor=hitachi
 				;;
-			-mpw* | -macos*)		# EGCS LOCAL
+			-mpw* | -macos*)
 				vendor=apple
 				;;
+			-*mint | -*MiNT)
+				vendor=atari
+				;;
 		esac
 		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
 		;;
diff --git a/configure b/configure
index cad60b7..e51ca9f 100755
--- a/configure
+++ b/configure
@@ -3,7 +3,7 @@
 ### WARNING: this file contains embedded tabs.  Do not run untabify on this file.
 
 # Configuration script
-# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 1997
+# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
 # Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -902,6 +902,9 @@
   test -n "$DEFAULT_LEX" && break
 done
 
+# BINUTILS LOCAL: This is included in the default CFLAGS when using gcc.
+warn_cflags="-W -Wall"
+
 if [ "${build}" != "${host}" ]; then
   # If we are doing a Canadian Cross, in which the host and build systems
   # are not the same, we set reasonable default values for the tools.
@@ -935,7 +938,7 @@
   AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as}
   BISON=${BISON-bison}
   CC=${CC-${host_alias}-gcc}
-  CFLAGS=${CFLAGS-"-g -O2"}
+  CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"}
   CXX=${CXX-${host_alias}-c++}
   CXXFLAGS=${CXXFLAGS-"-g -O2"}
   CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
@@ -1015,10 +1018,10 @@
 	CC="gcc"
 	echo 'void f(){}' > conftest.c
 	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
-	  CFLAGS=${CFLAGS-"-g -O2"}
+	  CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"}
 	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
 	else
-	  CFLAGS=${CFLAGS-"-O2"}
+	  CFLAGS=${CFLAGS-"-O2 ${warn_cflags}"}
 	  CXXFLAGS=${CXXFLAGS-"-O2"}
 	fi
 	rm -f conftest*
@@ -1035,10 +1038,10 @@
       *gcc)
 	echo 'void f(){}' > conftest.c
 	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
-	  CFLAGS=${CFLAGS-"-g -O2"}
+	  CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"}
 	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
 	else
-	  CFLAGS=${CFLAGS-"-O2"}
+	  CFLAGS=${CFLAGS-"-O2 ${warn_cflags}"}
 	  CXXFLAGS=${CXXFLAGS-"-O2"}
 	fi
 	rm -f conftest*
diff --git a/configure.in b/configure.in
index e4e5c43..e9cc906 100644
--- a/configure.in
+++ b/configure.in
@@ -643,8 +643,9 @@
     noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
     ;;
   hppa*-*-*elf* | \
+  hppa*-*-linux-gnu* | \
   hppa*-*-lites*)
-    # Do configure ld/binutils/gas for this case.
+    # Do configure ld/binutils/gas for the above cases.
     ;;
   hppa*-*-*)
     # HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach
@@ -784,9 +785,9 @@
     noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss"
     ;;
   mips*-*-irix6*)
-    # The GNU assembler and linker do not support IRIX 6.
+    # The GNU assembler does not support IRIX 6.
     # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
-    noconfigdirs="$noconfigdirs ld gas gprof emacs target-libgloss"
+    noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss"
     ;;
   mips*-dec-bsd*)
     noconfigdirs="$noconfigdirs gprof target-libgloss"
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 852b6c7..b557c59 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,809 @@
+1999-07-16  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* doc/c-sparc.texi: Document .register and .nword pseudo-ops.
+
+1999-07-16  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* config/tc-sparc.c (sparc_ip): Allow OLO10 relocations
+	on -64 and not pic.
+	(output_insn): Put OLO10's secondary addend into tc_fix_data.
+	(md_apply_fix3): Handle BFD_RELOC_SPARC_OLO10.
+	(tc_gen_reloc): Return two relocs for OLO10, LO10 and SPARC13.
+	* config/tc-sparc.h (RELOC_EXPANSION_POSSIBLE,
+	MAX_RELOC_EXPANSION): Define.
+	(TC_FIX_TYPE, TC_INIT_FIX_DATA, TC_FIX_DATA_PRINT): Likewise.
+
+1999-07-16  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* config/tc-i386.c (intel_float_operand): Add prototype, make static.
+	(md_assemble): Localize *exp variable to if (fake_zero_displacement)
+	block.  Print a warning if an 8-bit or 16-bit constant
+	displacement or immediate is truncated on output.
+	(i386_immediate): Ensure Imm16 is always legal for a 16-bit mode
+	immediate.
+	(i386_operand): Disallow immediate jump absolute operand.
+
+1999-07-15  Ian Lance Taylor  <ian@zembu.com>
+
+	* configure.in: Bump version number to 2.9.5.
+	* configure: Rebuild.
+
+	* dwarf2dbg.c (dwarf2_gen_line_info): Don't assume that long long
+	or %llx work.
+
+Thu Jul 15 02:45:30 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* config/tc-hppa.c (md_pseudo_table): Add ".dword" pseudo-op.
+	(cons_fix_new_hppa): Derive size of fixup from size of the object.
+
+1999-07-14  Philip Blundell  <pb@nexus.co.uk>
+
+	* symbols.c (dollar_label_name): Prepend LOCAL_LABEL_PREFIX if it
+	is defined.
+	* config/tc-arm.h (LOCAL_LABEL_PREFIX): Define to '.' for ELF.
+
+	* config/tc-arm.c (md_begin): Set F_SOFTFLOAT in the output file
+	if -mno-fpu was given.
+	(tc_gen_reloc): Fix typo.  Delete bogus code related to GOTPC
+	relocs.
+	(cons_fix_new_arm): Remove misleading comments.
+
+1999-07-14  Ian Lance Taylor  <ian@zembu.com>
+
+	* write.c (cvt_frag_to_fill): Use frag file and line in rs_org
+	error message.
+	(relax_segment): Likewise.  After giving a rs_org error, convert
+	the frag to rs_align to avoid cascading errors.
+
+1999-07-12  Andreas Schwab  <schwab@suse.de>
+
+	* config/tc-m68k.c: Add some ATTRIBUTE_UNUSED.
+
+1999-07-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
+	as appropriate.  Fill in structure initializations.  Add variable
+	initializations.  Add casts.
+	* dwarf2dbg.c (print_stats): Change i to size_t.
+	* listing.c (listing_listing): Change list_line to unsigned int.
+
+1999-07-10  Ian Lance Taylor  <ian@zembu.com>
+
+	* config/tc-ppc.h (tc_fix_adjustable) [OBJ_ELF]: Call S_IS_LOCAL
+	rather than checking for \001 and \002 in symbol name.
+	* config/tc-sparc.h (tc_fix_adjustable) [OBJ_ELF]: Likewise.
+
+Thu Jul  8 12:32:23 1999  John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+	* configure.in (hppa*-linux-gnu*): New target.
+	* configure: Rebuilt.
+
+1999-07-08  Nick Clifton  <nickc@cygnus.com>
+
+	* doc/c-arm.texi (ARM Directives): Document .thumb_set directive. 
+
+1999-07-07  Nick Clifton  <nickc@cygnus.com>
+
+	* config/tc-v850.c (v850_comm): Use symbol_get_obj() rather than
+	accessing symbolP directly.
+
+Tue Jul  6 10:41:42 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* config/tc-hppa.h (tc_frob_symbol): Always punt "$global$" symbol
+	for ELF.
+
+1999-07-05  Nick Clifton  <nickc@cygnus.com>
+
+	* config/tc-arm.c (ARM_EXT_V5): Define.
+	(ARM_ARCH_V5, ARM_ARCH_V5T): Define.
+	(md_begin): Detect ARM v5 architectures.
+	(md_parse_option): Accept arm v5 specification.
+	(md_show_usage): Documment -marmv5 switch.
+
+	* doc/c-arm.texi: Document -marmv5 command line option.
+	
+	* config/tc-arm.c (do_adrl): New function.  Implement ADRL pseudo
+	op.
+	(validate_immediate_twopart): New function.  Determine if a
+	constant can be computed by two ADD instructions.
+	(output_inst): Remove its command line parameter - it was never
+	used.
+	(md_apply_fix3): Support BFD_RELOC_ARM_ADRL_IMMEDIATE, used to
+	implememt the ADRL pseudo op.
+	(tc_gen_reloc): Generate a suitable error message if an ADRL
+	instruction tries to generate a real reloc.
+
+	* doc/c-arm.texi: Document NOP, ADR and ADRL pseudo ops.
+
+Thu Jul  1 15:33:10 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* config/tc-hppa.c (pa_ip): Convert the opcode and all completers
+	into lower case.
+
+1999-06-27  H.J. Lu  <hjl@gnu.org>
+
+	* subsegs.c (subseg_text_p): Use 1/0 instead of true/false for
+	non BFD_ASSEMBLER case.
+
+1999-06-26  Mumit Khan  <khan@xraylith.wisc.edu>
+
+	* config/obj-coff.c (obj_coff_section): Mark writable sections as
+	data.
+
+1999-06-26  David Mosberger  <davidm@hpl.hp.com>
+
+	* dwarf2dbg.c (dwarf2_gen_line_info): Don't call
+	out_end_sequence() when the address decreases due to a new frag.
+	(gen_dir_list): Set ls.file[i].dir to j + 1 (not j) because file
+	numbering starts with 1.
+
+1999-06-23  Nick Clifton  <nickc@cygnus.com>
+
+	* config/tc-mcore.c (md_pseudo_table): Add .comm for ELF and allow
+	.section for COFF.
+	(mcore_s_text): Call obj_elf_text for ELF target.
+	(mcore_s_data): Call obj_elf_data for ELF target.
+	(mcore_s_section): No longer ELF specific.  Call obj_coff_section
+	for COFF target.
+	(mcore_s_bss): New function:  Dump literal table before changing
+	sections.
+	(mcore_s_comm): New function:  Dump literal table before changing
+	sections.
+	
+	* config/obj-elf.c (obj_elf_common, obj_elf_data, obj_elf_text):
+	No longer static functions.
+	* config/obj-elf.h (obj_elf_common, obj_elf_data, obj_elf_text):
+	Provide prototypes for these functions.
+
+1999-06-22  Ian Lance Taylor  <ian@zembu.com>
+
+	* subsegs.c (subseg_text_p): Rewrite non BFD_ASSEMBLER case to use
+	a list of names, to try obj_segment_name, and to try abbreviated
+	names when using COFF without long section names.
+
+	* config/tc-alpha.c: More use of symbol accessor functions.
+	* config/tc-arc.c: Likewise.
+	* config/tc-d30v.c: Likewise.
+	* config/tc-fr30.c: Likewise.
+	* config/tc-i860.c: Likewise.
+	* config/tc-m88k.c: Likewise.
+	* config/tc-mcore.c: Likewise.
+	* config/tc-ns32k.c: Likewise.
+	* config/tc-sparc.c: Likewise.
+	* config/tc-v850.c: Likewise.
+
+	* config/tc-arc.c (get_arc_exp_reloc_type): Change uses of
+	sy_value with appropriate accessor functions.
+	* config/tc-arm.c (md_apply_fix3): Likewise.
+	* config/tc-d10v.c (AT_WORD_P): Likewise.
+	* config/tc-v850.c (reg_name_search): Likewise.
+
+	* config/obj-ecoff.c (obj_ecoff_set_ext): Change uses of bsym to
+	use symbol_get_bfdsym instead.
+	* config/tc-ppc.c (md_assemble): Likewise.
+	* config/tc-v850.c (v850_comm): Likewise.
+
+1999-06-22  Jonathan Larmour  <jlarmour@cygnus.co.uk>
+
+	* config/tc-arc.c (tc_gen_reloc): Use symbol_get_bfdsym to get at
+	the symbol, rather than accessing the bsym member.
+	* config/tc-d10v.c (tc_gen_reloc): Likewise.
+	* config/tc-d30v.c (tc_gen_reloc): Likewise.
+	* config/tc-mcore.c (tc_gen_reloc): Likewise.
+	* config/tc-mn10200.c (tc_gen_reloc): Likewise.
+	* config/tc-mn10300.c (tc_gen_reloc): Likewise.
+	* config/tc-ns32k.c (tc_gen_reloc): Likewise.
+	* config/tc-tic30.c (tc_gen_reloc): Likewise.
+	* config/tc-v850.c (tc_gen_reloc): Likewise.
+
+Mon Jun 21 16:45:19 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* tc-hppa.c (elf_hppa_reloc_type): Renamed from elf32_hppa_reloc_type.
+	(hppa_gen_reloc_type): Conditionalize on BFD64.
+	(tc_gen_reloc): Re-enable ELF relocations.
+	* tc-hppa.h (TARGET_FORMAT): Handle elf64-hppa format.
+
+1999-06-21  Ian Lance Taylor  <ian@zembu.com>
+
+	* config/tc-arm.c (ldst_extend): Add parentheses to avoid
+	warning.
+	(do_ldst): Move assignment out of if condition.
+	(md_apply_fix3): Add casts to avoid printf format warnings.  Add
+	parentheses to avoid warning.
+
+1999-06-21  Nick Clifton  <nickc@cygnus.com>
+
+	* config/tc-arm.c (arm_adjust_symtab): Use symbol_get_bfdsym()
+	macro to get at the BFD symbol associated with a GAS symbol.
+
+1999-06-19  Ian Lance Taylor  <ian@zembu.com>
+
+	* config/tc-ppc.c: Update for symbol handling changes.
+	* config/obj-coff.c: Likewise.
+
+Fri Jun 18 14:34:18 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* tc-hppa.c: General cleanups of ELF support.  No more spaces
+	and subspaces for ELF.
+	(GDB_DEBUG_SPACE_NAME): Delete definition for ELF.
+	(GDB_STRINGS_SUBSPACE_NAME): Likewise.
+	(GDB_SYMBOLS_SUBSPACE_NAME): Likewise
+	(UNWIND_SECTION_NAME): Likewise.
+	(space/subspace related structures): Conditionalize definitions
+	on OBJ_SOM.
+	(space/subspace directives and support routines): Conditionalize
+	definitions and references/uses on OBJ_SOM.
+	(label_symbol_struct): For ELF, track the symbol's segment.  For
+	SOM track its space.
+	(pa_define_label, pa_undefine_label, pa_get_label): Corresponding
+	changes.
+	(USE_ALIASES): Kill for both SOM & ELF.
+	(pa_def_subspaces, pa_def_spaces): Corresponding changes.
+	(pa_space, pa_subspace): Corresponding changes.
+	(pa_spaces_begin): Corresponding chagnes.
+	(md_begin): Do not muck around with space/subspace stuff for
+	OBJ_ELF.
+	(md_apply_fix): Temporarily disable argument relocation stuff
+	for OBJ_ELF.
+	(tc_gen_reloc): Temporarily disable relocation generation for
+	OBJ_ELF
+	(pa_build_unwind_subspace): Similarly.
+
+1999-06-16  Nick Clifton  <nickc@cygnus.com>
+
+	* config/tc-arm.c (thumb_set): New pseudo op.
+	(text, data, section): Override these pseudo ops with ARM
+	specific versions.
+	(s_thumb_set): New function: Perform the same as a .set pseudo
+	op, but also mark the alias'ed symbol as being a Thumb
+	function.
+	(arm_s_text): New function: Perform the same as the .text
+	pseudo op, but dump the literal pool before changing
+	sections. 
+	(arm_s_data): New function: Perform the same as the .data
+	pseudo op, but dump the literal pool before changing
+	sections. 
+	(arm_s_section): New function: Perform the same as the
+	.section pseudo op, but dump the literal pool before changing 
+	sections. 
+	(arm_cleanup): Do not reset the current section before dumping
+	the literal pool.
+
+1999-06-17  Nick Clifton  <nickc@cygnus.com>
+
+	* config/tc-m32r.c (md_longopts): Fix OPTION_WARN_UNMATCHED and
+	OPTION_NO_WARN_UNMATCHED entries.
+	(md_parse_option): Generate a warning message if an unrecognised
+	option is encountered.
+
+	* config/tc-d10v.c (do_not_ignore_hash): New variable.
+	(get_operands): When parsing an expression after an '@' symbol
+	has been detected, do not ignore '#' symbols.
+	(md_operand): Only ignore '#' symbols if do_not_ignore_hash is
+	false. 
+
+1999-06-13  Ian Lance Taylor  <ian@zembu.com>
+
+	From K. Richard Pixley <rich@noir.com>:
+	* configure.in (ppc-*-vxworks*): New target.
+	* configure: Rebuild.
+
+1999-06-12  Philip Blundell  <philb@gnu.org>
+
+	* config/tc-arm.c (tc_gen_reloc): Fix handling of GOTPC relocs.
+
+1999-06-13  Ian Lance Taylor  <ian@zembu.com>
+
+	* write.c (adjust_reloc_syms): Rather than never reducing reloc
+	which refer to symbols in linkonce sections, permit reducing the
+	relocs if the symbol is local.
+
+1999-06-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* subsegs.c (subseg_text_p): New function.
+	* as.h (subseg_text_p): Declare.
+	* read.c (do_align): Use subseg_text_p to set the default fill.
+	* write.c (subsegs_finish): Likewise.
+	* config/obj-coff.c (write_object_file): Likewise.
+	* config/tc-i386.h (md_maybe_text): Don't define.
+	(md_do_align): Use subseg_text_p to set the default fill.
+	* config/tc-m32r.c (m32r_do_align): Likewise.
+	* config/tc-sh.c (sh_do_align): Likewise.
+	* config/tc-sparc.h (md_do_align): Likewise.
+
+1999-06-12  David O'Brien  <obrien@freebsd.org>
+
+	* configure.in: (i[3456]86-*-freebsd*): Now defaults to ELF.
+	* configure: Rebuild.
+
+1999-06-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* dwarf2dbg.c: Include elf/dwarf2.h with "", not <>.
+	* Makefile.am: Rebuild dependencies.
+	* Makefile.in: Rebuild.
+
+	* config/tc-i386.c (i386_immediate): Remove unused label
+	seg_unimplemented.
+
+	* struc-symbol.h: Put local_symbol code in ifdef BFD_ASSEMBLER.
+	* symbols.c: Likewise.
+	* config/obj-aout.c (obj_crawl_symbol_chain): Refer directly to
+	sy_next field when taking address, rather than symbol_next.
+
+	* dwarf2dbg.c: Change bfd_vma to addressT and bfd_signed_vma to
+	offsetT.
+	(out_set_addr): Don't use BYTES_PER_ADDRESS.  Instead, get the
+	value from the output file architecture.
+	(dwarf2_gen_line_info): Ifdef BFD_ASSEMBLER specific code.
+	* dwarf2dbg.h: Change bfd_vma to addressT.
+
+1999-06-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* dwarf2dbg.h: Use PARAMS in function declarations.
+
+1999-06-11  Martin Dorey  <mdorey@madge.com>
+
+	* write.c (fixup_segment): Don't add symbol value for i960 ELF.
+	* config/tc-i960.c (s_leafproc): Don't call tc_set_bal_of_cal if
+	OBJ_ELF.
+	(md_apply_fix): Simplify BFD_ASSEMBLER handling.
+
+1999-06-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* config/tc-i386.c (md_apply_fix3): Add default case to switch.
+
+	* config/tc-sparc.c (md_pseudo_table): Remove pushsection and
+	popsection.
+
+	* config/tc-sparc.c (sparc_ip): Add default case to reloc switch.
+
+	* read.c (read_a_source_file): Only declare inescape if
+	QUOTES_IN_INSN.
+
+	* itbl-ops.c (itbl_disassemble): Change sprintf format strings to
+	match parameters.
+	(find_entry_byval): Add parens to avoid warning.
+
+	* as.c: If HAVE_ITBL_CPU, include "itbl-ops.h".
+
+	* symbols.c (resolve_symbol_value): Don't permit subtraction of
+	undefined symbols.
+
+1999-06-10  Jakub Jelinek  <jj@ultra.linux.cz>
+
+        * config/tc-sparc.c (sparc_ip): Don't use side-effect expression
+	with isoctal.
+
+	* config/tc-sparc.c (synthetize_setuw, synthetize_setsw,
+	synthetize_setx): New functions.
+	(md_assemble): Broken the special cases into the above
+	functions. Make compiler happy if sizeof(bfd_vma)==4.
+	Fix sethi generated from set/setuw. If instructions have a relloc,
+	always clear the fields to be relocated in the opcode.
+	(sparc_ip): Remove special_case global variable.
+
+1999-06-10  Ian Lance Taylor  <ian@zembu.com>
+
+	Based on patches from John W. Woznack <jwoznack@concentric.net>:
+	* itbl-ops.c (itbl_get_reg_val): Add pval parameter.  Return
+	indication of success rather than a value.
+	(itbl_get_val): Likewise.
+	(itbl_get_field): Use strcspn.  Change delimiters to include
+	parens.
+	* itbl-ops.h (itbl_get_reg_val): Update declaration.
+	(itbl_get_val): Likewise.
+	* config/tc-mips.c (mips_ip): Update call to itbl_get_reg_val.
+
+	* symbols.c (copy_symbol_attributes): Convert local symbols to
+	regular symbols.
+
+1999-06-10  Nick Clifton  <nickc@cygnus.com>
+
+	* config/tc-arm.c (md_parse_option): Add support for ARM920 and
+	ARM920t. 
+
+1999-06-07  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* config/tc-sparc.c (md_assemble): Fix up setx, support setsw.
+	Optimize set if sizeof(bfd_vma) == 64.
+	(sparc_ip): Fix sethi - without %hi() it should generate
+	R_SPARC_22 reloc, not R_SPARC_HI22.
+	(tc_gen_reloc): Handle BFD_RELOC_SPARC22.
+
+1999-06-07  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* config/tc-sparc.c (md_begin): Handle native wordsize aliases.
+	(s_ncons): New function.
+	(native_op_table): New table.
+	(sparc_ip): Be more strict on %hi() etc.; prepare assembler for
+	R_SPARC_OLO10 handling.
+
+Mon Jun  7 10:22:16 1999  Richard Henderson  <rth@cygnus.com>
+
+	* expr.h (struct expressionS): Revert last change; widen X_op.
+	* config/tc-alpha.c (md_begin): Check the field is wide enough.
+
+Mon Jun  7 11:25:16 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* Makefile.am (TARGET_CPU_CFILES): Add config/tc-fr30.c.
+	(TARGET_CPU_HFILES): Add config/tc-fr30.h.
+	(TARG_ENV_HFILES): Add config/te-epoc-pe.h.
+	* Makefile.in: Regenerated.
+
+	* config/obj-elf.c (obj_elf_common): In MRI mode if called as
+	`common' pass on to s_mri_common.
+	(elf_pseudo_table): Pass 1 to obj_elf_common for `common'. 
+
+1999-06-06  Richard Henderson  <rth@cygnus.com>
+
+	* config/obj-elf.c (obj_elf_section): Don't free the return
+	value of demand_copy_C_string.
+
+1999-06-05  Richard Henderson  <rth@cygnus.com>
+
+	* dwarf2dbg.c (dwarf2_gen_line_info): Mirror the section symbol
+	creation logic from obj_elf_create_section.
+
+	* config/obj-elf.c (elf_pseudo_tab): Add pushsection/popsection.
+	(section_stack): New.
+	(special_sections): Make const.
+	(obj_elf_section): Gut and rewrite parsing.
+	(obj_elf_change_section): New function broken out of obj_elf_section.
+	(obj_elf_parse_section_letters): Likewise.
+	(obj_elf_section_word): Likewise.
+	(obj_elf_section_type): Likewise.
+	(obj_elf_previous): Treat as a toggle.
+	(obj_elf_popsection): New.
+	* config/tc-ppc.c (ppc_section_word): Take str+len not ptr_str.
+	(ppc_section_type): Likewise.
+	* config/tc-ppc.h: Likewise.
+
+	* expr.h (struct expressionS): Don't make X_op a bitfield.
+	* config/tc-alpha.c: Update for symbol handling changes.
+	(md_apply_fix) [case GPREL]: Use now_seg instead of absolute_section.
+	(load_expression, emit_ir_load, emit_loadstore, emit_jsrjmp): Likewise.
+
+1999-06-05  Richard Henderson  <rth@cygnus.com>
+
+	* dwarf2dbg.c (*): Convert to K&R + prototypes.
+	(dwarf2_gen_line_info): Kill unused variables.
+	(dwarf2_finish): Likewise.
+	(dwarf2_where): Likewise.
+	(dwarf2_directive_file): If we've only got a string,
+	hand off to s_app_file.
+	* ecoff.c: Move the include of ecoff.h.
+	* symbols.h (S_IS_FUNCTION): Prototype.
+
+	* read.c (LEX_HASH): Supply a default.
+	(lex_type): Use it.
+	(s_globl): Update `c' after skipping whitespace.
+	* read.h (LEX_END_NAME, is_name_ender): New.
+	* expr.c (get_symbol_end): Respect it.
+
+1999-06-04  Mark Klein <mklein@dis.com>
+
+	* config/tc-hppa.c (md_begin): Convert local symbol dummy_symbol
+	to real if OBJ_SOM
+	(tc_gen_reloc): Still need bfd_abs_symbol in some relocs.
+
+	* config/tc-hppa.c: Update for symbol handling changes.
+
+1999-06-03  Ian Lance Taylor  <ian@zembu.com>
+
+	* cgen.c: Update for symbol handling changes.
+	* config/tc-m32r.c: Likewise.
+
+	* config/tc-hppa.h: Update for symbol handling changes.
+	* config/tc-hppa.c: Likewise.
+
+	* config/tc-arm.h: Update for symbol handling changes.
+	* config/tc-arm.c: Likewise.
+	(symbol_make_empty): Remove.  Just use symbol_create.
+
+	* symbols.c (symbol_set_tc): Correct name.
+
+	* Makefile.am: Rebuild dependencies.
+	($(OBJS)): Don't depend upon struc-symbol.h.
+	(.dep1, .tcdep, .objdep): Create itbl-parse.h.
+	* dep-in.sed: Don't remove struc-symbol.h.
+	* Makefile.in: Rebuild.
+
+	* doc/internals.texi (Symbols): Describe changes in symbol
+	handling.
+
+1999-06-03  Richard Henderson  <rth@cygnus.com>
+
+	* dwarf2dbg.c (dwarf2_gen_line_info): Use section_symbol
+	instead of doing the work by hand.
+
+1999-06-03  David Mosberger  <davidm@hpl.hp.com>
+
+	* dwarf2dbg.c (INITIAL_STATE): New macro encapsulating initial
+	state of line state-machine.
+	(struct ls): Collect DWARF2 line state-machine state in new member
+	SM.  Add member EMPTY_SEQUENCE to keep track if a code sequence
+	resulted in any DWARF2 directives.
+	(reset_state_machine): New function.
+	(out_end_sequence): Ditto.
+	(dwarf2_gen_line_info): When switching sections or switching to a
+	lower text address, call out_end_sequence() first to terminate the
+	previous code sequence as code sequences MUST have monotonically
+	increasing addresses.
+	(dwarf2_finish): Call out_end_sequence() instead of open coding it.
+
+1999-06-03  David Mosberger  <davidm@hpl.hp.com>
+
+	* as.c (parse_args): Add option -gdwarf2 to allow requesting
+	DWARF2 debug info (line information only, at this point).
+	* as.h: Update comment about supported debug formats.
+	* dwarf2dbg.c, dwarf2dbg.h: New files.
+	* Makefile.am (GAS_CFILES, HFILES, GENERIC_OBJS): Add them.
+
+	* expr.c (operand): Don't use [ for parens if we want an index op.
+	(op_encoding): Switch [ into O_index, if desired.
+	(op_rank): Renumber with O_index on bottom.
+	(expr): If O_index, match closing bracket.
+	* expr.h (O_index): New.
+
+	* read.c (read_a_source_file): Conditionally allow matched "
+	in lines passed to md_assemble.
+
+	* config/obj-elf.c (elf_pseudo_table): Add `common'.
+
+1999-06-03  Ian Lance Taylor  <ian@zembu.com>
+
+	Add support for storing local symbols in a small structure to save
+	memory when assembling large files.
+	* as.h: Don't include struc-symbol.h.
+	(symbolS): Add typedef.
+	* symbols.c: Include struc-symbol.h.
+	(local_hash): New static variable.
+	(save_symbol_name): New static function, from symbol_create.
+	(symbol_create): Call save_symbol_name.
+	(local_symbol_count): New static variable.
+	(local_symbol_conversion_count): Likewise.
+	(LOCAL_SYMBOL_CHECK): Define.
+	(local_symbol_make): New static function.
+	(local_symbol_convert): New static function.
+	(colon): Handle local symbols.  Create local symbol for local
+	label name.
+	(symbol_table_insert): Handle local symbols.
+	(symbol_find_or_make): Create local symbol for local label name.
+	(symbol_find_base): Check for local symbol.
+	(symbol_append, symbol_insert): Check for local symbols.
+	(symbol_clear_list_pointers, symbol_remove): Likewise.
+	(verify_symbol_chain): Likewise.
+	(copy_symbol_attributes): Likewise.
+	(resolve_symbol_value): Handle local symbols.
+	(resolve_local_symbol): New static function.
+	(resolve_local_symbol_values): New function.
+	(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
+	(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
+	(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
+	(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
+	(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
+	(symbol_previous, symbol_next): New functions.
+	(symbol_get_value_expression): Likewise.
+	(symbol_set_value_expression): Likewise.
+	(symbol_set_frag, symbol_get_frag): Likewise.
+	(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
+	(symbol_mark_used_in_reloc): Likewise.
+	(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
+	(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
+	(symbol_mri_common_p): Likewise.
+	(symbol_mark_written, symbol_clear_written): Likewise.
+	(symbol_written_p): Likewise.
+	(symbol_mark_resolved, symbol_resolved_p): Likewise.
+	(symbol_section_p, symbol_equated_p): Likewise.
+	(symbol_constant_p): Likewise.
+	(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
+	(symbol_get_obj, symbol_set_obj): Likewise.
+	(symbol_get_tc, symbol_set_tc): Likewise.
+	(symbol_begin): Initialize local_hash.
+	(print_symbol_value_1): Handle local symbols.
+	(symbol_print_statistics): Print local symbol statistics.
+	* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
+	Declare new symbols.c functions.  Move many declarations here from
+	struc-symbol.h.
+	(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
+	* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
+	(struct symbol): Move bsym to make it clearly the first field.
+	Remove TARGET_SYMBOL_FIELDS.
+	(symbolS): Don't typedef.
+	(struct broken_word): Remove.
+	(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
+	(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
+	(symbol_clear_list_pointers): Likewise.
+	(symbol_insert, symbol_remove): Likewise.
+	(symbol_previous, symbol_append): Likewise.
+	(verify_symbol_chain, verify_symbol_chain_2): Likewise.
+	(struct local_symbol): Define.
+	(local_symbol_converted_p, local_symbol_mark_converted): Define.
+	(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
+	(local_symbol_get_frag, local_symbol_set_frag): Define.
+	(local_symbol_get_real_symbol): Define.
+	(local_symbol_set_real_symbol): Define.
+	Define.
+	* write.c (write_object_file): Call resolve_local_symbol_values.
+	* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
+	(TARGET_SYMBOL_FIELDS): Don't define.
+	* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field.  If
+	ECOFF_DEBUGGING, add ECOFF fields.
+	(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
+	* config/obj-multi.h (struct elf_obj_sy): Add local field.  If
+	ECOFF_DEBUGGING, add ECOFF fields.
+	(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
+	(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
+	* config/tc-mcore.h: Don't include struc-symbol.h.
+	(TARGET_SYMBOL_FIELDS): Don't define.
+	(struct mcore_tc_sy): Define.
+	(TC_SYMFIELD_TYPE): Define.
+	* Many files: Use symbolS instead of struct symbol.  Use new
+	accessor functions rather than referring to symbolS fields
+	directly.
+
+	* read.c (s_mri_common): Don't add in value of line_label.
+
+	* config/tc-mips.c (md_apply_fix): Correct parenthesization when
+	checking for SEC_LINK_ONCE.
+
+	* config/tc-sh.h (sh_fix_adjustable): Declare.
+
+	* app.c (input_buffer): New static variable.
+	(app_push): Save saved_input in allocated buffer.
+	(app_pop): Restored saved_input.
+	(do_scrub_chars): Change get parameter to take char * and int as
+	arguments.  Change GET macro to pass input_buffer to get
+	function.  Don't save input into allocated buffer.
+	* as.h (do_scrub_chars): Update declaration.
+	* input-file.c (input_file_get): Change to take char * and int.
+	Read data into passed in buffer.  Remove static buffer.
+	* read.c (scrub_from_string): Change to take char * and int.  Copy
+	data into passed in buffer.
+
+	* hash.h: Neaten.  Declare hash_traverse.
+	* hash.c: Complete rewrite based on BFD hashing code.
+	* gasp.c (chunksize): New variable.
+	* macro.c (macro_expand_body): Call hash_jam with NULL rather than
+	hash_delete.
+
+1999-05-28  Nick Clifton  <nickc@cygnus.com>
+
+	* config/tc-arm.c (md_apply_fix3): Add pipeline offset into reloc
+	addend unless the target uses an old ABI.
+
+Mon May 24 13:36:55 1999  Doug Evans  <devans@canuck.cygnus.com>
+
+	-Wchar-subscripts cleanup
+	* listing.c (listing_newline): Use unsigned char variable, so
+ 	calls to isascii,iscntrl are correct.
+	* atof-generic.c (atof_generic): Cast arg to isdigit, et. al. with
+	(unsigned char).
+	* ecoff.c (ecoff_directive_ent,ecoff_stab): Ditto.
+	* config/obj-elf.c (obj_elf_vtable_inherit): Ditto.
+	* config/tc-mips.c (mips_ip,mips16_ip): Ditto.
+	(my_getSmallExpression,get_number,s_mips_ent): Ditto.
+
+1999-05-28  Torbjorn Granlund  <tege@matematik.su.se>
+
+	* config/tc-m68k.c (m68k_ip): Check for disallowed index register
+	width for Coldfire.
+	(arch_coldfire_p): New #define.
+	(m68k_ip, m68k_init_after_args): Use arch_coldfire_p.
+
+1999-05-28  Linus Nordberg  <linus.nordberg@canit.se>
+
+	* config/tc-m68k.c (install_operand): Add places `n', `o'.
+
+	* config/tc-m68k.c (m68k_ip): Add formats `E', `G', `H'.
+	(install_operand): Add place `N'.
+	(init_table): Add registers ACC, MACSR, MASK.
+
+	* config/m68k-parse.h (m68k_register): Add ACC, MACSR, MASK.
+
+	* config/tc-m68k.c: Change mcf5200 --> mcf.
+	(archs): Add mcf5206e, mcf5307.
+	(m68k_ip): Add format `u'.
+	(install_operand): Add place `m', `M', `h'.
+	(init_table): Add upper/lower registers.
+
+	* config/m68k-parse.h (m68k_register): Add upper/lower registers.
+
+1999-05-28  Martin Dorey  <mdorey@madge.com>
+
+	* config/tc-i960.c: Several minor changes to add ELF and
+	BFD_ASSEMBLER support.
+	* config/tc-i960.h: Likewise.
+	* configure.in (i960-*-elf*): New target.
+	* aclocal.m4, configure: Rebuild.
+
+1999-05-25  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* config/tc-i386.c (md_apply_fix3): Only do 1999-05-17 fx_pcrel
+	reloc changes when defined(BFD_ASSEMBLER).
+
+1999-05-17  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* config/tc-i386.c (tc_gen_reloc): Remove F and MAP macros.
+
+	* write.c (write_print_statistics): Output to file, not stderr.
+
+	* expr.c (generic_bignum_to_int32,64): Prototype.
+
+	* read.c (s_lcomm_internal, sizeof_sleb128, sizeof_uleb128,
+	output_sleb128, output_uleb128, output_big_sleb128,
+	output_big_uleb128, output_big_leb128): Prototype.
+	(output_big_sleb128, output_big_uleb128): Make inline.
+	(output_big_leb128): Remove inline
+
+	From Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+	* config/tc-i386.c (md_apply_fix3): Convert BFD_RELOC_16 with
+	fx_pcrel set to BFD_RELOC_16_PCREL.  Similarly for BFD_RELOC_8.
+	Handle BFD_RELOC_16_PCREL and BFD_RELOC_8_PCREL.  Return changed
+	value for correct overflow check in write.c:fixup_segment.
+	* write.c (fixup_segment): Move bitfield overflow checks to after
+	the md_apply_fix call.
+	* config/obj-coff.c (fixup_segment): Likewise.
+	* doc/internals.texi (CPU backend): Mention md_apply_fix modifying
+	valueT *val argument.
+
+Fri May 14 10:52:13 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* config/atof-ieee.c (gen_to_words): Correctly round a
+	denormalized number.  Fix off-by-one in range checking for
+	exponent in a denormal. 
+
+1999-05-10  Nick Clifton  <nickc@cygnus.com>
+
+	* config/tc-mcore.c (parse_reg): Accept 'sp' as a valid register
+	name. 
+
+Thu May 13 09:46:59 1999  Joel Sherrill (joel@OARcorp.com)
+
+	* configure.in (i386-*-rtemself*, sh-*-rtemself*): New targets.
+
+1999-05-12  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* config/tc-i386.h (InvMem): New flag.  Add to AnyMem.
+	(ReverseRegRegmem): Remove.
+	(ImmExt): New flag.  Renumber some of the opcode_modifier bits.
+	* config/tc-i386.c (md_assemble): Test for PIII SIMD and AMD
+	3DNow! via ImmExt opcode_modifier.  Remove ReverseRegRegmem
+	kludge.
+
+	From  Doug Ledford <dledford@redhat.com>
+	* config/tc-i386.h (RegXMM): New for P/III.
+	* config/tc-i386.c: Add support for P/III.
+
+Sat May  8 23:28:50 1999  Richard Henderson  <rth@cygnus.com>
+
+	* config/tc-ppc.c (md_parse_option): Recognize -mppc64bridge.
+	(md_begin): Allow ppc32 insns in ppc64bridge mode.
+	(ppc_insert_operand): Accept SIGNOPT in ppc64 mode.
+
+Thu May  6 23:13:39 1999  Richard Henderson  <rth@cygnus.com>
+
+	* config/tc-i386.c (i386_immediate): Skip whitespace before
+	complaining about junk after expression.
+	(i386_displacement): Likewise.
+
+Thu May  6 19:50:14 1999  Richard Henderson  <rth@cygnus.com>
+
+	* symbols.c (symbol_find_base): Use memcpy instead of strcpy.
+	Don't copy before downcaseing.
+
+1999-05-05  Catherine Moore  <clm@cygnus.com>
+ 
+        * tc-m68k.c: Include elf/m68k.h.
+        (m68k_elf_final_processing): New routine.
+        * tc-m68k.h (elf_tc_final_processing m68k_elf_final_processing):
+        Define.
+ 
+Mon May  3 10:26:03 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* config/tc-hppa.c (md_apply_fix): Handle 22 bit fmt insn like a
+	17 bit fmt insn.
+
 1999-04-30  Nick Clifton  <nickc@cygnus.com>
 
 	* config/tc-mcore.c (mcore_s_section): Dump literals before
diff --git a/gas/Makefile.am b/gas/Makefile.am
index 688f21c..09d5b9d 100644
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -134,6 +134,7 @@
 	bignum-copy.c \
 	cond.c \
 	depend.c \
+	dwarf2dbg.c \
 	ecoff.c \
 	ehopt.c \
 	expr.c \
@@ -164,6 +165,7 @@
 	bignum.h \
 	bit_fix.h \
 	cgen.h \
+	dwarf2dbg.h \
 	ecoff.h \
 	emul-target.h \
 	emul.h \
@@ -194,6 +196,7 @@
 	config/tc-arm.c \
 	config/tc-d10v.c \
 	config/tc-d30v.c \
+	config/tc-fr30.c \
 	config/tc-h8300.c \
 	config/tc-h8500.c \
 	config/tc-hppa.c \
@@ -226,6 +229,7 @@
 	config/tc-arm.h \
 	config/tc-d10v.h \
 	config/tc-d30v.h \
+	config/tc-fr30.h \
 	config/tc-h8300.h \
 	config/tc-h8500.h \
 	config/tc-hppa.h \
@@ -286,6 +290,7 @@
 	config/te-delt88.h \
 	config/te-dpx2.h \
 	config/te-dynix.h \
+	config/te-epoc-pe.h \
 	config/te-generic.h \
 	config/te-go32.h \
 	config/te-hp300.h \
@@ -331,6 +336,7 @@
 	bignum-copy.o \
 	cond.o \
 	depend.o \
+	dwarf2dbg.o \
 	ehopt.o \
 	expr.o \
 	flonum-konst.o \
@@ -416,7 +422,7 @@
 # Stuff that every object file depends upon.  If anything is removed
 # from this list, remove it from dep-in.sed as well.
 $(OBJS): config.h as.h $(TARG_ENV_H) $(OBJ_FORMAT_H) $(TARG_CPU_H) flonum.h \
-	expr.h struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h \
+	expr.h write.h frags.h hash.h read.h symbols.h tc.h \
 	obj.h listing.h bignum.h bit_fix.h $(INCDIR)/libiberty.h asintl.h
 
 gasp_new_SOURCES = gasp.c macro.c sb.c hash.c
@@ -709,6 +715,7 @@
 	echo '' > obj-format.h; \
 	echo '' > targ-env.h; \
 	echo '' > itbl-cpu.h; \
+	echo '' > itbl-parse.h; \
 	echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
 	$(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) $?
 	sed -e '/IF YOU PUT ANYTHING/,$$d' < .depdir/.dep > .dep1
@@ -728,6 +735,7 @@
 	      echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
 	      echo '#include "te-generic.h"' > targ-env.h; \
 	      echo '' > itbl-cpu.h; \
+	      echo '' > itbl-parse.h; \
 	      echo '#include "opcodes/'"$${c}"'-desc.h"' > cgen-desc.h; \
 	      rm -f dummy.c; \
 	      cp $${srcdir}/config/tc-$${c}.c dummy.c; \
@@ -774,6 +782,7 @@
 	      echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
 	      echo '#include "te-generic.h"' > targ-env.h; \
 	      echo '' > itbl-cpu.h; \
+	      echo '' > itbl-parse.h; \
 	      rm -f dummy.c; \
 	      cp $${srcdir}/config/obj-$${o}.c dummy.c; \
 	      echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
@@ -879,14 +888,16 @@
 bignum-copy.o: bignum-copy.c
 cond.o: cond.c macro.h sb.h $(INCDIR)/obstack.h
 depend.o: depend.c
-ecoff.o: ecoff.c
+dwarf2dbg.o: dwarf2dbg.c dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h \
+  $(INCDIR)/elf/dwarf2.h
+ecoff.o: ecoff.c ecoff.h
 ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h
 expr.o: expr.c $(INCDIR)/obstack.h
 flonum-copy.o: flonum-copy.c
 flonum-konst.o: flonum-konst.c
 flonum-mult.o: flonum-mult.c
 frags.o: frags.c subsegs.h $(INCDIR)/obstack.h
-hash.o: hash.c
+hash.o: hash.c $(INCDIR)/obstack.h
 input-file.o: input-file.c input-file.h
 input-scrub.o: input-scrub.c input-file.h sb.h
 listing.o: listing.c input-file.h subsegs.h
@@ -900,9 +911,11 @@
 stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \
   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
 subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h
-symbols.o: symbols.c $(INCDIR)/obstack.h subsegs.h
+symbols.o: symbols.c $(INCDIR)/obstack.h subsegs.h \
+  struc-symbol.h
 write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h
 gasp.o: gasp.c sb.h macro.h
+itbl-ops.o: itbl-ops.c itbl-ops.h itbl-parse.h
 e-i386coff.o: $(srcdir)/config/e-i386coff.c emul.h \
   emul-target.h
 e-i386elf.o: $(srcdir)/config/e-i386elf.c emul.h emul-target.h
@@ -1051,7 +1064,8 @@
 TCDEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/obstack.h \
-  subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
+  subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h \
+  $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h
 TCDEP_m68k_hp300 = $(srcdir)/config/obj-hp300.h $(srcdir)/config/obj-aout.h \
   $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/obstack.h subsegs.h $(INCDIR)/opcode/m68k.h \
diff --git a/gas/Makefile.in b/gas/Makefile.in
index 244fff2..56cacd1 100644
--- a/gas/Makefile.in
+++ b/gas/Makefile.in
@@ -95,6 +95,7 @@
 RANLIB = @RANLIB@
 USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
 USE_NLS = @USE_NLS@
+USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
 VERSION = @VERSION@
 atof = @atof@
 cgen_cpu_prefix = @cgen_cpu_prefix@
@@ -242,6 +243,7 @@
 	bignum-copy.c \
 	cond.c \
 	depend.c \
+	dwarf2dbg.c \
 	ecoff.c \
 	ehopt.c \
 	expr.c \
@@ -273,6 +275,7 @@
 	bignum.h \
 	bit_fix.h \
 	cgen.h \
+	dwarf2dbg.h \
 	ecoff.h \
 	emul-target.h \
 	emul.h \
@@ -304,6 +307,7 @@
 	config/tc-arm.c \
 	config/tc-d10v.c \
 	config/tc-d30v.c \
+	config/tc-fr30.c \
 	config/tc-h8300.c \
 	config/tc-h8500.c \
 	config/tc-hppa.c \
@@ -337,6 +341,7 @@
 	config/tc-arm.h \
 	config/tc-d10v.h \
 	config/tc-d30v.h \
+	config/tc-fr30.h \
 	config/tc-h8300.h \
 	config/tc-h8500.h \
 	config/tc-hppa.h \
@@ -400,6 +405,7 @@
 	config/te-delt88.h \
 	config/te-dpx2.h \
 	config/te-dynix.h \
+	config/te-epoc-pe.h \
 	config/te-generic.h \
 	config/te-go32.h \
 	config/te-hp300.h \
@@ -448,6 +454,7 @@
 	bignum-copy.o \
 	cond.o \
 	depend.o \
+	dwarf2dbg.o \
 	ehopt.o \
 	expr.o \
 	flonum-konst.o \
@@ -748,7 +755,8 @@
 TCDEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/obstack.h \
-  subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
+  subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h \
+  $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h
 
 TCDEP_m68k_hp300 = $(srcdir)/config/obj-hp300.h $(srcdir)/config/obj-aout.h \
   $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
@@ -1605,10 +1613,10 @@
 ../libiberty/libiberty.a
 itbl_test_LDFLAGS = 
 as_new_OBJECTS =  app.o as.o atof-generic.o bignum-copy.o cond.o \
-depend.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o \
-flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o \
-literal.o macro.o messages.o output-file.o read.o sb.o stabs.o \
-subsegs.o symbols.o write.o
+depend.o dwarf2dbg.o ecoff.o ehopt.o expr.o flonum-copy.o \
+flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o \
+listing.o literal.o macro.o messages.o output-file.o read.o sb.o \
+stabs.o subsegs.o symbols.o write.o
 as_new_LDFLAGS = 
 gasp_new_OBJECTS =  gasp.o macro.o sb.o hash.o
 gasp_new_LDFLAGS = 
@@ -1629,7 +1637,7 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = tar
+TAR = gtar
 GZIP_ENV = --best
 SOURCES = $(itbl_test_SOURCES) $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(gasp_new_SOURCES)
 OBJECTS = $(itbl_test_OBJECTS) $(as_new_OBJECTS) $(gasp_new_OBJECTS)
@@ -2029,7 +2037,7 @@
 # Stuff that every object file depends upon.  If anything is removed
 # from this list, remove it from dep-in.sed as well.
 $(OBJS): config.h as.h $(TARG_ENV_H) $(OBJ_FORMAT_H) $(TARG_CPU_H) flonum.h \
-	expr.h struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h \
+	expr.h write.h frags.h hash.h read.h symbols.h tc.h \
 	obj.h listing.h bignum.h bit_fix.h $(INCDIR)/libiberty.h asintl.h
 
 check-DEJAGNU: site.exp
@@ -2278,6 +2286,7 @@
 	echo '' > obj-format.h; \
 	echo '' > targ-env.h; \
 	echo '' > itbl-cpu.h; \
+	echo '' > itbl-parse.h; \
 	echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
 	$(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) $?
 	sed -e '/IF YOU PUT ANYTHING/,$$d' < .depdir/.dep > .dep1
@@ -2297,6 +2306,7 @@
 	      echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
 	      echo '#include "te-generic.h"' > targ-env.h; \
 	      echo '' > itbl-cpu.h; \
+	      echo '' > itbl-parse.h; \
 	      echo '#include "opcodes/'"$${c}"'-desc.h"' > cgen-desc.h; \
 	      rm -f dummy.c; \
 	      cp $${srcdir}/config/tc-$${c}.c dummy.c; \
@@ -2343,6 +2353,7 @@
 	      echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
 	      echo '#include "te-generic.h"' > targ-env.h; \
 	      echo '' > itbl-cpu.h; \
+	      echo '' > itbl-parse.h; \
 	      rm -f dummy.c; \
 	      cp $${srcdir}/config/obj-$${o}.c dummy.c; \
 	      echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
@@ -2448,14 +2459,16 @@
 bignum-copy.o: bignum-copy.c
 cond.o: cond.c macro.h sb.h $(INCDIR)/obstack.h
 depend.o: depend.c
-ecoff.o: ecoff.c
+dwarf2dbg.o: dwarf2dbg.c dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h \
+  $(INCDIR)/elf/dwarf2.h
+ecoff.o: ecoff.c ecoff.h
 ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h
 expr.o: expr.c $(INCDIR)/obstack.h
 flonum-copy.o: flonum-copy.c
 flonum-konst.o: flonum-konst.c
 flonum-mult.o: flonum-mult.c
 frags.o: frags.c subsegs.h $(INCDIR)/obstack.h
-hash.o: hash.c
+hash.o: hash.c $(INCDIR)/obstack.h
 input-file.o: input-file.c input-file.h
 input-scrub.o: input-scrub.c input-file.h sb.h
 listing.o: listing.c input-file.h subsegs.h
@@ -2469,9 +2482,11 @@
 stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \
   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
 subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h
-symbols.o: symbols.c $(INCDIR)/obstack.h subsegs.h
+symbols.o: symbols.c $(INCDIR)/obstack.h subsegs.h \
+  struc-symbol.h
 write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h
 gasp.o: gasp.c sb.h macro.h
+itbl-ops.o: itbl-ops.c itbl-ops.h itbl-parse.h
 e-i386coff.o: $(srcdir)/config/e-i386coff.c emul.h \
   emul-target.h
 e-i386elf.o: $(srcdir)/config/e-i386elf.c emul.h emul-target.h
diff --git a/gas/NEWS b/gas/NEWS
index 0844076..6017d58 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -22,6 +22,8 @@
 
 Texas Instruments c80 (tms320c80) support added.
 
+i960 ELF support added.
+
 Changes in 2.9:
 
 Texas Instruments c30 (tms320c30) support added.
diff --git a/gas/aclocal.m4 b/gas/aclocal.m4
index 1c6d60c..ebbe468 100644
--- a/gas/aclocal.m4
+++ b/gas/aclocal.m4
@@ -160,26 +160,58 @@
 AC_SUBST($1)])
 
 
-# serial 25 AM_PROG_LIBTOOL
-AC_DEFUN(AM_PROG_LIBTOOL,
-[AC_REQUIRE([AM_ENABLE_SHARED])dnl
-AC_REQUIRE([AM_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_RANLIB])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AM_PROG_LD])dnl
-AC_REQUIRE([AM_PROG_NM])dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-dnl
+# serial 35 AC_PROG_LIBTOOL
+AC_DEFUN(AC_PROG_LIBTOOL,
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+
+# Save cache, so that ltconfig can load it
+AC_CACHE_SAVE
+
+# Actually configure libtool.  ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+DLLTOOL="$DLLTOOL" AS="$AS" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+
+# Reload cache, that may have been modified by ltconfig
+AC_CACHE_LOAD
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 AC_SUBST(LIBTOOL)dnl
 
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+AC_DEFUN(AC_LIBTOOL_SETUP,
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_RANLIB])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_SYS_NM_PARSE])dnl
+AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+dnl
+
 # Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
@@ -208,37 +240,46 @@
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
   ;;
 
 *-*-cygwin*)
-  AM_SYS_LIBTOOL_CYGWIN
+  AC_SYS_LIBTOOL_CYGWIN
   ;;
 
 esac
 
-# Actually configure libtool.  ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
-DLLTOOL="$DLLTOOL" AS="$AS" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
-|| AC_MSG_ERROR([libtool configure failed])
+# enable the --disable-libtool-lock switch
 
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
+AC_ARG_ENABLE(libtool-lock,
+[  --disable-libtool-lock  force libtool not to do file locking],
+need_locks=$enableval,
+need_locks=yes)
+
+if test x"$need_locks" = xno; then
+  libtool_flags="$libtool_flags --disable-lock"
+fi
 ])
 
-# AM_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# AC_LIBTOOL_DLOPEN - check for dlopen support
+AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
 #   `yes'.
-AC_DEFUN(AM_ENABLE_SHARED,
-[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_SHARED,
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
 AC_ARG_ENABLE(shared,
 changequote(<<, >>)dnl
-<<  --enable-shared[=PKGS]  build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
+<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
 changequote([, ])dnl
 [p=${PACKAGE-default}
 case "$enableval" in
@@ -256,26 +297,22 @@
   IFS="$ac_save_ifs"
   ;;
 esac],
-enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
 ])
 
-# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN(AM_DISABLE_SHARED,
-[AM_ENABLE_SHARED(no)])
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AC_DISABLE_SHARED,
+[AC_ENABLE_SHARED(no)])
 
-# AM_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AM_DISABLE_STATIC,
-[AM_ENABLE_STATIC(no)])
-
-# AM_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
 #   `yes'.
-AC_DEFUN(AM_ENABLE_STATIC,
-[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_STATIC,
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
 AC_ARG_ENABLE(static,
 changequote(<<, >>)dnl
-<<  --enable-static[=PKGS]  build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
+<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
 changequote([, ])dnl
 [p=${PACKAGE-default}
 case "$enableval" in
@@ -293,28 +330,74 @@
   IFS="$ac_save_ifs"
   ;;
 esac],
-enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
 ])
 
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AC_DISABLE_STATIC,
+[AC_ENABLE_STATIC(no)])
 
-# AM_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN(AM_PROG_LD,
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN(AC_ENABLE_FAST_INSTALL,
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+  enable_fast_install=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+])
+
+# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN(AC_DISABLE_FAST_INSTALL,
+[AC_ENABLE_FAST_INSTALL(no)])
+
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AC_PROG_LD,
 [AC_ARG_WITH(gnu-ld,
 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   AC_MSG_CHECKING([for ld used by GCC])
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
-  # Accept absolute paths.
+    # Accept absolute paths.
 changequote(,)dnl
-  /* | [A-Za-z]:\\*)
+    /* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
 changequote([,])dnl
-    test -z "$LD" && LD="$ac_prog"
-    ;;
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
   "")
     # If it fails, then pretend we aren't using GCC.
     ac_prog=ld
@@ -342,7 +425,7 @@
       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
 	test "$with_gnu_ld" != no && break
       else
-        test "$with_gnu_ld" != yes && break
+	test "$with_gnu_ld" != yes && break
       fi
     fi
   done
@@ -358,10 +441,10 @@
 fi
 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 AC_SUBST(LD)
-AM_PROG_LD_GNU
+AC_PROG_LD_GNU
 ])
 
-AC_DEFUN(AM_PROG_LD_GNU,
+AC_DEFUN(AC_PROG_LD_GNU,
 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
@@ -371,8 +454,8 @@
 fi])
 ])
 
-# AM_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN(AM_PROG_NM,
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AC_PROG_NM,
 [AC_MSG_CHECKING([for BSD-compatible nm])
 AC_CACHE_VAL(ac_cv_path_NM,
 [if test -n "$NM"; then
@@ -380,20 +463,22 @@
   ac_cv_path_NM="$NM"
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/nm; then
       # Check to see if the nm accepts a BSD-compat flag.
       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
       #   nm: unknown option "B" ignored
       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-        ac_cv_path_NM="$ac_dir/nm -B"
+	ac_cv_path_NM="$ac_dir/nm -B"
+	break
       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-        ac_cv_path_NM="$ac_dir/nm -p"
+	ac_cv_path_NM="$ac_dir/nm -p"
+	break
       else
-        ac_cv_path_NM="$ac_dir/nm"
+	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+	continue # so that we can try to find one that supports BSD flags
       fi
-      break
     fi
   done
   IFS="$ac_save_ifs"
@@ -404,12 +489,280 @@
 AC_SUBST(NM)
 ])
 
-# AM_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
-AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN,
+# AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
+# by C symbol name from nm.
+AC_DEFUN(AC_SYS_NM_PARSE,
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output])
+AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
+[# These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix.  What could be older than Ultrix?!! ;)}
+
+changequote(,)dnl
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+  ac_symcode='[BCDT]'
+  ;;
+cygwin* | mingw*)
+  ac_symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+  ;;
+irix*)
+  ac_symcode='[BCDEGRST]'
+  ;;
+solaris*)
+  ac_symcode='[BDT]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+  ac_symcode='[ABCDGISTW]'
+fi
+changequote([,])dnl
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($ac_symcode\)[ 	][ 	]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  ac_pipe_works=no
+  rm -f conftest.$ac_ext
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    ac_nlist=conftest.nm
+  
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+
+      # Try sorting and uniquifying the output.
+      if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+	mv -f "$ac_nlist"T "$ac_nlist"
+      else
+	rm -f "$ac_nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+	if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+	  cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+	  cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+changequote(,)dnl
+lt_preloaded_symbols[] =
+changequote([,])dnl
+{
+EOF
+	sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+	cat <<\EOF >> conftest.c
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftestm.$ac_objext
+	  ac_save_LIBS="$LIBS"
+	  ac_save_CFLAGS="$CFLAGS"
+	  LIBS="conftestm.$ac_objext"
+	  CFLAGS="$CFLAGS$no_builtin_flag"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest; then
+	    ac_pipe_works=yes
+	  else
+	    echo "configure: failed program was:" >&AC_FD_CC
+	    cat conftest.c >&AC_FD_CC
+	  fi
+	  LIBS="$ac_save_LIBS"
+	  CFLAGS="$ac_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+	fi
+      else
+	echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
+      fi
+    else
+      echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+    fi
+  else
+    echo "$progname: failed program was:" >&AC_FD_CC
+    cat conftest.c >&AC_FD_CC
+  fi
+  rm -rf conftest*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$ac_pipe_works" = yes; then
+    if test x"$ac_symprfx" = x"_"; then
+      ac_cv_sys_symbol_underscore=yes
+    else
+      ac_cv_sys_symbol_underscore=no
+    fi
+    break
+  else
+    ac_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+   ac_result=no
+fi
+AC_MSG_RESULT($ac_result)
+])
+
+# AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
+AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
 AC_CHECK_TOOL(AS, as, false)
 ])
 
+# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
+#                            with an underscore?
+AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
+[AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_SYS_NM_PARSE])dnl
+AC_MSG_CHECKING([for _ prefix in compiled symbols])
+AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
+[ac_cv_sys_symbol_underscore=no
+cat > conftest.$ac_ext <<EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+EOF
+if AC_TRY_EVAL(ac_compile); then
+  # Now try to grab the symbols.
+  ac_nlist=conftest.nm
+  if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+    # See whether the symbols have a leading underscore.
+    if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+      ac_cv_sys_symbol_underscore=yes
+    else
+      if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+	:
+      else
+	echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+      fi
+    fi
+  else
+    echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+  fi
+else
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat conftest.c >&AC_FD_CC
+fi
+rm -rf conftest*
+])
+AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
+USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
+AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
+])
+
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN(AC_CHECK_LIBM, [
+AC_CHECK_LIB(mw, _mwvalidcheckl)
+AC_CHECK_LIB(m, cos)
+])
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library, adds --enable-ltdl-convenience to
+# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
+  case "$enable_ltdl_convenience" in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+])
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library, and adds --enable-ltdl-install to
+# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
+  AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
+    case "$enable_ltdl_install" in
+    no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
+    "") enable_ltdl_install=yes
+        ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
+    esac
+  ])
+  if test x"$enable_ltdl_install" != x"no"; then
+    LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+  fi
+])
+
+dnl old names
+AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
+AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
+AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
+AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
+AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
+
 # Like AC_CONFIG_HEADER, but automatically create stamp file.
 
 AC_DEFUN(AM_CONFIG_HEADER,
diff --git a/gas/app.c b/gas/app.c
index 2a8df3a..0494aec 100644
--- a/gas/app.c
+++ b/gas/app.c
@@ -191,6 +191,7 @@
 static int add_newlines;
 static char *saved_input;
 static int saved_input_len;
+static char input_buffer[32 * 1024];
 static const char *mri_state;
 static char mri_last_ch;
 
@@ -227,8 +228,14 @@
   saved->out_string = out_string;
   memcpy (saved->out_buf, out_buf, sizeof (out_buf));
   saved->add_newlines = add_newlines;
-  saved->saved_input = saved_input;
-  saved->saved_input_len = saved_input_len;
+  if (saved_input == NULL)
+    saved->saved_input = NULL;
+  else
+    {
+      saved->saved_input = xmalloc (saved_input_len);
+      memcpy (saved->saved_input, saved_input, saved_input_len);
+      saved->saved_input_len = saved_input_len;
+    }
   saved->scrub_m68k_mri = scrub_m68k_mri;
   saved->mri_state = mri_state;
   saved->mri_last_ch = mri_last_ch;
@@ -256,8 +263,16 @@
   out_string = saved->out_string;
   memcpy (out_buf, saved->out_buf, sizeof (out_buf));
   add_newlines = saved->add_newlines;
-  saved_input = saved->saved_input;
-  saved_input_len = saved->saved_input_len;
+  if (saved->saved_input == NULL)
+    saved_input = NULL;
+  else
+    {
+      assert (saved->saved_input_len <= (int) (sizeof input_buffer));
+      memcpy (input_buffer, saved->saved_input, saved->saved_input_len);
+      saved_input = input_buffer;
+      saved_input_len = saved->saved_input_len;
+      free (saved->saved_input);
+    }
   scrub_m68k_mri = saved->scrub_m68k_mri;
   mri_state = saved->mri_state;
   mri_last_ch = saved->mri_last_ch;
@@ -308,7 +323,7 @@
 
 int
 do_scrub_chars (get, tostart, tolen)
-     int (*get) PARAMS ((char **));
+     int (*get) PARAMS ((char *, int));
      char *tostart;
      int tolen;
 {
@@ -357,18 +372,15 @@
 
   /* This macro gets the next input character.  */
 
-#define GET()				\
-  (from < fromend			\
-   ? * (unsigned char *) (from++)	\
-   : ((saved_input != NULL		\
-       ? (free (saved_input),		\
-	  saved_input = NULL,		\
-	  0)				\
-       : 0),				\
-      fromlen = (*get) (&from),		\
-      fromend = from + fromlen,		\
-      (fromlen == 0			\
-       ? EOF				\
+#define GET()							\
+  (from < fromend						\
+   ? * (unsigned char *) (from++)				\
+   : (saved_input = NULL,					\
+      fromlen = (*get) (input_buffer, sizeof input_buffer),	\
+      from = input_buffer,					\
+      fromend = from + fromlen,					\
+      (fromlen == 0						\
+       ? EOF							\
        : * (unsigned char *) (from++))))
 
   /* This macro pushes a character back on the input stream.  */
@@ -400,9 +412,10 @@
     }
   else
     {
-      fromlen = (*get) (&from);
+      fromlen = (*get) (input_buffer, sizeof input_buffer);
       if (fromlen == 0)
 	return 0;
+      from = input_buffer;
       fromend = from + fromlen;
     }
 
@@ -1232,23 +1245,12 @@
      processed.  */
   if (fromend > from)
     {
-      char *save;
-
-      save = (char *) xmalloc (fromend - from);
-      memcpy (save, from, fromend - from);
-      if (saved_input != NULL)
-	free (saved_input);
-      saved_input = save;
+      saved_input = from;
       saved_input_len = fromend - from;
     }
   else
-    {
-      if (saved_input != NULL)
-	{
-	  free (saved_input);
-	  saved_input = NULL;
-	}
-    }
+    saved_input = NULL;
+
   return to - tostart;
 }
 
diff --git a/gas/as.c b/gas/as.c
index 0cdd357..f27a3fe 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -44,7 +44,9 @@
 #include "sb.h"
 #include "macro.h"
 
-#ifndef HAVE_ITBL_CPU
+#ifdef HAVE_ITBL_CPU
+#include "itbl-ops.h"
+#else
 #define itbl_parse(itbl_file) 1
 #define itbl_init()
 #endif
@@ -143,6 +145,7 @@
     m   include macro expansions\n\
     n   omit forms processing\n\
     s   include symbols\n\
+    L   include line debug statistics (if applicable)\n\
     =file set listing file name (must be last sub-option)\n"));
   
   fprintf (stream, _("\
@@ -365,7 +368,9 @@
 #define OPTION_STRIP_LOCAL_ABSOLUTE (OPTION_STD_BASE + 15)
     {"strip-local-absolute", no_argument, NULL, OPTION_STRIP_LOCAL_ABSOLUTE},
 #define OPTION_TRADITIONAL_FORMAT (OPTION_STD_BASE + 16)
-    {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT}
+    {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
+#define OPTION_GDWARF2 (OPTION_STD_BASE + 17)
+    {"gdwarf2", no_argument, NULL, OPTION_GDWARF2}
   };
 
   /* Construct the option lists from the standard list and the
@@ -546,6 +551,10 @@
 	  debug_type = DEBUG_STABS;
 	  break;
  
+	case OPTION_GDWARF2:
+	  debug_type = DEBUG_DWARF2;
+	  break;
+
 	case 'J':
 	  flag_signed_overflow_ok = 1;
 	  break;
diff --git a/gas/as.h b/gas/as.h
index a72dfad..e72902b 100644
--- a/gas/as.h
+++ b/gas/as.h
@@ -1,5 +1,5 @@
 /* as.h - global header file
-   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -457,7 +457,7 @@
 extern int listing;
 
 /* Type of debugging information we should generate.  We currently
-   only support stabs and ECOFF.  */
+   support stabs, ECOFF, and DWARF2.  */
 
 enum debug_info_type
   {
@@ -559,7 +559,7 @@
 char *input_scrub_include_file PARAMS ((char *filename, char *position));
 char *input_scrub_new_file PARAMS ((char *filename));
 char *input_scrub_next_buffer PARAMS ((char **bufp));
-int do_scrub_chars PARAMS ((int (*get) (char **), char *to, int tolen));
+int do_scrub_chars PARAMS ((int (*get) (char *, int), char *to, int tolen));
 int gen_to_words PARAMS ((LITTLENUM_TYPE * words, int precision,
 			  long exponent_bits));
 int had_err PARAMS ((void));
@@ -585,6 +585,7 @@
 #ifdef BFD_ASSEMBLER
 segT subseg_get PARAMS ((const char *, int));
 #endif
+int subseg_text_p PARAMS ((segT));
 
 void start_dependencies PARAMS ((char *));
 void register_dependency PARAMS ((char *));
@@ -592,13 +593,13 @@
 
 struct expressionS;
 struct fix;
-struct symbol;
+typedef struct symbol symbolS;
 struct relax_type;
 typedef struct frag fragS;
 
 #ifdef BFD_ASSEMBLER
 /* literal.c */
-valueT add_to_literal_pool PARAMS ((struct symbol *, valueT, segT, int));
+valueT add_to_literal_pool PARAMS ((symbolS *, valueT, segT, int));
 #endif
 
 int check_eh_frame PARAMS ((struct expressionS *, unsigned int *));
@@ -611,7 +612,6 @@
 /* this one starts the chain of target dependant headers */
 #include "targ-env.h"
 
-#include "struc-symbol.h"
 #include "write.h"
 #include "frags.h"
 #include "hash.h"
diff --git a/gas/atof-generic.c b/gas/atof-generic.c
index 316f665..de29f21 100644
--- a/gas/atof-generic.c
+++ b/gas/atof-generic.c
@@ -220,7 +220,7 @@
 	    && (!c || !strchr (string_of_decimal_exponent_marks, c)));
 	   p++)
 	{
-	  if (isdigit (c))
+	  if (isdigit ((unsigned char) c))
 	    {
 	      /* This may be retracted below. */
 	      number_of_digits_after_decimal++;
diff --git a/gas/cgen.c b/gas/cgen.c
index 3d2330e..e15e1b6 100644
--- a/gas/cgen.c
+++ b/gas/cgen.c
@@ -649,7 +649,8 @@
 
   assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
 
-  reloc->sym_ptr_ptr = & fixP->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
 
   /* Use fx_offset for these cases */
   if (   fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY
diff --git a/gas/cond.c b/gas/cond.c
index 71a2a8e..943c9f6 100644
--- a/gas/cond.c
+++ b/gas/cond.c
@@ -1,5 +1,5 @@
 /* cond.c - conditional assembly pseudo-ops, and .include
-   Copyright (C) 1990, 91, 92, 93, 95, 96, 97, 1998
+   Copyright (C) 1990, 91, 92, 93, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -64,7 +64,7 @@
      int arg;
 {
   register char *name;		/* points to name of symbol */
-  register struct symbol *symbolP;	/* Points to symbol */
+  register symbolS *symbolP;	/* Points to symbol */
   struct conditional_frame cframe;
 
   SKIP_WHITESPACE ();		/* Leading whitespace is part of operand. */
@@ -248,7 +248,7 @@
 
 void 
 s_endif (arg)
-     int arg;
+     int arg ATTRIBUTE_UNUSED;
 {
   struct conditional_frame *hold;
 
@@ -280,7 +280,7 @@
 
 void 
 s_else (arg)
-     int arg;
+     int arg ATTRIBUTE_UNUSED;
 {
   if (current_cframe == NULL)
     {
diff --git a/gas/config/atof-ieee.c b/gas/config/atof-ieee.c
index d586e3a..fbf0ffb 100644
--- a/gas/config/atof-ieee.c
+++ b/gas/config/atof-ieee.c
@@ -460,7 +460,7 @@
 	  /* Bigger than one littlenum */
 	  num_bits -= (LITTLENUM_NUMBER_OF_BITS - 1) - exponent_bits;
 	  *lp++ = word1;
-	  if (num_bits + exponent_bits + 1 >= precision * LITTLENUM_NUMBER_OF_BITS)
+	  if (num_bits + exponent_bits + 1 > precision * LITTLENUM_NUMBER_OF_BITS)
 	    {
 	      /* Exponent overflow */
 	      make_invalid_floating_point_number (words);
@@ -501,7 +501,7 @@
       if (next_bits (1))
 	{
 	  --lp;
-	  if (prec_bits > LITTLENUM_NUMBER_OF_BITS)
+	  if (prec_bits >= LITTLENUM_NUMBER_OF_BITS)
 	    {
 	      int n = 0;
 	      int tmp_bits;
@@ -515,7 +515,19 @@
 		  --n;
 		  tmp_bits -= LITTLENUM_NUMBER_OF_BITS;
 		}
-	      if (tmp_bits > LITTLENUM_NUMBER_OF_BITS || (lp[n] & mask[tmp_bits]) != mask[tmp_bits])
+	      if (tmp_bits > LITTLENUM_NUMBER_OF_BITS
+		  || (lp[n] & mask[tmp_bits]) != mask[tmp_bits]
+		  || (prec_bits != (precision * LITTLENUM_NUMBER_OF_BITS
+				    - exponent_bits - 1)
+#ifdef TC_I386
+		      /* An extended precision float with only the integer
+			 bit set would be invalid.  That must be converted
+			 to the smallest normalized number.  */
+		      && !(precision == X_PRECISION
+			   && prec_bits == (precision * LITTLENUM_NUMBER_OF_BITS
+					    - exponent_bits - 2))
+#endif
+		      ))
 		{
 		  unsigned long carry;
 
@@ -539,11 +551,18 @@
 			    << ((LITTLENUM_NUMBER_OF_BITS - 1)
 				- exponent_bits));
 		  *lp++ = word1;
+#ifdef TC_I386
+		  /* Set the integer bit in the extended precision format.
+		     This cannot happen on the m68k where the mantissa
+		     just overflows into the integer bit above.  */
+		  if (precision == X_PRECISION)
+		    *lp++ = 1 << (LITTLENUM_NUMBER_OF_BITS - 1);
+#endif
 		  while (lp < words_end)
 		    *lp++ = 0;
 		}
 	    }
-	  else if ((*lp & mask[prec_bits]) != mask[prec_bits])
+	  else
 	    *lp += 1;
 	}
 
diff --git a/gas/config/m68k-parse.h b/gas/config/m68k-parse.h
index e131342..cdb5f60 100644
--- a/gas/config/m68k-parse.h
+++ b/gas/config/m68k-parse.h
@@ -1,5 +1,6 @@
 /* m68k-parse.h -- header file for m68k assembler
-   Copyright (C) 1987, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1987, 91, 92, 93, 94, 95, 96, 1999
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -83,6 +84,9 @@
   ZPC,				/* Hack for Program space, but 0 addressing */
   SR,				/* Status Reg */
   CCR,				/* Condition code Reg */
+  ACC,				/* Accumulator Reg */
+  MACSR,			/* MAC Status Reg */
+  MASK,				/* Modulus Reg */
 
   /* These have to be grouped together for the movec instruction to work. */
   USP,				/*  User Stack Pointer */
@@ -165,6 +169,44 @@
   ZADDR5,
   ZADDR6,
   ZADDR7,
+
+  /* Upper and lower half of data and address registers.  Order *must*
+     be DATAxL, ADDRxL, DATAxU, ADDRxU. */
+  DATA0L,			/* lower half of data registers */
+  DATA1L,
+  DATA2L,
+  DATA3L,
+  DATA4L,
+  DATA5L,
+  DATA6L,
+  DATA7L,
+
+  ADDR0L,			/* lower half of address registers */
+  ADDR1L,
+  ADDR2L,
+  ADDR3L,
+  ADDR4L,
+  ADDR5L,
+  ADDR6L,
+  ADDR7L,
+
+  DATA0U,			/* upper half of data registers */
+  DATA1U,
+  DATA2U,
+  DATA3U,
+  DATA4U,
+  DATA5U,
+  DATA6U,
+  DATA7U,
+
+  ADDR0U,			/* upper half of address registers */
+  ADDR1U,
+  ADDR2U,
+  ADDR3U,
+  ADDR4U,
+  ADDR5U,
+  ADDR6U,
+  ADDR7U,
 };
 
 /* Size information.  */
diff --git a/gas/config/obj-aout.c b/gas/config/obj-aout.c
index b519347..4b4f4d8 100644
--- a/gas/config/obj-aout.c
+++ b/gas/config/obj-aout.c
@@ -1,5 +1,5 @@
 /* a.out object file format
-   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
@@ -14,9 +14,10 @@
 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 GAS; see the file COPYING.  If not, write
-to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+You should have received a copy of the GNU General Public License
+along with GAS; see the file COPYING.  If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
 
 #include "as.h"
 #ifdef BFD_ASSEMBLER
@@ -108,18 +109,21 @@
   asection *sec;
   int desc, type, other;
 
-  flags = sym->bsym->flags;
+  flags = symbol_get_bfdsym (sym)->flags;
   desc = S_GET_DESC (sym);
   type = S_GET_TYPE (sym);
   other = S_GET_OTHER (sym);
-  sec = sym->bsym->section;
+  sec = S_GET_SEGMENT (sym);
 
   /* Only frob simple symbols this way right now.  */
   if (! (type & ~ (N_TYPE | N_EXT)))
     {
       if (type == (N_UNDF | N_EXT)
 	  && sec == &bfd_abs_section)
-	sym->bsym->section = sec = bfd_und_section_ptr;
+	{
+	  sec = bfd_und_section_ptr;
+	  S_SET_SEGMENT (sym, sec);
+	}
 
       if ((type & N_TYPE) != N_INDR
 	  && (type & N_TYPE) != N_SETA
@@ -141,7 +145,7 @@
 	case N_SETB:
 	  /* Set the debugging flag for constructor symbols so that
 	     BFD leaves them alone.  */
-	  sym->bsym->flags |= BSF_DEBUGGING;
+	  symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
 
 	  /* You can't put a common symbol in a set.  The way a set
 	     element works is that the symbol has a definition and a
@@ -164,29 +168,29 @@
 	  break;
 	case N_INDR:
 	  /* Put indirect symbols in the indirect section.  */
-	  sym->bsym->section = bfd_ind_section_ptr;
-	  sym->bsym->flags |= BSF_INDIRECT;
+	  S_SET_SEGMENT (sym, bfd_ind_section_ptr);
+	  symbol_get_bfdsym (sym)->flags |= BSF_INDIRECT;
 	  if (type & N_EXT)
 	    {
-	      sym->bsym->flags |= BSF_EXPORT;
-	      sym->bsym->flags &=~ BSF_LOCAL;
+	      symbol_get_bfdsym (sym)->flags |= BSF_EXPORT;
+	      symbol_get_bfdsym (sym)->flags &=~ BSF_LOCAL;
 	    }
 	  break;
 	case N_WARNING:
 	  /* Mark warning symbols.  */
-	  sym->bsym->flags |= BSF_WARNING;
+	  symbol_get_bfdsym (sym)->flags |= BSF_WARNING;
 	  break;
 	}
     }
   else
     {
-      sym->bsym->flags |= BSF_DEBUGGING;
+      symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
     }
 
   S_SET_TYPE (sym, type);
 
   /* Double check weak symbols.  */
-  if (sym->bsym->flags & BSF_WEAK)
+  if (S_IS_WEAK (sym))
     {
       if (S_IS_COMMON (sym))
 	as_bad (_("Symbol `%s' can not be both weak and common"),
@@ -215,7 +219,7 @@
   assert (x == true);
 }
 
-#else
+#else /* ! BFD_ASSEMBLER */
 
 /* Relocation. */
 
@@ -291,7 +295,7 @@
 #endif /* CROSS_COMPILE */
 
 }
-#endif
+#endif /* ! defined (obj_header_append) */
 
 void
 obj_symbol_to_chars (where, symbolP)
@@ -508,7 +512,7 @@
 	    }
 	  else			/* .Stabd case. */
 	    symbolP->sy_name_offset = 0;
-	  symbolPP = &(symbol_next (symbolP));
+	  symbolPP = &symbolP->sy_next;
 	}
       else
 	{
diff --git a/gas/config/obj-aout.h b/gas/config/obj-aout.h
index 339070e..2cf33fd 100644
--- a/gas/config/obj-aout.h
+++ b/gas/config/obj-aout.h
@@ -1,5 +1,5 @@
 /* obj-aout.h, a.out object file format for gas, the assembler.
-   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 1998
+   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -60,18 +60,24 @@
 
 #ifdef BFD_ASSEMBLER
 
-#define S_SET_OTHER(S,V)		(aout_symbol((S)->bsym)->other = (V))
-#define S_SET_TYPE(S,T)			(aout_symbol((S)->bsym)->type = (T))
-#define S_SET_DESC(S,D)			(aout_symbol((S)->bsym)->desc = (D))
-#define S_GET_OTHER(S)			(aout_symbol((S)->bsym)->other)
-#define S_GET_TYPE(S)			(aout_symbol((S)->bsym)->type)
-#define S_GET_DESC(S)			(aout_symbol((S)->bsym)->desc)
+#define S_SET_OTHER(S,V) \
+  (aout_symbol (symbol_get_bfdsym (S))->other = (V))
+#define S_SET_TYPE(S,T) \
+  (aout_symbol (symbol_get_bfdsym (S))->type = (T))
+#define S_SET_DESC(S,D)	\
+  (aout_symbol (symbol_get_bfdsym (S))->desc = (D))
+#define S_GET_OTHER(S) \
+  (aout_symbol (symbol_get_bfdsym (S))->other)
+#define S_GET_TYPE(S) \
+  (aout_symbol (symbol_get_bfdsym (S))->type)
+#define S_GET_DESC(S) \
+  (aout_symbol (symbol_get_bfdsym (S))->desc)
 
 asection *text_section, *data_section, *bss_section;
 
 #define obj_frob_symbol(S,PUNT)	obj_aout_frob_symbol (S, &PUNT)
 #define obj_frob_file()		obj_aout_frob_file ()
-extern void obj_aout_frob_symbol PARAMS ((struct symbol *, int *));
+extern void obj_aout_frob_symbol PARAMS ((symbolS *, int *));
 extern void obj_aout_frob_file PARAMS ((void));
 
 #define obj_sec_sym_ok_for_reloc(SEC)	(1)
diff --git a/gas/config/obj-bout.c b/gas/config/obj-bout.c
index c9b80f5..dc79718 100644
--- a/gas/config/obj-bout.c
+++ b/gas/config/obj-bout.c
@@ -14,9 +14,10 @@
    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 GAS; see the file COPYING.  If not, write
-   to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+   You should have received a copy of the GNU General Public License
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA. */
 
 #include "as.h"
 #include "obstack.h"
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index 5639fbe..781d23d 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -1,5 +1,5 @@
 /* coff object file format
-   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS.
@@ -249,8 +249,8 @@
 {
   combined_entry_type *entry, *p;
 
-  entry = &coffsymbol (sym->bsym)->native[1];
-  p = coffsymbol (val->bsym)->native;
+  entry = &coffsymbol (symbol_get_bfdsym (sym))->native[1];
+  p = coffsymbol (symbol_get_bfdsym (val))->native;
   entry->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p = p;
   entry->fix_end = 1;
 }
@@ -262,8 +262,8 @@
 {
   combined_entry_type *entry, *p;
 
-  entry = &coffsymbol (sym->bsym)->native[1];
-  p = coffsymbol (val->bsym)->native;
+  entry = &coffsymbol (symbol_get_bfdsym (sym))->native[1];
+  p = coffsymbol (symbol_get_bfdsym (val))->native;
   entry->u.auxent.x_sym.x_tagndx.p = p;
   entry->fix_tag = 1;
 }
@@ -272,7 +272,7 @@
 S_GET_DATA_TYPE (sym)
      symbolS *sym;
 {
-  return coffsymbol (sym->bsym)->native->u.syment.n_type;
+  return coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_type;
 }
 
 int
@@ -280,7 +280,7 @@
      symbolS *sym;
      int val;
 {
-  coffsymbol (sym->bsym)->native->u.syment.n_type = val;
+  coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_type = val;
   return val;
 }
 
@@ -288,7 +288,7 @@
 S_GET_STORAGE_CLASS (sym)
      symbolS *sym;
 {
-  return coffsymbol (sym->bsym)->native->u.syment.n_sclass;
+  return coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_sclass;
 }
 
 int
@@ -296,7 +296,7 @@
      symbolS *sym;
      int val;
 {
-  coffsymbol (sym->bsym)->native->u.syment.n_sclass = val;
+  coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_sclass = val;
   return val;
 }
 
@@ -339,7 +339,7 @@
   S_SET_STORAGE_CLASS (symbolP, C_FILE);
   S_SET_NUMBER_AUXILIARY (symbolP, 1);
 
-  symbolP->bsym->flags = BSF_DEBUGGING;
+  symbol_get_bfdsym (symbolP)->flags = BSF_DEBUGGING;
 
 #ifndef NO_LISTING
   {
@@ -385,7 +385,7 @@
   char * s  = (char *) xmalloc (sz);
   
   memset (s, 0, sz);
-  coffsymbol (symbolP->bsym)->native = (combined_entry_type *) s;
+  coffsymbol (symbol_get_bfdsym (symbolP))->native = (combined_entry_type *) s;
 
   S_SET_DATA_TYPE (symbolP, T_NULL);
   S_SET_STORAGE_CLASS (symbolP, 0);
@@ -434,7 +434,8 @@
 {
   if (line_nos)
     {
-      coffsymbol (current_lineno_sym->bsym)->lineno = (alent *) line_nos;
+      coffsymbol (symbol_get_bfdsym (current_lineno_sym))->lineno =
+	(alent *) line_nos;
       coff_n_line_nos++;
       line_nos = 0;
     }
@@ -532,7 +533,7 @@
 
   /* Initialize the new symbol */
   def_symbol_in_progress = symbol_make (symbol_name_copy);
-  def_symbol_in_progress->sy_frag = &zero_address_frag;
+  symbol_set_frag (def_symbol_in_progress, &zero_address_frag);
   S_SET_VALUE (def_symbol_in_progress, 0);
 
   if (S_IS_STRING (def_symbol_in_progress))
@@ -585,7 +586,7 @@
 	CONST char *name;
 	S_SET_SEGMENT (def_symbol_in_progress, text_section);
 
-	name = bfd_asymbol_name (def_symbol_in_progress->bsym);
+	name = S_GET_NAME (def_symbol_in_progress);
 	if (name[1] == 'b' && name[2] == 'f')
 	  {
 	    if (! in_function ())
@@ -909,17 +910,19 @@
 #endif
       if (!strcmp (symbol_name, "."))
 	{
-	  def_symbol_in_progress->sy_frag = frag_now;
+	  symbol_set_frag (def_symbol_in_progress, frag_now);
 	  S_SET_VALUE (def_symbol_in_progress, (valueT) frag_now_fix ());
 	  /* If the .val is != from the .def (e.g. statics) */
 	}
       else if (strcmp (S_GET_NAME (def_symbol_in_progress), symbol_name))
 	{
-	  def_symbol_in_progress->sy_value.X_op = O_symbol;
-	  def_symbol_in_progress->sy_value.X_add_symbol =
-	    symbol_find_or_make (symbol_name);
-	  def_symbol_in_progress->sy_value.X_op_symbol = NULL;
-	  def_symbol_in_progress->sy_value.X_add_number = 0;
+	  expressionS exp;
+
+	  exp.X_op = O_symbol;
+	  exp.X_add_symbol = symbol_find_or_make (symbol_name);
+	  exp.X_op_symbol = NULL;
+	  exp.X_add_number = 0;
+	  symbol_set_value_expression (def_symbol_in_progress, &exp);
 
 	  /* If the segment is undefined when the forward reference is
 	     resolved, then copy the segment id from the forward
@@ -1034,7 +1037,8 @@
 	      coff_last_function = symp;
 	      if (S_GET_NUMBER_AUXILIARY (symp) < 1)
 		S_SET_NUMBER_AUXILIARY (symp, 1);
-	      auxp = &coffsymbol (symp->bsym)->native[1].u.auxent;
+	      auxp =
+		&coffsymbol (symbol_get_bfdsym (symp))->native[1].u.auxent;
 	      memset (auxp->x_sym.x_fcnary.x_ary.x_dimen, 0,
 		      sizeof (auxp->x_sym.x_fcnary.x_ary.x_dimen));
 	    }
@@ -1055,7 +1059,7 @@
 	*punt = 1;
 
       if (SF_GET_FUNCTION (symp))
-	symp->bsym->flags |= BSF_FUNCTION;
+	symbol_get_bfdsym (symp)->flags |= BSF_FUNCTION;
 
       /* more ... */
     }
@@ -1068,17 +1072,17 @@
 #ifdef OBJ_XCOFF
   /* This is pretty horrible, but we have to set *punt correctly in
      order to call SA_SET_SYM_ENDNDX correctly.  */
-  if (! symp->sy_used_in_reloc
-      && ((symp->bsym->flags & BSF_SECTION_SYM) != 0
+  if (! symbol_used_in_reloc_p (symp)
+      && ((symbol_get_bfdsym (symp)->flags & BSF_SECTION_SYM) != 0
 	  || (! S_IS_EXTERNAL (symp)
-	      && ! symp->sy_tc.output
+	      && ! symbol_get_tc (symp)->output
 	      && S_GET_STORAGE_CLASS (symp) != C_FILE)))
     *punt = 1;
 #endif
 
   if (set_end != (symbolS *) NULL
       && ! *punt
-      && ((symp->bsym->flags & BSF_NOT_AT_END) != 0
+      && ((symbol_get_bfdsym (symp)->flags & BSF_NOT_AT_END) != 0
 	  || (S_IS_DEFINED (symp)
 	      && ! S_IS_COMMON (symp)
 	      && (! S_IS_EXTERNAL (symp) || SF_GET_FUNCTION (symp)))))
@@ -1100,22 +1104,22 @@
       coff_last_bf = symp;
     }
 
-  if (coffsymbol (symp->bsym)->lineno)
+  if (coffsymbol (symbol_get_bfdsym (symp))->lineno)
     {
       int i;
       struct line_no *lptr;
       alent *l;
 
-      lptr = (struct line_no *) coffsymbol (symp->bsym)->lineno;
+      lptr = (struct line_no *) coffsymbol (symbol_get_bfdsym (symp))->lineno;
       for (i = 0; lptr; lptr = lptr->next)
 	i++;
-      lptr = (struct line_no *) coffsymbol (symp->bsym)->lineno;
+      lptr = (struct line_no *) coffsymbol (symbol_get_bfdsym (symp))->lineno;
 
       /* We need i entries for line numbers, plus 1 for the first
 	 entry which BFD will override, plus 1 for the last zero
 	 entry (a marker for BFD).  */
       l = (alent *) xmalloc ((i + 2) * sizeof (alent));
-      coffsymbol (symp->bsym)->lineno = l;
+      coffsymbol (symbol_get_bfdsym (symp))->lineno = l;
       l[i + 1].line_number = 0;
       l[i + 1].u.sym = NULL;
       for (; i > 0; i--)
@@ -1243,7 +1247,7 @@
 		case 'b': flags |= SEC_ALLOC; flags &=~ SEC_LOAD; break;
 		case 'n': flags &=~ SEC_LOAD; break;
 		case 'd':
-		case 'w': flags &=~ SEC_READONLY; break;
+		case 'w': flags |= SEC_DATA; flags &=~ SEC_READONLY; break;
 		case 'x': flags |= SEC_CODE; break;
 		case 'r': flags |= SEC_READONLY; break;
 
@@ -3231,6 +3235,7 @@
 	 at the next frag.  */
 
       subseg_set (frchain_ptr->frch_seg, frchain_ptr->frch_subseg);
+
 #ifndef SUB_SEGMENT_ALIGN
 #define SUB_SEGMENT_ALIGN(SEG) 1
 #endif
@@ -3238,7 +3243,9 @@
       md_do_align (SUB_SEGMENT_ALIGN (now_seg), (char *) NULL, 0, 0,
 		   alignment_done);
 #endif
-      frag_align (SUB_SEGMENT_ALIGN (now_seg), NOP_OPCODE, 0);
+      frag_align (SUB_SEGMENT_ALIGN (now_seg),
+		  subseg_text_p (now_seg) ? NOP_OPCODE : 0,
+		  0);
 #ifdef md_do_align
     alignment_done:
 #endif
@@ -4258,6 +4265,12 @@
 #endif
 	}			/* if pcrel */
 
+#ifdef MD_APPLY_FIX3
+      md_apply_fix3 (fixP, (valueT *) &add_number, this_segment_type);
+#else
+      md_apply_fix (fixP, add_number);
+#endif
+
       if (!fixP->fx_bit_fixP && ! fixP->fx_no_overflow)
 	{
 #ifndef TC_M88K
@@ -4294,13 +4307,6 @@
 			  (unsigned long) (fragP->fr_address + where));
 #endif
 	}			/* not a bit fix */
-      /* Once this fix has been applied, we don't have to output
-	 anything nothing more need be done.  */
-#ifdef MD_APPLY_FIX3
-      md_apply_fix3 (fixP, (valueT *) &add_number, this_segment_type);
-#else
-      md_apply_fix (fixP, add_number);
-#endif
     }				/* For each fixS in this segment. */
 }				/* fixup_segment() */
 
diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h
index 4650477..a8799a3 100644
--- a/gas/config/obj-coff.h
+++ b/gas/config/obj-coff.h
@@ -154,7 +154,7 @@
 #define OBJ_COFF_MAX_AUXENTRIES 1
 #endif /* OBJ_COFF_MAX_AUXENTRIES */
 
-extern void coff_obj_symbol_new_hook PARAMS ((struct symbol *));
+extern void coff_obj_symbol_new_hook PARAMS ((symbolS *));
 #define obj_symbol_new_hook coff_obj_symbol_new_hook
 
 extern void coff_obj_read_begin_hook PARAMS ((void));
@@ -211,32 +211,35 @@
 /* Alter the field names, for now, until we've fixed up the other
    references to use the new name.  */
 #ifdef TC_I960
-#define TC_SYMFIELD_TYPE	struct symbol *
+#define TC_SYMFIELD_TYPE	symbolS *
 #define sy_tc			bal
 #endif
 
 #define OBJ_SYMFIELD_TYPE	unsigned long
 #define sy_obj			sy_flags
 
-#define SYM_AUXENT(S)	(&coffsymbol ((S)->bsym)->native[1].u.auxent)
-#define SYM_AUXINFO(S)	(&coffsymbol ((S)->bsym)->native[1])
+#define SYM_AUXENT(S) \
+  (&coffsymbol (symbol_get_bfdsym (S))->native[1].u.auxent)
+#define SYM_AUXINFO(S) \
+  (&coffsymbol (symbol_get_bfdsym (S))->native[1])
 
 #define DO_NOT_STRIP	0
 
 extern void obj_coff_section PARAMS ((int));
 
 /* The number of auxiliary entries */
-#define S_GET_NUMBER_AUXILIARY(s)	(coffsymbol((s)->bsym)->native->u.syment.n_numaux)
+#define S_GET_NUMBER_AUXILIARY(s) \
+  (coffsymbol (symbol_get_bfdsym (s))->native->u.syment.n_numaux)
 /* The number of auxiliary entries */
 #define S_SET_NUMBER_AUXILIARY(s,v)	(S_GET_NUMBER_AUXILIARY (s) = (v))
 
 /* True if a symbol name is in the string table, i.e. its length is > 8. */
 #define S_IS_STRING(s)		(strlen(S_GET_NAME(s)) > 8 ? 1 : 0)
 
-extern int S_SET_DATA_TYPE PARAMS ((struct symbol *, int));
-extern int S_SET_STORAGE_CLASS PARAMS ((struct symbol *, int));
-extern int S_GET_STORAGE_CLASS PARAMS ((struct symbol *));
-extern void SA_SET_SYM_ENDNDX PARAMS ((struct symbol *, struct symbol *));
+extern int S_SET_DATA_TYPE PARAMS ((symbolS *, int));
+extern int S_SET_STORAGE_CLASS PARAMS ((symbolS *, int));
+extern int S_GET_STORAGE_CLASS PARAMS ((symbolS *));
+extern void SA_SET_SYM_ENDNDX PARAMS ((symbolS *, symbolS *));
 
 /* Auxiliary entry macros. SA_ stands for symbol auxiliary */
 /* Omit the tv related fields */
@@ -298,9 +301,9 @@
 /* All other bits are unused. */
 
 /* Accessors */
-#define SF_GET(s)		((s)->sy_flags)
-#define SF_GET_DEBUG(s)		((s)->bsym->flags & BSF_DEBUGGING)
-#define SF_SET_DEBUG(s)		((s)->bsym->flags |= BSF_DEBUGGING)
+#define SF_GET(s)		(*symbol_get_obj (s))
+#define SF_GET_DEBUG(s)		(symbol_get_bfdsym (s)->flags & BSF_DEBUGGING)
+#define SF_SET_DEBUG(s)		(symbol_get_bfdsym (s)->flags |= BSF_DEBUGGING)
 #define SF_GET_NORMAL_FIELD(s)	(SF_GET (s) & SF_NORMAL_MASK)
 #define SF_GET_DEBUG_FIELD(s)	(SF_GET (s) & SF_DEBUG_MASK)
 #define SF_GET_FILE(s)		(SF_GET (s) & SF_FILE)
@@ -346,13 +349,13 @@
 extern int coff_n_line_nos;
 
 #define obj_emit_lineno(WHERE,LINE,FILE_START)	abort ()
-extern void coff_add_linesym PARAMS ((struct symbol *));
+extern void coff_add_linesym PARAMS ((symbolS *));
 
 
 void c_dot_file_symbol PARAMS ((char *filename));
 #define obj_app_file c_dot_file_symbol
 
-extern void coff_frob_symbol PARAMS ((struct symbol *, int *));
+extern void coff_frob_symbol PARAMS ((symbolS *, int *));
 extern void coff_adjust_symtab PARAMS ((void));
 extern void coff_frob_section PARAMS ((segT));
 extern void coff_adjust_section_syms PARAMS ((bfd *, asection *, PTR));
@@ -364,7 +367,7 @@
 #define obj_frob_section(S)	coff_frob_section (S)
 #define obj_frob_file_after_relocs() coff_frob_file_after_relocs ()
 
-extern struct symbol *coff_last_function;
+extern symbolS *coff_last_function;
 
 /* Forward the segment of a forwarded symbol, handle assignments that
    just copy symbol values, etc.  */
@@ -778,7 +781,7 @@
 #define obj_app_file c_dot_file_symbol
 extern void obj_extra_stuff PARAMS ((object_headers * headers));
 
-extern segT s_get_segment PARAMS ((struct symbol * ptr));
+extern segT s_get_segment PARAMS ((symbolS *ptr));
 
 extern void c_section_header PARAMS ((struct internal_scnhdr * header,
 				      char *name,
@@ -792,7 +795,7 @@
 				      long alignment));
 
 #ifndef tc_coff_symbol_emit_hook
-void tc_coff_symbol_emit_hook PARAMS ((struct symbol *));
+void tc_coff_symbol_emit_hook PARAMS ((symbolS *));
 #endif
 
 /* sanity check */
diff --git a/gas/config/obj-ecoff.c b/gas/config/obj-ecoff.c
index ec3ce88..6489243 100644
--- a/gas/config/obj-ecoff.c
+++ b/gas/config/obj-ecoff.c
@@ -1,5 +1,5 @@
 /* ECOFF object file format.
-   Copyright (C) 1993, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    This file was put together by Ian Lance Taylor <ian@cygnus.com>.
 
@@ -260,8 +260,9 @@
     = &ecoff_backend (stdoutput)->debug_swap;
   ecoff_symbol_type *esym;
 
-  know (bfd_asymbol_flavour (sym->bsym) == bfd_target_ecoff_flavour);
-  esym = ecoffsymbol (sym->bsym);
+  know (bfd_asymbol_flavour (symbol_get_bfdsym (sym))
+	== bfd_target_ecoff_flavour);
+  esym = ecoffsymbol (symbol_get_bfdsym (sym));
   esym->local = false;
   esym->native = xmalloc (debug_swap->external_ext_size);
   (*debug_swap->swap_ext_out) (stdoutput, ext, esym->native);
diff --git a/gas/config/obj-ecoff.h b/gas/config/obj-ecoff.h
index 427e619..8bca254 100644
--- a/gas/config/obj-ecoff.h
+++ b/gas/config/obj-ecoff.h
@@ -36,10 +36,14 @@
    symbols is undefined (this last is needed to distinguish a .extern
    symbols from a .comm symbol).  */
 
-#define TARGET_SYMBOL_FIELDS \
-  struct efdr *ecoff_file; \
-  struct localsym *ecoff_symbol; \
+struct ecoff_sy_obj
+{
+  struct efdr *ecoff_file;
+  struct localsym *ecoff_symbol;
   valueT ecoff_extern_size;
+};
+
+#define OBJ_SYMFIELD_TYPE struct ecoff_sy_obj
 
 /* Modify the ECOFF symbol.  */
 #define obj_frob_symbol(symp, punt) ecoff_frob_symbol (symp)
@@ -64,4 +68,4 @@
 #define obj_sec_sym_ok_for_reloc(SEC)	1
 
 #define obj_ecoff_set_ext ecoff_set_ext
-extern void obj_ecoff_set_ext PARAMS ((struct symbol *, EXTR *));
+extern void obj_ecoff_set_ext PARAMS ((symbolS *, EXTR *));
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index f50c4b7..6feb5c5 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1,5 +1,5 @@
 /* ELF object file format
-   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -65,17 +65,16 @@
 static void obj_elf_ident PARAMS ((int));
 static void obj_elf_weak PARAMS ((int));
 static void obj_elf_local PARAMS ((int));
-static void obj_elf_common PARAMS ((int));
 static void obj_elf_symver PARAMS ((int));
 static void obj_elf_vtable_inherit PARAMS ((int));
 static void obj_elf_vtable_entry PARAMS ((int));
-static void obj_elf_data PARAMS ((int));
-static void obj_elf_text PARAMS ((int));
 static void obj_elf_subsection PARAMS ((int));
+static void obj_elf_popsection PARAMS ((int));
 
 static const pseudo_typeS elf_pseudo_table[] =
 {
   {"comm", obj_elf_common, 0},
+  {"common", obj_elf_common, 1},
   {"ident", obj_elf_ident, 0},
   {"local", obj_elf_local, 0},
   {"previous", obj_elf_previous, 0},
@@ -83,6 +82,8 @@
   {"section.s", obj_elf_section, 0},
   {"sect", obj_elf_section, 0},
   {"sect.s", obj_elf_section, 0},
+  {"pushsection", obj_elf_section, 1},
+  {"popsection", obj_elf_popsection, 0},
   {"size", obj_elf_size, 0},
   {"type", obj_elf_type, 0},
   {"version", obj_elf_version, 0},
@@ -111,7 +112,7 @@
   {"text", obj_elf_text, 0},
 
   /* End sentinel.  */
-  {NULL},
+  {NULL, NULL, 0},
 };
 
 static const pseudo_typeS ecoff_debug_pseudo_table[] =
@@ -156,7 +157,7 @@
   { "vreg",	s_ignore,		0 },
 #endif
 
-  {NULL}			/* end sentinel */
+  {NULL, NULL, 0}			/* end sentinel */
 };
 
 #undef NO_RELOC
@@ -235,8 +236,8 @@
   symbolS *sym;
 
   sym = symbol_new (s, absolute_section, (valueT) 0, (struct frag *) 0);
-  sym->sy_frag = &zero_address_frag;
-  sym->bsym->flags |= BSF_FILE;
+  symbol_set_frag (sym, &zero_address_frag);
+  symbol_get_bfdsym (sym)->flags |= BSF_FILE;
 
   if (symbol_rootP != sym)
     {
@@ -252,9 +253,9 @@
 #endif
 }
 
-static void
-obj_elf_common (ignore)
-     int ignore;
+void
+obj_elf_common (is_common)
+     int is_common;
 {
   char *name;
   char c;
@@ -263,6 +264,12 @@
   symbolS *symbolP;
   int have_align;
 
+  if (flag_mri && is_common)
+    {
+      s_mri_common (0);
+      return;
+    }
+
   name = input_line_pointer;
   c = get_symbol_end ();
   /* just after name is now '\0' */
@@ -294,7 +301,7 @@
     }
   if (S_GET_VALUE (symbolP) != 0)
     {
-      if (S_GET_VALUE (symbolP) != size)
+      if (S_GET_VALUE (symbolP) != (valueT) size)
 	{
 	  as_warn (_("Length of .comm \"%s\" is already %ld. Not changed to %d."),
 		   S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size);
@@ -322,7 +329,7 @@
 	      as_warn (_("Common alignment negative; 0 assumed"));
 	    }
 	}
-      if (symbolP->local)
+      if (symbol_get_obj (symbolP)->local)
 	{
 	  segT old_sec;
 	  int old_subsec;
@@ -350,8 +357,8 @@
 	  if (align)
 	    frag_align (align, 0, 0);
 	  if (S_GET_SEGMENT (symbolP) == bss_section)
-	    symbolP->sy_frag->fr_symbol = 0;
-	  symbolP->sy_frag = frag_now;
+	    symbol_get_frag (symbolP)->fr_symbol = 0;
+	  symbol_set_frag (symbolP, frag_now);
 	  pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP,
 			    (offsetT) size, (char *) 0);
 	  *pfrag = 0;
@@ -389,7 +396,7 @@
       goto allocate_common;
     }
 
-  symbolP->bsym->flags |= BSF_OBJECT;
+  symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT;
 
   demand_empty_rest_of_line ();
   return;
@@ -411,7 +418,7 @@
 
 static void
 obj_elf_local (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name;
   int c;
@@ -425,7 +432,7 @@
       *input_line_pointer = c;
       SKIP_WHITESPACE ();
       S_CLEAR_EXTERNAL (symbolP);
-      symbolP->local = 1;
+      symbol_get_obj (symbolP)->local = 1;
       if (c == ',')
 	{
 	  input_line_pointer++;
@@ -440,7 +447,7 @@
 
 static void
 obj_elf_weak (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name;
   int c;
@@ -454,7 +461,7 @@
       *input_line_pointer = c;
       SKIP_WHITESPACE ();
       S_SET_WEAK (symbolP);
-      symbolP->local = 1;
+      symbol_get_obj (symbolP)->local = 1;
       if (c == ',')
 	{
 	  input_line_pointer++;
@@ -470,6 +477,16 @@
 static segT previous_section;
 static int previous_subsection;
 
+struct section_stack
+{
+  struct section_stack *next;
+  segT seg, prev_seg;
+  int subseg, prev_subseg;
+};
+
+static struct section_stack *section_stack;
+
+
 /* Handle the .section pseudo-op.  This code supports two different
    syntaxes.
 
@@ -497,7 +514,7 @@
   int attributes;
 };
 
-static struct special_section special_sections[] =
+static struct special_section const special_sections[] =
 {
   { ".bss",	SHT_NOBITS,	SHF_ALLOC + SHF_WRITE		},
   { ".comment",	SHT_PROGBITS,	0				},
@@ -536,25 +553,197 @@
 };
 
 void
-obj_elf_section (xxx)
-     int xxx;
+obj_elf_change_section (name, type, attr, push)
+     char *name;
+     int type, attr, push;
 {
-  char *string;
   int new_sec;
   segT sec;
-  int type, attr;
-  int i;
-  flagword flags;
-  symbolS *secsym;
 
 #ifdef md_flush_pending_output
   md_flush_pending_output ();
 #endif
 
+  /* Switch to the section, creating it if necessary.  */
+  if (push)
+    {
+      struct section_stack *elt;
+      elt = xmalloc (sizeof (struct section_stack));
+      elt->next = section_stack;
+      elt->seg = now_seg;
+      elt->prev_seg = previous_section;
+      elt->subseg = now_subseg;
+      elt->prev_subseg = previous_subsection;
+      section_stack = elt;
+    }
+  previous_section = now_seg;
+  previous_subsection = now_subseg;
+
+  new_sec = bfd_get_section_by_name (stdoutput, name) == NULL;
+  sec = subseg_new (name, 0);
+
+  if (new_sec)
+    {
+      flagword flags;
+      symbolS *secsym;
+      int i;
+
+      /* See if this is one of the special sections.  */
+      for (i = 0; special_sections[i].name != NULL; i++)
+        if (strcmp (name, special_sections[i].name) == 0)
+          {
+	    if (type == SHT_NULL)
+	      type = special_sections[i].type;
+	    else if (type != special_sections[i].type)
+	      as_warn (_("Setting incorrect section type for %s"), name);
+
+	    if ((attr &~ special_sections[i].attributes) != 0)
+	      {
+	        /* As a GNU extension, we permit a .note section to be
+		   allocatable.  If the linker sees an allocateable .note
+		   section, it will create a PT_NOTE segment in the output
+		   file.  */
+		if (strcmp (name, ".note") != 0
+		    || attr != SHF_ALLOC)
+		  as_warn (_("Setting incorrect section attributes for %s"),
+			   name);
+	      }
+	    attr |= special_sections[i].attributes;
+	    break;
+	  }
+
+      /* Convert ELF type and flags to BFD flags.  */
+      flags = (SEC_RELOC
+	       | ((attr & SHF_WRITE) ? 0 : SEC_READONLY)
+	       | ((attr & SHF_ALLOC) ? SEC_ALLOC : 0)
+	       | (((attr & SHF_ALLOC) && type != SHT_NOBITS) ? SEC_LOAD : 0)
+	       | ((attr & SHF_EXECINSTR) ? SEC_CODE : 0));
+#ifdef md_elf_section_flags
+      flags = md_elf_section_flags (flags, attr, type);
+#endif
+
+      /* Prevent SEC_HAS_CONTENTS from being inadvertently set.  */
+      if (type == SHT_NOBITS)
+        seg_info (sec)->bss = 1;
+
+      bfd_set_section_flags (stdoutput, sec, flags);
+
+      /* Add a symbol for this section to the symbol table.  */
+      secsym = symbol_find (name);
+      if (secsym != NULL)
+	symbol_set_bfdsym (secsym, sec->symbol);
+      else
+        symbol_table_insert (section_symbol (sec));
+    }
+
+#ifdef md_elf_section_change_hook
+      md_elf_section_change_hook ();
+#endif
+}
+
+int
+obj_elf_parse_section_letters (str, len)
+     char *str;
+     size_t len;
+{
+  int attr = 0;
+
+  while (len > 0)
+    {
+      switch (*str)
+	{
+	case 'a':
+	  attr |= SHF_ALLOC;
+	  break;
+	case 'w':
+	  attr |= SHF_WRITE;
+	  break;
+	case 'x':
+	  attr |= SHF_EXECINSTR;
+	  break;
+	default:
+	  {
+	    char *bad_msg = _("Unrecognized .section attribute: want a,w,x");
+#ifdef md_elf_section_letter
+	    int md_attr = md_elf_section_letter (*str, &bad_msg);
+	    if (md_attr >= 0)
+	      attr |= md_attr;
+	    else
+#endif
+	      {
+		as_warn (bad_msg);
+		attr = -1;
+	      }
+	  }
+	  break;
+	}
+      str++, len--;
+    }
+
+  return attr;
+}
+
+int
+obj_elf_section_word (str, len)
+     char *str;
+     size_t len;
+{
+  if (len == 5 && strncmp (str, "write", 5) == 0)
+    return SHF_WRITE;
+  if (len == 5 && strncmp (str, "alloc", 5) == 0)
+    return SHF_ALLOC;
+  if (len == 9 && strncmp (str, "execinstr", 9) == 0)
+    return SHF_EXECINSTR;
+
+#ifdef md_elf_section_word
+  {
+    int md_attr = md_elf_section_word (str, len);
+    if (md_attr >= 0)
+      return md_attr;
+  }
+#endif
+
+  as_warn (_("Unrecognized section attribute"));
+  return 0;
+}
+
+int
+obj_elf_section_type (str, len)
+     char *str;
+     size_t len;
+{
+  if (len == 8 && strncmp (str, "progbits", 8) == 0)
+    return SHT_PROGBITS;
+  if (len == 6 && strncmp (str, "nobits", 6) == 0)
+    return SHT_NOBITS;
+
+#ifdef md_elf_section_type
+  {
+    int md_type = md_elf_section_type (str, len);
+    if (md_type >= 0)
+      return md_type;
+  }
+#endif
+
+  as_warn (_("Unrecognized section type"));
+  return 0;
+}
+
+void
+obj_elf_section (push)
+     int push;
+{
+  char *name, *beg, *end;
+  int type, attr, dummy;
+
   if (flag_mri)
     {
       char mri_type;
 
+#ifdef md_flush_pending_output
+  md_flush_pending_output ();
+#endif
+
       previous_section = now_seg;
       previous_subsection = now_subseg;
 
@@ -571,8 +760,8 @@
   SKIP_WHITESPACE ();
   if (*input_line_pointer == '"')
     {
-      string = demand_copy_C_string (&xxx);
-      if (string == NULL)
+      name = demand_copy_C_string (&dummy);
+      if (name == NULL)
 	{
 	  ignore_rest_of_line ();
 	  return;
@@ -580,46 +769,21 @@
     }
   else
     {
-      char *p = input_line_pointer;
-      char c;
-      while (0 == strchr ("\n\t,; ", *p))
-	p++;
-      if (p == input_line_pointer)
+      end = input_line_pointer;
+      while (0 == strchr ("\n\t,; ", *end))
+	end++;
+      if (end == input_line_pointer)
 	{
 	  as_warn (_("Missing section name"));
 	  ignore_rest_of_line ();
 	  return;
 	}
-      c = *p;
-      *p = 0;
-      string = xmalloc ((unsigned long) (p - input_line_pointer + 1));
-      strcpy (string, input_line_pointer);
-      *p = c;
-      input_line_pointer = p;
+    
+      name = xmalloc (end - input_line_pointer + 1);
+      memcpy (name, input_line_pointer, end - input_line_pointer);
+      name[end - input_line_pointer] = '\0';
+      input_line_pointer = end;
     }
-
-  /* Switch to the section, creating it if necessary.  */
-  previous_section = now_seg;
-  previous_subsection = now_subseg;
-
-  new_sec = bfd_get_section_by_name (stdoutput, string) == NULL;
-  sec = subseg_new (string, 0);
-
-  /* If this section already existed, we don't bother to change the
-     flag values.  */
-  if (! new_sec)
-    {
-      while (! is_end_of_line[(unsigned char) *input_line_pointer])
-	++input_line_pointer;
-      ++input_line_pointer;
-
-#ifdef md_elf_section_change_hook
-      md_elf_section_change_hook ();
-#endif
-
-      return;
-    }
-
   SKIP_WHITESPACE ();
 
   type = SHT_NULL;
@@ -629,81 +793,41 @@
     {
       /* Skip the comma.  */
       ++input_line_pointer;
-
       SKIP_WHITESPACE ();
 
       if (*input_line_pointer == '"')
 	{
-	  /* Pick up a string with a combination of a, w, x.  */
-	  ++input_line_pointer;
-	  while (*input_line_pointer != '"')
+	  beg = demand_copy_C_string (&dummy);
+	  if (beg == NULL)
 	    {
-	      switch (*input_line_pointer)
-		{
-		case 'a':
-		  attr |= SHF_ALLOC;
-		  break;
-		case 'w':
-		  attr |= SHF_WRITE;
-		  break;
-		case 'x':
-		  attr |= SHF_EXECINSTR;
-		  break;
-		default:
-		  {
-		    char *bad_msg = _("Bad .section directive: want a,w,x in string");
-#ifdef md_elf_section_letter
-		    int md_attr = md_elf_section_letter (*input_line_pointer, &bad_msg);
-		    if (md_attr)
-		      attr |= md_attr;
-		    else
-#endif
-		      {
-			as_warn (bad_msg);
-			ignore_rest_of_line ();
-			return;
-		      }
-		  }
-		}
-	      ++input_line_pointer;
+	      ignore_rest_of_line ();
+	      return;
 	    }
-
-	  /* Skip the closing quote.  */
-	  ++input_line_pointer;
+	  attr |= obj_elf_parse_section_letters (beg, strlen (beg));
 
 	  SKIP_WHITESPACE ();
 	  if (*input_line_pointer == ',')
 	    {
+	      char c;
 	      ++input_line_pointer;
 	      SKIP_WHITESPACE ();
-	      if (*input_line_pointer == '@' || *input_line_pointer == '%')
+	      c = *input_line_pointer;
+	      if (c == '"')
 		{
-		  ++input_line_pointer;
-		  if (strncmp (input_line_pointer, "progbits",
-			       sizeof "progbits" - 1) == 0)
+		  beg = demand_copy_C_string (&dummy);
+		  if (beg == NULL)
 		    {
-		      type = SHT_PROGBITS;
-		      input_line_pointer += sizeof "progbits" - 1;
+		      ignore_rest_of_line ();
+		      return;
 		    }
-		  else if (strncmp (input_line_pointer, "nobits",
-				    sizeof "nobits" - 1) == 0)
-		    {
-		      type = SHT_NOBITS;
-		      input_line_pointer += sizeof "nobits" - 1;
-		    }
-		  else
-		    {
-#ifdef md_elf_section_type
-		    int md_type = md_elf_section_type (&input_line_pointer);
-		    if (md_type)
-		      type = md_type;
-		    else
-#endif
-		      {
-			as_warn (_("Unrecognized section type"));
-			ignore_rest_of_line ();
-		      }
-		    }
+		  type = obj_elf_section_type (beg, strlen (beg));
+		}
+	      else if (c == '@' || c == '%')
+		{
+		  beg = ++input_line_pointer;
+		  c = get_symbol_end ();
+		  *input_line_pointer = c;
+		  type = obj_elf_section_type (beg, input_line_pointer - beg);
 		}
 	    }
 	}
@@ -711,6 +835,8 @@
 	{
 	  do
 	    {
+	      char c;
+
 	      SKIP_WHITESPACE ();
 	      if (*input_line_pointer != '#')
 		{
@@ -718,39 +844,12 @@
 		  ignore_rest_of_line ();
 		  return;
 		}
-	      ++input_line_pointer;
-	      if (strncmp (input_line_pointer, "write",
-			   sizeof "write" - 1) == 0)
-		{
-		  attr |= SHF_WRITE;
-		  input_line_pointer += sizeof "write" - 1;
-		}
-	      else if (strncmp (input_line_pointer, "alloc",
-				sizeof "alloc" - 1) == 0)
-		{
-		  attr |= SHF_ALLOC;
-		  input_line_pointer += sizeof "alloc" - 1;
-		}
-	      else if (strncmp (input_line_pointer, "execinstr",
-				sizeof "execinstr" - 1) == 0)
-		{
-		  attr |= SHF_EXECINSTR;
-		  input_line_pointer += sizeof "execinstr" - 1;
-		}
-	      else
-		{
-#ifdef md_elf_section_word
-		  int md_attr = md_elf_section_word (&input_line_pointer);
-		  if (md_attr)
-		    attr |= md_attr;
-		  else
-#endif
-		    {
-		      as_warn (_("Unrecognized section attribute"));
-		      ignore_rest_of_line ();
-		      return;
-		    }
-		}
+	      beg = ++input_line_pointer;
+	      c = get_symbol_end ();
+	      *input_line_pointer = c;
+
+	      attr |= obj_elf_section_word (beg, input_line_pointer - beg);
+
 	      SKIP_WHITESPACE ();
 	    }
 	  while (*input_line_pointer++ == ',');
@@ -758,77 +857,14 @@
 	}
     }
 
-  /* See if this is one of the special sections.  */
-  for (i = 0; special_sections[i].name != NULL; i++)
-    {
-      if (string[1] == special_sections[i].name[1]
-	  && strcmp (string, special_sections[i].name) == 0)
-	{
-	  if (type == SHT_NULL)
-	    type = special_sections[i].type;
-	  else if (type != special_sections[i].type)
-	    as_warn (_("Setting incorrect section type for %s"), string);
-
-	  if ((attr &~ special_sections[i].attributes) != 0)
-	    {
-	      /* As a GNU extension, we permit a .note section to be
-                 allocatable.  If the linker sees an allocateable
-                 .note section, it will create a PT_NOTE segment in
-                 the output file.  */
-	      if (strcmp (string, ".note") != 0
-		  || attr != SHF_ALLOC)
-		as_warn (_("Setting incorrect section attributes for %s"),
-			 string);
-	    }
-	  attr |= special_sections[i].attributes;
-
-	  break;
-	}
-    }
-
-  flags = (SEC_RELOC
-	   | ((attr & SHF_WRITE) ? 0 : SEC_READONLY)
-	   | ((attr & SHF_ALLOC) ? SEC_ALLOC : 0)
-	   | (((attr & SHF_ALLOC) && type != SHT_NOBITS) ? SEC_LOAD : 0)
-	   | ((attr & SHF_EXECINSTR) ? SEC_CODE : 0));
-  if (special_sections[i].name == NULL)
-    {
-      if (type == SHT_PROGBITS)
-	flags |= SEC_ALLOC | SEC_LOAD;
-      else if (type == SHT_NOBITS)
-	{
-	  flags |= SEC_ALLOC;
-	  flags &=~ SEC_LOAD;
-	}
-
-#ifdef md_elf_section_flags
-      flags = md_elf_section_flags (flags, attr, type);
-#endif
-    }
-
-  /* Prevent SEC_HAS_CONTENTS from being inadvertently set.  */
-  if (type == SHT_NOBITS)
-    seg_info (sec)->bss = 1;
-
-  bfd_set_section_flags (stdoutput, sec, flags);
-
-  /* Add a symbol for this section to the symbol table.  */
-  secsym = symbol_find (string);
-  if (secsym != NULL)
-    secsym->bsym = sec->symbol;
-  else
-    symbol_table_insert (section_symbol (sec));
-
-#ifdef md_elf_section_change_hook
-  md_elf_section_change_hook ();
-#endif
-
   demand_empty_rest_of_line ();
+
+  obj_elf_change_section (name, type, attr, push);
 }
 
 /* Change to the .data section.  */
 
-static void
+void
 obj_elf_data (i)
      int i;
 {
@@ -847,7 +883,7 @@
 
 /* Change to the .text section.  */
 
-static void
+void
 obj_elf_text (i)
      int i;
 {
@@ -866,7 +902,7 @@
 
 static void
 obj_elf_subsection (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register int temp;
 
@@ -898,8 +934,11 @@
 
 void
 obj_elf_previous (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
+  segT new_section;
+  int new_subsection;
+
   if (previous_section == 0)
     {
       as_bad (_(".previous without corresponding .section; ignored"));
@@ -910,8 +949,38 @@
   md_flush_pending_output ();
 #endif
 
-  subseg_set (previous_section, previous_subsection);
-  previous_section = 0;
+  new_section = previous_section;
+  new_subsection = previous_subsection;
+  previous_section = now_seg;
+  previous_subsection = now_subseg;
+  subseg_set (new_section, new_subsection);
+
+#ifdef md_elf_section_change_hook
+  md_elf_section_change_hook ();
+#endif
+}
+
+static void
+obj_elf_popsection (xxx)
+     int xxx ATTRIBUTE_UNUSED;
+{
+  struct section_stack *top = section_stack;
+
+  if (top == NULL)
+    {
+      as_bad (_(".popsection without corresponding .pushsection; ignored"));
+      return;
+    }
+
+#ifdef md_flush_pending_output
+  md_flush_pending_output ();
+#endif
+
+  section_stack = top->next;
+  previous_section = top->prev_seg;
+  previous_subsection = top->prev_subseg;
+  subseg_set (top->seg, top->subseg);
+  free (top);
 
 #ifdef md_elf_section_change_hook
   md_elf_section_change_hook ();
@@ -920,7 +989,7 @@
 
 static void
 obj_elf_line (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   /* Assume delimiter is part of expression.  BSD4.2 as fails with
      delightful bug, so we are not being incompatible here. */
@@ -936,7 +1005,7 @@
 
 static void
 obj_elf_symver (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name;
   char c;
@@ -949,7 +1018,7 @@
 
   *input_line_pointer = c;
 
-  if (sym->sy_obj.versioned_name != NULL)
+  if (symbol_get_obj (sym)->versioned_name != NULL)
     {
       as_bad (_("multiple .symver directives for symbol `%s'"),
 	      S_GET_NAME (sym));
@@ -975,14 +1044,14 @@
       *input_line_pointer++ = c;
     }
 
-  sym->sy_obj.versioned_name = xstrdup (name);
+  symbol_get_obj (sym)->versioned_name = xstrdup (name);
 
   *input_line_pointer = c;
 
-  if (strchr (sym->sy_obj.versioned_name, ELF_VER_CHR) == NULL)
+  if (strchr (symbol_get_obj (sym)->versioned_name, ELF_VER_CHR) == NULL)
     {
       as_bad (_("missing version name in `%s' for symbol `%s'"),
-	      sym->sy_obj.versioned_name, S_GET_NAME (sym));
+	      symbol_get_obj (sym)->versioned_name, S_GET_NAME (sym));
       ignore_rest_of_line ();
       return;
     }
@@ -996,6 +1065,7 @@
 
 static void
 obj_elf_vtable_inherit (ignore)
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *cname, *pname;
   symbolS *csym, *psym;
@@ -1012,7 +1082,7 @@
      the same child symbol.  Also, we can currently only do this if the
      child symbol is already exists and is placed in a fragment.  */
 
-  if (csym == NULL || csym->sy_frag == NULL)
+  if (csym == NULL || symbol_get_frag (csym) == NULL)
     {
       as_bad ("expected `%s' to have already been set for .vtable_inherit",
 	      cname);
@@ -1037,7 +1107,7 @@
 
   if (input_line_pointer[0] == '0'
       && (input_line_pointer[1] == '\0'
-	  || isspace(input_line_pointer[1])))
+	  || isspace ((unsigned char) input_line_pointer[1])))
     {
       psym = section_symbol (absolute_section);
       ++input_line_pointer;
@@ -1055,8 +1125,9 @@
   if (bad)
     return;
 
-  assert (csym->sy_value.X_op == O_constant);
-  fix_new (csym->sy_frag, csym->sy_value.X_add_number, 0, psym, 0, 0,
+  assert (symbol_get_value_expression (csym)->X_op == O_constant);
+  fix_new (symbol_get_frag (csym),
+	   symbol_get_value_expression (csym)->X_add_number, 0, psym, 0, 0,
 	   BFD_RELOC_VTABLE_INHERIT);
 }
   
@@ -1066,6 +1137,7 @@
 
 static void
 obj_elf_vtable_entry (ignore)
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name;
   symbolS *sym;
@@ -1113,8 +1185,11 @@
 obj_symbol_new_hook (symbolP)
      symbolS *symbolP;
 {
-  symbolP->sy_obj.size = NULL;
-  symbolP->sy_obj.versioned_name = NULL;
+  struct elf_obj_sy *sy_obj;
+
+  sy_obj = symbol_get_obj (symbolP);
+  sy_obj->size = NULL;
+  sy_obj->versioned_name = NULL;
 
 #ifdef NEED_ECOFF_DEBUG
   if (ECOFF_DEBUGGING)
@@ -1124,7 +1199,7 @@
 
 void
 obj_elf_version (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name;
   unsigned int c;
@@ -1191,7 +1266,7 @@
 
 static void
 obj_elf_size (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name = input_line_pointer;
   char c = get_symbol_end ();
@@ -1225,8 +1300,9 @@
     S_SET_SIZE (sym, exp.X_add_number);
   else
     {
-      sym->sy_obj.size = (expressionS *) xmalloc (sizeof (expressionS));
-      *sym->sy_obj.size = exp;
+      symbol_get_obj (sym)->size =
+	(expressionS *) xmalloc (sizeof (expressionS));
+      *symbol_get_obj (sym)->size = exp;
     }
   demand_empty_rest_of_line ();
 }
@@ -1246,7 +1322,7 @@
 
 static void
 obj_elf_type (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name;
   char c;
@@ -1284,14 +1360,14 @@
 
   *input_line_pointer = c;
 
-  sym->bsym->flags |= type;
+  symbol_get_bfdsym (sym)->flags |= type;
 
   demand_empty_rest_of_line ();
 }
 
 static void
 obj_elf_ident (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   static segT comment_section;
   segT old_section = now_seg;
@@ -1351,7 +1427,7 @@
 adjust_stab_sections (abfd, sec, xxx)
      bfd *abfd;
      asection *sec;
-     PTR xxx;
+     PTR xxx ATTRIBUTE_UNUSED;
 {
   char *name;
   asection *strsec;
@@ -1393,7 +1469,7 @@
      symbolS *sym;
      struct ecoff_extr *ext;
 {
-  sym->bsym->udata.p = (PTR) ext;
+  symbol_get_bfdsym (sym)->udata.p = (PTR) ext;
 }
 
 /* This function is called by bfd_ecoff_debug_externals.  It is
@@ -1429,35 +1505,39 @@
      symbolS *symp;
      int *puntp;
 {
+  struct elf_obj_sy *sy_obj;
+
 #ifdef NEED_ECOFF_DEBUG
   if (ECOFF_DEBUGGING)
     ecoff_frob_symbol (symp);
 #endif
 
-  if (symp->sy_obj.size != NULL)
+  sy_obj = symbol_get_obj (symp);
+
+  if (sy_obj->size != NULL)
     {
-      switch (symp->sy_obj.size->X_op)
+      switch (sy_obj->size->X_op)
 	{
 	case O_subtract:
 	  S_SET_SIZE (symp,
-		      (S_GET_VALUE (symp->sy_obj.size->X_add_symbol)
-		       + symp->sy_obj.size->X_add_number
-		       - S_GET_VALUE (symp->sy_obj.size->X_op_symbol)));
+		      (S_GET_VALUE (sy_obj->size->X_add_symbol)
+		       + sy_obj->size->X_add_number
+		       - S_GET_VALUE (sy_obj->size->X_op_symbol)));
 	  break;
 	case O_constant:
 	  S_SET_SIZE (symp,
-		      (S_GET_VALUE (symp->sy_obj.size->X_add_symbol)
-		       + symp->sy_obj.size->X_add_number));
+		      (S_GET_VALUE (sy_obj->size->X_add_symbol)
+		       + sy_obj->size->X_add_number));
 	  break;
 	default:
 	  as_bad (_(".size expression too complicated to fix up"));
 	  break;
 	}
-      free (symp->sy_obj.size);
-      symp->sy_obj.size = NULL;
+      free (sy_obj->size);
+      sy_obj->size = NULL;
     }
 
-  if (symp->sy_obj.versioned_name != NULL)
+  if (sy_obj->versioned_name != NULL)
     {
       /* This symbol was given a new name with the .symver directive.
 
@@ -1477,15 +1557,15 @@
 	  /* Verify that the name isn't using the @@ syntax--this is
              reserved for definitions of the default version to link
              against.  */
-	  p = strchr (symp->sy_obj.versioned_name, ELF_VER_CHR);
+	  p = strchr (sy_obj->versioned_name, ELF_VER_CHR);
 	  know (p != NULL);
 	  if (p[1] == ELF_VER_CHR)
 	    {
 	      as_bad (_("invalid attempt to declare external version name as default in symbol `%s'"),
-		      symp->sy_obj.versioned_name);
+		      sy_obj->versioned_name);
 	      *puntp = true;
 	    }
-	  S_SET_NAME (symp, symp->sy_obj.versioned_name);
+	  S_SET_NAME (symp, sy_obj->versioned_name);
 	}
       else
 	{
@@ -1497,7 +1577,7 @@
              where the loop will still see it.  It would probably be
              better to do this in obj_frob_file_before_adjust. */
 
-	  symp2 = symbol_find_or_make (symp->sy_obj.versioned_name);
+	  symp2 = symbol_find_or_make (sy_obj->versioned_name);
 
 	  /* Now we act as though we saw symp2 = sym.  */
 
@@ -1505,9 +1585,11 @@
 
 	  /* Subtracting out the frag address here is a hack because
              we are in the middle of the final loop.  */
-	  S_SET_VALUE (symp2, S_GET_VALUE (symp) - symp->sy_frag->fr_address);
+	  S_SET_VALUE (symp2,
+		       (S_GET_VALUE (symp)
+			- symbol_get_frag (symp)->fr_address));
 
-	  symp2->sy_frag = symp->sy_frag;
+	  symbol_set_frag (symp2, symbol_get_frag (symp));
 
 	  /* This will copy over the size information.  */
 	  copy_symbol_attributes (symp2, symp);
@@ -1521,7 +1603,7 @@
     }
 
   /* Double check weak symbols.  */
-  if (symp->bsym->flags & BSF_WEAK)
+  if (S_IS_WEAK (symp))
     {
       if (S_IS_COMMON (symp))
 	as_bad (_("Symbol `%s' can not be both weak and common"),
@@ -1537,19 +1619,21 @@
      .global directives to mark functions.  */
 
   if (S_IS_COMMON (symp))
-    symp->bsym->flags |= BSF_OBJECT;
+    symbol_get_bfdsym (symp)->flags |= BSF_OBJECT;
 
   if (strstr (TARGET_OS, "irix") != NULL
-      && (! S_IS_DEFINED (symp) && ((symp->bsym->flags & BSF_FUNCTION) == 0)))
-    symp->bsym->flags |= BSF_OBJECT;
+      && ! S_IS_DEFINED (symp)
+      && (symbol_get_bfdsym (symp)->flags & BSF_FUNCTION) == 0)
+    symbol_get_bfdsym (symp)->flags |= BSF_OBJECT;
 #endif
 
 #ifdef TC_PPC
   /* Frob the PowerPC, so that the symbol always has object type
      if it is not some other type.  VxWorks needs this.  */
-  if ((symp->bsym->flags & (BSF_FUNCTION | BSF_FILE | BSF_SECTION_SYM)) == 0
+  if ((symbol_get_bfdsym (symp)->flags
+       & (BSF_FUNCTION | BSF_FILE | BSF_SECTION_SYM)) == 0
       && S_IS_DEFINED (symp))
-    symp->bsym->flags |= BSF_OBJECT;
+    symbol_get_bfdsym (symp)->flags |= BSF_OBJECT;
 #endif
 }
 
diff --git a/gas/config/obj-elf.h b/gas/config/obj-elf.h
index 2f4bc5f..d39998e 100644
--- a/gas/config/obj-elf.h
+++ b/gas/config/obj-elf.h
@@ -1,5 +1,6 @@
 /* ELF object file format.
-   Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -34,6 +35,22 @@
 #define BYTES_IN_WORD 4		/* for now */
 #include "bfd/elf-bfd.h"
 
+#include "targ-cpu.h"
+
+#ifdef TC_ALPHA
+#define ECOFF_DEBUGGING alpha_flag_mdebug
+extern int alpha_flag_mdebug;
+#endif
+
+/* For now, always set ECOFF_DEBUGGING for a MIPS target.  */
+#ifdef TC_MIPS
+#ifdef MIPS_STABS_ELF
+#define ECOFF_DEBUGGING 0
+#else
+#define ECOFF_DEBUGGING 1
+#endif /* MIPS_STABS_ELF */
+#endif /* TC_MIPS */
+
 /* Additional information we keep for each symbol.  */
 
 /* FIXME: For some reason, this structure is needed both here and in
@@ -41,25 +58,28 @@
 #ifndef OBJ_SYMFIELD_TYPE
 struct elf_obj_sy
 {
+  /* Whether the symbol has been marked as local.  */
+  int local;
+
   /* Use this to keep track of .size expressions that involve
      differences that we can't compute yet.  */
   expressionS *size;
 
   /* The name specified by the .symver directive.  */
   char *versioned_name;
+
+#ifdef ECOFF_DEBUGGING
+  /* If we are generating ECOFF debugging information, we need some
+     additional fields for each symbol.  */
+  struct efdr *ecoff_file;
+  struct localsym *ecoff_symbol;
+  valueT ecoff_extern_size;
+#endif
 };
 #endif
 
 #define OBJ_SYMFIELD_TYPE struct elf_obj_sy
 
-/* Symbol fields used by the ELF back end.  */
-#define ELF_TARGET_SYMBOL_FIELDS int local:1;
-
-/* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead.  */
-#define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS
-
-#include "targ-cpu.h"
-
 #ifndef FALSE
 #define FALSE 0
 #define TRUE  !FALSE
@@ -71,17 +91,20 @@
 /* should be conditional on address size! */
 #define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd))
 
-#define S_GET_SIZE(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_size)
+#define S_GET_SIZE(S) \
+  (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_size)
 #define S_SET_SIZE(S,V) \
-  (elf_symbol((S)->bsym)->internal_elf_sym.st_size = (V))
+  (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_size = (V))
 
-#define S_GET_ALIGN(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_value)
+#define S_GET_ALIGN(S) \
+  (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value)
 #define S_SET_ALIGN(S,V) \
-  (elf_symbol ((S)->bsym)->internal_elf_sym.st_value = (V))
+  (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value = (V))
 
-#define S_GET_OTHER(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_other)
+#define S_GET_OTHER(S) \
+  (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_other)
 #define S_SET_OTHER(S,V) \
-  (elf_symbol ((S)->bsym)->internal_elf_sym.st_other = (V))
+  (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_other = (V))
 
 extern asection *gdb_section;
 
@@ -99,6 +122,9 @@
 extern void obj_elf_section PARAMS ((int));
 extern void obj_elf_previous PARAMS ((int));
 extern void obj_elf_version PARAMS ((int));
+extern void obj_elf_common PARAMS ((int));
+extern void obj_elf_data PARAMS ((int));
+extern void obj_elf_text PARAMS ((int));
 
 /* BFD wants to write the udata field, which is a no-no for the
    globally defined sections.  */
@@ -110,18 +136,20 @@
 #define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC)			\
 do								\
   {								\
-    if ((SRC)->sy_obj.size)					\
+    struct elf_obj_sy *srcelf = symbol_get_obj (SRC);		\
+    struct elf_obj_sy *destelf = symbol_get_obj (DEST);		\
+    if (srcelf->size)						\
       {								\
-	if ((DEST)->sy_obj.size == NULL)			\
-	  (DEST)->sy_obj.size =					\
+	if (destelf->size == NULL)				\
+	  destelf->size =					\
 	    (expressionS *) xmalloc (sizeof (expressionS));	\
-	*(DEST)->sy_obj.size = *(SRC)->sy_obj.size;		\
+	*destelf->size = *srcelf->size;				\
       }								\
     else							\
       {								\
-	if ((DEST)->sy_obj.size != NULL)			\
-	  free ((DEST)->sy_obj.size);				\
-	(DEST)->sy_obj.size = NULL;				\
+	if (destelf->size != NULL)				\
+	  free (destelf->size);					\
+	destelf->size = NULL;					\
       }								\
     S_SET_SIZE ((DEST), S_GET_SIZE (SRC));			\
     S_SET_OTHER ((DEST), S_GET_OTHER (SRC));			\
@@ -136,30 +164,7 @@
 extern void obj_elf_init_stab_section PARAMS ((segT));
 #define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg)
 
-#ifdef TC_ALPHA
-#define ECOFF_DEBUGGING alpha_flag_mdebug
-extern int alpha_flag_mdebug;
-#endif
-
-/* For now, always set ECOFF_DEBUGGING for a MIPS target.  */
-#ifdef TC_MIPS
-#ifdef MIPS_STABS_ELF
-#define ECOFF_DEBUGGING 0
-#else
-#define ECOFF_DEBUGGING 1
-#endif /* MIPS_STABS_ELF */
-#endif /* TC_MIPS */
-
 #ifdef ECOFF_DEBUGGING
-/* If we are generating ECOFF debugging information, we need some
-   additional fields for each symbol.  */
-#undef TARGET_SYMBOL_FIELDS
-#define TARGET_SYMBOL_FIELDS \
-  ELF_TARGET_SYMBOL_FIELDS \
-  struct efdr *ecoff_file; \
-  struct localsym *ecoff_symbol; \
-  valueT ecoff_extern_size;
-
 /* We smuggle stabs in ECOFF rather than using a separate section.
    The Irix linker can not handle a separate stabs section.  */
 
@@ -175,7 +180,7 @@
     ecoff_stab ((seg), (what), (string), (type), (other), (desc))
 #endif /* ECOFF_DEBUGGING */
 
-extern void elf_frob_symbol PARAMS ((struct symbol *, int *));
+extern void elf_frob_symbol PARAMS ((symbolS *, int *));
 #ifndef obj_frob_symbol
 #define obj_frob_symbol(symp, punt) elf_frob_symbol (symp, &punt)
 #endif
@@ -188,7 +193,7 @@
 #ifdef ANSI_PROTOTYPES
 struct ecoff_extr;
 #endif
-extern void elf_ecoff_set_ext PARAMS ((struct symbol *, struct ecoff_extr *));
+extern void elf_ecoff_set_ext PARAMS ((symbolS *, struct ecoff_extr *));
 #endif
 
 #endif /* _OBJ_ELF_H */
diff --git a/gas/config/obj-multi.h b/gas/config/obj-multi.h
index fe8d98d..d54c61f 100644
--- a/gas/config/obj-multi.h
+++ b/gas/config/obj-multi.h
@@ -25,26 +25,20 @@
 
 /* FIXME: What's the story here?  Why do we have to define
    OBJ_SYMFIELD_TYPE both here and in obj-elf.h?  */
+
 #ifdef OBJ_MAYBE_ELF
 struct elf_obj_sy
 {
+  int local;
   expressionS *size;
   char *versioned_name;
+#ifdef ECOFF_DEBUGGING
+  /* If we are generating ECOFF debugging information, we need some
+     additional fields for each symbol.  */
+  struct efdr *ecoff_file;
+  struct localsym *ecoff_symbol;
+  valueT ecoff_extern_size;
+#endif
 };
 #define OBJ_SYMFIELD_TYPE struct elf_obj_sy
-#define ELF_TARGET_SYMBOL_FIELDS int local:1;
-#else
-#define ELF_TARGET_SYMBOL_FIELDS
 #endif
-
-#ifdef ECOFF_DEBUGGING
-struct efdr;
-struct localsym;
-#define ECOFF_DEBUG_TARGET_SYMBOL_FIELDS struct efdr *ecoff_file; struct localsym *ecoff_symbol; valueT ecoff_extern_size;
-#else
-#define ECOFF_DEBUG_TARGET_SYMBOL_FIELDS
-#endif
-
-#define TARGET_SYMBOL_FIELDS \
-	ELF_TARGET_SYMBOL_FIELDS \
-	ECOFF_DEBUG_TARGET_SYMBOL_FIELDS
diff --git a/gas/config/obj-vms.h b/gas/config/obj-vms.h
index ac0c1fb..ad8fdce 100644
--- a/gas/config/obj-vms.h
+++ b/gas/config/obj-vms.h
@@ -1,5 +1,5 @@
 /* VMS object file format
-   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 1997
+   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 1999
    Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
@@ -214,18 +214,17 @@
 /* Force structure tags into scope so that their use in prototypes
    will never be their first occurance.  */
 struct fix;
-struct symbol;
 struct frag;
 
 /* obj-vms routines visible to the rest of gas.  */
 
 extern void tc_aout_fix_to_chars PARAMS ((char *,struct fix *,relax_addressT));
 
-extern int vms_resolve_symbol_redef PARAMS ((struct symbol *));
+extern int vms_resolve_symbol_redef PARAMS ((symbolS *));
 #define RESOLVE_SYMBOL_REDEFINITION(X)	vms_resolve_symbol_redef(X)
 
 /* Compiler-generated label "__vax_g_doubles" is used to augment .stabs. */
-extern void vms_check_for_special_label PARAMS ((struct symbol *));
+extern void vms_check_for_special_label PARAMS ((symbolS *));
 #define obj_frob_label(X) vms_check_for_special_label(X)
 
 extern void vms_check_for_main PARAMS ((void));
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index 568617f..69432dc 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -4,7 +4,7 @@
    Written by Alessandro Forin, based on earlier gas-1.38 target CPU files.
    Modified by Ken Raeburn for gas-2.x and ECOFF support.
    Modified by Richard Henderson for ELF support.
-   Modified by Klaus K"ampf for EVAX (openVMS/Alpha) support.
+   Modified by Klaus K"ampf for EVAX (OpenVMS/Alpha) support.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -96,8 +96,9 @@
 /* Two extra symbols we want to see in our input.  This is a blatent
    misuse of the expressionS.X_op field.  */
 
-#define O_pregister	(O_max+1)	/* O_register, but in parentheses */
-#define O_cpregister	(O_pregister+1)	/* + a leading comma */
+#define O_pregister  ((operatorT) (O_max+1)) /* O_register, in parentheses */
+#define O_cpregister ((operatorT) (O_pregister+1)) /* + a leading comma */
+#define O_alpha_max  ((operatorT) (O_cpregister+1))
 
 /* Macros for extracting the type and number of encoded register tokens */
 
@@ -709,6 +710,13 @@
 {
   unsigned int i;
 
+  /* Verify that X_op field is wide enough.  */
+  {
+    expressionS e;
+    e.X_op = O_alpha_max;
+    assert (e.X_op == O_alpha_max);
+  }
+
   /* Create the opcode hash table */
 
   alpha_opcode_hash = hash_new ();
@@ -1081,7 +1089,7 @@
 #endif
 
     do_reloc_gp:
-      fixP->fx_addsy = section_symbol (absolute_section);
+      fixP->fx_addsy = section_symbol (now_seg);
       md_number_to_chars (fixpos, value, 2);
       break;
 
@@ -1173,7 +1181,7 @@
 	   Therefore they must be completely resolved as constants.  */
 
 	if (fixP->fx_addsy != 0
-	    && fixP->fx_addsy->bsym->section != absolute_section)
+	    && S_GET_SEGMENT (fixP->fx_addsy) != absolute_section)
 	  as_bad_where (fixP->fx_file, fixP->fx_line,
 			_("non-absolute expression in constant field"));
 
@@ -1393,7 +1401,8 @@
   arelent *reloc;
 
   reloc = (arelent *) xmalloc (sizeof (arelent));
-  reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
 
   /* Make sure none of our internal relocations make it this far.
@@ -1435,7 +1444,7 @@
        */
       if ((S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy))
 	  && !S_IS_COMMON(fixp->fx_addsy))
-	reloc->addend -= fixp->fx_addsy->bsym->value;
+	reloc->addend -= symbol_get_bfdsym (fixp->fx_addsy)->value;
 #endif
     }
 
@@ -2109,9 +2118,6 @@
   expressionS newtok[3];
   expressionS addend;
 
-  /* We're going to need this symbol in md_apply_fix().  */
-  (void) section_symbol (absolute_section);
-
 #ifdef OBJ_ECOFF
   if (regno (tok[2].X_add_number) == AXP_REG_PV)
     ecoff_set_gp_prolog_size (0);
@@ -2175,7 +2181,7 @@
   segment_info_type *seginfo = seg_info (alpha_link_section);
   fixS *fixp;
 
-  offset = -basesym->sy_obj;
+  offset = - *symbol_get_obj (basesym);
 
   /* @@ This assumes all entries in a given section will be of the same
      size...  Probably correct, but unwise to rely on.  */
@@ -2498,7 +2504,8 @@
 	}
       insn.nfixups++;
       insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITUSE;
-      insn.fixups[0].exp.X_op = O_constant;
+      insn.fixups[0].exp.X_op = O_symbol;
+      insn.fixups[0].exp.X_add_symbol = section_symbol (now_seg);
       insn.fixups[0].exp.X_add_number = 1;
       emit_lituse = 0;
 
@@ -2649,7 +2656,8 @@
 	}
       insn.nfixups++;
       insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITUSE;
-      insn.fixups[0].exp.X_op = O_constant;
+      insn.fixups[0].exp.X_op = O_symbol;
+      insn.fixups[0].exp.X_add_symbol = section_symbol (now_seg);
       insn.fixups[0].exp.X_add_number = 1;
     }
 
@@ -2702,7 +2710,8 @@
 	}
       insn.nfixups++;
       insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITUSE;
-      insn.fixups[0].exp.X_op = O_constant;
+      insn.fixups[0].exp.X_op = O_symbol;
+      insn.fixups[0].exp.X_add_symbol = section_symbol (now_seg);
       insn.fixups[0].exp.X_add_number = 1;
     }
 
@@ -3287,7 +3296,8 @@
 	}
       insn.nfixups++;
       insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITUSE;
-      insn.fixups[0].exp.X_op = O_constant;
+      insn.fixups[0].exp.X_op = O_symbol;
+      insn.fixups[0].exp.X_add_symbol = section_symbol (now_seg);
       insn.fixups[0].exp.X_add_number = 3;
     }
 
@@ -3457,7 +3467,7 @@
       p = frag_more (temp);
       new_seg->flags |= SEC_IS_COMMON;
       if (! S_IS_DEFINED (symbolP))
-	symbolP->bsym->section = new_seg;
+	S_SET_SEGMENT (symbolP, new_seg);
 #else
       S_SET_VALUE (symbolP, (valueT) temp);
 #endif
@@ -3468,7 +3478,7 @@
   subseg_set (current_section, current_subsec);
 #endif
 
-  know (symbolP->sy_frag == &zero_address_frag);
+  know (symbol_get_frag (symbolP) == &zero_address_frag);
 
   demand_empty_rest_of_line ();
 }
@@ -3557,7 +3567,7 @@
 	    as_warn (_("nested .ent directives"));
 
 	  sym = symbol_find_or_make (name);
-	  sym->bsym->flags |= BSF_FUNCTION;
+	  symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION;
 	  alpha_cur_ent_sym = sym;
 
 	  /* The .ent directive is sometimes followed by a number.  Not sure
@@ -3604,12 +3614,13 @@
 	  /* Create an expression to calculate the size of the function.  */
 	  if (sym)
 	    {
-	      sym->sy_obj.size = (expressionS *) xmalloc (sizeof (expressionS));
-	      sym->sy_obj.size->X_op = O_subtract;
-	      sym->sy_obj.size->X_add_symbol
+	      symbol_get_obj (sym)->size =
+		(expressionS *) xmalloc (sizeof (expressionS));
+	      symbol_get_obj (sym)->size->X_op = O_subtract;
+	      symbol_get_obj (sym)->size->X_add_symbol
 	        = symbol_new ("L0\001", now_seg, frag_now_fix (), frag_now);
-	      sym->sy_obj.size->X_op_symbol = sym;
-	      sym->sy_obj.size->X_add_number = 0;
+	      symbol_get_obj (sym)->size->X_op_symbol = sym;
+	      symbol_get_obj (sym)->size->X_add_number = 0;
 	    }
 
 	  alpha_cur_ent_sym = NULL;
@@ -3765,7 +3776,7 @@
     }
 
   symbol = make_expr_symbol (&symexpr);
-  symbol->bsym->flags |= BSF_FUNCTION;
+  symbol_get_bfdsym (symbol)->flags |= BSF_FUNCTION;
   alpha_evax_proc.symbol = symbol;
 
   demand_empty_rest_of_line ();
@@ -3837,7 +3848,8 @@
       return;
     }
 
-  alpha_evax_proc.symbol->sy_obj = (valueT)seginfo->literal_pool_size;
+  *symbol_get_obj (alpha_evax_proc.symbol) =
+    (valueT) seginfo->literal_pool_size;
 
   expression (&exp);
   if (exp.X_op != O_symbol)
@@ -3849,7 +3861,8 @@
 
   entry_sym = make_expr_symbol (&exp);
   /* Save bfd symbol of proc desc in function symbol.  */
-  alpha_evax_proc.symbol->bsym->udata.p = (PTR)entry_sym->bsym;
+  symbol_get_bfdsym (alpha_evax_proc.symbol)->udata.p
+    = symbol_get_bfdsym (entry_sym);
 
   SKIP_WHITESPACE ();
   if (*input_line_pointer++ != ',')
@@ -4140,14 +4153,14 @@
   extern char *demand_copy_string PARAMS ((int *lenP));
 
   sprintf (case_hack, "<CASE:%01d%01d>",
-	    alpha_flag_hash_long_names, alpha_flag_show_after_trunc);
+	   alpha_flag_hash_long_names, alpha_flag_show_after_trunc);
 
   s = symbol_find_or_make (case_hack);
-  s->bsym->flags |= BSF_FILE;
+  symbol_get_bfdsym (s)->flags |= BSF_FILE;
 
   get_absolute_expression ();
   s = symbol_find_or_make (demand_copy_string (&length));
-  s->bsym->flags |= BSF_FILE;
+  symbol_get_bfdsym (s)->flags |= BSF_FILE;
   demand_empty_rest_of_line ();
 
   return;
@@ -4282,7 +4295,7 @@
       input_line_pointer++;
       temp = get_absolute_expression ();
     }
-  /*  symbolP->sy_other = (signed char) temp; */
+  /*  *symbol_get_obj (symbolP) = (signed char) temp; */
   as_warn (_("unhandled: .proc %s,%d"), name, temp);
   demand_empty_rest_of_line ();
 }
@@ -4745,7 +4758,7 @@
   if (label != NULL)
     {
       assert (S_GET_SEGMENT (label) == now_seg);
-      label->sy_frag = frag_now;
+      symbol_set_frag (label, frag_now);
       S_SET_VALUE (label, (valueT) frag_now_fix ());
     }
 
diff --git a/gas/config/tc-alpha.h b/gas/config/tc-alpha.h
index ca6903a..a350513 100644
--- a/gas/config/tc-alpha.h
+++ b/gas/config/tc-alpha.h
@@ -85,7 +85,7 @@
 extern void alpha_frob_ecoff_data PARAMS ((void));
 
 #define tc_frob_label(sym) alpha_define_label (sym)
-extern void alpha_define_label PARAMS ((struct symbol *));
+extern void alpha_define_label PARAMS ((symbolS *));
 
 #define md_cons_align(nbytes) alpha_cons_align (nbytes)
 extern void alpha_cons_align PARAMS ((int));
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index c07c2d7..3aafea3 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -1,5 +1,5 @@
 /* tc-arc.c -- Assembler for the ARC
-   Copyright (C) 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
    Contributed by Doug Evans (dje@cygnus.com).
 
    This file is part of GAS, the GNU Assembler.
@@ -15,8 +15,9 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with GAS; see the file COPYING.  If not, write to
-   the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA. */
 
 #include <stdio.h>
 #include <ctype.h>
@@ -797,7 +798,7 @@
 		   S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size);
 	}
     }
-  assert (symbolP->sy_frag == &zero_address_frag);
+  assert (symbol_get_frag (symbolP) == &zero_address_frag);
   if (*input_line_pointer != ',')
     {
       as_bad (_("expected comma after common length"));
@@ -830,8 +831,8 @@
 	  if (align)
 	    frag_align (align, 0, 0);
 	  if (S_GET_SEGMENT (symbolP) == bss_section)
-	    symbolP->sy_frag->fr_symbol = 0;
-	  symbolP->sy_frag = frag_now;
+	    symbol_get_frag (symbolP)->fr_symbol = 0;
+	  symbol_set_frag (symbolP, frag_now);
 	  p = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP,
 			(offsetT) size, (char *) 0);
 	  *p = 0;
@@ -966,7 +967,7 @@
   new = (char *) xmalloc (strlen (name) + 1);
   strcpy (new, name);
   *input_line_pointer = c;
-  sym->sy_tc.real_name = new;
+  symbol_get_tc (sym)->real_name = new;
 
   demand_empty_rest_of_line ();
 }
@@ -1241,13 +1242,13 @@
 
   if (exp->X_op == O_right_shift
       && exp->X_op_symbol != NULL
-      && exp->X_op_symbol->sy_value.X_op == O_constant
-      && exp->X_op_symbol->sy_value.X_add_number == 2
+      && symbol_constant_p (exp->X_op_symbol)
+      && S_GET_VALUE (exp->X_op_symbol) == 2
       && exp->X_add_number == 0)
     {
       if (exp->X_add_symbol != NULL
-	  && (exp->X_add_symbol->sy_value.X_op == O_constant
-	      || exp->X_add_symbol->sy_value.X_op == O_symbol))
+	  && (symbol_constant_p (exp->X_add_symbol)
+	      || symbol_equated_p (exp->X_add_symbol)))
 	{
 	  *expnew = *exp;
 	  expnew->X_op = O_symbol;
@@ -1255,9 +1256,10 @@
 	  return data_p ? BFD_RELOC_ARC_B26 : arc_operand_map['J'];
 	}
       else if (exp->X_add_symbol != NULL
-	       && exp->X_add_symbol->sy_value.X_op == O_subtract)
+	       && (symbol_get_value_expression (exp->X_add_symbol)->X_op
+		   == O_subtract))
 	{
-	  *expnew = exp->X_add_symbol->sy_value;
+	  *expnew = *symbol_get_value_expression (exp->X_add_symbol);
 	  return data_p ? BFD_RELOC_ARC_B26 : arc_operand_map['J'];
 	}
     }
@@ -1445,7 +1447,8 @@
 
   reloc = (arelent *) xmalloc (sizeof (arelent));
 
-  reloc->sym_ptr_ptr = &fixP->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
   reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
   reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
   if (reloc->howto == (reloc_howto_type *) NULL)
@@ -1473,8 +1476,8 @@
 arc_frob_symbol (sym)
      symbolS *sym;
 {
-  if (sym->sy_tc.real_name != (char *) NULL)
-    S_SET_NAME (sym, sym->sy_tc.real_name);
+  if (symbol_get_tc (sym)->real_name != (char *) NULL)
+    S_SET_NAME (sym, symbol_get_tc (sym)->real_name);
 
   return 0;
 }
diff --git a/gas/config/tc-arc.h b/gas/config/tc-arc.h
index 6a95ff4..5066201 100644
--- a/gas/config/tc-arc.h
+++ b/gas/config/tc-arc.h
@@ -1,5 +1,5 @@
 /* tc-arc.h - Macros and type defines for the ARC.
-   Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
    Contributed by Doug Evans (dje@cygnus.com).
 
    This file is part of GAS, the GNU Assembler.
@@ -66,6 +66,6 @@
 #define TC_SYMFIELD_TYPE struct arc_tc_sy
 
 /* Finish up the symbol.  */
-extern int arc_frob_symbol PARAMS ((struct symbol *));
+extern int arc_frob_symbol PARAMS ((symbolS *));
 #define tc_frob_symbol(sym, punt) punt = arc_frob_symbol (sym)
 #endif
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index d898bf0..7a90601 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -51,12 +51,17 @@
 #define ARM_LONGMUL	0x00000010	/* allow long multiplies */
 #define ARM_HALFWORD    0x00000020	/* allow half word loads */
 #define ARM_THUMB       0x00000040	/* allow BX instruction  */
+#define ARM_EXT_V5	0x00000080	/* allow CLZ etc	 */
 
-#define ARM_ARCHv4	(ARM_7 | ARM_LONGMUL | ARM_HALFWORD)
+/* Architectures are the sum of the base and extensions */
+#define ARM_ARCH_V4	(ARM_7 | ARM_LONGMUL | ARM_HALFWORD)
+#define ARM_ARCH_V4T	(ARM_ARCH_V4 | ARM_THUMB)
+#define ARM_ARCH_V5	(ARM_ARCH_V4 | ARM_EXT_V5)
+#define ARM_ARCH_V5T	(ARM_ARCH_V5 | ARM_THUMB)
 
 /* Some useful combinations:  */
 #define ARM_ANY		0x00ffffff
-#define ARM_2UP		0x00fffffe
+#define ARM_2UP		(ARM_ANY - ARM_1)
 #define ARM_ALL		ARM_2UP		/* Not arm1 only */
 #define ARM_3UP		0x00fffffc
 #define ARM_6UP		0x00fffff8      /* Includes ARM7 */
@@ -73,7 +78,7 @@
      
 #ifndef CPU_DEFAULT
 #if defined __thumb__
-#define CPU_DEFAULT (ARM_ARCHv4 | ARM_THUMB)
+#define CPU_DEFAULT (ARM_ARCH_V4 | ARM_THUMB)
 #else
 #define CPU_DEFAULT ARM_ALL
 #endif
@@ -419,6 +424,7 @@
 static void do_swi		PARAMS ((char *operands, unsigned long flags));
 /* Pseudo Op codes */
 static void do_adr		PARAMS ((char *operands, unsigned long flags));
+static void do_adrl		PARAMS ((char * operands, unsigned long flags));
 static void do_nop		PARAMS ((char *operands, unsigned long flags));
 /* ARM 2 */
 static void do_mul		PARAMS ((char *operands, unsigned long flags));
@@ -455,6 +461,7 @@
 					 valueT, fragS *));
 static int add_to_lit_pool	PARAMS ((void));
 static unsigned validate_immediate	PARAMS ((unsigned));
+static unsigned validate_immediate_twopart	PARAMS ((unsigned int, unsigned int *));
 static int validate_offset_imm	PARAMS ((int, int));
 static void opcode_select	PARAMS ((int));
 static void end_of_line		PARAMS ((char *));
@@ -484,9 +491,9 @@
 static void set_constant_flonums	PARAMS ((void));
 static valueT md_chars_to_number	PARAMS ((char *, int));
 static void insert_reg_alias	PARAMS ((char *, int));
-static void output_inst		PARAMS ((char *));
+static void output_inst		PARAMS ((void));
 #ifdef OBJ_ELF
-static bfd_reloc_code_real_type	arm_parse_reloc(void);
+static bfd_reloc_code_real_type	arm_parse_reloc PARAMS ((void));
 #endif
 
 /* ARM instructions take 4bytes in the object file, Thumb instructions
@@ -540,6 +547,7 @@
 
 /* Pseudo ops */
   {"adr",   0x028f0000, NULL,   NULL,        ARM_ANY,      do_adr},
+  {"adrl",  0x028f0000, NULL,   NULL,        ARM_ANY,      do_adrl},
   {"nop",   0x01a00000, NULL,   NULL,        ARM_ANY,      do_nop},
 
 /* ARM 2 multiplies */
@@ -870,8 +878,8 @@
   {NULL, 0}
 };
 
-#define bad_args _("Bad arguments to instruction");
-#define bad_pc _("r15 not allowed here");
+#define bad_args 	_("Bad arguments to instruction");
+#define bad_pc 		_("r15 not allowed here");
 
 static struct hash_control * arm_ops_hsh = NULL;
 static struct hash_control * arm_tops_hsh = NULL;
@@ -897,7 +905,11 @@
 static void s_code PARAMS ((int));
 static void s_force_thumb PARAMS ((int));
 static void s_thumb_func PARAMS ((int));
+static void s_thumb_set PARAMS ((int));
+static void arm_s_text PARAMS ((int));
+static void arm_s_data PARAMS ((int));
 #ifdef OBJ_ELF
+static void arm_s_section PARAMS ((int));
 static void s_arm_elf_cons PARAMS ((int));
 #endif
 
@@ -905,27 +917,35 @@
 
 CONST pseudo_typeS md_pseudo_table[] =
 {
-  {"req",         s_req, 0},	/* Never called becasue '.req' does not start line */
-  {"bss",         s_bss, 0},
-  {"align",       s_align, 0},
-  {"arm",         s_arm, 0},
-  {"thumb",       s_thumb, 0},
-  {"code",        s_code, 0},
-  {"force_thumb", s_force_thumb, 0},
-  {"thumb_func",  s_thumb_func, 0},
-  {"even",        s_even, 0},
-  {"ltorg",       s_ltorg, 0},
-  {"pool",        s_ltorg, 0},
+  { "req",         s_req,         0 },	/* Never called becasue '.req' does not start line */
+  { "bss",         s_bss,         0 },
+  { "align",       s_align,       0 },
+  { "arm",         s_arm,         0 },
+  { "thumb",       s_thumb,       0 },
+  { "code",        s_code,        0 },
+  { "force_thumb", s_force_thumb, 0 },
+  { "thumb_func",  s_thumb_func,  0 },
+  { "thumb_set",   s_thumb_set,   0 },
+  { "even",        s_even,        0 },
+  { "ltorg",       s_ltorg,       0 },
+  { "pool",        s_ltorg,       0 },
+  /* Allow for the effect of section changes.  */
+  { "text",        arm_s_text,    0 },
+  { "data",        arm_s_data,    0 },
 #ifdef OBJ_ELF  
-  {"word",        s_arm_elf_cons, 4},
-  {"long",        s_arm_elf_cons, 4},
+  { "section",     arm_s_section, 0 },
+  { "section.s",   arm_s_section, 0 },
+  { "sect",        arm_s_section, 0 },
+  { "sect.s",      arm_s_section, 0 },
+  { "word",        s_arm_elf_cons, 4 },
+  { "long",        s_arm_elf_cons, 4 },
 #else
-  {"word",        cons, 4},
+  { "word",        cons, 4},
 #endif
-  {"extend",      float_cons, 'x'},
-  {"ldouble",     float_cons, 'x'},
-  {"packed",      float_cons, 'p'},
-  {0, 0, 0}
+  { "extend",      float_cons, 'x' },
+  { "ldouble",     float_cons, 'x' },
+  { "packed",      float_cons, 'p' },
+  { 0, 0, 0 }
 };
 
 /* Stuff needed to resolve the label ambiguity
@@ -955,7 +975,6 @@
 int       next_literal_pool_place = 0; /* Next free entry in the pool */
 int       lit_pool_num = 1; /* Next literal pool number */
 symbolS * current_poolP = NULL;
-symbolS * symbol_make_empty PARAMS ((void)); 
 
 static int
 add_to_lit_pool ()
@@ -963,7 +982,8 @@
   int lit_count = 0;
 
   if (current_poolP == NULL)
-    current_poolP = symbol_make_empty ();
+    current_poolP = symbol_create (FAKE_LABEL_NAME, undefined_section,
+				   (valueT) 0, &zero_address_frag);
 
   /* Check if this literal value is already in the pool: */
   while (lit_count < next_literal_pool_place)
@@ -1027,7 +1047,7 @@
   S_SET_VALUE (symbolP, valu);
   symbol_clear_list_pointers(symbolP);
 
-  symbolP->sy_frag = frag;
+  symbol_set_frag (symbolP, frag);
 
   /* Link to end of symbol chain.  */
   {
@@ -1049,23 +1069,6 @@
 #endif /* DEBUG_SYMS */
 }
 
-symbolS *
-symbol_make_empty () 
-{
-  symbolS * symbolP; 
-
-  symbolP = (symbolS *) obstack_alloc (&notes, sizeof (symbolS));
-
-  /* symbol must be born in some fixed state.  This seems as good as any. */
-  memset (symbolP, 0, sizeof (symbolS));
-
-  symbolP->bsym = bfd_make_empty_symbol (stdoutput);
-  assert (symbolP->bsym != 0);
-  symbolP->bsym->udata.p = (PTR) symbolP;
-
-  return symbolP;
-}
-
 /* Check that an immediate is valid, and if so, convert it to the right format.  */
 
 static unsigned int
@@ -1084,6 +1087,47 @@
   return FAIL;
 }
 
+/* Check to see if an immediate can be computed as two seperate immediate
+   values, added together.  We already know that this value cannot be
+   computed by just one ARM instruction.  */
+
+static unsigned int
+validate_immediate_twopart (val, highpart)
+     unsigned int val;
+     unsigned int * highpart;
+{
+  unsigned int a;
+  unsigned int i;
+  
+  for (i = 0; i < 32; i += 2)
+    if (((a = rotate_left (val, i)) & 0xff) != 0)
+      {
+	if (a & 0xff00)
+	  {
+	    if (a & ~ 0xffff)
+	      continue;
+	    * highpart = (a  >> 8) | ((i + 24) << 7);
+	  }
+	else if (a & 0xff0000)
+	  {
+	    if (a & 0xff000000)
+	      continue;
+
+	    * highpart = (a >> 16) | ((i + 16) << 7);
+	  }
+	else
+	  {
+	    assert (a & 0xff000000);
+
+	    * highpart = (a >> 24) | ((i + 8) << 7);
+	  }
+
+	return (a & 0xff) | (i << 7);
+      }
+  
+  return FAIL;
+}
+
 static int
 validate_offset_imm (val, hwse)
      int val;
@@ -1126,19 +1170,14 @@
 }
 
 static void
-s_ltorg (internal)
-     int internal;
+s_ltorg (ignored)
+     int ignored;
 {
   int lit_count = 0;
   char sym_name[20];
 
   if (current_poolP == NULL)
-    {
-      /* Nothing to do */
-      if (!internal)
-	as_tsktsk (_("Nothing to put in the pool\n"));
-      return;
-    }
+    return;
 
   /* Align pool as you have word accesses */
   /* Only make a frag if we have to ... */
@@ -1147,9 +1186,6 @@
 
   record_alignment (now_seg, 2);
 
-  if (internal)
-    as_tsktsk (_("Inserting implicit pool at change of section"));
-
   sprintf (sym_name, "$$lit_\002%x", lit_pool_num++);
 
   symbol_locate (current_poolP, sym_name, now_seg,
@@ -1238,6 +1274,135 @@
   demand_empty_rest_of_line ();
 }
 
+/* Perform a .set directive, but also mark the alias as
+   being a thumb function.  */
+
+static void
+s_thumb_set (equiv)
+     int equiv;
+{
+  /* XXX the following is a duplicate of the code for s_set() in read.c
+     We cannot just call that code as we need to get at the symbol that
+     is created.  */
+  register char *    name;
+  register char      delim;
+  register char *    end_name;
+  register symbolS * symbolP;
+
+  /*
+   * Especial apologies for the random logic:
+   * this just grew, and could be parsed much more simply!
+   * Dean in haste.
+   */
+  name      = input_line_pointer;
+  delim     = get_symbol_end ();
+  end_name  = input_line_pointer;
+  *end_name = delim;
+  
+  SKIP_WHITESPACE ();
+
+  if (*input_line_pointer != ',')
+    {
+      *end_name = 0;
+      as_bad (_("Expected comma after name \"%s\""), name);
+      *end_name = delim;
+      ignore_rest_of_line ();
+      return;
+    }
+
+  input_line_pointer++;
+  *end_name = 0;
+
+  if (name[0] == '.' && name[1] == '\0')
+    {
+      /* XXX - this should not happen to .thumb_set  */
+      abort ();
+    }
+
+  if ((symbolP = symbol_find (name)) == NULL
+      && (symbolP = md_undefined_symbol (name)) == NULL)
+    {
+#ifndef NO_LISTING
+      /* When doing symbol listings, play games with dummy fragments living
+	 outside the normal fragment chain to record the file and line info
+         for this symbol.  */
+      if (listing & LISTING_SYMBOLS)
+	{
+	  extern struct list_info_struct * listing_tail;
+	  fragS * dummy_frag = (fragS *) xmalloc (sizeof(fragS));
+	  memset (dummy_frag, 0, sizeof(fragS));
+	  dummy_frag->fr_type = rs_fill;
+	  dummy_frag->line = listing_tail;
+	  symbolP = symbol_new (name, undefined_section, 0, dummy_frag);
+	  dummy_frag->fr_symbol = symbolP;
+	}
+      else
+#endif
+        symbolP = symbol_new (name, undefined_section, 0, &zero_address_frag);
+			    
+#ifdef OBJ_COFF
+      /* "set" symbols are local unless otherwise specified. */
+      SF_SET_LOCAL (symbolP);
+#endif /* OBJ_COFF */
+    }				/* make a new symbol */
+
+  symbol_table_insert (symbolP);
+
+  * end_name = delim;
+
+  if (equiv
+      && S_IS_DEFINED (symbolP)
+      && S_GET_SEGMENT (symbolP) != reg_section)
+    as_bad (_("symbol `%s' already defined"), S_GET_NAME (symbolP));
+
+  pseudo_set (symbolP);
+  
+  demand_empty_rest_of_line ();
+
+  /* XXX now we come to the Thumb specific bit of code.  */
+  
+  THUMB_SET_FUNC (symbolP, 1);
+  ARM_SET_THUMB (symbolP, 1);
+  ARM_SET_INTERWORK (symbolP, support_interwork);
+}
+
+/* If we change section we must dump the literal pool first.  */
+static void
+arm_s_text (ignore)
+     int ignore;
+{
+  if (now_seg != text_section)
+    s_ltorg (0);
+  
+  s_text (ignore);
+}
+
+static void
+arm_s_data (ignore)
+     int ignore;
+{
+  if (flag_readonly_data_in_text)
+    {
+      if (now_seg != text_section)
+	s_ltorg (0);
+    }
+  else if (now_seg != data_section)
+    s_ltorg (0);
+  
+  s_data (ignore);
+}
+
+#ifdef OBJ_ELF
+static void
+arm_s_section (ignore)
+     int ignore;
+{
+  s_ltorg (0);
+
+  obj_elf_section (ignore);
+}
+#endif
+
 static void
 opcode_select (width)
      int width;
@@ -2039,14 +2204,14 @@
 walk_no_bignums (sp)
      symbolS * sp;
 {
-  if (sp->sy_value.X_op == O_big)
+  if (symbol_get_value_expression (sp)->X_op == O_big)
     return 1;
 
-  if (sp->sy_value.X_add_symbol)
+  if (symbol_get_value_expression (sp)->X_add_symbol)
     {
-      return (walk_no_bignums (sp->sy_value.X_add_symbol)
-	      || (sp->sy_value.X_op_symbol
-		  && walk_no_bignums (sp->sy_value.X_op_symbol)));
+      return (walk_no_bignums (symbol_get_value_expression (sp)->X_add_symbol)
+	      || (symbol_get_value_expression (sp)->X_op_symbol
+		  && walk_no_bignums (symbol_get_value_expression (sp)->X_op_symbol)));
     }
 
   return 0;
@@ -2491,6 +2656,41 @@
 }
 
 static void
+do_adrl (str, flags)
+     char *        str;
+     unsigned long flags;
+{
+  /* This is a pseudo-op of the form "adrl rd, label" to be converted
+     into a relative address of the form:
+     	add rd, pc, #low(label-.-8)"
+     	add rd, rd, #high(label-.-8)"   */
+
+  while (* str == ' ')
+    str ++;
+
+  if (reg_required_here (& str, 12) == FAIL
+      || skip_past_comma (& str) == FAIL
+      || my_get_expression (& inst.reloc.exp, & str))
+    {
+      if (!inst.error)
+	inst.error = bad_args;
+      return;
+    }
+  
+  end_of_line (str);
+  
+  /* Frag hacking will turn this into a sub instruction if the offset turns
+     out to be negative.  */
+  inst.reloc.type              = BFD_RELOC_ARM_ADRL_IMMEDIATE;
+  inst.reloc.exp.X_add_number -= 8; /* PC relative adjust */
+  inst.reloc.pc_rel            = 1;
+  inst.instruction            |= flags;
+  inst.size                    = INSN_SIZE * 2;
+  
+  return;
+}
+
+static void
 do_cmp (str, flags)
      char *        str;
      unsigned long flags;
@@ -2584,7 +2784,7 @@
           /* Halfword and signextension instructions have the
              immediate value split across bits 11..8 and bits 3..0 */
           if (hwse)
-            inst.instruction |= add | HWOFFSET_IMM | (value >> 4) << 8 | value & 0xF;
+            inst.instruction |= add | HWOFFSET_IMM | ((value >> 4) << 8) | (value & 0xF);
           else
             inst.instruction |= add | value;
 	}
@@ -2635,7 +2835,8 @@
   /* This is not ideal, but it is the simplest way of dealing with the
      ARM7T halfword instructions (since they use a different
      encoding, but the same mnemonic): */
-  if (halfword = ((flags & 0x80000000) != 0))
+  halfword = (flags & 0x80000000) != 0;
+  if (halfword)
     {
       /* This is actually a load/store of a halfword, or a
          signed-extension load */
@@ -4835,6 +5036,7 @@
     if (support_interwork) flags |= F_INTERWORK;
     if (uses_apcs_float)   flags |= F_APCS_FLOAT;
     if (pic_code)          flags |= F_PIC;
+    if ((cpu_variant & FPU_ALL) == FPU_NONE) flags |= F_SOFT_FLOAT;
 
     bfd_set_private_flags (stdoutput, flags);
   }
@@ -4867,9 +5069,13 @@
     /* Catch special cases */
     if (cpu_variant != (FPU_DEFAULT | CPU_DEFAULT))
       {
-	if (cpu_variant & ARM_THUMB)
+	if (cpu_variant & (ARM_EXT_V5 & ARM_THUMB))
+	  mach = bfd_mach_arm_5T;
+	else if (cpu_variant & ARM_EXT_V5)
+	  mach = bfd_mach_arm_5;
+	else if (cpu_variant & ARM_THUMB)
 	  mach = bfd_mach_arm_4T;
-	else if ((cpu_variant & ARM_ARCHv4) == ARM_ARCHv4)
+	else if ((cpu_variant & ARM_ARCH_V4) == ARM_ARCH_V4)
 	  mach = bfd_mach_arm_4;
 	else if (cpu_variant & ARM_LONGMUL)
 	  mach = bfd_mach_arm_3M;
@@ -5010,8 +5216,7 @@
   return 0;
 }
 
-/* The knowledge of the PC's pipeline offset is built into the relocs
-   for the ELF port and into the insns themselves for the COFF port.  */
+/* The knowledge of the PC's pipeline offset is built into the insns themselves.  */ 
 long
 md_pcrel_from (fixP)
      fixS * fixP;
@@ -5028,7 +5233,7 @@
 	 for the calculation */
       return (fixP->fx_where + fixP->fx_frag->fr_address) & ~3;
     }
-  
+
   return fixP->fx_where + fixP->fx_frag->fr_address;
 }
 
@@ -5163,7 +5368,7 @@
 
   /* Note whether this will delete the relocation.  */
 #if 0 /* patch from REarnshaw to JDavis (disabled for the moment, since it doesn't work fully) */
-  if ((fixP->fx_addsy == 0 || fixP->fx_addsy->sy_value.X_op == O_constant)
+  if ((fixP->fx_addsy == 0 || symbol_constant_p (fixP->fx_addsy))
       && !fixP->fx_pcrel)
 #else
   if (fixP->fx_addsy == 0 && !fixP->fx_pcrel)
@@ -5179,7 +5384,8 @@
 	  && S_IS_DEFINED (fixP->fx_addsy)
 	  && S_GET_SEGMENT (fixP->fx_addsy) != seg)
 	{
-	  if (fixP->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH)
+	  if (target_oabi
+	      && fixP->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH)
 	    value = 0;
 	  else
 	    value += md_pcrel_from (fixP);
@@ -5200,7 +5406,8 @@
 	  && (newimm = negate_data_op (&temp, value)) == (unsigned int) FAIL)
 	{
 	  as_bad_where (fixP->fx_file, fixP->fx_line,
-			_("invalid constant (%x) after fixup\n"), value);
+			_("invalid constant (%lx) after fixup\n"),
+			(unsigned long) value);
 	  break;
 	}
 
@@ -5208,11 +5415,55 @@
       md_number_to_chars (buf, (valueT) newimm, INSN_SIZE);
       break;
 
-     case BFD_RELOC_ARM_OFFSET_IMM:
+    case BFD_RELOC_ARM_ADRL_IMMEDIATE:
+      {
+	unsigned int highpart = 0;
+	unsigned int newinsn  = 0xe1a00000; /* nop */
+	newimm = validate_immediate (value);
+	temp = md_chars_to_number (buf, INSN_SIZE);
+
+	/* If the instruction will fail, see if we can fix things up by
+	   changing the opcode.  */
+	if (newimm == (unsigned int) FAIL
+	    && (newimm = negate_data_op (& temp, value)) == (unsigned int) FAIL)
+	  {
+	    /* No ?  OK - try using two ADD instructions to generate the value.  */
+	    newimm = validate_immediate_twopart (value, & highpart);
+
+	    /* Yes - then make sure that the second instruction is also an add.  */
+	    if (newimm != (unsigned int) FAIL)
+	      newinsn = temp;
+	    /* Still No ?  Try using a negated value.  */
+	    else if (validate_immediate_twopart (- value, & highpart) != (unsigned int) FAIL)
+		temp = newinsn = (temp & OPCODE_MASK) | OPCODE_SUB << DATA_OP_SHIFT;
+	    /* Otherwise - give up.  */
+	    else
+	      {
+		as_bad_where (fixP->fx_file, fixP->fx_line,
+			      _("Unable to compute ADRL instructions for PC offset of 0x%x\n"), value);
+		break;
+	      }
+
+	    /* Replace the first operand in the 2nd instruction (which is the PC)
+	       with the destination register.  We have already added in the PC in the
+	       first instruction and we do not want to do it again.  */
+	    newinsn &= ~ 0xf0000;
+	    newinsn |= ((newinsn & 0x0f000) << 4);
+	  }
+
+	newimm |= (temp & 0xfffff000);
+	md_number_to_chars (buf, (valueT) newimm, INSN_SIZE);
+
+	highpart |= (newinsn & 0xfffff000);
+	md_number_to_chars (buf + INSN_SIZE, (valueT) highpart, INSN_SIZE);
+      }
+      break;
+
+    case BFD_RELOC_ARM_OFFSET_IMM:
       sign = value >= 0;
       if ((value = validate_offset_imm (value, 0)) == FAIL)
         {
-          as_bad (_("bad immediate value for offset (%d)"), val);
+          as_bad (_("bad immediate value for offset (%ld)"), (long) value);
           break;
         }
       if (value < 0)
@@ -5233,7 +5484,7 @@
 	    as_bad_where (fixP->fx_file, fixP->fx_line, 
 			_("invalid literal constant: pool needs to be closer\n"));
           else
-            as_bad (_("bad immediate value for offset (%d)"), value);
+            as_bad (_("bad immediate value for offset (%ld)"), (long) value);
           break;
         }
 
@@ -5242,7 +5493,7 @@
 
       newval = md_chars_to_number (buf, INSN_SIZE);
       newval &= 0xff7ff0f0;
-      newval |= ((value >> 4) << 8) | value & 0xf | (sign ? INDEX_UP : 0);
+      newval |= ((value >> 4) << 8) | (value & 0xf) | (sign ? INDEX_UP : 0);
       md_number_to_chars (buf, newval, INSN_SIZE);
       break;
 
@@ -5315,14 +5566,12 @@
 
     case BFD_RELOC_ARM_PCREL_BRANCH:
       newval = md_chars_to_number (buf, INSN_SIZE);
+
 #ifdef OBJ_ELF
-      newval &= 0xff000000;
       if (! target_oabi)
         value = fixP->fx_offset;
-      else
-#else
-	value = (value >> 2) & 0x00ffffff;
 #endif
+      value  = (value >> 2) & 0x00ffffff;
       value  = (value + (newval & 0x00ffffff)) & 0x00ffffff;
       newval = value | (newval & 0xff000000);
       md_number_to_chars (buf, newval, INSN_SIZE);
@@ -5504,7 +5753,8 @@
 
 	default:
 	  as_bad_where (fixP->fx_file, fixP->fx_line,
-			"Unable to process relocation for thumb opcode: %x", newval);
+			"Unable to process relocation for thumb opcode: %lx",
+			(unsigned long) newval);
 	  break;
 	}
       md_number_to_chars (buf, newval, THUMB_SIZE);
@@ -5543,7 +5793,8 @@
             if (subtract ||
                 value & ~0x3fc)
               as_bad_where (fixP->fx_file, fixP->fx_line,
-                            _("Invalid immediate for address calculation (value = 0x%08X)"), value);
+                            _("Invalid immediate for address calculation (value = 0x%08lX)"),
+			    (unsigned long) value);
             newval = (rs == REG_PC ? T_OPCODE_ADD_PC : T_OPCODE_ADD_SP);
             newval |= rd << 8;
             newval |= value >> 2;
@@ -5576,7 +5827,8 @@
         case 0x05: /* 8bit immediate CMP */
           if (value < 0 || value > 255)
             as_bad_where (fixP->fx_file, fixP->fx_line,
-                          _("Invalid immediate: %d is too large"), value);
+                          _("Invalid immediate: %ld is too large"),
+			  (long) value);
           newval |= value;
           break;
 
@@ -5590,7 +5842,7 @@
       /* 5bit shift value (0..31) */
       if (value < 0 || value > 31)
 	as_bad_where (fixP->fx_file, fixP->fx_line,
-		      _("Illegal Thumb shift value: %d"), value);
+		      _("Illegal Thumb shift value: %ld"), (long) value);
       newval = md_chars_to_number (buf, THUMB_SIZE) & 0xf03f;
       newval |= value << 6;
       md_number_to_chars (buf, newval , THUMB_SIZE);
@@ -5622,7 +5874,8 @@
 
   reloc = (arelent *) xmalloc (sizeof (arelent));
 
-  reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
 
   /* @@ Why fx_addnumber sometimes and fx_offset other times?  */
@@ -5671,17 +5924,11 @@
     case BFD_RELOC_ARM_LITERAL:
     case BFD_RELOC_ARM_HWLITERAL:
       /* If this is called then the a literal has been referenced across
-	 a section boundry - possibly due to an implicit dump */
+	 a section boundary - possibly due to an implicit dump */
       as_bad_where (fixp->fx_file, fixp->fx_line,
-		    _("Literal referenced across section boundry (Implicit dump?)"));
+		    _("Literal referenced across section boundary (Implicit dump?)"));
       return NULL;
 
-    case BFD_RELOC_ARM_GOTPC:
-      assert (fixp->fx_pcrel != 0);
-      code = fixp->fx_r_type;
-      code = BFD_RELOC_32_PCREL;
-      break;
-
 #ifdef OBJ_ELF
     case BFD_RELOC_ARM_GOT32:
     case BFD_RELOC_ARM_GOTOFF:
@@ -5696,6 +5943,12 @@
 		    fixp->fx_r_type);
       return NULL;
 
+    case BFD_RELOC_ARM_ADRL_IMMEDIATE:
+      as_bad_where (fixp->fx_file, fixp->fx_line,
+		    _("ADRL used for a symbol not defined in the same file"),
+		    fixp->fx_r_type);
+      return NULL;
+
     case BFD_RELOC_ARM_OFFSET_IMM:
       as_bad_where (fixp->fx_file, fixp->fx_line,
 		    _("Internal_relocation (type %d) not fixed up (OFFSET_IMM)"),
@@ -5731,7 +5984,10 @@
  if (code == BFD_RELOC_32_PCREL
      && GOT_symbol
      && fixp->fx_addsy == GOT_symbol)
-   code = BFD_RELOC_ARM_GOTPC;
+   {
+     code = BFD_RELOC_ARM_GOTPC;
+     reloc->addend = fixp->fx_offset = reloc->address;
+   }
 #endif
    
   reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
@@ -5757,8 +6013,7 @@
 }
 
 static void
-output_inst (str)
-     char * str;
+output_inst PARAMS ((void))
 {
   char * to = NULL;
     
@@ -5773,7 +6028,13 @@
     {
       assert (inst.size == (2 * THUMB_SIZE));
       md_number_to_chars (to, inst.instruction >> 16, THUMB_SIZE);
-      md_number_to_chars (to + 2, inst.instruction, THUMB_SIZE);
+      md_number_to_chars (to + THUMB_SIZE, inst.instruction, THUMB_SIZE);
+    }
+  else if (inst.size > INSN_SIZE)
+    {
+      assert (inst.size == (2 * INSN_SIZE));
+      md_number_to_chars (to, inst.instruction, INSN_SIZE);
+      md_number_to_chars (to + INSN_SIZE, inst.instruction, INSN_SIZE);
     }
   else
     md_number_to_chars (to, inst.instruction, inst.size);
@@ -5803,7 +6064,7 @@
   /* Align the previous label if needed.  */
   if (last_label_seen != NULL)
     {
-      last_label_seen->sy_frag = frag_now;
+      symbol_set_frag (last_label_seen, frag_now);
       S_SET_VALUE (last_label_seen, (valueT) frag_now_fix ());
       S_SET_SEGMENT (last_label_seen, now_seg);
     }
@@ -5813,7 +6074,7 @@
 
   if (*str == ' ')
     str++;			/* Skip leading white space */
-    
+  
   /* Scan up to the end of the op-code, which must end in white space or
      end of string.  */
   for (start = p = str; *p != '\0'; p++)
@@ -5828,24 +6089,25 @@
 
   if (thumb_mode)
     {
-      CONST struct thumb_opcode *opcode;
+      CONST struct thumb_opcode * opcode;
 
       c = *p;
       *p = '\0';
       opcode = (CONST struct thumb_opcode *) hash_find (arm_tops_hsh, str);
       *p = c;
+      
       if (opcode)
 	{
 	  inst.instruction = opcode->value;
 	  inst.size = opcode->size;
 	  (*opcode->parms)(p);
-	  output_inst (start);
+	  output_inst ();
 	  return;
 	}
     }
   else
     {
-      CONST struct asm_opcode *opcode;
+      CONST struct asm_opcode * opcode;
 
       inst.size = INSN_SIZE;
       /* p now points to the end of the opcode, probably white space, but we
@@ -5859,10 +6121,11 @@
 	  *q = '\0';
 	  opcode = (CONST struct asm_opcode *) hash_find (arm_ops_hsh, str);
 	  *q = c;
+	  
 	  if (opcode && opcode->template)
 	    {
 	      unsigned long flag_bits = 0;
-	      char *r;
+	      char * r;
 
 	      /* Check that this instruction is supported for this CPU */
 	      if ((opcode->variants & cpu_variant) == 0)
@@ -5879,7 +6142,7 @@
 		      inst.instruction |= COND_ALWAYS;
 		      (*opcode->parms)(q, 0);
 		    }
-		  output_inst (start);
+		  output_inst ();
 		  return;
 		}
 
@@ -5964,7 +6227,7 @@
 		}
 
 	      (*opcode->parms) (p, flag_bits);
-	      output_inst (start);
+	      output_inst ();
 	      return;
 	    }
 
@@ -6051,7 +6314,10 @@
  *            -m[arm]3                Arm 3 processor
  *            -m[arm]6[xx],           Arm 6 processors
  *            -m[arm]7[xx][t][[d]m]   Arm 7 processors
- *            -mstrongarm[110]	      Arm 8 processors
+ *            -m[arm]8[10]            Arm 8 processors
+ *            -m[arm]9[20][tdmi]      Arm 9 processors
+ *            -mstrongarm[110[0]]     StrongARM processors
+ *            -m[arm]v[2345]	      Arm architecures
  *            -mall                   All (except the ARM1)
  *    FP variants:
  *            -mfpa10, -mfpa11        FPA10 and 11 co-processor instructions
@@ -6140,7 +6406,7 @@
             }
           else if (streq (str, "thumb-interwork"))
             {
-              cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_THUMB | ARM_ARCHv4;
+              cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_THUMB | ARM_ARCH_V4;
 #if defined OBJ_COFF || defined OBJ_ELF
               support_interwork = true;
 #endif
@@ -6274,7 +6540,7 @@
                 switch (* str)
                   {
                   case 't':
-                    cpu_variant |= (ARM_THUMB | ARM_ARCHv4);
+                    cpu_variant |= (ARM_THUMB | ARM_ARCH_V4);
                     break;
 
                   case 'm':
@@ -6301,16 +6567,20 @@
 
 	    case '8':
 	      if (streq (str, "8") || streq (str, "810"))
-		cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_8 | ARM_ARCHv4 | ARM_LONGMUL;
+		cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_8 | ARM_ARCH_V4 | ARM_LONGMUL;
 	      else
 		goto bad;
 	      break;
 	      
 	    case '9':
 	      if (streq (str, "9"))
-		cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCHv4 | ARM_LONGMUL;
+		cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL | ARM_THUMB;
+	      else if (streq (str, "920"))
+		cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL;
+	      else if (streq (str, "920t"))
+		cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL | ARM_THUMB;
 	      else if (streq (str, "9tdmi"))
-		cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCHv4 | ARM_LONGMUL | ARM_THUMB;
+		cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL | ARM_THUMB;
 	      else
 		goto bad;
 	      break;
@@ -6319,7 +6589,7 @@
 	      if (streq (str, "strongarm")
 		  || streq (str, "strongarm110")
 		  || streq (str, "strongarm1100"))
-		cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_8 | ARM_ARCHv4 | ARM_LONGMUL;
+		cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_8 | ARM_ARCH_V4 | ARM_LONGMUL;
 	      else
 		goto bad;
 	      break;
@@ -6349,7 +6619,18 @@
 		  break;
 		  
 		case '4':
-		  cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_ARCHv4;
+		  cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_ARCH_V4;
+		  
+		  switch (*++str)
+		    {
+		    case 't': cpu_variant |= ARM_THUMB; break;
+		    case 0:   break;
+		    default:  as_bad (_("Invalid architecture variant -m%s"), arg); break;
+		    }
+		  break;
+		  
+		case '5':
+		  cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_ARCH_V5;
 		  
 		  switch (*++str)
 		    {
@@ -6392,7 +6673,7 @@
 _("\
  ARM Specific Assembler Options:\n\
   -m[arm][<processor name>] select processor variant\n\
-  -m[arm]v[2|2a|3|3m|4|4t]  select architecture variant\n\
+  -m[arm]v[2|2a|3|3m|4|4t|5]select architecture variant\n\
   -mthumb                   only allow Thumb instructions\n\
   -mthumb-interwork         mark the assembled code as supporting interworking\n\
   -mall                     allow any instruction\n\
@@ -6469,24 +6750,7 @@
 }
 
 
-/*
- * This fix_new is called by cons via TC_CONS_FIX_NEW
- *
- * We check the expression to see if it is of the form
- *  __GLOBAL_OFFSET_TABLE + ???
- * If it is then this is a PC relative reference to the GOT.
- * i.e.
- * 	ldr	sl, L1
- * 	add	sl, pc, sl
- * L2:
- * 	...
- * L1:
- *	.word	__GLOBAL_OFFSET_TABLE + (. - (L2 + 4))
- *
- * In this case use a reloc type BFD_RELOC_ARM_GOTPC instead of the
- * normal BFD_RELOC_{16,32,64}
- */
-
+/* This fix_new is called by cons via TC_CONS_FIX_NEW.  */
 void
 cons_fix_new_arm (frag, where, size, exp)
      fragS *       frag;
@@ -6515,13 +6779,6 @@
       break;
     }
   
-  /* Look for possible GOTPC reloc */
-  
-  /*
-   * Look for pic assembler and 'undef symbol + expr symbol' expression
-   * and a 32 bit size.
-   */
-  
   fix_new_exp (frag, where, (int) size, exp, pcrel, type);
 }
 
@@ -6613,7 +6870,7 @@
         }
 
       if (ARM_IS_INTERWORK (sym))
-	coffsymbol(sym->bsym)->native->u.syment.n_flags = 0xFF;
+	coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_flags = 0xFF;
     }
 #endif
 #ifdef OBJ_ELF
@@ -6627,7 +6884,7 @@
         {
 	  if (THUMB_IS_FUNC (sym))
 	    {
-	      elf_sym = elf_symbol (sym->bsym);
+	      elf_sym = elf_symbol (symbol_get_bfdsym (sym));
 	      bind = ELF_ST_BIND (elf_sym);
 	      elf_sym->internal_elf_sym.st_info = ELF_ST_INFO (bind, STT_ARM_TFUNC);
             }
@@ -6854,4 +7111,3 @@
 }
 
 #endif /* OBJ_ELF */
-
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h
index bf99e24..d27d61d 100644
--- a/gas/config/tc-arm.h
+++ b/gas/config/tc-arm.h
@@ -1,5 +1,6 @@
 /* This file is tc-arm.h
-   Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999
+   Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 	Modified by David Taylor (dtaylor@armltd.co.uk)
 
@@ -103,7 +104,7 @@
  extern void arm_start_line_hook PARAMS ((void));
 
 #define tc_frob_label(S) arm_frob_label (S)
- extern void arm_frob_label PARAMS ((struct symbol *));
+ extern void arm_frob_label PARAMS ((symbolS *));
 
 /* We also need to mark assembler created symbols:  */
 #define tc_frob_fake_label(S) arm_frob_label (S)
@@ -121,9 +122,9 @@
 /* We need to keep some local information on symbols.  */
 
 #define TC_SYMFIELD_TYPE unsigned int
-#define ARM_GET_FLAG(s)   	((s)->sy_tc)
-#define ARM_SET_FLAG(s,v) 	((s)->sy_tc |= (v))
-#define ARM_RESET_FLAG(s,v) 	((s)->sy_tc &= ~(v))
+#define ARM_GET_FLAG(s)   	(*symbol_get_tc (s))
+#define ARM_SET_FLAG(s,v) 	(*symbol_get_tc (s) |= (v))
+#define ARM_RESET_FLAG(s,v) 	(*symbol_get_tc (s) &= ~(v))
 
 #define ARM_FLAG_THUMB 		(1 << 0)	/* The symbol is a Thumb symbol rather than an Arm symbol.  */
 #define ARM_FLAG_INTERWORK 	(1 << 1)	/* The symbol is attached to code that suppports interworking.  */
@@ -170,6 +171,9 @@
 
 #define LOCAL_LABEL(name) (name[0] == '.' && (name[1] == 'L'))
 #define LOCAL_LABELS_FB   1
+#ifdef OBJ_ELF
+#define LOCAL_LABEL_PREFIX '.'
+#endif
 
 /* This expression evaluates to false if the relocation is for a local object
    for which we still want to do the relocation at runtime.  True if we
diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c
index cf38f3e..33926fb 100644
--- a/gas/config/tc-d10v.c
+++ b/gas/config/tc-d10v.c
@@ -1,6 +1,5 @@
 /* tc-d10v.c -- Assembler code for the Mitsubishi D10V
-
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -37,8 +36,8 @@
 
 #define AT_WORD_P(X) ((X)->X_op == O_right_shift \
 		      && (X)->X_op_symbol != NULL \
-		      && (X)->X_op_symbol->sy_value.X_op == O_constant \
-		      && (X)->X_op_symbol->sy_value.X_add_number == AT_WORD_RIGHT_SHIFT)
+		      && symbol_constant_p ((X)->X_op_symbol) \
+		      && S_GET_VALUE ((X)->X_op_symbol) == AT_WORD_RIGHT_SHIFT)
 #define AT_WORD_RIGHT_SHIFT 2
 
 
@@ -63,6 +62,8 @@
 static Fixups FixUps[2];
 static Fixups *fixups;
 
+static int do_not_ignore_hash = 0;
+
 /* True if instruction swapping warnings should be inhibited.  */
 static unsigned char flag_warn_suppress_instructionswap; /* --nowarnswap */
 
@@ -159,7 +160,7 @@
     {
       expressionP->X_op = O_register;
       /* temporarily store a pointer to the string here */
-      expressionP->X_op_symbol = (struct symbol *)input_line_pointer;
+      expressionP->X_op_symbol = (symbolS *)input_line_pointer;
       expressionP->X_add_number = reg_number;
       input_line_pointer = p;
       return 1;
@@ -393,7 +394,8 @@
   char *p = input_line_pointer;
   int numops = 0;
   int post = 0;
-
+  int uses_at = 0;
+  
   while (*p)  
     {
       while (*p == ' ' || *p == '\t' || *p == ',') 
@@ -403,6 +405,8 @@
       
       if (*p == '@') 
 	{
+	  uses_at = 1;
+	  
 	  p++;
 	  exp[numops].X_op = O_absent;
 	  if (*p == '(') 
@@ -437,7 +441,20 @@
       if (!register_name (&exp[numops]))
 	{
 	  /* parse as an expression */
-	  expression (&exp[numops]);
+	  if (uses_at)
+	    {
+	      /* Any expression that involves the indirect addressing
+		 cannot also involve immediate addressing.  Therefore
+		 the use of the hash character is illegal.  */
+	      int save = do_not_ignore_hash;
+	      do_not_ignore_hash = 1;
+	      
+	      expression (&exp[numops]);
+	      
+	      do_not_ignore_hash = save;
+	    }
+	  else
+	    expression (&exp[numops]);
 	}
 
       if (strncasecmp (input_line_pointer, "@word", 5) == 0)
@@ -1376,7 +1393,8 @@
 {
   arelent *reloc;
   reloc = (arelent *) xmalloc (sizeof (arelent));
-  reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
   reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
   if (reloc->howto == (reloc_howto_type *) NULL)
@@ -1595,7 +1613,7 @@
 md_operand (expressionP)
      expressionS *expressionP;
 {
-  if (*input_line_pointer == '#')
+  if (*input_line_pointer == '#' && ! do_not_ignore_hash)
     {
       input_line_pointer++;
       expression (expressionP);
diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c
index c5033ba..0682a57 100644
--- a/gas/config/tc-d30v.c
+++ b/gas/config/tc-d30v.c
@@ -1,6 +1,5 @@
 /* tc-d30v.c -- Assembler code for the Mitsubishi D30V
-
-   Copyright (C) 1997, 1998 Free Software Foundation.
+   Copyright (C) 1997, 1998, 1999 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -216,7 +215,7 @@
     {
       expressionP->X_op = O_register;
       /* temporarily store a pointer to the string here */
-      expressionP->X_op_symbol = (struct symbol *)input_line_pointer;
+      expressionP->X_op_symbol = (symbolS *)input_line_pointer;
       expressionP->X_add_number = reg_number;
       input_line_pointer = p;
       return 1;
@@ -1745,7 +1744,8 @@
 {
   arelent *reloc;
   reloc = (arelent *) xmalloc (sizeof (arelent));
-  reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
   reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
   if (reloc->howto == (reloc_howto_type *) NULL)
@@ -2028,7 +2028,7 @@
   d30v_cleanup (false);
 
   /* Update the label's address with the current output pointer.  */
-  lab->sy_frag = frag_now;
+  symbol_set_frag (lab, frag_now);
   S_SET_VALUE (lab, (valueT) frag_now_fix ());
 
   /* Record this label for future adjustment after we find out what
@@ -2110,7 +2110,7 @@
       
       assert (S_GET_SEGMENT (label) == now_seg);
 
-      old_frag  = label->sy_frag;
+      old_frag  = symbol_get_frag (label);
       old_value = S_GET_VALUE (label);
       new_value = (valueT) frag_now_fix ();
       
@@ -2125,15 +2125,16 @@
 	 in the target fragment.  Note, this search is guaranteed to
 	 find at least one match when sym == label, so no special case
 	 code is necessary.  */
-      for (sym = symbol_lastP; sym != NULL; sym = sym->sy_previous)
+      for (sym = symbol_lastP; sym != NULL; sym = symbol_previous (sym))
 	{
-	  if (sym->sy_frag == old_frag && S_GET_VALUE (sym) == old_value)
+	  if (symbol_get_frag (sym) == old_frag
+	      && S_GET_VALUE (sym) == old_value)
 	    {
 	      label_seen = true;
-	      sym->sy_frag = frag_now;
+	      symbol_set_frag (sym, frag_now);
 	      S_SET_VALUE (sym, new_value);
 	    }
-	  else if (label_seen && sym->sy_frag != old_frag)
+	  else if (label_seen && symbol_get_frag (sym) != old_frag)
 	    break;
 	}
     }
diff --git a/gas/config/tc-d30v.h b/gas/config/tc-d30v.h
index acce285..dfebbb9 100644
--- a/gas/config/tc-d30v.h
+++ b/gas/config/tc-d30v.h
@@ -1,5 +1,5 @@
 /* tc-310v.h -- Header file for tc-d30v.c.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Martin Hunt, Cygnus Support.
 
    This file is part of GAS, the GNU Assembler.
@@ -15,8 +15,9 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with GAS; see the file COPYING.  If not, write to
-   the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA. */
 
 #define TC_D30V
 
@@ -52,7 +53,7 @@
 #define TC_START_LABEL(ch, ptr)      (ch == ':' && d30v_cleanup (false))
 #define md_start_line_hook()	     d30v_start_line (false)
 
-void d30v_frob_label PARAMS ((struct symbol *));
+void d30v_frob_label PARAMS ((symbolS *));
 #define tc_frob_label(sym)	     d30v_frob_label(sym)
 
 void d30v_cons_align PARAMS ((int));
diff --git a/gas/config/tc-fr30.c b/gas/config/tc-fr30.c
index aa075b7..aca5880 100644
--- a/gas/config/tc-fr30.c
+++ b/gas/config/tc-fr30.c
@@ -384,7 +384,7 @@
     {
       /* Address we want to reach in file space.  */
       target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
-      target_address += fragP->fr_symbol->sy_frag->fr_address;
+      target_address += symbol_get_frag (fragP->fr_symbol)->fr_address;
       addend = (target_address - (opcode_address & -4)) >> 2;
     }
 
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index 8785de8..82e07d3 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -1,5 +1,6 @@
 /* tc-hppa.c -- Assemble for the PA
-   Copyright (C) 1989, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -34,32 +35,30 @@
 /* Be careful, this file includes data *declarations*.  */
 #include "opcode/hppa.h"
 
+#if defined (OBJ_ELF) && defined (OBJ_SOM)
+error only one of OBJ_ELF and OBJ_SOM can be defined
+#endif
+
 /* A "convient" place to put object file dependencies which do
    not need to be seen outside of tc-hppa.c.  */
 #ifdef OBJ_ELF
-/* Names of various debugging spaces/subspaces.  */
-#define GDB_DEBUG_SPACE_NAME ".stab"
-#define GDB_STRINGS_SUBSPACE_NAME ".stabstr"
-#define GDB_SYMBOLS_SUBSPACE_NAME ".stab"
-#define UNWIND_SECTION_NAME ".PARISC.unwind"
-/* Nonzero if CODE is a fixup code needing further processing.  */
-
 /* Object file formats specify relocation types.  */
-typedef elf32_hppa_reloc_type reloc_type;
+typedef elf_hppa_reloc_type reloc_type;
 
 /* Object file formats specify BFD symbol types.  */
 typedef elf_symbol_type obj_symbol_type;
 
+#ifdef BFD64
 /* How to generate a relocation.  */
-#define hppa_gen_reloc_type hppa_elf_gen_reloc_type
+#define hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type
+#else
+#define hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type
+#endif
 
 /* ELF objects can have versions, but apparently do not have anywhere
    to store a copyright string.  */
 #define obj_version obj_elf_version
 #define obj_copyright obj_elf_version
-
-/* Use space aliases.  */
-#define USE_ALIASES 1
 #endif
 
 #ifdef OBJ_SOM
@@ -76,9 +75,6 @@
 #define obj_version obj_som_version
 #define obj_copyright obj_som_copyright
 
-/* Do not use space aliases.  */
-#define USE_ALIASES 0
-
 /* How to generate a relocation.  */
 #define hppa_gen_reloc_type hppa_som_gen_reloc_type
 
@@ -267,6 +263,7 @@
     unsigned int arg_count;
   };
 
+#ifdef OBJ_SOM
 /* This structure defines an entry in the subspace dictionary
    chain.  */
 
@@ -321,17 +318,6 @@
 
 typedef struct space_dictionary_chain sd_chain_struct;
 
-/* Structure for previous label tracking.  Needed so that alignments,
-   callinfo declarations, etc can be easily attached to a particular
-   label.  */
-typedef struct label_symbol_struct
-  {
-    struct symbol *lss_label;
-    sd_chain_struct *lss_space;
-    struct label_symbol_struct *lss_next;
-  }
-label_symbol_struct;
-
 /* This structure defines attributes of the default subspace
    dictionary entries.  */
 
@@ -378,9 +364,6 @@
     /* An index into the default spaces array.  */
     int def_space_index;
 
-    /* An alias for this section (or NULL if no alias exists).  */
-    char *alias;
-
     /* Subsegment associated with this subspace.  */
     subsegT subsegment;
   };
@@ -411,10 +394,24 @@
 
     /* Segment associated with this space.  */
     asection *segment;
-
-    /* An alias for this section (or NULL if no alias exists).  */
-    char *alias;
   };
+#endif
+
+/* Structure for previous label tracking.  Needed so that alignments,
+   callinfo declarations, etc can be easily attached to a particular
+   label.  */
+typedef struct label_symbol_struct
+  {
+    struct symbol *lss_label;
+#ifdef OBJ_SOM
+    sd_chain_struct *lss_space;
+#endif
+#ifdef OBJ_ELF
+    segT lss_segment;
+#endif
+    struct label_symbol_struct *lss_next;
+  }
+label_symbol_struct;
 
 /* Extra information needed to perform fixups (relocations) on the PA.  */
 struct hppa_fix_struct
@@ -461,7 +458,10 @@
 
 /* Prototypes for functions local to tc-hppa.c.  */
 
+#ifdef OBJ_SOM
 static void pa_check_current_space_and_subspace PARAMS ((void));
+#endif
+
 static fp_operand_format pa_parse_fp_format PARAMS ((char **s));
 static void pa_cons PARAMS ((int));
 static void pa_data PARAMS ((int));
@@ -483,7 +483,6 @@
 static int pa_parse_neg_cmpsub_cmpltr PARAMS ((char **, int));
 static int pa_parse_neg_add_cmpltr PARAMS ((char **, int));
 static int pa_parse_nonneg_add_cmpltr PARAMS ((char **, int));
-static void pa_align PARAMS ((int));
 static void pa_block PARAMS ((int));
 static void pa_brtab PARAMS ((int));
 static void pa_try PARAMS ((int));
@@ -492,9 +491,6 @@
 static void pa_callinfo PARAMS ((int));
 static void pa_code PARAMS ((int));
 static void pa_comm PARAMS ((int));
-#ifdef OBJ_SOM
-static void pa_compiler PARAMS ((int));
-#endif
 static void pa_copyright PARAMS ((int));
 static void pa_end PARAMS ((int));
 static void pa_enter PARAMS ((int));
@@ -510,15 +506,18 @@
 static void pa_origin PARAMS ((int));
 static void pa_proc PARAMS ((int));
 static void pa_procend PARAMS ((int));
-static void pa_space PARAMS ((int));
-static void pa_spnum PARAMS ((int));
-static void pa_subspace PARAMS ((int));
 static void pa_param PARAMS ((int));
 static void pa_undefine_label PARAMS ((void));
 static int need_pa11_opcode PARAMS ((struct pa_it *,
 				     struct pa_11_fp_reg_struct *));
 static int pa_parse_number PARAMS ((char **, struct pa_11_fp_reg_struct *));
 static label_symbol_struct *pa_get_label PARAMS ((void));
+#ifdef OBJ_SOM
+static void pa_compiler PARAMS ((int));
+static void pa_align PARAMS ((int));
+static void pa_space PARAMS ((int));
+static void pa_spnum PARAMS ((int));
+static void pa_subspace PARAMS ((int));
 static sd_chain_struct *create_new_space PARAMS ((char *, int, int,
 						  int, int, int,
 						  asection *, int));
@@ -539,6 +538,10 @@
 							    subsegT));
 static sd_chain_struct *pa_find_space_by_number PARAMS ((int));
 static unsigned int pa_subspace_start PARAMS ((sd_chain_struct *, int));
+static sd_chain_struct *pa_parse_space_stmt PARAMS ((char *, int));
+static int pa_next_subseg PARAMS ((sd_chain_struct *));
+static void pa_spaces_begin PARAMS ((void));
+#endif
 static void pa_ip PARAMS ((char *));
 static void fix_new_hppa PARAMS ((fragS *, int, int, symbolS *,
 				  long, expressionS *, int,
@@ -550,11 +553,8 @@
 static int pa_chk_field_selector PARAMS ((char **));
 static int is_same_frag PARAMS ((fragS *, fragS *));
 static void process_exit PARAMS ((void));
-static sd_chain_struct *pa_parse_space_stmt PARAMS ((char *, int));
 static int log2 PARAMS ((int));
-static int pa_next_subseg PARAMS ((sd_chain_struct *));
 static unsigned int pa_stringer_aux PARAMS ((char *));
-static void pa_spaces_begin PARAMS ((void));
 
 #ifdef OBJ_ELF
 static void hppa_elf_mark_end_of_function PARAMS ((void));
@@ -563,6 +563,7 @@
 
 /* File and gloally scoped variable declarations.  */
 
+#ifdef OBJ_SOM
 /* Root and final entry in the space chain.  */
 static sd_chain_struct *space_dict_root;
 static sd_chain_struct *space_dict_last;
@@ -570,6 +571,7 @@
 /* The current space and subspace.  */
 static sd_chain_struct *current_space;
 static ssd_chain_struct *current_subspace;
+#endif
 
 /* Root of the call_info chain.  */
 static struct call_info *call_info_root;
@@ -596,7 +598,12 @@
 {
   /* align pseudo-ops on the PA specify the actual alignment requested,
      not the log2 of the requested alignment.  */
+#ifdef OBJ_SOM
   {"align", pa_align, 8},
+#endif
+#ifdef OBJ_ELF
+  {"align", s_align_bytes, 8},
+#endif
   {"begin_brtab", pa_brtab, 1},
   {"begin_try", pa_try, 1},
   {"block", pa_block, 1},
@@ -612,6 +619,7 @@
   {"copyright", pa_copyright, 0},
   {"data", pa_data, 0},
   {"double", pa_float_cons, 'd'},
+  {"dword", pa_cons, 8},
   {"end", pa_end, 0},
   {"end_brtab", pa_brtab, 0},
   {"end_try", pa_try, 0},
@@ -631,7 +639,9 @@
   {"level", pa_level, 0},
   {"long", pa_cons, 4},
   {"lsym", pa_lsym, 0},
+#ifdef OBJ_SOM
   {"nsubspa", pa_subspace, 1},
+#endif
   {"octa", pa_cons, 16},
   {"org", pa_origin, 0},
   {"origin", pa_origin, 0},
@@ -642,11 +652,15 @@
   {"reg", pa_equ, 1},
   {"short", pa_cons, 2},
   {"single", pa_float_cons, 'f'},
+#ifdef OBJ_SOM
   {"space", pa_space, 0},
   {"spnum", pa_spnum, 0},
+#endif
   {"string", pa_stringer, 0},
   {"stringz", pa_stringer, 1},
+#ifdef OBJ_SOM
   {"subspa", pa_subspace, 0},
+#endif
   {"text", pa_text, 0},
   {"version", pa_version, 0},
   {"word", pa_cons, 4},
@@ -701,9 +715,10 @@
 /* Holds the last field selector.  */
 static int hppa_field_selector;
 
-
+#ifdef OBJ_SOM
 /* A dummy bfd symbol so that all relocations have symbols of some kind.  */
 static symbolS *dummy_symbol;
+#endif
 
 /* Nonzero if errors are to be printed.  */
 static int print_errors = 1;
@@ -995,6 +1010,7 @@
   {"t", e_tsel},
 };
 
+#ifdef OBJ_SOM
 /* default space and subspace dictionaries */
 
 #define GDB_SYMBOLS          GDB_SYMBOLS_SUBSPACE_NAME
@@ -1012,31 +1028,23 @@
 
 static struct default_subspace_dict pa_def_subspaces[] =
 {
-  {"$CODE$", 1, 1, 1, 0, 0, 0, 24, 0x2c, 0, 8, 0, 0, ".text", SUBSEG_CODE},
-  {"$DATA$", 1, 1, 0, 0, 0, 0, 24, 0x1f, 1, 8, 1, 1, ".data", SUBSEG_DATA},
-  {"$LIT$", 1, 1, 0, 0, 0, 0, 16, 0x2c, 0, 8, 0, 0, ".text", SUBSEG_LIT},
-  {"$MILLICODE$", 1, 1, 0, 0, 0, 0, 8, 0x2c, 0, 8, 0, 0, ".text", SUBSEG_MILLI},
-  {"$BSS$", 1, 1, 0, 0, 0, 1, 80, 0x1f, 1, 8, 1, 1, ".bss", SUBSEG_BSS},
-#ifdef OBJ_ELF
-  {"$UNWIND$", 1, 1, 0, 0, 0, 0, 64, 0x2c, 0, 4, 0, 0, ".PARISC.unwind", SUBSEG_UNWIND},
-#endif
+  {"$CODE$", 1, 1, 1, 0, 0, 0, 24, 0x2c, 0, 8, 0, 0, SUBSEG_CODE},
+  {"$DATA$", 1, 1, 0, 0, 0, 0, 24, 0x1f, 1, 8, 1, 1, SUBSEG_DATA},
+  {"$LIT$", 1, 1, 0, 0, 0, 0, 16, 0x2c, 0, 8, 0, 0, SUBSEG_LIT},
+  {"$MILLICODE$", 1, 1, 0, 0, 0, 0, 8, 0x2c, 0, 8, 0, 0, SUBSEG_MILLI},
+  {"$BSS$", 1, 1, 0, 0, 0, 1, 80, 0x1f, 1, 8, 1, 1, SUBSEG_BSS},
   {NULL, 0, 1, 0, 0, 0, 0, 255, 0x1f, 0, 4, 0, 0, 0}
 };
 
 static struct default_space_dict pa_def_spaces[] =
 {
-  {"$TEXT$", 0, 1, 1, 0, 8, ASEC_NULL, ".text"},
-  {"$PRIVATE$", 1, 1, 1, 1, 16, ASEC_NULL, ".data"},
-  {NULL, 0, 0, 0, 0, 0, ASEC_NULL, NULL}
+  {"$TEXT$", 0, 1, 1, 0, 8, ASEC_NULL},
+  {"$PRIVATE$", 1, 1, 1, 1, 16, ASEC_NULL},
+  {NULL, 0, 0, 0, 0, 0, ASEC_NULL}
 };
 
 /* Misc local definitions used by the assembler.  */
 
-/* Return nonzero if the string pointed to by S potentially represents
-   a right or left half of a FP register  */
-#define IS_R_SELECT(S)   (*(S) == 'R' || *(S) == 'r')
-#define IS_L_SELECT(S)   (*(S) == 'L' || *(S) == 'l')
-
 /* These macros are used to maintain spaces/subspaces.  */
 #define SPACE_DEFINED(space_chain)	(space_chain)->sd_defined
 #define SPACE_USER_DEFINED(space_chain) (space_chain)->sd_user_defined
@@ -1045,6 +1053,12 @@
 
 #define SUBSPACE_DEFINED(ss_chain)	(ss_chain)->ssd_defined
 #define SUBSPACE_NAME(ss_chain)		(ss_chain)->ssd_name
+#endif
+
+/* Return nonzero if the string pointed to by S potentially represents
+   a right or left half of a FP register  */
+#define IS_R_SELECT(S)   (*(S) == 'R' || *(S) == 'r')
+#define IS_L_SELECT(S)   (*(S) == 'L' || *(S) == 'l')
 
 /* Insert FIELD into OPCODE starting at bit START.  Continue pa_ip
    main loop after insertion.  */
@@ -1071,11 +1085,11 @@
 
 #define is_DP_relative(exp)			\
   ((exp).X_op == O_subtract			\
-   && strcmp((exp).X_op_symbol->bsym->name, "$global$") == 0)
+   && strcmp (S_GET_NAME ((exp).X_op_symbol), "$global$") == 0)
 
 #define is_PC_relative(exp)			\
   ((exp).X_op == O_subtract			\
-   && strcmp((exp).X_op_symbol->bsym->name, "$PIC_pcrel$0") == 0)
+   && strcmp (S_GET_NAME ((exp).X_op_symbol), "$PIC_pcrel$0") == 0)
 
 /* We need some complex handling for stabs (sym1 - sym2).  Luckily, we'll
    always be able to reduce the expression to a constant, so we don't
@@ -1098,18 +1112,6 @@
     as_fatal (_("Missing .procend\n"));
 }
 
-/* Check to make sure we have a valid space and subspace.  */
-
-static void
-pa_check_current_space_and_subspace ()
-{
-  if (current_space == NULL)
-    as_fatal (_("Not in a space.\n"));
-
-  if (current_subspace == NULL)
-    as_fatal (_("Not in a subspace.\n"));
-}
-
 /* Returns a pointer to the label_symbol_struct for the current space.
    or NULL if no label_symbol_struct exists for the current space.  */
 
@@ -1117,13 +1119,20 @@
 pa_get_label ()
 {
   label_symbol_struct *label_chain;
-  sd_chain_struct *space_chain = current_space;
 
   for (label_chain = label_symbols_rootp;
        label_chain;
        label_chain = label_chain->lss_next)
-    if (space_chain == label_chain->lss_space && label_chain->lss_label)
+    {
+#ifdef OBJ_SOM
+    if (current_space == label_chain->lss_space && label_chain->lss_label)
       return label_chain;
+#endif
+#ifdef OBJ_ELF
+    if (now_seg == label_chain->lss_segment && label_chain->lss_label)
+      return label_chain;
+#endif
+    }
 
   return NULL;
 }
@@ -1136,7 +1145,6 @@
      symbolS *symbol;
 {
   label_symbol_struct *label_chain = pa_get_label ();
-  sd_chain_struct *space_chain = current_space;
 
   if (label_chain)
     label_chain->lss_label = symbol;
@@ -1146,7 +1154,12 @@
       label_chain
 	= (label_symbol_struct *) xmalloc (sizeof (label_symbol_struct));
       label_chain->lss_label = symbol;
-      label_chain->lss_space = space_chain;
+#ifdef OBJ_SOM
+      label_chain->lss_space = current_space;
+#endif
+#ifdef OBJ_ELF
+      label_chain->lss_segment = now_seg;
+#endif
       label_chain->lss_next = NULL;
 
       if (label_symbols_rootp)
@@ -1164,13 +1177,19 @@
 {
   label_symbol_struct *label_chain;
   label_symbol_struct *prev_label_chain = NULL;
-  sd_chain_struct *space_chain = current_space;
 
   for (label_chain = label_symbols_rootp;
        label_chain;
        label_chain = label_chain->lss_next)
     {
-      if (space_chain == label_chain->lss_space && label_chain->lss_label)
+      if (1
+#ifdef OBJ_SOM
+ 	  && current_space == label_chain->lss_space && label_chain->lss_label
+#endif
+#ifdef OBJ_ELF
+ 	  && now_seg == label_chain->lss_segment && label_chain->lss_label
+#endif
+	  )
 	{
 	  /* Remove the label from the chain and free its memory.  */
 	  if (prev_label_chain)
@@ -1273,7 +1292,7 @@
 
   fix_new_hppa (frag, where, size,
 		(symbolS *) NULL, (offsetT) 0, exp, 0, rel_type,
-		hppa_field_selector, 32, 0, NULL);
+		hppa_field_selector, size * 8, 0, NULL);
 
   /* Reset field selector to its default state.  */
   hppa_field_selector = 0;
@@ -1304,7 +1323,9 @@
       flag_readonly_data_in_text = 0;
     }
 
+#ifdef OBJ_SOM
   pa_spaces_begin ();
+#endif
 
   op_hash = hash_new ();
 
@@ -1334,12 +1355,18 @@
   if (lose)
     as_fatal (_("Broken assembler.  No assembly attempted."));
 
+#ifdef OBJ_SOM
   /* SOM will change text_section.  To make sure we never put
      anything into the old one switch to the new one now.  */
   subseg_set (text_section, 0);
+#endif
 
+#ifdef OBJ_SOM
   dummy_symbol = symbol_find_or_make ("L$dummy");
   S_SET_SEGMENT (dummy_symbol, text_section);
+  /* Force the symbol to be converted to a real symbol. */
+  (void) symbol_get_bfdsym (dummy_symbol); 
+#endif
 }
 
 /* Assemble a single instruction storing it into a frag.  */
@@ -1368,7 +1395,8 @@
 	  if (label_symbol->lss_label)
 	    {
 	      last_call_info->start_symbol = label_symbol->lss_label;
-	      label_symbol->lss_label->bsym->flags |= BSF_FUNCTION;
+	      symbol_get_bfdsym (label_symbol->lss_label)->flags
+		|= BSF_FUNCTION;
 #ifdef OBJ_SOM
 	      /* Also handle allocation of a fixup to hold the unwind
 		 information when the label appears after the proc/procend.  */
@@ -1423,8 +1451,16 @@
   unsigned long opcode;
   struct pa_opcode *insn;
 
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
+
+  /* Convert everything up to the first whitespace character into lower
+     case.  */
+  for (s = str; *s != ' ' && *s != '\t' && *s != '\n' && *s != '\0'; s++)
+    if (isupper (*s))
+      *s = tolower (*s);
 
   /* Skip to something interesting.  */
   for (s = str; isupper (*s) || islower (*s) || (*s >= '0' && *s <= '3'); ++s)
@@ -1451,14 +1487,6 @@
 
   save_s = str;
 
-  /* Convert everything into lower case.  */
-  while (*save_s)
-    {
-      if (isupper (*save_s))
-	*save_s = tolower (*save_s);
-      save_s++;
-    }
-
   /* Look up the opcode in the has table.  */
   if ((insn = (struct pa_opcode *) hash_find (op_hash, str)) == NULL)
     {
@@ -2730,13 +2758,14 @@
 
   reloc = (arelent *) xmalloc (sizeof (arelent));
 
-  reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   codes = (bfd_reloc_code_real_type **) hppa_gen_reloc_type (stdoutput,
 			       fixp->fx_r_type,
 			       hppa_fixp->fx_r_format,
 			       hppa_fixp->fx_r_field,
 			       fixp->fx_subsy != NULL,
-			       fixp->fx_addsy->bsym);
+			       symbol_get_bfdsym (fixp->fx_addsy));
 
   if (codes == NULL)
     abort ();
@@ -2759,7 +2788,8 @@
 
       code = *codes[0];
 
-      reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+      reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+      *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
       reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
       reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
       reloc->addend = 0;	/* default */
@@ -2809,7 +2839,8 @@
     {
       code = *codes[i];
 
-      relocs[i]->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+      relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+      *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
       relocs[i]->howto = bfd_reloc_type_lookup (stdoutput, code);
       relocs[i]->address = fixp->fx_frag->fr_address + fixp->fx_where;
 
@@ -2820,23 +2851,25 @@
 	     of two symbols.  With that in mind we fill in all four
 	     relocs now and break out of the loop.  */
 	  assert (i == 1);
-	  relocs[0]->sym_ptr_ptr = (asymbol **) &bfd_abs_symbol;
+	  relocs[0]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol);
 	  relocs[0]->howto = bfd_reloc_type_lookup (stdoutput, *codes[0]);
 	  relocs[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
 	  relocs[0]->addend = 0;
-	  relocs[1]->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+	  relocs[1]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+	  *relocs[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
 	  relocs[1]->howto = bfd_reloc_type_lookup (stdoutput, *codes[1]);
 	  relocs[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
 	  relocs[1]->addend = 0;
-	  relocs[2]->sym_ptr_ptr = &fixp->fx_subsy->bsym;
+	  relocs[2]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+	  *relocs[2]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy);
 	  relocs[2]->howto = bfd_reloc_type_lookup (stdoutput, *codes[2]);
 	  relocs[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
 	  relocs[2]->addend = 0;
-	  relocs[3]->sym_ptr_ptr = (asymbol **) &bfd_abs_symbol;
+	  relocs[3]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol);
 	  relocs[3]->howto = bfd_reloc_type_lookup (stdoutput, *codes[3]);
 	  relocs[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
 	  relocs[3]->addend = 0;
-	  relocs[4]->sym_ptr_ptr = (asymbol **) &bfd_abs_symbol;
+	  relocs[4]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol);
 	  relocs[4]->howto = bfd_reloc_type_lookup (stdoutput, *codes[4]);
 	  relocs[4]->address = fixp->fx_frag->fr_address + fixp->fx_where;
 	  relocs[4]->addend = 0;
@@ -2874,7 +2907,8 @@
 	case R_N0SEL:
 	case R_N1SEL:
 	  /* There is no symbol or addend associated with these fixups.  */
-	  relocs[i]->sym_ptr_ptr = &dummy_symbol->bsym;
+          relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+          *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol);
 	  relocs[i]->addend = 0;
 	  break;
 
@@ -2882,7 +2916,8 @@
 	case R_ENTRY:
 	case R_EXIT:
 	  /* There is no symbol associated with these fixups.  */
-	  relocs[i]->sym_ptr_ptr = &dummy_symbol->bsym;
+          relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+          *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol);
 	  relocs[i]->addend = fixp->fx_offset;
 	  break;
 
@@ -3039,7 +3074,7 @@
 	  && fmt != 32
 #endif
 	  )
-	new_val = ((fmt == 12 || fmt == 17) ? 8 : 0);
+	new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0);
 #ifdef OBJ_SOM
       /* These field selectors imply that we do not want an addend.  */
       else if (hppa_fixP->fx_r_field == e_psel
@@ -3048,7 +3083,7 @@
 	       || hppa_fixP->fx_r_field == e_tsel
 	       || hppa_fixP->fx_r_field == e_rtsel
 	       || hppa_fixP->fx_r_field == e_ltsel)
-	new_val = ((fmt == 12 || fmt == 17) ? 8 : 0);
+	new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0);
       /* This is truely disgusting.  The machine independent code blindly
 	 adds in the value of the symbol being relocated against.  Damn!  */
       else if (fmt == 32
@@ -3063,13 +3098,15 @@
       /* Handle pc-relative exceptions from above.  */
 #define arg_reloc_stub_needed(CALLER, CALLEE) \
   ((CALLEE) && (CALLER) && ((CALLEE) != (CALLER)))
-      if ((fmt == 12 || fmt == 17)
+      if ((fmt == 12 || fmt == 17 || fmt == 22)
 	  && fixP->fx_addsy
 	  && fixP->fx_pcrel
+#ifdef OBJ_SOM
 	  && !arg_reloc_stub_needed ((long) ((obj_symbol_type *)
-			fixP->fx_addsy->bsym)->tc_data.ap.hppa_arg_reloc,
-				    hppa_fixP->fx_arg_reloc)
-	  && ((int)(*valp) > -262144 && (int)(*valp) < 262143)
+		symbol_get_bfdsym (fixP->fx_addsy))->tc_data.ap.hppa_arg_reloc,
+		hppa_fixP->fx_arg_reloc)
+#endif
+	  && (((int)(*valp) > -262144 && (int)(*valp) < 262143) && fmt != 22)
 	  && S_GET_SEGMENT (fixP->fx_addsy) == hppa_fixP->segment
 	  && !(fixP->fx_subsy
 	       && S_GET_SEGMENT (fixP->fx_subsy) != hppa_fixP->segment))
@@ -4144,6 +4181,7 @@
   return cmpltr;
 }
 
+#ifdef OBJ_SOM
 /* Handle an alignment directive.  Special so that we can update the
    alignment of the subspace if necessary.  */
 static void
@@ -4160,6 +4198,7 @@
   if (log2 (bytes) != -1)
     record_alignment (current_subspace->ssd_seg, log2 (bytes));
 }
+#endif
 
 /* Handle a .BLOCK type pseudo-op.  */
 
@@ -4172,8 +4211,10 @@
   unsigned int temp_size;
   unsigned int i;
 
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   temp_size = get_absolute_expression ();
 
@@ -4251,8 +4292,10 @@
 pa_call (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   pa_call_args (&last_call_desc);
   demand_empty_rest_of_line ();
@@ -4336,6 +4379,7 @@
 pa_build_unwind_subspace (call_info)
      struct call_info *call_info;
 {
+#if 0
   char *unwind;
   asection *seg, *save_seg;
   subsegT subseg, save_subseg;
@@ -4397,6 +4441,7 @@
 
   /* Return back to the original segment/subsegment.  */
   subseg_set (save_seg, save_subseg);
+#endif
 }
 #endif
 
@@ -4411,8 +4456,10 @@
   char *name, c, *p;
   int temp;
 
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   /* .CALLINFO must appear within a procedure definition.  */
   if (!within_procedure)
@@ -4549,9 +4596,11 @@
 pa_code (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   current_space = is_defined_space ("$TEXT$");
   current_subspace
     = pa_subsegment_to_subspace (current_space->sd_seg, 0);
+#endif
   s_text (0);
   pa_undefine_label ();
 }
@@ -4601,7 +4650,7 @@
       /* colon() has already set the frag to the current location in the
          current subspace; we need to reset the fragment to the zero address
          fragment.  We also need to reset the segment pointer.  */
-      symbol->sy_frag = &zero_address_frag;
+      symbol_set_frag (symbol, &zero_address_frag);
     }
   demand_empty_rest_of_line ();
 }
@@ -4620,8 +4669,10 @@
 pa_enter (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   as_bad (_("The .ENTER pseudo-op is not supported"));
   demand_empty_rest_of_line ();
@@ -4633,8 +4684,10 @@
 pa_entry (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   if (!within_procedure)
     as_bad (_("Misplaced .entry. Ignored."));
@@ -4738,8 +4791,10 @@
 pa_exit (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   if (!within_procedure)
     as_bad (_(".EXIT must appear within a procedure"));
@@ -4808,13 +4863,13 @@
   char *name, c, *p;
   unsigned int temp, arg_reloc;
   pa_symbol_type type = SYMBOL_TYPE_UNKNOWN;
-  obj_symbol_type *symbol = (obj_symbol_type *) symbolP->bsym;
+  obj_symbol_type *symbol = (obj_symbol_type *) symbol_get_bfdsym (symbolP);
 
   if (strncasecmp (input_line_pointer, "absolute", 8) == 0)
 
     {
       input_line_pointer += 8;
-      symbolP->bsym->flags &= ~BSF_FUNCTION;
+      symbol_get_bfdsym (symbolP)->flags &= ~BSF_FUNCTION;
       S_SET_SEGMENT (symbolP, bfd_abs_section_ptr);
       type = SYMBOL_TYPE_ABSOLUTE;
     }
@@ -4827,54 +4882,55 @@
          Complain if one tries to EXPORT a CODE type since that's never
          done.  Both GCC and HP C still try to IMPORT CODE types, so
          silently fix them to be ENTRY types.  */
-      if (symbolP->bsym->flags & BSF_FUNCTION)
+      if (S_IS_FUNCTION (symbolP))
 	{
 	  if (is_export)
-	    as_tsktsk (_("Using ENTRY rather than CODE in export directive for %s"), symbolP->bsym->name);
+	    as_tsktsk (_("Using ENTRY rather than CODE in export directive for %s"),
+		       S_GET_NAME (symbolP));
 
-	  symbolP->bsym->flags |= BSF_FUNCTION;
+	  symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION;
 	  type = SYMBOL_TYPE_ENTRY;
 	}
       else
 	{
-	  symbolP->bsym->flags &= ~BSF_FUNCTION;
+	  symbol_get_bfdsym (symbolP)->flags &= ~BSF_FUNCTION;
 	  type = SYMBOL_TYPE_CODE;
 	}
     }
   else if (strncasecmp (input_line_pointer, "data", 4) == 0)
     {
       input_line_pointer += 4;
-      symbolP->bsym->flags &= ~BSF_FUNCTION;
+      symbol_get_bfdsym (symbolP)->flags &= ~BSF_FUNCTION;
       type = SYMBOL_TYPE_DATA;
     }
   else if ((strncasecmp (input_line_pointer, "entry", 5) == 0))
     {
       input_line_pointer += 5;
-      symbolP->bsym->flags |= BSF_FUNCTION;
+      symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION;
       type = SYMBOL_TYPE_ENTRY;
     }
   else if (strncasecmp (input_line_pointer, "millicode", 9) == 0)
     {
       input_line_pointer += 9;
-      symbolP->bsym->flags |= BSF_FUNCTION;
+      symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION;
       type = SYMBOL_TYPE_MILLICODE;
     }
   else if (strncasecmp (input_line_pointer, "plabel", 6) == 0)
     {
       input_line_pointer += 6;
-      symbolP->bsym->flags &= ~BSF_FUNCTION;
+      symbol_get_bfdsym (symbolP)->flags &= ~BSF_FUNCTION;
       type = SYMBOL_TYPE_PLABEL;
     }
   else if (strncasecmp (input_line_pointer, "pri_prog", 8) == 0)
     {
       input_line_pointer += 8;
-      symbolP->bsym->flags |= BSF_FUNCTION;
+      symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION;
       type = SYMBOL_TYPE_PRI_PROG;
     }
   else if (strncasecmp (input_line_pointer, "sec_prog", 8) == 0)
     {
       input_line_pointer += 8;
-      symbolP->bsym->flags |= BSF_FUNCTION;
+      symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION;
       type = SYMBOL_TYPE_SEC_PROG;
     }
 
@@ -4882,7 +4938,7 @@
      than BFD understands.  This is how we get this information
      to the SOM BFD backend.  */
 #ifdef obj_set_symbol_type
-  obj_set_symbol_type (symbolP->bsym, (int) type);
+  obj_set_symbol_type (symbol_get_bfdsym (symbolP), (int) type);
 #endif
 
   /* Now that the type of the exported symbol has been handled,
@@ -4903,7 +4959,9 @@
 	  name = input_line_pointer;
 	  c = get_symbol_end ();
 	  arg_reloc = pa_align_arg_reloc (temp, pa_build_arg_reloc (name));
+#ifdef OBJ_SOM
 	  symbol->tc_data.ap.hppa_arg_reloc |= arg_reloc;
+#endif
 	  *input_line_pointer = c;
 	}
       /* The return value.  */
@@ -4915,7 +4973,9 @@
 	  name = input_line_pointer;
 	  c = get_symbol_end ();
 	  arg_reloc = pa_build_arg_reloc (name);
+#ifdef OBJ_SOM
 	  symbol->tc_data.ap.hppa_arg_reloc |= arg_reloc;
+#endif
 	  *input_line_pointer = c;
 	}
       /* Privelege level.  */
@@ -4925,7 +4985,9 @@
 	  *p = c;
 	  input_line_pointer++;
 	  temp = atoi (input_line_pointer);
+#ifdef OBJ_SOM
 	  symbol->tc_data.ap.hppa_priv_level = temp;
+#endif
 	  c = get_symbol_end ();
 	  *input_line_pointer = c;
 	}
@@ -4976,7 +5038,7 @@
 	     the the current segment.  Note only BSF_FUNCTION really
 	     matters, we do not need to set the full SYMBOL_TYPE_* info.  */
 	  if (now_seg == text_section)
-	    symbol->bsym->flags |= BSF_FUNCTION;
+	    symbol_get_bfdsym (symbol)->flags |= BSF_FUNCTION;
 
 	  /* If the section is undefined, then the symbol is undefined
 	     Since this is an import, leave the section undefined.  */
@@ -5030,8 +5092,10 @@
 pa_leave (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   as_bad (_("The .LEAVE pseudo-op is not supported"));
   demand_empty_rest_of_line ();
@@ -5078,8 +5142,10 @@
 pa_origin (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   s_org (0);
   pa_undefine_label ();
@@ -5129,8 +5195,10 @@
 {
   struct call_info *call_info;
 
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   if (within_procedure)
     as_fatal (_("Nested procedures"));
@@ -5176,7 +5244,7 @@
 	if (label_symbol->lss_label)
 	  {
 	    last_call_info->start_symbol = label_symbol->lss_label;
-	    label_symbol->lss_label->bsym->flags |= BSF_FUNCTION;
+	    symbol_get_bfdsym (label_symbol->lss_label)->flags |= BSF_FUNCTION;
 	  }
 	else
 	  as_bad (_("Missing function name for .PROC (corrupted label chain)"));
@@ -5196,8 +5264,10 @@
      int unused;
 {
 
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   /* If we are within a procedure definition, make sure we've
      defined a label for the procedure; handle case where the
@@ -5215,7 +5285,8 @@
 	  if (label_symbol->lss_label)
 	    {
 	      last_call_info->start_symbol = label_symbol->lss_label;
-	      label_symbol->lss_label->bsym->flags |= BSF_FUNCTION;
+	      symbol_get_bfdsym (label_symbol->lss_label)->flags
+		|= BSF_FUNCTION;
 #ifdef OBJ_SOM
 	      /* Also handle allocation of a fixup to hold the unwind
 		 information when the label appears after the proc/procend.  */
@@ -5257,6 +5328,38 @@
   pa_undefine_label ();
 }
 
+/* If VALUE is an exact power of two between zero and 2^31, then
+   return log2 (VALUE).  Else return -1.  */
+
+static int
+log2 (value)
+     int value;
+{
+  int shift = 0;
+
+  while ((1 << shift) != value && shift < 32)
+    shift++;
+
+  if (shift >= 32)
+    return -1;
+  else
+    return shift;
+}
+
+
+#ifdef OBJ_SOM
+/* Check to make sure we have a valid space and subspace.  */
+
+static void
+pa_check_current_space_and_subspace ()
+{
+  if (current_space == NULL)
+    as_fatal (_("Not in a space.\n"));
+
+  if (current_subspace == NULL)
+    as_fatal (_("Not in a subspace.\n"));
+}
+
 /* Parse the parameters to a .SPACE directive; if CREATE_FLAG is nonzero,
    then create a new space entry to hold the information specified
    by the parameters to the .SPACE directive.  */
@@ -5525,24 +5628,6 @@
   demand_empty_rest_of_line ();
 }
 
-/* If VALUE is an exact power of two between zero and 2^31, then
-   return log2 (VALUE).  Else return -1.  */
-
-static int
-log2 (value)
-     int value;
-{
-  int shift = 0;
-
-  while ((1 << shift) != value && shift < 32)
-    shift++;
-
-  if (shift >= 32)
-    return -1;
-  else
-    return shift;
-}
-
 /* Handle a .SUBSPACE pseudo-op; this switches the current subspace to the
    given subspace, creating the new subspace if necessary.
 
@@ -5553,7 +5638,7 @@
 pa_subspace (create_new)
      int create_new;
 {
-  char *name, *ss_name, *alias, c;
+  char *name, *ss_name, c;
   char loadable, code_only, common, dup_common, zero, sort;
   int i, access, space_index, alignment, quadrant, applicable, flags;
   sd_chain_struct *space;
@@ -5587,7 +5672,6 @@
       space_index = ~0;
       alignment = 1;
       quadrant = 0;
-      alias = NULL;
 
       space = current_space;
       if (create_new)
@@ -5624,8 +5708,6 @@
 		  quadrant = pa_def_subspaces[i].quadrant;
 		  access = pa_def_subspaces[i].access;
 		  sort = pa_def_subspaces[i].sort;
-		  if (USE_ALIASES && pa_def_subspaces[i].alias)
-		    alias = pa_def_subspaces[i].alias;
 		  break;
 		}
 	      i++;
@@ -5734,14 +5816,6 @@
 	section = subseg_force_new (ss_name, 0);
       else if (ssd)
 	section = ssd->ssd_seg;
-      else if (alias)
-	section = subseg_new (alias, 0);
-      else if (!alias && USE_ALIASES)
-	{
-	  as_warn (_("Ignoring subspace decl due to ELF BFD bugs."));
-	  demand_empty_rest_of_line ();
-	  return;
-	}
       else
 	section = subseg_new (ss_name, 0);
 
@@ -5798,10 +5872,7 @@
       char *name;
 
       /* Pick the right name to use for the new section.  */
-      if (pa_def_spaces[i].alias && USE_ALIASES)
-	name = pa_def_spaces[i].alias;
-      else
-	name = pa_def_spaces[i].name;
+      name = pa_def_spaces[i].name;
 
       pa_def_spaces[i].segment = subseg_new (name, 0);
       create_new_space (pa_def_spaces[i].name, pa_def_spaces[i].spnum,
@@ -5821,16 +5892,8 @@
 
       /* Pick the right name for the new section and pick the right
          subsegment number.  */
-      if (pa_def_subspaces[i].alias && USE_ALIASES)
-	{
-	  name = pa_def_subspaces[i].alias;
-	  subsegment = pa_def_subspaces[i].subsegment;
-	}
-      else
-	{
-	  name = pa_def_subspaces[i].name;
-	  subsegment = 0;
-	}
+      name = pa_def_subspaces[i].name;
+      subsegment = 0;
 
       /* Create the new section.  */
       segment = subseg_new (name, subsegment);
@@ -5839,7 +5902,7 @@
       /* For SOM we want to replace the standard .text, .data, and .bss
          sections with our own.   We also want to set BFD flags for
 	 all the built-in subspaces.  */
-      if (!strcmp (pa_def_subspaces[i].name, "$CODE$") && !USE_ALIASES)
+      if (!strcmp (pa_def_subspaces[i].name, "$CODE$"))
 	{
 	  text_section = segment;
 	  applicable = bfd_applicable_section_flags (stdoutput);
@@ -5849,7 +5912,7 @@
 					       | SEC_READONLY
 					       | SEC_HAS_CONTENTS));
 	}
-      else if (!strcmp (pa_def_subspaces[i].name, "$DATA$") && !USE_ALIASES)
+      else if (!strcmp (pa_def_subspaces[i].name, "$DATA$"))
 	{
 	  data_section = segment;
 	  applicable = bfd_applicable_section_flags (stdoutput);
@@ -5860,14 +5923,14 @@
 
 
 	}
-      else if (!strcmp (pa_def_subspaces[i].name, "$BSS$") && !USE_ALIASES)
+      else if (!strcmp (pa_def_subspaces[i].name, "$BSS$"))
 	{
 	  bss_section = segment;
 	  applicable = bfd_applicable_section_flags (stdoutput);
 	  bfd_set_section_flags (stdoutput, segment,
 				 applicable & SEC_ALLOC);
 	}
-      else if (!strcmp (pa_def_subspaces[i].name, "$LIT$") && !USE_ALIASES)
+      else if (!strcmp (pa_def_subspaces[i].name, "$LIT$"))
 	{
 	  applicable = bfd_applicable_section_flags (stdoutput);
 	  bfd_set_section_flags (stdoutput, segment,
@@ -5876,8 +5939,7 @@
 					       | SEC_READONLY
 					       | SEC_HAS_CONTENTS));
 	}
-      else if (!strcmp (pa_def_subspaces[i].name, "$MILLICODE$")
-	       && !USE_ALIASES)
+      else if (!strcmp (pa_def_subspaces[i].name, "$MILLICODE$"))
 	{
 	  applicable = bfd_applicable_section_flags (stdoutput);
 	  bfd_set_section_flags (stdoutput, segment,
@@ -5886,7 +5948,7 @@
 					       | SEC_READONLY
 					       | SEC_HAS_CONTENTS));
 	}
-      else if (!strcmp (pa_def_subspaces[i].name, "$UNWIND$") && !USE_ALIASES)
+      else if (!strcmp (pa_def_subspaces[i].name, "$UNWIND$"))
 	{
 	  applicable = bfd_applicable_section_flags (stdoutput);
 	  bfd_set_section_flags (stdoutput, segment,
@@ -6037,7 +6099,7 @@
      we'll set it to 1 which "locks-in" the subspace attributes.  */
   SUBSPACE_DEFINED (chain_entry) = 0;
 
-  chain_entry->ssd_subseg = USE_ALIASES ? pa_next_subseg (space) : 0;
+  chain_entry->ssd_subseg = 0;
   chain_entry->ssd_seg = seg;
   chain_entry->ssd_next = NULL;
 
@@ -6256,7 +6318,6 @@
      sd_chain_struct *space;
      int quadrant;
 {
-#ifdef OBJ_SOM
   /* FIXME.  Assumes everyone puts read/write data at 0x4000000, this
      is not correct for the PA OSF1 port.  */
   if ((strcmp (SPACE_NAME (space), "$PRIVATE$") == 0) && quadrant == 1)
@@ -6265,7 +6326,6 @@
     return 0x40000000;
   else
     return 0;
-#endif
   return 0;
 }
 
@@ -6278,6 +6338,7 @@
   space->sd_last_subseg++;
   return space->sd_last_subseg;
 }
+#endif
 
 /* Helper function for pa_stringer.  Used to find the end of
    a string.  */
@@ -6288,8 +6349,10 @@
 {
   unsigned int c = *s & CHAR_MASK;
 
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   switch (c)
     {
@@ -6430,9 +6493,11 @@
 pa_data (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   current_space = is_defined_space ("$PRIVATE$");
   current_subspace
     = pa_subsegment_to_subspace (current_space->sd_seg, 0);
+#endif
   s_data (0);
   pa_undefine_label ();
 }
@@ -6453,8 +6518,10 @@
 pa_fill (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   s_fill (0);
   pa_undefine_label ();
@@ -6466,8 +6533,10 @@
 pa_lcomm (needs_align)
      int needs_align;
 {
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   s_lcomm (needs_align);
   pa_undefine_label ();
@@ -6479,8 +6548,10 @@
 pa_lsym (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
+#endif
 
   s_lsym (0);
   pa_undefine_label ();
@@ -6492,9 +6563,11 @@
 pa_text (unused)
      int unused;
 {
+#ifdef OBJ_SOM
   current_space = is_defined_space ("$TEXT$");
   current_subspace
     = pa_subsegment_to_subspace (current_space->sd_seg, 0);
+#endif
 
   s_text (0);
   pa_undefine_label ();
@@ -6549,7 +6622,7 @@
       && (hppa_fix->segment->flags & SEC_CODE))
     {
       /* Apparently sy_used_in_reloc never gets set for sub symbols.  */
-      fixp->fx_subsy->sy_used_in_reloc = 1;
+      symbol_mark_used_in_reloc (fixp->fx_subsy);
       return 0;
     }
 
@@ -6571,7 +6644,7 @@
       || hppa_fix->fx_r_field == e_lpsel)
     return 0;
 
-  if (fixp->fx_addsy && fixp->fx_addsy->bsym->flags & BSF_GLOBAL)
+  if (fixp->fx_addsy && S_IS_EXTERNAL (fixp->fx_addsy))
     return 0;
 
   /* Reject absolute calls (jumps).  */
@@ -6579,8 +6652,7 @@
     return 0;
 
   /* Reject reductions of function symbols.  */
-  if (fixp->fx_addsy == 0
-      || (fixp->fx_addsy->bsym->flags & BSF_FUNCTION) == 0)
+  if (fixp->fx_addsy == 0 || ! S_IS_FUNCTION (fixp->fx_addsy))
     return 1;
 
   return 0;
@@ -6612,15 +6684,16 @@
 #define arg_reloc_stub_needed(CALLER, CALLEE) \
   ((CALLEE) && (CALLER) && ((CALLEE) != (CALLER)))
 
+#ifdef OBJ_SOM
   /* It is necessary to force PC-relative calls/jumps to have a relocation
      entry if they're going to need either a argument relocation or long
      call stub.  FIXME.  Can't we need the same for absolute calls?  */
   if (fixp->fx_pcrel && fixp->fx_addsy
       && (arg_reloc_stub_needed ((long) ((obj_symbol_type *)
-				  fixp->fx_addsy->bsym)->tc_data.ap.hppa_arg_reloc,
-
-				 hppa_fixp->fx_arg_reloc)))
+	symbol_get_bfdsym (fixp->fx_addsy))->tc_data.ap.hppa_arg_reloc,
+	hppa_fixp->fx_arg_reloc)))
     return 1;
+#endif
   distance = (fixp->fx_offset + S_GET_VALUE (fixp->fx_addsy)
 	      - md_pcrel_from (fixp));
   /* Now check and see if we're going to need a long-branch stub.  */
@@ -6677,7 +6750,7 @@
 				frag_now);
 
 	  assert (symbolP);
-	  symbolP->bsym->flags = BSF_LOCAL;
+	  S_CLEAR_EXTERNAL (symbolP);
 	  symbol_table_insert (symbolP);
 	}
 
@@ -6707,7 +6780,8 @@
        call_info_pointer = call_info_pointer->ci_next)
     {
       elf_symbol_type *esym
-      = (elf_symbol_type *) call_info_pointer->start_symbol->bsym;
+	= ((elf_symbol_type *)
+	   symbol_get_bfdsym (call_info_pointer->start_symbol));
       esym->internal_elf_sym.st_size =
 	S_GET_VALUE (call_info_pointer->end_symbol)
 	- S_GET_VALUE (call_info_pointer->start_symbol) + 4;
diff --git a/gas/config/tc-hppa.h b/gas/config/tc-hppa.h
index c1541d9..13e10da 100644
--- a/gas/config/tc-hppa.h
+++ b/gas/config/tc-hppa.h
@@ -1,5 +1,6 @@
 /* tc-hppa.h -- Header file for the PA
-   Copyright (C) 1989, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -48,9 +49,14 @@
 /* FIXME.  The lack of a place to put things which are both target cpu
    and target format dependent makes hacks like this necessary.  */
 #ifdef OBJ_ELF
+#ifdef BFD64
+#include "bfd/elf64-hppa.h"
+#define TARGET_FORMAT "elf64-hppa"
+#else
 #include "bfd/elf32-hppa.h"
 #define TARGET_FORMAT "elf32-hppa"
 #endif
+#endif
 
 #ifdef OBJ_SOM
 #include "bfd/som.h"
@@ -128,9 +134,9 @@
    *not* end up in the symbol table.  Likewise for absolute symbols
    with local scope.  */
 #define tc_frob_symbol(sym,punt) \
-    if ((S_GET_SEGMENT (sym) == &bfd_und_section && sym->sy_used == 0) \
+    if ((S_GET_SEGMENT (sym) == &bfd_und_section && ! symbol_used_p (sym)) \
 	|| (S_GET_SEGMENT (sym) == &bfd_abs_section \
-	    && (sym->bsym->flags & BSF_EXPORT) == 0)) \
+	    && ! S_IS_EXTERNAL (sym))) \
       punt = 1
 
 /* We need to be able to make relocations involving the difference of
@@ -147,9 +153,10 @@
 #ifdef OBJ_ELF
 #define tc_frob_symbol(sym,punt) \
   { \
-    if ((S_GET_SEGMENT (sym) == &bfd_und_section && sym->sy_used == 0) \
+    if ((S_GET_SEGMENT (sym) == &bfd_und_section && ! symbol_used_p (sym)) \
 	|| (S_GET_SEGMENT (sym) == &bfd_abs_section \
-	    && (sym->bsym->flags & BSF_EXPORT) == 0)) \
+	    && ! S_IS_EXTERNAL (sym)) \
+	|| strcmp (S_GET_NAME (sym), "$global$") == 0) \
       punt = 1; \
   }
 #endif
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 7149d71..30c9abf 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -740,7 +740,7 @@
       pt (x->types[i]);
       fprintf (stdout, "\n");
       if (x->types[i]
-	  & (Reg | SReg2 | SReg3 | Control | Debug | Test | RegMMX))
+	  & (Reg | SReg2 | SReg3 | Control | Debug | Test | RegMMX | RegXMM))
 	fprintf (stdout, "%s\n", x->regs[i]->reg_name);
       if (x->types[i] & Imm)
 	pe (x->imms[i]);
@@ -835,6 +835,7 @@
   { Acc, "Acc" },
   { JumpAbsolute, "Jump Absolute" },
   { RegMMX, "rMMX" },
+  { RegXMM, "rXMM" },
   { EsSeg, "es" },
   { 0, "" }
 };
@@ -948,7 +949,10 @@
 #define BFD_RELOC_386_GOTOFF	0
 #endif
 
-int
+static int
+intel_float_operand PARAMS ((char *mnemonic));
+
+static int
 intel_float_operand (mnemonic)
      char *mnemonic;
 {
@@ -1244,7 +1248,6 @@
 
   {
     register unsigned int overlap0, overlap1;
-    expressionS *exp;
     unsigned int overlap2;
     unsigned int found_reverse_match;
     int suffix_check;
@@ -1256,11 +1259,12 @@
         && (strncmp (mnemonic, "fsub", 4) !=0)
         && (strncmp (mnemonic, "fdiv", 4) !=0))
       {
-        const reg_entry *temp_reg;
-        expressionS *temp_disp;
-        expressionS *temp_imm;
+        const reg_entry *temp_reg = NULL;
+        expressionS *temp_disp = NULL;
+        expressionS *temp_imm = NULL;
         unsigned int temp_type;
-        int xchg1, xchg2;
+        int xchg1 = 0;
+	int xchg2 = 0;
 
         if (i.operands == 2)
           {
@@ -1552,8 +1556,10 @@
 		    continue;
 		  }
 		/* Any other register is bad */
-		if (i.types[op] & (Reg | RegMMX | Control | Debug | Test
-				   | FloatReg | FloatAcc | SReg2 | SReg3))
+		if (i.types[op] & (Reg | RegMMX | RegXMM
+				   | SReg2 | SReg3
+				   | Control | Debug | Test
+				   | FloatReg | FloatAcc))
 		  {
 		    as_bad (_("`%%%s' not allowed with `%s%c'"),
 			    i.regs[op]->reg_name,
@@ -1740,12 +1746,12 @@
           }
       }
 
-    if (i.tm.base_opcode == AMD_3DNOW_OPCODE)
+    if (i.tm.opcode_modifier & ImmExt)
       {
-	/* These AMD specific instructions have an opcode suffix which
-	   is coded in the same place as an 8-bit immediate field
-	   would be.  Here we fake an 8-bit immediate operand from the
-	   opcode suffix stored in tm.extension_opcode.  */
+	/* These AMD 3DNow! and Intel Katmai New Instructions have an
+	   opcode suffix which is coded in the same place as an 8-bit
+	   immediate field would be.  Here we fake an 8-bit immediate
+	   operand from the opcode suffix stored in tm.extension_opcode.  */
 
 	expressionS *exp;
 
@@ -1822,37 +1828,21 @@
 	      {
 		unsigned int source, dest;
 		source = ((i.types[0]
-			   & (Reg
-			      | SReg2
-			      | SReg3
-			      | Control
-			      | Debug
-			      | Test
-			      | RegMMX))
+			   & (Reg | RegMMX | RegXMM
+			      | SReg2 | SReg3
+			      | Control | Debug | Test))
 			  ? 0 : 1);
 		dest = source + 1;
 
-		/* Certain instructions expect the destination to be
-		   in the i.rm.reg field.  This is by far the
-		   exceptional case.  For these instructions, if the
-		   source operand is a register, we must reverse the
-		   i.rm.reg and i.rm.regmem fields.  We accomplish
-		   this by pretending that the two register operands
-		   were given in the reverse order.  */
-		if (i.tm.opcode_modifier & ReverseRegRegmem)
-		  {
-		    const reg_entry *tmp = i.regs[source];
-		    i.regs[source] = i.regs[dest];
-		    i.regs[dest] = tmp;
-		  }
-
 		i.rm.mode = 3;
-		/* We must be careful to make sure that all
-		   segment/control/test/debug/MMX registers go into
-		   the i.rm.reg field (despite whether they are
-		   source or destination operands). */
-		if (i.regs[dest]->reg_type
-		    & (SReg2 | SReg3 | Control | Debug | Test | RegMMX))
+		/* One of the register operands will be encoded in the
+		   i.tm.reg field, the other in the combined i.tm.mode
+		   and i.tm.regmem fields.  If no form of this
+		   instruction supports a memory destination operand,
+		   then we assume the source operand may sometimes be
+		   a memory operand and so we need to store the
+		   destination in the i.rm.reg field.  */
+		if ((i.tm.operand_types[dest] & AnyMem) == 0)
 		  {
 		    i.rm.reg = i.regs[dest]->reg_num;
 		    i.rm.regmem = i.regs[source]->reg_num;
@@ -1981,6 +1971,8 @@
 		      {
 			/* Fakes a zero displacement assuming that i.types[op]
 			   holds the correct displacement size. */
+			expressionS *exp;
+
 			exp = &disp_expressions[i.disp_operands++];
 			i.disps[op] = exp;
 			exp->X_op = O_constant;
@@ -1999,12 +1991,14 @@
 		  {
 		    unsigned int op =
 		      ((i.types[0]
-			& (Reg | SReg2 | SReg3 | Control | Debug
-			   | Test | RegMMX))
+			& (Reg | RegMMX | RegXMM
+			   | SReg2 | SReg3
+			   | Control | Debug | Test))
 		       ? 0
 		       : ((i.types[1]
-			   & (Reg | SReg2 | SReg3 | Control | Debug
-			      | Test | RegMMX))
+			   & (Reg | RegMMX | RegXMM
+			      | SReg2 | SReg3
+			      | Control | Debug | Test))
 			  ? 1
 			  : 2));
 		    /* If there is an extension opcode to put here, the
@@ -2369,30 +2363,28 @@
 		  {
 		    if (i.disps[n]->X_op == O_constant)
 		      {
-			if (i.types[n] & Disp8)
+			int size = 4;
+			long val = (long) i.disps[n]->X_add_number;
+
+			if (i.types[n] & (Disp8 | Disp16))
 			  {
-			    insn_size += 1;
-			    p = frag_more (1);
-			    md_number_to_chars (p,
-						(valueT) i.disps[n]->X_add_number,
-						1);
+			    long mask;
+
+			    size = 2;
+			    mask = ~ (long) 0xffff;
+			    if (i.types[n] & Disp8)
+			      {
+				size = 1;
+				mask = ~ (long) 0xff;
+			      }
+
+			    if ((val & mask) != 0 && (val & mask) != mask)
+				as_warn (_("%ld shortened to %ld"),
+					 val, val & ~mask);
 			  }
-			else if (i.types[n] & Disp16)
-			  {
-			    insn_size += 2;
-			    p = frag_more (2);
-			    md_number_to_chars (p,
-						(valueT) i.disps[n]->X_add_number,
-						2);
-			  }
-			else
-			  {	/* Disp32 */
-			    insn_size += 4;
-			    p = frag_more (4);
-			    md_number_to_chars (p,
-						(valueT) i.disps[n]->X_add_number,
-						4);
-			  }
+			insn_size += size;
+			p = frag_more (size);
+			md_number_to_chars (p, (valueT) val, size);
 		      }
 		    else if (i.types[n] & Disp32)
 		      {
@@ -2425,30 +2417,27 @@
 		  {
 		    if (i.imms[n]->X_op == O_constant)
 		      {
-			if (i.types[n] & (Imm8 | Imm8S))
+			int size = 4;
+			long val = (long) i.imms[n]->X_add_number;
+
+			if (i.types[n] & (Imm8 | Imm8S | Imm16))
 			  {
-			    insn_size += 1;
-			    p = frag_more (1);
-			    md_number_to_chars (p,
-						(valueT) i.imms[n]->X_add_number,
-						1);
+			    long mask;
+
+			    size = 2;
+			    mask = ~ (long) 0xffff;
+			    if (i.types[n] & (Imm8 | Imm8S))
+			      {
+				size = 1;
+				mask = ~ (long) 0xff;
+			      }
+			    if ((val & mask) != 0 && (val & mask) != mask)
+				as_warn (_("%ld shortened to %ld"),
+					 val, val & ~mask);
 			  }
-			else if (i.types[n] & Imm16)
-			  {
-			    insn_size += 2;
-			    p = frag_more (2);
-			    md_number_to_chars (p,
-						(valueT) i.imms[n]->X_add_number,
-						2);
-			  }
-			else
-			  {
-			    insn_size += 4;
-			    p = frag_more (4);
-			    md_number_to_chars (p,
-						(valueT) i.imms[n]->X_add_number,
-						4);
-			  }
+			insn_size += size;
+			p = frag_more (size);
+			md_number_to_chars (p, (valueT) val, size);
 		      }
 		    else
 		      {		/* not absolute_section */
@@ -2474,7 +2463,8 @@
 			    && GOT_symbol == i.imms[n]->X_add_symbol
 			    && (i.imms[n]->X_op == O_symbol
 				|| (i.imms[n]->X_op == O_add
-				    && (i.imms[n]->X_op_symbol->sy_value.X_op
+				    && ((symbol_get_value_expression
+					 (i.imms[n]->X_op_symbol)->X_op)
 					== O_subtract))))
 			  {
 			    r_type = BFD_RELOC_386_GOTPC;
@@ -2561,7 +2551,8 @@
       if (cp != NULL)
         {
 	  char *tmpbuf;
-	  int len, first;
+	  int len = 0;
+	  int first;
 
 	  /* GOT relocations are not supported in 16 bit mode */
 	  if (flag_16bit_code)
@@ -2602,6 +2593,7 @@
 
   exp_seg = expression (exp);
 
+  SKIP_WHITESPACE ();
   if (*input_line_pointer)
     as_bad (_("Ignoring junk `%s' after expression"), input_line_pointer);
 
@@ -2620,9 +2612,13 @@
     }
   else if (exp->X_op == O_constant)
     {
+      int bigimm = Imm32;
+      if (flag_16bit_code ^ (i.prefix[DATA_PREFIX] != 0))
+	bigimm = Imm16;
+
       i.types[this_operand] |=
-	smallest_imm_type ((long) exp->X_add_number);
-  
+	(bigimm | smallest_imm_type ((long) exp->X_add_number));
+
       /* If a suffix is given, this operand may be shortended. */
       switch (i.suffix)
         {
@@ -2644,7 +2640,6 @@
 #endif
           )
     {
-    seg_unimplemented:
       as_bad (_("Unimplemented segment type %d in operand"), exp_seg);
       return 0;
     }
@@ -2790,7 +2785,8 @@
       if (cp != NULL)
         {
 	  char *tmpbuf;
-	  int len, first;
+	  int len = 0;
+	  int first;
 
 	 /* GOT relocations are not supported in 16 bit mode */
 	 if (flag_16bit_code)
@@ -2839,7 +2835,7 @@
       {
         if (S_IS_LOCAL(exp->X_add_symbol)
             && S_GET_SEGMENT (exp->X_add_symbol) != undefined_section)
-          section_symbol(exp->X_add_symbol->bsym->section);
+          section_symbol (S_GET_SEGMENT (exp->X_add_symbol));
         assert (exp->X_op == O_symbol);
         exp->X_op = O_subtract;
         exp->X_op_symbol = GOT_symbol;
@@ -2847,6 +2843,7 @@
       }
 #endif
 
+     SKIP_WHITESPACE ();
      if (*input_line_pointer)
        as_bad (_("Ignoring junk `%s' after expression"),
                input_line_pointer);
@@ -3456,6 +3453,11 @@
   else if (*op_string == IMMEDIATE_PREFIX)
     {				/* ... or an immediate */
       ++op_string;
+      if (i.types[this_operand] & JumpAbsolute)
+	{
+	  as_bad (_("Immediate operand illegal with absolute jump"));
+	  return 0;
+	}
       if (!i386_immediate (op_string))
         return 0;
     }
@@ -3469,8 +3471,8 @@
       int found_base_index_form;
 
       /* Start and end of displacement string expression (if found). */
-      char *displacement_string_start;
-      char *displacement_string_end;
+      char *displacement_string_start = NULL;
+      char *displacement_string_end = NULL;
 
     do_memory_reference:
 
@@ -3781,8 +3783,8 @@
 #else
 void
 md_convert_frag (abfd, sec, fragP)
-     bfd *abfd;
-     segT sec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     segT sec ATTRIBUTE_UNUSED;
      register fragS *fragP;
 #endif
 {
@@ -3798,7 +3800,7 @@
   /* Address we want to reach in file space. */
   target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
 #ifdef BFD_ASSEMBLER /* not needed otherwise? */
-  target_address += fragP->fr_symbol->sy_frag->fr_address;
+  target_address += symbol_get_frag (fragP->fr_symbol)->fr_address;
 #endif
 
   /* Address opcode resides at in file space. */
@@ -3864,8 +3866,8 @@
 md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol)
      char *ptr;
      addressT from_addr, to_addr;
-     fragS *frag;
-     symbolS *to_symbol;
+     fragS *frag ATTRIBUTE_UNUSED;
+     symbolS *to_symbol ATTRIBUTE_UNUSED;
 {
   long offset;
 
@@ -3915,15 +3917,34 @@
   register char *p = fixP->fx_where + fixP->fx_frag->fr_literal;
   valueT value = *valp;
 
-  if (fixP->fx_r_type == BFD_RELOC_32 && fixP->fx_pcrel)
-     fixP->fx_r_type = BFD_RELOC_32_PCREL;
-
 #if defined (BFD_ASSEMBLER) && !defined (TE_Mach)
+  if (fixP->fx_pcrel)
+    {
+      switch (fixP->fx_r_type)
+	{
+	default:
+	  break;
+
+	case BFD_RELOC_32:
+	  fixP->fx_r_type = BFD_RELOC_32_PCREL;
+	  break;
+	case BFD_RELOC_16:
+	  fixP->fx_r_type = BFD_RELOC_16_PCREL;
+	  break;
+	case BFD_RELOC_8:
+	  fixP->fx_r_type = BFD_RELOC_8_PCREL;
+	  break;
+	}
+    }
+
   /*
    * This is a hack.  There should be a better way to
    * handle this.
    */
-  if (fixP->fx_r_type == BFD_RELOC_32_PCREL && fixP->fx_addsy)
+  if ((fixP->fx_r_type == BFD_RELOC_32_PCREL
+       || fixP->fx_r_type == BFD_RELOC_16_PCREL
+       || fixP->fx_r_type == BFD_RELOC_8_PCREL)
+      && fixP->fx_addsy)
     {
 #ifndef OBJ_AOUT
       if (OUTPUT_FLAVOR == bfd_target_elf_flavour
@@ -3936,7 +3957,7 @@
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
       if (OUTPUT_FLAVOR == bfd_target_elf_flavour
 	  && (S_GET_SEGMENT (fixP->fx_addsy) == seg
-	      || (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0)
+	      || symbol_section_p (fixP->fx_addsy))
 	  && ! S_IS_EXTERNAL (fixP->fx_addsy)
 	  && ! S_IS_WEAK (fixP->fx_addsy)
 	  && S_IS_DEFINED (fixP->fx_addsy)
@@ -4023,9 +4044,9 @@
     default:
       break;
     }
-#endif
-
-#endif
+#endif /* defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) */
+  *valp = value;
+#endif /* defined (BFD_ASSEMBLER) && !defined (TE_Mach) */
   md_number_to_chars (p, value, fixP->fx_size);
 
   return 1;
@@ -4178,7 +4199,7 @@
 int
 md_parse_option (c, arg)
      int c;
-     char *arg;
+     char *arg ATTRIBUTE_UNUSED;
 {
   switch (c)
     {
@@ -4264,7 +4285,7 @@
 /* Round up a section size to the appropriate boundary.  */
 valueT
 md_section_align (segment, size)
-     segT segment;
+     segT segment ATTRIBUTE_UNUSED;
      valueT size;
 {
 #ifdef OBJ_AOUT
@@ -4299,7 +4320,7 @@
 
 static void
 s_bss (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register int temp;
 
@@ -4324,12 +4345,9 @@
     }
 }
 
-#define F(SZ,PCREL)		(((SZ) << 1) + (PCREL))
-#define MAP(SZ,PCREL,TYPE)	case F(SZ,PCREL): code = (TYPE); break
-
 arelent *
 tc_gen_reloc (section, fixp)
-     asection *section;
+     asection *section ATTRIBUTE_UNUSED;
      fixS *fixp;
 {
   arelent *rel;
@@ -4347,27 +4365,35 @@
       code = fixp->fx_r_type;
       break;
     default:
-      switch (F (fixp->fx_size, fixp->fx_pcrel))
+      if (fixp->fx_pcrel)
 	{
-	  MAP (1, 0, BFD_RELOC_8);
-	  MAP (2, 0, BFD_RELOC_16);
-	  MAP (4, 0, BFD_RELOC_32);
-	  MAP (1, 1, BFD_RELOC_8_PCREL);
-	  MAP (2, 1, BFD_RELOC_16_PCREL);
-	  MAP (4, 1, BFD_RELOC_32_PCREL);
-	default:
-	  if (fixp->fx_pcrel)
-	    as_bad (_("Can not do %d byte pc-relative relocation"),
-		    fixp->fx_size);
-	  else
-	    as_bad (_("Can not do %d byte relocation"), fixp->fx_size);
-	  code = BFD_RELOC_32;
-	  break;
+	  switch (fixp->fx_size)
+	    {
+	    default:
+	      as_bad (_("Can not do %d byte pc-relative relocation"),
+		      fixp->fx_size);
+	      code = BFD_RELOC_32_PCREL;
+	      break;
+	    case 1: code = BFD_RELOC_8_PCREL;  break;
+	    case 2: code = BFD_RELOC_16_PCREL; break;
+	    case 4: code = BFD_RELOC_32_PCREL; break;
+	    }
+	}
+      else
+	{
+	  switch (fixp->fx_size)
+	    {
+	    default:
+	      as_bad (_("Can not do %d byte relocation"), fixp->fx_size);
+	      code = BFD_RELOC_32;
+	      break;
+	    case 1: code = BFD_RELOC_8;  break;
+	    case 2: code = BFD_RELOC_16; break;
+	    case 4: code = BFD_RELOC_32; break;
+	    }
 	}
       break;
     }
-#undef MAP
-#undef F
 
   if (code == BFD_RELOC_32
       && GOT_symbol
@@ -4375,7 +4401,8 @@
     code = BFD_RELOC_386_GOTPC;
 
   rel = (arelent *) xmalloc (sizeof (arelent));
-  rel->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
 
   rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
   /* HACK: Since i386 ELF uses Rel instead of Rela, encode the
@@ -4470,6 +4497,6 @@
 
 #endif /* I386COFF */
 
-#endif /* BFD_ASSEMBLER? */
+#endif /* ! BFD_ASSEMBLER */
 
 /* end of tc-i386.c */
diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
index d876d61..ef778c1 100644
--- a/gas/config/tc-i386.h
+++ b/gas/config/tc-i386.h
@@ -1,5 +1,6 @@
 /* tc-i386.h -- Header file for tc-i386.c
-   Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation.
+   Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -270,14 +271,21 @@
 #define Acc	      0x200000	/* Accumulator %al or %ax or %eax */
 #define JumpAbsolute  0x400000
 #define RegMMX	      0x800000	/* MMX register */
-#define EsSeg	     0x1000000	/* String insn operand with fixed es segment */
+#define RegXMM	     0x1000000	/* XMM registers in PIII */
+#define EsSeg	     0x2000000	/* String insn operand with fixed es segment */
+/* InvMem is for instructions with a modrm byte that only allow a
+   general register encoding in the i.tm.mode and i.tm.regmem fields,
+   eg. control reg moves.  They really ought to support a memory form,
+   but don't, so we add an InvMem flag to the register operand to
+   indicate that it should be encoded in the i.tm.regmem field.  */
+#define InvMem	     0x4000000
 
 #define Reg	(Reg8|Reg16|Reg32)	/* gen'l register */
 #define WordReg (Reg16|Reg32)
 #define ImplicitRegister (InOutPortReg|ShiftCount|Acc|FloatAcc)
 #define Imm	(Imm8|Imm8S|Imm16|Imm32) /* gen'l immediate */
 #define Disp	(Disp8|Disp16|Disp32)	/* General displacement */
-#define AnyMem	(Disp|BaseIndex)	/* General memory */
+#define AnyMem	(Disp|BaseIndex|InvMem)	/* General memory */
 /* The following aliases are defined because the opcode table
    carefully specifies the allowed memory types for each instruction.
    At the moment we can only tell a memory reference size by the
@@ -323,7 +331,6 @@
 #define D		   0x2	/* D = 0 if Reg --> Regmem;
 				   D = 1 if Regmem --> Reg:    MUST BE 0x2 */
 #define Modrm		   0x4
-#define ReverseRegRegmem   0x8  /* swap reg,regmem fields for 2 reg case */
 #define FloatR		   0x8	/* src/dest swap for floats:   MUST BE 0x8 */
 #define ShortForm	  0x10	/* register is in low 3 bits of opcode */
 #define FloatMF		  0x20	/* FP insn memory format bit, sized by 0x4 */
@@ -341,12 +348,13 @@
 #define No_wSuf	       0x20000	/* w suffix on instruction illegal */
 #define No_lSuf	       0x40000	/* l suffix on instruction illegal */
 #define No_sSuf	       0x80000	/* s suffix on instruction illegal */
-#define FWait	      0x100000	/* instruction needs FWAIT */
-#define IsString      0x200000	/* quick test for string instructions */
-#define regKludge     0x400000	/* fake an extra reg operand for clr, imul */
-#define IsPrefix      0x800000	/* opcode is a prefix */
-#define No_dSuf      0x1000000  /* d suffix on instruction illegal */
-#define No_xSuf      0x2000000  /* x suffix on instruction illegal */
+#define No_dSuf       0x100000  /* d suffix on instruction illegal */
+#define No_xSuf       0x200000  /* x suffix on instruction illegal */
+#define FWait	      0x400000	/* instruction needs FWAIT */
+#define IsString      0x800000	/* quick test for string instructions */
+#define regKludge    0x1000000	/* fake an extra reg operand for clr, imul */
+#define IsPrefix     0x2000000	/* opcode is a prefix */
+#define ImmExt	     0x4000000	/* instruction has extension in 8 bit imm */
 #define Ugh	    0x80000000	/* deprecated fp insn, gets a warning */
 
   /* operand_types[i] describes the type of operand i.  This is made
@@ -425,18 +433,10 @@
 
 extern int flag_16bit_code;
 
-#ifdef BFD_ASSEMBLER
-#define md_maybe_text() \
-  ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
-#else
-#define md_maybe_text() \
-  (now_seg != data_section && now_seg != bss_section)
-#endif
-
 #define md_do_align(n, fill, len, max, around)				\
 if ((n) && !need_pass_2							\
     && (!(fill) || ((char)*(fill) == (char)0x90 && (len) == 1))		\
-    && md_maybe_text ())						\
+    && subseg_text_p (now_seg))						\
   {									\
     char *p;								\
     p = frag_var (rs_align_code, 15, 1, (relax_substateT) max,		\
diff --git a/gas/config/tc-i860.c b/gas/config/tc-i860.c
index f2e2b19..3317282 100644
--- a/gas/config/tc-i860.c
+++ b/gas/config/tc-i860.c
@@ -1,5 +1,5 @@
 /* tc-i860.c -- Assemble for the I860
-   Copyright (C) 1989, 92, 93, 94, 95, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1989, 92, 93, 94, 95, 98, 1999 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -1118,9 +1118,9 @@
 	      ri.r_extern = 0;
 	      ri.r_symbolnum = S_GET_TYPE (symbolP);
 	    }
-	  if (symbolP && symbolP->sy_frag)
+	  if (symbolP && symbol_get_frag (symbolP))
 	    {
-	      ri.r_addend = symbolP->sy_frag->fr_address;
+	      ri.r_addend = symbol_get_frag (symbolP)->fr_address;
 	    }
 	  ri.r_type = fixP->fx_r_type;
 	  if (fixP->fx_pcrel)
@@ -1184,9 +1184,9 @@
 	      | ((r_extern << 6) & 0x40)
 	      | (fixP->fx_r_type & 0x3F));
 
-  if (fixP->fx_addsy->sy_frag)
+  if (symbol_get_frag (fixP->fx_addsy))
     {
-      r_addend = fixP->fx_addsy->sy_frag->fr_address;
+      r_addend = symbol_get_frag (fixP->fx_addsy)->fr_address;
     }
 
   if (fixP->fx_pcrel)
diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index 936b662..d8c15c0 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -1,5 +1,5 @@
 /* tc-i960.c - All the i80960-specific stuff
-   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS.
@@ -101,7 +101,22 @@
 #define TC_S_FORCE_TO_SYSPROC(s)	(S_SET_STORAGE_CLASS((s), C_SCALL))
 
 #else /* ! OBJ_COFF */
-you lose;
+#ifdef OBJ_ELF
+#define TC_S_IS_SYSPROC(s)	0
+
+#define TC_S_IS_BALNAME(s)	0
+#define TC_S_IS_CALLNAME(s)	0
+#define TC_S_IS_BADPROC(s)	0
+
+#define TC_S_SET_SYSPROC(s, p)
+#define TC_S_GET_SYSPROC(s) 0
+
+#define TC_S_FORCE_TO_BALNAME(s)
+#define TC_S_FORCE_TO_CALLNAME(s)
+#define TC_S_FORCE_TO_SYSPROC(s)
+#else
+ #error COFF, a.out, b.out, and ELF are the only supported formats.
+#endif /* ! OBJ_ELF */
 #endif /* ! OBJ_COFF */
 #endif /* ! OBJ_A/BOUT */
 
@@ -1009,7 +1024,6 @@
 }
 
 
-#ifndef BFD_ASSEMBLER
 /*****************************************************************************
    md_convert_frag:
   	Called by base assembler after address relaxation is finished:  modify
@@ -1023,11 +1037,19 @@
   	Replace the cobr with a two instructions (a compare and a branch).
 
   *************************************************************************** */
+#ifndef BFD_ASSEMBLER
 void
 md_convert_frag (headers, seg, fragP)
      object_headers *headers;
      segT seg;
      fragS *fragP;
+#else
+void
+md_convert_frag (abfd, sec, fragP)
+     bfd *abfd;
+     segT sec;
+     fragS *fragP;
+#endif
 {
   fixS *fixP;			/* Structure describing needed address fix */
 
@@ -1082,6 +1104,7 @@
   return 0;
 }				/* md_estimate_size_before_relax() */
 
+#if defined(OBJ_AOUT) | defined(OBJ_BOUT)
 
 /*****************************************************************************
    md_ri_to_chars:
@@ -1096,7 +1119,8 @@
   	does do the reordering (Ian Taylor 28 Aug 92).
 
   *************************************************************************** */
-void
+
+static void
 md_ri_to_chars (where, ri)
      char *where;
      struct relocation_info *ri;
@@ -1114,7 +1138,8 @@
 	      | (ri->r_callj << 6));
 }
 
-#endif /* BFD_ASSEMBLER */
+#endif /* defined(OBJ_AOUT) | defined(OBJ_BOUT) */
+
 
 /* FOLLOWING ARE THE LOCAL ROUTINES, IN ALPHABETICAL ORDER  */
 
@@ -2613,7 +2638,9 @@
 	}
       TC_S_FORCE_TO_BALNAME (balP);
 
+#ifndef OBJ_ELF
       tc_set_bal_of_call (callP, balP);
+#endif
     }				/* if only one arg, or the args are the same */
 }
 
@@ -2819,25 +2846,42 @@
   return fixP->fx_where + fixP->fx_frag->fr_address;
 }
 
+#ifdef BFD_ASSEMBLER
+int
+md_apply_fix (fixP, valp)
+     fixS *fixP;
+     valueT *valp;
+#else
 void
 md_apply_fix (fixP, val)
      fixS *fixP;
      long val;
+#endif
 {
+#ifdef BFD_ASSEMBLER
+  long val = *valp;
+#endif
   char *place = fixP->fx_where + fixP->fx_frag->fr_literal;
 
   if (!fixP->fx_bit_fixP)
     {
+#ifndef BFD_ASSEMBLER
       /* For callx, we always want to write out zero, and emit a
 	 symbolic relocation.  */
       if (fixP->fx_bsr)
 	val = 0;
 
       fixP->fx_addnumber = val;
+#endif
+
       md_number_to_imm (place, val, fixP->fx_size, fixP);
     }
   else
     md_number_to_field (place, val, fixP->fx_bit_fixP);
+
+#ifdef BFD_ASSEMBLER
+  return 0;
+#endif
 }
 
 #if defined(OBJ_AOUT) | defined(OBJ_BOUT)
@@ -2937,8 +2981,14 @@
      segT seg;
      valueT addr;		/* Address to be rounded up */
 {
-  return ((addr + (1 << section_alignment[(int) seg]) - 1) & (-1 << section_alignment[(int) seg]));
-}				/* md_section_align() */
+  int align;
+#ifdef BFD_ASSEMBLER
+  align = bfd_get_section_alignment (stdoutput, seg);
+#else
+  align = section_alignment[(int) seg];
+#endif
+  return (addr + (1 << align) - 1) & (-1 << align);
+}
 
 extern int coff_flags;
 
@@ -3007,6 +3057,8 @@
 
 #endif /* OBJ_COFF */
 
+#ifndef BFD_ASSEMBLER
+
 /* Things going on here:
 
    For bout, We need to assure a couple of simplifying
@@ -3066,6 +3118,8 @@
     }				/* walk the symbol chain */
 }
 
+#endif /* ! BFD_ASSEMBLER */
+
 /* For aout or bout, the bal immediately follows the call.
 
    For coff, we cheat and store a pointer to the bal symbol in the
@@ -3105,7 +3159,7 @@
     }				/* if not in order */
 
 #else /* ! OBJ_ABOUT */
-  (as yet unwritten.);
+  as_fatal ("Only supported for a.out, b.out, or COFF");
 #endif /* ! OBJ_ABOUT */
 #endif /* ! OBJ_COFF */
 }
@@ -3124,7 +3178,7 @@
 #ifdef OBJ_ABOUT
   retval = symbol_next (callP);
 #else
-  (as yet unwritten.);
+  as_fatal ("Only supported for a.out, b.out, or COFF");
 #endif /* ! OBJ_ABOUT */
 #endif /* ! OBJ_COFF */
 
@@ -3228,4 +3282,68 @@
   return 0;
 }
 
+#ifdef BFD_ASSEMBLER
+
+/* From cgen.c:  */
+
+static short
+tc_bfd_fix2rtype (fixP)
+     fixS *fixP;
+{
+#if 0
+  if (fixP->fx_bsr)
+    abort ();
+#endif
+
+  if (fixP->fx_pcrel == 0 && fixP->fx_size == 4)
+    return BFD_RELOC_32;
+
+  if (fixP->fx_pcrel != 0 && fixP->fx_size == 4)
+    return BFD_RELOC_24_PCREL;
+
+  abort ();
+  return 0;
+}
+
+/* Translate internal representation of relocation info to BFD target
+   format.
+
+   FIXME: To what extent can we get all relevant targets to use this?  */
+
+arelent *
+tc_gen_reloc (section, fixP)
+     asection *section;
+     fixS *fixP;
+{
+  arelent * reloc;
+
+  reloc = (arelent *) xmalloc (sizeof (arelent));
+
+  /* HACK: Is this right? */
+  fixP->fx_r_type = tc_bfd_fix2rtype (fixP);
+
+  reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
+  if (reloc->howto == (reloc_howto_type *) NULL)
+    {
+      as_bad_where (fixP->fx_file, fixP->fx_line,
+		    "internal error: can't export reloc type %d (`%s')",
+		    fixP->fx_r_type,
+		    bfd_get_reloc_code_name (fixP->fx_r_type));
+      return NULL;
+    }
+
+  assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
+
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
+  reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
+  reloc->addend = fixP->fx_addnumber;
+
+  return reloc;
+}
+
+/* end from cgen.c */
+
+#endif /* BFD_ASSEMBLER */
+
 /* end of tc-i960.c */
diff --git a/gas/config/tc-i960.h b/gas/config/tc-i960.h
index f606967..2746ede 100644
--- a/gas/config/tc-i960.h
+++ b/gas/config/tc-i960.h
@@ -1,5 +1,5 @@
 /* tc-i960.h - Basic 80960 instruction formats.
-   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -22,6 +22,11 @@
 #ifndef TC_I960
 #define TC_I960 1
 
+#ifdef OBJ_ELF
+#define TARGET_FORMAT "elf32-i960"
+#define TARGET_ARCH bfd_arch_i960
+#endif
+
 #define TARGET_BYTES_BIG_ENDIAN 0
 
 #define WORKING_DOT_WORD
@@ -125,7 +130,7 @@
 #ifdef OBJ_COFF
 
 /* We store the bal information in the sy_tc field.  */
-#define TC_SYMFIELD_TYPE struct symbol *
+#define TC_SYMFIELD_TYPE symbolS *
 
 #define TC_ADJUST_RELOC_COUNT(FIXP,COUNT) \
   { fixS *tcfixp = (FIXP); \
@@ -135,20 +140,36 @@
   }
 #endif
 
-extern int i960_validate_fix PARAMS ((struct fix *, segT, struct symbol **));
+extern int i960_validate_fix PARAMS ((struct fix *, segT, symbolS **));
 #define TC_VALIDATE_FIX(FIXP,SEGTYPE,LABEL) \
 	if (i960_validate_fix (FIXP, SEGTYPE, &add_symbolP) != 0) goto LABEL
 
+#ifdef OBJ_ELF
+#define TC_RELOC_RTSYM_LOC_FIXUP(FIX)  \
+  ((FIX)->fx_addsy == NULL \
+   || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \
+       && ! S_IS_WEAK ((FIX)->fx_addsy) \
+       && S_IS_DEFINED ((FIX)->fx_addsy) \
+       && ! S_IS_COMMON ((FIX)->fx_addsy)))
+#endif
+
+#ifndef OBJ_ELF
 #define tc_fix_adjustable(FIXP)		((FIXP)->fx_bsr == 0)
+#else
+#define tc_fix_adjustable(FIXP)						\
+  ((FIXP)->fx_bsr == 0							\
+   && ! S_IS_EXTERNAL ((FIXP)->fx_addsy)				\
+   && ! S_IS_WEAK ((FIXP)->fx_addsy))
+#endif
 
 extern void brtab_emit PARAMS ((void));
 #define md_end()	brtab_emit ()
 
 extern void reloc_callj ();
 
-extern void tc_set_bal_of_call PARAMS ((struct symbol *, struct symbol *));
+extern void tc_set_bal_of_call PARAMS ((symbolS *, symbolS *));
 
-extern struct symbol *tc_get_bal_of_call PARAMS ((struct symbol *));
+extern struct symbol *tc_get_bal_of_call PARAMS ((symbolS *));
 
 extern void i960_handle_align ();
 #define HANDLE_ALIGN(FRAG)	i960_handle_align (FRAG)
diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c
index 997e623..300f997 100644
--- a/gas/config/tc-m32r.c
+++ b/gas/config/tc-m32r.c
@@ -136,11 +136,11 @@
 
   /* Sigh.  I guess all warnings must now have both variants.  */
 #define OPTION_WARN_UNMATCHED (OPTION_MD_BASE + 4)
-  {"warn-unmatched-high", OPTION_WARN_UNMATCHED},
-  {"Wuh", OPTION_WARN_UNMATCHED},
+  {"warn-unmatched-high", no_argument, NULL, OPTION_WARN_UNMATCHED},
+  {"Wuh", no_argument, NULL, OPTION_WARN_UNMATCHED},
 #define OPTION_NO_WARN_UNMATCHED (OPTION_MD_BASE + 5)
-  {"no-warn-unmatched-high", OPTION_WARN_UNMATCHED},
-  {"Wnuh", OPTION_WARN_UNMATCHED},
+  {"no-warn-unmatched-high", no_argument, NULL, OPTION_WARN_UNMATCHED},
+  {"Wnuh", no_argument, NULL, OPTION_WARN_UNMATCHED},
 
 #if 0 /* not supported yet */
 #define OPTION_RELAX  (OPTION_MD_BASE + 6)
@@ -179,6 +179,10 @@
 #endif
 
     default:
+      if (arg)
+	fprintf (stderr, _("%s: unrecognised command line option: -%c\n"), myname, c);
+      else
+	fprintf (stderr, _("%s: unrecognised command line option: -%c%s\n"), myname, c, arg);
       return 0;
     }
   return 1;
@@ -245,7 +249,7 @@
 {
   /* Only do this if the fill pattern wasn't specified.  */
   if (fill == NULL
-      && (now_seg->flags & SEC_CODE) != 0
+      && subseg_text_p (now_seg)
       /* Only do this special handling if aligning to at least a
 	 4 byte boundary.  */
       && n > 1
@@ -336,7 +340,7 @@
       link->symbol = symbolP;
       link->next = debug_sym_link;
       debug_sym_link = link;
-      symbolP->local = 1;
+      symbol_get_obj (symbolP)->local = 1;
     }
 
   *end_name = delim;
@@ -694,7 +698,7 @@
       return;
     }
 
-  if (symbolP->local)
+  if (symbol_get_obj (symbolP)->local)
     {
       segT   old_sec    = now_seg;
       int    old_subsec = now_subseg;
@@ -707,9 +711,9 @@
 	frag_align (align2, 0, 0);
       
       if (S_GET_SEGMENT (symbolP) == sbss_section)
-	symbolP->sy_frag->fr_symbol = 0;
+	symbol_get_frag (symbolP)->fr_symbol = 0;
       
-      symbolP->sy_frag = frag_now;
+      symbol_set_frag (symbolP, frag_now);
       
       pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, size,
 			(char *) 0);
@@ -936,7 +940,7 @@
     {
       /* Address we want to reach in file space.  */
       target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
-      target_address += fragP->fr_symbol->sy_frag->fr_address;
+      target_address += symbol_get_frag (fragP->fr_symbol)->fr_address;
       addend = (target_address - (opcode_address & -4)) >> 2;
     }
 
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 856dd4e..0749665 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -1,5 +1,5 @@
 /* tc-m68k.c -- Assemble for the m68k family
-   Copyright (C) 1987, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1987, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -27,6 +27,10 @@
 #include "opcode/m68k.h"
 #include "m68k-parse.h"
 
+#if defined (OBJ_ELF)
+#include "elf/m68k.h"
+#endif
+
 /* This string holds the chars that always start a comment.  If the
    pre-processor is disabled, these aren't very useful.  The macro
    tc_comment_chars points to this.  We use this, rather than the
@@ -189,7 +193,7 @@
   USP, VBR, URP, SRP, PCR,
   0
 };
-static const enum m68k_register mcf5200_control_regs[] = {
+static const enum m68k_register mcf_control_regs[] = {
   CACR, TC, ITT0, ITT1, DTT0, DTT1, VBR, ROMBAR, 
   RAMBAR0, RAMBAR1, MBAR,
   0
@@ -247,9 +251,10 @@
   reloc[5];			/* Five is enough??? */
 };
 
-#define cpu_of_arch(x)		((x) & (m68000up|mcf5200))
+#define cpu_of_arch(x)		((x) & (m68000up|mcf))
 #define float_of_arch(x)	((x) & mfloat)
 #define mmu_of_arch(x)		((x) & mmmu)
+#define arch_coldfire_p(x)	(((x) & mcf) != 0)
 
 /* Macros for determining if cpu supports a specific addressing mode */
 #define HAVE_LONG_BRANCH(x)	((x) & (m68020|m68030|m68040|m68060|cpu32))
@@ -391,6 +396,8 @@
   { m68881, "68881", 0 },
   { m68851, "68851", 0 },
   { mcf5200, "5200", 0 },
+  { mcf5206e, "5206e", 0 },
+  { mcf5307, "5307", 0},
   /* Aliases (effectively, so far as gas is concerned) for the above
      cpus.  */
   { m68020, "68k", 1 },
@@ -418,6 +425,9 @@
   { cpu32,  "68349", 1 },
   { cpu32,  "68360", 1 },
   { m68881, "68882", 1 },
+  { mcf5200, "5202", 1 },
+  { mcf5200, "5204", 1 },
+  { mcf5200, "5206", 1 },
 };
 
 static const int n_archs = sizeof (archs) / sizeof (archs[0]);
@@ -897,7 +907,8 @@
 #undef MAP
 
   reloc = (arelent *) xmalloc (sizeof (arelent));
-  reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
 #ifndef OBJ_ELF
   if (fixp->fx_pcrel)
@@ -1471,11 +1482,26 @@
 		    losing++;
 		  break;
 
+		case 'E':
+		  if (opP->reg != ACC)
+		    losing++;
+		  break;
+
 		case 'F':
 		  if (opP->mode != FPREG)
 		    losing++;
 		  break;
 
+		case 'G':
+		  if (opP->reg != MACSR)
+		    losing++;
+		  break;
+
+		case 'H':
+		  if (opP->reg != MASK)
+		    losing++;
+		  break;
+
 		case 'I':
 		  if (opP->mode != CONTROL
 		      || opP->reg < COP0
@@ -1737,6 +1763,19 @@
 		    ++losing;
 		  break;
 
+		case 'u':
+		  if (opP->reg < DATA0L || opP->reg > ADDR7U)
+		    losing++;
+		  /* FIXME: kludge instead of fixing parser:
+                     upper/lower registers are *not* CONTROL
+                     registers, but ordinary ones. */
+		  if ((opP->reg >= DATA0L && opP->reg <= DATA7L)
+		      || (opP->reg >= DATA0U && opP->reg <= DATA7U))
+		    opP->mode = DREG;
+		  else
+		    opP->mode = AREG;
+		  break;
+
 		default:
 		  abort ();
 		}		/* switch on type of operand */
@@ -1994,11 +2033,11 @@
 		      && ((opP->disp.size == SIZE_UNSPEC
 			   && flag_short_refs == 0
 			   && cpu_of_arch (current_architecture) >= m68020
-			   && cpu_of_arch (current_architecture) != mcf5200)
+			   && ! arch_coldfire_p (current_architecture))
 			  || opP->disp.size == SIZE_LONG)))
 		{
 		  if (cpu_of_arch (current_architecture) < m68020
-		      || cpu_of_arch (current_architecture) == mcf5200)
+		      || arch_coldfire_p (current_architecture))
 		    opP->error =
 		      _("displacement too large for this architecture; needs 68020 or higher");
 		  if (opP->reg == PC)
@@ -2107,12 +2146,16 @@
 		  if ((opP->index.scale != 1 
 		       && cpu_of_arch (current_architecture) < m68020)
 		      || (opP->index.scale == 8 
-			  && current_architecture == mcf5200))
+			  && arch_coldfire_p (current_architecture)))
 		    {
 		      opP->error =
 			_("scale factor invalid on this architecture; needs cpu32 or 68020 or higher");
 		    }
 
+		  if (arch_coldfire_p (current_architecture)
+		      && opP->index.size == SIZE_WORD)
+		    opP->error = _("invalid index size for coldfire");
+
 		  switch (opP->index.scale)
 		    {
 		    case 1:
@@ -2144,7 +2187,7 @@
 		    {
 		      if (siz1 == SIZE_BYTE
 			  || cpu_of_arch (current_architecture) < m68020
-			  || cpu_of_arch (current_architecture) == mcf5200
+			  || arch_coldfire_p (current_architecture)
 			  || (siz1 == SIZE_UNSPEC
 			      && ! isvar (&opP->disp)
 			      && issbyte (baseo)))
@@ -2211,7 +2254,7 @@
 	      /* It isn't simple.  */
 
 	      if (cpu_of_arch (current_architecture) < m68020
-		  || cpu_of_arch (current_architecture) == mcf5200)
+		  || arch_coldfire_p (current_architecture))
 		opP->error =
 		  _("invalid operand mode for this architecture; needs 68020 or higher");
 
@@ -2570,10 +2613,17 @@
 	  install_operand (s[1], opP->reg - DATA);
 	  break;
 
+	case 'E':		/* Ignore it */
+	  break;
+
 	case 'F':
 	  install_operand (s[1], opP->reg - FP0);
 	  break;
 
+	case 'G':		/* Ignore it */
+	case 'H':
+	  break;
+
 	case 'I':
 	  tmpreg = opP->reg - COP0;
 	  install_operand (s[1], tmpreg);
@@ -2901,6 +2951,11 @@
 	  addword (tmpreg >> 16);
 	  addword (tmpreg & 0xFFFF);
 	  break;
+	case 'u':
+	  install_operand (s[1], opP->reg - DATA0L);
+	  opP->reg -= (DATA0L);
+	  opP->reg &= 0x0F;	/* remove upper/lower bit */
+	  break;
 	default:
 	  abort ();
 	}
@@ -3040,6 +3095,30 @@
       the_ins.opcode[1] = (val >> 16);
       the_ins.opcode[2] = val & 0xffff;
       break;
+    case 'm':
+      the_ins.opcode[0] |= ((val & 0x8) << (6 - 3));
+      the_ins.opcode[0] |= ((val & 0x7) << 9);
+      the_ins.opcode[1] |= ((val & 0x10) << (7 - 4));
+      break;
+    case 'n':
+      the_ins.opcode[0] |= ((val & 0x8) << (6 - 3));
+      the_ins.opcode[0] |= ((val & 0x7) << 9);
+      break;
+    case 'o':
+      the_ins.opcode[1] |= val << 12;
+      the_ins.opcode[1] |= ((val & 0x10) << (7 - 4));
+      break;
+    case 'M':
+      the_ins.opcode[0] |= (val & 0xF);
+      the_ins.opcode[1] |= ((val & 0x10) << (6 - 4));
+      break;
+    case 'N':
+      the_ins.opcode[1] |= (val & 0xF);
+      the_ins.opcode[1] |= ((val & 0x10) << (6 - 4));
+      break;
+    case 'h':
+      the_ins.opcode[1] |= ((val != 1) << 10);
+      break;
     case 'c':
     default:
       as_fatal (_("failed sanity check."));
@@ -3241,6 +3320,10 @@
   { "ccr", CCR },
   { "cc", CCR },
 
+  { "acc", ACC },
+  { "macsr", MACSR },
+  { "mask", MASK },
+
   /* control registers */
   { "sfc", SFC },		/* Source Function Code */
   { "sfcr", SFC },
@@ -3345,6 +3428,43 @@
   { "za6", ZADDR6 },
   { "za7", ZADDR7 },
 
+  /* Upper and lower data and address registers, used by macw and msacw. */
+  { "d0l", DATA0L },
+  { "d1l", DATA1L },
+  { "d2l", DATA2L },
+  { "d3l", DATA3L },
+  { "d4l", DATA4L },
+  { "d5l", DATA5L },
+  { "d6l", DATA6L },
+  { "d7l", DATA7L },
+
+  { "a0l", ADDR0L },
+  { "a1l", ADDR1L },
+  { "a2l", ADDR2L },
+  { "a3l", ADDR3L },
+  { "a4l", ADDR4L },
+  { "a5l", ADDR5L },
+  { "a6l", ADDR6L },
+  { "a7l", ADDR7L },
+
+  { "d0u", DATA0U },
+  { "d1u", DATA1U },
+  { "d2u", DATA2U },
+  { "d3u", DATA3U },
+  { "d4u", DATA4U },
+  { "d5u", DATA5U },
+  { "d6u", DATA6U },
+  { "d7u", DATA7U },
+
+  { "a0u", ADDR0U },
+  { "a1u", ADDR1U },
+  { "a2u", ADDR2U },
+  { "a3u", ADDR3U },
+  { "a4u", ADDR4U },
+  { "a5u", ADDR5U },
+  { "a6u", ADDR6U },
+  { "a7u", ADDR7U },
+
   { 0, 0 }
 };
 
@@ -3779,7 +3899,9 @@
       control_regs = cpu32_control_regs;
       break;
     case mcf5200:
-      control_regs = mcf5200_control_regs;
+    case mcf5206e:
+    case mcf5307:
+      control_regs = mcf_control_regs;
       break;
     default:
       abort ();
@@ -3853,7 +3975,7 @@
   select_control_regs ();
 
   if (cpu_of_arch (current_architecture) < m68020
-      || cpu_of_arch (current_architecture) == mcf5200)
+      || arch_coldfire_p (current_architecture))
     md_relax_table[TAB (PCINDEX, BYTE)].rlx_more = 0;
 }
 
@@ -4171,7 +4293,7 @@
   disp = (disp + fragP->fr_offset) - object_address;
 
 #ifdef BFD_ASSEMBLER
-  disp += fragP->fr_symbol->sy_frag->fr_address;
+  disp += symbol_get_frag (fragP->fr_symbol)->fr_address;
 #endif
 
   switch (fragP->fr_subtype)
@@ -4373,8 +4495,8 @@
 
 void
 md_convert_frag (abfd, sec, fragP)
-     bfd *abfd;
-     segT sec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     segT sec ATTRIBUTE_UNUSED;
      fragS *fragP;
 {
   md_convert_frag_1 (fragP);
@@ -4620,14 +4742,14 @@
 	 word mode.  */
       if (fragP->fr_symbol && S_GET_VALUE (fragP->fr_symbol) == 0)
 	{
+	  fragS *stop;
 	  fragS *l;
 
-	  for (l = fragP->fr_next;
-	       l != fragP->fr_symbol->sy_frag;
-	       l = l->fr_next)
+	  stop = symbol_get_frag (fragP->fr_symbol);
+	  for (l = fragP->fr_next; l != stop; l = l->fr_next)
 	    if (l->fr_fix + l->fr_var != 0)
 	      break;
-	  if (l == fragP->fr_symbol->sy_frag)
+	  if (l == stop)
 	    {
 	      fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);
 	      fragP->fr_var += 2;
@@ -4712,8 +4834,8 @@
 md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol)
      char *ptr;
      addressT from_addr, to_addr;
-     fragS *frag;
-     symbolS *to_symbol;
+     fragS *frag ATTRIBUTE_UNUSED;
+     symbolS *to_symbol ATTRIBUTE_UNUSED;
 {
   valueT offset;
 
@@ -4898,7 +5020,7 @@
 
 static void
 s_data1 (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   subseg_set (data_section, 1);
   demand_empty_rest_of_line ();
@@ -4906,7 +5028,7 @@
 
 static void
 s_data2 (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   subseg_set (data_section, 2);
   demand_empty_rest_of_line ();
@@ -4914,7 +5036,7 @@
 
 static void
 s_bss (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   /* We don't support putting frags in the BSS segment, we fake it
      by marking in_bss, then looking at s_skip for clues.  */
@@ -4925,7 +5047,7 @@
 
 static void
 s_even (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register int temp;
   register long temp_fill;
@@ -4940,7 +5062,7 @@
 
 static void
 s_proc (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   demand_empty_rest_of_line ();
 }
@@ -5016,7 +5138,7 @@
 
 static void
 s_chip (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *stop = NULL;
   char stopc;
@@ -5033,7 +5155,7 @@
 
 static void
 s_fopt (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   SKIP_WHITESPACE ();
 
@@ -5143,7 +5265,7 @@
 
 static void
 s_opt (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   do
     {
@@ -5211,8 +5333,8 @@
 
 static void
 skip_to_comma (arg, on)
-     int arg;
-     int on;
+     int arg ATTRIBUTE_UNUSED;
+     int on ATTRIBUTE_UNUSED;
 {
   while (*input_line_pointer != ','
 	 && ! is_end_of_line[(unsigned char) *input_line_pointer])
@@ -5223,8 +5345,8 @@
 
 static void
 opt_nest (arg, on)
-     int arg;
-     int on;
+     int arg ATTRIBUTE_UNUSED;
+     int on ATTRIBUTE_UNUSED;
 {
   if (*input_line_pointer != '=')
     {
@@ -5240,8 +5362,8 @@
 
 static void
 opt_chip (arg, on)
-     int arg;
-     int on;
+     int arg ATTRIBUTE_UNUSED;
+     int on ATTRIBUTE_UNUSED;
 {
   if (*input_line_pointer != '=')
     {
@@ -5257,7 +5379,7 @@
 
 static void
 opt_list (arg, on)
-     int arg;
+     int arg ATTRIBUTE_UNUSED;
      int on;
 {
   listing_list (on);
@@ -5267,7 +5389,7 @@
 
 static void
 opt_list_symbols (arg, on)
-     int arg;
+     int arg ATTRIBUTE_UNUSED;
      int on;
 {
   if (on)
@@ -5280,7 +5402,7 @@
 
 static void
 s_reg (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *s;
   int c;
@@ -5351,7 +5473,7 @@
 
   S_SET_SEGMENT (line_label, reg_section);
   S_SET_VALUE (line_label, ~mask);
-  line_label->sy_frag = &zero_address_frag;
+  symbol_set_frag (line_label, &zero_address_frag);
 
   if (flag_mri)
     mri_comment_end (stop, stopc);
@@ -5384,7 +5506,7 @@
 
 static void
 s_save (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   struct save_opts *s;
 
@@ -5409,7 +5531,7 @@
 
 static void
 s_restore (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   struct save_opts *s;
 
@@ -6086,7 +6208,7 @@
 
 static void
 s_mri_endi (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   if (mri_control_stack == NULL
       || mri_control_stack->type != mri_if)
@@ -6429,7 +6551,7 @@
 
 static void
 s_mri_endf (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   if (mri_control_stack == NULL
       || mri_control_stack->type != mri_for)
@@ -6465,7 +6587,7 @@
 
 static void
 s_mri_repeat (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   struct mri_control_info *n;
 
@@ -6570,7 +6692,7 @@
 
 static void
 s_mri_endw (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *buf;
 
@@ -6929,7 +7051,7 @@
 /* ARGSUSED */
 symbolS *
 md_undefined_symbol (name)
-     char *name;
+     char *name ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -6937,7 +7059,7 @@
 /* Round up a section size to the appropriate boundary.  */
 valueT
 md_section_align (segment, size)
-     segT segment;
+     segT segment ATTRIBUTE_UNUSED;
      valueT size;
 {
 #ifdef OBJ_AOUT
@@ -7005,5 +7127,12 @@
 
 #endif
 #endif
-
+#ifdef OBJ_ELF
+void m68k_elf_final_processing()
+{
+   /* Set file-specific flags if this is a cpu32 processor */
+   if (cpu_of_arch (current_architecture) & cpu32)
+     elf_elfheader (stdoutput)->e_flags |= EF_CPU32;
+}
+#endif
 /* end of tc-m68k.c */
diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h
index bc8308a..b8492b9 100644
--- a/gas/config/tc-m68k.h
+++ b/gas/config/tc-m68k.h
@@ -1,5 +1,5 @@
 /* This file is tc-m68k.h
-   Copyright (C) 1987, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1987, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -22,7 +22,6 @@
 #define TC_M68K 1
 
 #ifdef ANSI_PROTOTYPES
-struct symbol;
 struct fix;
 #endif
 
@@ -138,13 +137,13 @@
 extern int m68k_conditional_pseudoop PARAMS ((pseudo_typeS *));
 #define tc_conditional_pseudoop(pop) m68k_conditional_pseudoop (pop)
 
-extern void m68k_frob_label PARAMS ((struct symbol *));
+extern void m68k_frob_label PARAMS ((symbolS *));
 #define tc_frob_label(sym) m68k_frob_label (sym)
 
 extern void m68k_flush_pending_output PARAMS ((void));
 #define md_flush_pending_output() m68k_flush_pending_output ()
 
-extern void m68k_frob_symbol PARAMS ((struct symbol *));
+extern void m68k_frob_symbol PARAMS ((symbolS *));
 
 #ifdef BFD_ASSEMBLER
 
@@ -176,6 +175,8 @@
 
 #define tc_fix_adjustable(X) tc_m68k_fix_adjustable(X)
 extern int tc_m68k_fix_adjustable PARAMS ((struct fix *));
+#define elf_tc_final_processing m68k_elf_final_processing
+extern void m68k_elf_final_processing PARAMS ((void));
 #endif
 
 #define TC_FORCE_RELOCATION(FIX)			\
diff --git a/gas/config/tc-m88k.c b/gas/config/tc-m88k.c
index 931a496a..f77460a 100644
--- a/gas/config/tc-m88k.c
+++ b/gas/config/tc-m88k.c
@@ -1,7 +1,7 @@
 /* m88k.c -- Assembler for the Motorola 88000
    Contributed by Devon Bowen of Buffalo University
    and Torbjorn Granlund of the Swedish Institute of Computer Science.
-   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 1997
+   Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
@@ -1214,9 +1214,9 @@
 	      ri.r_extern = 0;
 	      ri.r_symbolnum = symbolP->sy_type & N_TYPE;
 	    }
-	  if (symbolP && symbolP->sy_frag)
+	  if (symbolP && symbol_get_frag (symbolP))
 	    {
-	      ri.r_addend = symbolP->sy_frag->fr_address;
+	      ri.r_addend = symbol_get_frag (symbolP)->fr_address;
 	    }
 	  ri.r_type = fixP->fx_r_type;
 	  if (fixP->fx_pcrel)
@@ -1294,10 +1294,10 @@
 	    frag_align (bss_align, 0, 0);
 
 	  /* detach from old frag */
-	  if (symbolP->sy_type == N_BSS && symbolP->sy_frag != NULL)
-	    symbolP->sy_frag->fr_symbol = NULL;
+	  if (symbolP->sy_type == N_BSS && symbol_get_frag (symbolP) != NULL)
+	    symbol_get_frag (symbolP)->fr_symbol = NULL;
 
-	  symbolP->sy_frag  = frag_now;
+	  symbol_set_frag (symbolP, frag_now);
 	  p = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
 			(offsetT) temp, (char *)0);
 	  *p = 0;
diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c
index 7e78435..d33fc9f 100644
--- a/gas/config/tc-mcore.c
+++ b/gas/config/tc-mcore.c
@@ -1,6 +1,5 @@
 /* tc-mcore.c -- Assemble code for M*Core
-
-   Copyright (C) 1993,1994, 1999 Free Software Foundation.
+   Copyright (C) 1999 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -53,16 +52,19 @@
 static void   check_literals PARAMS ((int, int));
 static void   mcore_s_text    PARAMS ((int));
 static void   mcore_s_data    PARAMS ((int));
-#ifdef OBJ_ELF
 static void   mcore_s_section PARAMS ((int));
+static void   mcore_s_bss     PARAMS ((int));
+#ifdef OBJ_ELF
+static void   mcore_s_comm    PARAMS ((int));
 #endif
 
+
 /* Several places in this file insert raw instructions into the
    object. They should use MCORE_INST_XXX macros to get the opcodes
    and then use these two macros to crack the MCORE_INST value into
    the appropriate byte values.  */
-#define	INST_BYTE0(x)	(((x) >> 8) & 0xFF)
-#define	INST_BYTE1(x)	((x) & 0xFF)
+#define	INST_BYTE0(x)  (((x) >> 8) & 0xFF)
+#define	INST_BYTE1(x)  ((x) & 0xFF)
 
 const char comment_chars[] = "#/";
 const char line_separator_chars[] = ";";
@@ -70,7 +72,6 @@
 
 const int md_reloc_size = 8;
 
-static int relax;		/* set if -relax seen */
 static int do_jsri2bsr = 0;	/* change here from 1 by Cruess 19 August 97 */
 static int sifilter_mode = 0;
 
@@ -165,7 +166,6 @@
   { "import",   s_ignore,         0 },
   { "literals", mcore_s_literals, 0 },
   { "page",     listing_eject,    0 },
-  { "bss",      s_lcomm_bytes,    1 },
 
   /* The following are to intercept the placement of data into the text
      section (eg addresses for a switch table), so that the space they
@@ -197,13 +197,15 @@
   /* Allow for the effect of section changes.  */
   { "text",      mcore_s_text,    0 },
   { "data",      mcore_s_data,    0 },
-  
-#ifdef OBJ_ELF
+  { "bss",       mcore_s_bss,     1 },
+#ifdef OBJ_EF
+  { "comm",      mcore_s_comm,    0 },
+#endif
   { "section",   mcore_s_section, 0 },
   { "section.s", mcore_s_section, 0 },
   { "sect",      mcore_s_section, 0 },
   { "sect.s",    mcore_s_section, 0 },
-#endif  
+  
   { 0,          0,                0 }
 };
 
@@ -304,13 +306,20 @@
   check_literals (2, 0);
 }
 
+/* Handle the section changing pseudo-ops.  These call through to the
+   normal implementations, but they dump the literal pool first.  */
+
 static void
 mcore_s_text (ignore)
      int ignore;
 {
   dump_literals (0);
   
+#ifdef OBJ_ELF
+  obj_elf_text (ignore);
+#else
   s_text (ignore);
+#endif
 }
 
 static void
@@ -319,9 +328,47 @@
 {
   dump_literals (0);
   
+#ifdef OBJ_ELF
+  obj_elf_data (ignore);
+#else
   s_data (ignore);
+#endif
 }
 
+static void
+mcore_s_section (ignore)
+     int ignore;
+{
+  dump_literals (0);
+
+#ifdef OBJ_ELF
+  obj_elf_section (ignore);
+#endif
+#ifdef OBJ_COFF
+  obj_coff_section (ignore);
+#endif
+}
+
+static void
+mcore_s_bss (needs_align)
+     int needs_align;
+{
+  dump_literals (0);
+  
+  s_lcomm_bytes (needs_align);
+}
+
+#ifdef OBJ_ELF
+static void
+mcore_s_comm (needs_align)
+     int needs_align;
+{
+  dump_literals (0);
+  
+  obj_elf_common (needs_align);
+}
+#endif
+
 /* This function is called once, at assembler startup time.  This should
   set up all the tables, etc that the MD part of the assembler needs.  */
 void
@@ -394,7 +441,7 @@
     }
   else if (   tolower (s[0]) == 's'
 	   && tolower (s[1]) == 'p'
-	   && (isspace (s[2]) || s[2] == ','))
+	   && ! isalnum (s[2]))
     {
       * reg = 0;
       return s + 2;
@@ -533,13 +580,16 @@
   s[7] = 0;
 }
 
+#define POOL_END_LABEL   ".LE"
+#define POOL_START_LABEL ".LS"
+
 static void
 dump_literals (isforce)
      int isforce;
 {
   int i;
   struct literal * p;
-  struct symbol * brarsym;
+  symbolS * brarsym;
   
   if (poolsize == 0)
     return;
@@ -550,7 +600,7 @@
       char * output;
       char brarname[8];
       
-      make_name (brarname, ".YP.", poolnumber);
+      make_name (brarname, POOL_END_LABEL, poolnumber);
       
       brarsym = symbol_make (brarname);
       
@@ -642,7 +692,7 @@
       if (++ poolnumber > 0xFFFF)
 	as_fatal (_("more than 65K literal pools"));
       
-      make_name (poolname, ".XP.", poolnumber);
+      make_name (poolname, POOL_START_LABEL, poolnumber);
       poolsym = symbol_make (poolname);
       symbol_table_insert (poolsym);
       poolspan = 0;
@@ -877,8 +927,8 @@
          fixes problem of an interrupt during a jmp.. */
       if (sifilter_mode)
 	{
-	  output[0] = (inst >> 8);
-	  output[1] = (inst);
+	  output[0] = INST_BYTE0 (inst);
+	  output[1] = INST_BYTE1 (inst);
 	  output = frag_more (2);
 	}
       break;
@@ -896,20 +946,20 @@
 	{
 	  /* Replace with:  bsr .+2 ; addi r15,6; jmp rx ; jmp rx */
 	  inst = MCORE_INST_BSR;	/* with 0 displacement */
-	  output[0] = (inst >> 8);
-	  output[1] = (inst);
+	  output[0] = INST_BYTE0 (inst);
+	  output[1] = INST_BYTE1 (inst);
 
 	  output = frag_more (2);
 	  inst = MCORE_INST_ADDI;
 	  inst |= 15;			/* addi r15,6 */
 	  inst |= (6 - 1) << 4;		/* over the jmp's */
-	  output[0] = (inst >> 8);
-	  output[1] = (inst);
+	  output[0] = INST_BYTE0 (inst);
+	  output[1] = INST_BYTE1 (inst);
 
 	  output = frag_more (2);
 	  inst = MCORE_INST_JMP | reg;
-	  output[0] = (inst >> 8);
-	  output[1] = (inst);
+	  output[0] = INST_BYTE0 (inst);
+	  output[1] = INST_BYTE1 (inst);
 
 	  output = frag_more (2);		/* 2nd emitted in fallthru */
 	}
@@ -1496,8 +1546,8 @@
       as_bad (_("unimplemented opcode \"%s\""), name);
     }
   
-  output[0] = inst >> 8;
-  output[1] = inst;
+  output[0] = INST_BYTE0 (inst);
+  output[1] = INST_BYTE1 (inst);
   
   check_literals (opcode->transfer, isize);
 }
@@ -1531,7 +1581,7 @@
 {
   int prec;
   LITTLENUM_TYPE words[MAX_LITTLENUMS];
-  LITTLENUM_TYPE * wordP;
+  int    i;
   char * t;
   char * atof_ieee ();
 
@@ -1573,26 +1623,25 @@
 
   *sizeP = prec * sizeof (LITTLENUM_TYPE);
   
-  for (wordP = words; prec--;)
-    {
-      md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE));
-      litP += sizeof (LITTLENUM_TYPE);
-    }
+    for (i = 0; i < prec; i++)
+      {
+	md_number_to_chars (litP, (valueT) words[i],
+			    sizeof (LITTLENUM_TYPE));
+	litP += sizeof (LITTLENUM_TYPE);
+      }
   
   return 0;
 }
 
 CONST char * md_shortopts = "";
 
-#define OPTION_RELAX		(OPTION_MD_BASE)
-#define OPTION_JSRI2BSR_ON	(OPTION_MD_BASE + 1)
-#define OPTION_JSRI2BSR_OFF	(OPTION_MD_BASE + 2)
-#define OPTION_SIFILTER_ON	(OPTION_MD_BASE + 3)
-#define OPTION_SIFILTER_OFF	(OPTION_MD_BASE + 4)
+#define OPTION_JSRI2BSR_ON	(OPTION_MD_BASE + 0)
+#define OPTION_JSRI2BSR_OFF	(OPTION_MD_BASE + 1)
+#define OPTION_SIFILTER_ON	(OPTION_MD_BASE + 2)
+#define OPTION_SIFILTER_OFF	(OPTION_MD_BASE + 3)
 
 struct option md_longopts[] =
 {
-  { "relax",       no_argument, NULL, OPTION_RELAX},
   { "no-jsri2bsr", no_argument, NULL, OPTION_JSRI2BSR_OFF},
   { "jsri2bsr",    no_argument, NULL, OPTION_JSRI2BSR_ON},
   { "sifilter",    no_argument, NULL, OPTION_SIFILTER_ON},
@@ -1613,7 +1662,6 @@
   switch (c)
     {
       
-    case OPTION_RELAX:        relax = 1;         break;
     case OPTION_JSRI2BSR_ON:  do_jsri2bsr = 1;   break;
     case OPTION_JSRI2BSR_OFF: do_jsri2bsr = 0;   break;
     case OPTION_SIFILTER_ON:  sifilter_mode = 1; break;
@@ -1630,9 +1678,8 @@
 {
   fprintf (stream, _("\
 MCORE specific options:\n\
-  -{no-}jsri2bsr	  {dis}able jsri to bsr transformation (def: off)\n\
-  -{no-}sifilter	  {dis}able silicon filter behavior (def: off)\n\
-  -relax		  alter jump instructions for long displacements\n"));
+  -{no-}jsri2bsr	  {dis}able jsri to bsr transformation (def: dis)\n\
+  -{no-}sifilter	  {dis}able silicon filter behavior (def: dis)"));
 }
 
 int md_short_jump_size;
@@ -1670,7 +1717,7 @@
   int targ_addr = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
   
   buffer = (unsigned char *) (fragP->fr_fix + fragP->fr_literal);
-  targ_addr += fragP->fr_symbol->sy_frag->fr_address;
+  targ_addr += symbol_get_frag (fragP->fr_symbol)->fr_address;
 
   switch (fragP->fr_subtype)
     {
@@ -1683,14 +1730,17 @@
 	int disp = targ_addr - next_inst;
 	
 	if (disp & 1)
-	    as_bad (_("odd displacement at %x"), next_inst - 2);
+	  as_bad (_("odd displacement at %x"), next_inst - 2);
 	
 	disp >>= 1;
-	t0 = buffer[0] & 0xF8;
+	  {
+	    t0 = buffer[0] & 0xF8;
 	
-	md_number_to_chars (buffer, disp, 2);
+	    md_number_to_chars (buffer, disp, 2);
 	
-	buffer[0] = (buffer[0] & 0x07) | t0;
+	    buffer[0] = (buffer[0] & 0x07) | t0;
+	  }
+	
 	fragP->fr_fix += 2;
 	fragP->fr_var = 0;
       }
@@ -1712,15 +1762,18 @@
 	int first_inst = fragP->fr_fix + fragP->fr_address;
 	int needpad = (first_inst & 3);
 
-	buffer[0] ^= 0x08;	/* Toggle T/F bit */
+	  buffer[0] ^= 0x08;	/* Toggle T/F bit */
 
 	buffer[2] = INST_BYTE0 (MCORE_INST_JMPI);	/* Build jmpi */
 	buffer[3] = INST_BYTE1 (MCORE_INST_JMPI);
  
 	if (needpad)
 	  {
-	    buffer[1] = 4;	/* branch over jmpi, pad, and ptr */
-	    buffer[3] = 1;	/* jmpi offset of 1 gets the pointer */
+	      {
+		buffer[1] = 4;	/* branch over jmpi, pad, and ptr */
+		buffer[3] = 1;	/* jmpi offset of 1 gets the pointer */
+	      }
+	    
 	    buffer[4] = 0;	/* alignment/pad */
 	    buffer[5] = 0;
 	    buffer[6] = 0;	/* space for 32 bit address */
@@ -1740,8 +1793,11 @@
 	       shrinking the fragment. '3' is the amount of code that
 	       we inserted here, but '4' is right for the space we reserved
 	       for this fragment. */
-	    buffer[1] = 3;	/* branch over jmpi, and ptr */
-	    buffer[3] = 0;	/* jmpi offset of 0 gets the pointer */
+	      {
+		buffer[1] = 3;	/* branch over jmpi, and ptr */
+		buffer[3] = 0;	/* jmpi offset of 0 gets the pointer */
+	      }
+	    
 	    buffer[4] = 0;	/* space for 32 bit address */
 	    buffer[5] = 0;
 	    buffer[6] = 0;
@@ -1752,12 +1808,12 @@
 		     fragP->fr_symbol, fragP->fr_offset, 0, BFD_RELOC_32);
 	    fragP->fr_fix += C32_LEN;
 
-	    /* frag is actually shorter (see the other side of this ifdef)
-	       but gas isn't prepared for that. We have to re-adjust
+	    /* Frag is actually shorter (see the other side of this ifdef)
+	       but gas isn't prepared for that.  We have to re-adjust
 	       the branch displacement so that it goes beyond the 
 	       full length of the fragment, not just what we actually
 	       filled in.  */
-	    buffer[1] = 4;	/* jmpi, ptr, and the 'tail pad' */
+	      buffer[1] = 4;	/* jmpi, ptr, and the 'tail pad' */
 	  }
 	
 	fragP->fr_var = 0;
@@ -1782,7 +1838,7 @@
 
 	if (needpad)
 	  {
-	    buffer[1] = 1;	/* jmpi offset of 1 since padded */
+	      buffer[1] = 1;	/* jmpi offset of 1 since padded */
 	    buffer[2] = 0;	/* alignment */
 	    buffer[3] = 0;
 	    buffer[4] = 0;	/* space for 32 bit address */
@@ -1798,7 +1854,7 @@
 	  }
 	else
 	  {
-	    buffer[1] = 0;	/* jmpi offset of 0 if no pad */
+	      buffer[1] = 0;	/* jmpi offset of 0 if no pad */
 	    buffer[2] = 0;	/* space for 32 bit address */
 	    buffer[3] = 0;
 	    buffer[4] = 0;
@@ -1865,9 +1921,9 @@
 	as_bad_where (file, fixP->fx_line,
 		      _("pcrel for branch to %s too far (0x%x)"),
 		      symname, val);
-      buf[0] |= ((val >> 8) & 0x7);
-      buf[1] |= (val & 0xff);
-        break;
+        buf[0] |= ((val >> 8) & 0x7);
+        buf[1] |= (val & 0xff);
+      break;
 
     case BFD_RELOC_MCORE_PCREL_IMM8BY4:	/* lower 8 bits of 2 byte opcode */
       val += 3;
@@ -1878,14 +1934,14 @@
 		      symname, val);
       else
 	buf[1] |= (val & 0xff);
-        break;
+      break;
 
     case BFD_RELOC_MCORE_PCREL_IMM4BY2:	/* loopt instruction */
       if ((val < -32) || (val > -2))
 	as_bad_where (file, fixP->fx_line,
 		      _("pcrel for loopt too far (0x%x)"), val);
       val /= 2;
-      buf[1] |= (val & 0xf);
+        buf[1] |= (val & 0xf);
       break;
 
     case BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2:
@@ -1898,8 +1954,8 @@
 	  nval |= MCORE_INST_BSR;
 	  
 	  /* REPLACE the instruction, don't just modify it.  */
-	  buf[0] = ((nval >> 8) & 0xff);
-	  buf[1] = (nval & 0xff);
+	  buf[0] = INST_BYTE0 (nval);
+	  buf[1] = INST_BYTE1 (nval);
 	}
       else
 	fixP->fx_done = 0;
@@ -1923,21 +1979,14 @@
 #endif
 	{
 	  if (fixP->fx_size == 4)
-	    {
-	      *buf++ = val >> 24;
-	      *buf++ = val >> 16;
-	      *buf++ = val >> 8;
-	      *buf = val;
-	    }
+	    ;
 	  else if (fixP->fx_size == 2 && val >= -32768 && val <= 32767)
-	    {
-	      *buf++ = val >> 8;
-	      *buf = val;
-	    }
+	    ;
 	  else if (fixP->fx_size == 1 && val >= -256 && val <= 255)
-	    *buf = val;
+	    ;
 	  else
 	    abort ();
+	  md_number_to_chars (buf, val, fixP->fx_size);
 	}
       break;
     }
@@ -2022,21 +2071,20 @@
 }
 
 /* Put number into target byte order */
-
 void
 md_number_to_chars (ptr, use, nbytes)
      char * ptr;
      valueT use;
      int nbytes;
 {
-  switch (nbytes)
-    {
-    case 4: *ptr++ = (use >> 24) & 0xff; /* fall through */
-    case 3: *ptr++ = (use >> 16) & 0xff; /* fall through */
-    case 2: *ptr++ = (use >>  8) & 0xff; /* fall through */
-    case 1: *ptr++ = (use >>  0) & 0xff;    break;
-    default: abort ();
-    }
+    switch (nbytes)
+      {
+      case 4: *ptr++ = (use >> 24) & 0xff; /* fall through */
+      case 3: *ptr++ = (use >> 16) & 0xff; /* fall through */
+      case 2: *ptr++ = (use >>  8) & 0xff; /* fall through */
+      case 1: *ptr++ = (use >>  0) & 0xff;    break;
+      default: abort ();
+      }
 }
 
 /* Round up a section size to the appropriate boundary.  */
@@ -2117,7 +2165,8 @@
   }
 
   rel = (arelent *) xmalloc (sizeof (arelent));
-  rel->sym_ptr_ptr = & fixp->fx_addsy->bsym;
+  rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
   /* Always pass the addend along!  */
   rel->addend = fixp->fx_addnumber;
@@ -2169,15 +2218,4 @@
 
   return 1;
 }
-
-/* Handle the .section pseudo-op.  This is like the usual one, but it
-   dumps the literal pool before changing the section.  */
-static void
-mcore_s_section (ignore)
-     int ignore;
-{
-  dump_literals (0);
-
-  obj_elf_section (ignore);
-}
 #endif /* OBJ_ELF */
diff --git a/gas/config/tc-mcore.h b/gas/config/tc-mcore.h
index 9e487c9..e713c27 100644
--- a/gas/config/tc-mcore.h
+++ b/gas/config/tc-mcore.h
@@ -65,7 +65,12 @@
 
 #define TARGET_FORMAT	(target_big_endian ? "pe-mcore-big" : "pe-mcore-little")
 
-#define TARGET_SYMBOL_FIELDS  int sy_flags ;
+struct mcore_tc_sy
+{
+  int sy_flags;
+};
+
+#define TC_SYMFIELD_TYPE struct mcore_tc_sy
 
 #endif /* OBJ_COFF */
 
@@ -93,7 +98,6 @@
 # error No target format specified.
 #endif
 
-#include "struc-symbol.h" /* For definition of symbolS */
 #include "write.h"        /* For definition of fixS */
   
 extern void      md_begin            PARAMS ((void));
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 3d865fd..c9b0632 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -1,5 +1,5 @@
 /* tc-mips.c -- assemble code for a MIPS chip.
-   Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Contributed by the OSF and Ralph Campbell.
    Written by Keith Knowles and Ralph Campbell, working independently.
    Modified for ECOFF and R4000 support by Ian Lance Taylor of Cygnus
@@ -54,7 +54,6 @@
 #undef S_GET_SIZE
 #undef S_SET_ALIGN
 #undef S_SET_SIZE
-#undef TARGET_SYMBOL_FIELDS
 #undef obj_frob_file
 #undef obj_frob_file_after_relocs
 #undef obj_frob_symbol
@@ -1373,8 +1372,8 @@
 	  if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
 	    S_SET_OTHER (l->label, STO_MIPS16);
 #endif
-	  if ((l->label->sy_value.X_add_number & 1) == 0)
-	    ++l->label->sy_value.X_add_number;
+	  if ((S_GET_VALUE (l->label) & 1) == 0)
+	    S_SET_VALUE (l->label, S_GET_VALUE (l->label) + 1);
 	}
     }
 }
@@ -1656,11 +1655,11 @@
 	  for (l = insn_labels; l != NULL; l = l->next)
 	    {
 	      assert (S_GET_SEGMENT (l->label) == now_seg);
-	      l->label->sy_frag = frag_now;
+	      symbol_set_frag (l->label, frag_now);
 	      S_SET_VALUE (l->label, (valueT) frag_now_fix ());
 	      /* mips16 text labels are stored as odd.  */
 	      if (mips_opts.mips16)
-		++l->label->sy_value.X_add_number;
+		S_SET_VALUE (l->label, S_GET_VALUE (l->label) + 1);
 	    }
 
 #ifndef NO_ECOFF_DEBUGGING
@@ -2360,11 +2359,11 @@
 	  for (l = insn_labels; l != NULL; l = l->next)
 	    {
 	      assert (S_GET_SEGMENT (l->label) == now_seg);
-	      l->label->sy_frag = frag_now;
+	      symbol_set_frag (l->label, frag_now);
 	      S_SET_VALUE (l->label, (valueT) frag_now_fix ());
 	      /* mips16 text labels are stored as odd.  */
 	      if (mips_opts.mips16)
-		++l->label->sy_value.X_add_number;
+		S_SET_VALUE (l->label, S_GET_VALUE (l->label) + 1);
 	    }
 	}
     }
@@ -4103,11 +4102,12 @@
       if (mips_pic == EMBEDDED_PIC
 	  && offset_expr.X_op == O_subtract
 	  && now_seg == text_section
-	  && (offset_expr.X_op_symbol->sy_value.X_op == O_constant
+	  && (symbol_constant_p (offset_expr.X_op_symbol)
 	      ? S_GET_SEGMENT (offset_expr.X_op_symbol) == text_section
-	      : (offset_expr.X_op_symbol->sy_value.X_op == O_symbol
-		 && (S_GET_SEGMENT (offset_expr.X_op_symbol
-				    ->sy_value.X_add_symbol)
+	      : (symbol_equated_p (offset_expr.X_op_symbol)
+		 && (S_GET_SEGMENT
+		     (symbol_get_value_expression (offset_expr.X_op_symbol)
+		      ->X_add_symbol)
 		     == text_section)))
 	  && breg == 0
 	  && offset_expr.X_add_number == 0)
@@ -6956,13 +6956,13 @@
   /* If the instruction contains a '.', we first try to match an instruction
      including the '.'.  Then we try again without the '.'.  */
   insn = NULL;
-  for (s = str; *s != '\0' && !isspace(*s); ++s)
+  for (s = str; *s != '\0' && !isspace ((unsigned char) *s); ++s)
     continue;
 
   /* If we stopped on whitespace, then replace the whitespace with null for
      the call to hash_find.  Save the character we replaced just in case we
      have to re-parse the instruction.  */
-  if (isspace (*s))
+  if (isspace ((unsigned char) *s))
     {
       save_c = *s;
       *s++ = '\0';
@@ -6980,7 +6980,7 @@
 	*(--s) = save_c;
 
       /* Scan up to the first '.' or whitespace.  */
-      for (s = str; *s != '\0' && *s != '.' && !isspace (*s); ++s)
+      for (s = str; *s != '\0' && *s != '.' && !isspace ((unsigned char) *s); ++s)
 	continue;
 
       /* If we did not find a '.', then we can quit now.  */
@@ -7246,7 +7246,7 @@
 	      if (s[0] == '$')
 		{
 
-		  if (isdigit (s[1]))
+		  if (isdigit ((unsigned char) s[1]))
 		    {
 		      ++s;
 		      regno = 0;
@@ -7256,7 +7256,7 @@
 			  regno += *s - '0';
 			  ++s;
 			}
-		      while (isdigit (*s));
+		      while (isdigit ((unsigned char) *s));
 		      if (regno > 31)
 			as_bad (_("Invalid register number (%d)"), regno);
 		    }
@@ -7297,23 +7297,22 @@
 		      else if (itbl_have_entries)
 			{
 			  char *p, *n;
-			  int r;
+			  unsigned long r;
 
-			  p = s+1; 	/* advance past '$' */
+			  p = s + 1; 	/* advance past '$' */
 			  n = itbl_get_field (&p);  /* n is name */
 
-			  /* See if this is a register defined in an 
-			     itbl entry */
-			  r = itbl_get_reg_val (n);
-			  if (r)
+			  /* See if this is a register defined in an
+			     itbl entry.  */
+			  if (itbl_get_reg_val (n, &r))
 			    {
 			      /* Get_field advances to the start of
 				 the next field, so we need to back
-				 rack to the end of the last field. */
+				 rack to the end of the last field.  */
 			      if (p) 
 				s = p - 1;
 			      else 
-				s = strchr (s,'\0');
+				s = strchr (s, '\0');
 			      regno = r;
 			    }
 			  else
@@ -7406,7 +7405,7 @@
 	    case 'V':
 	    case 'W':
 	      s_reset = s;
-	      if (s[0] == '$' && s[1] == 'f' && isdigit (s[2]))
+	      if (s[0] == '$' && s[1] == 'f' && isdigit ((unsigned char) s[2]))
 		{
 		  s += 2;
 		  regno = 0;
@@ -7416,7 +7415,7 @@
 		      regno += *s - '0';
 		      ++s;
 		    }
-		  while (isdigit (*s));
+		  while (isdigit ((unsigned char) *s));
 
 		  if (regno > 31)
 		    as_bad (_("Invalid float register number (%d)"), regno);
@@ -7848,7 +7847,7 @@
 		  regno += *s - '0';
 		  ++s;
 		}
-	      while (isdigit (*s));
+	      while (isdigit ((unsigned char) *s));
 	      if (regno > 7)
 		as_bad (_("invalid condition code register $fcc%d"), regno);
 	      if (*args == 'N')
@@ -7901,7 +7900,7 @@
   mips16_small = false;
   mips16_ext = false;
 
-  for (s = str; islower (*s); ++s)
+  for (s = str; islower ((unsigned char) *s); ++s)
     ;
   switch (*s)
     {
@@ -8034,7 +8033,7 @@
 	      if (s[0] != '$')
 		break;
 	      s_reset = s;
-	      if (isdigit (s[1]))
+	      if (isdigit ((unsigned char) s[1]))
 		{
 		  ++s;
 		  regno = 0;
@@ -8044,7 +8043,7 @@
 		      regno += *s - '0';
 		      ++s;
 		    }
-		  while (isdigit (*s));
+		  while (isdigit ((unsigned char) *s));
 		  if (regno > 31)
 		    {
 		      as_bad (_("invalid register number (%d)"), regno);
@@ -8315,7 +8314,7 @@
 			++s;
 		      }
 		    reg1 = 0;
-		    while (isdigit (*s))
+		    while (isdigit ((unsigned char) *s))
 		      {
 			reg1 *= 10;
 			reg1 += *s - '0';
@@ -8342,7 +8341,7 @@
 			      }
 			  }
 			reg2 = 0;
-			while (isdigit (*s))
+			while (isdigit ((unsigned char) *s))
 			  {
 			    reg2 *= 10;
 			    reg2 += *s - '0';
@@ -8626,9 +8625,9 @@
 	;
       if (sp - 4 >= str && sp[-1] == RP)
 	{
-	  if (isdigit (sp[-2]))
+	  if (isdigit ((unsigned char) sp[-2]))
 	    {
-	      for (sp -= 3; sp >= str && isdigit (*sp); sp--)
+	      for (sp -= 3; sp >= str && isdigit ((unsigned char) *sp); sp--)
 		;
 	      if (*sp == '$' && sp > str && sp[-1] == LP)
 		{
@@ -8699,10 +8698,10 @@
       && ep->X_op == O_symbol
       && strcmp (S_GET_NAME (ep->X_add_symbol), FAKE_LABEL_NAME) == 0
       && S_GET_SEGMENT (ep->X_add_symbol) == now_seg
-      && ep->X_add_symbol->sy_frag == frag_now
-      && ep->X_add_symbol->sy_value.X_op == O_constant
-      && ep->X_add_symbol->sy_value.X_add_number == frag_now_fix ())
-    ++ep->X_add_symbol->sy_value.X_add_number;
+      && symbol_get_frag (ep->X_add_symbol) == frag_now
+      && symbol_constant_p (ep->X_add_symbol)
+      && S_GET_VALUE (ep->X_add_symbol) == frag_now_fix ())
+    S_SET_VALUE (ep->X_add_symbol, S_GET_VALUE (ep->X_add_symbol) + 1);
 }
 
 /* Turn a string in input_line_pointer into a floating point constant
@@ -9472,13 +9471,13 @@
   if (fixP->fx_addsy != NULL && OUTPUT_FLAVOR == bfd_target_elf_flavour)
     if (S_GET_OTHER (fixP->fx_addsy) == STO_MIPS16 
         || S_IS_WEAK (fixP->fx_addsy)
-        || (fixP->fx_addsy->sy_used_in_reloc
-            && (bfd_get_section_flags (stdoutput,
-                                       S_GET_SEGMENT (fixP->fx_addsy))
-                & SEC_LINK_ONCE != 0)
-               || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
-                            ".gnu.linkonce",
-                            sizeof (".gnu.linkonce") - 1)))
+        || (symbol_used_in_reloc_p (fixP->fx_addsy)
+            && (((bfd_get_section_flags (stdoutput,
+					 S_GET_SEGMENT (fixP->fx_addsy))
+		  & SEC_LINK_ONCE) != 0)
+		|| !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
+			     ".gnu.linkonce",
+			     sizeof (".gnu.linkonce") - 1))))
 
       {
         value -= S_GET_VALUE (fixP->fx_addsy);
@@ -9529,7 +9528,7 @@
     case BFD_RELOC_PCREL_HI16_S:
       /* The addend for this is tricky if it is internal, so we just
 	 do everything here rather than in bfd_install_relocation.  */
-      if ((fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) == 0)
+      if ((symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_SECTION_SYM) == 0)
 	{
 	  /* For an external symbol adjust by the address to make it
 	     pcrel_offset.  We use the address of the RELLO reloc
@@ -9549,7 +9548,7 @@
     case BFD_RELOC_PCREL_LO16:
       /* The addend for this is tricky if it is internal, so we just
 	 do everything here rather than in bfd_install_relocation.  */
-      if ((fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) == 0)
+      if ((symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_SECTION_SYM) == 0)
 	value += fixP->fx_frag->fr_address + fixP->fx_where;
       buf = (unsigned char *) fixP->fx_frag->fr_literal + fixP->fx_where;
       if (target_big_endian)
@@ -9818,7 +9817,7 @@
   if (label != NULL)
     {
       assert (S_GET_SEGMENT (label) == now_seg);
-      label->sy_frag = frag_now;
+      symbol_set_frag (label, frag_now);
       S_SET_VALUE (label, (valueT) frag_now_fix ());
     }
 }
@@ -10002,10 +10001,12 @@
   mips_emit_delays (false);
 
   if (auto_align)
-    if (type == 'd')
-      mips_align (3, 0, label);
-    else
-      mips_align (2, 0, label);
+    {
+      if (type == 'd')
+	mips_align (3, 0, label);
+      else
+	mips_align (2, 0, label);
+    }
 
   mips_clear_insn_labels ();
 
@@ -10053,7 +10054,7 @@
 	flag = BSF_FUNCTION;
     }
 
-  symbolP->bsym->flags |= flag;
+  symbol_get_bfdsym (symbolP)->flags |= flag;
 
   S_SET_EXTERNAL (symbolP);
   demand_empty_rest_of_line ();
@@ -10297,7 +10298,7 @@
   ex.X_add_number = 0;
 
   /* In ELF, this symbol is implicitly an STT_OBJECT symbol.  */
-  ex.X_add_symbol->bsym->flags |= BSF_OBJECT;
+  symbol_get_bfdsym (ex.X_add_symbol)->flags |= BSF_OBJECT;
 
   macro_build_lui ((char *) NULL, &icnt, &ex, GP);
   macro_build ((char *) NULL, &icnt, &ex, "addiu", "t,r,j", GP, GP,
@@ -10489,7 +10490,7 @@
 	  ignore_rest_of_line();
 	  return;
 	}
-      symbolP->sy_value = exp;
+      symbol_set_value_expression (symbolP, &exp);
     }
 
   demand_empty_rest_of_line ();
@@ -10601,15 +10602,16 @@
       else if ((! S_IS_DEFINED (sym) || S_IS_COMMON (sym))
 	       && (0
 #ifndef NO_ECOFF_DEBUGGING
-		   || (sym->ecoff_extern_size != 0
-		       && sym->ecoff_extern_size <= g_switch_value)
+		   || (symbol_get_obj (sym)->ecoff_extern_size != 0
+		       && (symbol_get_obj (sym)->ecoff_extern_size
+			   <= g_switch_value))
 #endif
 		   /* We must defer this decision until after the whole
 		      file has been read, since there might be a .extern
 		      after the first use of this symbol.  */
 		   || (before_relaxing
 #ifndef NO_ECOFF_DEBUGGING
-		       && sym->ecoff_extern_size == 0
+		       && symbol_get_obj (sym)->ecoff_extern_size == 0
 #endif
 		       && S_GET_VALUE (sym) == 0)
 		   || (S_GET_VALUE (sym) != 0
@@ -10679,23 +10681,26 @@
       maxtiny = (1 << (op->nbits - 1)) - 1;
     }
 
-  /* We can't call S_GET_VALUE here, because we don't want to lock in
-     a particular frag address.  */
-  if (fragp->fr_symbol->sy_value.X_op == O_constant)
+  /* We can't always call S_GET_VALUE here, because we don't want to
+     lock in a particular frag address.  */
+  if (symbol_constant_p (fragp->fr_symbol))
     {
-      val = (fragp->fr_symbol->sy_value.X_add_number
-	     + fragp->fr_symbol->sy_frag->fr_address);
+      val = (S_GET_VALUE (fragp->fr_symbol)
+	     + symbol_get_frag (fragp->fr_symbol)->fr_address);
       symsec = S_GET_SEGMENT (fragp->fr_symbol);
     }
-  else if (fragp->fr_symbol->sy_value.X_op == O_symbol
-	   && (fragp->fr_symbol->sy_value.X_add_symbol->sy_value.X_op
-	       == O_constant))
+  else if (symbol_equated_p (fragp->fr_symbol)
+	   && (symbol_constant_p
+	       (symbol_get_value_expression (fragp->fr_symbol)->X_add_symbol)))
     {
-      val = (fragp->fr_symbol->sy_value.X_add_symbol->sy_value.X_add_number
-	     + fragp->fr_symbol->sy_value.X_add_symbol->sy_frag->fr_address
-	     + fragp->fr_symbol->sy_value.X_add_number
-	     + fragp->fr_symbol->sy_frag->fr_address);
-      symsec = S_GET_SEGMENT (fragp->fr_symbol->sy_value.X_add_symbol);
+      symbolS *eqsym;
+
+      eqsym = symbol_get_value_expression (fragp->fr_symbol)->X_add_symbol;
+      val = (S_GET_VALUE (eqsym)
+	     + symbol_get_frag (eqsym)->fr_address
+	     + symbol_get_value_expression (fragp->fr_symbol)->X_add_number
+	     + symbol_get_frag (fragp->fr_symbol)->fr_address);
+      symsec = S_GET_SEGMENT (eqsym);
     }
   else
     return 1;
@@ -10737,7 +10742,8 @@
 	 in STRETCH in order to get a better estimate of the address.
 	 This particularly matters because of the shift bits.  */
       if (stretch != 0
-	  && fragp->fr_symbol->sy_frag->fr_address >= fragp->fr_address)
+	  && (symbol_get_frag (fragp->fr_symbol)->fr_address
+	      >= fragp->fr_address))
 	{
 	  fragS *f;
 
@@ -10748,7 +10754,7 @@
              a maximum number of bytes to skip when doing an
              alignment.  */
 	  for (f = fragp;
-	       f != NULL && f != fragp->fr_symbol->sy_frag;
+	       f != NULL && f != symbol_get_frag (fragp->fr_symbol);
 	       f = f->fr_next)
 	    {
 	      if (f->fr_type == rs_align || f->fr_type == rs_align_code)
@@ -10882,14 +10888,14 @@
       sym = fragp->fr_symbol;
 
       /* Handle the case of a symbol equated to another symbol.  */
-      while (sym->sy_value.X_op == O_symbol
+      while (symbol_equated_p (sym)
 	     && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym)))
 	{
 	  symbolS *n;
 
 	  /* It's possible to get a loop here in a badly written
              program.  */
-	  n = sym->sy_value.X_add_symbol;
+	  n = symbol_get_value_expression (sym)->X_add_symbol;
 	  if (n == sym)
 	    break;
 	  sym = n;
@@ -10967,7 +10973,8 @@
   reloc = retval[0] = (arelent *) xmalloc (sizeof (arelent));
   retval[1] = NULL;
 
-  reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
 
   if (mips_pic == EMBEDDED_PIC
@@ -10984,7 +10991,7 @@
   else if (fixp->fx_r_type == BFD_RELOC_PCREL_LO16)
     {
       /* We use a special addend for an internal RELLO reloc.  */
-      if (fixp->fx_addsy->bsym->flags & BSF_SECTION_SYM)
+      if (symbol_section_p (fixp->fx_addsy))
 	reloc->addend = reloc->address - S_GET_VALUE (fixp->fx_subsy);
       else
 	reloc->addend = fixp->fx_addnumber + reloc->address;
@@ -10996,7 +11003,7 @@
       /* We use a special addend for an internal RELHI reloc.  The
 	 reloc is relative to the RELLO; adjust the addend
 	 accordingly.  */
-      if (fixp->fx_addsy->bsym->flags & BSF_SECTION_SYM)
+      if (symbol_section_p (fixp->fx_addsy))
 	reloc->addend = (fixp->fx_next->fx_frag->fr_address
 			 + fixp->fx_next->fx_where
 			 - S_GET_VALUE (fixp->fx_subsy));
@@ -11055,7 +11062,8 @@
       reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
       reloc2 = retval[1] = (arelent *) xmalloc (sizeof (arelent));
       retval[2] = NULL;
-      reloc2->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+      reloc2->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+      *reloc2->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
       reloc2->address = (reloc->address
 			 + (RELAX_RELOC2 (fixp->fx_frag->fr_subtype)
 			    - RELAX_RELOC1 (fixp->fx_frag->fr_subtype)));
@@ -11433,7 +11441,7 @@
 
 typedef struct proc
   {
-    struct symbol *isym;
+    symbolS *isym;
     unsigned long reg_mask;
     unsigned long reg_offset;
     unsigned long fpreg_mask;
@@ -11472,14 +11480,14 @@
       ++input_line_pointer;
       negative = 1;
     }
-  if (!isdigit (*input_line_pointer))
+  if (!isdigit ((unsigned char) *input_line_pointer))
     as_bad (_("Expected simple number."));
   if (input_line_pointer[0] == '0')
     {
       if (input_line_pointer[1] == 'x')
 	{
 	  input_line_pointer += 2;
-	  while (isxdigit (*input_line_pointer))
+	  while (isxdigit ((unsigned char) *input_line_pointer))
 	    {
 	      val <<= 4;
 	      val |= hex_value (*input_line_pointer++);
@@ -11489,7 +11497,7 @@
       else
 	{
 	  ++input_line_pointer;
-	  while (isdigit (*input_line_pointer))
+	  while (isdigit ((unsigned char) *input_line_pointer))
 	    {
 	      val <<= 3;
 	      val |= *input_line_pointer++ - '0';
@@ -11497,14 +11505,14 @@
 	  return negative ? -val : val;
 	}
     }
-  if (!isdigit (*input_line_pointer))
+  if (!isdigit ((unsigned char) *input_line_pointer))
     {
       printf (_(" *input_line_pointer == '%c' 0x%02x\n"),
 	      *input_line_pointer, *input_line_pointer);
       as_warn (_("Invalid number"));
       return -1;
     }
-  while (isdigit (*input_line_pointer))
+  while (isdigit ((unsigned char) *input_line_pointer))
     {
       val *= 10;
       val += *input_line_pointer++ - '0';
@@ -11630,7 +11638,8 @@
   if (*input_line_pointer == ',')
     input_line_pointer++;
   SKIP_WHITESPACE ();
-  if (isdigit (*input_line_pointer) || *input_line_pointer == '-')
+  if (isdigit ((unsigned char) *input_line_pointer)
+      || *input_line_pointer == '-')
     number = get_number ();
 
 #ifdef BFD_ASSEMBLER
@@ -11658,7 +11667,7 @@
 
       cur_proc_ptr->isym = symbolP;
 
-      symbolP->bsym->flags |= BSF_FUNCTION;
+      symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION;
 
       numprocs++;
     }
diff --git a/gas/config/tc-mips.h b/gas/config/tc-mips.h
index 868aede..ccfd998 100644
--- a/gas/config/tc-mips.h
+++ b/gas/config/tc-mips.h
@@ -1,5 +1,5 @@
 /* tc-mips.h -- header file for tc-mips.c.
-   Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc.
    Contributed by the OSF and Ralph Campbell.
    Written by Keith Knowles and Ralph Campbell, working independently.
    Modified for ECOFF support by Ian Lance Taylor of Cygnus Support.
@@ -85,7 +85,7 @@
 extern int mips_parse_long_option PARAMS ((const char *));
 
 #define tc_frob_label(sym) mips_define_label (sym)
-extern void mips_define_label PARAMS ((struct symbol *));
+extern void mips_define_label PARAMS ((symbolS *));
 
 #define tc_frob_file_before_adjust() mips_frob_file_before_adjust ()
 extern void mips_frob_file_before_adjust PARAMS ((void));
diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c
index 2380915..264f7bf 100644
--- a/gas/config/tc-mn10200.c
+++ b/gas/config/tc-mn10200.c
@@ -1,6 +1,5 @@
 /* tc-mn10200.c -- Assembler code for the Matsushita 10200
-
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -1252,7 +1251,8 @@
     }
   else 
     {
-      reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+      reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+      *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
       reloc->addend = fixp->fx_offset;
     }
   return reloc;
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index 3f9e9ce..4f146d1 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -1,6 +1,5 @@
 /* tc-mn10300.c -- Assembler code for the Matsushita 10300
-
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -1445,7 +1444,8 @@
     }
   else 
     {
-      reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+      reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof( asymbol *));
+      *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
       reloc->addend = fixp->fx_offset;
     }
   return reloc;
diff --git a/gas/config/tc-ns32k.c b/gas/config/tc-ns32k.c
index 42dc528..59f1467 100644
--- a/gas/config/tc-ns32k.c
+++ b/gas/config/tc-ns32k.c
@@ -1,5 +1,6 @@
 /* ns32k.c  -- Assemble on the National Semiconductor 32k series
-   Copyright (C) 1987, 92, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -1970,7 +1971,7 @@
   /* The displacement of the address, from current location.  */
   disp = (S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset) - object_address;
 #ifdef BFD_ASSEMBLER
-  disp += fragP->fr_symbol->sy_frag->fr_address;
+  disp += symbol_get_frag (fragP->fr_symbol)->fr_address;
 #endif
   disp += md_pcrel_adjust(fragP);
 
@@ -2264,7 +2265,8 @@
   code = reloc(fixp->fx_size, fixp->fx_pcrel, fix_im_disp(fixp));
 
   rel = (arelent *) xmalloc (sizeof (arelent));
-  rel->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
   if (fixp->fx_pcrel)
     rel->addend = fixp->fx_addnumber;
diff --git a/gas/config/tc-ns32k.h b/gas/config/tc-ns32k.h
index 4b038eb..69c86ec 100644
--- a/gas/config/tc-ns32k.h
+++ b/gas/config/tc-ns32k.h
@@ -1,5 +1,5 @@
 /* tc-ns32k.h -- Opcode table for National Semi 32k processor
-   Copyright (C) 1987, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1987, 92, 93, 94, 95, 97, 1999 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -76,7 +76,7 @@
 extern void fix_new_ns32k PARAMS ((fragS *frag,
 				   int where,
 				   int size,
-				   struct symbol *add_symbol,
+				   symbolS *add_symbol,
 				   long offset,
 				   int pcrel,
 				   int im_disp,
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 8c31ba6..56c2a48 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -1,5 +1,5 @@
 /* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000)
-   Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
    This file is part of GAS, the GNU Assembler.
@@ -766,6 +766,11 @@
 	  ppc_cpu = PPC_OPCODE_PPC;
 	  ppc_size = PPC_OPCODE_64;
 	}
+      else if (strcmp (arg, "ppc64bridge") == 0)
+	{
+	  ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64_BRIDGE;
+	  ppc_size = PPC_OPCODE_64;
+	}
       /* -mcom means assemble for the common intersection between Power
 	 and PowerPC.  At present, we just allow the union, rather
 	 than the intersection.  */
@@ -872,6 +877,7 @@
 -mppc, -mppc32, -m403, -m603, -m604\n\
 			generate code for Motorola PowerPC 603/604\n\
 -mppc64, -m620		generate code for Motorola PowerPC 620\n\
+-mppc64bridge		generate code for PowerPC 64, including bridge insns\n\
 -mcom			generate code Power/PowerPC common instructions\n\
 -many			generate code for any architecture (PWR/PWRX/PPC)\n\
 -mregnames		Allow symbolic names for registers\n\
@@ -972,7 +978,8 @@
 
       if ((op->flags & ppc_cpu) != 0
 	  && ((op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == 0
-	      || (op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == ppc_size))
+	      || (op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == ppc_size
+	      || (ppc_cpu & PPC_OPCODE_64_BRIDGE) != 0))
 	{
 	  const char *retval;
 
@@ -1026,9 +1033,9 @@
      text csects to precede the data csects.  These symbols will not
      be output.  */
   ppc_text_csects = symbol_make ("dummy\001");
-  ppc_text_csects->sy_tc.within = ppc_text_csects;
+  symbol_get_tc (ppc_text_csects)->within = ppc_text_csects;
   ppc_data_csects = symbol_make ("dummy\001");
-  ppc_data_csects->sy_tc.within = ppc_data_csects;
+  symbol_get_tc (ppc_data_csects)->within = ppc_data_csects;
 #endif
 
 #ifdef TE_PE
@@ -1056,8 +1063,7 @@
 
       if ((operand->flags & PPC_OPERAND_SIGNED) != 0)
 	{
-	  if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0
-	      && ppc_size == PPC_OPCODE_32)
+	  if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0)
 	    max = (1 << operand->bits) - 1;
 	  else
 	    max = (1 << (operand->bits - 1)) - 1;
@@ -1399,8 +1405,8 @@
   if (align2)
     frag_align (align2, 0, 0);
   if (S_GET_SEGMENT (symbolP) == bss_section)
-    symbolP->sy_frag->fr_symbol = 0;
-  symbolP->sy_frag = frag_now;
+    symbol_get_frag (symbolP)->fr_symbol = 0;
+  symbol_set_frag (symbolP, frag_now);
   pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, size,
 		    (char *) 0);
   *pfrag = 0;
@@ -1777,7 +1783,8 @@
 	      if (ex.X_op == O_symbol) 
 		{		  
 		  assert (ex.X_add_symbol != NULL);
-		  if (ex.X_add_symbol->bsym->section != tocdata_section)
+		  if (symbol_get_bfdsym (ex.X_add_symbol)->section
+		      != tocdata_section)
 		    {
 		      as_bad(_("[tocv] symbol is not a toc symbol"));
 		    }
@@ -2120,29 +2127,25 @@
 }
 
 int
-ppc_section_word (ptr_str)
-     char **ptr_str;
+ppc_section_word (str, len)
+     char *str;
+     size_t len;
 {
-  if (strncmp (*ptr_str, "exclude", sizeof ("exclude")-1) == 0)
-    {
-      *ptr_str += sizeof ("exclude")-1;
-      return SHF_EXCLUDE;
-    }
+  if (len == 7 && strncmp (str, "exclude", 7) == 0)
+    return SHF_EXCLUDE;
 
-  return 0;
+  return -1;
 }
 
 int
-ppc_section_type (ptr_str)
-     char **ptr_str;
+ppc_section_type (str, len)
+     char *str;
+     size_t len;
 {
-  if (strncmp (*ptr_str, "ordered", sizeof ("ordered")-1) == 0)
-    {
-      *ptr_str += sizeof ("ordered")-1;
-      return SHT_ORDERED;
-    }
+  if (len == 7 && strncmp (str, "ordered", 7) == 0)
+    return SHT_ORDERED;
 
-  return 0;
+  return -1;
 }
 
 int
@@ -2325,7 +2328,7 @@
 	}
       else
 	{
-	  lcomm_sym->sy_tc.output = 1;
+	  symbol_get_tc (lcomm_sym)->output = 1;
 	  def_sym = lcomm_sym;
 	  def_size = 0;
 	}
@@ -2333,30 +2336,30 @@
       subseg_set (bss_section, 1);
       frag_align (align, 0, 0);
   
-      def_sym->sy_frag = frag_now;
+      symbol_set_frag (def_sym, frag_now);
       pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, def_sym,
 			def_size, (char *) NULL);
       *pfrag = 0;
       S_SET_SEGMENT (def_sym, bss_section);
-      def_sym->sy_tc.align = align;
+      symbol_get_tc (def_sym)->align = align;
     }
   else if (lcomm)
     {
       /* Align the size of lcomm_sym.  */
-      lcomm_sym->sy_frag->fr_offset =
-	((lcomm_sym->sy_frag->fr_offset + (1 << align) - 1)
+      symbol_get_frag (lcomm_sym)->fr_offset =
+	((symbol_get_frag (lcomm_sym)->fr_offset + (1 << align) - 1)
 	 &~ ((1 << align) - 1));
-      if (align > lcomm_sym->sy_tc.align)
-	lcomm_sym->sy_tc.align = align;
+      if (align > symbol_get_tc (lcomm_sym)->align)
+	symbol_get_tc (lcomm_sym)->align = align;
     }
 
   if (lcomm)
     {
       /* Make sym an offset from lcomm_sym.  */
       S_SET_SEGMENT (sym, bss_section);
-      sym->sy_frag = lcomm_sym->sy_frag;
-      S_SET_VALUE (sym, lcomm_sym->sy_frag->fr_offset);
-      lcomm_sym->sy_frag->fr_offset += size;
+      symbol_set_frag (sym, symbol_get_frag (lcomm_sym));
+      S_SET_VALUE (sym, symbol_get_frag (lcomm_sym)->fr_offset);
+      symbol_get_frag (lcomm_sym)->fr_offset += size;
     }
 
   subseg_set (current_seg, current_subseg);
@@ -2388,7 +2391,7 @@
   if (S_GET_NAME (sym)[0] == '\0')
     {
       /* An unnamed csect is assumed to be [PR].  */
-      sym->sy_tc.class = XMC_PR;
+      symbol_get_tc (sym)->class = XMC_PR;
     }
 
   ppc_change_csect (sym);
@@ -2396,7 +2399,7 @@
   if (*input_line_pointer == ',')
     {
       ++input_line_pointer;
-      sym->sy_tc.align = get_absolute_expression ();
+      symbol_get_tc (sym)->align = get_absolute_expression ();
     }
 
   demand_empty_rest_of_line ();
@@ -2409,7 +2412,7 @@
      symbolS *sym;
 {
   if (S_IS_DEFINED (sym))
-    subseg_set (S_GET_SEGMENT (sym), sym->sy_tc.subseg);
+    subseg_set (S_GET_SEGMENT (sym), symbol_get_tc (sym)->subseg);
   else
     {
       symbolS **list_ptr;
@@ -2421,7 +2424,7 @@
 	 figure out whether it should go in the text section or the
 	 data section.  */
       after_toc = 0;
-      switch (sym->sy_tc.class)
+      switch (symbol_get_tc (sym)->class)
 	{
 	case XMC_PR:
 	case XMC_RO:
@@ -2432,7 +2435,7 @@
 	case XMC_TI:
 	case XMC_TB:
 	  S_SET_SEGMENT (sym, text_section);
-	  sym->sy_tc.subseg = ppc_text_subsegment;
+	  symbol_get_tc (sym)->subseg = ppc_text_subsegment;
 	  ++ppc_text_subsegment;
 	  list_ptr = &ppc_text_csects;
 	  break;
@@ -2444,10 +2447,11 @@
 	case XMC_BS:
 	case XMC_UC:
 	  if (ppc_toc_csect != NULL
-	      && ppc_toc_csect->sy_tc.subseg + 1 == ppc_data_subsegment)
+	      && (symbol_get_tc (ppc_toc_csect)->subseg + 1
+		  == ppc_data_subsegment))
 	    after_toc = 1;
 	  S_SET_SEGMENT (sym, data_section);
-	  sym->sy_tc.subseg = ppc_data_subsegment;
+	  symbol_get_tc (sym)->subseg = ppc_data_subsegment;
 	  ++ppc_data_subsegment;
 	  list_ptr = &ppc_data_csects;
 	  break;
@@ -2461,28 +2465,30 @@
       hold_chunksize = chunksize;
       chunksize = 64;
 
-      subseg_new (segment_name (S_GET_SEGMENT (sym)), sym->sy_tc.subseg);
+      subseg_new (segment_name (S_GET_SEGMENT (sym)),
+		  symbol_get_tc (sym)->subseg);
 
       chunksize = hold_chunksize;
 
       if (after_toc)
 	ppc_after_toc_frag = frag_now;
 
-      sym->sy_frag = frag_now;
+      symbol_set_frag (sym, frag_now);
       S_SET_VALUE (sym, (valueT) frag_now_fix ());
 
-      sym->sy_tc.align = 2;
-      sym->sy_tc.output = 1;
-      sym->sy_tc.within = sym;
+      symbol_get_tc (sym)->align = 2;
+      symbol_get_tc (sym)->output = 1;
+      symbol_get_tc (sym)->within = sym;
 	  
       for (list = *list_ptr;
-	   list->sy_tc.next != (symbolS *) NULL;
-	   list = list->sy_tc.next)
+	   symbol_get_tc (list)->next != (symbolS *) NULL;
+	   list = symbol_get_tc (list)->next)
 	;
-      list->sy_tc.next = sym;
+      symbol_get_tc (list)->next = sym;
 	  
       symbol_remove (sym, &symbol_rootP, &symbol_lastP);
-      symbol_append (sym, list->sy_tc.within, &symbol_rootP, &symbol_lastP);
+      symbol_append (sym, symbol_get_tc (list)->within, &symbol_rootP,
+		     &symbol_lastP);
     }
 
   ppc_current_csect = sym;
@@ -2586,7 +2592,7 @@
 
   *input_line_pointer = endc;
 
-  sym->sy_tc.output = 1;
+  symbol_get_tc (sym)->output = 1;
 
   demand_empty_rest_of_line ();
 }
@@ -2618,7 +2624,7 @@
     }
   ++input_line_pointer;
 
-  sym->sy_tc.real_name = demand_copy_C_string (&len);
+  symbol_get_tc (sym)->real_name = demand_copy_C_string (&len);
 
   demand_empty_rest_of_line ();
 }
@@ -2652,7 +2658,7 @@
   sym = symbol_make (name);
   ppc_stab_symbol = false;
 
-  sym->sy_tc.real_name = name;
+  symbol_get_tc (sym)->real_name = name;
 
   (void) expression (&exp);
 
@@ -2666,17 +2672,17 @@
       /* Fall through.  */
     case O_constant:
       S_SET_VALUE (sym, (valueT) exp.X_add_number);
-      sym->sy_frag = &zero_address_frag;
+      symbol_set_frag (sym, &zero_address_frag);
       break;
 
     case O_symbol:
       if (S_GET_SEGMENT (exp.X_add_symbol) == undefined_section)
-	sym->sy_value = exp;
+	symbol_set_value_expression (sym, &exp);
       else
 	{
 	  S_SET_VALUE (sym,
 		       exp.X_add_number + S_GET_VALUE (exp.X_add_symbol));
-	  sym->sy_frag = exp.X_add_symbol->sy_frag;
+	  symbol_set_frag (sym, symbol_get_frag (exp.X_add_symbol));
 	}
       break;
 
@@ -2684,12 +2690,12 @@
       /* The value is some complex expression.  This will probably
          fail at some later point, but this is probably the right
          thing to do here.  */
-      sym->sy_value = exp;
+      symbol_set_value_expression (sym, &exp);
       break;
     }
 
   S_SET_SEGMENT (sym, ppc_coff_debug_section);
-  sym->bsym->flags |= BSF_DEBUGGING;
+  symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
 
   if (*input_line_pointer != ',')
     {
@@ -2709,10 +2715,10 @@
 
   S_SET_DATA_TYPE (sym, get_absolute_expression ());
 
-  sym->sy_tc.output = 1;
+  symbol_get_tc (sym)->output = 1;
 
   if (S_GET_STORAGE_CLASS (sym) == C_STSYM)
-    sym->sy_tc.within = ppc_current_block;
+    symbol_get_tc (sym)->within = ppc_current_block;
 
   if (exp.X_op != O_symbol
       || ! S_IS_EXTERNAL (exp.X_add_symbol)
@@ -2722,8 +2728,8 @@
     {
       symbol_remove (sym, &symbol_rootP, &symbol_lastP);
       symbol_append (sym, exp.X_add_symbol, &symbol_rootP, &symbol_lastP);
-      if (ppc_current_csect->sy_tc.within == exp.X_add_symbol)
-	ppc_current_csect->sy_tc.within = sym;
+      if (symbol_get_tc (ppc_current_csect)->within == exp.X_add_symbol)
+	symbol_get_tc (ppc_current_csect)->within = sym;
     }
 
   demand_empty_rest_of_line ();
@@ -2778,15 +2784,19 @@
 
   if (ext_sym != lab_sym)
     {
-      ext_sym->sy_value.X_op = O_symbol;
-      ext_sym->sy_value.X_add_symbol = lab_sym;
-      ext_sym->sy_value.X_op_symbol = NULL;
-      ext_sym->sy_value.X_add_number = 0;
+      expressionS exp;
+
+      exp.X_op = O_symbol;
+      exp.X_add_symbol = lab_sym;
+      exp.X_op_symbol = NULL;
+      exp.X_add_number = 0;
+      exp.X_unsigned = 0;
+      symbol_set_value_expression (ext_sym, &exp);
     }
 
-  if (ext_sym->sy_tc.class == -1)
-    ext_sym->sy_tc.class = XMC_PR;
-  ext_sym->sy_tc.output = 1;
+  if (symbol_get_tc (ext_sym)->class == -1)
+    symbol_get_tc (ext_sym)->class = XMC_PR;
+  symbol_get_tc (ext_sym)->output = 1;
 
   if (*input_line_pointer == ',')
     {
@@ -2804,11 +2814,11 @@
 	    {
 	      /* The fifth argument is the function size.  */
 	      ++input_line_pointer;
-	      ext_sym->sy_tc.size = symbol_new ("L0\001",
-						absolute_section,
-						(valueT) 0,
-						&zero_address_frag);
-	      pseudo_set (ext_sym->sy_tc.size);
+	      symbol_get_tc (ext_sym)->size = symbol_new ("L0\001",
+							  absolute_section,
+							  (valueT) 0,
+							  &zero_address_frag);
+	      pseudo_set (symbol_get_tc (ext_sym)->size);
 	    }
 	}
     }
@@ -2832,7 +2842,7 @@
 
   sym = symbol_make (".bf");
   S_SET_SEGMENT (sym, text_section);
-  sym->sy_frag = frag_now;
+  symbol_set_frag (sym, frag_now);
   S_SET_VALUE (sym, frag_now_fix ());
   S_SET_STORAGE_CLASS (sym, C_FCN);
 
@@ -2841,7 +2851,7 @@
   S_SET_NUMBER_AUXILIARY (sym, 1);
   SA_SET_SYM_LNNO (sym, coff_line_base);
 
-  sym->sy_tc.output = 1;
+  symbol_get_tc (sym)->output = 1;
 
   ppc_frob_label (sym);
 
@@ -2860,12 +2870,12 @@
 
   sym = symbol_make (".ef");
   S_SET_SEGMENT (sym, text_section);
-  sym->sy_frag = frag_now;
+  symbol_set_frag (sym, frag_now);
   S_SET_VALUE (sym, frag_now_fix ());
   S_SET_STORAGE_CLASS (sym, C_FCN);
   S_SET_NUMBER_AUXILIARY (sym, 1);
   SA_SET_SYM_LNNO (sym, get_absolute_expression ());
-  sym->sy_tc.output = 1;
+  symbol_get_tc (sym)->output = 1;
 
   ppc_frob_label (sym);
 
@@ -2899,10 +2909,10 @@
      .text section.  */
   S_SET_SEGMENT (sym, text_section);
   S_SET_VALUE (sym, coff_n_line_nos);
-  sym->bsym->flags |= BSF_DEBUGGING;
+  symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
 
   S_SET_STORAGE_CLASS (sym, ei ? C_EINCL : C_BINCL);
-  sym->sy_tc.output = 1;
+  symbol_get_tc (sym)->output = 1;
   
   for (look = last_biei ? last_biei : symbol_rootP;
        (look != (symbolS *) NULL
@@ -2947,10 +2957,10 @@
   sym = symbol_make (".bs");
   S_SET_SEGMENT (sym, now_seg);
   S_SET_STORAGE_CLASS (sym, C_BSTAT);
-  sym->bsym->flags |= BSF_DEBUGGING;
-  sym->sy_tc.output = 1;
+  symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
+  symbol_get_tc (sym)->output = 1;
 
-  sym->sy_tc.within = csect;
+  symbol_get_tc (sym)->within = csect;
 
   ppc_frob_label (sym);
 
@@ -2973,8 +2983,8 @@
   sym = symbol_make (".es");
   S_SET_SEGMENT (sym, now_seg);
   S_SET_STORAGE_CLASS (sym, C_ESTAT);
-  sym->bsym->flags |= BSF_DEBUGGING;
-  sym->sy_tc.output = 1;
+  symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
+  symbol_get_tc (sym)->output = 1;
 
   ppc_frob_label (sym);
 
@@ -2994,14 +3004,14 @@
 
   sym = symbol_make (".bb");
   S_SET_SEGMENT (sym, text_section);
-  sym->sy_frag = frag_now;
+  symbol_set_frag (sym, frag_now);
   S_SET_VALUE (sym, frag_now_fix ());
   S_SET_STORAGE_CLASS (sym, C_BLOCK);
 
   S_SET_NUMBER_AUXILIARY (sym, 1);
   SA_SET_SYM_LNNO (sym, get_absolute_expression ());
 
-  sym->sy_tc.output = 1;
+  symbol_get_tc (sym)->output = 1;
 
   SF_SET_PROCESS (sym);
 
@@ -3021,12 +3031,12 @@
 
   sym = symbol_make (".eb");
   S_SET_SEGMENT (sym, text_section);
-  sym->sy_frag = frag_now;
+  symbol_set_frag (sym, frag_now);
   S_SET_VALUE (sym, frag_now_fix ());
   S_SET_STORAGE_CLASS (sym, C_BLOCK);
   S_SET_NUMBER_AUXILIARY (sym, 1);
   SA_SET_SYM_LNNO (sym, get_absolute_expression ());
-  sym->sy_tc.output = 1;
+  symbol_get_tc (sym)->output = 1;
 
   SF_SET_PROCESS (sym);
 
@@ -3049,10 +3059,10 @@
   name = demand_copy_C_string (&len);
   sym = symbol_make (name);
   S_SET_SEGMENT (sym, ppc_coff_debug_section);
-  sym->bsym->flags |= BSF_DEBUGGING;
+  symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
   S_SET_STORAGE_CLASS (sym, C_BCOMM);
   S_SET_VALUE (sym, 0);
-  sym->sy_tc.output = 1;
+  symbol_get_tc (sym)->output = 1;
 
   ppc_frob_label (sym);
 
@@ -3069,10 +3079,10 @@
 
   sym = symbol_make (".ec");
   S_SET_SEGMENT (sym, ppc_coff_debug_section);
-  sym->bsym->flags |= BSF_DEBUGGING;
+  symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
   S_SET_STORAGE_CLASS (sym, C_ECOMM);
   S_SET_VALUE (sym, 0);
-  sym->sy_tc.output = 1;
+  symbol_get_tc (sym)->output = 1;
 
   ppc_frob_label (sym);
 
@@ -3086,7 +3096,7 @@
      int ignore;
 {
   if (ppc_toc_csect != (symbolS *) NULL)
-    subseg_set (data_section, ppc_toc_csect->sy_tc.subseg);
+    subseg_set (data_section, symbol_get_tc (ppc_toc_csect)->subseg);
   else
     {
       subsegT subseg;
@@ -3100,23 +3110,24 @@
       ppc_toc_frag = frag_now;
 
       sym = symbol_find_or_make ("TOC[TC0]");
-      sym->sy_frag = frag_now;
+      symbol_set_frag (sym, frag_now);
       S_SET_SEGMENT (sym, data_section);
       S_SET_VALUE (sym, (valueT) frag_now_fix ());
-      sym->sy_tc.subseg = subseg;
-      sym->sy_tc.output = 1;
-      sym->sy_tc.within = sym;
+      symbol_get_tc (sym)->subseg = subseg;
+      symbol_get_tc (sym)->output = 1;
+      symbol_get_tc (sym)->within = sym;
 
       ppc_toc_csect = sym;
 	  
       for (list = ppc_data_csects;
-	   list->sy_tc.next != (symbolS *) NULL;
-	   list = list->sy_tc.next)
+	   symbol_get_tc (list)->next != (symbolS *) NULL;
+	   list = symbol_get_tc (list)->next)
 	;
-      list->sy_tc.next = sym;
+      symbol_get_tc (list)->next = sym;
 
       symbol_remove (sym, &symbol_rootP, &symbol_lastP);
-      symbol_append (sym, list->sy_tc.within, &symbol_rootP, &symbol_lastP);
+      symbol_append (sym, symbol_get_tc (list)->within, &symbol_rootP,
+		     &symbol_lastP);
     }
 
   ppc_current_csect = ppc_toc_csect;
@@ -3208,8 +3219,8 @@
       {
 	symbolS *label;
 
-	label = ppc_current_csect->sy_tc.within;
-	if (label->sy_tc.class != XMC_TC0)
+	label = symbol_get_tc (ppc_current_csect)->within;
+	if (symbol_get_tc (label)->class != XMC_TC0)
 	  {
 	    as_bad (_(".tc with no label"));
 	    ignore_rest_of_line ();
@@ -3217,7 +3228,7 @@
 	  }
 
 	S_SET_SEGMENT (label, S_GET_SEGMENT (sym));
-	label->sy_frag = sym->sy_frag;
+	symbol_set_frag (label, symbol_get_frag (sym));
 	S_SET_VALUE (label, S_GET_VALUE (sym));
 
 	while (! is_end_of_line[(unsigned char) *input_line_pointer])
@@ -3227,10 +3238,10 @@
       }
 
     S_SET_SEGMENT (sym, now_seg);
-    sym->sy_frag = frag_now;
+    symbol_set_frag (sym, frag_now);
     S_SET_VALUE (sym, (valueT) frag_now_fix ());
-    sym->sy_tc.class = XMC_TC;
-    sym->sy_tc.output = 1;
+    symbol_get_tc (sym)->class = XMC_TC;
+    symbol_get_tc (sym)->output = 1;
 
     ppc_frob_label (sym);
   }
@@ -3910,16 +3921,18 @@
 ppc_symbol_new_hook (sym)
      symbolS *sym;
 {
+  struct ppc_tc_sy *tc;
   const char *s;
 
-  sym->sy_tc.next = NULL;
-  sym->sy_tc.output = 0;
-  sym->sy_tc.class = -1;
-  sym->sy_tc.real_name = NULL;
-  sym->sy_tc.subseg = 0;
-  sym->sy_tc.align = 0;
-  sym->sy_tc.size = NULL;
-  sym->sy_tc.within = NULL;
+  tc = symbol_get_tc (sym);
+  tc->next = NULL;
+  tc->output = 0;
+  tc->class = -1;
+  tc->real_name = NULL;
+  tc->subseg = 0;
+  tc->align = 0;
+  tc->size = NULL;
+  tc->within = NULL;
 
   if (ppc_stab_symbol)
     return;
@@ -3937,55 +3950,55 @@
     {
     case 'B':
       if (strcmp (s, "BS]") == 0)
-	sym->sy_tc.class = XMC_BS;
+	tc->class = XMC_BS;
       break;
     case 'D':
       if (strcmp (s, "DB]") == 0)
-	sym->sy_tc.class = XMC_DB;
+	tc->class = XMC_DB;
       else if (strcmp (s, "DS]") == 0)
-	sym->sy_tc.class = XMC_DS;
+	tc->class = XMC_DS;
       break;
     case 'G':
       if (strcmp (s, "GL]") == 0)
-	sym->sy_tc.class = XMC_GL;
+	tc->class = XMC_GL;
       break;
     case 'P':
       if (strcmp (s, "PR]") == 0)
-	sym->sy_tc.class = XMC_PR;
+	tc->class = XMC_PR;
       break;
     case 'R':
       if (strcmp (s, "RO]") == 0)
-	sym->sy_tc.class = XMC_RO;
+	tc->class = XMC_RO;
       else if (strcmp (s, "RW]") == 0)
-	sym->sy_tc.class = XMC_RW;
+	tc->class = XMC_RW;
       break;
     case 'S':
       if (strcmp (s, "SV]") == 0)
-	sym->sy_tc.class = XMC_SV;
+	tc->class = XMC_SV;
       break;
     case 'T':
       if (strcmp (s, "TC]") == 0)
-	sym->sy_tc.class = XMC_TC;
+	tc->class = XMC_TC;
       else if (strcmp (s, "TI]") == 0)
-	sym->sy_tc.class = XMC_TI;
+	tc->class = XMC_TI;
       else if (strcmp (s, "TB]") == 0)
-	sym->sy_tc.class = XMC_TB;
+	tc->class = XMC_TB;
       else if (strcmp (s, "TC0]") == 0 || strcmp (s, "T0]") == 0)
-	sym->sy_tc.class = XMC_TC0;
+	tc->class = XMC_TC0;
       break;
     case 'U':
       if (strcmp (s, "UA]") == 0)
-	sym->sy_tc.class = XMC_UA;
+	tc->class = XMC_UA;
       else if (strcmp (s, "UC]") == 0)
-	sym->sy_tc.class = XMC_UC;
+	tc->class = XMC_UC;
       break;
     case 'X':
       if (strcmp (s, "XO]") == 0)
-	sym->sy_tc.class = XMC_XO;
+	tc->class = XMC_XO;
       break;
     }
 
-  if (sym->sy_tc.class == -1)
+  if (tc->class == -1)
     as_bad (_("Unrecognized symbol suffix"));
 }
 
@@ -3999,13 +4012,13 @@
 {
   if (ppc_current_csect != (symbolS *) NULL)
     {
-      if (sym->sy_tc.class == -1)
-	sym->sy_tc.class = ppc_current_csect->sy_tc.class;
+      if (symbol_get_tc (sym)->class == -1)
+	symbol_get_tc (sym)->class = symbol_get_tc (ppc_current_csect)->class;
 
       symbol_remove (sym, &symbol_rootP, &symbol_lastP);
-      symbol_append (sym, ppc_current_csect->sy_tc.within, &symbol_rootP,
-		     &symbol_lastP);
-      ppc_current_csect->sy_tc.within = sym;
+      symbol_append (sym, symbol_get_tc (ppc_current_csect)->within,
+		     &symbol_rootP, &symbol_lastP);
+      symbol_get_tc (ppc_current_csect)->within = sym;
     }
 }
 
@@ -4029,15 +4042,15 @@
 
   /* Discard symbols that should not be included in the output symbol
      table.  */
-  if (! sym->sy_used_in_reloc
-      && ((sym->bsym->flags & BSF_SECTION_SYM) != 0
+  if (! symbol_used_in_reloc_p (sym)
+      && ((symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) != 0
 	  || (! S_IS_EXTERNAL (sym)
-	      && ! sym->sy_tc.output
+	      && ! symbol_get_tc (sym)->output
 	      && S_GET_STORAGE_CLASS (sym) != C_FILE)))
     return 1;
 
-  if (sym->sy_tc.real_name != (char *) NULL)
-    S_SET_NAME (sym, sym->sy_tc.real_name);
+  if (symbol_get_tc (sym)->real_name != (char *) NULL)
+    S_SET_NAME (sym, symbol_get_tc (sym)->real_name);
   else
     {
       const char *name;
@@ -4070,10 +4083,11 @@
       if (ppc_last_function != (symbolS *) NULL)
 	as_bad (_("two .function pseudo-ops with no intervening .ef"));
       ppc_last_function = sym;
-      if (sym->sy_tc.size != (symbolS *) NULL)
+      if (symbol_get_tc (sym)->size != (symbolS *) NULL)
 	{
-	  resolve_symbol_value (sym->sy_tc.size, 1);
-	  SA_SET_SYM_FSIZE (sym, (long) S_GET_VALUE (sym->sy_tc.size));
+	  resolve_symbol_value (symbol_get_tc (sym)->size, 1);
+	  SA_SET_SYM_FSIZE (sym,
+			    (long) S_GET_VALUE (symbol_get_tc (sym)->size));
 	}
     }
   else if (S_GET_STORAGE_CLASS (sym) == C_FCN
@@ -4093,7 +4107,7 @@
     }
 
   if (! S_IS_EXTERNAL (sym)
-      && (sym->bsym->flags & BSF_SECTION_SYM) == 0
+      && (symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) == 0
       && S_GET_STORAGE_CLASS (sym) != C_FILE
       && S_GET_STORAGE_CLASS (sym) != C_FCN
       && S_GET_STORAGE_CLASS (sym) != C_BLOCK
@@ -4113,39 +4127,39 @@
       /* Create a csect aux.  */
       i = S_GET_NUMBER_AUXILIARY (sym);
       S_SET_NUMBER_AUXILIARY (sym, i + 1);
-      a = &coffsymbol (sym->bsym)->native[i + 1].u.auxent;
-      if (sym->sy_tc.class == XMC_TC0)
+      a = &coffsymbol (symbol_get_bfdsym (sym))->native[i + 1].u.auxent;
+      if (symbol_get_tc (sym)->class == XMC_TC0)
 	{
 	  /* This is the TOC table.  */
 	  know (strcmp (S_GET_NAME (sym), "TOC") == 0);
 	  a->x_csect.x_scnlen.l = 0;
 	  a->x_csect.x_smtyp = (2 << 3) | XTY_SD;
 	}
-      else if (sym->sy_tc.subseg != 0)
+      else if (symbol_get_tc (sym)->subseg != 0)
 	{
 	  /* This is a csect symbol.  x_scnlen is the size of the
 	     csect.  */
-	  if (sym->sy_tc.next == (symbolS *) NULL)
+	  if (symbol_get_tc (sym)->next == (symbolS *) NULL)
 	    a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
 						       S_GET_SEGMENT (sym))
 				     - S_GET_VALUE (sym));
 	  else
 	    {
-	      resolve_symbol_value (sym->sy_tc.next, 1);
-	      a->x_csect.x_scnlen.l = (S_GET_VALUE (sym->sy_tc.next)
+	      resolve_symbol_value (symbol_get_tc (sym)->next, 1);
+	      a->x_csect.x_scnlen.l = (S_GET_VALUE (symbol_get_tc (sym)->next)
 				       - S_GET_VALUE (sym));
 	    }
-	  a->x_csect.x_smtyp = (sym->sy_tc.align << 3) | XTY_SD;
+	  a->x_csect.x_smtyp = (symbol_get_tc (sym)->align << 3) | XTY_SD;
 	}
       else if (S_GET_SEGMENT (sym) == bss_section)
 	{
 	  /* This is a common symbol.  */
-	  a->x_csect.x_scnlen.l = sym->sy_frag->fr_offset;
-	  a->x_csect.x_smtyp = (sym->sy_tc.align << 3) | XTY_CM;
+	  a->x_csect.x_scnlen.l = symbol_get_frag (sym)->fr_offset;
+	  a->x_csect.x_smtyp = (symbol_get_tc (sym)->align << 3) | XTY_CM;
 	  if (S_IS_EXTERNAL (sym))
-	    sym->sy_tc.class = XMC_RW;
+	    symbol_get_tc (sym)->class = XMC_RW;
 	  else
-	    sym->sy_tc.class = XMC_BS;
+	    symbol_get_tc (sym)->class = XMC_BS;
 	}
       else if (S_GET_SEGMENT (sym) == absolute_section)
 	{
@@ -4153,8 +4167,8 @@
              ppc_adjust_symtab.  */
 	  ppc_saw_abs = true;
 	  a->x_csect.x_smtyp = XTY_LD;
-	  if (sym->sy_tc.class == -1)
-	    sym->sy_tc.class = XMC_XO;
+	  if (symbol_get_tc (sym)->class == -1)
+	    symbol_get_tc (sym)->class = XMC_XO;
 	}
       else if (! S_IS_DEFINED (sym))
 	{
@@ -4162,17 +4176,17 @@
 	  a->x_csect.x_scnlen.l = 0;
 	  a->x_csect.x_smtyp = XTY_ER;
 	}
-      else if (sym->sy_tc.class == XMC_TC)
+      else if (symbol_get_tc (sym)->class == XMC_TC)
 	{
 	  symbolS *next;
 
 	  /* This is a TOC definition.  x_scnlen is the size of the
 	     TOC entry.  */
 	  next = symbol_next (sym);
-	  while (next->sy_tc.class == XMC_TC0)
+	  while (symbol_get_tc (next)->class == XMC_TC0)
 	    next = symbol_next (next);
 	  if (next == (symbolS *) NULL
-	      || next->sy_tc.class != XMC_TC)
+	      || symbol_get_tc (next)->class != XMC_TC)
 	    {
 	      if (ppc_after_toc_frag == (fragS *) NULL)
 		a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
@@ -4204,7 +4218,7 @@
 	    abort ();
 
 	  /* Skip the initial dummy symbol.  */
-	  csect = csect->sy_tc.next;
+	  csect = symbol_get_tc (csect)->next;
 
 	  if (csect == (symbolS *) NULL)
 	    {
@@ -4213,31 +4227,34 @@
 	    }
 	  else
 	    {
-	      while (csect->sy_tc.next != (symbolS *) NULL)
+	      while (symbol_get_tc (csect)->next != (symbolS *) NULL)
 		{
-		  resolve_symbol_value (csect->sy_tc.next, 1);
-		  if (S_GET_VALUE (csect->sy_tc.next) > S_GET_VALUE (sym))
+		  resolve_symbol_value (symbol_get_tc (csect)->next, 1);
+		  if (S_GET_VALUE (symbol_get_tc (csect)->next)
+		      > S_GET_VALUE (sym))
 		    break;
-		  csect = csect->sy_tc.next;
+		  csect = symbol_get_tc (csect)->next;
 		}
 
-	      a->x_csect.x_scnlen.p = coffsymbol (csect->bsym)->native;
-	      coffsymbol (sym->bsym)->native[i + 1].fix_scnlen = 1;
+	      a->x_csect.x_scnlen.p =
+		coffsymbol (symbol_get_bfdsym (csect))->native;
+	      coffsymbol (symbol_get_bfdsym (sym))->native[i + 1].fix_scnlen =
+		1;
 	    }
 	  a->x_csect.x_smtyp = XTY_LD;
 	}
 	
       a->x_csect.x_parmhash = 0;
       a->x_csect.x_snhash = 0;
-      if (sym->sy_tc.class == -1)
+      if (symbol_get_tc (sym)->class == -1)
 	a->x_csect.x_smclas = XMC_PR;
       else
-	a->x_csect.x_smclas = sym->sy_tc.class;
+	a->x_csect.x_smclas = symbol_get_tc (sym)->class;
       a->x_csect.x_stab = 0;
       a->x_csect.x_snstab = 0;
 
       /* Don't let the COFF backend resort these symbols.  */
-      sym->bsym->flags |= BSF_NOT_AT_END;
+      symbol_get_bfdsym (sym)->flags |= BSF_NOT_AT_END;
     }
   else if (S_GET_STORAGE_CLASS (sym) == C_BSTAT)
     {
@@ -4245,8 +4262,10 @@
 	 csect symbol.  BFD will do that for us if we set the right
 	 flags.  */
       S_SET_VALUE (sym,
-		   (valueT) coffsymbol (sym->sy_tc.within->bsym)->native);
-      coffsymbol (sym->bsym)->native->fix_value = 1;
+		   ((valueT)
+		    coffsymbol (symbol_get_bfdsym
+				(symbol_get_tc (sym)->within))->native));
+      coffsymbol (symbol_get_bfdsym (sym))->native->fix_value = 1;
     }
   else if (S_GET_STORAGE_CLASS (sym) == C_STSYM)
     {
@@ -4254,8 +4273,8 @@
       symbolS *csect;
 
       /* The value is the offset from the enclosing csect.  */
-      block = sym->sy_tc.within;
-      csect = block->sy_tc.within;
+      block = symbol_get_tc (sym)->within;
+      csect = symbol_get_tc (block)->within;
       resolve_symbol_value (csect, 1);
       S_SET_VALUE (sym, S_GET_VALUE (sym) - S_GET_VALUE (csect));
     }
@@ -4265,7 +4284,7 @@
       /* We want the value to be a file offset into the line numbers.
          BFD will do that for us if we set the right flags.  We have
          already set the value correctly.  */
-      coffsymbol (sym->bsym)->native->fix_line = 1;
+      coffsymbol (symbol_get_bfdsym (sym))->native->fix_line = 1;
     }
 
   return 0;
@@ -4293,11 +4312,11 @@
 
       csect = symbol_create (".abs[XO]", absolute_section,
 			     S_GET_VALUE (sym), &zero_address_frag);
-      csect->bsym->value = S_GET_VALUE (sym);
+      symbol_get_bfdsym (csect)->value = S_GET_VALUE (sym);
       S_SET_STORAGE_CLASS (csect, C_HIDEXT);
       i = S_GET_NUMBER_AUXILIARY (csect);
       S_SET_NUMBER_AUXILIARY (csect, i + 1);
-      a = &coffsymbol (csect->bsym)->native[i + 1].u.auxent;
+      a = &coffsymbol (symbol_get_bfdsym (csect))->native[i + 1].u.auxent;
       a->x_csect.x_scnlen.l = 0;
       a->x_csect.x_smtyp = XTY_SD;
       a->x_csect.x_parmhash = 0;
@@ -4309,9 +4328,9 @@
       symbol_insert (csect, sym, &symbol_rootP, &symbol_lastP);
 
       i = S_GET_NUMBER_AUXILIARY (sym);
-      a = &coffsymbol (sym->bsym)->native[i].u.auxent;
-      a->x_csect.x_scnlen.p = coffsymbol (csect->bsym)->native;
-      coffsymbol (sym->bsym)->native[i].fix_scnlen = 1;
+      a = &coffsymbol (symbol_get_bfdsym (sym))->native[i].u.auxent;
+      a->x_csect.x_scnlen.p = coffsymbol (symbol_get_bfdsym (csect))->native;
+      coffsymbol (symbol_get_bfdsym (sym))->native[i].fix_scnlen = 1;
     }
 
   ppc_saw_abs = false;
@@ -4490,9 +4509,9 @@
 	   sy != (symbolS *) NULL;
 	   sy = symbol_next (sy))
 	{
-	  if (sy->sy_tc.class == XMC_TC0)
+	  if (symbol_get_tc (sy)->class == XMC_TC0)
 	    continue;
-	  if (sy->sy_tc.class != XMC_TC)
+	  if (symbol_get_tc (sy)->class != XMC_TC)
 	    break;
 	  resolve_symbol_value (sy, 1);
 	  if (val == S_GET_VALUE (sy))
@@ -4509,9 +4528,9 @@
 
   /* Possibly adjust the reloc to be against the csect.  */
   if (fix->fx_addsy != (symbolS *) NULL
-      && fix->fx_addsy->sy_tc.subseg == 0
-      && fix->fx_addsy->sy_tc.class != XMC_TC0
-      && fix->fx_addsy->sy_tc.class != XMC_TC
+      && symbol_get_tc (fix->fx_addsy)->subseg == 0
+      && symbol_get_tc (fix->fx_addsy)->class != XMC_TC0
+      && symbol_get_tc (fix->fx_addsy)->class != XMC_TC
       && S_GET_SEGMENT (fix->fx_addsy) != bss_section
       /* Don't adjust if this is a reloc in the toc section.  */
       && (S_GET_SEGMENT (fix->fx_addsy) != data_section
@@ -4530,29 +4549,29 @@
 	abort ();
 
       /* Skip the initial dummy symbol.  */
-      csect = csect->sy_tc.next;
+      csect = symbol_get_tc (csect)->next;
 
       if (csect != (symbolS *) NULL)
 	{
-	  while (csect->sy_tc.next != (symbolS *) NULL
-		 && (csect->sy_tc.next->sy_frag->fr_address
-		     <= fix->fx_addsy->sy_frag->fr_address))
+	  while (symbol_get_tc (csect)->next != (symbolS *) NULL
+		 && (symbol_get_frag (symbol_get_tc (csect)->next)->fr_address
+		     <= symbol_get_frag (fix->fx_addsy)->fr_address))
 	    {
 	      /* If the csect address equals the symbol value, then we
                  have to look through the full symbol table to see
                  whether this is the csect we want.  Note that we will
                  only get here if the csect has zero length.  */
-	      if ((csect->sy_frag->fr_address
-		   == fix->fx_addsy->sy_frag->fr_address)
+	      if ((symbol_get_frag (csect)->fr_address
+		   == symbol_get_frag (fix->fx_addsy)->fr_address)
 		  && S_GET_VALUE (csect) == S_GET_VALUE (fix->fx_addsy))
 		{
 		  symbolS *scan;
 
-		  for (scan = csect->sy_next;
+		  for (scan = symbol_next (csect);
 		       scan != NULL;
-		       scan = scan->sy_next)
+		       scan = symbol_next (scan))
 		    {
-		      if (scan->sy_tc.subseg != 0)
+		      if (symbol_get_tc (scan)->subseg != 0)
 			break;
 		      if (scan == fix->fx_addsy)
 			break;
@@ -4564,11 +4583,11 @@
 		    break;
 		}
 
-	      csect = csect->sy_tc.next;
+	      csect = symbol_get_tc (csect)->next;
 	    }
 
 	  fix->fx_offset += (S_GET_VALUE (fix->fx_addsy)
-			     - csect->sy_frag->fr_address);
+			     - symbol_get_frag (csect)->fr_address);
 	  fix->fx_addsy = csect;
 	}
     }
@@ -4579,10 +4598,11 @@
       && S_GET_SEGMENT (fix->fx_addsy) == bss_section
       && ! S_IS_EXTERNAL (fix->fx_addsy))
     {
-      resolve_symbol_value (fix->fx_addsy->sy_frag->fr_symbol, 1);
-      fix->fx_offset += (S_GET_VALUE (fix->fx_addsy)
-			 - S_GET_VALUE (fix->fx_addsy->sy_frag->fr_symbol));
-      fix->fx_addsy = fix->fx_addsy->sy_frag->fr_symbol;
+      resolve_symbol_value (symbol_get_frag (fix->fx_addsy)->fr_symbol, 1);
+      fix->fx_offset +=
+	(S_GET_VALUE (fix->fx_addsy)
+	 - S_GET_VALUE (symbol_get_frag (fix->fx_addsy)->fr_symbol));
+      fix->fx_addsy = symbol_get_frag (fix->fx_addsy)->fr_symbol;
     }
 
   return 0;
@@ -4602,10 +4622,11 @@
      we need to force the relocation.  */
   if (fix->fx_pcrel
       && fix->fx_addsy != NULL
-      && fix->fx_addsy->sy_tc.subseg != 0
-      && (fix->fx_addsy->sy_frag->fr_address > fix->fx_frag->fr_address
-	  || (fix->fx_addsy->sy_tc.next != NULL
-	      && (fix->fx_addsy->sy_tc.next->sy_frag->fr_address
+      && symbol_get_tc (fix->fx_addsy)->subseg != 0
+      && ((symbol_get_frag (fix->fx_addsy)->fr_address
+	   > fix->fx_frag->fr_address)
+	  || (symbol_get_tc (fix->fx_addsy)->next != NULL
+	      && (symbol_get_frag (symbol_get_tc (fix->fx_addsy)->next)->fr_address
 		  <= fix->fx_frag->fr_address))))
     return 1;
 
@@ -4621,7 +4642,7 @@
      symbolS *sym;
 {
 #ifdef OBJ_XCOFF
-  return sym->sy_tc.class == XMC_TC;
+  return symbol_get_tc (sym)->class == XMC_TC;
 #else
   return strcmp (segment_name (S_GET_SEGMENT (sym)), ".got") == 0;
 #endif
@@ -4650,7 +4671,7 @@
     {
       /* `*valuep' may contain the value of the symbol on which the reloc
 	 will be based; we have to remove it.  */
-      if (fixp->fx_addsy->sy_used_in_reloc
+      if (symbol_used_in_reloc_p (fixp->fx_addsy)
 	  && S_GET_SEGMENT (fixp->fx_addsy) != absolute_section
 	  && S_GET_SEGMENT (fixp->fx_addsy) != undefined_section
 	  && ! bfd_is_com_section (S_GET_SEGMENT (fixp->fx_addsy)))
@@ -4725,9 +4746,9 @@
 	  && operand->shift == 0
 	  && operand->insert == NULL
 	  && fixp->fx_addsy != NULL
-	  && fixp->fx_addsy->sy_tc.subseg != 0
-	  && fixp->fx_addsy->sy_tc.class != XMC_TC
-	  && fixp->fx_addsy->sy_tc.class != XMC_TC0
+	  && symbol_get_tc (fixp->fx_addsy)->subseg != 0
+	  && symbol_get_tc (fixp->fx_addsy)->class != XMC_TC
+	  && symbol_get_tc (fixp->fx_addsy)->class != XMC_TC0
 	  && S_GET_SEGMENT (fixp->fx_addsy) != bss_section)
 	{
 	  value = fixp->fx_offset;
@@ -4881,7 +4902,7 @@
 	  if (fixp->fx_pcrel)
 	    abort ();
 	  md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where,
-			      value + 0x8000 >> 16, 2);
+			      (value + 0x8000) >> 16, 2);
 	  break;
 
 	  /* Because SDA21 modifies the register field, the size is set to 4
@@ -4988,7 +5009,8 @@
 
   reloc = (arelent *) xmalloc (sizeof (arelent));
 
-  reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
   reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
   if (reloc->howto == (reloc_howto_type *) NULL)
diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h
index 0871d13..436b975 100644
--- a/gas/config/tc-ppc.h
+++ b/gas/config/tc-ppc.h
@@ -1,5 +1,5 @@
 /* tc-ppc.h -- Header file for tc-ppc.c.
-   Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
    This file is part of GAS, the GNU Assembler.
@@ -121,7 +121,7 @@
 struct ppc_tc_sy
 {
   /* We keep a few linked lists of symbols.  */
-  struct symbol *next;
+  symbolS *next;
   /* Non-zero if the symbol should be output.  The RS/6000 assembler
      only outputs symbols that are external or are mentioned in a
      .globl or .lglobl statement.  */
@@ -137,11 +137,11 @@
   int align;
   /* For a function symbol, a symbol whose value is the size.  The
      field is NULL if there is no size.  */
-  struct symbol *size;
+  symbolS *size;
   /* For a csect symbol, the last symbol which has been defined in
      this csect, or NULL if none have been defined so far.  For a .bs
      symbol, the referenced csect symbol.  */
-  struct symbol *within;
+  symbolS *within;
 };
 
 #define TC_SYMFIELD_TYPE struct ppc_tc_sy
@@ -158,11 +158,11 @@
 
 /* Get the symbol class from the name.  */
 #define tc_symbol_new_hook(sym) ppc_symbol_new_hook (sym)
-extern void ppc_symbol_new_hook PARAMS ((struct symbol *));
+extern void ppc_symbol_new_hook PARAMS ((symbolS *));
 
 /* Set the symbol class of a label based on the csect.  */
 #define tc_frob_label(sym) ppc_frob_label (sym)
-extern void ppc_frob_label PARAMS ((struct symbol *));
+extern void ppc_frob_label PARAMS ((symbolS *));
 
 /* TOC relocs requires special handling.  */
 #define tc_fix_adjustable(fixp) ppc_fix_adjustable (fixp)
@@ -178,7 +178,7 @@
 
 /* Finish up the symbol.  */
 #define tc_frob_symbol(sym, punt) punt = ppc_frob_symbol (sym)
-extern int ppc_frob_symbol PARAMS ((struct symbol *));
+extern int ppc_frob_symbol PARAMS ((symbolS *));
 
 /* Finish up the entire symtab.  */
 #define tc_adjust_symtab() ppc_adjust_symtab ()
@@ -203,18 +203,18 @@
 
 #define TC_FORCE_RELOCATION_SECTION(FIXP,SEC)				\
 (TC_FORCE_RELOCATION (FIXP)						\
- || ((FIXP)->fx_addsy && !(FIXP)->fx_subsy && (FIXP)->fx_addsy->bsym	\
-     && (FIXP)->fx_addsy->bsym->section != SEC))
+ || ((FIXP)->fx_addsy && !(FIXP)->fx_subsy				\
+     && S_GET_SEGMENT ((FIXP)->fx_addsy) != SEC))
 
 /* Support for SHF_EXCLUDE and SHT_ORDERED */
 extern int ppc_section_letter PARAMS ((int, char **));
-extern int ppc_section_type PARAMS ((char **));
-extern int ppc_section_word PARAMS ((char **));
+extern int ppc_section_type PARAMS ((char *, size_t));
+extern int ppc_section_word PARAMS ((char *, size_t));
 extern int ppc_section_flags PARAMS ((int, int, int));
 
 #define md_elf_section_letter(LETTER, PTR_MSG)	ppc_section_letter (LETTER, PTR_MSG)
-#define md_elf_section_type(PTR_STR)		ppc_section_type (PTR_STR)
-#define md_elf_section_word(PTR_STR)		ppc_section_word (PTR_STR)
+#define md_elf_section_type(STR, LEN)		ppc_section_type (STR, LEN)
+#define md_elf_section_word(STR, LEN)		ppc_section_word (STR, LEN)
 #define md_elf_section_flags(FLAGS, ATTR, TYPE)	ppc_section_flags (FLAGS, ATTR, TYPE)
 
 /* Add extra PPC sections -- Note, for now, make .sbss2 and .PPC.EMB.sbss0 a
@@ -247,8 +247,7 @@
        || ((FIX)->fx_subsy != NULL					\
 	   && (S_GET_SEGMENT ((FIX)->fx_subsy)				\
 	       == S_GET_SEGMENT ((FIX)->fx_addsy)))			\
-       || strchr (S_GET_NAME ((FIX)->fx_addsy), '\001') != NULL		\
-       || strchr (S_GET_NAME ((FIX)->fx_addsy), '\002') != NULL))
+       || S_IS_LOCAL ((FIX)->fx_addsy)))
 
 /* We must never ever try to resolve references to externally visible
    symbols in the assembler, because the .o file might go into a shared
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index 6d8ca81..2752d03 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -1,5 +1,5 @@
 /* tc-sh.c -- Assemble code for the Hitachi Super-H
-   Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -1450,7 +1450,8 @@
 	 We have already adjusted the value of sym to include the
 	 fragment address, so we undo that adjustment here.  */
       subseg_change (sec, 0);
-      fix_new (sym->sy_frag, S_GET_VALUE (sym) - sym->sy_frag->fr_address,
+      fix_new (symbol_get_frag (sym),
+	       S_GET_VALUE (sym) - symbol_get_frag (sym)->fr_address,
 	       4, &abs_symbol, info.count, 0, BFD_RELOC_SH_COUNT);
     }
 }
@@ -2056,7 +2057,11 @@
     case BFD_RELOC_VTABLE_INHERIT:
     case BFD_RELOC_VTABLE_ENTRY:
       fixP->fx_done = 0;
+#ifdef BFD_ASSEMBLER
+      return 0;
+#else
       return;
+#endif
 
     default:
       abort ();
@@ -2187,12 +2192,7 @@
      int max;
 {
   if (fill == NULL
-#ifdef BFD_ASSEMBLER
-      && (now_seg->flags & SEC_CODE) != 0
-#else
-      && now_seg != data_section
-      && now_seg != bss_section
-#endif
+      && subseg_text_p (now_seg)
       && n > 1)
     {
       static const unsigned char big_nop_pattern[] = { 0x00, 0x09 };
@@ -2377,7 +2377,8 @@
   bfd_reloc_code_real_type r_type;
 
   rel = (arelent *) xmalloc (sizeof (arelent));
-  rel->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
 
   r_type = fixp->fx_r_type;
diff --git a/gas/config/tc-sh.h b/gas/config/tc-sh.h
index cc02eab..f4278c2 100644
--- a/gas/config/tc-sh.h
+++ b/gas/config/tc-sh.h
@@ -1,5 +1,5 @@
 /* This file is tc-sh.h
-   Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -56,6 +56,8 @@
 
 #ifdef OBJ_ELF
 #define obj_fix_adjustable(fixP) sh_fix_adjustable(fixP)
+struct fix;
+extern boolean sh_fix_adjustable PARAMS ((struct fix *));
 #endif
 
 #define IGNORE_NONSTANDARD_ESCAPES
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 1518a8a..1bced29 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -1,5 +1,5 @@
 /* tc-sparc.c -- Assemble for the SPARC
-   Copyright (C) 1989, 90-96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1989, 90-96, 97, 98, 1999 Free Software Foundation, Inc.
    This file is part of GAS, the GNU Assembler.
 
    GAS is free software; you can redistribute it and/or modify
@@ -31,11 +31,14 @@
 
 static struct sparc_arch *lookup_arch PARAMS ((char *));
 static void init_default_arch PARAMS ((void));
-static void sparc_ip PARAMS ((char *, const struct sparc_opcode **));
+static int sparc_ip PARAMS ((char *, const struct sparc_opcode **));
 static int in_signed_range PARAMS ((bfd_signed_vma, bfd_signed_vma));
 static int in_unsigned_range PARAMS ((bfd_vma, bfd_vma));
 static int in_bitfield_range PARAMS ((bfd_signed_vma, bfd_signed_vma));
 static int sparc_ffs PARAMS ((unsigned int));
+static void synthetize_setuw PARAMS ((const struct sparc_opcode *));
+static void synthetize_setsw PARAMS ((const struct sparc_opcode *));
+static void synthetize_setx PARAMS ((const struct sparc_opcode *));
 static bfd_vma BSR PARAMS ((bfd_vma, int));
 static int cmp_reg_entry PARAMS ((const PTR, const PTR));
 static int parse_keyword_arg PARAMS ((int (*) (const char *), char **, int *));
@@ -115,6 +118,7 @@
 static void s_common PARAMS ((int));
 static void s_empty PARAMS ((int));
 static void s_uacons PARAMS ((int));
+static void s_ncons PARAMS ((int));
 
 const pseudo_typeS md_pseudo_table[] =
 {
@@ -123,6 +127,7 @@
   {"empty", s_empty, 0},
   {"global", s_globl, 0},
   {"half", cons, 2},
+  {"nword", s_ncons, 0},
   {"optim", s_ignore, 0},
   {"proc", s_proc, 0},
   {"reserve", s_reserve, 0},
@@ -135,8 +140,6 @@
   {"uaxword", s_uacons, 8},
 #ifdef OBJ_ELF
   /* these are specific to sparc/svr4 */
-  {"pushsection", obj_elf_section, 0},
-  {"popsection", obj_elf_previous, 0},
   {"2byte", s_uacons, 2},
   {"4byte", s_uacons, 4},
   {"8byte", s_uacons, 8},
@@ -174,9 +177,7 @@
    changed in read.c.  Ideally it shouldn't have to know about it at all,
    but nothing is ideal around here.  */
 
-static unsigned char octal[256];
-#define isoctal(c)  octal[(unsigned char) (c)]
-static unsigned char toHex[256];
+#define isoctal(c)  ((unsigned)((c) - '0') < '8')
 
 struct sparc_it
   {
@@ -184,6 +185,7 @@
     unsigned long opcode;
     struct nlist *nlistp;
     expressionS exp;
+    expressionS exp2;
     int pcrel;
     bfd_reloc_code_real_type reloc;
   };
@@ -613,6 +615,27 @@
 #endif
 }
 
+/* native operand size opcode translation */
+struct
+  {
+    char *name;
+    char *name32;
+    char *name64;
+  } native_op_table[] =
+{
+  {"ldn", "ld", "ldx"},
+  {"ldna", "lda", "ldxa"},
+  {"stn", "st", "stx"},
+  {"stna", "sta", "stxa"},
+  {"slln", "sll", "sllx"},
+  {"srln", "srl", "srlx"},
+  {"sran", "sra", "srax"},
+  {"casn", "cas", "casx"},
+  {"casna", "casa", "casxa"},
+  {"clrn", "clr", "clrx"},
+  {NULL, NULL, NULL},
+};
+
 /* sparc64 priviledged registers */
 
 struct priv_reg_entry
@@ -693,16 +716,16 @@
       retval = hash_insert (op_hash, name, (PTR) &sparc_opcodes[i]);
       if (retval != NULL)
 	{
-	  fprintf (stderr, _("internal error: can't hash `%s': %s\n"),
-		   sparc_opcodes[i].name, retval);
+	  as_bad (_("Internal error: can't hash `%s': %s\n"),
+		  sparc_opcodes[i].name, retval);
 	  lose = 1;
 	}
       do
 	{
 	  if (sparc_opcodes[i].match & sparc_opcodes[i].lose)
 	    {
-	      fprintf (stderr, _("internal error: losing opcode: `%s' \"%s\"\n"),
-		       sparc_opcodes[i].name, sparc_opcodes[i].args);
+	      as_bad (_("Internal error: losing opcode: `%s' \"%s\"\n"),
+		      sparc_opcodes[i].name, sparc_opcodes[i].args);
 	      lose = 1;
 	    }
 	  ++i;
@@ -711,18 +734,33 @@
 	     && !strcmp (sparc_opcodes[i].name, name));
     }
 
+  for (i = 0; native_op_table[i].name; i++)
+    {
+      const struct sparc_opcode *insn;
+      char *name = sparc_arch_size == 32 ? native_op_table[i].name32 :
+			native_op_table[i].name64;
+      insn = (struct sparc_opcode *)hash_find (op_hash, name);
+      if (insn == NULL)
+        {
+          as_bad (_("Internal error: can't find opcode `%s' for `%s'\n"),
+          	  name, native_op_table[i].name);
+          lose = 1;
+        }
+      else
+	{
+	  retval = hash_insert (op_hash, native_op_table[i].name, (PTR) insn);
+	  if (retval != NULL)
+	    {
+	      as_bad (_("Internal error: can't hash `%s': %s\n"),
+		      sparc_opcodes[i].name, retval);
+	      lose = 1;
+	    }
+	}
+    }
+
   if (lose)
     as_fatal (_("Broken assembler.  No assembly attempted."));
 
-  for (i = '0'; i < '8'; ++i)
-    octal[i] = 1;
-  for (i = '0'; i <= '9'; ++i)
-    toHex[i] = i - '0';
-  for (i = 'a'; i <= 'f'; ++i)
-    toHex[i] = i + 10 - 'a';
-  for (i = 'A'; i <= 'F'; ++i)
-    toHex[i] = i + 10 - 'A';
-
   qsort (priv_reg_table, sizeof (priv_reg_table) / sizeof (priv_reg_table[0]),
 	 sizeof (priv_reg_table[0]), cmp_reg_entry);
 
@@ -860,9 +898,6 @@
 /* For communication between sparc_ip and get_expression.  */
 static char *expr_end;
 
-/* For communication between md_assemble and sparc_ip.  */
-static int special_case;
-
 /* Values for `special_case'.
    Instructions that require wierd handling because they're longer than
    4 bytes.  */
@@ -876,6 +911,7 @@
 /* Bit masks of various insns.  */
 #define NOP_INSN 0x01000000
 #define OR_INSN 0x80100000
+#define XOR_INSN 0x80180000
 #define FMOVS_INSN 0x81A00020
 #define SETHI_INSN 0x01000000
 #define SLLX_INSN 0x81281000
@@ -886,6 +922,281 @@
 /* The assembled opcode of `last_insn'.  */
 static unsigned long last_opcode;
 
+/* Handle the set and setuw synthetic instructions.  */
+static void
+synthetize_setuw (insn)
+     const struct sparc_opcode *insn;
+{
+  int need_hi22_p = 0;
+  int rd = (the_insn.opcode & RD (~0)) >> 25;
+
+  if (the_insn.exp.X_op == O_constant)
+    {
+      if (SPARC_OPCODE_ARCH_V9_P (max_architecture))
+	{
+	  if (sizeof(offsetT) > 4
+	      && (the_insn.exp.X_add_number < 0
+		  || the_insn.exp.X_add_number > (offsetT) 0xffffffff))
+	    as_warn (_("set: number not in 0..4294967295 range"));
+	}
+      else
+	{
+	  if (sizeof(offsetT) > 4
+	      && (the_insn.exp.X_add_number < -(offsetT) 0x80000000
+		  || the_insn.exp.X_add_number > (offsetT) 0xffffffff))
+	    as_warn (_("set: number not in -2147483648..4294967295 range"));
+	  the_insn.exp.X_add_number = (int)the_insn.exp.X_add_number;
+	}
+    }
+
+  /* See if operand is absolute and small; skip sethi if so.  */
+  if (the_insn.exp.X_op != O_constant
+      || the_insn.exp.X_add_number >= (1 << 12)
+      || the_insn.exp.X_add_number < -(1 << 12))
+    {
+      the_insn.opcode = (SETHI_INSN | RD (rd)
+			 | ((the_insn.exp.X_add_number >> 10)
+			    & (the_insn.exp.X_op == O_constant ? 0x3fffff : 0)));
+      the_insn.reloc = (the_insn.exp.X_op != O_constant
+			? BFD_RELOC_HI22
+			: BFD_RELOC_NONE);
+      output_insn (insn, &the_insn);
+      need_hi22_p = 1;
+    }
+
+  /* See if operand has no low-order bits; skip OR if so.  */
+  if (the_insn.exp.X_op != O_constant
+      || (need_hi22_p && (the_insn.exp.X_add_number & 0x3FF) != 0)
+      || ! need_hi22_p)
+    {
+      the_insn.opcode = (OR_INSN | (need_hi22_p ? RS1 (rd) : 0)
+			 | RD (rd) | IMMED
+			 | (the_insn.exp.X_add_number
+			    & (the_insn.exp.X_op != O_constant ? 0 :
+			       need_hi22_p ? 0x3ff : 0x1fff)));
+      the_insn.reloc = (the_insn.exp.X_op != O_constant
+			? BFD_RELOC_LO10
+			: BFD_RELOC_NONE);
+      output_insn (insn, &the_insn);
+    }
+}
+    
+/* Handle the setsw synthetic instruction.  */
+static void
+synthetize_setsw (insn)
+     const struct sparc_opcode *insn;
+{
+  int low32, rd, opc;
+
+  rd = (the_insn.opcode & RD (~0)) >> 25;
+
+  if (the_insn.exp.X_op != O_constant)
+    {
+      synthetize_setuw (insn);
+
+      /* Need to sign extend it.  */
+      the_insn.opcode = (SRA_INSN | RS1 (rd) | RD (rd));
+      the_insn.reloc = BFD_RELOC_NONE;
+      output_insn (insn, &the_insn);
+      return;
+    }
+
+  if (sizeof(offsetT) > 4
+      && (the_insn.exp.X_add_number < -(offsetT) 0x80000000
+	  || the_insn.exp.X_add_number > (offsetT) 0xffffffff))
+    as_warn (_("setsw: number not in -2147483648..4294967295 range"));
+
+  low32 = the_insn.exp.X_add_number;	
+	      
+  if (low32 >= 0)
+    {
+      synthetize_setuw (insn);
+      return;
+    }
+
+  opc = OR_INSN;
+    
+  the_insn.reloc = BFD_RELOC_NONE;
+  /* See if operand is absolute and small; skip sethi if so.  */
+  if (low32 < -(1 << 12))
+    {
+      the_insn.opcode = (SETHI_INSN | RD (rd)
+			 | (((~the_insn.exp.X_add_number) >> 10) & 0x3fffff));
+      output_insn (insn, &the_insn);
+      low32 = 0x1c00 | (low32 & 0x3ff);
+      opc = RS1 (rd) | XOR_INSN;
+    }
+
+  the_insn.opcode = (opc | RD (rd) | IMMED
+		     | (low32 & 0x1fff));
+  output_insn (insn, &the_insn);
+}
+
+/* Handle the setsw synthetic instruction.  */
+static void
+synthetize_setx (insn)
+     const struct sparc_opcode *insn;
+{
+  int upper32, lower32;
+  int tmpreg = (the_insn.opcode & RS1 (~0)) >> 14;
+  int dstreg = (the_insn.opcode & RD (~0)) >> 25;
+  int upper_dstreg;
+  int need_hh22_p = 0, need_hm10_p = 0, need_hi22_p = 0, need_lo10_p = 0;
+  int need_xor10_p = 0;
+    
+#define SIGNEXT32(x) ((((x) & 0xffffffff) ^ 0x80000000) - 0x80000000)
+  lower32 = SIGNEXT32 (the_insn.exp.X_add_number);
+  upper32 = SIGNEXT32 (BSR (the_insn.exp.X_add_number, 32));
+#undef SIGNEXT32
+
+  upper_dstreg = tmpreg;
+  /* The tmp reg should not be the dst reg.  */
+  if (tmpreg == dstreg)
+    as_warn (_("setx: temporary register same as destination register"));
+
+  /* ??? Obviously there are other optimizations we can do
+     (e.g. sethi+shift for 0x1f0000000) and perhaps we shouldn't be
+     doing some of these.  Later.  If you do change things, try to
+     change all of this to be table driven as well.  */
+  /* What to output depends on the number if it's constant.
+     Compute that first, then output what we've decided upon.  */
+  if (the_insn.exp.X_op != O_constant)
+    {
+      if (sparc_arch_size == 32)
+	{
+	  /* When arch size is 32, we want setx to be equivalent
+	     to setuw for anything but constants.  */
+	  the_insn.exp.X_add_number &= 0xffffffff;
+	  synthetize_setuw (insn);
+	  return;
+	}
+      need_hh22_p = need_hm10_p = need_hi22_p = need_lo10_p = 1;
+      lower32 = 0; upper32 = 0;
+    }
+  else
+    {
+      /* Reset X_add_number, we've extracted it as upper32/lower32.
+	 Otherwise fixup_segment will complain about not being able to
+	 write an 8 byte number in a 4 byte field.  */
+      the_insn.exp.X_add_number = 0;
+    
+      /* Only need hh22 if `or' insn can't handle constant.  */
+      if (upper32 < -(1 << 12) || upper32 >= (1 << 12))
+	need_hh22_p = 1;
+    
+      /* Does bottom part (after sethi) have bits?  */
+      if ((need_hh22_p && (upper32 & 0x3ff) != 0)
+	  /* No hh22, but does upper32 still have bits we can't set
+	     from lower32?  */
+	  || (! need_hh22_p && upper32 != 0 && upper32 != -1))
+	need_hm10_p = 1;
+    
+      /* If the lower half is all zero, we build the upper half directly
+	 into the dst reg.  */
+      if (lower32 != 0
+	  /* Need lower half if number is zero or 0xffffffff00000000.  */
+	  || (! need_hh22_p && ! need_hm10_p))
+	{
+	  /* No need for sethi if `or' insn can handle constant.  */
+	  if (lower32 < -(1 << 12) || lower32 >= (1 << 12)
+	      /* Note that we can't use a negative constant in the `or'
+		 insn unless the upper 32 bits are all ones.  */
+	      || (lower32 < 0 && upper32 != -1)
+	      || (lower32 >= 0 && upper32 == -1))
+	    need_hi22_p = 1;
+		      
+	  if (need_hi22_p && upper32 == -1)
+	    need_xor10_p = 1;
+
+	  /* Does bottom part (after sethi) have bits?  */
+	  else if ((need_hi22_p && (lower32 & 0x3ff) != 0)
+		   /* No sethi.  */
+		   || (! need_hi22_p && (lower32 & 0x1fff) != 0)
+		   /* Need `or' if we didn't set anything else.  */
+		   || (! need_hi22_p && ! need_hh22_p && ! need_hm10_p))
+	    need_lo10_p = 1;
+	}
+      else
+	/* Output directly to dst reg if lower 32 bits are all zero.  */
+	upper_dstreg = dstreg;
+    }
+    
+  if (!upper_dstreg && dstreg)
+    as_warn (_("setx: illegal temporary register g0"));
+
+  if (need_hh22_p)
+    {
+      the_insn.opcode = (SETHI_INSN | RD (upper_dstreg)
+			 | ((upper32 >> 10) & 0x3fffff));
+      the_insn.reloc = (the_insn.exp.X_op != O_constant
+			? BFD_RELOC_SPARC_HH22 : BFD_RELOC_NONE);
+      output_insn (insn, &the_insn);
+    }
+    
+  if (need_hi22_p)
+    {
+      the_insn.opcode = (SETHI_INSN | RD (dstreg)
+			 | (((need_xor10_p ? ~lower32 : lower32)
+			    >> 10) & 0x3fffff));
+      the_insn.reloc = (the_insn.exp.X_op != O_constant
+			? BFD_RELOC_SPARC_LM22 : BFD_RELOC_NONE);
+      output_insn (insn, &the_insn);
+    }
+
+  if (need_hm10_p)
+    {
+      the_insn.opcode = (OR_INSN
+			 | (need_hh22_p ? RS1 (upper_dstreg) : 0)
+			 | RD (upper_dstreg)
+			 | IMMED
+			 | (upper32 & (need_hh22_p ? 0x3ff : 0x1fff)));
+      the_insn.reloc = (the_insn.exp.X_op != O_constant
+			? BFD_RELOC_SPARC_HM10 : BFD_RELOC_NONE);
+      output_insn (insn, &the_insn);
+    }
+    
+  if (need_lo10_p)
+    {
+      /* FIXME: One nice optimization to do here is to OR the low part
+	 with the highpart if hi22 isn't needed and the low part is
+	 positive.  */
+      the_insn.opcode = (OR_INSN | (need_hi22_p ? RS1 (dstreg) : 0)
+			 | RD (dstreg)
+			 | IMMED
+			 | (lower32 & (need_hi22_p ? 0x3ff : 0x1fff)));
+      the_insn.reloc = (the_insn.exp.X_op != O_constant
+			? BFD_RELOC_LO10 : BFD_RELOC_NONE);
+      output_insn (insn, &the_insn);
+    }
+    
+  /* If we needed to build the upper part, shift it into place.  */
+  if (need_hh22_p || need_hm10_p)
+    {
+      the_insn.opcode = (SLLX_INSN | RS1 (upper_dstreg) | RD (upper_dstreg)
+			 | IMMED | 32);
+      the_insn.reloc = BFD_RELOC_NONE;
+      output_insn (insn, &the_insn);
+    }
+    
+  /* To get -1 in upper32, we do sethi %hi(~x), r; xor r, -0x400 | x, r.  */
+  if (need_xor10_p)
+    {
+      the_insn.opcode = (XOR_INSN | RS1 (dstreg) | RD (dstreg) | IMMED
+			 | 0x1c00 | (lower32 & 0x3ff));
+      the_insn.reloc = BFD_RELOC_NONE;
+      output_insn (insn, &the_insn);
+    }
+
+  /* If we needed to build both upper and lower parts, OR them together.  */
+  else if ((need_hh22_p || need_hm10_p) && (need_hi22_p || need_lo10_p))
+    {
+      the_insn.opcode = (OR_INSN | RS1 (dstreg) | RS2 (upper_dstreg)
+			 | RD (dstreg));
+      the_insn.reloc = BFD_RELOC_NONE;
+      output_insn (insn, &the_insn);
+    }
+}
+
 /* Main entry point to assemble one instruction.  */
 
 void
@@ -893,10 +1204,10 @@
      char *str;
 {
   const struct sparc_opcode *insn;
+  int special_case;
 
   know (str);
-  special_case = SPECIAL_CASE_NONE;
-  sparc_ip (str, &insn);
+  special_case = sparc_ip (str, &insn);
 
   /* We warn about attempts to put a floating point branch in a delay slot,
      unless the delay slot has been annulled.  */
@@ -934,202 +1245,24 @@
       output_insn (insn, &the_insn);
       break;
 
-    case SPECIAL_CASE_SET:
-      {
-	int need_hi22_p = 0;
-
-	/* "set" is not defined for negative numbers in v9: it doesn't yield
-	   what you expect it to.  */
-	if (SPARC_OPCODE_ARCH_V9_P (max_architecture)
-	    && the_insn.exp.X_op == O_constant)
-	  {
-	    if (the_insn.exp.X_add_number < 0)
-	      as_warn (_("set: used with negative number"));
-	    else if (the_insn.exp.X_add_number > (offsetT) 0xffffffff)
-	      as_warn (_("set: number larger than 4294967295"));
-	  }
-
-	/* See if operand is absolute and small; skip sethi if so.  */
-	if (the_insn.exp.X_op != O_constant
-	    || the_insn.exp.X_add_number >= (1 << 12)
-	    || the_insn.exp.X_add_number < -(1 << 12))
-	  {
-	    output_insn (insn, &the_insn);
-	    need_hi22_p = 1;
-	  }
-	/* See if operand has no low-order bits; skip OR if so.  */
-	if (the_insn.exp.X_op != O_constant
-	    || (need_hi22_p && (the_insn.exp.X_add_number & 0x3FF) != 0)
-	    || ! need_hi22_p)
-	  {
-	    int rd = (the_insn.opcode & RD (~0)) >> 25;
-	    the_insn.opcode = (OR_INSN | (need_hi22_p ? RS1 (rd) : 0)
-			       | RD (rd)
-			       | IMMED
-			       | (the_insn.exp.X_add_number
-				  & (need_hi22_p ? 0x3ff : 0x1fff)));
-	    the_insn.reloc = (the_insn.exp.X_op != O_constant
-			      ? BFD_RELOC_LO10
-			      : BFD_RELOC_NONE);
-	    output_insn (insn, &the_insn);
-	  }
-	break;
-      }
-
     case SPECIAL_CASE_SETSW:
-      {
-	/* FIXME: Not finished.  */
-	break;
-      }
+      synthetize_setsw (insn);
+      break;
+	  
+    case SPECIAL_CASE_SET:
+      synthetize_setuw (insn);
+      break;
 
     case SPECIAL_CASE_SETX:
-      {
-#define SIGNEXT32(x) ((((x) & 0xffffffff) ^ 0x80000000) - 0x80000000)
-	int upper32 = SIGNEXT32 (BSR (the_insn.exp.X_add_number, 32));
-	int lower32 = SIGNEXT32 (the_insn.exp.X_add_number);
-#undef SIGNEXT32
-	int tmpreg = (the_insn.opcode & RS1 (~0)) >> 14;
-	int dstreg = (the_insn.opcode & RD (~0)) >> 25;
-	/* Output directly to dst reg if lower 32 bits are all zero.  */
-	int upper_dstreg = (the_insn.exp.X_op == O_constant
-			    && lower32 == 0) ? dstreg : tmpreg;
-	int need_hh22_p = 0, need_hm10_p = 0, need_hi22_p = 0, need_lo10_p = 0;
-
-	/* The tmp reg should not be the dst reg.  */
-	if (tmpreg == dstreg)
-	  as_warn (_("setx: temporary register same as destination register"));
-
-	/* Reset X_add_number, we've extracted it as upper32/lower32.
-	   Otherwise fixup_segment will complain about not being able to
-	   write an 8 byte number in a 4 byte field.  */
-	the_insn.exp.X_add_number = 0;
-
-	/* ??? Obviously there are other optimizations we can do
-	   (e.g. sethi+shift for 0x1f0000000) and perhaps we shouldn't be
-	   doing some of these.  Later.  If you do change things, try to
-	   change all of this to be table driven as well.  */
-
-	/* What to output depends on the number if it's constant.
-	   Compute that first, then output what we've decided upon.  */
-	if (the_insn.exp.X_op != O_constant)
-	  need_hh22_p = need_hm10_p = need_hi22_p = need_lo10_p = 1;
-	else
-	  {
-	    /* Only need hh22 if `or' insn can't handle constant.  */
-	    if (upper32 < -(1 << 12) || upper32 >= (1 << 12))
-	      need_hh22_p = 1;
-
-	    /* Does bottom part (after sethi) have bits?  */
-	    if ((need_hh22_p && (upper32 & 0x3ff) != 0)
-		/* No hh22, but does upper32 still have bits we can't set
-		   from lower32?  */
-		|| (! need_hh22_p
-		    && upper32 != 0
-		    && (upper32 != -1 || lower32 >= 0)))
-	      need_hm10_p = 1;
-
-	    /* If the lower half is all zero, we build the upper half directly
-	       into the dst reg.  */
-	    if (lower32 != 0
-		/* Need lower half if number is zero.  */
-		|| (! need_hh22_p && ! need_hm10_p))
-	      {
-		/* No need for sethi if `or' insn can handle constant.  */
-		if (lower32 < -(1 << 12) || lower32 >= (1 << 12)
-		    /* Note that we can't use a negative constant in the `or'
-		       insn unless the upper 32 bits are all ones.  */
-		    || (lower32 < 0 && upper32 != -1))
-		  need_hi22_p = 1;
-
-		/* Does bottom part (after sethi) have bits?  */
-		if ((need_hi22_p && (lower32 & 0x3ff) != 0)
-		    /* No sethi.  */
-		    || (! need_hi22_p && (lower32 & 0x1fff) != 0)
-		    /* Need `or' if we didn't set anything else.  */
-		    || (! need_hi22_p && ! need_hh22_p && ! need_hm10_p))
-		  need_lo10_p = 1;
-	      }
-	  }
-
-	if (need_hh22_p)
-	  {
-	    the_insn.opcode = (SETHI_INSN | RD (upper_dstreg)
-			       | ((upper32 >> 10) & 0x3fffff));
-	    the_insn.reloc = (the_insn.exp.X_op != O_constant
-			      ? BFD_RELOC_SPARC_HH22 : BFD_RELOC_NONE);
-	    output_insn (insn, &the_insn);
-	  }
-
-	if (need_hm10_p)
-	  {
-	    the_insn.opcode = (OR_INSN
-			       | (need_hh22_p ? RS1 (upper_dstreg) : 0)
-			       | RD (upper_dstreg)
-			       | IMMED
-			       | (upper32
-				  & (need_hh22_p ? 0x3ff : 0x1fff)));
-	    the_insn.reloc = (the_insn.exp.X_op != O_constant
-			      ? BFD_RELOC_SPARC_HM10 : BFD_RELOC_NONE);
-	    output_insn (insn, &the_insn);
-	  }
-
-	if (need_hi22_p)
-	  {
-	    the_insn.opcode = (SETHI_INSN | RD (dstreg)
-			       | ((lower32 >> 10) & 0x3fffff));
-	    the_insn.reloc = BFD_RELOC_HI22;
-	    output_insn (insn, &the_insn);
-	  }
-
-	if (need_lo10_p)
-	  {
-	    /* FIXME: One nice optimization to do here is to OR the low part
-	       with the highpart if hi22 isn't needed and the low part is
-	       positive.  */
-	    the_insn.opcode = (OR_INSN | (need_hi22_p ? RS1 (dstreg) : 0)
-			       | RD (dstreg)
-			       | IMMED
-			       | (lower32
-				  & (need_hi22_p ? 0x3ff : 0x1fff)));
-	    the_insn.reloc = BFD_RELOC_LO10;
-	    output_insn (insn, &the_insn);
-	  }
-
-	/* If we needed to build the upper part, shift it into place.  */
-	if (need_hh22_p || need_hm10_p)
-	  {
-	    the_insn.opcode = (SLLX_INSN | RS1 (upper_dstreg) | RD (upper_dstreg)
-			       | IMMED | 32);
-	    the_insn.reloc = BFD_RELOC_NONE;
-	    output_insn (insn, &the_insn);
-	  }
-
-	/* If we needed to build both upper and lower parts, OR them together.  */
-	if ((need_hh22_p || need_hm10_p)
-	    && (need_hi22_p || need_lo10_p))
-	  {
-	    the_insn.opcode = (OR_INSN | RS1 (dstreg) | RS2 (upper_dstreg)
-			       | RD (dstreg));
-	    the_insn.reloc = BFD_RELOC_NONE;
-	    output_insn (insn, &the_insn);
-	  }
-	/* We didn't need both regs, but we may have to sign extend lower32.  */
-	else if (need_hi22_p && upper32 == -1)
-	  {
-	    the_insn.opcode = (SRA_INSN | RS1 (dstreg) | RD (dstreg)
-			       | IMMED | 0);
-	    the_insn.reloc = BFD_RELOC_NONE;
-	    output_insn (insn, &the_insn);
-	  }
-	break;
-      }
-
+      synthetize_setx (insn);
+      break;
+      
     case SPECIAL_CASE_FDIV:
       {
 	int rd = (the_insn.opcode >> 25) & 0x1f;
-
+    
 	output_insn (insn, &the_insn);
-
+    
 	/* According to information leaked from Sun, the "fdiv" instructions
 	   on early SPARC machines would produce incorrect results sometimes.
 	   The workaround is to add an fmovs of the destination register to
@@ -1138,9 +1271,9 @@
 	assert (the_insn.reloc == BFD_RELOC_NONE);
 	the_insn.opcode = FMOVS_INSN | rd | RD (rd);
 	output_insn (insn, &the_insn);
-	break;
+	return;
       }
-
+    
     default:
       as_fatal (_("failed special case insn sanity check"));
     }
@@ -1148,7 +1281,7 @@
 
 /* Subroutine of md_assemble to do the actual parsing.  */
 
-static void
+static int
 sparc_ip (str, pinsn)
      char *str;
      const struct sparc_opcode **pinsn;
@@ -1164,6 +1297,7 @@
   int match = 0;
   int comma = 0;
   int v9_arg_p;
+  int special_case = SPECIAL_CASE_NONE;
 
   s = str;
   if (islower ((unsigned char) *s))
@@ -1195,7 +1329,7 @@
   if (insn == NULL)
     {
       as_bad (_("Unknown opcode: `%s'"), str);
-      return;
+      return special_case;
     }
   if (comma)
     {
@@ -1654,7 +1788,8 @@
 		      goto error;
 
 		    case 'g':	/* global register */
-		      if (isoctal (c = *s++))
+		      c = *s++;
+		      if (isoctal (c))
 			{
 			  mask = c - '0';
 			  break;
@@ -1662,7 +1797,8 @@
 		      goto error;
 
 		    case 'i':	/* in register */
-		      if (isoctal (c = *s++))
+		      c = *s++;
+		      if (isoctal (c))
 			{
 			  mask = c - '0' + 24;
 			  break;
@@ -1670,7 +1806,8 @@
 		      goto error;
 
 		    case 'l':	/* local register */
-		      if (isoctal (c = *s++))
+		      c = *s++;
+		      if (isoctal (c))
 			{
 			  mask = (c - '0' + 16);
 			  break;
@@ -1678,7 +1815,8 @@
 		      goto error;
 
 		    case 'o':	/* out register */
-		      if (isoctal (c = *s++))
+		      c = *s++;
+		      if (isoctal (c))
 			{
 			  mask = (c - '0' + 8);
 			  break;
@@ -1854,14 +1992,10 @@
 		}
 	      break;
 
-	    case '0':		/* 64 bit immediate (setx insn) */
+	    case '0':		/* 64 bit immediate (set, setsw, setx insn) */
 	      the_insn.reloc = BFD_RELOC_NONE; /* reloc handled elsewhere */
 	      goto immediate;
 
-	    case 'h':		/* high 22 bits */
-	      the_insn.reloc = BFD_RELOC_HI22;
-	      goto immediate;
-
 	    case 'l':		/* 22 bit PC relative immediate */
 	      the_insn.reloc = BFD_RELOC_SPARC_WDISP22;
 	      the_insn.pcrel = 1;
@@ -1872,6 +2006,7 @@
 	      the_insn.pcrel = 1;
 	      goto immediate;
 
+	    case 'h':
 	    case 'n':		/* 22 bit immediate */
 	      the_insn.reloc = BFD_RELOC_SPARC22;
 	      goto immediate;
@@ -1885,89 +2020,224 @@
 	      if (*s == ' ')
 		s++;
 
-	      /* Check for %hi, etc.  */
-	      if (*s == '%')
-		{
-		  static struct ops {
-		    /* The name as it appears in assembler.  */
-		    char *name;
-		    /* strlen (name), precomputed for speed */
-		    int len;
-		    /* The reloc this pseudo-op translates to.  */
-		    int reloc;
-		    /* Non-zero if for v9 only.  */
-		    int v9_p;
-		    /* Non-zero if can be used in pc-relative contexts.  */
-		    int pcrel_p;/*FIXME:wip*/
-		  } ops[] = {
-		    /* hix/lox must appear before hi/lo so %hix won't be
-		       mistaken for %hi.  */
-		    { "hix", 3, BFD_RELOC_SPARC_HIX22, 1, 0 },
-		    { "lox", 3, BFD_RELOC_SPARC_LOX10, 1, 0 },
-		    { "hi", 2, BFD_RELOC_HI22, 0, 1 },
-		    { "lo", 2, BFD_RELOC_LO10, 0, 1 },
-		    { "hh", 2, BFD_RELOC_SPARC_HH22, 1, 1 },
-		    { "hm", 2, BFD_RELOC_SPARC_HM10, 1, 1 },
-		    { "lm", 2, BFD_RELOC_SPARC_LM22, 1, 1 },
-		    { "h44", 3, BFD_RELOC_SPARC_H44, 1, 0 },
-		    { "m44", 3, BFD_RELOC_SPARC_M44, 1, 0 },
-		    { "l44", 3, BFD_RELOC_SPARC_L44, 1, 0 },
-		    { "uhi", 3, BFD_RELOC_SPARC_HH22, 1, 0 },
-		    { "ulo", 3, BFD_RELOC_SPARC_HM10, 1, 0 },
-		    { NULL }
-		  };
-		  struct ops *o;
-
-		  for (o = ops; o->name; o++)
-		    if (strncmp (s + 1, o->name, o->len) == 0)
-		      break;
-		  if (o->name == NULL)
-		    break;
-
-		  the_insn.reloc = o->reloc;
-		  s += o->len + 1;
-		  v9_arg_p = o->v9_p;
-		}
-
-	      /* Note that if the get_expression() fails, we will still
-		 have created U entries in the symbol table for the
-		 'symbols' in the input string.  Try not to create U
-		 symbols for registers, etc.  */
 	      {
+		char *s1;
+		char *op_arg = NULL;
+		expressionS op_exp;
+		bfd_reloc_code_real_type old_reloc = the_insn.reloc;
+
+		/* Check for %hi, etc.  */
+		if (*s == '%')
+		  {
+		    static const struct ops {
+		      /* The name as it appears in assembler.  */
+		      char *name;
+		      /* strlen (name), precomputed for speed */
+		      int len;
+		      /* The reloc this pseudo-op translates to.  */
+		      int reloc;
+		      /* Non-zero if for v9 only.  */
+		      int v9_p;
+		      /* Non-zero if can be used in pc-relative contexts.  */
+		      int pcrel_p;/*FIXME:wip*/
+		    } ops[] = {
+		      /* hix/lox must appear before hi/lo so %hix won't be
+			 mistaken for %hi.  */
+		      { "hix", 3, BFD_RELOC_SPARC_HIX22, 1, 0 },
+		      { "lox", 3, BFD_RELOC_SPARC_LOX10, 1, 0 },
+		      { "hi", 2, BFD_RELOC_HI22, 0, 1 },
+		      { "lo", 2, BFD_RELOC_LO10, 0, 1 },
+		      { "hh", 2, BFD_RELOC_SPARC_HH22, 1, 1 },
+		      { "hm", 2, BFD_RELOC_SPARC_HM10, 1, 1 },
+		      { "lm", 2, BFD_RELOC_SPARC_LM22, 1, 1 },
+		      { "h44", 3, BFD_RELOC_SPARC_H44, 1, 0 },
+		      { "m44", 3, BFD_RELOC_SPARC_M44, 1, 0 },
+		      { "l44", 3, BFD_RELOC_SPARC_L44, 1, 0 },
+		      { "uhi", 3, BFD_RELOC_SPARC_HH22, 1, 0 },
+		      { "ulo", 3, BFD_RELOC_SPARC_HM10, 1, 0 },
+		      { NULL }
+		    };
+		    const struct ops *o;
+  
+		    for (o = ops; o->name; o++)
+		      if (strncmp (s + 1, o->name, o->len) == 0)
+			break;
+		    if (o->name == NULL)
+		      break;
+		      
+		    if (s[o->len + 1] != '(')
+		      {
+			as_bad (_("Illegal operands: %%%s requires arguments in ()"), o->name);
+			return special_case;
+		      }
+
+		    op_arg = o->name;
+		    the_insn.reloc = o->reloc;
+		    s += o->len + 2;
+		    v9_arg_p = o->v9_p;
+		  }
+
+		/* Note that if the get_expression() fails, we will still
+		   have created U entries in the symbol table for the
+		   'symbols' in the input string.  Try not to create U
+		   symbols for registers, etc.  */
+
 		/* This stuff checks to see if the expression ends in
 		   +%reg.  If it does, it removes the register from
 		   the expression, and re-sets 's' to point to the
 		   right place.  */
 
-		char *s1;
+		if (op_arg)
+		  {
+		    int npar = 0;
+
+		    for (s1 = s; *s1 && *s1 != ',' && *s1 != ']'; s1++)
+		      if (*s1 == '(')
+			npar++;
+		      else if (*s1 == ')')
+			{
+			  if (!npar)
+			    break;
+			  npar--;
+			}
+
+		    if (*s1 != ')')
+		      {
+			as_bad (_("Illegal operands: %%%s requires arguments in ()"), op_arg);
+			return special_case;
+		      }
+		    
+		    *s1 = '\0';
+		    (void) get_expression (s);
+		    *s1 = ')';
+		    s = s1 + 1;
+		    if (*s == ',' || *s == ']' || !*s)
+		      continue;
+		    if (*s != '+' && *s != '-')
+		      {
+			as_bad (_("Illegal operands: Can't do arithmetics other than + and - involving %%%s()"), op_arg);
+			return special_case;
+		      }
+		    *s1 = '0';
+		    s = s1;
+		    op_exp = the_insn.exp;
+		    memset (&the_insn.exp, 0, sizeof(the_insn.exp));
+		  }
 
 		for (s1 = s; *s1 && *s1 != ',' && *s1 != ']'; s1++) ;
 
 		if (s1 != s && isdigit ((unsigned char) s1[-1]))
 		  {
 		    if (s1[-2] == '%' && s1[-3] == '+')
-		      {
-			s1 -= 3;
-			*s1 = '\0';
-			(void) get_expression (s);
-			*s1 = '+';
-			s = s1;
-			continue;
-		      }
+		      s1 -= 3;
 		    else if (strchr ("goli0123456789", s1[-2]) && s1[-3] == '%' && s1[-4] == '+')
+		      s1 -= 4;
+		    else
+		      s1 = NULL;
+		    if (s1)
 		      {
-			s1 -= 4;
 			*s1 = '\0';
 			(void) get_expression (s);
 			*s1 = '+';
+			if (op_arg)
+			  *s = ')';
 			s = s1;
-			continue;
+		      }
+		  }
+		else
+		  s1 = NULL;
+
+		if (!s1)
+		  {
+		    (void) get_expression (s);
+		    if (op_arg)
+		      *s = ')';
+		    s = expr_end;
+		  }
+
+		if (op_arg)
+		  {
+		    the_insn.exp2 = the_insn.exp;
+		    the_insn.exp = op_exp;
+		    if (the_insn.exp2.X_op == O_absent)
+		      the_insn.exp2.X_op = O_illegal;
+		    else if (the_insn.exp.X_op == O_absent)
+		      {
+			the_insn.exp = the_insn.exp2;
+			the_insn.exp2.X_op = O_illegal;
+		      }
+		    else if (the_insn.exp.X_op == O_constant)
+		      {
+			valueT val = the_insn.exp.X_add_number;
+			switch (the_insn.reloc)
+			  {
+			  default:
+			    break;
+
+			  case BFD_RELOC_SPARC_HH22:
+			    val = BSR (val, 32);
+			    /* intentional fallthrough */
+
+			  case BFD_RELOC_SPARC_LM22:
+			  case BFD_RELOC_HI22:
+			    val = (val >> 10) & 0x3fffff;
+			    break;
+
+			  case BFD_RELOC_SPARC_HM10:
+			    val = BSR (val, 32);
+			    /* intentional fallthrough */
+
+			  case BFD_RELOC_LO10:
+			    val &= 0x3ff;
+			    break;
+
+			  case BFD_RELOC_SPARC_H44:
+			    val >>= 22;
+			    val &= 0x3fffff;
+			    break;
+
+			  case BFD_RELOC_SPARC_M44:
+			    val >>= 12;
+			    val &= 0x3ff;
+			    break;
+
+			  case BFD_RELOC_SPARC_L44:
+			    val &= 0xfff;
+			    break;
+
+			  case BFD_RELOC_SPARC_HIX22:
+			    val = ~ val;
+			    val = (val >> 10) & 0x3fffff;
+			    break;
+
+			  case BFD_RELOC_SPARC_LOX10:
+			    val = (val & 0x3ff) | 0x1c00;
+			    break;
+			  }
+			the_insn.exp = the_insn.exp2;
+			the_insn.exp.X_add_number += val;
+			the_insn.exp2.X_op = O_illegal;
+			the_insn.reloc = old_reloc;
+		      }
+		    else if (the_insn.exp2.X_op != O_constant)
+		      {
+			as_bad (_("Illegal operands: Can't add non-constant expression to %%%s()"), op_arg);
+			return special_case;
+		      }
+		    else
+		      {
+			if (old_reloc != BFD_RELOC_SPARC13
+			    || the_insn.reloc != BFD_RELOC_LO10
+			    || sparc_arch_size != 64
+			    || sparc_pic_code)
+			  {
+			    as_bad (_("Illegal operands: Can't do arithmetics involving %%%s() of a relocatable symbol"), op_arg);
+			    return special_case;
+			  }
+			the_insn.reloc = BFD_RELOC_SPARC_OLO10;
 		      }
 		  }
 	      }
-	      (void) get_expression (s);
-	      s = expr_end;
-
 	      /* Check for constants that don't require emitting a reloc.  */
 	      if (the_insn.exp.X_op == O_constant
 		  && the_insn.exp.X_add_symbol == 0
@@ -2176,7 +2446,7 @@
 	  else
 	    {
 	      as_bad (_("Illegal operands%s"), error_message);
-	      return;
+	      return special_case;
 	    }
 	}
       else
@@ -2244,7 +2514,7 @@
 	      as_tsktsk (_(" (Requires %s; requested architecture is %s.)"),
 			 required_archs,
 			 sparc_opcode_archs[max_architecture].name);
-	      return;
+	      return special_case;
 	    }
 	} /* if no match */
 
@@ -2252,6 +2522,7 @@
     } /* forever looking for a match */
 
   the_insn.opcode = opcode;
+  return special_case;
 }
 
 /* Parse an argument that can be expressed as a keyword.
@@ -2374,6 +2645,8 @@
 	 the insn size is 4 and fixup_segment will signal an overflow for
 	 large 8 byte quantities.  */
       fixP->fx_no_overflow = 1;
+      if (the_insn->reloc == BFD_RELOC_SPARC_OLO10)
+	fixP->tc_fix_data = the_insn->exp2.X_add_number;
     }
 
   last_insn = insn;
@@ -2504,7 +2777,7 @@
      don't want to include the value of an externally visible symbol.  */
   if (fixP->fx_addsy != NULL)
     {
-      if (fixP->fx_addsy->sy_used_in_reloc
+      if (symbol_used_in_reloc_p (fixP->fx_addsy)
 	  && (S_IS_EXTERNAL (fixP->fx_addsy)
 	      || S_IS_WEAK (fixP->fx_addsy)
 	      || (sparc_pic_code && ! fixP->fx_pcrel)
@@ -2549,7 +2822,7 @@
       && fixP->fx_r_type != BFD_RELOC_32_PCREL_S2
       && fixP->fx_addsy != NULL
       && ! S_IS_COMMON (fixP->fx_addsy)
-      && (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) == 0)
+      && symbol_section_p (fixP->fx_addsy))
     fixP->fx_addnumber -= 2 * S_GET_VALUE (fixP->fx_addsy);
 
   /* When generating PIC code, we need to fiddle to get
@@ -2606,7 +2879,7 @@
 	     being done!  */
 	  if (! sparc_pic_code
 	      || fixP->fx_addsy == NULL
-	      || (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0)
+	      || symbol_section_p (fixP->fx_addsy))
 	    ++val;
 	  insn |= val & 0x3fffffff;
 	  break;
@@ -2708,6 +2981,11 @@
 	    }
 	  break;
 
+	case BFD_RELOC_SPARC_OLO10:
+	  val &= 0x3ff;
+	  val += fixP->tc_fix_data;
+	  /* intentional fallthrough */
+
 	case BFD_RELOC_SPARC13:
 	  if (! in_signed_range (val, 0x1fff))
 	    as_bad_where (fixP->fx_file, fixP->fx_line,
@@ -2777,17 +3055,20 @@
 
 /* Translate internal representation of relocation info to BFD target
    format.  */
-arelent *
+arelent **
 tc_gen_reloc (section, fixp)
      asection *section;
      fixS *fixp;
 {
+  static arelent *relocs[3];
   arelent *reloc;
   bfd_reloc_code_real_type code;
 
-  reloc = (arelent *) xmalloc (sizeof (arelent));
+  relocs[0] = reloc = (arelent *) xmalloc (sizeof (arelent));
+  relocs[1] = NULL;
 
-  reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
 
   switch (fixp->fx_r_type)
@@ -2798,6 +3079,7 @@
     case BFD_RELOC_LO10:
     case BFD_RELOC_32_PCREL_S2:
     case BFD_RELOC_SPARC13:
+    case BFD_RELOC_SPARC22:
     case BFD_RELOC_SPARC_BASE13:
     case BFD_RELOC_SPARC_WDISP16:
     case BFD_RELOC_SPARC_WDISP19:
@@ -2820,6 +3102,7 @@
     case BFD_RELOC_SPARC_HIX22:
     case BFD_RELOC_SPARC_LOX10:
     case BFD_RELOC_SPARC_REV32:
+    case BFD_RELOC_SPARC_OLO10:
     case BFD_RELOC_VTABLE_ENTRY:
     case BFD_RELOC_VTABLE_INHERIT:
       code = fixp->fx_r_type;
@@ -2873,13 +3156,18 @@
     }
 #endif /* defined (OBJ_ELF) || defined (OBJ_AOUT) */
 
-  reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
+  if (code == BFD_RELOC_SPARC_OLO10)
+    reloc->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO10);
+  else
+    reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
   if (reloc->howto == 0)
     {
       as_bad_where (fixp->fx_file, fixp->fx_line,
 		    _("internal error: can't export reloc type %d (`%s')"),
 		    fixp->fx_r_type, bfd_get_reloc_code_name (code));
-      return 0;
+      xfree (reloc);
+      relocs[0] = NULL;
+      return relocs;
     }
 
   /* @@ Why fx_addnumber sometimes and fx_offset other times?  */
@@ -2906,7 +3194,7 @@
       || code == BFD_RELOC_SPARC_PC10
       || code == BFD_RELOC_SPARC_PC22)
     reloc->addend = fixp->fx_addnumber;
-  else if ((fixp->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0)
+  else if (symbol_section_p (fixp->fx_addsy))
     reloc->addend = (section->vma
 		     + fixp->fx_addnumber
 		     + md_pcrel_from (fixp));
@@ -2914,7 +3202,21 @@
     reloc->addend = fixp->fx_offset;
 #endif
 
-  return reloc;
+  /* We expand R_SPARC_OLO10 to R_SPARC_LO10 and R_SPARC_13
+     on the same location.  */
+  if (code == BFD_RELOC_SPARC_OLO10)
+    {
+      relocs[1] = reloc = (arelent *) xmalloc (sizeof (arelent));
+      relocs[2] = NULL;
+
+      reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+      *reloc->sym_ptr_ptr = symbol_get_bfdsym (section_symbol (absolute_section));
+      reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
+      reloc->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_SPARC13);
+      reloc->addend = fixp->tc_fix_data;
+    }
+
+  return relocs;
 }
 
 /* We have no need to default values of symbols. */
@@ -2961,7 +3263,7 @@
   ret = fixP->fx_where + fixP->fx_frag->fr_address;
   if (! sparc_pic_code
       || fixP->fx_addsy == NULL
-      || (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0)
+      || symbol_section_p (fixP->fx_addsy))
     ret += fixP->fx_size;
   return ret;
 }
@@ -3110,9 +3412,9 @@
 
 	  /* detach from old frag */
 	  if (S_GET_SEGMENT(symbolP) == bss_section)
-	    symbolP->sy_frag->fr_symbol = NULL;
+	    symbol_get_frag (symbolP)->fr_symbol = NULL;
 
-	  symbolP->sy_frag = frag_now;
+	  symbol_set_frag (symbolP, frag_now);
 	  pfrag = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
 			    (offsetT) size, (char *)0);
 	  *pfrag = 0;
@@ -3189,7 +3491,7 @@
       S_SET_EXTERNAL (symbolP);
 #endif
     }
-  know (symbolP->sy_frag == &zero_address_frag);
+  know (symbol_get_frag (symbolP) == &zero_address_frag);
   if (*input_line_pointer != ',')
     {
       as_bad (_("Expected comma after common length"));
@@ -3218,7 +3520,7 @@
 	}
 
 #ifdef OBJ_ELF
-      if (symbolP->local)
+      if (symbol_get_obj (symbolP)->local)
 	{
 	  segT old_sec;
 	  int old_subsec;
@@ -3245,8 +3547,8 @@
 	  if (align)
 	    frag_align (align, 0, 0);
 	  if (S_GET_SEGMENT (symbolP) == bss_section)
-	    symbolP->sy_frag->fr_symbol = 0;
-	  symbolP->sy_frag = frag_now;
+	    symbol_get_frag (symbolP)->fr_symbol = 0;
+	  symbol_set_frag (symbolP, frag_now);
 	  p = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP,
 			(offsetT) size, (char *) 0);
 	  *p = 0;
@@ -3289,7 +3591,7 @@
     }
 
 #ifdef BFD_ASSEMBLER
-  symbolP->bsym->flags |= BSF_OBJECT;
+  symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT;
 #endif
 
   demand_empty_rest_of_line ();
@@ -3394,6 +3696,17 @@
   cons (bytes);
 }
 
+/* This handles the native word allocation pseudo-op .nword.
+   For sparc_arch_size 32 it is equivalent to .word,  for
+   sparc_arch_size 64 it is equivalent to .xword.  */
+
+static void
+s_ncons (bytes)
+     int bytes;
+{
+  cons (sparc_arch_size == 32 ? 4 : 8);
+}
+
 /* If the --enforce-aligned-data option is used, we require .word,
    et. al., to be aligned correctly.  We do it by setting up an
    rs_align_code frag, and checking in HANDLE_ALIGN to make sure that
diff --git a/gas/config/tc-sparc.h b/gas/config/tc-sparc.h
index 2a05764..40ab02c8 100644
--- a/gas/config/tc-sparc.h
+++ b/gas/config/tc-sparc.h
@@ -35,6 +35,9 @@
 extern const char *sparc_target_format PARAMS ((void));
 #define TARGET_FORMAT sparc_target_format ()
 
+#define RELOC_EXPANSION_POSSIBLE
+#define MAX_RELOC_EXPANSION 2
+
 #if 0
 #ifdef TE_SPARCAOUT
 /* Bi-endian support may eventually be unconditional, but until things are
@@ -57,7 +60,7 @@
 
 #define md_do_align(n, fill, len, max, around)				\
 if ((n) && (n) <= 10 && !need_pass_2 && !(fill)				\
-    && now_seg != data_section && now_seg != bss_section)		\
+    && subseg_text_p (now_seg))						\
   {									\
     char *p;								\
     p = frag_var (rs_align_code, 1 << n, 1, (relax_substateT) 1024,	\
@@ -129,8 +132,7 @@
        || ((FIX)->fx_subsy != NULL					\
 	   && (S_GET_SEGMENT ((FIX)->fx_subsy)				\
 	       == S_GET_SEGMENT ((FIX)->fx_addsy)))			\
-       || strchr (S_GET_NAME ((FIX)->fx_addsy), '\001') != NULL		\
-       || strchr (S_GET_NAME ((FIX)->fx_addsy), '\002') != NULL))
+       || S_IS_LOCAL ((FIX)->fx_addsy)))
 #endif
 
 #ifdef OBJ_AOUT
@@ -161,4 +163,21 @@
 extern void cons_fix_new_sparc
   PARAMS ((struct frag *, int, unsigned int, struct expressionS *));
 
+#define TC_FIX_TYPE	valueT
+
+#define TC_INIT_FIX_DATA(X)			\
+  do						\
+     {						\
+       (X)->tc_fix_data = 0;			\
+     }						\
+  while(0)
+
+#define TC_FIX_DATA_PRINT(FILE, FIXP)					\
+  do									\
+    {									\
+      fprintf((FILE), "addend2=%ld\n",   				\
+	      (unsigned long) (FIXP)->tc_fix_data);			\
+    }									\
+  while(0)
+
 /* end of tc-sparc.h */
diff --git a/gas/config/tc-tahoe.c b/gas/config/tc-tahoe.c
index 2bd63ca..26a7524 100644
--- a/gas/config/tc-tahoe.c
+++ b/gas/config/tc-tahoe.c
@@ -1611,7 +1611,7 @@
   segT to_seg;			/* Target segment of the address.	 */
 
   register valueT this_add_number;
-  register struct symbol *this_add_symbol;	/* +ve (minuend) symbol. */
+  register symbolS *this_add_symbol;	/* +ve (minuend) symbol. */
 
   /*  tahoe_opcodeT opcode_as_number; fixme: remove this line *//* The opcode as a number. */
   char *opcodeP;		/* Where it is in a frag. */
diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c
index 61ed905..255c06a 100644
--- a/gas/config/tc-tic30.c
+++ b/gas/config/tc-tic30.c
@@ -1,5 +1,5 @@
 /* tc-c30.c -- Assembly code for the Texas Instruments TMS320C30
-   Copyright (C) 1998 Free Software Foundation.
+   Copyright (C) 1998, 1999 Free Software Foundation.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
    This file is part of GAS, the GNU Assembler.
@@ -1842,7 +1842,8 @@
 
   rel = (arelent *) xmalloc (sizeof (arelent));
   assert (rel != 0);
-  rel->sym_ptr_ptr = &fixP->fx_addsy->bsym;
+  rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *rel->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
   rel->address = fixP->fx_frag->fr_address + fixP->fx_where;
   if (fixP->fx_pcrel)
     rel->addend = fixP->fx_addnumber;
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index c8ab145..c8d308c 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -1,5 +1,5 @@
 /* tc-v850.c -- Assembler code for the NEC V850
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -297,7 +297,7 @@
 	}
     }
   
-  know (symbolP->sy_frag == & zero_address_frag);
+  know (symbol_get_frag (symbolP) == & zero_address_frag);
   
   if (*input_line_pointer != ',')
     have_align = 0;
@@ -323,7 +323,7 @@
 	    }
 	}
       
-      if (symbolP->local)
+      if (symbol_get_obj (symbolP)->local)
 	{
 	  segT   old_sec;
 	  int    old_subsec;
@@ -421,24 +421,24 @@
 	    {
 	    case AREA_SDA:
 	      if (S_GET_SEGMENT (symbolP) == sbss_section)
-		symbolP->sy_frag->fr_symbol = 0;
+		symbol_get_frag (symbolP)->fr_symbol = 0;
 	      break;
 
 	    case AREA_ZDA:
 	      if (S_GET_SEGMENT (symbolP) == zbss_section)
-		symbolP->sy_frag->fr_symbol = 0;
+		symbol_get_frag (symbolP)->fr_symbol = 0;
 	      break;
 
 	    case AREA_TDA:
 	      if (S_GET_SEGMENT (symbolP) == tbss_section)
-		symbolP->sy_frag->fr_symbol = 0;
+		symbol_get_frag (symbolP)->fr_symbol = 0;
 	      break;
 
 	    default:
-	      abort();
+	      abort ();
 	    }
 	  
-	  symbolP->sy_frag = frag_now;
+	  symbol_set_frag (symbolP, frag_now);
 	  pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP,
 			    (offsetT) size, (char *) 0);
 	  *pfrag = 0;
@@ -548,7 +548,7 @@
       goto allocate_common;
     }
 
-  symbolP->bsym->flags |= BSF_OBJECT;
+  symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT;
 
   demand_empty_rest_of_line ();
   return;
@@ -726,9 +726,9 @@
     {
       /* If the symbol is an alias for another name then use that.
 	 If the symbol is an alias for a number, then return the number.  */
-      if (symbolP->sy_value.X_op == O_symbol)
+      if (symbol_equated_p (symbolP))
 	{
-	  name = S_GET_NAME (symbolP->sy_value.X_add_symbol);
+	  name = S_GET_NAME (symbol_get_value_expression (symbolP)->X_add_symbol);
 	}
       else if (accept_numbers)
 	{
@@ -2243,7 +2243,8 @@
   arelent * reloc;
   
   reloc              = (arelent *) xmalloc (sizeof (arelent));
-  reloc->sym_ptr_ptr = & fixp->fx_addsy->bsym;
+  reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  *reloc->sym_ptr_ptr= symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address     = fixp->fx_frag->fr_address + fixp->fx_where;
   reloc->howto       = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
 
diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c
index 24e4a9b..f425ccc 100644
--- a/gas/config/tc-vax.c
+++ b/gas/config/tc-vax.c
@@ -1,5 +1,6 @@
 /* tc-vax.c - vax-specific -
-   Copyright (C) 1987, 91, 92, 93, 94, 95, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1987, 91, 92, 93, 94, 95, 98, 1999
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -335,7 +336,7 @@
   segT to_seg;
   valueT this_add_number;
   /* Positive (minuend) symbol. */
-  struct symbol *this_add_symbol;
+  symbolS *this_add_symbol;
   /* As a number. */
   long opcode_as_number;
   /* Least significant byte 1st. */
diff --git a/gas/config/tc-w65.c b/gas/config/tc-w65.c
index 72201e7..e57eb0f 100644
--- a/gas/config/tc-w65.c
+++ b/gas/config/tc-w65.c
@@ -1081,7 +1081,7 @@
 
 void
 tc_coff_symbol_emit_hook (x)
-    struct symbol *x;
+    symbolS *x;
 {
 }
 
diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c
index 1611341..f89b14b 100644
--- a/gas/config/tc-z8k.c
+++ b/gas/config/tc-z8k.c
@@ -1,5 +1,5 @@
 /* tc-z8k.c -- Assemble code for the Zilog Z800n
-   Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation.
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -1520,7 +1520,7 @@
 
 void
 tc_coff_symbol_emit_hook (s)
-     struct symbol *s;
+     symbolS *s;
 {
 }
 
diff --git a/gas/configure b/gas/configure
index b8eefe4..494d852 100755
--- a/gas/configure
+++ b/gas/configure
@@ -16,8 +16,12 @@
 ac_help="$ac_help
   --enable-static[=PKGS]  build static libraries [default=yes]"
 ac_help="$ac_help
+  --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
+ac_help="$ac_help
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
 ac_help="$ac_help
+  --disable-libtool-lock  force libtool not to do file locking"
+ac_help="$ac_help
   --enable-bfd-assembler  use BFD back end for writing object files"
 ac_help="$ac_help
     targets            alternative target configurations besides the primary"
@@ -47,6 +51,7 @@
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -161,6 +166,7 @@
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
+  --site-file=FILE        use FILE as the site file
   --version               print the version of autoconf that created configure
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -331,6 +337,11 @@
   -site=* | --site=* | --sit=*)
     site="$ac_optarg" ;;
 
+  -site-file | --site-file | --site-fil | --site-fi | --site-f)
+    ac_prev=sitefile ;;
+  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+    sitefile="$ac_optarg" ;;
+
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -496,12 +507,16 @@
 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+  if test -z "$CONFIG_SITE"; then
+    if test "x$prefix" != xNONE; then
+      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+    else
+      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+    fi
   fi
+else
+  CONFIG_SITE="$sitefile"
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
@@ -588,7 +603,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:592: checking host system type" >&5
+echo "configure:607: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -609,7 +624,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:613: checking target system type" >&5
+echo "configure:628: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -627,7 +642,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:631: checking build system type" >&5
+echo "configure:646: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -662,7 +677,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:666: checking for a BSD compatible install" >&5
+echo "configure:681: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -715,7 +730,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:719: checking whether build environment is sane" >&5
+echo "configure:734: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -772,7 +787,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:776: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:791: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -801,7 +816,7 @@
 
 PACKAGE=gas
 
-VERSION=2.9.4
+VERSION=2.9.5
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -818,7 +833,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:822: checking for working aclocal" >&5
+echo "configure:837: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -831,7 +846,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:835: checking for working autoconf" >&5
+echo "configure:850: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -844,7 +859,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:848: checking for working automake" >&5
+echo "configure:863: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -857,7 +872,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:861: checking for working autoheader" >&5
+echo "configure:876: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -870,7 +885,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:874: checking for working makeinfo" >&5
+echo "configure:889: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -930,10 +945,33 @@
   enable_static=yes
 fi
 
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+  enable_fast_install=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_fast_install=yes
+fi
+
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:937: checking for $ac_word" >&5
+echo "configure:975: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -963,7 +1001,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:967: checking for $ac_word" >&5
+echo "configure:1005: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -993,7 +1031,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:997: checking for $ac_word" >&5
+echo "configure:1035: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1044,7 +1082,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1048: checking for $ac_word" >&5
+echo "configure:1086: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1076,7 +1114,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1080: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1118: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1087,12 +1125,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1091 "configure"
+#line 1129 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1118,12 +1156,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1122: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1160: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1127: checking whether we are using GNU C" >&5
+echo "configure:1165: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1132,7 +1170,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1151,7 +1189,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1155: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1193: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1190,18 +1228,23 @@
   with_gnu_ld=no
 fi
 
-
 ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1199: checking for ld used by GCC" >&5
+echo "configure:1236: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
-  # Accept absolute paths.
-  /* | [A-Za-z]:\\*)
-    test -z "$LD" && LD="$ac_prog"
-    ;;
+    # Accept absolute paths.
+    /* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
   "")
     # If it fails, then pretend we aren't using GCC.
     ac_prog=ld
@@ -1213,10 +1256,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1217: checking for GNU ld" >&5
+echo "configure:1260: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1220: checking for non-GNU ld" >&5
+echo "configure:1263: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1233,7 +1276,7 @@
       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
 	test "$with_gnu_ld" != no && break
       else
-        test "$with_gnu_ld" != yes && break
+	test "$with_gnu_ld" != yes && break
       fi
     fi
   done
@@ -1252,7 +1295,7 @@
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1256: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1299: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1268,7 +1311,7 @@
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1272: checking for BSD-compatible nm" >&5
+echo "configure:1315: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1277,20 +1320,22 @@
   ac_cv_path_NM="$NM"
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/nm; then
       # Check to see if the nm accepts a BSD-compat flag.
       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
       #   nm: unknown option "B" ignored
       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-        ac_cv_path_NM="$ac_dir/nm -B"
+	ac_cv_path_NM="$ac_dir/nm -B"
+	break
       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-        ac_cv_path_NM="$ac_dir/nm -p"
+	ac_cv_path_NM="$ac_dir/nm -p"
+	break
       else
-        ac_cv_path_NM="$ac_dir/nm"
+	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+	continue # so that we can try to find one that supports BSD flags
       fi
-      break
     fi
   done
   IFS="$ac_save_ifs"
@@ -1302,8 +1347,212 @@
 echo "$ac_t""$NM" 1>&6
 
 
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
+echo "configure:1353: checking command to parse $NM output" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix.  What could be older than Ultrix?!! ;)}
+
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+  ac_symcode='[BCDT]'
+  ;;
+cygwin* | mingw*)
+  ac_symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+  ;;
+irix*)
+  ac_symcode='[BCDEGRST]'
+  ;;
+solaris*)
+  ac_symcode='[BDT]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+  ac_symcode='[ABCDGISTW]'
+fi
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* 	\($ac_symcode\) 	 	*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  ac_pipe_works=no
+  rm -f conftest.$ac_ext
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+  if { (eval echo configure:1416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+    # Now try to grab the symbols.
+    ac_nlist=conftest.nm
+  
+    if { (eval echo configure:1420: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+
+      # Try sorting and uniquifying the output.
+      if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+	mv -f "$ac_nlist"T "$ac_nlist"
+      else
+	rm -f "$ac_nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+	if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+	  cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+	  cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+	cat <<\EOF >> conftest.c
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftestm.$ac_objext
+	  ac_save_LIBS="$LIBS"
+	  ac_save_CFLAGS="$CFLAGS"
+	  LIBS="conftestm.$ac_objext"
+	  CFLAGS="$CFLAGS$no_builtin_flag"
+	  if { (eval echo configure:1472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+	    ac_pipe_works=yes
+	  else
+	    echo "configure: failed program was:" >&5
+	    cat conftest.c >&5
+	  fi
+	  LIBS="$ac_save_LIBS"
+	  CFLAGS="$ac_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $ac_nlist" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $ac_nlist" >&5
+      fi
+    else
+      echo "cannot run $ac_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.c >&5
+  fi
+  rm -rf conftest*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$ac_pipe_works" = yes; then
+    if test x"$ac_symprfx" = x"_"; then
+      ac_cv_sys_symbol_underscore=yes
+    else
+      ac_cv_sys_symbol_underscore=no
+    fi
+    break
+  else
+    ac_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+   ac_result=no
+fi
+echo "$ac_t""$ac_result" 1>&6
+
+echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
+echo "configure:1518: checking for _ prefix in compiled symbols" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_sys_symbol_underscore=no
+cat > conftest.$ac_ext <<EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+EOF
+if { (eval echo configure:1527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  # Now try to grab the symbols.
+  ac_nlist=conftest.nm
+  if { (eval echo configure:1530: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+    # See whether the symbols have a leading underscore.
+    if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+      ac_cv_sys_symbol_underscore=yes
+    else
+      if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+	:
+      else
+	echo "configure: cannot find nm_test_func in $ac_nlist" >&5
+      fi
+    fi
+  else
+    echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&5
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.c >&5
+fi
+rm -rf conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_sys_symbol_underscore" 1>&6
+USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
+
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1307: checking whether ln -s works" >&5
+echo "configure:1556: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1329,13 +1578,13 @@
   ac_tool_prefix=
 fi
 
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 # Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
@@ -1345,8 +1594,8 @@
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1349 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1598 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1364,14 +1613,45 @@
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
+  echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:1620: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1625 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  lt_cv_cc_needs_belf=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
   ;;
 
 *-*-cygwin*)
   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1375: checking for $ac_word" >&5
+echo "configure:1655: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1403,7 +1683,7 @@
   # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1407: checking for $ac_word" >&5
+echo "configure:1687: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1438,7 +1718,7 @@
 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
 set dummy ${ac_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1442: checking for $ac_word" >&5
+echo "configure:1722: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1470,7 +1750,7 @@
   # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1474: checking for $ac_word" >&5
+echo "configure:1754: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1507,6 +1787,71 @@
 
 esac
 
+# enable the --disable-libtool-lock switch
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+  need_locks=$enableval
+else
+  need_locks=yes
+fi
+
+
+if test x"$need_locks" = xno; then
+  libtool_flags="$libtool_flags --disable-lock"
+fi
+
+
+# Save cache, so that ltconfig can load it
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+
 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
@@ -1515,6 +1860,22 @@
 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
 
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
 # Redirect the config.log output again, so that the ltconfig log is not
 # clobbered by the next message.
 exec 5>>./config.log
@@ -1674,6 +2035,7 @@
       fr30-*-*)		    fmt=elf bfd_gas=yes ;;
 
       hppa-*-*elf*)         fmt=elf em=hppa ;;
+      hppa-*-linux-gnu*)    fmt=elf em=hppa ;;
       hppa-*-lites*)        fmt=elf em=hppa ;;
       hppa-*-osf*)          fmt=som em=hppa ;;
       hppa-*-rtems*)        fmt=elf em=hppa ;;
@@ -1698,8 +2060,9 @@
       i386-*-lynxos*)       fmt=coff em=lynx ;;
       i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
 			    fmt=elf bfd_gas=yes ;;
-      i386-*-freebsdelf*)   fmt=elf bfd_gas=yes ;;
-      i386-*-freebsd*)      fmt=aout em=386bsd ;;
+      i386-*-freebsdaout* | i386-*-freebsd12.* | i386-*-freebsd12)
+                            fmt=aout em=386bsd ;;
+      i386-*-freebsd*)	    fmt=elf bfd_gas=yes ;;
       i386-*-coff | i386-*-sysv* | i386-*-sco3.2v5*coff | i386-*-isc*)
                           fmt=coff ;;
       i386-*-sco3.2v5*)      fmt=elf
@@ -1714,6 +2077,7 @@
       i386-*-vsta)          fmt=aout ;;
       i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*)
 			    fmt=coff em=go32;;
+      i386-*-rtemself*)     fmt=elf ;;
       i386-*-rtems*)        fmt=coff ;;
       i386-*-gnu*)          fmt=elf ;;
       i386-*-mach*)
@@ -1732,6 +2096,7 @@
       i960-*-vxworks5.0)    fmt=bout ;;
       i960-*-vxworks5.*)    fmt=coff em=ic960 ;;
       i960-*-vxworks*)      fmt=bout ;;
+      i960-*-elf*)	    fmt=elf ;;
 
       m32r-*-*)		    fmt=elf bfd_gas=yes ;;
 
@@ -1814,9 +2179,11 @@
       ppc-*-macos* | ppc-*-mpw*)
 			    fmt=coff em=macos ;;
       ppc-*-netware*)       fmt=elf em=ppcnw ;;
+      ppc-*-vxworks*)       fmt=elf ;;
 
       sh-*-elf*)	    fmt=elf ;;
       sh-*-coff*)           fmt=coff ;;
+      sh-*-rtemself*)       fmt=elf ;;
       sh-*-rtems*)	    fmt=coff ;;
 
       ns32k-pc532-mach* | ns32k-pc532-ux*)    fmt=aout em=pc532mach ;;
@@ -2305,7 +2672,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2323: checking for $ac_word" >&5
+echo "configure:2676: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2335,7 +2702,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2353: checking for $ac_word" >&5
+echo "configure:2706: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2386,7 +2753,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2404: checking for $ac_word" >&5
+echo "configure:2757: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2418,7 +2785,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2436: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2789: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2429,12 +2796,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 2447 "configure"
+#line 2800 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2460,12 +2827,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2478: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2831: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2483: checking whether we are using GNU C" >&5
+echo "configure:2836: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2474,7 +2841,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2493,7 +2860,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2511: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2864: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2530,7 +2897,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2548: checking for $ac_word" >&5
+echo "configure:2901: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2561,7 +2928,7 @@
 test -n "$YACC" || YACC="yacc"
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2579: checking how to run the C preprocessor" >&5
+echo "configure:2932: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2576,13 +2943,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2594 "configure"
+#line 2947 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2593,13 +2960,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2611 "configure"
+#line 2964 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2610,13 +2977,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2628 "configure"
+#line 2981 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2646,7 +3013,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2664: checking for $ac_word" >&5
+echo "configure:3017: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2679,7 +3046,7 @@
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2697: checking for $ac_word" >&5
+echo "configure:3050: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2713,7 +3080,7 @@
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:2731: checking for yywrap in -l$ac_lib" >&5
+echo "configure:3084: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2721,7 +3088,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2739 "configure"
+#line 3092 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2732,7 +3099,7 @@
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:2750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2755,7 +3122,7 @@
 fi
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:2773: checking lex output file root" >&5
+echo "configure:3126: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2776,7 +3143,7 @@
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:2794: checking whether yytext is a pointer" >&5
+echo "configure:3147: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2788,14 +3155,14 @@
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 2806 "configure"
+#line 3159 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -2819,7 +3186,7 @@
 
 ALL_LINGUAS=
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:2837: checking for POSIXized ISC" >&5
+echo "configure:3190: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -2840,12 +3207,12 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2858: checking for ANSI C header files" >&5
+echo "configure:3211: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2863 "configure"
+#line 3216 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2853,7 +3220,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2870,7 +3237,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2888 "configure"
+#line 3241 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2888,7 +3255,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2906 "configure"
+#line 3259 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2909,7 +3276,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2927 "configure"
+#line 3280 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2920,7 +3287,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2944,12 +3311,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2962: checking for working const" >&5
+echo "configure:3315: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2967 "configure"
+#line 3320 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2998,7 +3365,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3019,21 +3386,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:3037: checking for inline" >&5
+echo "configure:3390: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 3044 "configure"
+#line 3397 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:3051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -3059,12 +3426,12 @@
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3077: checking for off_t" >&5
+echo "configure:3430: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3082 "configure"
+#line 3435 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3092,12 +3459,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3110: checking for size_t" >&5
+echo "configure:3463: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3115 "configure"
+#line 3468 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3127,19 +3494,19 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:3145: checking for working alloca.h" >&5
+echo "configure:3498: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3150 "configure"
+#line 3503 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:3157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -3160,12 +3527,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3178: checking for alloca" >&5
+echo "configure:3531: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3183 "configure"
+#line 3536 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -3193,7 +3560,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:3211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -3225,12 +3592,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3243: checking whether alloca needs Cray hooks" >&5
+echo "configure:3596: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3248 "configure"
+#line 3601 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -3255,12 +3622,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3273: checking for $ac_func" >&5
+echo "configure:3626: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3278 "configure"
+#line 3631 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3283,7 +3650,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3310,7 +3677,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3328: checking stack direction for C alloca" >&5
+echo "configure:3681: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3318,7 +3685,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 3336 "configure"
+#line 3689 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -3337,7 +3704,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:3355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -3362,17 +3729,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3380: checking for $ac_hdr" >&5
+echo "configure:3733: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3385 "configure"
+#line 3738 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3401,12 +3768,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3419: checking for $ac_func" >&5
+echo "configure:3772: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3424 "configure"
+#line 3777 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3429,7 +3796,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3454,7 +3821,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3472: checking for working mmap" >&5
+echo "configure:3825: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3462,7 +3829,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3480 "configure"
+#line 3833 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3602,7 +3969,7 @@
 }
 
 EOF
-if { (eval echo configure:3620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -3630,17 +3997,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3648: checking for $ac_hdr" >&5
+echo "configure:4001: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3653 "configure"
+#line 4006 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3670,12 +4037,12 @@
 __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3688: checking for $ac_func" >&5
+echo "configure:4041: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3693 "configure"
+#line 4046 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3698,7 +4065,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3727,12 +4094,12 @@
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3745: checking for $ac_func" >&5
+echo "configure:4098: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3750 "configure"
+#line 4103 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3755,7 +4122,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3789,19 +4156,19 @@
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3807: checking for LC_MESSAGES" >&5
+echo "configure:4160: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3812 "configure"
+#line 4165 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:3819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -3822,7 +4189,7 @@
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3840: checking whether NLS is requested" >&5
+echo "configure:4193: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -3842,7 +4209,7 @@
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3860: checking whether included gettext is requested" >&5
+echo "configure:4213: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -3861,17 +4228,17 @@
 
 	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3879: checking for libintl.h" >&5
+echo "configure:4232: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3884 "configure"
+#line 4237 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3888,19 +4255,19 @@
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:3906: checking for gettext in libc" >&5
+echo "configure:4259: checking for gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3911 "configure"
+#line 4264 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libc=yes
 else
@@ -3916,7 +4283,7 @@
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 	     echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3934: checking for bindtextdomain in -lintl" >&5
+echo "configure:4287: checking for bindtextdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3924,7 +4291,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3942 "configure"
+#line 4295 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3935,7 +4302,7 @@
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3951,19 +4318,19 @@
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3969: checking for gettext in libintl" >&5
+echo "configure:4322: checking for gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3974 "configure"
+#line 4327 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libintl=yes
 else
@@ -3991,7 +4358,7 @@
 	      # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4009: checking for $ac_word" >&5
+echo "configure:4362: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4025,12 +4392,12 @@
 		for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4043: checking for $ac_func" >&5
+echo "configure:4396: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4048 "configure"
+#line 4401 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4053,7 +4420,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4080,7 +4447,7 @@
 		# Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4098: checking for $ac_word" >&5
+echo "configure:4451: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4116,7 +4483,7 @@
 		# Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4134: checking for $ac_word" >&5
+echo "configure:4487: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4148,7 +4515,7 @@
 fi
 
 		cat > conftest.$ac_ext <<EOF
-#line 4166 "configure"
+#line 4519 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4156,7 +4523,7 @@
 			       return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:4174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
 		   DATADIRNAME=share
@@ -4188,7 +4555,7 @@
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4206: checking for $ac_word" >&5
+echo "configure:4559: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4222,7 +4589,7 @@
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4240: checking for $ac_word" >&5
+echo "configure:4593: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4258,7 +4625,7 @@
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4276: checking for $ac_word" >&5
+echo "configure:4629: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4348,7 +4715,7 @@
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:4366: checking for catalogs to be installed" >&5
+echo "configure:4719: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -4376,17 +4743,17 @@
       if test "$CATOBJEXT" = ".cat"; then
 	 ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:4394: checking for linux/version.h" >&5
+echo "configure:4747: checking for linux/version.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4399 "configure"
+#line 4752 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4449,7 +4816,7 @@
   
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4467: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4820: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -4472,12 +4839,12 @@
   
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:4490: checking for Cygwin environment" >&5
+echo "configure:4843: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4495 "configure"
+#line 4848 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4488,7 +4855,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:4506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -4505,19 +4872,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:4523: checking for mingw32 environment" >&5
+echo "configure:4876: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4528 "configure"
+#line 4881 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:4535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -4536,7 +4903,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:4554: checking for executable suffix" >&5
+echo "configure:4907: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4546,7 +4913,7 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:4564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:4917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -4571,17 +4938,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4589: checking for $ac_hdr" >&5
+echo "configure:4942: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4594 "configure"
+#line 4947 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4611,7 +4978,7 @@
 # Put this here so that autoconf's "cross-compiling" message doesn't confuse
 # people who are not cross-compiling but are compiling cross-assemblers.
 echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6
-echo "configure:4629: checking whether compiling a cross-assembler" >&5
+echo "configure:4982: checking whether compiling a cross-assembler" >&5
 if test "${host}" = "${target}"; then
   cross_gas=no
 else
@@ -4626,19 +4993,19 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:4644: checking for working alloca.h" >&5
+echo "configure:4997: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4649 "configure"
+#line 5002 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:4656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -4659,12 +5026,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:4677: checking for alloca" >&5
+echo "configure:5030: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4682 "configure"
+#line 5035 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -4692,7 +5059,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:4710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -4724,12 +5091,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:4742: checking whether alloca needs Cray hooks" >&5
+echo "configure:5095: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4747 "configure"
+#line 5100 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -4754,12 +5121,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4772: checking for $ac_func" >&5
+echo "configure:5125: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4777 "configure"
+#line 5130 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4782,7 +5149,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4809,7 +5176,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:4827: checking stack direction for C alloca" >&5
+echo "configure:5180: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4817,7 +5184,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 4835 "configure"
+#line 5188 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -4836,7 +5203,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:4854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -4858,21 +5225,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:4876: checking for inline" >&5
+echo "configure:5229: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 4883 "configure"
+#line 5236 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:4890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -4902,12 +5269,12 @@
 for ac_func in unlink remove
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4920: checking for $ac_func" >&5
+echo "configure:5273: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4925 "configure"
+#line 5278 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4930,7 +5297,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4959,12 +5326,12 @@
 for ac_func in sbrk
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4977: checking for $ac_func" >&5
+echo "configure:5330: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4982 "configure"
+#line 5335 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4987,7 +5354,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5016,12 +5383,12 @@
 # enough, but on some of those systems, the assert macro relies on requoting
 # working properly!
 echo $ac_n "checking for working assert macro""... $ac_c" 1>&6
-echo "configure:5034: checking for working assert macro" >&5
+echo "configure:5387: checking for working assert macro" >&5
 if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5039 "configure"
+#line 5392 "configure"
 #include "confdefs.h"
 #include <assert.h>
 #include <stdio.h>
@@ -5037,7 +5404,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_assert_ok=yes
 else
@@ -5078,12 +5445,12 @@
 "
 
 echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6
-echo "configure:5096: checking whether declaration is required for strstr" >&5
+echo "configure:5449: checking whether declaration is required for strstr" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5101 "configure"
+#line 5454 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -5094,7 +5461,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_strstr=no
 else
@@ -5115,12 +5482,12 @@
 
 
 echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6
-echo "configure:5133: checking whether declaration is required for malloc" >&5
+echo "configure:5486: checking whether declaration is required for malloc" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5138 "configure"
+#line 5491 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -5131,7 +5498,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_malloc=no
 else
@@ -5152,12 +5519,12 @@
 
 
 echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6
-echo "configure:5170: checking whether declaration is required for free" >&5
+echo "configure:5523: checking whether declaration is required for free" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5175 "configure"
+#line 5528 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -5168,7 +5535,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_free=no
 else
@@ -5189,12 +5556,12 @@
 
 
 echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6
-echo "configure:5207: checking whether declaration is required for sbrk" >&5
+echo "configure:5560: checking whether declaration is required for sbrk" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5212 "configure"
+#line 5565 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -5205,7 +5572,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_sbrk=no
 else
@@ -5226,12 +5593,12 @@
 
 
 echo $ac_n "checking whether declaration is required for environ""... $ac_c" 1>&6
-echo "configure:5244: checking whether declaration is required for environ" >&5
+echo "configure:5597: checking whether declaration is required for environ" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_environ'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5249 "configure"
+#line 5602 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -5242,7 +5609,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_environ=no
 else
@@ -5266,12 +5633,12 @@
 # for it?
 
 echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6
-echo "configure:5284: checking whether declaration is required for errno" >&5
+echo "configure:5637: checking whether declaration is required for errno" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5289 "configure"
+#line 5642 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_ERRNO_H
@@ -5286,7 +5653,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_errno=no
 else
@@ -5471,10 +5838,11 @@
 s%@CC@%$CC%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
+s%@USE_SYMBOL_UNDERSCORE@%$USE_SYMBOL_UNDERSCORE%g
 s%@LN_S@%$LN_S%g
-s%@LIBTOOL@%$LIBTOOL%g
 s%@DLLTOOL@%$DLLTOOL%g
 s%@AS@%$AS%g
+s%@LIBTOOL@%$LIBTOOL%g
 s%@cgen_cpu_prefix@%$cgen_cpu_prefix%g
 s%@extra_objects@%$extra_objects%g
 s%@target_cpu_type@%$target_cpu_type%g
diff --git a/gas/configure.in b/gas/configure.in
index 4d847ba..e4c8177 100644
--- a/gas/configure.in
+++ b/gas/configure.in
@@ -10,7 +10,7 @@
 
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(gas, 2.9.4)
+AM_INIT_AUTOMAKE(gas, 2.9.5)
 
 AM_PROG_LIBTOOL
 
@@ -152,6 +152,7 @@
       fr30-*-*)		    fmt=elf bfd_gas=yes ;;
 
       hppa-*-*elf*)         fmt=elf em=hppa ;;
+      hppa-*-linux-gnu*)    fmt=elf em=hppa ;;
       hppa-*-lites*)        fmt=elf em=hppa ;;
       hppa-*-osf*)          fmt=som em=hppa ;;
       hppa-*-rtems*)        fmt=elf em=hppa ;;
@@ -176,8 +177,9 @@
       i386-*-lynxos*)       fmt=coff em=lynx ;;
       i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
 			    fmt=elf bfd_gas=yes ;;
-      i386-*-freebsdelf*)   fmt=elf bfd_gas=yes ;;
-      i386-*-freebsd*)      fmt=aout em=386bsd ;;
+      i386-*-freebsdaout* | i386-*-freebsd[12].* | i386-*-freebsd[12])
+                            fmt=aout em=386bsd ;;
+      i386-*-freebsd*)	    fmt=elf bfd_gas=yes ;;
       i386-*-coff | i386-*-sysv* | i386-*-sco3.2v5*coff | i386-*-isc*)
                           fmt=coff ;;
       i386-*-sco3.2v5*)      fmt=elf
@@ -190,6 +192,7 @@
       i386-*-vsta)          fmt=aout ;;
       i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*)
 			    fmt=coff em=go32;;
+      i386-*-rtemself*)     fmt=elf ;;
       i386-*-rtems*)        fmt=coff ;;
       i386-*-gnu*)          fmt=elf ;;
       i386-*-mach*)
@@ -208,6 +211,7 @@
       i960-*-vxworks5.0)    fmt=bout ;;
       i960-*-vxworks5.*)    fmt=coff em=ic960 ;;
       i960-*-vxworks*)      fmt=bout ;;
+      i960-*-elf*)	    fmt=elf ;;
 
       m32r-*-*)		    fmt=elf bfd_gas=yes ;;
 
@@ -286,9 +290,11 @@
       ppc-*-macos* | ppc-*-mpw*)
 			    fmt=coff em=macos ;;
       ppc-*-netware*)       fmt=elf em=ppcnw ;;
+      ppc-*-vxworks*)       fmt=elf ;;
 
       sh-*-elf*)	    fmt=elf ;;
       sh-*-coff*)           fmt=coff ;;
+      sh-*-rtemself*)       fmt=elf ;;
       sh-*-rtems*)	    fmt=coff ;;
 
       ns32k-pc532-mach* | ns32k-pc532-ux*)    fmt=aout em=pc532mach ;;
diff --git a/gas/dep-in.sed b/gas/dep-in.sed
index c07f969..8771f0f 100644
--- a/gas/dep-in.sed
+++ b/gas/dep-in.sed
@@ -18,7 +18,6 @@
 s! targ-cpu.h!!g
 s! flonum.h!!g
 s! expr.h!!g
-s! struc-symbol.h!!g
 s! write.h!!g
 s! frags.h!!g
 s! hash.h!!g
diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in
index 5f4d1a5..71399f2 100644
--- a/gas/doc/Makefile.in
+++ b/gas/doc/Makefile.in
@@ -161,7 +161,7 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = tar
+TAR = gtar
 GZIP_ENV = --best
 all: all-redirect
 .SUFFIXES:
diff --git a/gas/doc/c-arm.texi b/gas/doc/c-arm.texi
index b94fb2a..3c1677c 100644
--- a/gas/doc/c-arm.texi
+++ b/gas/doc/c-arm.texi
@@ -29,12 +29,12 @@
 @cindex options for ARM (none)
 @table @code
 @cindex @code{-marm} command line option, ARM
-@item -marm @var{[2|250|3|6|60|600|610|620|7|7m|7d|7dm|7di|7dmi|70|700|700i|710|710c|7100|7500|7500fe|7tdmi|8|810|9|9tdmistrongarm|strongarm110|strongarm1100]}
+@item -marm @var{[2|250|3|6|60|600|610|620|7|7m|7d|7dm|7di|7dmi|70|700|700i|710|710c|7100|7500|7500fe|7tdmi|8|810|9|9tdmi|920||strongarm|strongarm110|strongarm1100]}
 This option specifies the target processor.  The assembler will issue an
 error message if an attempt is made to assemble an instruction which
 will not execute on the target processor.
 @cindex @code{-marmv} command line option, ARM
-@item -marmv @var{[2|2a|3|3m|4|4t]}
+@item -marmv @var{[2|2a|3|3m|4|4t|5|5t]}
 This option specifies the target architecture.  The assembler will issue
 an error message if an attempt is made to assemble an instruction which
 will not execute on the target architecture.
@@ -167,6 +167,14 @@
 between Arm and Thumb instructions and should be used even if
 interworking is not going to be performed.
 
+@cindex @code{thumb_set} directive, ARM
+@item .thumb_set
+This performs the equivalent of a @code{.set} directive in that it
+creates a symbol which is an alias for another symbol (possibly not yet
+defined).  This directive also has the added property in that it marks
+the aliased symbol as being a thumb function entry point, in the same
+way that the @code{.thumb_func} directive does.
+
 @cindex @code{.ltorg} directive, ARM
 @item .ltorg
 This directive causes the current contents of the literal pool to be
@@ -184,13 +192,23 @@
 
 @cindex ARM opcodes
 @cindex opcodes for ARM
-@code{@value{AS}} implements all the standard ARM opcodes.
+@code{@value{AS}} implements all the standard ARM opcodes.  It also
+implements several pseudo opcodes, including several synthetic load
+instructions. 
 
-*TODO* Document the pseudo-ops (adr, nop)
+@table @code
 
-GAS for the ARM supports a synthetic register load instruction whoes
-syntax is: 
+@cindex @code{NOP} pseudo op, ARM
+@item NOP
+@smallexample
+  nop
+@end smallexample
 
+This pseudo op will always evaluate to a legal ARM instruction that does
+nothing.  Currently it will evaluate to MOV r0, r0.
+
+@cindex @code{LDR reg,=<label>} pseudo op, ARM
+@item LDR 
 @smallexample
   ldr <register> , = <expression>
 @end smallexample
@@ -201,6 +219,37 @@
 the constant will be placed into the nearest literal pool (if it not
 already there) and a PC relative LDR instruction will be generated.
 
+@cindex @code{ADR reg,<label>} pseudo op, ARM
+@item ADR
+@smallexample
+  adr <register> <label>
+@end smallexample
+
+This instruction will load the address of @var{label} into the indicated
+register.  The instruction will evaluate to a PC relative ADD or SUB
+instruction depending upon where the label is located.  If the label is
+out of range, or if it is not defined in the same file (and section) as
+the ADR instruction, then an error will be generated.  This instruction
+will not make use of the literal pool.
+
+@cindex @code{ADRL reg,<label>} pseudo op, ARM
+@item ADRL 
+@smallexample
+  adrl <register> <label>
+@end smallexample
+
+This instruction will load the address of @var{label} into the indicated
+register.  The instruction will evaluate to one or two a PC relative ADD
+or SUB instructions depending upon where the label is located.  If a
+second instruction is not needed a NOP instruction will be generated in
+its place, so that this instruction is always 8 bytes long.
+
+If the label is out of range, or if it is not defined in the same file
+(and section) as the ADRL instruction, then an error will be generated.
+This instruction will not make use of the literal pool.
+
+@end table
+
 For information on the ARM or Thumb instruction sets, see @cite{ARM
 Software Development Toolkit Reference Manual}, Advanced RISC Machines
 Ltd.
diff --git a/gas/doc/c-sparc.texi b/gas/doc/c-sparc.texi
index f871c82..adbe299 100644
--- a/gas/doc/c-sparc.texi
+++ b/gas/doc/c-sparc.texi
@@ -145,11 +145,24 @@
 @item .half
 This is functionally identical to @code{.short}.
 
+@cindex @code{nword} directive, SPARC
+@item .nword
+On the Sparc, the @code{.nword} directive produces native word sized value,
+ie. if assembling with -32 it is equivalent to @code{.word}, if assembling
+with -64 it is equivalent to @code{.xword}.
+
 @cindex @code{proc} directive, SPARC
 @item .proc
 This directive is ignored.  Any text following it on the same
 line is also ignored.
 
+@cindex @code{register} directive, SPARC
+@item .register
+This directive declares use of a global application or system register.
+It must be followed by a register name %g2, %g3, %g6 or %g7, comma and
+the symbol name for that register or @code{#scratch} if it is a scratch
+register.
+
 @cindex @code{reserve} directive, SPARC
 @item .reserve
 This must be followed by a symbol name, a positive number, and
@@ -176,4 +189,3 @@
 On the Sparc V9 processor, the @code{.xword} directive produces
 64 bit values.
 @end table
-
diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi
index dd3b4ab..7f92105 100644
--- a/gas/doc/internals.texi
+++ b/gas/doc/internals.texi
@@ -115,9 +115,14 @@
 @cindex symbols, internal
 @cindex symbolS structure
 
-The definition for @code{struct symbol}, also known as @code{symbolS}, is
-located in @file{struc-symbol.h}.  Symbol structures contain the following
-fields:
+The definition for the symbol structure, @code{symbolS}, is located in
+@file{struc-symbol.h}.
+
+In general, the fields of this structure may not be referred to directly.
+Instead, you must use one of the accessor functions defined in @file{symbol.h}.
+These accessor functions should work for any GAS version.
+
+Symbol structures contain the following fields:
 
 @table @code
 @item sy_value
@@ -188,16 +193,10 @@
 This processor-specific data is of type @code{TC_SYMFIELD_TYPE}.  If no macro
 by that name is defined in @file{targ-cpu.h}, this field is not defined.
 
-@item TARGET_SYMBOL_FIELDS
-If this macro is defined, it defines additional fields in the symbol structure.
-This macro is obsolete, and should be replaced when possible by uses of
-@code{OBJ_SYMFIELD_TYPE} and @code{TC_SYMFIELD_TYPE}.
 @end table
 
-There are a number of access routines used to extract the fields of a
-@code{symbolS} structure.  When possible, these routines should be used rather
-than referring to the fields directly.  These routines will work for any GAS
-version.
+Here is a description of the accessor functions.  These should be used rather
+than referring to the fields of @code{symbolS} directly.
 
 @table @code
 @item S_SET_VALUE
@@ -302,8 +301,136 @@
 @cindex S_SET_SIZE
 Set the size of a symbol.  This is only defined for object file formats for
 which it makes sense (primarily ELF).
+
+@item symbol_get_value_expression
+@cindex symbol_get_value_expression
+Get a pointer to an @code{expressionS} structure which represents the value of
+the symbol as an expression.
+
+@item symbol_set_value_expression
+@cindex symbol_set_value_expression
+Set the value of a symbol to an expression.
+
+@item symbol_set_frag
+@cindex symbol_set_frag
+Set the frag where a symbol is defined.
+
+@item symbol_get_frag
+@cindex symbol_get_frag
+Get the frag where a symbol is defined.
+
+@item symbol_mark_used
+@cindex symbol_mark_used
+Mark a symbol as having been used in an expression.
+
+@item symbol_clear_used
+@cindex symbol_clear_used
+Clear the mark indicating that a symbol was used in an expression.
+
+@item symbol_used_p
+@cindex symbol_used_p
+Return whether a symbol was used in an expression.
+
+@item symbol_mark_used_in_reloc
+@cindex symbol_mark_used_in_reloc
+Mark a symbol as having been used by a relocation.
+
+@item symbol_clear_used_in_reloc
+@cindex symbol_clear_used_in_reloc
+Clear the mark indicating that a symbol was used in a relocation.
+
+@item symbol_used_in_reloc_p
+@cindex symbol_used_in_reloc_p
+Return whether a symbol was used in a relocation.
+
+@item symbol_mark_mri_common
+@cindex symbol_mark_mri_common
+Mark a symbol as an MRI common symbol.
+
+@item symbol_clear_mri_common
+@cindex symbol_clear_mri_common
+Clear the mark indicating that a symbol is an MRI common symbol.
+
+@item symbol_mri_common_p
+@cindex symbol_mri_common_p
+Return whether a symbol is an MRI common symbol.
+
+@item symbol_mark_written
+@cindex symbol_mark_written
+Mark a symbol as having been written.
+
+@item symbol_clear_written
+@cindex symbol_clear_written
+Clear the mark indicating that a symbol was written.
+
+@item symbol_written_p
+@cindex symbol_written_p
+Return whether a symbol was written.
+
+@item symbol_mark_resolved
+@cindex symbol_mark_resolved
+Mark a symbol as having been resolved.
+
+@item symbol_resolved_p
+@cindex symbol_resolved_p
+Return whether a symbol has been resolved.
+
+@item symbol_section_p
+@cindex symbol_section_p
+Return whether a symbol is a section symbol.
+
+@item symbol_equated_p
+@cindex symbol_equated_p
+Return whether a symbol is equated to another symbol.
+
+@item symbol_constant_p
+@cindex symbol_constant_p
+Return whether a symbol has a constant value, including being an offset within
+some frag.
+
+@item symbol_get_bfdsym
+@cindex symbol_get_bfdsym
+Return the BFD symbol associated with a symbol.
+
+@item symbol_set_bfdsym
+@cindex symbol_set_bfdsym
+Set the BFD symbol associated with a symbol.
+
+@item symbol_get_obj
+@cindex symbol_get_obj
+Return a pointer to the @code{OBJ_SYMFIELD_TYPE} field of a symbol.
+
+@item symbol_set_obj
+@cindex symbol_set_obj
+Set the @code{OBJ_SYMFIELD_TYPE} field of a symbol.
+
+@item symbol_get_tc
+@cindex symbol_get_tc
+Return a pointer to the @code{TC_SYMFIELD_TYPE} field of a symbol.
+
+@item symbol_set_tc
+@cindex symbol_set_tc
+Set the @code{TC_SYMFIELD_TYPE} field of a symbol.
+
 @end table
 
+When @code{BFD_ASSEMBLER} is defined, GAS attempts to store local
+symbols--symbols which will not be written to the output file--using a
+different structure, @code{struct local_symbol}.  This structure can only
+represent symbols whose value is an offset within a frag.
+
+Code outside of the symbol handler will always deal with @code{symbolS}
+structures and use the accessor functions.  The accessor functions correctly
+deal with local symbols.  @code{struct local_symbol} is much smaller than
+@code{symbolS} (which also automatically creates a bfd @code{asymbol}
+structure), so this saves space when assembling large files.
+
+The first field of @code{symbolS} is @code{bsym}, the pointer to the BFD
+symbol.  The first field of @code{struct local_symbol} is a pointer which is
+always set to NULL.  This is how the symbol accessor functions can distinguish
+local symbols from ordinary symbols.  The symbol accessor functions
+automatically convert a local symbol into an ordinary symbol when necessary.
+
 @node Expressions
 @subsection Expressions
 @cindex internals, expressions
@@ -1034,7 +1161,10 @@
 @item md_apply_fix
 @cindex md_apply_fix
 GAS will call this for each fixup.  It should store the correct value in the
-object file.
+object file.  @code{fixup_segment} performs a generic overflow check on the
+@code{valueT *val} argument after @code{md_apply_fix} returns.  If the overflow
+check is relevant for the target machine, then @code{md_apply_fix} should
+modify @code{valueT *val}, typically to the value stored in the object file.
 
 @item TC_HANDLES_FX_DONE
 @cindex TC_HANDLES_FX_DONE
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
new file mode 100644
index 0000000..5e447ab
--- /dev/null
+++ b/gas/dwarf2dbg.c
@@ -0,0 +1,749 @@
+/* dwarf2dbg.c - DWARF2 debug support
+   Copyright (C) 1999 Free Software Foundation, Inc.
+   Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+   This file is part of GAS, the GNU Assembler.
+
+   GAS 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, or (at your option)
+   any later version.
+
+   GAS 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 GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.  */
+
+/* Logical line numbers can be controlled by the compiler via the
+   following two directives:
+
+	.file FILENO "file.c"
+	.loc  FILENO LINENO [COLUMN]
+
+   FILENO is the filenumber.  */
+
+#include "ansidecl.h"
+
+#include "as.h"
+#include "dwarf2dbg.h"
+#include "subsegs.h"
+
+#include "elf/dwarf2.h"
+
+/* Since we can't generate the prolog until the body is complete, we
+   use three different subsegments for .debug_line: one holding the
+   prolog, one for the directory and filename info, and one for the
+   body ("statement program").  */
+#define DL_PROLOG	0
+#define DL_FILES	1
+#define DL_BODY		2
+
+/* First special line opcde - leave room for the standard opcodes.
+   Note: If you want to change this, you'll have to update the
+   "standard_opcode_lengths" table that is emitted below in
+   dwarf2_finish().  */
+#define DWARF2_LINE_OPCODE_BASE		10
+
+#ifndef DWARF2_LINE_BASE
+  /* Minimum line offset in a special line info. opcode.  This value
+     was chosen to give a reasonable range of values.  */
+# define DWARF2_LINE_BASE		-5
+#endif
+
+/* Range of line offsets in a special line info. opcode.  */
+#ifndef DWARF2_LINE_RANGE
+# define DWARF2_LINE_RANGE		14
+#endif
+
+#ifndef DWARF2_LINE_MIN_INSN_LENGTH
+  /* Define the architecture-dependent minimum instruction length (in
+     bytes).  This value should be rather too small than too big.  */
+# define DWARF2_LINE_MIN_INSN_LENGTH	4
+#endif
+
+/* Flag that indicates the initial value of the is_stmt_start flag.
+   In the present implementation, we do not mark any lines as
+   the beginning of a source statement, because that information
+   is not made available by the GCC front-end.  */
+#define	DWARF2_LINE_DEFAULT_IS_STMT	1
+
+/* Flag that indicates the initial value of the is_stmt_start flag.
+   In the present implementation, we do not mark any lines as
+   the beginning of a source statement, because that information
+   is not made available by the GCC front-end.  */
+#define	DWARF2_LINE_DEFAULT_IS_STMT	1
+
+/* Given a special op, return the line skip amount: */
+#define SPECIAL_LINE(op) \
+	(((op) - DWARF2_LINE_OPCODE_BASE)%DWARF2_LINE_RANGE + DWARF2_LINE_BASE)
+
+/* Given a special op, return the address skip amount (in units of
+   DWARF2_LINE_MIN_INSN_LENGTH.  */
+#define SPECIAL_ADDR(op) (((op) - DWARF2_LINE_OPCODE_BASE)/DWARF2_LINE_RANGE)
+
+/* The maximum address skip amont that can be encoded with a special op: */
+#define MAX_SPECIAL_ADDR_DELTA		SPECIAL_ADDR(255)
+
+#define INITIAL_STATE						\
+  /* initialize as per DWARF2.0 standard: */			\
+  0,					/* address */		\
+  1,					/* file */		\
+  1,					/* line */		\
+  0,					/* column */		\
+  DWARF2_LINE_DEFAULT_IS_STMT,		/* is_stmt */		\
+  0,					/* basic_block */	\
+  1					/* empty_sequence */
+
+static struct
+  {
+    /* state machine state as per DWARF2 manual: */
+    struct dwarf2_sm
+      {
+	addressT addr;
+	unsigned int filenum;
+	unsigned int line;
+	unsigned int column;
+	unsigned int
+	  is_stmt : 1,
+	  basic_block : 1,
+	  empty_sequence : 1;		/* current code sequence has no DWARF2 directives? */
+      }
+    sm;
+
+    unsigned int
+      any_dwarf2_directives : 1;	/* did we emit any DWARF2 line debug directives? */
+
+    segT text_seg;	/* text segment "addr" is relative to */
+    subsegT text_subseg;
+    segT line_seg;	/* ".debug_line" segment */
+    int last_filename;	/* index of last filename that was used */
+    int num_filenames;	/* index of last filename in use */
+    int filename_len;	/* length of the filename array */
+    struct
+      {
+	int dir;	/* valid after gen_dir_list() only */
+	char *name; /* full path before gen_dir_list(), filename afterwards */
+      }
+    *file;
+
+    struct dwarf2_line_info current;	/* current source info: */
+
+    /* counters for statistical purposes: */
+    unsigned int num_line_entries;
+    unsigned int opcode_hist[256];	/* histogram of opcode frequencies */
+  }
+ls =
+  {
+    {
+      INITIAL_STATE
+    },
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    NULL,
+    { NULL, 0, 0, 0, 0 },
+    0,
+    {
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+    }
+  };
+
+
+/* Function prototypes: */
+static void out_uleb128 PARAMS ((addressT));
+static void out_sleb128 PARAMS ((offsetT));
+static void gen_addr_line PARAMS ((int, addressT));
+static void reset_state_machine PARAMS ((void));
+static void out_set_addr PARAMS ((addressT));
+static void out_end_sequence PARAMS ((void));
+static int get_filenum PARAMS ((int, char *));
+static void gen_dir_list PARAMS ((void));
+static void gen_file_list PARAMS ((void));
+static void print_stats PARAMS ((unsigned long));
+
+
+#define out_byte(byte)	FRAG_APPEND_1_CHAR(byte)
+#define out_opcode(opc)	(out_byte ((opc)), ++ls.opcode_hist[(opc) & 0xff])
+
+/* Output an unsigned "little-endian base 128" number.  */
+static void
+out_uleb128 (value)
+     addressT value;
+{
+  unsigned char byte, more = 0x80;
+
+  do
+    {
+      byte = value & 0x7f;
+      value >>= 7;
+      if (value == 0)
+	more = 0;
+      out_byte (more | byte);
+    }
+  while (more);
+}
+
+/* Output a signed "little-endian base 128" number.  */
+static void
+out_sleb128 (value)
+     offsetT value;
+{
+  unsigned char byte, more = 0x80;
+
+  do
+    {
+      byte = value & 0x7f;
+      value >>= 7;
+      if (((value == 0) && ((byte & 0x40) == 0))
+	  || ((value == -1) && ((byte & 0x40) != 0)))
+	more = 0;
+      out_byte (more | byte);
+    }
+  while (more);
+}
+
+/* Encode a pair of line and address skips as efficiently as possible.
+   Note that the line skip is signed, whereas the address skip is
+   unsigned.  */
+static void
+gen_addr_line (line_delta, addr_delta)
+     int line_delta;
+     addressT addr_delta;
+{
+  unsigned int tmp, opcode;
+
+  tmp = line_delta - DWARF2_LINE_BASE;
+
+  if (tmp >= DWARF2_LINE_RANGE)
+    {
+      out_opcode (DW_LNS_advance_line);
+      out_sleb128 (line_delta);
+      tmp = 0 - DWARF2_LINE_BASE;
+      line_delta = 0;
+    }
+
+  tmp += DWARF2_LINE_OPCODE_BASE;
+
+  /* try using a special opcode: */
+  opcode = tmp + addr_delta*DWARF2_LINE_RANGE;
+  if (opcode <= 255)
+    {
+      out_opcode (opcode);
+      return;
+    }
+
+  /* try using DW_LNS_const_add_pc followed by special op: */
+  opcode = tmp + (addr_delta - MAX_SPECIAL_ADDR_DELTA)*DWARF2_LINE_RANGE;
+  if (opcode <= 255)
+    {
+      out_opcode (DW_LNS_const_add_pc);
+      out_opcode (opcode);
+      return;
+    }
+
+  out_opcode (DW_LNS_advance_pc);
+  out_uleb128 (addr_delta);
+
+  if (line_delta)
+    out_opcode (tmp);		/* output line-delta */
+  else
+    out_opcode (DW_LNS_copy);	/* append new row with current info */
+}
+
+static void
+reset_state_machine ()
+{
+  static const struct dwarf2_sm initial_state = { INITIAL_STATE };
+
+  ls.sm = initial_state;
+}
+
+/* Set an absolute address (may results in a relocation entry): */
+static void
+out_set_addr (addr)
+     addressT addr;
+{
+  subsegT saved_subseg;
+  segT saved_seg;
+  expressionS expr;
+  symbolS *sym;
+  int bytes_per_address;
+
+  saved_seg = now_seg;
+  saved_subseg = now_subseg;
+
+  subseg_set (ls.text_seg, ls.text_subseg);
+  sym = symbol_new (".L0\001", now_seg, addr, frag_now);
+
+  subseg_set (saved_seg, saved_subseg);
+
+#ifdef BFD_ASSEMBLER
+  bytes_per_address = bfd_arch_bits_per_address (stdoutput) / 8;
+#else
+  /* FIXME.  */
+  bytes_per_address = 4;
+#endif
+
+  out_opcode (DW_LNS_extended_op);
+  out_uleb128 (bytes_per_address + 1);
+
+  out_opcode (DW_LNE_set_address);
+  expr.X_op = O_symbol;
+  expr.X_add_symbol = sym;
+  expr.X_add_number = 0;
+  emit_expr (&expr, bytes_per_address);
+}
+
+/* Emit DW_LNS_end_sequence and reset state machine.  Does not
+   preserve the current segment/sub-segment!  */
+static void
+out_end_sequence ()
+{
+  addressT addr, delta;
+
+  if (ls.text_seg)
+    {
+      subseg_set (ls.text_seg, ls.text_subseg);
+#ifdef md_current_text_addr
+      addr = md_current_text_addr ();
+#else
+      addr = frag_now_fix ();
+#endif
+      subseg_set (ls.line_seg, DL_BODY);
+      if (addr < ls.sm.addr)
+	{
+	  out_set_addr (addr);
+	  ls.sm.addr = addr;
+	}
+      else
+	{
+	  delta = addr - ls.sm.addr;
+	  if (delta > 0)
+	    gen_addr_line (0, delta / DWARF2_LINE_MIN_INSN_LENGTH);
+	}
+    }
+  else
+    subseg_set (ls.line_seg, DL_BODY);
+
+  out_opcode (DW_LNS_extended_op);
+  out_uleb128 (1);
+  out_byte (DW_LNE_end_sequence);
+
+  reset_state_machine ();
+}
+
+/* Look up a filenumber either by filename or by filenumber.  If both
+   a filenumber and a filename are specified, lookup by filename takes
+   precedence.  If the filename cannot be found, it is added to the
+   filetable the filenumber for the new entry is returned.  */
+static int
+get_filenum (filenum, file)
+     int filenum;
+     char *file;
+{
+  int i, last = filenum - 1;
+  char char0 = file[0];
+
+  if (last >= ls.num_filenames)
+    last = ls.last_filename;
+
+  /* do a quick check against the previously used filename: */
+  if (ls.num_filenames > 0 && ls.file[last].name[0] == char0
+      && strcmp (ls.file[last].name + 1, file + 1) == 0)
+    return last + 1;
+
+  /* no match, fall back to simple linear scan: */
+  for (i = 0; i < ls.num_filenames; ++i)
+    {
+      if (ls.file[i].name[0] == char0
+	  && strcmp (ls.file[i].name + 1, file + 1) == 0)
+	{
+	  ls.last_filename = i;
+	  return i + 1;
+	}
+    }
+
+  /* no match: enter new filename */
+  if (ls.num_filenames >= ls.filename_len)
+    {
+      ls.filename_len += 13;
+      ls.file = xrealloc (ls.file, ls.filename_len * sizeof (ls.file[0]));
+    }
+  ls.file[ls.num_filenames].dir = 0;
+  ls.file[ls.num_filenames].name = file;
+  return ++ls.num_filenames;
+}
+
+void
+dwarf2_gen_line_info (addr, l)
+     addressT addr;
+     struct dwarf2_line_info *l;
+{
+  unsigned int filenum = l->filenum;
+  unsigned int any_output = 0;
+  subsegT saved_subseg;
+  segT saved_seg;
+
+  if (flag_debug)
+    fprintf (stderr, "line: addr %lx file `%s' line %u col %u flags %x\n",
+	     (unsigned long) addr, l->filename, l->line, l->column, l->flags);
+
+  if (filenum > 0 && !l->filename)
+    {
+      if (filenum >= (unsigned int) ls.num_filenames)
+	{
+	  as_warn ("Encountered bad file number in line number debug info!");
+	  return;
+	}
+    }
+  else if (l->filename)
+    filenum = get_filenum (filenum, l->filename);
+  else
+    return;	/* no filename, no filnum => no play */
+
+  if (!ls.line_seg)
+    {
+#ifdef BFD_ASSEMBLER
+      symbolS *secsym;
+#endif
+
+      ls.line_seg = subseg_new (".debug_line", 0);
+
+#ifdef BFD_ASSEMBLER
+      bfd_set_section_flags (stdoutput, ls.line_seg, SEC_READONLY);
+
+      /* We're going to need this symbol.  */
+      secsym = symbol_find (".debug_line");
+      if (secsym != NULL)
+        symbol_set_bfdsym (secsym, ls.line_seg->symbol);
+      else
+        symbol_table_insert (section_symbol (ls.line_seg));
+#endif
+    }
+
+  saved_seg = now_seg;
+  saved_subseg = now_subseg;
+  subseg_set (ls.line_seg, DL_BODY);
+
+  if (ls.text_seg != saved_seg || ls.text_subseg != saved_subseg)
+    {
+      if (!ls.sm.empty_sequence)
+	{
+	  out_end_sequence ();		/* terminate previous sequence */
+	  ls.sm.empty_sequence = 1;
+	}
+      any_output = 1;
+      ls.text_seg = saved_seg;
+      ls.text_subseg = saved_subseg;
+      out_set_addr (addr);
+      ls.sm.addr = addr;
+    }
+
+  if (ls.sm.filenum != filenum)
+    {
+      any_output = 1;
+      out_opcode (DW_LNS_set_file);
+      out_uleb128 (filenum);
+      ls.sm.filenum = filenum;
+    }
+
+  if (ls.sm.column != l->column)
+    {
+      any_output = 1;
+      out_opcode (DW_LNS_set_column);
+      out_uleb128 (l->column);
+      ls.sm.column = l->column;
+    }
+
+  if (((l->flags & DWARF2_FLAG_BEGIN_STMT) != 0) != ls.sm.is_stmt)
+    {
+      any_output = 1;
+      out_opcode (DW_LNS_negate_stmt);
+    }
+
+  if (l->flags & DWARF2_FLAG_BEGIN_BLOCK)
+    {
+      any_output = 1;
+      out_opcode (DW_LNS_set_basic_block);
+    }
+
+  if (ls.sm.line != l->line)
+    {
+      any_output = 1;
+      if (addr < ls.sm.addr)
+	{
+	  /* This happens when a new frag got allocated (for whatever
+	     reason).  Deal with it by generating a reference symbol.
+	     Note: no end_sequence needs to be generated because the
+	     address did not really decrease (only the reference point
+	     changed).
+
+	     ??? Perhaps we should directly check for a change of
+	     frag_now instead?  */
+	  out_set_addr (addr);
+	  ls.sm.addr = addr;
+	}
+      gen_addr_line (l->line - ls.sm.line,
+		     (addr - ls.sm.addr) / DWARF2_LINE_MIN_INSN_LENGTH);
+      ls.sm.basic_block = 0;
+      ls.sm.line = l->line;
+      ls.sm.addr = addr;
+    }
+
+  subseg_set (saved_seg, saved_subseg);
+
+  ls.num_line_entries += any_output;
+  if (any_output)
+    ls.sm.empty_sequence = 0;
+}
+
+static void
+gen_dir_list ()
+{
+  char *str, *slash, *dir_list, *dp, *cp;
+  int i, j, num_dirs;
+
+  dir_list = frag_more (0);
+  num_dirs = 0;
+
+  for (i = 0; i < ls.num_filenames; ++i)
+    {
+      str = ls.file[i].name;
+      slash = strrchr (str, '/');
+      if (slash)
+	{
+	  *slash = '\0';
+	  for (j = 0, dp = dir_list; j < num_dirs; ++j)
+	    {
+	      if (strcmp (str, dp) == 0)
+		{
+		  ls.file[i].dir = j + 1;
+		  break;
+		}
+	      dp += strlen (dp);
+	    }
+	  if (j >= num_dirs)
+	    {
+	      /* didn't find this directory: append it to the list */
+	      size_t size = strlen (str) + 1;
+	      cp = frag_more (size);
+	      memcpy (cp, str, size);
+	      ls.file[i].dir = ++num_dirs;
+	    }
+	  *slash = '/';
+	  ls.file[i].name = slash + 1;
+	}
+    }
+  out_byte ('\0');	/* terminate directory list */
+}
+
+static void
+gen_file_list ()
+{
+  size_t size;
+  char *cp;
+  int i;
+
+  for (i = 0; i < ls.num_filenames; ++i)
+    {
+      size = strlen (ls.file[i].name) + 1;
+      cp = frag_more (size);
+      memcpy (cp, ls.file[i].name, size);
+
+      out_uleb128 (ls.file[i].dir);	/* directory number */
+      out_uleb128 (0);			/* last modification timestamp */
+      out_uleb128 (0);			/* filesize */
+    }
+  out_byte (0);		/* terminate filename list */
+}
+
+static void
+print_stats (total_size)
+     unsigned long total_size;
+{
+  static const char *opc_name[] =
+    {
+      "extended", "copy", "advance_pc", "advance_line", "set_file",
+      "set_column", "negate_stmt", "set_basic_block", "const_add_pc",
+      "fixed_advance_pc"
+    };
+  size_t i;
+  int j;
+
+  fprintf (stderr, "Average size: %g bytes/line\n",
+	   total_size / (double) ls.num_line_entries);
+
+  fprintf (stderr, "\nStandard opcode histogram:\n");
+
+  for (i = 0; i < sizeof (opc_name)/sizeof (opc_name[0]); ++i)
+    {
+      fprintf (stderr, "%s", opc_name[i]);
+      for (j = strlen (opc_name[i]); j < 16; ++j)
+	fprintf (stderr, " ");
+      fprintf (stderr, ": %u\n", ls.opcode_hist[i]);
+    }
+
+  fprintf (stderr, "\nSpecial opcodes:\naddr\t\t\t\tline skip\n");
+
+  fprintf (stderr, "skip: ");
+  for (j = DWARF2_LINE_BASE; j < DWARF2_LINE_BASE + DWARF2_LINE_RANGE; ++j)
+    fprintf (stderr, "%3d", j);
+  fprintf (stderr, "\n-----");
+
+  for (; i < 256; ++i)
+    {
+      j = SPECIAL_LINE (i);
+      if (j == DWARF2_LINE_BASE)
+	fprintf (stderr, "\n%4u: ",
+		 DWARF2_LINE_MIN_INSN_LENGTH*SPECIAL_ADDR (i));
+      fprintf (stderr, " %2u", ls.opcode_hist[i]);
+    }
+  fprintf (stderr, "\n");
+}
+
+void
+dwarf2_finish ()
+{
+  addressT body_size, total_size, prolog_size;
+  subsegT saved_subseg;
+  segT saved_seg;
+  char *cp;
+
+  if (!ls.line_seg)
+    /* no .debug_line segment, no work to do... */
+    return;
+
+  saved_seg = now_seg;
+  saved_subseg = now_subseg;
+
+  if (!ls.sm.empty_sequence)
+    out_end_sequence ();
+  total_size = body_size = frag_now_fix ();
+
+  /* now generate the directory and file lists: */
+  subseg_set (ls.line_seg, DL_FILES);
+  gen_dir_list ();
+  gen_file_list ();
+  total_size += frag_now_fix ();
+
+  /* and now the header ("statement program prolog", in DWARF2 lingo...) */
+  subseg_set (ls.line_seg, DL_PROLOG);
+
+  cp = frag_more (15 + DWARF2_LINE_OPCODE_BASE - 1);
+
+  total_size += frag_now_fix ();
+  prolog_size = total_size - body_size - 10;
+
+# define STUFF(val,size)	md_number_to_chars (cp, val, size); cp += size;
+  STUFF (total_size - 4, 4);	/* length */
+  STUFF (2, 2);			/* version */
+  STUFF (prolog_size, 4);	/* prologue_length */
+  STUFF (DWARF2_LINE_MIN_INSN_LENGTH, 1);
+  STUFF (DWARF2_LINE_DEFAULT_IS_STMT, 1);
+  STUFF (DWARF2_LINE_BASE, 1);
+  STUFF (DWARF2_LINE_RANGE, 1);
+  STUFF (DWARF2_LINE_OPCODE_BASE, 1);
+
+  /* standard_opcode_lengths: */
+  STUFF (0, 1);			/* DW_LNS_copy */
+  STUFF (1, 1);			/* DW_LNS_advance_pc */
+  STUFF (1, 1);			/* DW_LNS_advance_line */
+  STUFF (1, 1);			/* DW_LNS_set_file */
+  STUFF (1, 1);			/* DW_LNS_set_column */
+  STUFF (0, 1);			/* DW_LNS_negate_stmt */
+  STUFF (0, 1);			/* DW_LNS_set_basic_block */
+  STUFF (0, 1);			/* DW_LNS_const_add_pc */
+  STUFF (1, 1);			/* DW_LNS_fixed_advance_pc */
+
+  subseg_set (saved_seg, saved_subseg);
+
+  if (flag_debug)
+    print_stats (total_size);
+}
+
+void
+dwarf2_directive_file (dummy)
+     int dummy ATTRIBUTE_UNUSED;
+{
+  int len;
+
+  /* Continue to accept a bare string and pass it off.  */
+  SKIP_WHITESPACE ();
+  if (*input_line_pointer == '"')
+    {
+      s_app_file (0);
+      return;
+    }
+
+  ls.any_dwarf2_directives = 1;
+
+  if (debug_type == DEBUG_NONE)
+    /* Automatically turn on DWARF2 debug info unless something else
+       has been selected.  */
+    debug_type = DEBUG_DWARF2;
+
+  ls.current.filenum = get_absolute_expression ();
+  ls.current.filename = demand_copy_C_string (&len);
+
+  demand_empty_rest_of_line ();
+}
+
+void
+dwarf2_directive_loc (dummy)
+     int dummy ATTRIBUTE_UNUSED;
+{
+  ls.any_dwarf2_directives = 1;
+
+  ls.current.filenum = get_absolute_expression ();
+  SKIP_WHITESPACE ();
+  ls.current.line = get_absolute_expression ();
+  SKIP_WHITESPACE ();
+  ls.current.column = get_absolute_expression ();
+  demand_empty_rest_of_line ();
+
+  ls.current.flags = DWARF2_FLAG_BEGIN_STMT;
+
+#ifndef NO_LISTING
+  if (listing)
+    listing_source_line (ls.current.line);
+#endif
+}
+
+void
+dwarf2_where (line)
+     struct dwarf2_line_info *line;
+{
+  if (ls.any_dwarf2_directives)
+    *line = ls.current;
+  else
+    {
+      as_where (&line->filename, &line->line);
+      line->filenum = 0;
+      line->column = 0;
+      line->flags = DWARF2_FLAG_BEGIN_STMT;
+    }
+}
diff --git a/gas/dwarf2dbg.h b/gas/dwarf2dbg.h
new file mode 100644
index 0000000..a3eec1c
--- /dev/null
+++ b/gas/dwarf2dbg.h
@@ -0,0 +1,69 @@
+/* dwarf2dbg.h - DWARF2 debug support
+   Copyright (C) 1999 Free Software Foundation, Inc.
+
+   This file is part of GAS, the GNU Assembler.
+
+   GAS 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, or (at your option)
+   any later version.
+
+   GAS 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 GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.  */
+
+#ifndef AS_DWARF2DBG_H
+#define AS_DWARF2DBG_H
+
+#include "as.h"
+
+#define DWARF2_FLAG_BEGIN_STMT	(1 << 0)	/* beginning of statement */
+#define DWARF2_FLAG_BEGIN_BLOCK	(1 << 1)	/* beginning of basic block */
+
+struct dwarf2_line_info
+  {
+    char *filename;
+    unsigned int filenum;
+    unsigned int line;
+    unsigned int column;
+    unsigned int flags;
+  };
+
+/* Implements the .file FILENO "FILENAME" directive.  FILENO can be 0
+   to indicate that no file number has been assigned.  All real file
+   number must be >0.  */
+extern void dwarf2_directive_file PARAMS ((int dummy));
+
+/* Implements the .loc FILENO LINENO [COLUMN] directive.  FILENO is
+   the file number, LINENO the line number and the (optional) COLUMN
+   the column of the source code that the following instruction
+   corresponds to.  FILENO can be 0 to indicate that the filename
+   specified by the textually most recent .file directive should be
+   used.  */
+extern void dwarf2_directive_loc PARAMS ((int dummy));
+
+/* Returns the current source information.  If .file directives have
+   been encountered, the info for the corresponding source file is
+   returned.  Otherwise, the info for the assembly source file is
+   returned.  */
+extern void dwarf2_where PARAMS ((struct dwarf2_line_info *l));
+
+/* This function generates .debug_line info based on the address and
+   source information passed in the arguments.  ADDR should be the
+   frag-relative offset of the instruction the information is for and
+   L is the source information that should be associated with that
+   address. */
+extern void dwarf2_gen_line_info PARAMS ((addressT addr,
+					  struct dwarf2_line_info *l));
+
+/* Must be called after all other input is processed to finish up the
+   .debug_line section.  */
+extern void dwarf2_finish PARAMS ((void));
+
+#endif /* AS_DWARF2DBG_H */
diff --git a/gas/ecoff.c b/gas/ecoff.c
index c3c9375..436c8c4 100644
--- a/gas/ecoff.c
+++ b/gas/ecoff.c
@@ -1,5 +1,5 @@
 /* ECOFF debugging support.
-   Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    This file was put together by Ian Lance Taylor <ian@cygnus.com>.  A
    good deal of it comes directly from mips-tfile.c, by Michael
@@ -28,11 +28,12 @@
    ECOFF debugging information (e.g., MIPS ECOFF, MIPS ELF, Alpha
    ECOFF).  */
 
+#include "ecoff.h"
+
 #ifdef ECOFF_DEBUGGING
 
 #include "coff/internal.h"
 #include "coff/symconst.h"
-#include "ecoff.h"
 #include "aout/stab_gnu.h"
 
 #include <ctype.h>
@@ -1513,6 +1514,8 @@
 ecoff_symbol_new_hook (symbolP)
      symbolS *symbolP;
 {
+  OBJ_SYMFIELD_TYPE *obj;
+
   /* Make sure that we have a file pointer, but only if we have seen a
      file.  If we haven't seen a file, then this is a probably special
      symbol created by md_begin which may required special handling at
@@ -1521,9 +1524,10 @@
   if (cur_file_ptr == (efdr_t *) NULL
       && seen_at_least_1_file ())
     add_file ((const char *) NULL, 0, 1);
-  symbolP->ecoff_file = cur_file_ptr;
-  symbolP->ecoff_symbol = NULL;
-  symbolP->ecoff_extern_size = 0;
+  obj = symbol_get_obj (symbolP);
+  obj->ecoff_file = cur_file_ptr;
+  obj->ecoff_symbol = NULL;
+  obj->ecoff_extern_size = 0;
 }
 
 /* Add a page to a varray object.  */
@@ -1643,7 +1647,7 @@
     psym->name = str;
   psym->as_sym = sym_value;
   if (sym_value != (symbolS *) NULL)
-    sym_value->ecoff_symbol = psym;
+    symbol_get_obj (sym_value)->ecoff_symbol = psym;
   psym->addend = addend;
   psym->file_ptr = cur_file_ptr;
   psym->proc_ptr = cur_proc_ptr;
@@ -2170,7 +2174,7 @@
 
   /* Set the BSF_FUNCTION flag for the symbol.  */
   sym = symbol_find_or_make (func);
-  sym->bsym->flags |= BSF_FUNCTION;
+  symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION;
 
   /* Push the start of the function.  */
   new_proc_ptr->sym = add_ecoff_symbol ((const char *) NULL, st_Proc, sc_Text,
@@ -3122,7 +3126,8 @@
       ++input_line_pointer;
       SKIP_WHITESPACE ();
     }
-  if (isdigit (*input_line_pointer) || *input_line_pointer == '-')
+  if (isdigit ((unsigned char) *input_line_pointer)
+      || *input_line_pointer == '-')
     (void) get_absolute_expression ();
 
   demand_empty_rest_of_line ();
@@ -3150,7 +3155,7 @@
     ++input_line_pointer;
   size = get_absolute_expression ();
 
-  symbolp->ecoff_extern_size = size;
+  symbol_get_obj (symbolp)->ecoff_extern_size = size;
 }
 
 /* Parse .file directives.  */
@@ -3432,7 +3437,7 @@
 	      ignore_rest_of_line();
 	      return;
 	    }
-	  symbolP->sy_value = exp;
+	  symbol_set_value_expression (symbolP, &exp);
 	}
     }
 
@@ -3565,7 +3570,7 @@
 	listing_source_file (string);
 #endif
 
-      if (isdigit (*input_line_pointer)
+      if (isdigit ((unsigned char) *input_line_pointer)
 	  || *input_line_pointer == '-'
 	  || *input_line_pointer == '+')
 	{
@@ -3615,12 +3620,12 @@
      ECOFF symbol.  We want to compute the type of the ECOFF symbol
      independently.  */
   if (sym != (symbolS *) NULL)
-    hold = sym->ecoff_symbol;
+    hold = symbol_get_obj (sym)->ecoff_symbol;
 
   (void) add_ecoff_symbol (string, st, sc, sym, addend, value, indx);
 
   if (sym != (symbolS *) NULL)
-    sym->ecoff_symbol = hold;
+    symbol_get_obj (sym)->ecoff_symbol = hold;
 
   /* Restore normal file type.  */
   cur_file_ptr = save_file_ptr;
@@ -3657,7 +3662,7 @@
     }
 
   /* Double check weak symbols.  */
-  if (sym->bsym->flags & BSF_WEAK)
+  if (S_IS_WEAK (sym))
     {
       if (S_IS_COMMON (sym))
 	as_bad (_("Symbol `%s' can not be both weak and common"),
@@ -4083,7 +4088,8 @@
 				  || S_IS_WEAK (as_sym)
 				  || ! S_IS_DEFINED (as_sym)))
 			    {
-			      if ((as_sym->bsym->flags & BSF_FUNCTION) != 0)
+			      if ((symbol_get_bfdsym (as_sym)->flags
+				   & BSF_FUNCTION) != 0)
 				st = st_Proc;
 			      else
 				st = st_Global;
@@ -4095,18 +4101,19 @@
 
 			  if (! S_IS_DEFINED (as_sym))
 			    {
-			      if (as_sym->ecoff_extern_size == 0
-				  || (as_sym->ecoff_extern_size
-				      > bfd_get_gp_size (stdoutput)))
+			      valueT s;
+
+			      s = symbol_get_obj (as_sym)->ecoff_extern_size;
+			      if (s == 0
+				  || s > bfd_get_gp_size (stdoutput))
 				sc = sc_Undefined;
 			      else
 				{
 				  sc = sc_SUndefined;
-				  sym_ptr->ecoff_sym.asym.value =
-				    as_sym->ecoff_extern_size;
+				  sym_ptr->ecoff_sym.asym.value = s;
 				}
 #ifdef S_SET_SIZE
-			      S_SET_SIZE (as_sym, as_sym->ecoff_extern_size);
+			      S_SET_SIZE (as_sym, s);
 #endif
 			    }
 			  else if (S_IS_COMMON (as_sym))
@@ -4289,7 +4296,7 @@
 		     case this is an external symbol.  Note that this
 		     destroys the asym.index field.  */
 		  if (as_sym != (symbolS *) NULL
-		      && as_sym->ecoff_symbol == sym_ptr)
+		      && symbol_get_obj (as_sym)->ecoff_symbol == sym_ptr)
 		    {
 		      if ((sym_ptr->ecoff_sym.asym.st == st_Proc
 			   || sym_ptr->ecoff_sym.asym.st == st_StaticProc)
@@ -4658,7 +4665,7 @@
 
   for (sym = symbol_rootP; sym != (symbolS *) NULL; sym = symbol_next (sym))
     {
-      if (sym->ecoff_symbol == NULL)
+      if (symbol_get_obj (sym)->ecoff_symbol == NULL)
 	continue;
 
       /* If this is a local symbol, then force the fields to zero.  */
@@ -4666,13 +4673,16 @@
 	  && ! S_IS_WEAK (sym)
 	  && S_IS_DEFINED (sym))
 	{
-	  sym->ecoff_symbol->ecoff_sym.asym.value = 0;
-	  sym->ecoff_symbol->ecoff_sym.asym.st = (int) st_Nil;
-	  sym->ecoff_symbol->ecoff_sym.asym.sc = (int) sc_Nil;
-	  sym->ecoff_symbol->ecoff_sym.asym.index = indexNil;
+	  struct localsym *lsym;
+
+	  lsym = symbol_get_obj (sym)->ecoff_symbol;
+	  lsym->ecoff_sym.asym.value = 0;
+	  lsym->ecoff_sym.asym.st = (int) st_Nil;
+	  lsym->ecoff_sym.asym.sc = (int) sc_Nil;
+	  lsym->ecoff_sym.asym.index = indexNil;
 	}
 
-      obj_ecoff_set_ext (sym, &sym->ecoff_symbol->ecoff_sym);
+      obj_ecoff_set_ext (sym, &symbol_get_obj (sym)->ecoff_symbol->ecoff_sym);
     }
 }
 
@@ -4722,12 +4732,12 @@
   cur_proc_ptr = (proc_t *) NULL;
   for (sym = symbol_rootP; sym != (symbolS *) NULL; sym = symbol_next (sym))
     {
-      if (sym->ecoff_symbol != NULL
-	  || sym->ecoff_file == (efdr_t *) NULL
-	  || (sym->bsym->flags & BSF_SECTION_SYM) != 0)
+      if (symbol_get_obj (sym)->ecoff_symbol != NULL
+	  || symbol_get_obj (sym)->ecoff_file == (efdr_t *) NULL
+	  || (symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) != 0)
 	continue;
 
-      cur_file_ptr = sym->ecoff_file;
+      cur_file_ptr = symbol_get_obj (sym)->ecoff_file;
       add_ecoff_symbol ((const char *) NULL, st_Nil, sc_Nil, sym,
 			(bfd_vma) 0, S_GET_VALUE (sym), indexNil);
     }
diff --git a/gas/ecoff.h b/gas/ecoff.h
index 1a9b6fc..8ac65f8 100644
--- a/gas/ecoff.h
+++ b/gas/ecoff.h
@@ -1,5 +1,5 @@
 /* ecoff.h -- header file for ECOFF debugging support
-   Copyright (C) 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    Put together by Ian Lance Taylor <ian@cygnus.com>.
 
@@ -41,10 +41,10 @@
 
 /* This function should be called when a new symbol is created, by
    obj_symbol_new_hook.  */
-extern void ecoff_symbol_new_hook PARAMS ((struct symbol *));
+extern void ecoff_symbol_new_hook PARAMS ((symbolS *));
 
 /* This function should be called by the obj_frob_symbol hook.  */
-extern void ecoff_frob_symbol PARAMS ((struct symbol *));
+extern void ecoff_frob_symbol PARAMS ((symbolS *));
 
 /* Build the ECOFF debugging information.  This should be called by
    obj_frob_file.  This fills in the counts in *HDR; the offsets are
@@ -89,7 +89,7 @@
 /* This routine is called from the ECOFF code to set the external
    information for a symbol.  */
 #ifndef obj_ecoff_set_ext
-extern void obj_ecoff_set_ext PARAMS ((struct symbol *, EXTR *));
+extern void obj_ecoff_set_ext PARAMS ((symbolS *, EXTR *));
 #endif
 
 /* This routine is used to patch up a line number directive when
@@ -100,7 +100,7 @@
 extern int ecoff_no_current_file PARAMS ((void));
 
 /* This function returns the symbol associated with the current proc.  */
-extern struct symbol *ecoff_get_cur_proc_sym PARAMS ((void));
+extern symbolS *ecoff_get_cur_proc_sym PARAMS ((void));
 
 #endif /* ECOFF_DEBUGGING */
 
diff --git a/gas/expr.c b/gas/expr.c
index d5d55fd..c50e2c2 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1,5 +1,5 @@
 /* expr.c -operands, expressions-
-   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -34,6 +34,10 @@
 #include "obstack.h"
 
 static void floating_constant PARAMS ((expressionS * expressionP));
+static valueT generic_bignum_to_int32 PARAMS ((void));
+#ifdef BFD64
+static valueT generic_bignum_to_int64 PARAMS ((void));
+#endif
 static void integer_constant PARAMS ((int radix, expressionS * expressionP));
 static void mri_char_constant PARAMS ((expressionS *));
 static void current_location PARAMS ((expressionS *));
@@ -100,7 +104,7 @@
 			    ? absolute_section
 			    : expr_section),
 			   0, &zero_address_frag);
-  symbolP->sy_value = *expressionP;
+  symbol_set_value_expression (symbolP, expressionP);
 
   if (expressionP->X_op == O_constant)
     resolve_symbol_value (symbolP, 1);
@@ -985,7 +989,9 @@
       break;
 
     case '(':
+#ifndef NEED_INDEX_OPERATOR
     case '[':
+#endif
       /* didn't begin with digit & not a name */
       segment = expression (expressionP);
       /* Expression() will pass trailing whitespace */
@@ -1305,7 +1311,7 @@
 
   /* The PA port needs this information.  */
   if (expressionP->X_add_symbol)
-    expressionP->X_add_symbol->sy_used = 1;
+    symbol_mark_used (expressionP->X_add_symbol);
 
   switch (expressionP->X_op)
     {
@@ -1352,8 +1358,8 @@
       break;
     case O_subtract:
       if (expressionP->X_op_symbol == expressionP->X_add_symbol
-	  || ((expressionP->X_op_symbol->sy_frag
-	       == expressionP->X_add_symbol->sy_frag)
+	  || ((symbol_get_frag (expressionP->X_op_symbol)
+	       == symbol_get_frag (expressionP->X_add_symbol))
 	      && SEG_NORMAL (S_GET_SEGMENT (expressionP->X_add_symbol))
 	      && (S_GET_VALUE (expressionP->X_op_symbol)
 		  == S_GET_VALUE (expressionP->X_add_symbol))))
@@ -1411,7 +1417,13 @@
   __, __, __, __, __, __, __, __,
   __, __, __, __, __, __, __, __,
   __, __, __, __, __, __, __, __,
-  __, __, __, __, __, __, O_bit_exclusive_or, __,
+  __, __, __,
+#ifdef NEED_INDEX_OPERATOR
+  O_index,
+#else
+  __,
+#endif
+  __, __, O_bit_exclusive_or, __,
   __, __, __, __, __, __, __, __,
   __, __, __, __, __, __, __, __,
   __, __, __, __, __, __, __, __,
@@ -1449,28 +1461,29 @@
   0,	/* O_symbol_rva */
   0,	/* O_register */
   0,	/* O_bit */
-  8,	/* O_uminus */
-  8,	/* O_bit_not */
-  8,	/* O_logical_not */
-  7,	/* O_multiply */
-  7,	/* O_divide */
-  7,	/* O_modulus */
-  7,	/* O_left_shift */
-  7,	/* O_right_shift */
-  6,	/* O_bit_inclusive_or */
-  6,	/* O_bit_or_not */
-  6,	/* O_bit_exclusive_or */
-  6,	/* O_bit_and */
-  4,	/* O_add */
-  4,	/* O_subtract */
-  3,	/* O_eq */
-  3,	/* O_ne */
-  3,	/* O_lt */
-  3,	/* O_le */
-  3,	/* O_ge */
-  3,	/* O_gt */
-  2,	/* O_logical_and */
-  1	/* O_logical_or */
+  9,	/* O_uminus */
+  9,	/* O_bit_not */
+  9,	/* O_logical_not */
+  8,	/* O_multiply */
+  8,	/* O_divide */
+  8,	/* O_modulus */
+  8,	/* O_left_shift */
+  8,	/* O_right_shift */
+  7,	/* O_bit_inclusive_or */
+  7,	/* O_bit_or_not */
+  7,	/* O_bit_exclusive_or */
+  7,	/* O_bit_and */
+  5,	/* O_add */
+  5,	/* O_subtract */
+  4,	/* O_eq */
+  4,	/* O_ne */
+  4,	/* O_lt */
+  4,	/* O_le */
+  4,	/* O_ge */
+  4,	/* O_gt */
+  3,	/* O_logical_and */
+  2,	/* O_logical_or */
+  1,	/* O_index */
 };
 
 /* Unfortunately, in MRI mode for the m68k, multiplication and
@@ -1637,6 +1650,17 @@
 
       know (*input_line_pointer != ' ');
 
+      if (op_left == O_index)
+	{
+	  if (*input_line_pointer != ']')
+	    as_bad ("missing right bracket");
+	  else
+	    {
+	      ++input_line_pointer;
+	      SKIP_WHITESPACE ();
+	    }
+	}
+
       if (retval == undefined_section)
 	{
 	  if (SEG_NORMAL (rightseg))
@@ -1696,8 +1720,8 @@
       else if (op_left == O_subtract
 	       && right.X_op == O_symbol
 	       && resultP->X_op == O_symbol
-	       && (right.X_add_symbol->sy_frag
-		   == resultP->X_add_symbol->sy_frag)
+	       && (symbol_get_frag (right.X_add_symbol)
+		   == symbol_get_frag (resultP->X_add_symbol))
 	       && SEG_NORMAL (S_GET_SEGMENT (right.X_add_symbol)))
 
 	{
@@ -1811,7 +1835,7 @@
 
   /* The PA port needs this information.  */
   if (resultP->X_add_symbol)
-    resultP->X_add_symbol->sy_used = 1;
+    symbol_mark_used (resultP->X_add_symbol);
 
   return resultP->X_op == O_constant ? absolute_section : retval;
 }
@@ -1839,9 +1863,13 @@
   /* We accept \001 in a name in case this is being called with a
      constructed string.  */
   if (is_name_beginner (c = *input_line_pointer++) || c == '\001')
-    while (is_part_of_name (c = *input_line_pointer++)
-	   || c == '\001')
-      ;
+    {
+      while (is_part_of_name (c = *input_line_pointer++)
+	     || c == '\001')
+	;
+      if (is_name_ender (c))
+	c = *input_line_pointer++;
+    }
   *--input_line_pointer = 0;
   return (c);
 }
diff --git a/gas/expr.h b/gas/expr.h
index da90743..e376409 100644
--- a/gas/expr.h
+++ b/gas/expr.h
@@ -1,5 +1,5 @@
 /* expr.h -> header file for expr.c
-   Copyright (C) 1987, 92-97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1987, 92-98, 1999 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -102,6 +102,8 @@
   O_logical_and,
   /* (X_add_symbol || X_op_symbol) + X_add_number.  */
   O_logical_or,
+  /* X_op_symbol [ X_add_symbol ] */
+  O_index,
   /* this must be the largest value */
   O_max
 } operatorT;
@@ -109,18 +111,18 @@
 typedef struct expressionS
 {
   /* The main symbol.  */
-  struct symbol *X_add_symbol;
+  symbolS *X_add_symbol;
   /* The second symbol, if needed.  */
-  struct symbol *X_op_symbol;
+  symbolS *X_op_symbol;
   /* A number to add.  */
   offsetT X_add_number;
   /* The type of the expression.  We can't assume that an arbitrary
      compiler can handle a bitfield of enum type.  FIXME: We could
      check this using autoconf.  */
 #ifdef __GNUC__
-  operatorT X_op : 5;
+  operatorT X_op : 7;
 #else
-  unsigned X_op : 5;
+  unsigned X_op : 7;
 #endif
   /* Non-zero if X_add_number should be regarded as unsigned.  This is
      only valid for O_constant expressions.  It is only used when an
@@ -149,14 +151,13 @@
 extern void expr_set_precedence PARAMS ((void));
 extern segT expr PARAMS ((int rank, expressionS * resultP));
 extern unsigned int get_single_number PARAMS ((void));
-extern struct symbol *make_expr_symbol PARAMS ((expressionS * expressionP));
+extern symbolS *make_expr_symbol PARAMS ((expressionS * expressionP));
 extern int expr_symbol_where
-  PARAMS ((struct symbol *, char **, unsigned int *));
+  PARAMS ((symbolS *, char **, unsigned int *));
 
-extern struct symbol * expr_build_uconstant PARAMS ((offsetT));
-extern struct symbol * expr_build_unary PARAMS ((operatorT, struct symbol *));
-extern struct symbol * expr_build_binary
-  PARAMS ((operatorT, struct symbol *, struct symbol *));
-extern struct symbol * expr_build_dot PARAMS ((void));
+extern symbolS *expr_build_uconstant PARAMS ((offsetT));
+extern symbolS *expr_build_unary PARAMS ((operatorT, symbolS *));
+extern symbolS *expr_build_binary PARAMS ((operatorT, symbolS *, symbolS *));
+extern symbolS *expr_build_dot PARAMS ((void));
 
 /* end of expr.h */
diff --git a/gas/frags.h b/gas/frags.h
index 9590292..b188e33 100644
--- a/gas/frags.h
+++ b/gas/frags.h
@@ -1,5 +1,5 @@
 /* frags.h - Header file for the frag concept.
-   Copyright (C) 1987, 92, 93, 94, 95, 97, 1998
+   Copyright (C) 1987, 92, 93, 94, 95, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -54,7 +54,7 @@
   /* (Variable) number of chars after above.  May be 0. */
   offsetT fr_var;
   /* For variable-length tail. */
-  struct symbol *fr_symbol;
+  symbolS *fr_symbol;
   /* For variable-length tail. */
   offsetT fr_offset;
   /* Points to opcode low addr byte, for relaxation.  */
diff --git a/gas/gasp.c b/gas/gasp.c
index fbb65e3..d8b98b3 100644
--- a/gas/gasp.c
+++ b/gas/gasp.c
@@ -76,6 +76,11 @@
    it.  */
 extern void as_abort PARAMS ((const char *, int, const char *));
 
+/* The default obstack chunk size.  If we set this to zero, the
+   obstack code will use whatever will fit in a 4096 byte block.  This
+   is used by the hash table code used by macro.c.  */
+int chunksize = 0;
+
 #define MAX_INCLUDES 30		/* Maximum include depth */
 #define MAX_REASONABLE 1000	/* Maximum number of expansions */
 
diff --git a/gas/hash.c b/gas/hash.c
index dccd660..0f129fb 100644
--- a/gas/hash.c
+++ b/gas/hash.c
@@ -1,5 +1,5 @@
-/* hash.c - hash table lookup strings -
-   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 1998
+/* hash.c -- gas hash table code
+   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -15,835 +15,408 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with GAS; see the file COPYING.  If not, write to
-   the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.  */
 
-/*
- * BUGS, GRIPES, APOLOGIA etc.
- *
- * A typical user doesn't need ALL this: I intend to make a library out
- * of it one day - Dean Elsner.
- * Also, I want to change the definition of a symbol to (address,length)
- * so I can put arbitrary binary in the names stored. [see hsh.c for that]
- *
- * This slime is common coupled inside the module. Com-coupling (and other
- * vandalism) was done to speed running time. The interfaces at the
- * module's edges are adequately clean.
- *
- * There is no way to (a) run a test script through this heap and (b)
- * compare results with previous scripts, to see if we have broken any
- * code. Use GNU (f)utilities to do this. A few commands assist test.
- * The testing is awkward: it tries to be both batch & interactive.
- * For now, interactive rules!
- */
-
-/*
- *  The idea is to implement a symbol table. A test jig is here.
- *  Symbols are arbitrary strings; they can't contain '\0'.
- *	[See hsh.c for a more general symbol flavour.]
- *  Each symbol is associated with a char*, which can point to anything
- *  you want, allowing an arbitrary property list for each symbol.
- *
- *  The basic operations are:
- *
- *    new                     creates symbol table, returns handle
- *    find (symbol)           returns char*
- *    insert (symbol,char*)   error if symbol already in table
- *    delete (symbol)         returns char* if symbol was in table
- *    apply                   so you can delete all symbols before die()
- *    die                     destroy symbol table (free up memory)
- *
- *  Supplementary functions include:
- *
- *    say                     how big? what % full?
- *    replace (symbol,newval) report previous value
- *    jam (symbol,value)      assert symbol:=value
- *
- *  You, the caller, have control over errors: this just reports them.
- *
- *  This package requires malloc(), free().
- *  Malloc(size) returns NULL or address of char[size].
- *  Free(address) frees same.
- */
-
-/*
- *  The code and its structures are re-enterent.
- *
- *  Before you do anything else, you must call hash_new() which will
- *  return the address of a hash-table-control-block.  You then use
- *  this address as a handle of the symbol table by passing it to all
- *  the other hash_...() functions.  The only approved way to recover
- *  the memory used by the symbol table is to call hash_die() with the
- *  handle of the symbol table.
- *
- *  Before you call hash_die() you normally delete anything pointed to
- *  by individual symbols. After hash_die() you can't use that symbol
- *  table again.
- *
- *  The char* you associate with a symbol may not be NULL (0) because
- *  NULL is returned whenever a symbol is not in the table. Any other
- *  value is OK, except DELETED, #defined below.
- *
- *  When you supply a symbol string for insertion, YOU MUST PRESERVE THE
- *  STRING until that symbol is deleted from the table. The reason is that
- *  only the address you supply, NOT the symbol string itself, is stored
- *  in the symbol table.
- *
- *  You may delete and add symbols arbitrarily.
- *  Any or all symbols may have the same 'value' (char *). In fact, these
- *  routines don't do anything with your symbol values.
- *
- *  You have no right to know where the symbol:char* mapping is stored,
- *  because it moves around in memory; also because we may change how it
- *  works and we don't want to break your code do we? However the handle
- *  (address of struct hash_control) is never changed in
- *  the life of the symbol table.
- *
- *  What you CAN find out about a symbol table is:
- *    how many slots are in the hash table?
- *    how many slots are filled with symbols?
- *    (total hashes,collisions) for (reads,writes) (*)
- *  All of the above values vary in time.
- *  (*) some of these numbers will not be meaningful if we change the
- *  internals. */
-
-/*
- *  I N T E R N A L
- *
- *  Hash table is an array of hash_entries; each entry is a pointer to a
- *  a string and a user-supplied value 1 char* wide.
- *
- *  The array always has 2 ** n elements, n>0, n integer.
- *  There is also a 'wall' entry after the array, which is always empty
- *  and acts as a sentinel to stop running off the end of the array.
- *  When the array gets too full, we create a new array twice as large
- *  and re-hash the symbols into the new array, then forget the old array.
- *  (Of course, we copy the values into the new array before we junk the
- *  old array!)
- *
- */
-
-#include <stdio.h>
-
-#ifndef FALSE
-#define FALSE	(0)
-#define TRUE	(!FALSE)
-#endif /* no FALSE yet */
-
-#include <ctype.h>
-#define min(a, b)	((a) < (b) ? (a) : (b))
+/* This version of the hash table code is a wholescale replacement of
+   the old hash table code, which was fairly bad.  This is based on
+   the hash table code in BFD, but optimized slightly for the
+   asssembler.  The assembler does not need to derive structures that
+   are stored in the hash table.  Instead, it always stores a pointer.
+   The assembler uses the hash table mostly to store symbols, and we
+   don't need to confuse the symbol structure with a hash table
+   structure.  */
 
 #include "as.h"
+#include "obstack.h"
 
-#define error	as_fatal
+/* The default number of entries to use when creating a hash table.  */
 
-static char _deleted_[1];
-#define DELETED     ((PTR)_deleted_)	/* guarenteed unique address */
-#define START_POWER    (10)	/* power of two: size of new hash table */
+#define DEFAULT_SIZE (4051)
 
-/* TRUE if a symbol is in entry @ ptr.  */
-#define islive(ptr) (ptr->hash_string && ptr->hash_string!=DELETED)
+/* An entry in a hash table.  */
 
-enum stat_enum {
-  /* Number of slots in hash table.  The wall does not count here.
-     We expect this is always a power of 2.  */
-  STAT_SIZE = 0,
-  /* Number of hash_ask calls.  */
-  STAT_ACCESS,
-  STAT_ACCESS_w,
-  /* Number of collisions (total).  This may exceed STAT_ACCESS if we
-     have lots of collisions/access.  */
-  STAT_COLLIDE,
-  STAT_COLLIDE_w,
-  /* Slots used right now.  */
-  STAT_USED,
-  /* How many string compares?  */
-  STAT_STRCMP,
-  STAT_STRCMP_w,
-  /* Size of statistics block... this must be last.  */
-  STATLENGTH
-};
-#define STAT__READ     (0)	/* reading */
-#define STAT__WRITE    (1)	/* writing */
-
-/* When we grow a hash table, by what power of two do we increase it?  */
-#define GROW_FACTOR 1
-/* When should we grow it?  */
-#define FULL_VALUE(N)	((N) / 2)
-
-/* #define SUSPECT to do runtime checks */
-/* #define TEST to be a test jig for hash...() */
-
-#ifdef TEST
-/* TEST: use smaller hash table */
-#undef  START_POWER
-#define START_POWER (3)
-#undef  START_SIZE
-#define START_SIZE  (8)
-#undef  START_FULL
-#define START_FULL  (4)
-#endif
-
 struct hash_entry
 {
-  const char *hash_string;	/* points to where the symbol string is */
-  /* NULL means slot is not used */
-  /* DELETED means slot was deleted */
-  PTR hash_value;		/* user's datum, associated with symbol */
-  unsigned long h;
+  /* Next entry for this hash code.  */
+  struct 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;
+  /* Pointer being stored in the hash table.  */
+  PTR data;
 };
 
-struct hash_control {
-  struct hash_entry *hash_where;/* address of hash table */
-  int hash_sizelog;		/* Log of ( hash_mask + 1 ) */
-  int hash_mask;		/* masks a hash into index into table */
-  int hash_full;		/* when hash_stat[STAT_USED] exceeds this, */
-  /* grow table */
-  struct hash_entry *hash_wall;	/* point just after last (usable) entry */
-  /* here we have some statistics */
-  int hash_stat[STATLENGTH];	/* lies & statistics */
+/* A hash table.  */
+
+struct hash_control
+{
+  /* The hash array.  */
+  struct hash_entry **table;
+  /* The number of slots in the hash table.  */
+  unsigned int size;
+  /* An obstack for this hash table.  */
+  struct obstack memory;
+
+#ifdef HASH_STATISTICS
+  /* Statistics.  */
+  unsigned long lookups;
+  unsigned long hash_compares;
+  unsigned long string_compares;
+  unsigned long insertions;
+  unsigned long replacements;
+  unsigned long deletions;
+#endif /* HASH_STATISTICS */
 };
-
-/*------------------ plan ---------------------------------- i = internal
 
-  struct hash_control * c;
-  struct hash_entry   * e;                                                    i
-  int                   b[z];     buffer for statistics
-  z         size of b
-  char                * s;        symbol string (address) [ key ]
-  char                * v;        value string (address)  [datum]
-  boolean               f;        TRUE if we found s in hash table            i
-  char                * t;        error string; 0 means OK
-  int                   a;        access type [0...n)                         i
+/* Create a hash table.  This return a control block.  */
 
-  c=hash_new       ()             create new hash_control
-
-  hash_die         (c)            destroy hash_control (and hash table)
-  table should be empty.
-  doesn't check if table is empty.
-  c has no meaning after this.
-
-  hash_say         (c,b,z)        report statistics of hash_control.
-  also report number of available statistics.
-
-  v=hash_delete    (c,s)          delete symbol, return old value if any.
-  ask()                       NULL means no old value.
-  f
-
-  v=hash_replace   (c,s,v)        replace old value of s with v.
-  ask()                       NULL means no old value: no table change.
-  f
-
-  t=hash_insert    (c,s,v)        insert (s,v) in c.
-  ask()                       return error string.
-  f                           it is an error to insert if s is already
-  in table.
-  if any error, c is unchanged.
-
-  t=hash_jam       (c,s,v)        assert that new value of s will be v.       i
-  ask()                       it may decide to GROW the table.            i
-  f                                                                       i
-  grow()                                                                  i
-  t=hash_grow      (c)            grow the hash table.                        i
-  jam()                       will invoke JAM.                            i
-
-  ?=hash_apply     (c,y)          apply y() to every symbol in c.
-  y                           evtries visited in 'unspecified' order.
-
-  v=hash_find      (c,s)          return value of s, or NULL if s not in c.
-  ask()
-  f
-
-  f,e=hash_ask()   (c,s,a)        return slot where s SHOULD live.            i
-  code()                      maintain collision stats in c.              i
-
-  .=hash_code      (c,s)          compute hash-code for s,                    i
-  from parameters of c.                       i
-
-  */
-
-/* Returned by hash_ask() to stop extra testing. hash_ask() wants to
-   return both a slot and a status. This is the status.  TRUE: found
-   symbol FALSE: absent: empty or deleted slot Also returned by
-   hash_jam().  TRUE: we replaced a value FALSE: we inserted a value.  */
-static char hash_found;
-
-static struct hash_entry *hash_ask PARAMS ((struct hash_control *,
-					    const char *, int));
-static int hash_code PARAMS ((struct hash_control *, const char *));
-static const char *hash_grow PARAMS ((struct hash_control *));
-
-/* Create a new hash table.  Return NULL if failed; otherwise return handle
-   (address of struct hash).  */
 struct hash_control *
 hash_new ()
 {
-  struct hash_control *retval;
-  struct hash_entry *room;	/* points to hash table */
-  struct hash_entry *wall;
-  struct hash_entry *entry;
-  int *ip;		/* scan stats block of struct hash_control */
-  int *nd;		/* limit of stats block */
+  unsigned int size;
+  struct hash_control *ret;
+  unsigned int alloc;
 
-  room = (struct hash_entry *) xmalloc (sizeof (struct hash_entry)
-					/* +1 for the wall entry */
-					* ((1 << START_POWER) + 1));
-  retval = (struct hash_control *) xmalloc (sizeof (struct hash_control));
+  size = DEFAULT_SIZE;
 
-  nd = retval->hash_stat + STATLENGTH;
-  for (ip = retval->hash_stat; ip < nd; ip++)
-    *ip = 0;
+  ret = (struct hash_control *) xmalloc (sizeof *ret);
+  obstack_begin (&ret->memory, chunksize);
+  alloc = size * sizeof (struct hash_entry *);
+  ret->table = (struct hash_entry **) obstack_alloc (&ret->memory, alloc);
+  memset (ret->table, 0, alloc);
+  ret->size = size;
 
-  retval->hash_stat[STAT_SIZE] = 1 << START_POWER;
-  retval->hash_mask = (1 << START_POWER) - 1;
-  retval->hash_sizelog = START_POWER;
-  /* works for 1's compl ok */
-  retval->hash_where = room;
-  retval->hash_wall =
-    wall = room + (1 << START_POWER);
-  retval->hash_full = FULL_VALUE (1 << START_POWER);
-  for (entry = room; entry <= wall; entry++)
-    entry->hash_string = NULL;
-  return retval;
+#ifdef HASH_STATISTICS
+  ret->lookups = 0;
+  ret->hash_compares = 0;
+  ret->string_compares = 0;
+  ret->insertions = 0;
+  ret->replacements = 0;
+  ret->deletions = 0;
+#endif
+
+  return ret;  
 }
 
-/*
- *           h a s h _ d i e ( )
- *
- * Table should be empty, but this is not checked.
- * To empty the table, try hash_apply()ing a symbol deleter.
- * Return to free memory both the hash table and it's control
- * block.
- * 'handle' has no meaning after this function.
- * No errors are recoverable.
- */
+/* Delete a hash table, freeing all allocated memory.  */
+
 void
-hash_die (handle)
-     struct hash_control *handle;
+hash_die (table)
+     struct hash_control *table;
 {
-  free ((char *) handle->hash_where);
-  free ((char *) handle);
-}
-
-#ifdef TEST
-/*
- *           h a s h _ s a y ( )
- *
- * Return the size of the statistics table, and as many statistics as
- * we can until either (a) we have run out of statistics or (b) caller
- * has run out of buffer.
- * NOTE: hash_say treats all statistics alike.
- * These numbers may change with time, due to insertions, deletions
- * and expansions of the table.
- * The first "statistic" returned is the length of hash_stat[].
- * Then contents of hash_stat[] are read out (in ascending order)
- * until your buffer or hash_stat[] is exausted.
- */
-static void
-hash_say (handle, buffer, bufsiz)
-     struct hash_control *handle;
-     int buffer[ /*bufsiz*/ ];
-     int bufsiz;
-{
-  int *nd;		/* limit of statistics block */
-  int *ip;		/* scan statistics */
-
-  ip = handle->hash_stat;
-  nd = ip + min (bufsiz - 1, STATLENGTH);
-  if (bufsiz > 0)		/* trust nothing! bufsiz<=0 is dangerous */
-    {
-      *buffer++ = STATLENGTH;
-      for (; ip < nd; ip++, buffer++)
-	{
-	  *buffer = *ip;
-	}
-    }
-}
-#endif
-
-/*
- *           h a s h _ d e l e t e ( )
- *
- * Try to delete a symbol from the table.
- * If it was there, return its value (and adjust STAT_USED).
- * Otherwise, return NULL.
- * Anyway, the symbol is not present after this function.
- *
- */
-PTR				/* NULL if string not in table, else */
-/* returns value of deleted symbol */
-hash_delete (handle, string)
-     struct hash_control *handle;
-     const char *string;
-{
-  PTR retval;
-  struct hash_entry *entry;
-
-  entry = hash_ask (handle, string, STAT__WRITE);
-  if (hash_found)
-    {
-      retval = entry->hash_value;
-      entry->hash_string = DELETED;
-      handle->hash_stat[STAT_USED] -= 1;
-#ifdef SUSPECT
-      if (handle->hash_stat[STAT_USED] < 0)
-	{
-	  error ("hash_delete");
-	}
-#endif /* def SUSPECT */
-    }
-  else
-    {
-      retval = NULL;
-    }
-  return (retval);
-}
-
-/*
- *                   h a s h _ r e p l a c e ( )
- *
- * Try to replace the old value of a symbol with a new value.
- * Normally return the old value.
- * Return NULL and don't change the table if the symbol is not already
- * in the table.
- */
-PTR
-hash_replace (handle, string, value)
-     struct hash_control *handle;
-     const char *string;
-     PTR value;
-{
-  struct hash_entry *entry;
-  char *retval;
-
-  entry = hash_ask (handle, string, STAT__WRITE);
-  if (hash_found)
-    {
-      retval = entry->hash_value;
-      entry->hash_value = value;
-    }
-  else
-    {
-      retval = NULL;
-    }
-  ;
-  return retval;
-}
-
-/*
- *                   h a s h _ i n s e r t ( )
- *
- * Insert a (symbol-string, value) into the hash table.
- * Return an error string, 0 means OK.
- * It is an 'error' to insert an existing symbol.
- */
-
-const char *			/* return error string */
-hash_insert (handle, string, value)
-     struct hash_control *handle;
-     const char *string;
-     PTR value;
-{
-  struct hash_entry *entry;
-  const char *retval;
-
-  retval = 0;
-  if (handle->hash_stat[STAT_USED] > handle->hash_full)
-    {
-      retval = hash_grow (handle);
-    }
-  if (!retval)
-    {
-      entry = hash_ask (handle, string, STAT__WRITE);
-      if (hash_found)
-	{
-	  retval = "exists";
-	}
-      else
-	{
-	  entry->hash_value = value;
-	  entry->hash_string = string;
-	  handle->hash_stat[STAT_USED] += 1;
-	}
-    }
-  return retval;
-}
-
-/*
- *               h a s h _ j a m ( )
- *
- * Regardless of what was in the symbol table before, after hash_jam()
- * the named symbol has the given value. The symbol is either inserted or
- * (its value is) replaced.
- * An error message string is returned, 0 means OK.
- *
- * WARNING: this may decide to grow the hashed symbol table.
- * To do this, we call hash_grow(), WHICH WILL recursively CALL US.
- *
- * We report status internally: hash_found is TRUE if we replaced, but
- * false if we inserted.
- */
-const char *
-hash_jam (handle, string, value)
-     struct hash_control *handle;
-     const char *string;
-     PTR value;
-{
-  const char *retval;
-  struct hash_entry *entry;
-
-  retval = 0;
-  if (handle->hash_stat[STAT_USED] > handle->hash_full)
-    {
-      retval = hash_grow (handle);
-    }
-  if (!retval)
-    {
-      entry = hash_ask (handle, string, STAT__WRITE);
-      if (!hash_found)
-	{
-	  entry->hash_string = string;
-	  handle->hash_stat[STAT_USED] += 1;
-	}
-      entry->hash_value = value;
-    }
-  return retval;
+  obstack_free (&table->memory, 0);
+  free (table);
 }
 
-/*
- *               h a s h _ g r o w ( )
- *
- * Grow a new (bigger) hash table from the old one.
- * We choose to double the hash table's size.
- * Return a human-scrutible error string: 0 if OK.
- * Warning! This uses hash_jam(), which had better not recurse
- * back here! Hash_jam() conditionally calls us, but we ALWAYS
- * call hash_jam()!
- * Internal.
- */
-static const char *
-hash_grow (handle)		/* make a hash table grow */
-     struct hash_control *handle;
+/* Look up a string in a hash table.  This returns a pointer to the
+   hash_entry, or NULL if the string is not in the table.  If PLIST is
+   not NULL, this sets *PLIST to point to the start of the list which
+   would hold this hash entry.  If PHASH is not NULL, this sets *PHASH
+   to the hash code for KEY.
+
+   Each time we look up a string, we move it to the start of the list
+   for its hash code, to take advantage of referential locality.  */
+
+static struct hash_entry *hash_lookup PARAMS ((struct hash_control *,
+					       const char *,
+					       struct hash_entry ***,
+					       unsigned long *));
+
+static struct hash_entry *
+hash_lookup (table, key, plist, phash)
+     struct hash_control *table;
+     const char *key;
+     struct hash_entry ***plist;
+     unsigned long *phash;
 {
-  struct hash_entry *newwall;
-  struct hash_entry *newwhere;
-  struct hash_entry *newtrack;
-  struct hash_entry *oldtrack;
-  struct hash_entry *oldwhere;
-  struct hash_entry *oldwall;
-  int temp;
-  int newsize;
-  const char *string;
-  const char *retval;
-#ifdef SUSPECT
-  int oldused;
+  register unsigned long hash;
+  unsigned int len;
+  register const unsigned char *s;
+  register unsigned int c;
+  unsigned int index;
+  struct hash_entry **list;
+  struct hash_entry *p;
+  struct hash_entry *prev;
+
+#ifdef HASH_STATISTICS
+  ++table->lookups;
 #endif
 
-  /*
-   * capture info about old hash table
-   */
-  oldwhere = handle->hash_where;
-  oldwall = handle->hash_wall;
-#ifdef SUSPECT
-  oldused = handle->hash_stat[STAT_USED];
-#endif
-  /*
-   * attempt to get enough room for a hash table twice as big
-   */
-  temp = handle->hash_stat[STAT_SIZE];
-  newwhere = ((struct hash_entry *)
-	      xmalloc ((unsigned long) ((temp << (GROW_FACTOR + 1))
-					/* +1 for wall slot */
-					* sizeof (struct hash_entry))));
-  if (newwhere == NULL)
-    return "no_room";
-
-  /*
-   * have enough room: now we do all the work.
-   * double the size of everything in handle.
-   */
-  handle->hash_mask = ((handle->hash_mask + 1) << GROW_FACTOR) - 1;
-  handle->hash_stat[STAT_SIZE] <<= GROW_FACTOR;
-  newsize = handle->hash_stat[STAT_SIZE];
-  handle->hash_where = newwhere;
-  handle->hash_full <<= GROW_FACTOR;
-  handle->hash_sizelog += GROW_FACTOR;
-  handle->hash_wall = newwall = newwhere + newsize;
-  /* Set all those pesky new slots to vacant.  */
-  for (newtrack = newwhere; newtrack <= newwall; newtrack++)
-    newtrack->hash_string = NULL;
-  /* We will do a scan of the old table, the hard way, using the
-   * new control block to re-insert the data into new hash table.  */
-  handle->hash_stat[STAT_USED] = 0;
-  for (oldtrack = oldwhere; oldtrack < oldwall; oldtrack++)
-    if (((string = oldtrack->hash_string) != NULL) && string != DELETED)
-      if ((retval = hash_jam (handle, string, oldtrack->hash_value)))
-	return retval;
-
-#ifdef SUSPECT
-  if (handle->hash_stat[STAT_USED] != oldused)
-    return "hash_used";
-#endif
-
-  /* We have a completely faked up control block.
-     Return the old hash table.  */
-  free ((char *) oldwhere);
-
-  return 0;
-}
-
-#ifdef TEST
-/*
- *          h a s h _ a p p l y ( )
- *
- * Use this to scan each entry in symbol table.
- * For each symbol, this calls (applys) a nominated function supplying the
- * symbol's value (and the symbol's name).
- * The idea is you use this to destroy whatever is associted with
- * any values in the table BEFORE you destroy the table with hash_die.
- * Of course, you can use it for other jobs; whenever you need to
- * visit all extant symbols in the table.
- *
- * We choose to have a call-you-back idea for two reasons:
- *  asthetic: it is a neater idea to use apply than an explicit loop
- *  sensible: if we ever had to grow the symbol table (due to insertions)
- *            then we would lose our place in the table when we re-hashed
- *            symbols into the new table in a different order.
- *
- * The order symbols are visited depends entirely on the hashing function.
- * Whenever you insert a (symbol, value) you risk expanding the table. If
- * you do expand the table, then the hashing function WILL change, so you
- * MIGHT get a different order of symbols visited. In other words, if you
- * want the same order of visiting symbols as the last time you used
- * hash_apply() then you better not have done any hash_insert()s or
- * hash_jam()s since the last time you used hash_apply().
- *
- * In future we may use the value returned by your nominated function.
- * One idea is to abort the scan if, after applying the function to a
- * certain node, the function returns a certain code.
- *
- * The function you supply should be of the form:
- *      void myfunct(string,value)
- *              char * string;        |* the symbol's name *|
- *              char * value;         |* the symbol's value *|
- *      {
- *        |* ... *|
- *      }
- *
- */
-void
-hash_apply (handle, function)
-     struct hash_control *handle;
-     void (*function) ();
-{
-  struct hash_entry *entry;
-  struct hash_entry *wall;
-
-  wall = handle->hash_wall;
-  for (entry = handle->hash_where; entry < wall; entry++)
+  hash = 0;
+  len = 0;
+  s = (const unsigned char *) key;
+  while ((c = *s++) != '\0')
     {
-      if (islive (entry))	/* silly code: tests entry->string twice! */
-	{
-	  (*function) (entry->hash_string, entry->hash_value);
-	}
-    }
-}
-#endif
-
-/*
- *          h a s h _ f i n d ( )
- *
- * Given symbol string, find value (if any).
- * Return found value or NULL.
- */
-PTR
-hash_find (handle, string)
-     struct hash_control *handle;
-     const char *string;
-{
-  struct hash_entry *entry;
-
-  entry = hash_ask (handle, string, STAT__READ);
-  if (hash_found)
-    return entry->hash_value;
-  else
-    return NULL;
-}
-
-/*
- *          h a s h _ a s k ( )
- *
- * Searches for given symbol string.
- * Return the slot where it OUGHT to live. It may be there.
- * Return hash_found: TRUE only if symbol is in that slot.
- * Access argument is to help keep statistics in control block.
- * Internal.
- */
-static struct hash_entry *	/* string slot, may be empty or deleted */
-hash_ask (handle, string, access_type)
-     struct hash_control *handle;
-     const char *string;
-     int access_type;
-{
-  const char *s;
-  struct hash_entry *slot;
-  int collision;	/* count collisions */
-  int strcmps;
-  int hcode;
-
-  /* start looking here */
-  hcode = hash_code (handle, string);
-  slot = handle->hash_where + (hcode & handle->hash_mask);
-
-  handle->hash_stat[STAT_ACCESS + access_type] += 1;
-  collision = strcmps = 0;
-  hash_found = FALSE;
-  while (((s = slot->hash_string) != NULL) && s != DELETED)
-    {
-      if (string == s)
-	{
-	  hash_found = TRUE;
-	  break;
-	}
-      if (slot->h == (unsigned long) hcode)
-	{
-	  if (!strcmp (string, s))
-	    {
-	      hash_found = TRUE;
-	      break;
-	    }
-	  strcmps++;
-	}
-      collision++;
-      slot++;
-    }
-  /*
-   * slot:                                                      return:
-   *       in use:     we found string                           slot
-   *       at empty:
-   *                   at wall:        we fell off: wrap round   ????
-   *                   in table:       dig here                  slot
-   *       at DELETED: dig here                                  slot
-   */
-  if (slot == handle->hash_wall)
-    {
-      slot = handle->hash_where;/* now look again */
-      while (((s = slot->hash_string) != NULL) && s != DELETED)
-	{
-	  if (string == s)
-	    {
-	      hash_found = TRUE;
-	      break;
-	    }
-	  if (slot->h == (unsigned long) hcode)
-	    {
-	      if (!strcmp (string, s))
-		{
-		  hash_found = TRUE;
-		  break;
-		}
-	      strcmps++;
-	    }
-	  collision++;
-	  slot++;
-	}
-      /*
-       * slot:                                                   return:
-       *       in use: we found it                                slot
-       *       empty:  wall:         ERROR IMPOSSIBLE             !!!!
-       *               in table:     dig here                     slot
-       *       DELETED:dig here                                   slot
-       */
-    }
-  handle->hash_stat[STAT_COLLIDE + access_type] += collision;
-  handle->hash_stat[STAT_STRCMP + access_type] += strcmps;
-  if (!hash_found)
-    slot->h = hcode;
-  return slot;			/* also return hash_found */
-}
-
-/*
- *           h a s h _ c o d e
- *
- * Does hashing of symbol string to hash number.
- * Internal.
- */
-static int
-hash_code (handle, string)
-     struct hash_control *handle;
-     const char *string;
-{
-#if 1 /* There seems to be some interesting property of this function
-	 that prevents the bfd version below from being an adequate
-	 substitute.  @@ Figure out what this property is!  */
-  long h;		/* hash code built here */
-  long c;		/* each character lands here */
-  int n;		/* Amount to shift h by */
-
-  n = (handle->hash_sizelog - 3);
-  h = 0;
-  while ((c = *string++) != 0)
-    {
-      h += c;
-      h = (h << 3) + (h >> n) + c;
-    }
-  return h;
-#else
-  /* from bfd */
-  unsigned long h = 0;
-  unsigned int len = 0;
-  unsigned int c;
-
-  while ((c = *string++) != 0)
-    {
-      h += c + (c << 17);
-      h ^= h >> 2;
+      hash += c + (c << 17);
+      hash ^= hash >> 2;
       ++len;
     }
-  h += len + (len << 17);
-  h ^= h >> 2;
-  return h;
+  hash += len + (len << 17);
+  hash ^= hash >> 2;
+
+  if (phash != NULL)
+    *phash = hash;
+
+  index = hash % table->size;
+  list = table->table + index;
+
+  if (plist != NULL)
+    *plist = list;
+
+  prev = NULL;
+  for (p = *list; p != NULL; p = p->next)
+    {
+#ifdef HASH_STATISTICS
+      ++table->hash_compares;
+#endif
+
+      if (p->hash == hash)
+	{
+#ifdef HASH_STATISTICS
+	  ++table->string_compares;
+#endif
+
+	  if (strcmp (p->string, key) == 0)
+	    {
+	      if (prev != NULL)
+		{
+		  prev->next = p->next;
+		  p->next = *list;
+		  *list = p;
+		}
+
+	      return p;
+	    }
+	}
+
+      prev = p;
+    }
+
+  return NULL;
+}
+
+/* Insert an entry into a hash table.  This returns NULL on success.
+   On error, it returns a printable string indicating the error.  It
+   is considered to be an error if the entry already exists in the
+   hash table.  */
+
+const char *
+hash_insert (table, key, value)
+     struct hash_control *table;
+     const char *key;
+     PTR value;
+{
+  struct hash_entry *p;
+  struct hash_entry **list;
+  unsigned long hash;
+
+  p = hash_lookup (table, key, &list, &hash);
+  if (p != NULL)
+    return "exists";
+
+#ifdef HASH_STATISTICS
+  ++table->insertions;
+#endif
+
+  p = obstack_alloc (&table->memory, sizeof *p);
+  p->string = key;
+  p->hash = hash;
+  p->data = value;
+
+  p->next = *list;
+  *list = p;
+
+  return NULL;
+}
+
+/* Insert or replace an entry in a hash table.  This returns NULL on
+   success.  On error, it returns a printable string indicating the
+   error.  If an entry already exists, its value is replaced.  */
+
+const char *
+hash_jam (table, key, value)
+     struct hash_control *table;
+     const char *key;
+     PTR value;
+{
+  struct hash_entry *p;
+  struct hash_entry **list;
+  unsigned long hash;
+
+  p = hash_lookup (table, key, &list, &hash);
+  if (p != NULL)
+    {
+#ifdef HASH_STATISTICS
+      ++table->replacements;
+#endif
+
+      p->data = value;
+    }
+  else
+    {
+#ifdef HASH_STATISTICS
+      ++table->insertions;
+#endif
+
+      p = obstack_alloc (&table->memory, sizeof *p);
+      p->string = key;
+      p->hash = hash;
+      p->data = value;
+
+      p->next = *list;
+      *list = p;
+    }
+
+  return NULL;
+}
+
+/* Replace an existing entry in a hash table.  This returns the old
+   value stored for the entry.  If the entry is not found in the hash
+   table, this does nothing and returns NULL.  */
+
+PTR
+hash_replace (table, key, value)
+     struct hash_control *table;
+     const char *key;
+     PTR value;
+{
+  struct hash_entry *p;
+  PTR ret;
+
+  p = hash_lookup (table, key, NULL, NULL);
+  if (p == NULL)
+    return NULL;
+
+#ifdef HASH_STATISTICS
+  ++table->replacements;
+#endif
+
+  ret = p->data;
+
+  p->data = value;
+
+  return ret;
+}
+
+/* Find an entry in a hash table, returning its value.  Returns NULL
+   if the entry is not found.  */
+
+PTR
+hash_find (table, key)
+     struct hash_control *table;
+     const char *key;
+{
+  struct hash_entry *p;
+
+  p = hash_lookup (table, key, NULL, NULL);
+  if (p == NULL)
+    return NULL;
+
+  return p->data;
+}
+
+/* Delete an entry from a hash table.  This returns the value stored
+   for that entry, or NULL if there is no such entry.  */
+
+PTR
+hash_delete (table, key)
+     struct hash_control *table;
+     const char *key;
+{
+  struct hash_entry *p;
+  struct hash_entry **list;
+
+  p = hash_lookup (table, key, &list, NULL);
+  if (p == NULL)
+    return NULL;
+
+  if (p != *list)
+    abort ();
+
+#ifdef HASH_STATISTICS
+  ++table->deletions;
+#endif
+
+  *list = p->next;
+
+  /* Note that we never reclaim the memory for this entry.  If gas
+     ever starts deleting hash table entries in a big way, this will
+     have to change.  */
+
+  return p->data;
+}
+
+/* Traverse a hash table.  Call the function on every entry in the
+   hash table.  */
+
+void
+hash_traverse (table, pfn)
+     struct hash_control *table;
+     void (*pfn) PARAMS ((const char *key, PTR value));
+{
+  unsigned int i;
+
+  for (i = 0; i < table->size; ++i)
+    {
+      struct hash_entry *p;
+
+      for (p = table->table[i]; p != NULL; p = p->next)
+	(*pfn) (p->string, p->data);
+    }
+}
+
+/* Print hash table statistics on the specified file.  NAME is the
+   name of the hash table, used for printing a header.  */
+
+void
+hash_print_statistics (f, name, table)
+     FILE *f ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
+     struct hash_control *table ATTRIBUTE_UNUSED;
+{
+#ifdef HASH_STATISTICS
+  unsigned int i;
+  unsigned long total;
+  unsigned long empty;
+
+  fprintf (f, "%s hash statistics:\n", name);
+  fprintf (f, "\t%lu lookups\n", table->lookups);
+  fprintf (f, "\t%lu hash comparisons\n", table->hash_compares);
+  fprintf (f, "\t%lu string comparisons\n", table->string_compares);
+  fprintf (f, "\t%lu insertions\n", table->insertions);
+  fprintf (f, "\t%lu replacements\n", table->replacements);
+  fprintf (f, "\t%lu deletions\n", table->deletions);
+
+  total = 0;
+  empty = 0;
+  for (i = 0; i < table->size; ++i)
+    {
+      struct hash_entry *p;
+
+      if (table->table[i] == NULL)
+	++empty;
+      else
+	{
+	  for (p = table->table[i]; p != NULL; p = p->next)
+	    ++total;
+	}
+    }
+
+  fprintf (f, "\t%g average chain length\n", (double) total / table->size);
+  fprintf (f, "\t%lu empty slots\n", empty);
 #endif
 }
 
-void
-hash_print_statistics (file, name, h)
-     FILE *file;
-     const char *name;
-     struct hash_control *h;
-{
-  unsigned long sz, used, pct;
-
-  if (h == 0)
-    return;
-
-  sz = h->hash_stat[STAT_SIZE];
-  used = h->hash_stat[STAT_USED];
-  pct = (used * 100 + sz / 2) / sz;
-
-  fprintf (file, "%s hash statistics:\n\t%lu/%lu slots used (%lu%%)\n",
-	   name, used, sz, pct);
-
-#define P(name, off)							\
-  fprintf (file, "\t%-16s %6dr + %6dw = %7d\n", name,			\
-	   h->hash_stat[off+STAT__READ],				\
-	   h->hash_stat[off+STAT__WRITE],				\
-	   h->hash_stat[off+STAT__READ] + h->hash_stat[off+STAT__WRITE])
-
-  P ("accesses:", STAT_ACCESS);
-  P ("collisions:", STAT_COLLIDE);
-  P ("string compares:", STAT_STRCMP);
-
-#undef P
-}
-
-/*
- * Here is a test program to exercise above.
- */
 #ifdef TEST
 
+/* This test program is left over from the old hash table code.  */
+
 #define TABLES (6)		/* number of hash tables to maintain */
-/* (at once) in any testing */
+				/* (at once) in any testing */
 #define STATBUFSIZE (12)	/* we can have 12 statistics */
 
 int statbuf[STATBUFSIZE];	/* display statistics here */
@@ -858,8 +431,9 @@
 int used;
 char command;
 int number;			/* number 0:TABLES-1 of current hashed */
-/* symbol table */
+				/* symbol table */
 
+int
 main ()
 {
   void applicatee ();
@@ -891,10 +465,10 @@
 	    }
 	  break;
 	case 'a':
-	  hash_apply (h, applicatee);
+	  hash_traverse (h, applicatee);
 	  break;
 	case 'd':
-	  hash_apply (h, destroy);
+	  hash_traverse (h, destroy);
 	  hash_die (h);
 	  break;
 	case 'f':
@@ -996,8 +570,9 @@
   printf ("%.20s-%.20s\n", string, value);
 }
 
+void
 whattable ()			/* determine number: what hash table to use */
-     /* also determine h: points to hash_control */
+			        /* also determine h: points to hash_control */
 {
 
   for (;;)
@@ -1021,8 +596,6 @@
     }
 }
 
-
-
 #endif /* #ifdef TEST */
 
 /* end of hash.c */
diff --git a/gas/hash.h b/gas/hash.h
index fb229c8..df59d9f 100644
--- a/gas/hash.h
+++ b/gas/hash.h
@@ -1,5 +1,5 @@
-/* hash.h - for hash.c
-   Copyright (C) 1987, 1992 Free Software Foundation, Inc.
+/* hash.h -- header file for gas hash table routines
+   Copyright (C) 1987, 92, 93, 95, 1999 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -14,32 +14,65 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with GAS; see the file COPYING.  If not, write to
-   the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.  */
 
-#ifndef hashH
-#define hashH
+#ifndef HASH_H
+#define HASH_H
 
 struct hash_control;
 
-/* returns control block */
-struct hash_control *hash_new PARAMS ((void));
-void hash_die PARAMS ((struct hash_control *));
-/* returns previous value */
-PTR hash_delete PARAMS ((struct hash_control *, const char *str));
-/* returns previous value */
-PTR hash_replace PARAMS ((struct hash_control *, const char *str, PTR val));
-/* returns error string or null */
-const char *hash_insert PARAMS ((struct hash_control *, const char *str,
-				 PTR val));
-/* returns value */
-PTR hash_find PARAMS ((struct hash_control *, const char *str));
-/* returns error text or null (internal) */
-const char *hash_jam PARAMS ((struct hash_control *, const char *str,
-			      PTR val));
+/* Create a hash table.  This return a control block.  */
 
-void hash_print_statistics PARAMS ((FILE *, const char *,
-				    struct hash_control *));
-#endif /* #ifdef hashH */
+extern struct hash_control *hash_new PARAMS ((void));
 
-/* end of hash.c */
+/* Delete a hash table, freeing all allocated memory.  */
+
+extern void hash_die PARAMS ((struct hash_control *));
+
+/* Insert an entry into a hash table.  This returns NULL on success.
+   On error, it returns a printable string indicating the error.  It
+   is considered to be an error if the entry already exists in the
+   hash table.  */
+
+extern const char *hash_insert PARAMS ((struct hash_control *,
+					const char *key, PTR value));
+
+/* Insert or replace an entry in a hash table.  This returns NULL on
+   success.  On error, it returns a printable string indicating the
+   error.  If an entry already exists, its value is replaced.  */
+
+extern const char *hash_jam PARAMS ((struct hash_control *,
+				     const char *key, PTR value));
+
+/* Replace an existing entry in a hash table.  This returns the old
+   value stored for the entry.  If the entry is not found in the hash
+   table, this does nothing and returns NULL.  */
+
+extern PTR hash_replace PARAMS ((struct hash_control *, const char *key,
+				 PTR value));
+
+/* Find an entry in a hash table, returning its value.  Returns NULL
+   if the entry is not found.  */
+
+extern PTR hash_find PARAMS ((struct hash_control *, const char *key));
+
+/* Delete an entry from a hash table.  This returns the value stored
+   for that entry, or NULL if there is no such entry.  */
+
+extern PTR hash_delete PARAMS ((struct hash_control *, const char *key));
+
+/* Traverse a hash table.  Call the function on every entry in the
+   hash table.  */
+
+extern void hash_traverse PARAMS ((struct hash_control *,
+				   void (*pfn) (const char *key, PTR value)));
+
+/* Print hash table statistics on the specified file.  NAME is the
+   name of the hash table, used for printing a header.  */
+
+extern void hash_print_statistics PARAMS ((FILE *, const char *name,
+					   struct hash_control *));
+
+#endif /* HASH_H */
diff --git a/gas/input-file.c b/gas/input-file.c
index c63f7c9..634f6f7 100644
--- a/gas/input-file.c
+++ b/gas/input-file.c
@@ -1,5 +1,6 @@
 /* input_file.c - Deal with Input Files -
-   Copyright (C) 1987, 1990, 1991, 1992, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 98, 1999
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -14,8 +15,9 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with GAS; see the file COPYING.  If not, write to
-   the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.  */
 
 /*
  * Confines all details of reading source bytes to this module.
@@ -30,7 +32,7 @@
 #include "as.h"
 #include "input-file.h"
 
-static int input_file_get PARAMS ((char **));
+static int input_file_get PARAMS ((char *, int));
 
 /* This variable is non-zero if the file currently being read should be
    preprocessed by app.  It is zero if the file can be read straight in.
@@ -191,19 +193,18 @@
 /* This function is passed to do_scrub_chars.  */
 
 static int
-input_file_get (from)
-     char **from;
+input_file_get (buf, buflen)
+     char *buf;
+     int buflen;
 {
-  static char buf[BUFFER_SIZE];
   int size;
 
-  size = fread (buf, sizeof (char), sizeof buf, f_in);
+  size = fread (buf, sizeof (char), buflen, f_in);
   if (size < 0)
     {
       as_perror (_("Can't read from %s"), file_name);
       size = 0;
     }
-  *from = buf;
   return size;
 }
 
diff --git a/gas/itbl-ops.c b/gas/itbl-ops.c
index f008dca..27cca60 100644
--- a/gas/itbl-ops.c
+++ b/gas/itbl-ops.c
@@ -1,5 +1,5 @@
 /* itbl-ops.c
-   Copyright (C) 1997, 1998  Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -457,18 +457,20 @@
 
 /* Get processor's register name from val */
 
-unsigned long 
-itbl_get_reg_val (char *name)
+int
+itbl_get_reg_val (char *name, unsigned long *pval)
 {
   e_type t;
   e_processor p;
-  int r = 0;
+
   for (p = e_p0; p < e_nprocs; p++)
-    for (t = e_regtype0; t < e_nregtypes; t++)
-      {
-	if (r = itbl_get_val (p, t, name), r)
-	  return r;
-      }
+    {
+      for (t = e_regtype0; t < e_nregtypes; t++)
+	{
+	  if (itbl_get_val (p, t, name, pval))
+	    return 1;
+	}
+    }
   return 0;
 }
 
@@ -486,16 +488,17 @@
 
 /* Get processor's register value from name */
 
-unsigned long 
-itbl_get_val (e_processor processor, e_type type, char *name)
+int
+itbl_get_val (e_processor processor, e_type type, char *name,
+	      unsigned long *pval)
 {
   struct itbl_entry *r;
   /* type depends on instruction passed */
   r = find_entry_byname (processor, type, name);
-  if (r)
-    return r->value;
-  else
-    return 0;			/* error; invalid operand */
+  if (r == NULL)
+    return 0;
+  *pval = r->value;
+  return 1;
 }
 
 
@@ -640,7 +643,7 @@
 	  if (r)
 	    strcat (s, r->name);
 	  else
-	    sprintf (s, "%s$%d", s, value);
+	    sprintf (s, "%s$%lu", s, value);
 	  break;
 	case e_addr:
 	  /* use assembler's symbol table to find symbol */
@@ -649,7 +652,7 @@
 			*/
 	  /* If not a symbol, fall thru to IMMED */
 	case e_immed:
-	  sprintf (s, "%s0x%x", s, value);
+	  sprintf (s, "%s0x%lx", s, value);
 	  break;
 	default:
 	  return 0;		/* error; invalid field spec */
@@ -732,28 +735,20 @@
 /* Extract processor's assembly instruction field name from s;
  * forms are "n args" "n,args" or "n" */
 /* Return next argument from string pointer "s" and advance s.
- * delimiters are " ,\0" */
+ * delimiters are " ,()" */
 
 char *
 itbl_get_field (char **S)
 {
   static char n[128];
-  char *p, *ps, *s;
+  char *s;
   int len;
 
   s = *S;
   if (!s || !*s)
     return 0;
-  p = s + strlen (s);
-  if (ps = strchr (s, ','), ps)
-    p = ps;
-  if (ps = strchr (s, ' '), ps)
-    p = min (p, ps);
-  if (ps = strchr (s, '\0'), ps)
-    p = min (p, ps);
-  if (p == 0)
-    return 0;			/* error! */
-  len = p - s;
+  /* FIXME: This is a weird set of delimiters.  */
+  len = strcspn (s, " \t,()");
   ASSERT (128 > len + 1);
   strncpy (n, s, len);
   n[len] = 0;
@@ -816,8 +811,8 @@
 	  eval = apply_range (e->value, e->range);
 	  val &= apply_range (0xffffffff, e->range);
 	}
-      else if (r->sbit == e->range.sbit && r->ebit == e->range.ebit
-	       || e->range.sbit == 0 && e->range.ebit == 0)
+      else if ((r->sbit == e->range.sbit && r->ebit == e->range.ebit)
+	       || (e->range.sbit == 0 && e->range.ebit == 0))
 	{
 	  eval = apply_range (e->value, *r);
 	  val = apply_range (val, *r);
diff --git a/gas/itbl-ops.h b/gas/itbl-ops.h
index 2946eff..d69ea7f 100644
--- a/gas/itbl-ops.h
+++ b/gas/itbl-ops.h
@@ -1,5 +1,5 @@
 /* itbl-ops.h
-   Copyright (C) 1997  Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -92,9 +92,9 @@
 unsigned long itbl_assemble PARAMS ((char *name, char *operands));
 int itbl_disassemble PARAMS ((char *str, unsigned long insn));
 int itbl_parse PARAMS ((char *tbl));	/* parses insn tbl */
-unsigned long itbl_get_reg_val PARAMS ((char *name));
-unsigned long itbl_get_val PARAMS ((e_processor processor, e_type type,
-				    char *name));
+int itbl_get_reg_val PARAMS ((char *name, unsigned long *pval));
+int itbl_get_val PARAMS ((e_processor processor, e_type type, char *name,
+			  unsigned long *pval));
 char *itbl_get_name PARAMS ((e_processor processor, e_type type,
 			     unsigned long val));
 
diff --git a/gas/listing.c b/gas/listing.c
index e2b173b..1ab0dde 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -375,7 +375,7 @@
 	      
 	      while (--len)
 		{
-		  char c = * src ++;
+		  unsigned char c = * src ++;
 
 		  /* Omit control characters in the listing.  */
 		  if (isascii (c) && ! iscntrl (c))
@@ -789,7 +789,7 @@
 	{
 #ifdef BFD_ASSEMBLER
 	  /* Don't report section symbols.  They are not interesting.  */
-	  if (ptr->bsym->flags & BSF_SECTION_SYM)
+	  if (symbol_section_p (ptr))
 	    continue;
 #endif
 	  if (S_GET_NAME (ptr))
@@ -821,11 +821,11 @@
 		  got_some = 1;
 		}
 
-	      if (ptr->sy_frag && ptr->sy_frag->line)
+	      if (symbol_get_frag (ptr) && symbol_get_frag (ptr)->line)
 		{
 		  fprintf (list_file, "%20s:%-5d  %s:%s %s\n",
-			   ptr->sy_frag->line->file->filename,
-			   ptr->sy_frag->line->line,
+			   symbol_get_frag (ptr)->line->file->filename,
+			   symbol_get_frag (ptr)->line->line,
 			   segment_name (S_GET_SEGMENT (ptr)),
 			   buf, S_GET_NAME (ptr));
 		}
@@ -978,7 +978,7 @@
 
 static void
 listing_listing (name)
-     char *name;
+     char *name ATTRIBUTE_UNUSED;
 {
   list_info_type *list = head;
   file_info_type *current_hll_file = (file_info_type *) NULL;
@@ -1006,7 +1006,7 @@
 
   while (list)
     {
-      int list_line;
+      unsigned int list_line;
 
       width = listing_rhs_width > paper_width ? paper_width :
 	listing_rhs_width;
@@ -1180,7 +1180,7 @@
 
 void
 listing_eject (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   if (listing)
     listing_tail->edict = EDICT_EJECT;
@@ -1188,7 +1188,7 @@
 
 void
 listing_flags (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   while ((*input_line_pointer++) && (*input_line_pointer != '\n'))
     input_line_pointer++;
@@ -1261,7 +1261,7 @@
 
 void
 listing_nopage (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   paper_height = 0;
 }
diff --git a/gas/macro.c b/gas/macro.c
index 9d92ff4..2aeb157 100644
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -1,5 +1,5 @@
 /* macro.c - macro support for gas and gasp
-   Copyright (C) 1994, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
 
    Written by Steve and Judy Chamberlain of Cygnus Support,
       sac@cygnus.com
@@ -902,7 +902,9 @@
       formal_entry *f;
 
       f = loclist->next;
-      hash_delete (formal_hash, sb_terminate (&loclist->name));
+      /* Setting the value to NULL effectively deletes the entry.  We
+         avoid calling hash_delete because it doesn't reclaim memory.  */
+      hash_jam (formal_hash, sb_terminate (&loclist->name), NULL);
       sb_kill (&loclist->name);
       sb_kill (&loclist->def);
       sb_kill (&loclist->actual);
diff --git a/gas/po/POTFILES.in b/gas/po/POTFILES.in
index 0023b7a..9f67f27 100644
--- a/gas/po/POTFILES.in
+++ b/gas/po/POTFILES.in
@@ -1,16 +1,22 @@
-config/tc-hppa.c
-config/tc-m32r.c
-config/aout_gnu.h
-config/atof-ieee.c
-config/atof-tahoe.c
-config/atof-vax.c
+app.c
+app.c
+as.c
+as.c
+as.h
+asintl.h
+atof-generic.c
+atof-generic.c
+bignum-copy.c
+bignum-copy.c
+bignum.h
+bit_fix.h
+cgen.h
+cond.c
+cond.c
 config/e-i386coff.c
 config/e-i386elf.c
 config/e-mipsecoff.c
 config/e-mipself.c
-config/itbl-mips.h
-config/m68k-parse.h
-config/m88k-opcode.h
 config/obj-aout.c
 config/obj-aout.h
 config/obj-bout.c
@@ -23,14 +29,10 @@
 config/obj-elf.h
 config/obj-evax.c
 config/obj-evax.h
-config/obj-generic.c
-config/obj-generic.h
 config/obj-hp300.c
 config/obj-hp300.h
 config/obj-ieee.c
 config/obj-ieee.h
-config/obj-multi.c
-config/obj-multi.h
 config/obj-som.c
 config/obj-som.h
 config/obj-vms.c
@@ -47,16 +49,11 @@
 config/tc-d10v.h
 config/tc-d30v.c
 config/tc-d30v.h
-config/tc-mcore.c
-config/tc-fr30.c
-config/tc-fr30.h
-config/tc-generic.c
-config/tc-generic.h
 config/tc-h8300.c
 config/tc-h8300.h
 config/tc-h8500.c
 config/tc-h8500.h
-config/tc-mips.c
+config/tc-hppa.c
 config/tc-hppa.h
 config/tc-i386.c
 config/tc-i386.h
@@ -64,17 +61,19 @@
 config/tc-i860.h
 config/tc-i960.c
 config/tc-i960.h
-config/tc-mn10300.c
+config/tc-m32r.c
 config/tc-m32r.h
-config/tc-m68851.h
 config/tc-m68k.c
 config/tc-m68k.h
 config/tc-m88k.c
 config/tc-m88k.h
+config/tc-mcore.c
 config/tc-mcore.h
+config/tc-mips.c
 config/tc-mips.h
 config/tc-mn10200.c
 config/tc-mn10200.h
+config/tc-mn10300.c
 config/tc-mn10300.h
 config/tc-ns32k.c
 config/tc-ns32k.h
@@ -98,96 +97,72 @@
 config/tc-w65.h
 config/tc-z8k.c
 config/tc-z8k.h
-config/te-386bsd.h
-config/te-aux.h
-config/te-delt88.h
-config/te-delta.h
-config/te-dpx2.h
-config/te-dynix.h
-config/te-epoc-pe.h
-config/te-generic.h
-config/te-go32.h
-config/te-hp300.h
-config/te-hppa.h
-config/te-i386aix.h
-config/te-ic960.h
-config/te-linux.h
-config/te-lnews.h
-config/te-lynx.h
-config/te-mach.h
-config/te-macos.h
-config/te-multi.h
-config/te-nbsd.h
-config/te-nbsd532.h
-config/te-pc532mach.h
-config/te-pe.h
-config/te-ppcnw.h
-config/te-psos.h
-config/te-riscix.h
-config/te-sparcaout.h
-config/te-sun3.h
-config/te-svr4.h
-config/te-sysv32.h
-config/vax-inst.h
-config/vms-a-conf.h
-config/vms-conf.h
-app.c
-as.c
-as.h
-asintl.h
-atof-generic.c
-bignum-copy.c
-bignum.h
-bit_fix.h
-cgen.c
-cgen.h
-cond.c
-debug.c
 depend.c
+depend.c
+dwarf2dbg.c
+dwarf2dbg.c
+dwarf2dbg.h
+ecoff.c
 ecoff.c
 ecoff.h
 ehopt.c
+ehopt.c
 emul-target.h
 emul.h
 expr.c
+expr.c
 expr.h
 flonum-copy.c
+flonum-copy.c
+flonum-konst.c
 flonum-konst.c
 flonum-mult.c
+flonum-mult.c
 flonum.h
 frags.c
+frags.c
 frags.h
 gasp.c
 hash.c
+hash.c
 hash.h
 input-file.c
+input-file.c
 input-file.h
 input-scrub.c
+input-scrub.c
 itbl-ops.c
 itbl-ops.h
 listing.c
+listing.c
 listing.h
 literal.c
+literal.c
+macro.c
 macro.c
 macro.h
 messages.c
+messages.c
 obj.h
 output-file.c
+output-file.c
 output-file.h
 read.c
+read.c
 read.h
 sb.c
+sb.c
 sb.h
 stabs.c
+stabs.c
 struc-symbol.h
 subsegs.c
+subsegs.c
 subsegs.h
 symbols.c
+symbols.c
 symbols.h
 tc.h
 write.c
+write.c
 write.h
-testsuite/gas/all/itbl-test.c
-testsuite/gas/mips/elf_e_flags.c
-testsuite/gas/tic80/relocs1.c
-testsuite/gas/tic80/relocs2.c
diff --git a/gas/po/gas.pot b/gas/po/gas.pot
index cd9abba..ef40ee1 100644
--- a/gas/po/gas.pot
+++ b/gas/po/gas.pot
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-04-18 18:31-0400\n"
+"POT-Creation-Date: 1999-06-03 03:00-0700\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -14,48 +14,48 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: ENCODING\n"
 
-#: app.c:435 app.c:449
+#: app.c:448 app.c:462
 msgid "end of file in comment"
 msgstr ""
 
-#: app.c:528
+#: app.c:541
 msgid "end of file in string: inserted '\"'"
 msgstr ""
 
-#: app.c:594
+#: app.c:607
 #, c-format
 msgid "Unknown escape '\\%c' in string: Ignored"
 msgstr ""
 
-#: app.c:603
+#: app.c:616
 msgid "End of file in string: '\"' inserted"
 msgstr ""
 
-#: app.c:723
+#: app.c:736
 msgid "end of file not at end of a line; newline inserted"
 msgstr ""
 
-#: app.c:869
+#: app.c:882
 msgid "end of file in multiline comment"
 msgstr ""
 
-#: app.c:918
+#: app.c:931
 msgid "end of file after a one-character quote; \\0 inserted"
 msgstr ""
 
-#: app.c:926
+#: app.c:939
 msgid "end of file in escape character"
 msgstr ""
 
-#: app.c:938
+#: app.c:951
 msgid "Missing close quote: (assumed)"
 msgstr ""
 
-#: app.c:997 app.c:1051 app.c:1120
+#: app.c:1010 app.c:1064 app.c:1133
 msgid "end of file in comment; newline inserted"
 msgstr ""
 
-#: app.c:1061
+#: app.c:1074
 msgid "EOF in Comment: Newline inserted"
 msgstr ""
 
@@ -86,10 +86,11 @@
 "    m   include macro expansions\n"
 "    n   omit forms processing\n"
 "    s   include symbols\n"
+"    L   include line debug statistics (if applicable)\n"
 "    =file set listing file name (must be last sub-option)\n"
 msgstr ""
 
-#: as.c:148
+#: as.c:149
 msgid ""
 "  -D\t\t          produce assembler debugging messages\n"
 "  --defsym SYM=VAL        define symbol SYM to given value\n"
@@ -102,7 +103,7 @@
 "  -L,--keep-locals        keep local symbols (e.g. starting with `L')\n"
 msgstr ""
 
-#: as.c:159
+#: as.c:160
 msgid ""
 "  -M,--mri\t          assemble in MRI compatibility mode\n"
 "  --MD FILE\t          write dependency information in FILE (default none)\n"
@@ -121,7 +122,7 @@
 "  -Z\t\t\t  generate object file even after errors\n"
 msgstr ""
 
-#: as.c:176
+#: as.c:177
 msgid ""
 "  --listing-lhs-width\t  set the width in words of the output data column "
 "of\n"
@@ -135,99 +136,99 @@
 "\t\t\t  for the output data column of the listing\n"
 msgstr ""
 
-#: as.c:189 gasp.c:3583
+#: as.c:190 gasp.c:3588
 msgid ""
 "\n"
 "Report bugs to bug-gnu-utils@gnu.org\n"
 msgstr ""
 
-#: as.c:226
+#: as.c:227
 msgid "missing emulation mode name"
 msgstr ""
 
-#: as.c:241
+#: as.c:242
 #, c-format
 msgid "unrecognized emulation name `%s'"
 msgstr ""
 
 #. This output is intended to follow the GNU standards document.
-#: as.c:459
+#: as.c:462
 #, c-format
 msgid "GNU assembler %s\n"
 msgstr ""
 
-#: as.c:460
+#: as.c:463
 msgid "Copyright 1997 Free Software Foundation, Inc.\n"
 msgstr ""
 
-#: as.c:461 gasp.c:3677
+#: as.c:464 gasp.c:3682
 msgid ""
 "This program is free software; you may redistribute it under the terms of\n"
 "the GNU General Public License.  This program has absolutely no warranty.\n"
 msgstr ""
 
-#: as.c:464
+#: as.c:467
 #, c-format
 msgid "This assembler was configured for a target of `%s'.\n"
 msgstr ""
 
-#: as.c:471
+#: as.c:474
 msgid "multiple emulation names specified"
 msgstr ""
 
-#: as.c:473
+#: as.c:476
 msgid "emulations not handled in this configuration"
 msgstr ""
 
-#: as.c:478
+#: as.c:481
 #, c-format
 msgid "alias = %s\n"
 msgstr ""
 
-#: as.c:479
+#: as.c:482
 #, c-format
 msgid "canonical = %s\n"
 msgstr ""
 
-#: as.c:480
+#: as.c:483
 #, c-format
 msgid "cpu-type = %s\n"
 msgstr ""
 
-#: as.c:482
+#: as.c:485
 #, c-format
 msgid "format = %s\n"
 msgstr ""
 
-#: as.c:485
+#: as.c:488
 #, c-format
 msgid "bfd-target = %s\n"
 msgstr ""
 
-#: as.c:498
+#: as.c:501
 msgid "bad defsym; format is --defsym name=value"
 msgstr ""
 
-#: as.c:518
+#: as.c:521
 msgid "No file name following -t option\n"
 msgstr ""
 
-#: as.c:534
+#: as.c:537
 #, c-format
 msgid "Failed to read instruction table %s\n"
 msgstr ""
 
-#: as.c:634
+#: as.c:641
 #, c-format
 msgid "invalid listing option `%c'"
 msgstr ""
 
-#: as.c:856
+#: as.c:863
 #, c-format
 msgid "%s: total time in assembly: %ld.%06ld\n"
 msgstr ""
 
-#: as.c:859
+#: as.c:866
 #, c-format
 msgid "%s: data size %ld\n"
 msgstr ""
@@ -237,7 +238,7 @@
 #. * This should never happen.
 #.
 #: atof-generic.c:438 config/tc-a29k.c:544 config/tc-i860.c:335
-#: config/tc-i860.c:708 config/tc-m68k.c:3045 config/tc-m68k.c:3074
+#: config/tc-i860.c:708 config/tc-m68k.c:3124 config/tc-m68k.c:3153
 #: config/tc-sparc.c:2157
 msgid "failed sanity check."
 msgstr ""
@@ -294,46 +295,46 @@
 msgid "here is the \"else\" of the unterminated conditional"
 msgstr ""
 
-#: config/obj-aout.c:157
+#: config/obj-aout.c:161
 #, c-format
 msgid "Attempt to put a common symbol into set %s"
 msgstr ""
 
-#: config/obj-aout.c:161
+#: config/obj-aout.c:165
 #, c-format
 msgid "Attempt to put an undefined symbol into set %s"
 msgstr ""
 
-#: config/obj-aout.c:192 config/obj-elf.c:1527 ecoff.c:3663
+#: config/obj-aout.c:196 config/obj-elf.c:1540 ecoff.c:3667
 #, c-format
 msgid "Symbol `%s' can not be both weak and common"
 msgstr ""
 
-#: config/obj-aout.c:250 config/obj-coff.c:1766
+#: config/obj-aout.c:254 config/obj-coff.c:1770
 msgid "unresolved relocation"
 msgstr ""
 
-#: config/obj-aout.c:252 config/obj-coff.c:1768
+#: config/obj-aout.c:256 config/obj-coff.c:1772
 #, c-format
 msgid "bad relocation: symbol `%s' not in symbol table"
 msgstr ""
 
-#: config/obj-aout.c:339
+#: config/obj-aout.c:343
 #, c-format
 msgid "%s: bad type for weak symbol"
 msgstr ""
 
-#: config/obj-aout.c:453 config/obj-coff.c:2700 write.c:1796
+#: config/obj-aout.c:457 config/obj-coff.c:2704 write.c:1801
 #, c-format
 msgid "%s: global symbols not supported in common sections"
 msgstr ""
 
-#: config/obj-aout.c:520
+#: config/obj-aout.c:524
 #, c-format
 msgid "Local symbol %s never defined."
 msgstr ""
 
-#: config/obj-aout.c:608
+#: config/obj-aout.c:612
 msgid "subsegment index too high"
 msgstr ""
 
@@ -347,153 +348,153 @@
 msgid "Inserting \"%s\" into structure table failed: %s"
 msgstr ""
 
-#: config/obj-coff.c:452 config/obj-coff.c:2113
+#: config/obj-coff.c:453 config/obj-coff.c:2117
 msgid ".ln pseudo-op inside .def/.endef: ignored."
 msgstr ""
 
-#: config/obj-coff.c:512 config/obj-coff.c:2170
+#: config/obj-coff.c:513 config/obj-coff.c:2174
 msgid ".def pseudo-op used inside of .def/.endef: ignored."
 msgstr ""
 
-#: config/obj-coff.c:558 config/obj-coff.c:2223
+#: config/obj-coff.c:559 config/obj-coff.c:2227
 msgid ".endef pseudo-op used outside of .def/.endef: ignored."
 msgstr ""
 
-#: config/obj-coff.c:592
+#: config/obj-coff.c:593
 #, c-format
 msgid "`%s' symbol without preceding function"
 msgstr ""
 
-#: config/obj-coff.c:634 config/obj-coff.c:2298
+#: config/obj-coff.c:635 config/obj-coff.c:2302
 #, c-format
 msgid "unexpected storage class %d"
 msgstr ""
 
-#: config/obj-coff.c:736 config/obj-coff.c:2405
+#: config/obj-coff.c:737 config/obj-coff.c:2409
 msgid ".dim pseudo-op used outside of .def/.endef: ignored."
 msgstr ""
 
-#: config/obj-coff.c:756 config/obj-coff.c:2425
+#: config/obj-coff.c:757 config/obj-coff.c:2429
 msgid "badly formed .dim directive ignored"
 msgstr ""
 
-#: config/obj-coff.c:807 config/obj-coff.c:2488
+#: config/obj-coff.c:808 config/obj-coff.c:2492
 msgid ".size pseudo-op used outside of .def/.endef ignored."
 msgstr ""
 
-#: config/obj-coff.c:823 config/obj-coff.c:2504
+#: config/obj-coff.c:824 config/obj-coff.c:2508
 msgid ".scl pseudo-op used outside of .def/.endef ignored."
 msgstr ""
 
-#: config/obj-coff.c:841 config/obj-coff.c:2522
+#: config/obj-coff.c:842 config/obj-coff.c:2526
 msgid ".tag pseudo-op used outside of .def/.endef ignored."
 msgstr ""
 
-#: config/obj-coff.c:860 config/obj-coff.c:2540
+#: config/obj-coff.c:861 config/obj-coff.c:2544
 #, c-format
 msgid "tag not found for .tag %s"
 msgstr ""
 
-#: config/obj-coff.c:875 config/obj-coff.c:2555
+#: config/obj-coff.c:876 config/obj-coff.c:2559
 msgid ".type pseudo-op used outside of .def/.endef ignored."
 msgstr ""
 
-#: config/obj-coff.c:897 config/obj-coff.c:2577
+#: config/obj-coff.c:898 config/obj-coff.c:2581
 msgid ".val pseudo-op used outside of .def/.endef ignored."
 msgstr ""
 
-#: config/obj-coff.c:1026 config/obj-coff.c:2773
+#: config/obj-coff.c:1029 config/obj-coff.c:2777
 msgid "mismatched .eb"
 msgstr ""
 
-#: config/obj-coff.c:1044 config/obj-coff.c:2813
+#: config/obj-coff.c:1048 config/obj-coff.c:2817
 msgid "C_EFCN symbol out of scope"
 msgstr ""
 
 #. STYP_INFO
 #. STYP_LIB
 #. STYP_OVER
-#: config/obj-coff.c:1253
+#: config/obj-coff.c:1257
 #, c-format
 msgid "unsupported section attribute '%c'"
 msgstr ""
 
-#: config/obj-coff.c:1258 config/obj-coff.c:3516 config/tc-ppc.c:3778
+#: config/obj-coff.c:1262 config/obj-coff.c:3520 config/tc-ppc.c:3784
 #, c-format
 msgid "unknown section attribute '%c'"
 msgstr ""
 
-#: config/obj-coff.c:1280 config/tc-ppc.c:3796 read.c:2478
+#: config/obj-coff.c:1284 config/tc-ppc.c:3802 read.c:2499
 #, c-format
 msgid "error setting flags for \"%s\": %s"
 msgstr ""
 
-#: config/obj-coff.c:1399
+#: config/obj-coff.c:1403
 #, c-format
 msgid "0x%lx: \"%s\" type = %ld, class = %d, segment = %d\n"
 msgstr ""
 
-#: config/obj-coff.c:1593 config/obj-ieee.c:69
+#: config/obj-coff.c:1597 config/obj-ieee.c:69
 msgid "Out of step\n"
 msgstr ""
 
-#: config/obj-coff.c:2028
+#: config/obj-coff.c:2032
 msgid "bfd_coff_swap_scnhdr_out failed"
 msgstr ""
 
-#: config/obj-coff.c:2255
+#: config/obj-coff.c:2259
 msgid "`.bf' symbol without preceding function\n"
 msgstr ""
 
-#: config/obj-coff.c:3216 config/obj-ieee.c:522 output-file.c:52
+#: config/obj-coff.c:3220 config/obj-ieee.c:522 output-file.c:52
 #: output-file.c:119
 #, c-format
 msgid "FATAL: Can't create %s"
 msgstr ""
 
-#: config/obj-coff.c:3390
+#: config/obj-coff.c:3394
 #, c-format
 msgid "Can't close %s: %s"
 msgstr ""
 
-#: config/obj-coff.c:3424
+#: config/obj-coff.c:3428
 #, c-format
 msgid "Too many new sections; can't add \"%s\""
 msgstr ""
 
-#: config/obj-coff.c:3834 config/tc-m88k.c:1260 config/tc-sparc.c:3015
+#: config/obj-coff.c:3838 config/tc-m88k.c:1260 config/tc-sparc.c:3016
 msgid "Expected comma after name"
 msgstr ""
 
-#: config/obj-coff.c:3840 read.c:1934
+#: config/obj-coff.c:3844 read.c:1955
 msgid "Missing size expression"
 msgstr ""
 
-#: config/obj-coff.c:3846
+#: config/obj-coff.c:3850
 #, c-format
 msgid "lcomm length (%d.) <0! Ignored."
 msgstr ""
 
-#: config/obj-coff.c:3874 read.c:2160
+#: config/obj-coff.c:3878 read.c:2181
 #, c-format
 msgid "Symbol %s already defined"
 msgstr ""
 
-#: config/obj-coff.c:3968 config/tc-i960.c:3201
+#: config/obj-coff.c:3972 config/tc-i960.c:3274
 #, c-format
 msgid "No 'bal' entry point for leafproc %s"
 msgstr ""
 
-#: config/obj-coff.c:4047 write.c:2501
+#: config/obj-coff.c:4051 write.c:2495
 #, c-format
 msgid "Negative of non-absolute symbol %s"
 msgstr ""
 
-#: config/obj-coff.c:4068 write.c:2515
+#: config/obj-coff.c:4072 write.c:2509
 msgid "callj to difference of 2 symbols"
 msgstr ""
 
-#: config/obj-coff.c:4114
+#: config/obj-coff.c:4118
 #, c-format
 msgid "Can't emit reloc {- %s-seg symbol \"%s\"} @ file address %ld."
 msgstr ""
@@ -501,16 +502,16 @@
 #. This is a COBR instruction.  They have only a 13-bit
 #. displacement and are only to be used for local branches:
 #. flag as error, don't generate relocation.
-#: config/obj-coff.c:4204 config/tc-i960.c:3221 write.c:2659
+#: config/obj-coff.c:4208 config/tc-i960.c:3294 write.c:2653
 msgid "can't use COBR format with external label"
 msgstr ""
 
-#: config/obj-coff.c:4278
+#: config/obj-coff.c:4288
 #, c-format
 msgid "Value of %ld too large for field of %d bytes at 0x%lx"
 msgstr ""
 
-#: config/obj-coff.c:4292 write.c:2747
+#: config/obj-coff.c:4302 write.c:2762
 #, c-format
 msgid "Signed .word overflow; switch may be too large; %ld at 0x%lx"
 msgstr ""
@@ -523,128 +524,128 @@
 msgid "Can't set register masks"
 msgstr ""
 
-#: config/obj-elf.c:274 config/tc-sparc.c:3156 config/tc-v850.c:263
+#: config/obj-elf.c:276 config/tc-sparc.c:3157 config/tc-v850.c:263
 msgid "Expected comma after symbol-name"
 msgstr ""
 
-#: config/obj-elf.c:281 config/tc-arc.c:778 config/tc-sparc.c:3163
+#: config/obj-elf.c:283 config/tc-arc.c:778 config/tc-sparc.c:3164
 #, c-format
 msgid ".COMMon length (%d.) <0! Ignored."
 msgstr ""
 
-#: config/obj-elf.c:291 config/tc-alpha.c:3429 config/tc-sparc.c:3173
+#: config/obj-elf.c:293 config/tc-alpha.c:3430 config/tc-sparc.c:3174
 #: config/tc-v850.c:285
 msgid "Ignoring attempt to re-define symbol"
 msgstr ""
 
-#: config/obj-elf.c:299 config/tc-arc.c:796 config/tc-sparc.c:3181
+#: config/obj-elf.c:301 config/tc-arc.c:796 config/tc-sparc.c:3182
 #: config/tc-v850.c:295
 #, c-format
 msgid "Length of .comm \"%s\" is already %ld. Not changed to %d."
 msgstr ""
 
-#: config/obj-elf.c:322 config/tc-arc.c:815 config/tc-v850.c:322
+#: config/obj-elf.c:324 config/tc-arc.c:815 config/tc-v850.c:322
 msgid "Common alignment negative; 0 assumed"
 msgstr ""
 
-#: config/obj-elf.c:341 config/tc-m32r.c:1298 config/tc-ppc.c:1389
+#: config/obj-elf.c:343 config/tc-m32r.c:664 config/tc-ppc.c:1395
 #: config/tc-v850.c:385
 msgid "Common alignment not a power of 2"
 msgstr ""
 
-#: config/obj-elf.c:404 config/tc-arc.c:875 config/tc-sparc.c:3305
+#: config/obj-elf.c:406 config/tc-arc.c:875 config/tc-sparc.c:3306
 #: config/tc-v850.c:563
 #, c-format
 msgid "bad .common segment %s"
 msgstr ""
 
-#: config/obj-elf.c:589
+#: config/obj-elf.c:591
 msgid "Missing section name"
 msgstr ""
 
-#: config/obj-elf.c:654
+#: config/obj-elf.c:656
 msgid "Bad .section directive: want a,w,x in string"
 msgstr ""
 
-#: config/obj-elf.c:703
+#: config/obj-elf.c:705
 msgid "Unrecognized section type"
 msgstr ""
 
-#: config/obj-elf.c:717
+#: config/obj-elf.c:719
 msgid "Bad .section directive - character following name is not '#'"
 msgstr ""
 
-#: config/obj-elf.c:749
+#: config/obj-elf.c:751
 msgid "Unrecognized section attribute"
 msgstr ""
 
-#: config/obj-elf.c:770
+#: config/obj-elf.c:772
 #, c-format
 msgid "Setting incorrect section type for %s"
 msgstr ""
 
-#: config/obj-elf.c:780
+#: config/obj-elf.c:782
 #, c-format
 msgid "Setting incorrect section attributes for %s"
 msgstr ""
 
-#: config/obj-elf.c:905
+#: config/obj-elf.c:907
 msgid ".previous without corresponding .section; ignored"
 msgstr ""
 
-#: config/obj-elf.c:954
+#: config/obj-elf.c:956
 #, c-format
 msgid "multiple .symver directives for symbol `%s'"
 msgstr ""
 
-#: config/obj-elf.c:963
+#: config/obj-elf.c:965
 msgid "expected comma after name in .symver"
 msgstr ""
 
-#: config/obj-elf.c:984
+#: config/obj-elf.c:986
 #, c-format
 msgid "missing version name in `%s' for symbol `%s'"
 msgstr ""
 
-#: config/obj-elf.c:1187 config/obj-som.c:148 config/obj-som.c:193
+#: config/obj-elf.c:1193 config/obj-som.c:148 config/obj-som.c:193
 msgid "Expected quoted string"
 msgstr ""
 
-#: config/obj-elf.c:1208
+#: config/obj-elf.c:1214
 #, c-format
 msgid "expected comma after name `%s' in .size directive"
 msgstr ""
 
-#: config/obj-elf.c:1217
+#: config/obj-elf.c:1223
 msgid "missing expression in .size directive"
 msgstr ""
 
-#: config/obj-elf.c:1283
+#: config/obj-elf.c:1290
 #, c-format
 msgid "ignoring unrecognized symbol type \"%s\""
 msgstr ""
 
-#: config/obj-elf.c:1453
+#: config/obj-elf.c:1464
 msgid ".size expression too complicated to fix up"
 msgstr ""
 
-#: config/obj-elf.c:1484
+#: config/obj-elf.c:1495
 #, c-format
 msgid ""
 "invalid attempt to declare external version name as default in symbol `%s'"
 msgstr ""
 
-#: config/obj-elf.c:1610
+#: config/obj-elf.c:1625
 #, c-format
 msgid "Failed to set up debugging information: %s"
 msgstr ""
 
-#: config/obj-elf.c:1626
+#: config/obj-elf.c:1641
 #, c-format
 msgid "Can't start writing .mdebug section: %s"
 msgstr ""
 
-#: config/obj-elf.c:1634
+#: config/obj-elf.c:1649
 #, c-format
 msgid "Could not write .mdebug section: %s"
 msgstr ""
@@ -817,25 +818,25 @@
 msgid "unhandled stab type %d"
 msgstr ""
 
-#: config/tc-a29k.c:160 config/tc-sparc.c:3357
+#: config/tc-a29k.c:160 config/tc-sparc.c:3358
 msgid "Unknown segment type"
 msgstr ""
 
 #. Probably a memory allocation problem?  Give up now.
-#: config/tc-a29k.c:330 config/tc-hppa.c:1354 config/tc-i860.c:202
-#: config/tc-mips.c:1102 config/tc-mips.c:1144 config/tc-sparc.c:715
+#: config/tc-a29k.c:330 config/tc-hppa.c:1336 config/tc-i860.c:202
+#: config/tc-mips.c:1016 config/tc-mips.c:1058 config/tc-sparc.c:715
 msgid "Broken assembler.  No assembly attempted."
 msgstr ""
 
 #: config/tc-a29k.c:375 config/tc-arc.c:534 config/tc-d10v.c:481
 #: config/tc-d30v.c:540 config/tc-h8300.c:305 config/tc-h8500.c:297
-#: config/tc-mcore.c:380 config/tc-mn10200.c:936 config/tc-mn10300.c:1307
-#: config/tc-ppc.c:1844 config/tc-sh.c:478 config/tc-tic80.c:291
+#: config/tc-mcore.c:509 config/tc-mn10200.c:936 config/tc-mn10300.c:992
+#: config/tc-ppc.c:1850 config/tc-sh.c:478 config/tc-tic80.c:291
 #: config/tc-v850.c:2033 config/tc-w65.c:257 config/tc-z8k.c:341
 msgid "missing operand"
 msgstr ""
 
-#: config/tc-a29k.c:415 config/tc-hppa.c:1471 config/tc-i860.c:407
+#: config/tc-a29k.c:415 config/tc-hppa.c:1450 config/tc-i860.c:407
 #: config/tc-i860.c:423 config/tc-sparc.c:1191 config/tc-sparc.c:1197
 #, c-format
 msgid "Unknown opcode: `%s'"
@@ -897,13 +898,13 @@
 msgid "internal error: can't hash macro `%s': %s"
 msgstr ""
 
-#: config/tc-alpha.c:832 config/tc-i960.c:2711
+#: config/tc-alpha.c:832 config/tc-i960.c:2736
 msgid "syntax error"
 msgstr ""
 
 #: config/tc-alpha.c:905 config/tc-arm.c:4982 config/tc-h8300.c:1413
-#: config/tc-h8500.c:1222 config/tc-hppa.c:3651 config/tc-i860.c:813
-#: config/tc-m68k.c:4003 config/tc-m88k.c:1106 config/tc-ns32k.c:1588
+#: config/tc-h8500.c:1222 config/tc-hppa.c:2684 config/tc-i860.c:813
+#: config/tc-m68k.c:4125 config/tc-m88k.c:1106 config/tc-ns32k.c:1588
 #: config/tc-sparc.c:2433 config/tc-z8k.c:1355
 msgid "Bad call to MD_ATOF()"
 msgstr ""
@@ -945,219 +946,219 @@
 msgid "type %d reloc done?\n"
 msgstr ""
 
-#: config/tc-alpha.c:1243 config/tc-alpha.c:1250 config/tc-mips.c:7777
+#: config/tc-alpha.c:1243 config/tc-alpha.c:1250 config/tc-mips.c:7329
 msgid "Used $at without \".set noat\""
 msgstr ""
 
-#: config/tc-alpha.c:1407
+#: config/tc-alpha.c:1408
 #, c-format
 msgid "cannot represent `%s' relocation in object file"
 msgstr ""
 
-#: config/tc-alpha.c:1414
+#: config/tc-alpha.c:1415
 #, c-format
 msgid "internal error? cannot generate `%s' relocation"
 msgstr ""
 
-#: config/tc-alpha.c:1468
+#: config/tc-alpha.c:1469
 #, c-format
 msgid "frame reg expected, using $%d."
 msgstr ""
 
-#: config/tc-alpha.c:1793
+#: config/tc-alpha.c:1794
 #, c-format
 msgid "operand out of range (%s not between %d and %d)"
 msgstr ""
 
-#: config/tc-alpha.c:1890 config/tc-arc.c:547 config/tc-d10v.c:570
-#: config/tc-d30v.c:623 config/tc-mn10200.c:991 config/tc-mn10300.c:1382
-#: config/tc-ppc.c:1810 config/tc-ppc.c:1917 config/tc-ppc.c:1929
+#: config/tc-alpha.c:1891 config/tc-arc.c:547 config/tc-d10v.c:570
+#: config/tc-d30v.c:623 config/tc-mn10200.c:991 config/tc-mn10300.c:1058
+#: config/tc-ppc.c:1816 config/tc-ppc.c:1923 config/tc-ppc.c:1935
 #: config/tc-v850.c:1819 config/tc-v850.c:1842 config/tc-v850.c:2055
 msgid "too many fixups"
 msgstr ""
 
-#: config/tc-alpha.c:2015 config/tc-alpha.c:2073
+#: config/tc-alpha.c:2016 config/tc-alpha.c:2074
 #, c-format
 msgid "inappropriate arguments for opcode `%s'"
 msgstr ""
 
-#: config/tc-alpha.c:2017 config/tc-alpha.c:2075
+#: config/tc-alpha.c:2018 config/tc-alpha.c:2076
 #, c-format
 msgid "opcode `%s' not supported for target %s"
 msgstr ""
 
-#: config/tc-alpha.c:2021 config/tc-alpha.c:2078
+#: config/tc-alpha.c:2022 config/tc-alpha.c:2079
 #, c-format
 msgid "unknown opcode `%s'"
 msgstr ""
 
-#: config/tc-alpha.c:2130
+#: config/tc-alpha.c:2131
 msgid "can not resolve expression"
 msgstr ""
 
-#: config/tc-alpha.c:2268 config/tc-alpha.c:2445
+#: config/tc-alpha.c:2269 config/tc-alpha.c:2446
 msgid "overflow in literal (.lita) table"
 msgstr ""
 
-#: config/tc-alpha.c:2275 config/tc-alpha.c:2297 config/tc-alpha.c:2458
-#: config/tc-alpha.c:2680 config/tc-alpha.c:2727 config/tc-alpha.c:2775
-#: config/tc-alpha.c:2864 config/tc-alpha.c:3065 config/tc-alpha.c:3166
+#: config/tc-alpha.c:2276 config/tc-alpha.c:2298 config/tc-alpha.c:2459
+#: config/tc-alpha.c:2681 config/tc-alpha.c:2728 config/tc-alpha.c:2776
+#: config/tc-alpha.c:2865 config/tc-alpha.c:3066 config/tc-alpha.c:3167
 msgid "macro requires $at register while noat in effect"
 msgstr ""
 
-#: config/tc-alpha.c:2277 config/tc-alpha.c:2299 config/tc-alpha.c:2460
+#: config/tc-alpha.c:2278 config/tc-alpha.c:2300 config/tc-alpha.c:2461
 msgid "macro requires $at while $at in use"
 msgstr ""
 
-#: config/tc-alpha.c:2407 expr.c:82 read.c:3101
+#: config/tc-alpha.c:2408 expr.c:86 read.c:3125
 msgid "bignum invalid; zero assumed"
 msgstr ""
 
-#: config/tc-alpha.c:2409 expr.c:84 read.c:3103 read.c:3432 read.c:4328
+#: config/tc-alpha.c:2410 expr.c:88 read.c:3127 read.c:3457 read.c:4353
 msgid "floating point number invalid; zero assumed"
 msgstr ""
 
-#: config/tc-alpha.c:2414
+#: config/tc-alpha.c:2415
 msgid "can't handle expression"
 msgstr ""
 
-#: config/tc-alpha.c:2451
+#: config/tc-alpha.c:2452
 msgid "overflow in literal (.lit8) table"
 msgstr ""
 
-#: config/tc-alpha.c:3400 config/tc-ppc.c:1338 config/tc-ppc.c:3542
-#: read.c:1358
+#: config/tc-alpha.c:3401 config/tc-ppc.c:1344 config/tc-ppc.c:3548
+#: read.c:1377
 #, c-format
 msgid ".COMMon length (%ld.) <0! Ignored."
 msgstr ""
 
-#: config/tc-alpha.c:3438 config/tc-alpha.c:3447 config/tc-ppc.c:3579
-#: read.c:1379
+#: config/tc-alpha.c:3439 config/tc-alpha.c:3448 config/tc-ppc.c:3585
+#: read.c:1398
 #, c-format
 msgid "Length of .comm \"%s\" is already %ld. Not changed to %ld."
 msgstr ""
 
-#: config/tc-alpha.c:3549 ecoff.c:3105
+#: config/tc-alpha.c:3550 ecoff.c:3108
 msgid ".ent directive has no name"
 msgstr ""
 
-#: config/tc-alpha.c:3557
+#: config/tc-alpha.c:3558
 msgid "nested .ent directives"
 msgstr ""
 
-#: config/tc-alpha.c:3593 ecoff.c:3053
+#: config/tc-alpha.c:3594 ecoff.c:3056
 msgid ".end directive has no name"
 msgstr ""
 
-#: config/tc-alpha.c:3602
+#: config/tc-alpha.c:3603
 msgid ".end directive names different symbol than .ent"
 msgstr ""
 
-#: config/tc-alpha.c:3676
+#: config/tc-alpha.c:3678
 #, c-format
 msgid "Invalid argument %d to .prologue."
 msgstr ""
 
-#: config/tc-alpha.c:3704
+#: config/tc-alpha.c:3706
 msgid "ECOFF debugging is disabled."
 msgstr ""
 
-#: config/tc-alpha.c:3725
+#: config/tc-alpha.c:3727
 msgid "Unknown section directive"
 msgstr ""
 
-#: config/tc-alpha.c:3762
+#: config/tc-alpha.c:3764
 msgid ".ent directive has no symbol"
 msgstr ""
 
-#: config/tc-alpha.c:3790
+#: config/tc-alpha.c:3792
 msgid "Bad .frame directive 1./2. param"
 msgstr ""
 
-#: config/tc-alpha.c:3802
+#: config/tc-alpha.c:3804
 msgid "Bad .frame directive 3./4. param"
 msgstr ""
 
-#: config/tc-alpha.c:3827
+#: config/tc-alpha.c:3829
 msgid ".pdesc directive not in link (.link) section"
 msgstr ""
 
-#: config/tc-alpha.c:3835
+#: config/tc-alpha.c:3837
 msgid ".pdesc has no matching .ent"
 msgstr ""
 
-#: config/tc-alpha.c:3845
+#: config/tc-alpha.c:3847
 msgid ".pdesc directive has no entry symbol"
 msgstr ""
 
-#: config/tc-alpha.c:3857
+#: config/tc-alpha.c:3859
 msgid "No comma after .pdesc <entryname>"
 msgstr ""
 
-#: config/tc-alpha.c:3880
+#: config/tc-alpha.c:3882
 msgid "unknown procedure kind"
 msgstr ""
 
-#: config/tc-alpha.c:3975
+#: config/tc-alpha.c:3977
 msgid ".name directive not in link (.link) section"
 msgstr ""
 
-#: config/tc-alpha.c:3983
+#: config/tc-alpha.c:3985
 msgid ".name directive has no symbol"
 msgstr ""
 
-#: config/tc-alpha.c:4018
+#: config/tc-alpha.c:4020
 msgid "No symbol after .linkage"
 msgstr ""
 
-#: config/tc-alpha.c:4047
+#: config/tc-alpha.c:4049
 msgid "No symbol after .code_address"
 msgstr ""
 
-#: config/tc-alpha.c:4082 ecoff.c:3269
+#: config/tc-alpha.c:4084 ecoff.c:3273
 msgid "Bad .mask directive"
 msgstr ""
 
-#: config/tc-alpha.c:4104 ecoff.c:3200
+#: config/tc-alpha.c:4106 ecoff.c:3204
 msgid "Bad .fmask directive"
 msgstr ""
 
-#: config/tc-alpha.c:4275 read.c:2123 read.c:2675 stabs.c:460
+#: config/tc-alpha.c:4277 read.c:2144 read.c:2696 stabs.c:460
 #, c-format
 msgid "Expected comma after name \"%s\""
 msgstr ""
 
 #. symbolP->sy_other = (signed char) temp;
-#: config/tc-alpha.c:4286
+#: config/tc-alpha.c:4288
 #, c-format
 msgid "unhandled: .proc %s,%d"
 msgstr ""
 
-#: config/tc-alpha.c:4321
+#: config/tc-alpha.c:4323
 #, c-format
 msgid "Tried to .set unrecognized mode `%s'"
 msgstr ""
 
 #. not fatal, but it might not work in the end
-#: config/tc-alpha.c:4338
+#: config/tc-alpha.c:4340
 msgid "File overrides no-base-register option."
 msgstr ""
 
-#: config/tc-alpha.c:4355
+#: config/tc-alpha.c:4357
 #, c-format
 msgid "Bad base register, using $%d."
 msgstr ""
 
-#: config/tc-alpha.c:4377
+#: config/tc-alpha.c:4379
 #, c-format
 msgid "Alignment too large: %d. assumed"
 msgstr ""
 
-#: config/tc-alpha.c:4381 config/tc-d30v.c:2163
+#: config/tc-alpha.c:4383 config/tc-d30v.c:2163
 msgid "Alignment negative: 0 assumed"
 msgstr ""
 
-#: config/tc-alpha.c:4694
+#: config/tc-alpha.c:4696
 #, c-format
 msgid "Chose GP value of %lx\n"
 msgstr ""
@@ -1170,8 +1171,8 @@
 msgstr ""
 
 #: config/tc-arc.c:154 config/tc-arc.c:177 config/tc-arc.c:921
-#: config/tc-hppa.c:1316 config/tc-hppa.c:6410 config/tc-hppa.c:6416
-#: config/tc-hppa.c:6422 config/tc-mn10300.c:890 config/tc-mn10300.c:2023
+#: config/tc-hppa.c:1298 config/tc-hppa.c:5054 config/tc-hppa.c:5060
+#: config/tc-hppa.c:5066 config/tc-mn10300.c:721 config/tc-mn10300.c:1646
 msgid "could not set architecture and machine"
 msgstr ""
 
@@ -1179,8 +1180,8 @@
 msgid "virtual memory exhausted"
 msgstr ""
 
-#: config/tc-arc.c:253 config/tc-mn10200.c:1354 config/tc-mn10300.c:1930
-#: config/tc-ppc.c:1095 config/tc-v850.c:1618
+#: config/tc-arc.c:253 config/tc-mn10200.c:1354 config/tc-mn10300.c:1565
+#: config/tc-ppc.c:1101 config/tc-v850.c:1618
 #, c-format
 msgid "operand out of range (%s not between %ld and %ld)"
 msgstr ""
@@ -1195,13 +1196,13 @@
 msgstr ""
 
 #: config/tc-arc.c:532 config/tc-d10v.c:479 config/tc-d30v.c:538
-#: config/tc-mn10200.c:933 config/tc-mn10300.c:1304 config/tc-ppc.c:1842
+#: config/tc-mn10200.c:933 config/tc-mn10300.c:989 config/tc-ppc.c:1848
 #: config/tc-tic80.c:287 config/tc-v850.c:2030
 msgid "illegal operand"
 msgstr ""
 
-#: config/tc-arc.c:619 config/tc-mn10200.c:1032 config/tc-mn10300.c:1452
-#: config/tc-ppc.c:1966 config/tc-v850.c:2108
+#: config/tc-arc.c:619 config/tc-mn10200.c:1032 config/tc-mn10300.c:1128
+#: config/tc-ppc.c:1972 config/tc-v850.c:2108
 #, c-format
 msgid "junk at end of line: `%s'"
 msgstr ""
@@ -1218,7 +1219,7 @@
 msgid "conditional branch follows set of flags"
 msgstr ""
 
-#: config/tc-arc.c:748 config/tc-arm.c:6041
+#: config/tc-arc.c:748 config/tc-arm.c:6039
 #, c-format
 msgid "bad instruction `%s'"
 msgstr ""
@@ -1247,7 +1248,7 @@
 msgid "bad .cpu op"
 msgstr ""
 
-#: config/tc-arc.c:950 config/tc-ppc.c:2615
+#: config/tc-arc.c:950 config/tc-ppc.c:2621
 msgid "missing rename string"
 msgstr ""
 
@@ -1256,7 +1257,7 @@
 msgstr ""
 
 #: config/tc-arc.c:1009 config/tc-d10v.c:274 config/tc-d30v.c:353
-#: config/tc-mips.c:9317 config/tc-mn10200.c:356 config/tc-ppc.c:4363
+#: config/tc-mips.c:8736 config/tc-mn10200.c:356 config/tc-ppc.c:4369
 #: config/tc-sh.c:1187 config/tc-v850.c:1276
 msgid "bad call to md_atof"
 msgstr ""
@@ -1271,17 +1272,17 @@
 msgstr ""
 
 #: config/tc-arc.c:1324 config/tc-arm.c:2937 config/tc-d10v.c:1448
-#: config/tc-d30v.c:1810 config/tc-mips.c:3361 config/tc-mips.c:4317
-#: config/tc-mips.c:5102 config/tc-mips.c:5648 config/tc-ppc.c:4698
+#: config/tc-d30v.c:1810 config/tc-mips.c:3196 config/tc-mips.c:4128
+#: config/tc-mips.c:4913 config/tc-mips.c:5459 config/tc-ppc.c:4704
 #: config/tc-v850.c:2339
 msgid "expression too complex"
 msgstr ""
 
-#: config/tc-arc.c:1390 config/tc-ppc.c:4801 config/tc-v850.c:2383
+#: config/tc-arc.c:1390 config/tc-ppc.c:4807 config/tc-v850.c:2383
 msgid "unresolved expression that must be resolved"
 msgstr ""
 
-#: config/tc-arc.c:1454 config/tc-sparc.c:2880
+#: config/tc-arc.c:1454 config/tc-sparc.c:2881
 #, c-format
 msgid "internal error: can't export reloc type %d (`%s')"
 msgstr ""
@@ -1302,12 +1303,12 @@
 msgid "Inserting implicit pool at change of section"
 msgstr ""
 
-#: config/tc-arm.c:1183 config/tc-mips.c:10603 read.c:2017
+#: config/tc-arm.c:1183 config/tc-mips.c:9851 read.c:2038
 #, c-format
 msgid "Alignment too large: %d. assumed."
 msgstr ""
 
-#: config/tc-arm.c:1186 read.c:2022
+#: config/tc-arm.c:1186 read.c:2043
 msgid "Alignment negative. 0 assumed."
 msgstr ""
 
@@ -1608,8 +1609,8 @@
 msgid "invalid base register in load/store"
 msgstr ""
 
-#: config/tc-arm.c:4308 config/tc-arm.c:5471 config/tc-arm.c:5480
-#: config/tc-arm.c:5487 config/tc-arm.c:5494 config/tc-arm.c:5501
+#: config/tc-arm.c:4308 config/tc-arm.c:5469 config/tc-arm.c:5478
+#: config/tc-arm.c:5485 config/tc-arm.c:5492 config/tc-arm.c:5499
 msgid "Invalid offset"
 msgstr ""
 
@@ -1672,134 +1673,134 @@
 msgid "Invalid expression in load/store multiple"
 msgstr ""
 
-#: config/tc-arm.c:5341 config/tc-arm.c:5357 config/tc-mips.c:10430
+#: config/tc-arm.c:5339 config/tc-arm.c:5355 config/tc-mips.c:9678
 msgid "Branch out of range"
 msgstr ""
 
-#: config/tc-arm.c:5376
+#: config/tc-arm.c:5374
 msgid "Branch with link out of range"
 msgstr ""
 
-#: config/tc-arm.c:5443
+#: config/tc-arm.c:5441
 msgid "Illegal value for co-processor offset"
 msgstr ""
 
-#: config/tc-arm.c:5466
+#: config/tc-arm.c:5464
 #, c-format
 msgid "Invalid offset, target not word aligned (0x%08X)"
 msgstr ""
 
-#: config/tc-arm.c:5537
+#: config/tc-arm.c:5535
 msgid "Invalid immediate for stack address calculation"
 msgstr ""
 
-#: config/tc-arm.c:5546
+#: config/tc-arm.c:5544
 #, c-format
 msgid "Invalid immediate for address calculation (value = 0x%08X)"
 msgstr ""
 
-#: config/tc-arm.c:5555
+#: config/tc-arm.c:5553
 msgid "Invalid 8bit immediate"
 msgstr ""
 
-#: config/tc-arm.c:5563
+#: config/tc-arm.c:5561
 msgid "Invalid 3bit immediate"
 msgstr ""
 
-#: config/tc-arm.c:5579
+#: config/tc-arm.c:5577
 #, c-format
 msgid "Invalid immediate: %d is too large"
 msgstr ""
 
-#: config/tc-arm.c:5593
+#: config/tc-arm.c:5591
 #, c-format
 msgid "Illegal Thumb shift value: %d"
 msgstr ""
 
-#: config/tc-arm.c:5607
+#: config/tc-arm.c:5605
 #, c-format
 msgid "Bad relocation fixup type (%d)\n"
 msgstr ""
 
-#: config/tc-arm.c:5676
+#: config/tc-arm.c:5674
 msgid "Literal referenced across section boundry (Implicit dump?)"
 msgstr ""
 
-#: config/tc-arm.c:5695
+#: config/tc-arm.c:5693
 #, c-format
 msgid "Internal_relocation (type %d) not fixed up (IMMEDIATE)"
 msgstr ""
 
-#: config/tc-arm.c:5701
+#: config/tc-arm.c:5699
 #, c-format
 msgid "Internal_relocation (type %d) not fixed up (OFFSET_IMM)"
 msgstr ""
 
-#: config/tc-arm.c:5724
+#: config/tc-arm.c:5722
 #, c-format
 msgid "Can not represent %s relocation in this object file format (%d)"
 msgstr ""
 
-#: config/tc-arm.c:5742 config/tc-mips.c:11909 config/tc-sh.c:2277
+#: config/tc-arm.c:5740 config/tc-mips.c:11166 config/tc-sh.c:2282
 #, c-format
 msgid "Can not represent %s relocation in this object file format"
 msgstr ""
 
-#: config/tc-arm.c:5755
+#: config/tc-arm.c:5753
 msgid "md_estimate_size_before_relax\n"
 msgstr ""
 
-#: config/tc-arm.c:5825
+#: config/tc-arm.c:5823
 #, c-format
 msgid "No operator -- statement `%s'\n"
 msgstr ""
 
-#: config/tc-arm.c:5875 config/tc-arm.c:5927
+#: config/tc-arm.c:5873 config/tc-arm.c:5925
 #, c-format
 msgid "Opcode `%s' must have suffix from <%s>\n"
 msgstr ""
 
-#: config/tc-arm.c:5900
+#: config/tc-arm.c:5898
 msgid "Warning: Use of the 'nv' conditional is deprecated\n"
 msgstr ""
 
-#: config/tc-arm.c:6019
+#: config/tc-arm.c:6017
 #, c-format
 msgid "register '%s' does not exist\n"
 msgstr ""
 
-#: config/tc-arm.c:6025
+#: config/tc-arm.c:6023
 #, c-format
 msgid "ignoring redefinition of register alias '%s'"
 msgstr ""
 
-#: config/tc-arm.c:6030
+#: config/tc-arm.c:6028
 #, c-format
 msgid ""
 "ignoring redefinition of register alias '%s' to non-existant register '%s'"
 msgstr ""
 
-#: config/tc-arm.c:6034
+#: config/tc-arm.c:6032
 msgid "ignoring incomplete .req pseuso op"
 msgstr ""
 
-#: config/tc-arm.c:6210
+#: config/tc-arm.c:6208
 #, c-format
 msgid "Unrecognised APCS switch -m%s"
 msgstr ""
 
-#: config/tc-arm.c:6336 config/tc-arm.c:6347 config/tc-arm.c:6358
-#: config/tc-arm.c:6363
+#: config/tc-arm.c:6334 config/tc-arm.c:6345 config/tc-arm.c:6356
+#: config/tc-arm.c:6361
 #, c-format
 msgid "Invalid architecture variant -m%s"
 msgstr ""
 
-#: config/tc-arm.c:6370
+#: config/tc-arm.c:6368
 #, c-format
 msgid "Invalid processor variant -m%s"
 msgstr ""
 
-#: config/tc-arm.c:6392
+#: config/tc-arm.c:6390
 msgid ""
 " ARM Specific Assembler Options:\n"
 "  -m[arm][<processor name>] select processor variant\n"
@@ -1814,36 +1815,36 @@
 "  -mno-fpu                  don't allow any floating-point instructions.\n"
 msgstr ""
 
-#: config/tc-arm.c:6403
+#: config/tc-arm.c:6401
 msgid "  -k                        generate PIC code.\n"
 msgstr ""
 
-#: config/tc-arm.c:6407
+#: config/tc-arm.c:6405
 msgid ""
 "  -mapcs-32, -mapcs-26      specify which ARM Procedure Calling Standard to "
 "use\n"
 msgstr ""
 
-#: config/tc-arm.c:6410
+#: config/tc-arm.c:6408
 msgid "  -mapcs-float              floating point args are passed in FP regs\n"
 msgstr ""
 
-#: config/tc-arm.c:6413
+#: config/tc-arm.c:6411
 msgid ""
 "  -mapcs-reentrant          the code is position independent/reentrant\n"
 msgstr ""
 
-#: config/tc-arm.c:6418
+#: config/tc-arm.c:6416
 msgid "  -moabi                    support the old ELF ABI\n"
 msgstr ""
 
-#: config/tc-arm.c:6423
+#: config/tc-arm.c:6421
 msgid ""
 "  -EB                       assemble code for a big endian cpu\n"
 "  -EL                       assemble code for a little endian cpu\n"
 msgstr ""
 
-#: config/tc-arm.c:6596
+#: config/tc-arm.c:6594
 #, c-format
 msgid "%s: unexpected function type: %d"
 msgstr ""
@@ -1901,7 +1902,7 @@
 msgstr ""
 
 #: config/tc-d10v.c:1023 config/tc-d10v.c:1037 config/tc-h8300.c:1279
-#: config/tc-h8500.c:1122 config/tc-mcore.c:709 config/tc-sh.c:1040
+#: config/tc-h8500.c:1122 config/tc-mcore.c:842 config/tc-sh.c:1040
 #: config/tc-z8k.c:1223
 msgid "can't find opcode "
 msgstr ""
@@ -1919,7 +1920,7 @@
 msgid "bad opcode or operands"
 msgstr ""
 
-#: config/tc-d10v.c:1246 config/tc-m68k.c:4110
+#: config/tc-d10v.c:1246 config/tc-m68k.c:4232
 msgid "value out of range"
 msgstr ""
 
@@ -1932,7 +1933,7 @@
 msgstr ""
 
 #: config/tc-d10v.c:1385 config/tc-d30v.c:1754 config/tc-mn10200.c:1234
-#: config/tc-mn10300.c:1786 config/tc-ppc.c:4997 config/tc-v850.c:2254
+#: config/tc-mn10300.c:1425 config/tc-ppc.c:5004 config/tc-v850.c:2254
 #, c-format
 msgid "reloc %d not supported by object file format"
 msgstr ""
@@ -2147,7 +2148,7 @@
 msgid "invalid operands"
 msgstr ""
 
-#: config/tc-h8300.c:1290 config/tc-h8500.c:1129 config/tc-mips.c:8513
+#: config/tc-h8300.c:1290 config/tc-h8500.c:1129 config/tc-mips.c:7932
 #: config/tc-sh.c:1047 config/tc-w65.c:759 config/tc-z8k.c:1235
 msgid "unknown opcode"
 msgstr ""
@@ -2225,373 +2226,363 @@
 msgid "invalid operands for opcode"
 msgstr ""
 
-#: config/tc-hppa.c:1114
+#: config/tc-hppa.c:1096
 msgid "Missing .exit\n"
 msgstr ""
 
-#: config/tc-hppa.c:1117
+#: config/tc-hppa.c:1099
 msgid "Missing .procend\n"
 msgstr ""
 
-#: config/tc-hppa.c:1126
+#: config/tc-hppa.c:1108
 msgid "Not in a space.\n"
 msgstr ""
 
-#: config/tc-hppa.c:1129
+#: config/tc-hppa.c:1111
 msgid "Not in a subspace.\n"
 msgstr ""
 
-#: config/tc-hppa.c:1291
+#: config/tc-hppa.c:1273
 msgid "Invalid field selector.  Assuming F%%."
 msgstr ""
 
-#: config/tc-hppa.c:1322
+#: config/tc-hppa.c:1304
 msgid "-R option not supported on this target."
 msgstr ""
 
-#: config/tc-hppa.c:1336
+#: config/tc-hppa.c:1318
 #, c-format
 msgid "Internal error: can't hash `%s': %s\n"
 msgstr ""
 
-#: config/tc-hppa.c:1344 config/tc-i860.c:191 config/tc-sparc.c:704
+#: config/tc-hppa.c:1326 config/tc-i860.c:191 config/tc-sparc.c:704
 #, c-format
 msgid "internal error: losing opcode: `%s' \"%s\"\n"
 msgstr ""
 
-#: config/tc-hppa.c:1406 config/tc-hppa.c:6539 config/tc-hppa.c:6591
+#: config/tc-hppa.c:1388 config/tc-hppa.c:5183 config/tc-hppa.c:5235
 msgid "Missing function name for .PROC (corrupted label chain)"
 msgstr ""
 
-#: config/tc-hppa.c:1409 config/tc-hppa.c:6594
+#: config/tc-hppa.c:1391 config/tc-hppa.c:5238
 msgid "Missing function name for .PROC"
 msgstr ""
 
-#: config/tc-hppa.c:1518 config/tc-hppa.c:4430
+#: config/tc-hppa.c:1494 config/tc-hppa.c:3463
 msgid "could not update architecture and machine"
 msgstr ""
 
-#: config/tc-hppa.c:1714
+#: config/tc-hppa.c:1625
 msgid "Invalid Indexed Load Completer."
 msgstr ""
 
-#: config/tc-hppa.c:1723
+#: config/tc-hppa.c:1630
 msgid "Invalid Indexed Load Completer Syntax."
 msgstr ""
 
-#: config/tc-hppa.c:1756
+#: config/tc-hppa.c:1654
 msgid "Invalid Short Load/Store Completer."
 msgstr ""
 
-#: config/tc-hppa.c:1807 config/tc-hppa.c:1812
+#: config/tc-hppa.c:1681 config/tc-hppa.c:1686
 msgid "Invalid Store Bytes Short Completer"
 msgstr ""
 
-#: config/tc-hppa.c:1822 config/tc-hppa.c:1866
+#: config/tc-hppa.c:1696 config/tc-hppa.c:1728
 #, c-format
 msgid "Invalid Compare/Subtract Condition: %c"
 msgstr ""
 
-#: config/tc-hppa.c:1840 config/tc-hppa.c:2375
+#: config/tc-hppa.c:1711
 msgid "Invalid Compare/Subtract Condition."
 msgstr ""
 
-#: config/tc-hppa.c:1881
+#: config/tc-hppa.c:1743
 msgid "Invalid Compare/Subtract Condition"
 msgstr ""
 
-#: config/tc-hppa.c:1970 config/tc-hppa.c:2062
+#: config/tc-hppa.c:1821 config/tc-hppa.c:1894
 #, c-format
 msgid "Invalid Add Condition: %s"
 msgstr ""
 
-#: config/tc-hppa.c:2132 config/tc-hppa.c:2245
+#: config/tc-hppa.c:1948 config/tc-hppa.c:2025
 msgid "Invalid Logical Instruction Condition."
 msgstr ""
 
-#: config/tc-hppa.c:2301
+#: config/tc-hppa.c:2067
 msgid "Invalid Shift/Extract/Deposit Condition."
 msgstr ""
 
-#: config/tc-hppa.c:2337
+#: config/tc-hppa.c:2089
 #, c-format
 msgid "Invalid Bit Branch Condition: %c"
 msgstr ""
 
-#: config/tc-hppa.c:2776 config/tc-hppa.c:2791
-#, c-format
-msgid "Invalid CBit Specification: %s"
-msgstr ""
-
-#: config/tc-hppa.c:2977 config/tc-hppa.c:3010 config/tc-hppa.c:3047
+#: config/tc-hppa.c:2202 config/tc-hppa.c:2235 config/tc-hppa.c:2272
 msgid "Branch to unaligned address"
 msgstr ""
 
-#: config/tc-hppa.c:3147
+#: config/tc-hppa.c:2335
 msgid "Invalid SFU identifier"
 msgstr ""
 
-#: config/tc-hppa.c:3207
+#: config/tc-hppa.c:2375
 msgid "Invalid COPR identifier"
 msgstr ""
 
-#: config/tc-hppa.c:3447 config/tc-hppa.c:3473 config/tc-hppa.c:3498
-#: config/tc-hppa.c:3523 config/tc-hppa.c:3548
+#: config/tc-hppa.c:2500 config/tc-hppa.c:2521 config/tc-hppa.c:2541
+#: config/tc-hppa.c:2561 config/tc-hppa.c:2581
 msgid "Invalid register for single precision fmpyadd or fmpysub"
 msgstr ""
 
-#: config/tc-hppa.c:3572
+#: config/tc-hppa.c:2605
 msgid "Invalid Floating Point Operand Format."
 msgstr ""
 
-#: config/tc-hppa.c:3595
+#: config/tc-hppa.c:2628
 #, c-format
 msgid "Invalid operands %s"
 msgstr ""
 
-#: config/tc-hppa.c:4130
+#: config/tc-hppa.c:3163
 msgid "Unknown relocation encountered in md_apply_fix."
 msgstr ""
 
-#: config/tc-hppa.c:4140
+#: config/tc-hppa.c:3173
 #, c-format
 msgid "no hppa_fixup entry for this fixup (fixP = 0x%x, type = 0x%x)\n"
 msgstr ""
 
-#: config/tc-hppa.c:4282 config/tc-hppa.c:4307
+#: config/tc-hppa.c:3315 config/tc-hppa.c:3340
 #, c-format
 msgid "Undefined register: '%s'."
 msgstr ""
 
-#: config/tc-hppa.c:4345
+#: config/tc-hppa.c:3378
 #, c-format
 msgid "Non-absolute symbol: '%s'."
 msgstr ""
 
-#: config/tc-hppa.c:4360
+#: config/tc-hppa.c:3393
 #, c-format
 msgid "Undefined absolute constant: '%s'."
 msgstr ""
 
-#: config/tc-hppa.c:4469
+#: config/tc-hppa.c:3502
 #, c-format
 msgid "Invalid FP Compare Condition: %s"
 msgstr ""
 
-#: config/tc-hppa.c:4526
-#, c-format
-msgid "Invalid FTEST completer: %s"
-msgstr ""
-
-#: config/tc-hppa.c:4593 config/tc-hppa.c:4632
+#: config/tc-hppa.c:3543
 #, c-format
 msgid "Invalid FP Operand Format: %3s"
 msgstr ""
 
-#: config/tc-hppa.c:4713
+#: config/tc-hppa.c:3624
 msgid "Bad segment in expression."
 msgstr ""
 
-#: config/tc-hppa.c:4772
+#: config/tc-hppa.c:3675
 msgid "Bad segment (should be absolute)."
 msgstr ""
 
-#: config/tc-hppa.c:4871
+#: config/tc-hppa.c:3774
 #, c-format
 msgid "Invalid argument location: %s\n"
 msgstr ""
 
-#: config/tc-hppa.c:4902
+#: config/tc-hppa.c:3805
 #, c-format
 msgid "Invalid argument description: %d"
 msgstr ""
 
-#: config/tc-hppa.c:4925
+#: config/tc-hppa.c:3828
 #, c-format
 msgid "Invalid Nullification: (%c)"
 msgstr ""
 
-#: config/tc-hppa.c:5657
+#: config/tc-hppa.c:4301
 #, c-format
 msgid "Invalid .CALL argument: %s"
 msgstr ""
 
-#: config/tc-hppa.c:5776
+#: config/tc-hppa.c:4420
 msgid ".callinfo is not within a procedure definition"
 msgstr ""
 
-#: config/tc-hppa.c:5796
+#: config/tc-hppa.c:4440
 #, c-format
 msgid "FRAME parameter must be a multiple of 8: %d\n"
 msgstr ""
 
-#: config/tc-hppa.c:5815
+#: config/tc-hppa.c:4459
 msgid "Value for ENTRY_GR must be in the range 3..18\n"
 msgstr ""
 
-#: config/tc-hppa.c:5827
+#: config/tc-hppa.c:4471
 msgid "Value for ENTRY_FR must be in the range 12..21\n"
 msgstr ""
 
-#: config/tc-hppa.c:5837
+#: config/tc-hppa.c:4481
 msgid "Value for ENTRY_SR must be 3\n"
 msgstr ""
 
-#: config/tc-hppa.c:5893
+#: config/tc-hppa.c:4537
 #, c-format
 msgid "Invalid .CALLINFO argument: %s"
 msgstr ""
 
-#: config/tc-hppa.c:5983
+#: config/tc-hppa.c:4627
 msgid "The .ENTER pseudo-op is not supported"
 msgstr ""
 
-#: config/tc-hppa.c:5997
+#: config/tc-hppa.c:4641
 msgid "Misplaced .entry. Ignored."
 msgstr ""
 
-#: config/tc-hppa.c:6001
+#: config/tc-hppa.c:4645
 msgid "Missing .callinfo."
 msgstr ""
 
-#: config/tc-hppa.c:6049
+#: config/tc-hppa.c:4693
 msgid ".REG must use a label"
 msgstr ""
 
-#: config/tc-hppa.c:6051
+#: config/tc-hppa.c:4695
 msgid ".EQU must use a label"
 msgstr ""
 
-#: config/tc-hppa.c:6102
+#: config/tc-hppa.c:4746
 msgid ".EXIT must appear within a procedure"
 msgstr ""
 
-#: config/tc-hppa.c:6106
+#: config/tc-hppa.c:4750
 msgid "Missing .callinfo"
 msgstr ""
 
-#: config/tc-hppa.c:6110
+#: config/tc-hppa.c:4754
 msgid "No .ENTRY for this .EXIT"
 msgstr ""
 
-#: config/tc-hppa.c:6137
+#: config/tc-hppa.c:4781
 #, c-format
 msgid "Cannot define export symbol: %s\n"
 msgstr ""
 
-#: config/tc-hppa.c:6190
+#: config/tc-hppa.c:4834
 #, c-format
 msgid "Using ENTRY rather than CODE in export directive for %s"
 msgstr ""
 
-#: config/tc-hppa.c:6291
+#: config/tc-hppa.c:4935
 #, c-format
 msgid "Undefined .EXPORT/.IMPORT argument (ignored): %s"
 msgstr ""
 
-#: config/tc-hppa.c:6373
+#: config/tc-hppa.c:5017
 msgid "Missing label name on .LABEL"
 msgstr ""
 
-#: config/tc-hppa.c:6378
+#: config/tc-hppa.c:5022
 msgid "extra .LABEL arguments ignored."
 msgstr ""
 
-#: config/tc-hppa.c:6393
+#: config/tc-hppa.c:5037
 msgid "The .LEAVE pseudo-op is not supported"
 msgstr ""
 
-#: config/tc-hppa.c:6426
+#: config/tc-hppa.c:5070
 msgid "Unrecognized .LEVEL argument\n"
 msgstr ""
 
-#: config/tc-hppa.c:6460
+#: config/tc-hppa.c:5104
 #, c-format
 msgid "Cannot define static symbol: %s\n"
 msgstr ""
 
-#: config/tc-hppa.c:6493
+#: config/tc-hppa.c:5137
 msgid "Nested procedures"
 msgstr ""
 
-#: config/tc-hppa.c:6503
+#: config/tc-hppa.c:5147
 msgid "Cannot allocate unwind descriptor\n"
 msgstr ""
 
-#: config/tc-hppa.c:6598
+#: config/tc-hppa.c:5242
 msgid "misplaced .procend"
 msgstr ""
 
-#: config/tc-hppa.c:6601
+#: config/tc-hppa.c:5245
 msgid "Missing .callinfo for this procedure"
 msgstr ""
 
-#: config/tc-hppa.c:6604
+#: config/tc-hppa.c:5248
 msgid "Missing .EXIT for a .ENTRY"
 msgstr ""
 
-#: config/tc-hppa.c:6704
+#: config/tc-hppa.c:5348
 msgid "Invalid .SPACE argument"
 msgstr ""
 
-#: config/tc-hppa.c:6752
+#: config/tc-hppa.c:5396
 msgid "Can't change spaces within a procedure definition. Ignored"
 msgstr ""
 
-#: config/tc-hppa.c:6879
+#: config/tc-hppa.c:5523
 #, c-format
 msgid "Undefined space: '%s' Assuming space number = 0."
 msgstr ""
 
-#: config/tc-hppa.c:6921
+#: config/tc-hppa.c:5565
 msgid "Must be in a space before changing or declaring subspaces.\n"
 msgstr ""
 
-#: config/tc-hppa.c:6925
+#: config/tc-hppa.c:5569
 msgid "Can't change subspaces within a procedure definition. Ignored"
 msgstr ""
 
-#: config/tc-hppa.c:6961
+#: config/tc-hppa.c:5605
 msgid "Parameters of an existing subspace can't be modified"
 msgstr ""
 
-#: config/tc-hppa.c:7014
+#: config/tc-hppa.c:5658
 msgid "Alignment must be a power of 2"
 msgstr ""
 
-#: config/tc-hppa.c:7056
+#: config/tc-hppa.c:5700
 msgid "FIRST not supported as a .SUBSPACE argument"
 msgstr ""
 
-#: config/tc-hppa.c:7058
+#: config/tc-hppa.c:5702
 msgid "Invalid .SUBSPACE argument"
 msgstr ""
 
-#: config/tc-hppa.c:7098
+#: config/tc-hppa.c:5742
 msgid "Ignoring subspace decl due to ELF BFD bugs."
 msgstr ""
 
-#: config/tc-hppa.c:7261
+#: config/tc-hppa.c:5905
 #, c-format
 msgid "Internal error: Unable to find containing space for %s."
 msgstr ""
 
-#: config/tc-hppa.c:7302
+#: config/tc-hppa.c:5946
 #, c-format
 msgid "Out of memory: could not allocate new space chain entry: %s\n"
 msgstr ""
 
-#: config/tc-hppa.c:7388
+#: config/tc-hppa.c:6032
 #, c-format
 msgid "Out of memory: could not allocate new subspace chain entry: %s\n"
 msgstr ""
 
-#: config/tc-hppa.c:8044
+#: config/tc-hppa.c:6688
 #, c-format
 msgid "Symbol '%s' could not be created."
 msgstr ""
 
-#: config/tc-hppa.c:8048
+#: config/tc-hppa.c:6692
 msgid "No memory for symbol name."
 msgstr ""
 
@@ -2603,267 +2594,267 @@
 msgid "Bad argument to syntax directive."
 msgstr ""
 
-#: config/tc-i386.c:619 config/tc-m68k.c:3630
+#: config/tc-i386.c:619 config/tc-m68k.c:3750
 #, c-format
 msgid "Internal Error:  Can't hash %s: %s"
 msgstr ""
 
-#: config/tc-i386.c:850
+#: config/tc-i386.c:851
 msgid "Unknown"
 msgstr ""
 
-#: config/tc-i386.c:898 config/tc-i386.c:4360 config/tc-m68k.c:762
+#: config/tc-i386.c:899 config/tc-i386.c:4360 config/tc-m68k.c:772
 #, c-format
 msgid "Can not do %d byte pc-relative relocation"
 msgstr ""
 
-#: config/tc-i386.c:908 config/tc-i386.c:4363 config/tc-m68k.c:769
+#: config/tc-i386.c:909 config/tc-i386.c:4374 config/tc-m68k.c:779
 #, c-format
 msgid "Can not do %d byte relocation"
 msgstr ""
 
-#: config/tc-i386.c:1009 config/tc-i386.c:1095
+#: config/tc-i386.c:1010 config/tc-i386.c:1096
 #, c-format
 msgid "no such 386 instruction: `%s'"
 msgstr ""
 
-#: config/tc-i386.c:1018
+#: config/tc-i386.c:1019
 #, c-format
 msgid "invalid character %s in mnemonic"
 msgstr ""
 
-#: config/tc-i386.c:1025
+#: config/tc-i386.c:1026
 msgid "expecting prefix; got nothing"
 msgstr ""
 
-#: config/tc-i386.c:1027
+#: config/tc-i386.c:1028
 msgid "expecting mnemonic; got nothing"
 msgstr ""
 
-#: config/tc-i386.c:1045
+#: config/tc-i386.c:1046
 #, c-format
 msgid "redundant %s prefix"
 msgstr ""
 
-#: config/tc-i386.c:1104
+#: config/tc-i386.c:1105
 #, c-format
 msgid "expecting string instruction after `%s'"
 msgstr ""
 
-#: config/tc-i386.c:1127
+#: config/tc-i386.c:1128
 #, c-format
 msgid "invalid character %s before operand %d"
 msgstr ""
 
-#: config/tc-i386.c:1141
+#: config/tc-i386.c:1142
 #, c-format
 msgid "unbalanced parenthesis in operand %d."
 msgstr ""
 
-#: config/tc-i386.c:1144
+#: config/tc-i386.c:1145
 #, c-format
 msgid "unbalanced brackets in operand %d."
 msgstr ""
 
-#: config/tc-i386.c:1153
+#: config/tc-i386.c:1154
 #, c-format
 msgid "invalid character %s in operand %d"
 msgstr ""
 
-#: config/tc-i386.c:1180
+#: config/tc-i386.c:1181
 #, c-format
 msgid "spurious operands; (%d operands/instruction max)"
 msgstr ""
 
-#: config/tc-i386.c:1201
+#: config/tc-i386.c:1202
 msgid "expecting operand after ','; got nothing"
 msgstr ""
 
-#: config/tc-i386.c:1206
+#: config/tc-i386.c:1207
 msgid "expecting operand before ','; got nothing"
 msgstr ""
 
 #. we found no match
-#: config/tc-i386.c:1433
+#: config/tc-i386.c:1434
 #, c-format
 msgid "suffix or operands invalid for `%s'"
 msgstr ""
 
 #. Warn them that a data or address size prefix doesn't affect
 #. assembly of the next line of code.
-#: config/tc-i386.c:1442
+#: config/tc-i386.c:1443
 #, c-format
 msgid "stand-alone `%s' prefix"
 msgstr ""
 
-#: config/tc-i386.c:1466 config/tc-i386.c:1481
+#: config/tc-i386.c:1467 config/tc-i386.c:1482
 msgid "`%s' operand %d must use `%%es' segment"
 msgstr ""
 
-#: config/tc-i386.c:1547 config/tc-i386.c:1586 config/tc-i386.c:1613
+#: config/tc-i386.c:1548 config/tc-i386.c:1589 config/tc-i386.c:1616
 msgid "using `%%%s' instead of `%%%s' due to `%c' suffix"
 msgstr ""
 
-#: config/tc-i386.c:1558 config/tc-i386.c:1575 config/tc-i386.c:1602
+#: config/tc-i386.c:1561 config/tc-i386.c:1578 config/tc-i386.c:1605
 msgid "`%%%s' not allowed with `%s%c'"
 msgstr ""
 
-#: config/tc-i386.c:1642 config/tc-i386.c:1662
+#: config/tc-i386.c:1645 config/tc-i386.c:1665
 msgid "no instruction mnemonic suffix given; can't determine immediate size"
 msgstr ""
 
-#: config/tc-i386.c:1687
+#: config/tc-i386.c:1690
 msgid ""
 "no instruction mnemonic suffix given and no register operands; can't size "
 "instruction"
 msgstr ""
 
 #. reversed arguments on faddp, fsubp, etc.
-#: config/tc-i386.c:1800
+#: config/tc-i386.c:1803
 msgid "translating to `%s %%%s,%%%s'"
 msgstr ""
 
 #. extraneous `l' suffix on fp insn
-#: config/tc-i386.c:1807
+#: config/tc-i386.c:1810
 msgid "translating to `%s %%%s'"
 msgstr ""
 
-#: config/tc-i386.c:2033
+#: config/tc-i386.c:2022
 msgid "you can't `pop %%cs'"
 msgstr ""
 
 #. UnixWare fsub no args is alias for fsubp, fadd -> faddp, etc
-#: config/tc-i386.c:2064
+#: config/tc-i386.c:2053
 #, c-format
 msgid "translating to `%sp'"
 msgstr ""
 
-#: config/tc-i386.c:2095 config/tc-i386.c:2198 config/tc-i386.c:2258
+#: config/tc-i386.c:2084 config/tc-i386.c:2187 config/tc-i386.c:2247
 msgid "skipping prefixes on this instruction"
 msgstr ""
 
-#: config/tc-i386.c:2115 config/tc-i386.c:2222 config/tc-i386.c:2271
+#: config/tc-i386.c:2104 config/tc-i386.c:2211 config/tc-i386.c:2260
 msgid "16-bit jump out of range"
 msgstr ""
 
-#: config/tc-i386.c:2217
+#: config/tc-i386.c:2206
 #, c-format
 msgid "`%s' only takes byte displacement; %ld shortened to %d"
 msgstr ""
 
-#: config/tc-i386.c:2280
+#: config/tc-i386.c:2269
 #, c-format
 msgid "can't handle non absolute segment in `%s'"
 msgstr ""
 
-#: config/tc-i386.c:2537
+#: config/tc-i386.c:2527
 msgid "Only 1 or 2 immediate operands are allowed"
 msgstr ""
 
-#: config/tc-i386.c:2568 config/tc-i386.c:2797
+#: config/tc-i386.c:2558 config/tc-i386.c:2788
 msgid "GOT relocations not supported in 16 bit mode"
 msgstr ""
 
-#: config/tc-i386.c:2589 config/tc-i386.c:2818
+#: config/tc-i386.c:2579 config/tc-i386.c:2809
 msgid "Bad reloc specifier in expression"
 msgstr ""
 
-#: config/tc-i386.c:2606 config/tc-i386.c:2851
+#: config/tc-i386.c:2597 config/tc-i386.c:2843
 #, c-format
 msgid "Ignoring junk `%s' after expression"
 msgstr ""
 
 #. missing or bad expr becomes absolute 0
-#: config/tc-i386.c:2613
+#: config/tc-i386.c:2604
 #, c-format
 msgid "Missing or invalid immediate expression `%s' taken as 0"
 msgstr ""
 
-#: config/tc-i386.c:2648 config/tc-i386.c:2870
+#: config/tc-i386.c:2639 config/tc-i386.c:2862
 #, c-format
 msgid "Unimplemented segment type %d in operand"
 msgstr ""
 
-#: config/tc-i386.c:2691
+#: config/tc-i386.c:2682
 #, c-format
 msgid "expecting scale factor of 1, 2, 4, or 8: got `%s'"
 msgstr ""
 
-#: config/tc-i386.c:2697
+#: config/tc-i386.c:2688
 #, c-format
 msgid "scale factor of %d without an index register"
 msgstr ""
 
-#: config/tc-i386.c:3045 config/tc-i386.c:3051 config/tc-i386.c:3060
+#: config/tc-i386.c:3037 config/tc-i386.c:3043 config/tc-i386.c:3052
 #, c-format
 msgid "bad segment name `%s'"
 msgstr ""
 
-#: config/tc-i386.c:3226 config/tc-i386.c:3481
+#: config/tc-i386.c:3218 config/tc-i386.c:3473
 #, c-format
 msgid "too many memory references for `%s'"
 msgstr ""
 
-#: config/tc-i386.c:3337 config/tc-i386.c:3350 config/tc-i386.c:3662
-#: config/tc-i386.c:3675
+#: config/tc-i386.c:3329 config/tc-i386.c:3342 config/tc-i386.c:3654
+#: config/tc-i386.c:3667
 #, c-format
 msgid "`%s' is not a valid %s bit base/index expression"
 msgstr ""
 
-#: config/tc-i386.c:3434
+#: config/tc-i386.c:3426
 #, c-format
 msgid "bad memory operand `%s'"
 msgstr ""
 
-#: config/tc-i386.c:3449
+#: config/tc-i386.c:3441
 #, c-format
 msgid "Junk `%s' after register"
 msgstr ""
 
-#: config/tc-i386.c:3590
+#: config/tc-i386.c:3582
 #, c-format
 msgid "expecting `,' or `)' after index register in `%s'"
 msgstr ""
 
-#: config/tc-i386.c:3607
+#: config/tc-i386.c:3599
 #, c-format
 msgid "expecting `)' after scale factor in `%s'"
 msgstr ""
 
-#: config/tc-i386.c:3614
+#: config/tc-i386.c:3606
 #, c-format
 msgid "expecting index register or scale factor after `,'; got '%c'"
 msgstr ""
 
-#: config/tc-i386.c:3621
+#: config/tc-i386.c:3613
 #, c-format
 msgid "expecting `,' or `)' after base register in `%s'"
 msgstr ""
 
 #. it's not a memory operand; argh!
-#: config/tc-i386.c:3684
+#: config/tc-i386.c:3676
 #, c-format
 msgid "invalid char %s beginning operand %d `%s'"
 msgstr ""
 
-#: config/tc-i386.c:4087
+#: config/tc-i386.c:4095
 msgid "Bad call to md_atof ()"
 msgstr ""
 
-#: config/tc-i386.c:4148 config/tc-i386.c:4161
+#: config/tc-i386.c:4156 config/tc-i386.c:4169
 #, c-format
 msgid "bad register name `%s'"
 msgstr ""
 
-#: config/tc-i386.c:4215
+#: config/tc-i386.c:4223
 msgid "-m\t\t\tdo long jump\n"
 msgstr ""
 
-#: config/tc-i386.c:4255
+#: config/tc-i386.c:4263
 msgid "GOT already in symbol table"
 msgstr ""
 
-#: config/tc-i386.c:4395 config/tc-mcore.c:2017 config/tc-sh.c:2415
+#: config/tc-i386.c:4409 config/tc-mcore.c:2130 config/tc-sh.c:2421
 #, c-format
 msgid "Cannot represent relocation type %s"
 msgstr ""
@@ -2872,7 +2863,7 @@
 msgid "Unknown temporary pseudo register"
 msgstr ""
 
-#: config/tc-i860.c:183 config/tc-mips.c:1099 config/tc-sparc.c:696
+#: config/tc-i860.c:183 config/tc-mips.c:1013 config/tc-sparc.c:696
 #, c-format
 msgid "internal error: can't hash `%s': %s\n"
 msgstr ""
@@ -2961,45 +2952,45 @@
 msgid "i860_estimate_size_before_relax\n"
 msgstr ""
 
-#: config/tc-i960.c:544
+#: config/tc-i960.c:559
 #, c-format
 msgid "Hashing returned \"%s\"."
 msgstr ""
 
 #. Offset of last character in opcode mnemonic
-#: config/tc-i960.c:578
+#: config/tc-i960.c:593
 msgid "branch prediction invalid on this opcode"
 msgstr ""
 
-#: config/tc-i960.c:621
+#: config/tc-i960.c:636
 #, c-format
 msgid "invalid opcode, \"%s\"."
 msgstr ""
 
-#: config/tc-i960.c:626
+#: config/tc-i960.c:641
 #, c-format
 msgid "improper number of operands.  expecting %d, got %d"
 msgstr ""
 
-#: config/tc-i960.c:771 config/tc-m32r.c:1873
+#: config/tc-i960.c:786 config/tc-m32r.c:1239
 msgid "Bad call to md_atof()"
 msgstr ""
 
-#: config/tc-i960.c:861
+#: config/tc-i960.c:876
 #, c-format
 msgid "Fixup of %ld too large for field width of %d"
 msgstr ""
 
-#: config/tc-i960.c:979
+#: config/tc-i960.c:994
 #, c-format
 msgid "invalid architecture %s"
 msgstr ""
 
-#: config/tc-i960.c:999
+#: config/tc-i960.c:1014
 msgid "I960 options:\n"
 msgstr ""
 
-#: config/tc-i960.c:1002
+#: config/tc-i960.c:1017
 msgid ""
 "\n"
 "\t\t\tspecify variant of 960 architecture\n"
@@ -3010,591 +3001,534 @@
 "\t\t\tlong displacements\n"
 msgstr ""
 
-#: config/tc-i960.c:1400
+#: config/tc-i960.c:1425
 msgid "too many operands"
 msgstr ""
 
-#: config/tc-i960.c:1460 config/tc-i960.c:1690
+#: config/tc-i960.c:1485 config/tc-i960.c:1715
 msgid "expression syntax error"
 msgstr ""
 
-#: config/tc-i960.c:1498
+#: config/tc-i960.c:1523
 msgid "attempt to branch into different segment"
 msgstr ""
 
-#: config/tc-i960.c:1502
+#: config/tc-i960.c:1527
 #, c-format
 msgid "target of %s instruction must be a label"
 msgstr ""
 
-#: config/tc-i960.c:1542
+#: config/tc-i960.c:1567
 msgid "unmatched '['"
 msgstr ""
 
-#: config/tc-i960.c:1553
+#: config/tc-i960.c:1578
 msgid "garbage after index spec ignored"
 msgstr ""
 
 #. We never moved: there was no opcode either!
-#: config/tc-i960.c:1620
+#: config/tc-i960.c:1645
 msgid "missing opcode"
 msgstr ""
 
-#: config/tc-i960.c:1928
+#: config/tc-i960.c:1953
 msgid "invalid constant"
 msgstr ""
 
-#: config/tc-i960.c:2041
+#: config/tc-i960.c:2066
 msgid "invalid index register"
 msgstr ""
 
-#: config/tc-i960.c:2064
+#: config/tc-i960.c:2089
 msgid "invalid scale factor"
 msgstr ""
 
-#: config/tc-i960.c:2247
+#: config/tc-i960.c:2272
 msgid "unaligned register"
 msgstr ""
 
-#: config/tc-i960.c:2270
+#: config/tc-i960.c:2295
 msgid "no such sfr in this architecture"
 msgstr ""
 
-#: config/tc-i960.c:2308
+#: config/tc-i960.c:2333
 msgid "illegal literal"
 msgstr ""
 
 #. Should not happen: see block comment above
-#: config/tc-i960.c:2541
+#: config/tc-i960.c:2566
 #, c-format
 msgid "Trying to 'bal' to %s"
 msgstr ""
 
-#: config/tc-i960.c:2552
+#: config/tc-i960.c:2577
 msgid "Looks like a proc, but can't tell what kind.\n"
 msgstr ""
 
-#: config/tc-i960.c:2584
+#: config/tc-i960.c:2609
 msgid "should have 1 or 2 operands"
 msgstr ""
 
-#: config/tc-i960.c:2593 config/tc-i960.c:2612
+#: config/tc-i960.c:2618 config/tc-i960.c:2637
 #, c-format
 msgid "Redefining leafproc %s"
 msgstr ""
 
-#: config/tc-i960.c:2642
+#: config/tc-i960.c:2667
 msgid "should have two operands"
 msgstr ""
 
-#: config/tc-i960.c:2652
+#: config/tc-i960.c:2677
 msgid "'entry_num' must be absolute number in [0,31]"
 msgstr ""
 
-#: config/tc-i960.c:2661
+#: config/tc-i960.c:2686
 #, c-format
 msgid "Redefining entrynum for sysproc %s"
 msgstr ""
 
-#: config/tc-i960.c:2772
+#: config/tc-i960.c:2797
 msgid "architecture of opcode conflicts with that of earlier instruction(s)"
 msgstr ""
 
-#: config/tc-i960.c:2793
+#: config/tc-i960.c:2818
 msgid "big endian mode is not supported"
 msgstr ""
 
-#: config/tc-i960.c:2795
+#: config/tc-i960.c:2820
 #, c-format
 msgid "ignoring unrecognized .endian type `%s'"
 msgstr ""
 
-#: config/tc-i960.c:3052
+#: config/tc-i960.c:3123
 #, c-format
 msgid "leafproc symbol '%s' undefined"
 msgstr ""
 
-#: config/tc-i960.c:3062
+#: config/tc-i960.c:3133
 #, c-format
 msgid "Warning: making leafproc entries %s and %s both global\n"
 msgstr ""
 
-#: config/tc-i960.c:3169
+#: config/tc-i960.c:3242
 msgid "option --link-relax is only supported in b.out format"
 msgstr ""
 
-#: config/tc-i960.c:3212
+#: config/tc-i960.c:3285
 msgid "callj to difference of two symbols"
 msgstr ""
 
-#. Pretend that we do not recognise this option.
-#: config/tc-m32r.c:232
-#, c-format
-msgid "%s: unrecognised option: -hidden\n"
-msgstr ""
-
-#: config/tc-m32r.c:265
+#: config/tc-m32r.c:191
 msgid " M32R specific command line options:\n"
 msgstr ""
 
-#: config/tc-m32r.c:287
+#: config/tc-m32r.c:194
 msgid ""
 "  -warn-unmatched-high    warn when an (s)high reloc has no matching low "
 "reloc\n"
 msgstr ""
 
-#: config/tc-m32r.c:289
+#: config/tc-m32r.c:196
 msgid "  -no-warn-unmatched-high do not warn about missing low relocs\n"
 msgstr ""
 
-#: config/tc-m32r.c:291
+#: config/tc-m32r.c:198
 msgid "  -Wuh                    synonym for -warn-unmatched-high\n"
 msgstr ""
 
-#: config/tc-m32r.c:293
+#: config/tc-m32r.c:200
 msgid "  -Wnuh                   synonym for -no-warn-unmatched-high\n"
 msgstr ""
 
-#: config/tc-m32r.c:297
+#: config/tc-m32r.c:204
 msgid "  -relax                 create linker relaxable code\n"
 msgstr ""
 
-#: config/tc-m32r.c:299
+#: config/tc-m32r.c:206
 msgid "  -cpu-desc              provide runtime cpu description file\n"
 msgstr ""
 
-#: config/tc-m32r.c:429 read.c:2734 read.c:4799
+#: config/tc-m32r.c:331 read.c:2755 read.c:4824
 #, c-format
 msgid "symbol `%s' already defined"
 msgstr ""
 
-#: config/tc-m32r.c:700
-msgid "Instructions write to the same destination register."
-msgstr ""
-
-#: config/tc-m32r.c:708
-msgid "Instructions do not use parallel execution pipelines."
-msgstr ""
-
-#: config/tc-m32r.c:715
-msgid "Instructions share the same execution pipeline"
-msgstr ""
-
-#: config/tc-m32r.c:784 config/tc-m32r.c:870
-#, c-format
-msgid "not a 16 bit instruction '%s'"
-msgstr ""
-
-#: config/tc-m32r.c:791 config/tc-m32r.c:877 config/tc-m32r.c:1038
-#, c-format
-msgid "unknown instruction '%s'"
-msgstr ""
-
-#: config/tc-m32r.c:799 config/tc-m32r.c:884 config/tc-m32r.c:1045
-#, c-format
-msgid "instruction '%s' is for the M32RX only"
-msgstr ""
-
-#: config/tc-m32r.c:807 config/tc-m32r.c:892
-#, c-format
-msgid "instruction '%s' cannot be executed in parallel."
-msgstr ""
-
-#: config/tc-m32r.c:854 config/tc-m32r.c:917 config/tc-m32r.c:1098
-msgid "internal error: lookup/get operands failed"
-msgstr ""
-
-#: config/tc-m32r.c:902
-#, c-format
-msgid "'%s': only the NOP instruction can be issued in parallel on the m32r"
-msgstr ""
-
-#: config/tc-m32r.c:931
-#, c-format
-msgid ""
-"%s: output of 1st instruction is the same as an input to 2nd instruction - "
-"is this intentional ?"
-msgstr ""
-
-#: config/tc-m32r.c:935
-#, c-format
-msgid ""
-"%s: output of 2nd instruction is the same as an input to 1st instruction - "
-"is this intentional ?"
-msgstr ""
-
-#: config/tc-m32r.c:1264 config/tc-ppc.c:1330 config/tc-ppc.c:3534 read.c:1349
+#: config/tc-m32r.c:630 config/tc-ppc.c:1336 config/tc-ppc.c:3540 read.c:1368
 msgid "Expected comma after symbol-name: rest of line ignored."
 msgstr ""
 
-#: config/tc-m32r.c:1273
+#: config/tc-m32r.c:639
 #, c-format
 msgid ".SCOMMon length (%ld.) <0! Ignored."
 msgstr ""
 
-#: config/tc-m32r.c:1287 config/tc-ppc.c:1352 config/tc-ppc.c:2261
-#: config/tc-ppc.c:3558
+#: config/tc-m32r.c:653 config/tc-ppc.c:1358 config/tc-ppc.c:2267
+#: config/tc-ppc.c:3564
 msgid "ignoring bad alignment"
 msgstr ""
 
-#: config/tc-m32r.c:1313 config/tc-ppc.c:1363 config/tc-ppc.c:3570 read.c:1369
-#: read.c:2083
+#: config/tc-m32r.c:679 config/tc-ppc.c:1369 config/tc-ppc.c:3576 read.c:1388
+#: read.c:2104
 #, c-format
 msgid "Ignoring attempt to re-define symbol `%s'."
 msgstr ""
 
-#: config/tc-m32r.c:1322
+#: config/tc-m32r.c:688
 #, c-format
 msgid "Length of .scomm \"%s\" is already %ld. Not changed to %ld."
 msgstr ""
 
-#: config/tc-m32r.c:1566
+#: config/tc-m32r.c:932
 msgid "Addend to unresolved symbol not on word boundary."
 msgstr ""
 
-#: config/tc-m32r.c:1795
+#: config/tc-m32r.c:1161
 msgid "Unmatched high/shigh reloc"
 msgstr ""
 
-#: config/tc-m68k.c:636
+#: config/tc-m68k.c:646
 msgid "Unknown PC relative instruction"
 msgstr ""
 
-#: config/tc-m68k.c:764
+#: config/tc-m68k.c:774
 #, c-format
 msgid "Can not do %d byte pc-relative pic relocation"
 msgstr ""
 
-#: config/tc-m68k.c:771
+#: config/tc-m68k.c:781
 #, c-format
 msgid "Can not do %d byte pic relocation"
 msgstr ""
 
-#: config/tc-m68k.c:875 config/tc-mips.c:11891
+#: config/tc-m68k.c:885 config/tc-mips.c:11148
 #, c-format
 msgid "Cannot make %s relocation PC relative"
 msgstr ""
 
-#: config/tc-m68k.c:987 config/tc-tahoe.c:1505 config/tc-vax.c:1773
+#: config/tc-m68k.c:998 config/tc-tahoe.c:1505 config/tc-vax.c:1774
 msgid "No operator"
 msgstr ""
 
-#: config/tc-m68k.c:1017 config/tc-tahoe.c:1522 config/tc-vax.c:1790
+#: config/tc-m68k.c:1028 config/tc-tahoe.c:1522 config/tc-vax.c:1791
 msgid "Unknown operator"
 msgstr ""
 
-#: config/tc-m68k.c:1764
+#: config/tc-m68k.c:1803
 msgid "invalid instruction for this architecture; needs "
 msgstr ""
 
-#: config/tc-m68k.c:1769
+#: config/tc-m68k.c:1808
 msgid "fpu (68040, 68060 or 68881/68882)"
 msgstr ""
 
-#: config/tc-m68k.c:1772
+#: config/tc-m68k.c:1811
 msgid "mmu (68030 or 68851)"
 msgstr ""
 
-#: config/tc-m68k.c:1775
+#: config/tc-m68k.c:1814
 msgid "68020 or higher"
 msgstr ""
 
-#: config/tc-m68k.c:1778
+#: config/tc-m68k.c:1817
 msgid "68000 or higher"
 msgstr ""
 
-#: config/tc-m68k.c:1781
+#: config/tc-m68k.c:1820
 msgid "68010 or higher"
 msgstr ""
 
-#: config/tc-m68k.c:1809
+#: config/tc-m68k.c:1848
 msgid "operands mismatch"
 msgstr ""
 
-#: config/tc-m68k.c:1866 config/tc-m68k.c:1872 config/tc-m68k.c:1878
+#: config/tc-m68k.c:1905 config/tc-m68k.c:1911 config/tc-m68k.c:1917
 msgid "operand out of range"
 msgstr ""
 
-#: config/tc-m68k.c:1935
+#: config/tc-m68k.c:1974
 #, c-format
 msgid "Bignum too big for %c format; truncated"
 msgstr ""
 
-#: config/tc-m68k.c:2003
+#: config/tc-m68k.c:2042
 msgid "displacement too large for this architecture; needs 68020 or higher"
 msgstr ""
 
-#: config/tc-m68k.c:2113
+#: config/tc-m68k.c:2152
 msgid ""
 "scale factor invalid on this architecture; needs cpu32 or 68020 or higher"
 msgstr ""
 
-#: config/tc-m68k.c:2167
+#: config/tc-m68k.c:2157
+msgid "invalid index size for coldfire"
+msgstr ""
+
+#: config/tc-m68k.c:2210
 msgid "Forcing byte displacement"
 msgstr ""
 
-#: config/tc-m68k.c:2169
+#: config/tc-m68k.c:2212
 msgid "byte displacement out of range"
 msgstr ""
 
-#: config/tc-m68k.c:2216 config/tc-m68k.c:2254
+#: config/tc-m68k.c:2259 config/tc-m68k.c:2297
 msgid "invalid operand mode for this architecture; needs 68020 or higher"
 msgstr ""
 
-#: config/tc-m68k.c:2240 config/tc-m68k.c:2274
+#: config/tc-m68k.c:2283 config/tc-m68k.c:2317
 msgid ":b not permitted; defaulting to :w"
 msgstr ""
 
-#: config/tc-m68k.c:2356
+#: config/tc-m68k.c:2399
 msgid "unsupported byte value; use a different suffix"
 msgstr ""
 
-#: config/tc-m68k.c:2370
+#: config/tc-m68k.c:2413
 msgid "unknown/incorrect operand"
 msgstr ""
 
-#: config/tc-m68k.c:2403 config/tc-m68k.c:2411 config/tc-m68k.c:2418
-#: config/tc-m68k.c:2425
+#: config/tc-m68k.c:2446 config/tc-m68k.c:2454 config/tc-m68k.c:2461
+#: config/tc-m68k.c:2468
 msgid "out of range"
 msgstr ""
 
-#: config/tc-m68k.c:2475
+#: config/tc-m68k.c:2518
 msgid "Can't use long branches on 68000/68010/5200"
 msgstr ""
 
-#: config/tc-m68k.c:2563
+#: config/tc-m68k.c:2606
 msgid "Expression out of range, using 0"
 msgstr ""
 
-#: config/tc-m68k.c:2668 config/tc-m68k.c:2684
+#: config/tc-m68k.c:2718 config/tc-m68k.c:2734
 msgid "Floating point register in register list"
 msgstr ""
 
-#: config/tc-m68k.c:2674
+#: config/tc-m68k.c:2724
 msgid "Wrong register in floating-point reglist"
 msgstr ""
 
-#: config/tc-m68k.c:2690
+#: config/tc-m68k.c:2740
 msgid "incorrect register in reglist"
 msgstr ""
 
-#: config/tc-m68k.c:2696
+#: config/tc-m68k.c:2746
 msgid "wrong register in floating-point reglist"
 msgstr ""
 
-#: config/tc-m68k.c:2772
+#: config/tc-m68k.c:2822
 msgid "failed sanity check"
 msgstr ""
 
 #. ERROR
-#: config/tc-m68k.c:3108
+#: config/tc-m68k.c:3187
 msgid "Extra )"
 msgstr ""
 
 #. ERROR
-#: config/tc-m68k.c:3119
+#: config/tc-m68k.c:3198
 msgid "Missing )"
 msgstr ""
 
-#: config/tc-m68k.c:3136
+#: config/tc-m68k.c:3215
 msgid "Missing operand"
 msgstr ""
 
-#: config/tc-m68k.c:3427
+#: config/tc-m68k.c:3547
 #, c-format
 msgid "%s -- statement `%s' ignored"
 msgstr ""
 
-#: config/tc-m68k.c:3471
+#: config/tc-m68k.c:3591
 #, c-format
 msgid "Don't know how to figure width of %c in md_assemble()"
 msgstr ""
 
-#: config/tc-m68k.c:3639 config/tc-m68k.c:3675
+#: config/tc-m68k.c:3759 config/tc-m68k.c:3795
 #, c-format
 msgid "Internal Error: Can't find %s in hash table"
 msgstr ""
 
-#: config/tc-m68k.c:3642 config/tc-m68k.c:3678
+#: config/tc-m68k.c:3762 config/tc-m68k.c:3798
 #, c-format
 msgid "Internal Error: Can't hash %s: %s"
 msgstr ""
 
-#: config/tc-m68k.c:3804
+#: config/tc-m68k.c:3926
 #, c-format
 msgid "unrecognized default cpu `%s' ???"
 msgstr ""
 
-#: config/tc-m68k.c:3816
+#: config/tc-m68k.c:3938
 msgid "68040 and 68851 specified; mmu instructions may assemble incorrectly"
 msgstr ""
 
-#: config/tc-m68k.c:3836
+#: config/tc-m68k.c:3958
 msgid "options for 68881 and no-68881 both given"
 msgstr ""
 
-#: config/tc-m68k.c:3838
+#: config/tc-m68k.c:3960
 msgid "options for 68851 and no-68851 both given"
 msgstr ""
 
-#: config/tc-m68k.c:3909
+#: config/tc-m68k.c:4031
 #, c-format
 msgid "text label `%s' aligned to odd boundary"
 msgstr ""
 
-#: config/tc-m68k.c:4126
+#: config/tc-m68k.c:4248
 msgid "invalid byte branch offset"
 msgstr ""
 
-#: config/tc-m68k.c:4183
+#: config/tc-m68k.c:4305
 msgid "short branch with zero offset: use :w"
 msgstr ""
 
-#: config/tc-m68k.c:4229
+#: config/tc-m68k.c:4351
 msgid "Long branch offset not supported."
 msgstr ""
 
-#: config/tc-m68k.c:4290
+#: config/tc-m68k.c:4412
 #, c-format
 msgid "Internal error (long PC-relative operand) for insn 0x%04x at 0x%lx"
 msgstr ""
 
-#: config/tc-m68k.c:4321
+#: config/tc-m68k.c:4443
 msgid "displacement doesn't fit in one byte"
 msgstr ""
 
-#: config/tc-m68k.c:4434
+#: config/tc-m68k.c:4556
 msgid "Long branch offset to extern symbol not supported."
 msgstr ""
 
-#: config/tc-m68k.c:4783 config/tc-m68k.c:4794
+#: config/tc-m68k.c:4905 config/tc-m68k.c:4916
 msgid "expression out of range: defaulting to 1"
 msgstr ""
 
-#: config/tc-m68k.c:4826
+#: config/tc-m68k.c:4948
 msgid "expression out of range: defaulting to 0"
 msgstr ""
 
-#: config/tc-m68k.c:4859 config/tc-m68k.c:4871
+#: config/tc-m68k.c:4981 config/tc-m68k.c:4993
 #, c-format
 msgid "Can't deal with expression; defaulting to %ld"
 msgstr ""
 
-#: config/tc-m68k.c:4885
+#: config/tc-m68k.c:5007
 msgid "expression doesn't fit in BYTE"
 msgstr ""
 
-#: config/tc-m68k.c:4889
+#: config/tc-m68k.c:5011
 msgid "expression doesn't fit in WORD"
 msgstr ""
 
-#: config/tc-m68k.c:4982
+#: config/tc-m68k.c:5104
 #, c-format
 msgid "%s: unrecognized processor name"
 msgstr ""
 
-#: config/tc-m68k.c:5047
+#: config/tc-m68k.c:5169
 msgid "bad coprocessor id"
 msgstr ""
 
-#: config/tc-m68k.c:5053
+#: config/tc-m68k.c:5175
 msgid "unrecognized fopt option"
 msgstr ""
 
-#: config/tc-m68k.c:5187
+#: config/tc-m68k.c:5309
 #, c-format
 msgid "option `%s' may not be negated"
 msgstr ""
 
-#: config/tc-m68k.c:5198
+#: config/tc-m68k.c:5320
 #, c-format
 msgid "option `%s' not recognized"
 msgstr ""
 
-#: config/tc-m68k.c:5231
+#: config/tc-m68k.c:5353
 msgid "bad format of OPT NEST=depth"
 msgstr ""
 
-#: config/tc-m68k.c:5294
+#: config/tc-m68k.c:5416
 msgid "missing label"
 msgstr ""
 
-#: config/tc-m68k.c:5318 config/tc-m68k.c:5347
+#: config/tc-m68k.c:5440 config/tc-m68k.c:5469
 msgid "bad register list"
 msgstr ""
 
-#: config/tc-m68k.c:5320
+#: config/tc-m68k.c:5442
 #, c-format
 msgid "bad register list: %s"
 msgstr ""
 
-#: config/tc-m68k.c:5418
+#: config/tc-m68k.c:5540
 msgid "restore without save"
 msgstr ""
 
-#: config/tc-m68k.c:5595 config/tc-m68k.c:5944
+#: config/tc-m68k.c:5717 config/tc-m68k.c:6066
 msgid "syntax error in structured control directive"
 msgstr ""
 
-#: config/tc-m68k.c:5646
+#: config/tc-m68k.c:5768
 msgid "missing condition code in structured control directive"
 msgstr ""
 
-#: config/tc-m68k.c:5978
+#: config/tc-m68k.c:6100
 msgid "missing then"
 msgstr ""
 
-#: config/tc-m68k.c:6060
+#: config/tc-m68k.c:6182
 msgid "else without matching if"
 msgstr ""
 
-#: config/tc-m68k.c:6094
+#: config/tc-m68k.c:6216
 msgid "endi without matching if"
 msgstr ""
 
-#: config/tc-m68k.c:6135
+#: config/tc-m68k.c:6257
 msgid "break outside of structured loop"
 msgstr ""
 
-#: config/tc-m68k.c:6174
+#: config/tc-m68k.c:6296
 msgid "next outside of structured loop"
 msgstr ""
 
-#: config/tc-m68k.c:6226
+#: config/tc-m68k.c:6348
 msgid "missing ="
 msgstr ""
 
-#: config/tc-m68k.c:6264
+#: config/tc-m68k.c:6386
 msgid "missing to or downto"
 msgstr ""
 
-#: config/tc-m68k.c:6300 config/tc-m68k.c:6334 config/tc-m68k.c:6544
+#: config/tc-m68k.c:6422 config/tc-m68k.c:6456 config/tc-m68k.c:6666
 msgid "missing do"
 msgstr ""
 
-#: config/tc-m68k.c:6437
+#: config/tc-m68k.c:6559
 msgid "endf without for"
 msgstr ""
 
-#: config/tc-m68k.c:6493
+#: config/tc-m68k.c:6615
 msgid "until without repeat"
 msgstr ""
 
-#: config/tc-m68k.c:6580
+#: config/tc-m68k.c:6702
 msgid "endw without while"
 msgstr ""
 
-#: config/tc-m68k.c:6696
+#: config/tc-m68k.c:6818
 #, c-format
 msgid "unrecognized option `%s'"
 msgstr ""
 
-#: config/tc-m68k.c:6741
+#: config/tc-m68k.c:6863
 #, c-format
 msgid "unrecognized architecture specification `%s'"
 msgstr ""
 
-#: config/tc-m68k.c:6811
+#: config/tc-m68k.c:6933
 msgid ""
 "680X0 options:\n"
 "-l\t\t\tuse 1 word for refs to undefined symbols [default 2]\n"
@@ -3607,7 +3541,7 @@
 "\t\t\t[default yes for 68020, 68030, and cpu32]\n"
 msgstr ""
 
-#: config/tc-m68k.c:6821
+#: config/tc-m68k.c:6943
 msgid ""
 "-m68851 | -mno-68851\n"
 "\t\t\ttarget has/lacks memory-management unit coprocessor\n"
@@ -3619,7 +3553,7 @@
 "--bitwise-or\t\tdo not treat `|' as a comment character\n"
 msgstr ""
 
-#: config/tc-m68k.c:6830
+#: config/tc-m68k.c:6952
 msgid ""
 "--base-size-default-16\tbase reg without size is 16 bits\n"
 "--base-size-default-32\tbase reg without size is 32 bits (default)\n"
@@ -3627,12 +3561,12 @@
 "--disp-size-default-32\tdisplacement with unknown size is 32 bits (default)\n"
 msgstr ""
 
-#: config/tc-m68k.c:6865
+#: config/tc-m68k.c:6987
 #, c-format
 msgid "Error %s in %s\n"
 msgstr ""
 
-#: config/tc-m68k.c:6869
+#: config/tc-m68k.c:6991
 #, c-format
 msgid "Opcode(%d.%s): "
 msgstr ""
@@ -3693,7 +3627,7 @@
 msgid "Relaxation should never occur"
 msgstr ""
 
-#: config/tc-m88k.c:1267 config/tc-sparc.c:3024 read.c:1940
+#: config/tc-m88k.c:1267 config/tc-sparc.c:3025 read.c:1961
 #, c-format
 msgid "BSS length (%d.) <0! Ignored."
 msgstr ""
@@ -3703,151 +3637,3530 @@
 msgid "Ignoring attempt to re-define symbol %s."
 msgstr ""
 
-#: config/tc-mcore.c:273
+#: config/tc-mcore.c:402
 #, c-format
 msgid "register expected, but saw '%.6s'"
 msgstr ""
 
-#: config/tc-mcore.c:357
+#: config/tc-mcore.c:486
 #, c-format
 msgid "control register expected, but saw '%.6s'"
 msgstr ""
 
-#: config/tc-mcore.c:513
+#: config/tc-mcore.c:645
 msgid "more than 65K literal pools"
 msgstr ""
 
-#: config/tc-mcore.c:567
+#: config/tc-mcore.c:699
 msgid "missing ']'"
 msgstr ""
 
-#: config/tc-mcore.c:607
+#: config/tc-mcore.c:739
 msgid "operand must be a constant"
 msgstr ""
 
-#: config/tc-mcore.c:609
+#: config/tc-mcore.c:741
 #, c-format
 msgid "operand must be absolute in range %d..%d, not %d"
 msgstr ""
 
-#: config/tc-mcore.c:646
+#: config/tc-mcore.c:779
 msgid "operand must be a multiple of 4"
 msgstr ""
 
-#: config/tc-mcore.c:653
+#: config/tc-mcore.c:786
 msgid "operand must be a multiple of 2"
 msgstr ""
 
-#: config/tc-mcore.c:667 config/tc-mcore.c:1177 config/tc-mcore.c:1231
+#: config/tc-mcore.c:800 config/tc-mcore.c:1301 config/tc-mcore.c:1355
 msgid "base register expected"
 msgstr ""
 
-#: config/tc-mcore.c:716
+#: config/tc-mcore.c:849
 #, c-format
 msgid "unknown opcode \"%s\""
 msgstr ""
 
-#: config/tc-mcore.c:759
+#: config/tc-mcore.c:892
 msgid "invalid register: r15 illegal"
 msgstr ""
 
-#: config/tc-mcore.c:808
-msgid "M340 specific opcode used when assembling for M210"
-msgstr ""
-
-#: config/tc-mcore.c:827 config/tc-mcore.c:866 config/tc-mcore.c:885
-#: config/tc-mcore.c:904 config/tc-mcore.c:931 config/tc-mcore.c:960
-#: config/tc-mcore.c:997 config/tc-mcore.c:1032 config/tc-mcore.c:1051
-#: config/tc-mcore.c:1070 config/tc-mcore.c:1102 config/tc-mcore.c:1124
-#: config/tc-mcore.c:1180 config/tc-mcore.c:1234 config/tc-mcore.c:1269
-#: config/tc-mcore.c:1323 config/tc-mcore.c:1345 config/tc-mcore.c:1368
+#: config/tc-mcore.c:951 config/tc-mcore.c:990 config/tc-mcore.c:1009
+#: config/tc-mcore.c:1028 config/tc-mcore.c:1055 config/tc-mcore.c:1084
+#: config/tc-mcore.c:1121 config/tc-mcore.c:1156 config/tc-mcore.c:1175
+#: config/tc-mcore.c:1194 config/tc-mcore.c:1226 config/tc-mcore.c:1248
+#: config/tc-mcore.c:1304 config/tc-mcore.c:1358 config/tc-mcore.c:1393
+#: config/tc-mcore.c:1447 config/tc-mcore.c:1469 config/tc-mcore.c:1492
 msgid "second operand missing"
 msgstr ""
 
-#: config/tc-mcore.c:842
+#: config/tc-mcore.c:966
 msgid "destination register must be r1"
 msgstr ""
 
-#: config/tc-mcore.c:863
+#: config/tc-mcore.c:987
 msgid "source register must be r1"
 msgstr ""
 
-#: config/tc-mcore.c:926 config/tc-mcore.c:983
+#: config/tc-mcore.c:1050 config/tc-mcore.c:1107
 msgid "immediate is not a power of two"
 msgstr ""
 
-#: config/tc-mcore.c:954
+#: config/tc-mcore.c:1078
 msgid "translating bgeni to movi"
 msgstr ""
 
-#: config/tc-mcore.c:991
+#: config/tc-mcore.c:1115
 msgid "translating mgeni to movi"
 msgstr ""
 
-#: config/tc-mcore.c:1023
+#: config/tc-mcore.c:1147
 msgid "translating bmaski to movi"
 msgstr ""
 
-#: config/tc-mcore.c:1097
+#: config/tc-mcore.c:1221
 #, c-format
 msgid "displacement too large (%d)"
 msgstr ""
 
-#: config/tc-mcore.c:1111
+#: config/tc-mcore.c:1235
 msgid "Invalid register: r0 and r15 illegal"
 msgstr ""
 
-#: config/tc-mcore.c:1138
+#: config/tc-mcore.c:1262
 msgid "bad starting register: r0 and r15 invalid"
 msgstr ""
 
-#: config/tc-mcore.c:1151
+#: config/tc-mcore.c:1275
 msgid "ending register must be r15"
 msgstr ""
 
-#: config/tc-mcore.c:1171
+#: config/tc-mcore.c:1295
 msgid "bad base register: must be r0"
 msgstr ""
 
-#: config/tc-mcore.c:1189
+#: config/tc-mcore.c:1313
 msgid "first register must be r4"
 msgstr ""
 
-#: config/tc-mcore.c:1200
+#: config/tc-mcore.c:1324
 msgid "last register must be r7"
 msgstr ""
 
-#: config/tc-mcore.c:1237
+#: config/tc-mcore.c:1361
 msgid "reg-reg expected"
 msgstr ""
 
-#: config/tc-mcore.c:1342
+#: config/tc-mcore.c:1466
 msgid "second operand must be 1"
 msgstr ""
 
-#: config/tc-mcore.c:1363
+#: config/tc-mcore.c:1487
 msgid "zero used as immediate value"
 msgstr ""
 
-#: config/tc-mcore.c:1374
+#: config/tc-mcore.c:1498
 #, c-format
 msgid "unimplemented opcode \"%s\""
 msgstr ""
 
-#: config/tc-mcore.c:1444 config/tc-w65.c:856
+#: config/tc-mcore.c:1568 config/tc-w65.c:856
 msgid "Bad call to MD_NTOF()"
 msgstr ""
 
-#: config/tc-mcore.c:1513
-#, c-format
-msgid "unrecognised cpu type '%s'"
-msgstr ""
-
-#: config/tc-mcore.c:1535
+#: config/tc-mcore.c:1631
 msgid ""
 "MCORE specific options:\n"
-"  -{no-}jsri2bsr\t  disable/enable jsri to bsr transformation (def: on)\n"
-"  -{no-}sifilter\t  disable/enable silicon filter behavior (def: off)\n"
-"  -relax\t\t  alter jump instructions for long displacements\n"
+"  -{no-}jsri2bsr\t  {dis}able jsri to bsr transformation (def: dis)\n"
+"  -{no-}sifilter\t  {dis}able silicon filter behavior (def: dis)"
 msgstr ""
 
+#: config/tc-mcore.c:1647
+msgid "failed sanity check: short_jump"
+msgstr ""
+
+#: config/tc-mcore.c:1658
+msgid "failed sanity check: long_jump"
+msgstr ""
+
+#: config/tc-mcore.c:1685
+#, c-format
+msgid "odd displacement at %x"
+msgstr ""
+
+#: config/tc-mcore.c:1839
+msgid "unknown"
+msgstr ""
+
+#: config/tc-mcore.c:1844 config/tc-ns32k.c:2281
+msgid "<unknown>"
+msgstr ""
+
+#: config/tc-mcore.c:1870
+#, c-format
+msgid "odd distance branch (0x%x bytes)"
+msgstr ""
+
+#: config/tc-mcore.c:1874
+#, c-format
+msgid "pcrel for branch to %s too far (0x%x)"
+msgstr ""
+
+#: config/tc-mcore.c:1885
+#, c-format
+msgid "pcrel for lrw/jmpi/jsri to %s too far (0x%x)"
+msgstr ""
+
+#: config/tc-mcore.c:1894
+#, c-format
+msgid "pcrel for loopt too far (0x%x)"
+msgstr ""
+
+#: config/tc-mcore.c:2112
+#, c-format
+msgid "Can not do %d byte %srelocation"
+msgstr ""
+
+#: config/tc-mcore.c:2114
+msgid "pc-relative"
+msgstr ""
+
+#: config/tc-mips.c:960
+msgid "trap exception not supported at ISA 1"
+msgstr ""
+
+#: config/tc-mips.c:1000
+msgid "Could not set architecture and machine"
+msgstr ""
+
+#: config/tc-mips.c:1039
+#, c-format
+msgid "internal: can't hash `%s': %s"
+msgstr ""
+
+#: config/tc-mips.c:1047
+#, c-format
+msgid "internal error: bad mips16 opcode: %s %s\n"
+msgstr ""
+
+#: config/tc-mips.c:1216
+#, c-format
+msgid "returned from mips_ip(%s) insn_opcode = 0x%x\n"
+msgstr ""
+
+#: config/tc-mips.c:1739 config/tc-mips.c:11279
+msgid "extended instruction in delay slot"
+msgstr ""
+
+#: config/tc-mips.c:1761 config/tc-mips.c:1768
+#, c-format
+msgid "jump to misaligned address (0x%lx)"
+msgstr ""
+
+#: config/tc-mips.c:2419 config/tc-mips.c:2782
+msgid "Macro instruction expanded into multiple instructions"
+msgstr ""
+
+#: config/tc-mips.c:2835
+msgid "unsupported large constant"
+msgstr ""
+
+#: config/tc-mips.c:2837
+#, c-format
+msgid "Instruction %s requires absolute expression"
+msgstr ""
+
+#: config/tc-mips.c:2983
+msgid "Number larger than 32 bits"
+msgstr ""
+
+#: config/tc-mips.c:3004
+msgid "Number larger than 64 bits"
+msgstr ""
+
+#: config/tc-mips.c:3270 config/tc-mips.c:3342 config/tc-mips.c:5021
+#: config/tc-mips.c:5072 config/tc-mips.c:5608 config/tc-mips.c:5671
+msgid "PIC code offset overflow (max 16 signed bits)"
+msgstr ""
+
+#: config/tc-mips.c:3581
+#, c-format
+msgid "Branch %s is always false (nop)"
+msgstr ""
+
+#: config/tc-mips.c:3586
+#, c-format
+msgid "Branch likely %s is always false"
+msgstr ""
+
+#: config/tc-mips.c:3593 config/tc-mips.c:3667 config/tc-mips.c:3770
+#: config/tc-mips.c:3825 config/tc-mips.c:6707 config/tc-mips.c:6716
+#: config/tc-mips.c:6724 config/tc-mips.c:6833
+msgid "Unsupported large constant"
+msgstr ""
+
+#. result is always true
+#: config/tc-mips.c:3629
+#, c-format
+msgid "Branch %s is always true"
+msgstr ""
+
+#: config/tc-mips.c:3901 config/tc-mips.c:4008
+msgid "Divide by zero."
+msgstr ""
+
+#: config/tc-mips.c:4592
+msgid "MIPS PIC call to register other than $25"
+msgstr ""
+
+#: config/tc-mips.c:4597 config/tc-mips.c:4709
+msgid "No .cprestore pseudo-op used in PIC code"
+msgstr ""
+
+#: config/tc-mips.c:4782 config/tc-mips.c:4871 config/tc-mips.c:5359
+#: config/tc-mips.c:5400 config/tc-mips.c:5418 config/tc-mips.c:6046
+#: config/tc-mips.c:7054
+msgid "opcode not supported on this processor"
+msgstr ""
+
+#: config/tc-mips.c:5877 config/tc-mips.c:6601
+msgid "Macro used $at after \".set noat\""
+msgstr ""
+
+#: config/tc-mips.c:6017 config/tc-mips.c:6035
+msgid "rotate count too large"
+msgstr ""
+
+#: config/tc-mips.c:6086
+#, c-format
+msgid "Instruction %s: result is always false"
+msgstr ""
+
+#: config/tc-mips.c:6255
+#, c-format
+msgid "Instruction %s: result is always true"
+msgstr ""
+
+#: config/tc-mips.c:6394 config/tc-mips.c:6421 config/tc-mips.c:6493
+#: config/tc-mips.c:6518
+msgid "operand overflow"
+msgstr ""
+
+#. FIXME: Check if this is one of the itbl macros, since they
+#. are added dynamically.
+#: config/tc-mips.c:6597
+#, c-format
+msgid "Macro %s not implemented yet"
+msgstr ""
+
+#: config/tc-mips.c:6867
+#, c-format
+msgid "internal: bad mips opcode (mask error): %s %s"
+msgstr ""
+
+#: config/tc-mips.c:6919
+#, c-format
+msgid "internal: bad mips opcode (unknown operand type `%c'): %s %s"
+msgstr ""
+
+#: config/tc-mips.c:6926
+#, c-format
+msgid "internal: bad mips opcode (bits 0x%lx undefined): %s %s"
+msgstr ""
+
+#: config/tc-mips.c:7059
+#, c-format
+msgid "opcode requires -mips%d or greater"
+msgstr ""
+
+#: config/tc-mips.c:7127
+#, c-format
+msgid "Improper shift amount (%ld)"
+msgstr ""
+
+#: config/tc-mips.c:7154 config/tc-mips.c:8272 config/tc-mips.c:8387
+#, c-format
+msgid "Invalid value for `%s' (%lu)"
+msgstr ""
+
+#: config/tc-mips.c:7172
+#, c-format
+msgid "Illegal break code (%ld)"
+msgstr ""
+
+#: config/tc-mips.c:7186
+#, c-format
+msgid "Illegal lower break code (%ld)"
+msgstr ""
+
+#: config/tc-mips.c:7199
+#, c-format
+msgid "Illegal syscall code (%ld)"
+msgstr ""
+
+#: config/tc-mips.c:7211
+#, c-format
+msgid "Coproccesor code > 25 bits (%ld)"
+msgstr ""
+
+#: config/tc-mips.c:7225
+#, c-format
+msgid "Invalidate performance regster (%ld)"
+msgstr ""
+
+#: config/tc-mips.c:7261
+#, c-format
+msgid "Invalid register number (%d)"
+msgstr ""
+
+#: config/tc-mips.c:7422
+#, c-format
+msgid "Invalid float register number (%d)"
+msgstr ""
+
+#: config/tc-mips.c:7432
+#, c-format
+msgid "Float register should be even, was %d"
+msgstr ""
+
+#: config/tc-mips.c:7484 config/tc-mips.c:7716 config/tc-mips.c:7755
+msgid "absolute expression required"
+msgstr ""
+
+#: config/tc-mips.c:7545
+#, c-format
+msgid "Bad floating point constant: %s"
+msgstr ""
+
+#: config/tc-mips.c:7662
+msgid "Can't use floating point insn in this section"
+msgstr ""
+
+#: config/tc-mips.c:7718
+msgid "16 bit expression not in range 0..65535"
+msgstr ""
+
+#: config/tc-mips.c:7757
+msgid "16 bit expression not in range -32768..32767"
+msgstr ""
+
+#: config/tc-mips.c:7829
+msgid "lui expression not in range 0..65535"
+msgstr ""
+
+#: config/tc-mips.c:7853
+#, c-format
+msgid "invalid condition code register $fcc%d"
+msgstr ""
+
+#: config/tc-mips.c:7861
+#, c-format
+msgid "bad char = '%c'\n"
+msgstr ""
+
+#: config/tc-mips.c:7874 config/tc-mips.c:8412
+msgid "illegal operands"
+msgstr ""
+
+#: config/tc-mips.c:7941
+msgid "unrecognized opcode"
+msgstr ""
+
+#: config/tc-mips.c:8050
+#, c-format
+msgid "invalid register number (%d)"
+msgstr ""
+
+#: config/tc-mips.c:8131
+msgid "used $at without \".set noat\""
+msgstr ""
+
+#: config/tc-mips.c:8306
+msgid "can't parse register list"
+msgstr ""
+
+#: config/tc-mips.c:8340 config/tc-mips.c:8370
+msgid "invalid register list"
+msgstr ""
+
+#: config/tc-mips.c:8537
+msgid "extended operand requested but not required"
+msgstr ""
+
+#: config/tc-mips.c:8539
+msgid "invalid unextended operand value"
+msgstr ""
+
+#: config/tc-mips.c:8567
+msgid "operand value out of range for instruction"
+msgstr ""
+
+#: config/tc-mips.c:9008
+#, c-format
+msgid "ignoring invalid leading 'v' in -mcpu=%s switch"
+msgstr ""
+
+#: config/tc-mips.c:9014
+#, c-format
+msgid "invalid architecture -mcpu=%s"
+msgstr ""
+
+#: config/tc-mips.c:9064
+msgid "-G may not be used with embedded PIC code"
+msgstr ""
+
+#: config/tc-mips.c:9076
+msgid "-call_shared is supported only for ELF format"
+msgstr ""
+
+#: config/tc-mips.c:9082 config/tc-mips.c:10093 config/tc-mips.c:10261
+msgid "-G may not be used with SVR4 PIC code"
+msgstr ""
+
+#: config/tc-mips.c:9091
+msgid "-non_shared is supported only for ELF format"
+msgstr ""
+
+#: config/tc-mips.c:9107
+msgid "-G is not supported for this configuration"
+msgstr ""
+
+#: config/tc-mips.c:9112
+msgid "-G may not be used with SVR4 or embedded PIC code"
+msgstr ""
+
+#: config/tc-mips.c:9136
+msgid "No compiled in support for 64 bit object file format"
+msgstr ""
+
+#: config/tc-mips.c:9197
+msgid ""
+"MIPS options:\n"
+"-membedded-pic\t\tgenerate embedded position independent code\n"
+"-EB\t\t\tgenerate big endian output\n"
+"-EL\t\t\tgenerate little endian output\n"
+"-g, -g2\t\t\tdo not remove uneeded NOPs or swap branches\n"
+"-G NUM\t\t\tallow referencing objects up to NUM bytes\n"
+"\t\t\timplicitly with the gp register [default 8]\n"
+msgstr ""
+
+#: config/tc-mips.c:9205
+msgid ""
+"-mips1\t\t\tgenerate MIPS ISA I instructions\n"
+"-mips2\t\t\tgenerate MIPS ISA II instructions\n"
+"-mips3\t\t\tgenerate MIPS ISA III instructions\n"
+"-mips4\t\t\tgenerate MIPS ISA IV instructions\n"
+"-mcpu=CPU\t\tgenerate code for CPU, where CPU is one of:\n"
+msgstr ""
+
+#: config/tc-mips.c:9231
+msgid ""
+"-mCPU\t\t\tequivalent to -mcpu=CPU.\n"
+"-no-mCPU\t\tdon't generate code specific to CPU.\n"
+"\t\t\tFor -mCPU and -no-mCPU, CPU must be one of:\n"
+msgstr ""
+
+#: config/tc-mips.c:9244
+msgid ""
+"-mips16\t\t\tgenerate mips16 instructions\n"
+"-no-mips16\t\tdo not generate mips16 instructions\n"
+msgstr ""
+
+#: config/tc-mips.c:9247
+msgid ""
+"-O0\t\t\tremove unneeded NOPs, do not swap branches\n"
+"-O\t\t\tremove unneeded NOPs and swap branches\n"
+"--trap, --no-break\ttrap exception on div by 0 and mult overflow\n"
+"--break, --no-trap\tbreak exception on div by 0 and mult overflow\n"
+msgstr ""
+
+#: config/tc-mips.c:9253
+msgid ""
+"-KPIC, -call_shared\tgenerate SVR4 position independent code\n"
+"-non_shared\t\tdo not generate position independent code\n"
+"-xgot\t\t\tassume a 32 bit GOT\n"
+"-32\t\t\tcreate 32 bit object file (default)\n"
+"-64\t\t\tcreate 64 bit object file\n"
+msgstr ""
+
+#: config/tc-mips.c:9310
+#, c-format
+msgid "Unsupported reloc size %d"
+msgstr ""
+
+#: config/tc-mips.c:9413
+msgid "Unmatched %%hi reloc"
+msgstr ""
+
+#: config/tc-mips.c:9518
+msgid "Invalid PC relative reloc"
+msgstr ""
+
+#: config/tc-mips.c:9617 config/tc-sparc.c:2617 config/tc-sparc.c:2624
+#: config/tc-sparc.c:2631 config/tc-sparc.c:2638 config/tc-sparc.c:2645
+#: config/tc-sparc.c:2654 config/tc-sparc.c:2665 config/tc-sparc.c:2691
+#: config/tc-sparc.c:2714 write.c:972 write.c:1036
+msgid "relocation overflow"
+msgstr ""
+
+#: config/tc-mips.c:9633
+#, c-format
+msgid "Branch to odd address (%lx)"
+msgstr ""
+
+#: config/tc-mips.c:9788
+#, c-format
+msgid "%08lx  UNDEFINED\n"
+msgstr ""
+
+#: config/tc-mips.c:9854
+msgid "Alignment negative: 0 assumed."
+msgstr ""
+
+#: config/tc-mips.c:9942
+msgid "No read only data section in this object file format"
+msgstr ""
+
+#: config/tc-mips.c:9965
+msgid "Global pointers not supported; recompile -G 0"
+msgstr ""
+
+#: config/tc-mips.c:10051
+#, c-format
+msgid "%s: no such section"
+msgstr ""
+
+#: config/tc-mips.c:10088
+#, c-format
+msgid ".option pic%d not supported"
+msgstr ""
+
+#: config/tc-mips.c:10099
+#, c-format
+msgid "Unrecognized option \"%s\""
+msgstr ""
+
+#: config/tc-mips.c:10162
+msgid "`noreorder' must be set before `nomacro'"
+msgstr ""
+
+#: config/tc-mips.c:10197
+msgid "unknown ISA level"
+msgstr ""
+
+#: config/tc-mips.c:10220
+msgid ".set pop with no .set push"
+msgstr ""
+
+#: config/tc-mips.c:10244
+#, c-format
+msgid "Tried to set unrecognized symbol: %s\n"
+msgstr ""
+
+#: config/tc-mips.c:10294
+msgid ".cpload not in noreorder section"
+msgstr ""
+
+#: config/tc-mips.c:10376
+msgid "Unsupported use of .gpword"
+msgstr ""
+
+#: config/tc-mips.c:10513
+msgid "expected `$'"
+msgstr ""
+
+#: config/tc-mips.c:10521
+msgid "Bad register number"
+msgstr ""
+
+#: config/tc-mips.c:10537
+msgid "Unrecognized register name"
+msgstr ""
+
+#: config/tc-mips.c:10734
+msgid "unsupported PC relative reference to different section"
+msgstr ""
+
+#: config/tc-mips.c:10843
+msgid "unsupported relocation"
+msgstr ""
+
+#: config/tc-mips.c:10926
+msgid "AT used after \".set noat\" or macro used after \".set nomacro\""
+msgstr ""
+
+#: config/tc-mips.c:10989
+msgid "Double check fx_r_type in tc-mips.c:tc_gen_reloc"
+msgstr ""
+
+#: config/tc-mips.c:11470
+msgid "missing `.end' at end of assembly"
+msgstr ""
+
+#: config/tc-mips.c:11485
+msgid "Expected simple number."
+msgstr ""
+
+#: config/tc-mips.c:11511
+#, c-format
+msgid " *input_line_pointer == '%c' 0x%02x\n"
+msgstr ""
+
+#: config/tc-mips.c:11513
+msgid "Invalid number"
+msgstr ""
+
+#: config/tc-mips.c:11568
+msgid ".end not in text section"
+msgstr ""
+
+#: config/tc-mips.c:11572
+msgid ".end directive without a preceding .ent directive."
+msgstr ""
+
+#: config/tc-mips.c:11581
+msgid ".end symbol does not match .ent symbol."
+msgstr ""
+
+#: config/tc-mips.c:11584
+msgid ".end directive missing or unknown symbol"
+msgstr ""
+
+#: config/tc-mips.c:11659
+msgid ".ent or .aent not in text section."
+msgstr ""
+
+#: config/tc-mips.c:11662
+msgid "missing `.end'"
+msgstr ""
+
+#: config/tc-mips.c:11695 ecoff.c:3226
+msgid ".frame outside of .ent"
+msgstr ""
+
+#: config/tc-mips.c:11706 ecoff.c:3237
+msgid "Bad .frame directive"
+msgstr ""
+
+#: config/tc-mips.c:11736
+msgid ".mask/.fmask outside of .ent"
+msgstr ""
+
+#: config/tc-mips.c:11743
+msgid "Bad .mask/.fmask directive"
+msgstr ""
+
+#: config/tc-mn10200.c:314
+msgid ""
+"MN10200 options:\n"
+"none yet\n"
+msgstr ""
+
+#: config/tc-mn10200.c:789 config/tc-mn10300.c:750 config/tc-ppc.c:1613
+#: config/tc-v850.c:1691
+#, c-format
+msgid "Unrecognized opcode: `%s'"
+msgstr ""
+
+#: config/tc-mn10300.c:333
+msgid ""
+"MN10300 options:\n"
+"none yet\n"
+msgstr ""
+
+#: config/tc-mn10300.c:768
+msgid "Invalid opcode/operands"
+msgstr ""
+
+#: config/tc-mn10300.c:1099
+msgid "Invalid register specification."
+msgstr ""
+
+#: config/tc-ns32k.c:443
+msgid "Invalid syntax in PC-relative addressing mode"
+msgstr ""
+
+#: config/tc-ns32k.c:467
+msgid "Invalid syntax in External addressing mode"
+msgstr ""
+
+#: config/tc-ns32k.c:536
+msgid "Invalid syntax in Memory Relative addressing mode"
+msgstr ""
+
+#: config/tc-ns32k.c:603
+msgid "Invalid scaled-indexed mode, use (b,w,d,q)"
+msgstr ""
+
+#: config/tc-ns32k.c:608
+msgid "Syntax in scaled-indexed mode, use [Rn:m] where n=[0..7] m={b,w,d,q}"
+msgstr ""
+
+#: config/tc-ns32k.c:614
+msgid "Scaled-indexed addressing mode combined with scaled-index"
+msgstr ""
+
+#: config/tc-ns32k.c:623
+msgid "Invalid or illegal addressing mode combined with scaled-index"
+msgstr ""
+
+#: config/tc-ns32k.c:730
+msgid "Premature end of suffix -- Defaulting to d"
+msgstr ""
+
+#: config/tc-ns32k.c:743
+msgid "Bad suffix after ':' use {b|w|d} Defaulting to d"
+msgstr ""
+
+#: config/tc-ns32k.c:784
+msgid "Very short instr to option, ie you can't do it on a NULLstr"
+msgstr ""
+
+#: config/tc-ns32k.c:828
+msgid "No such entry in list. (cpu/mmu register)"
+msgstr ""
+
+#: config/tc-ns32k.c:869
+msgid "Internal consistency error.  check ns32k-opcode.h"
+msgstr ""
+
+#: config/tc-ns32k.c:890
+msgid "Address of immediate operand"
+msgstr ""
+
+#: config/tc-ns32k.c:891
+msgid "Invalid immediate write operand."
+msgstr ""
+
+#: config/tc-ns32k.c:1018
+msgid "Bad opcode-table-option, check in file ns32k-opcode.h"
+msgstr ""
+
+#: config/tc-ns32k.c:1047
+msgid "No such opcode"
+msgstr ""
+
+#: config/tc-ns32k.c:1115
+msgid "Bad suffix, defaulting to d"
+msgstr ""
+
+#: config/tc-ns32k.c:1137
+msgid "Too many operands passed to instruction"
+msgstr ""
+
+#. check error in default
+#: config/tc-ns32k.c:1148
+msgid "Wrong numbers of operands in default, check ns32k-opcodes.h"
+msgstr ""
+
+#: config/tc-ns32k.c:1153
+msgid "Wrong number of operands"
+msgstr ""
+
+#: config/tc-ns32k.c:1272
+msgid "iif convert internal pcrel/binary"
+msgstr ""
+
+#: config/tc-ns32k.c:1288
+msgid "Bignum too big for long"
+msgstr ""
+
+#: config/tc-ns32k.c:1363
+msgid "iif convert internal pcrel/pointer"
+msgstr ""
+
+#: config/tc-ns32k.c:1368
+msgid "Internal logic error in iif.iifP[n].type"
+msgstr ""
+
+#. We cant relax this case
+#: config/tc-ns32k.c:1402
+msgid "Can't relax difference"
+msgstr ""
+
+#: config/tc-ns32k.c:1451
+msgid "Displacement to large for :d"
+msgstr ""
+
+#: config/tc-ns32k.c:1462
+msgid "Internal logic error in iif.iifP[].type"
+msgstr ""
+
+#: config/tc-ns32k.c:1517
+#, c-format
+msgid "Can not do %d byte pc-relative relocation for storage type %d"
+msgstr ""
+
+#: config/tc-ns32k.c:1520
+#, c-format
+msgid "Can not do %d byte relocation for storage type %d"
+msgstr ""
+
+#: config/tc-ns32k.c:1552
+#, c-format
+msgid "Can't hash %s: %s"
+msgstr ""
+
+#: config/tc-ns32k.c:1636
+msgid "Byte displacement out of range.  line number not valid"
+msgstr ""
+
+#: config/tc-ns32k.c:1645
+msgid "Word displacement out of range.  line number not valid"
+msgstr ""
+
+#: config/tc-ns32k.c:1659
+msgid "Double word displacement out of range"
+msgstr ""
+
+#: config/tc-ns32k.c:1679
+#, c-format
+msgid "Internal logic error.  line %s, file \"%s\""
+msgstr ""
+
+#: config/tc-ns32k.c:1727
+#, c-format
+msgid "Internal logic error. line %s, file \"%s\""
+msgstr ""
+
+#: config/tc-ns32k.c:1838
+msgid "Bit field out of range"
+msgstr ""
+
+#: config/tc-ns32k.c:2087
+#, c-format
+msgid "invalid architecture option -m%s"
+msgstr ""
+
+#: config/tc-ns32k.c:2103
+msgid ""
+"NS32K options:\n"
+"-m32032 | -m32532\tselect variant of NS32K architecture\n"
+msgstr ""
+
+#: config/tc-ns32k.c:2282
+#, c-format
+msgid "Cannot find relocation type for symbol %s, code %d"
+msgstr ""
+
+#: config/tc-ppc.c:834
+#, c-format
+msgid "invalid switch -m%s"
+msgstr ""
+
+#: config/tc-ppc.c:871
+msgid ""
+"PowerPC options:\n"
+"-u\t\t\tignored\n"
+"-mpwrx, -mpwr2\t\tgenerate code for IBM POWER/2 (RIOS2)\n"
+"-mpwr\t\t\tgenerate code for IBM POWER (RIOS1)\n"
+"-m601\t\t\tgenerate code for Motorola PowerPC 601\n"
+"-mppc, -mppc32, -m403, -m603, -m604\n"
+"\t\t\tgenerate code for Motorola PowerPC 603/604\n"
+"-mppc64, -m620\t\tgenerate code for Motorola PowerPC 620\n"
+"-mppc64bridge\t\tgenerate code for PowerPC 64, including bridge insns\n"
+"-mcom\t\t\tgenerate code Power/PowerPC common instructions\n"
+"-many\t\t\tgenerate code for any architecture (PWR/PWRX/PPC)\n"
+"-mregnames\t\tAllow symbolic names for registers\n"
+"-mno-regnames\t\tDo not allow symbolic names for registers\n"
+msgstr ""
+
+#: config/tc-ppc.c:886
+msgid ""
+"-mrelocatable\t\tsupport for GCC's -mrelocatble option\n"
+"-mrelocatable-lib\tsupport for GCC's -mrelocatble-lib option\n"
+"-memb\t\t\tset PPC_EMB bit in ELF flags\n"
+"-mlittle, -mlittle-endian\n"
+"\t\t\tgenerate code for a little endian machine\n"
+"-mbig, -mbig-endian\tgenerate code for a big endian machine\n"
+"-msolaris\t\tgenerate code for Solaris\n"
+"-mno-solaris\t\tdo not generate code for Solaris\n"
+"-V\t\t\tprint assembler version number\n"
+"-Qy, -Qn\t\tignored\n"
+msgstr ""
+
+#: config/tc-ppc.c:921
+#, c-format
+msgid "Unknown default cpu = %s, os = %s"
+msgstr ""
+
+#: config/tc-ppc.c:946
+msgid "Neither Power nor PowerPC opcodes were selected."
+msgstr ""
+
+#: config/tc-ppc.c:994
+#, c-format
+msgid "Internal assembler error for instruction %s"
+msgstr ""
+
+#: config/tc-ppc.c:1013
+#, c-format
+msgid "Internal assembler error for macro %s"
+msgstr ""
+
+#: config/tc-ppc.c:1223
+msgid "identifier+constant@got means identifier@got+constant"
+msgstr ""
+
+#: config/tc-ppc.c:1277
+#, c-format
+msgid "%s relocations do not fit in %d bytes\n"
+msgstr ""
+
+#: config/tc-ppc.c:1377
+#, c-format
+msgid "Length of .lcomm \"%s\" is already %ld. Not changed to %ld."
+msgstr ""
+
+#: config/tc-ppc.c:1459
+msgid "Relocation cannot be done when using -mrelocatable"
+msgstr ""
+
+#: config/tc-ppc.c:1540
+#, c-format
+msgid "syntax error: invalid toc specifier `%s'"
+msgstr ""
+
+#: config/tc-ppc.c:1554
+#, c-format
+msgid "syntax error: expected `]', found  `%c'"
+msgstr ""
+
+#: config/tc-ppc.c:1788
+msgid "[tocv] symbol is not a toc symbol"
+msgstr ""
+
+#: config/tc-ppc.c:1799
+msgid "Unimplemented toc32 expression modifier"
+msgstr ""
+
+#: config/tc-ppc.c:1804
+msgid "Unimplemented toc64 expression modifier"
+msgstr ""
+
+#: config/tc-ppc.c:1808
+#, c-format
+msgid "Unexpected return value [%d] from parse_toc_entry!\n"
+msgstr ""
+
+#: config/tc-ppc.c:1960
+#, c-format
+msgid "syntax error; found `%c' but expected `%c'"
+msgstr ""
+
+#: config/tc-ppc.c:2068
+msgid "wrong number of operands"
+msgstr ""
+
+#: config/tc-ppc.c:2124
+msgid "Bad .section directive: want a,w,x,e in string"
+msgstr ""
+
+#: config/tc-ppc.c:2242
+msgid "missing size"
+msgstr ""
+
+#: config/tc-ppc.c:2251
+msgid "negative size"
+msgstr ""
+
+#: config/tc-ppc.c:2292
+msgid "missing real symbol name"
+msgstr ""
+
+#: config/tc-ppc.c:2313
+msgid "attempt to redefine symbol"
+msgstr ""
+
+#: config/tc-ppc.c:2544
+msgid "The XCOFF file format does not support arbitrary sections"
+msgstr ""
+
+#: config/tc-ppc.c:2652 config/tc-ppc.c:3164 read.c:2950
+msgid "missing value"
+msgstr ""
+
+#: config/tc-ppc.c:2670
+msgid "illegal .stabx expression; zero assumed"
+msgstr ""
+
+#: config/tc-ppc.c:2702
+msgid "missing class"
+msgstr ""
+
+#: config/tc-ppc.c:2711
+msgid "missing type"
+msgstr ""
+
+#: config/tc-ppc.c:2772
+msgid "missing symbol name"
+msgstr ""
+
+#: config/tc-ppc.c:2944
+msgid "nested .bs blocks"
+msgstr ""
+
+#: config/tc-ppc.c:2977
+msgid ".es without preceding .bs"
+msgstr ""
+
+#: config/tc-ppc.c:3156
+msgid "non-constant byte count"
+msgstr ""
+
+#: config/tc-ppc.c:3201
+msgid ".tc not in .toc section"
+msgstr ""
+
+#: config/tc-ppc.c:3220
+msgid ".tc with no label"
+msgstr ""
+
+#: config/tc-ppc.c:3295
+msgid "No previous section to return to. Directive ignored."
+msgstr ""
+
+#. Section Contents
+#. unknown
+#: config/tc-ppc.c:3714
+msgid "Unsupported section attribute -- 'a'"
+msgstr ""
+
+#: config/tc-ppc.c:3904
+msgid "bad symbol suffix"
+msgstr ""
+
+#: config/tc-ppc.c:3995
+msgid "Unrecognized symbol suffix"
+msgstr ""
+
+#: config/tc-ppc.c:4077
+msgid "two .function pseudo-ops with no intervening .ef"
+msgstr ""
+
+#: config/tc-ppc.c:4089
+msgid ".ef with no preceding .function"
+msgstr ""
+
+#: config/tc-ppc.c:4217
+#, c-format
+msgid "warning: symbol %s has no csect"
+msgstr ""
+
+#: config/tc-ppc.c:4513
+msgid "symbol in .toc does not match any .tc"
+msgstr ""
+
+#: config/tc-ppc.c:4810
+msgid "unsupported relocation type"
+msgstr ""
+
+#: config/tc-ppc.c:4864
+#, c-format
+msgid "cannot emit PC relative %s relocation against %s"
+msgstr ""
+
+#: config/tc-ppc.c:4869
+#, c-format
+msgid "cannot emit PC relative %s relocation"
+msgstr ""
+
+#: config/tc-ppc.c:4931
+msgid "must branch to an address a multiple of 4"
+msgstr ""
+
+#: config/tc-ppc.c:4935
+#, c-format
+msgid "@local or @plt branch destination is too far away, %ld bytes"
+msgstr ""
+
+#: config/tc-ppc.c:4959
+#, c-format
+msgid "Gas failure, reloc value %d\n"
+msgstr ""
+
+#: config/tc-sh.c:521
+msgid "illegal register after @-"
+msgstr ""
+
+#: config/tc-sh.c:537
+msgid "must be @(r0,...)"
+msgstr ""
+
+#: config/tc-sh.c:553
+msgid "syntax error in @(r0,...)"
+msgstr ""
+
+#: config/tc-sh.c:585 config/tc-sh.c:590
+msgid "syntax error in @(disp,[Rn, gbr, pc])"
+msgstr ""
+
+#: config/tc-sh.c:595
+msgid "expecting )"
+msgstr ""
+
+#: config/tc-sh.c:604
+msgid "illegal register after @"
+msgstr ""
+
+#: config/tc-sh.c:1228
+msgid ".uses pseudo-op seen when not relaxing"
+msgstr ""
+
+#: config/tc-sh.c:1234
+msgid "bad .uses format"
+msgstr ""
+
+#: config/tc-sh.c:1289
+msgid ""
+"SH options:\n"
+"-little\t\t\tgenerate little endian code\n"
+"-relax\t\t\talter jump instructions for long displacements\n"
+"-small\t\t\talign sections to 4 byte boundaries, not 16\n"
+msgstr ""
+
+#: config/tc-sh.c:1299 config/tc-w65.c:883
+msgid "call to tc_Nout_fix_to_chars \n"
+msgstr ""
+
+#: config/tc-sh.c:1385
+msgid ".uses does not refer to a local symbol in the same section"
+msgstr ""
+
+#: config/tc-sh.c:1404
+msgid "can't find fixup pointed to by .uses"
+msgstr ""
+
+#: config/tc-sh.c:1427
+msgid ".uses target does not refer to a local symbol in the same section"
+msgstr ""
+
+#: config/tc-sh.c:1524
+#, c-format
+msgid "at 0x%lx, displacement overflows 12-bit field"
+msgstr ""
+
+#: config/tc-sh.c:1527
+#, c-format
+msgid "at 0x%lx, displacement to defined symbol %s overflows 12-bit field"
+msgstr ""
+
+#: config/tc-sh.c:1531
+#, c-format
+msgid "at 0x%lx, displacement to undefined symbol %s overflows 12-bit field"
+msgstr ""
+
+#: config/tc-sh.c:1647
+#, c-format
+msgid "at 0x%lx, displacement overflows 8-bit field"
+msgstr ""
+
+#: config/tc-sh.c:1650
+#, c-format
+msgid "at 0x%lx, displacement to defined symbol %s overflows 8-bit field "
+msgstr ""
+
+#: config/tc-sh.c:1654
+#, c-format
+msgid "at 0x%lx, displacement to undefined symbol %s overflows 8-bit field "
+msgstr ""
+
+#: config/tc-sh.c:1707
+#, c-format
+msgid "overflow in branch to %s; converted into longer instruction sequence"
+msgstr ""
+
+#: config/tc-sh.c:1782 config/tc-sh.c:1810 config/tc-sparc.c:3436
+#: config/tc-sparc.c:3455
+msgid "misaligned data"
+msgstr ""
+
+#: config/tc-sh.c:1988 config/tc-sh.c:1995 config/tc-sh.c:2002
+#: config/tc-sh.c:2009
+msgid "pcrel too far"
+msgstr ""
+
+#: config/tc-sh.c:2073
+msgid "misaligned offset"
+msgstr ""
+
+#: config/tc-sh.c:2081
+msgid "offset out of range"
+msgstr ""
+
+#: config/tc-sparc.c:257
+msgid "Invalid default architecture, broken assembler."
+msgstr ""
+
+#: config/tc-sparc.c:261 config/tc-sparc.c:448
+msgid "Bad opcode table, broken assembler."
+msgstr ""
+
+#: config/tc-sparc.c:427
+#, c-format
+msgid "invalid architecture -xarch=%s"
+msgstr ""
+
+#: config/tc-sparc.c:442
+#, c-format
+msgid "invalid architecture -A%s"
+msgstr ""
+
+#: config/tc-sparc.c:509
+#, c-format
+msgid "No compiled in support for %d bit object file format"
+msgstr ""
+
+#: config/tc-sparc.c:546
+msgid "Unrecognized option following -K"
+msgstr ""
+
+#: config/tc-sparc.c:570
+msgid "SPARC options:\n"
+msgstr ""
+
+#: config/tc-sparc.c:578
+msgid ""
+"\n"
+"-xarch=v8plus | -xarch=v8plusa\n"
+msgstr ""
+
+#: config/tc-sparc.c:579
+msgid ""
+"\t\t\tspecify variant of SPARC architecture\n"
+"-bump\t\t\twarn when assembler switches architectures\n"
+"-sparc\t\t\tignored\n"
+"--enforce-aligned-data\tforce .long, etc., to be aligned correctly\n"
+msgstr ""
+
+#: config/tc-sparc.c:585
+msgid "-k\t\t\tgenerate PIC\n"
+msgstr ""
+
+#: config/tc-sparc.c:589
+msgid ""
+"-32\t\t\tcreate 32 bit object file\n"
+"-64\t\t\tcreate 64 bit object file\n"
+msgstr ""
+
+#: config/tc-sparc.c:592
+#, c-format
+msgid "\t\t\t[default is %d]\n"
+msgstr ""
+
+#: config/tc-sparc.c:594
+msgid ""
+"-TSO\t\t\tuse Total Store Ordering\n"
+"-PSO\t\t\tuse Partial Store Ordering\n"
+"-RMO\t\t\tuse Relaxed Memory Ordering\n"
+msgstr ""
+
+#: config/tc-sparc.c:598
+#, c-format
+msgid "\t\t\t[default is %s]\n"
+msgstr ""
+
+#: config/tc-sparc.c:600
+msgid ""
+"-KPIC\t\t\tgenerate PIC\n"
+"-V\t\t\tprint assembler version number\n"
+"-q\t\t\tignored\n"
+"-Qy, -Qn\t\tignored\n"
+"-s\t\t\tignored\n"
+msgstr ""
+
+#: config/tc-sparc.c:608
+msgid ""
+"-EL\t\t\tgenerate code for a little endian machine\n"
+"-EB\t\t\tgenerate code for a big endian machine\n"
+"--little-endian-data\tgenerate code for a machine having big endian\n"
+"                        instructions and little endian data."
+msgstr ""
+
+#: config/tc-sparc.c:856
+msgid "Support for 64-bit arithmetic not compiled in."
+msgstr ""
+
+#: config/tc-sparc.c:911
+msgid "FP branch in delay slot"
+msgstr ""
+
+#: config/tc-sparc.c:927
+msgid "FP branch preceded by FP instruction; NOP inserted"
+msgstr ""
+
+#: config/tc-sparc.c:947
+msgid "set: used with negative number"
+msgstr ""
+
+#: config/tc-sparc.c:949
+msgid "set: number larger than 4294967295"
+msgstr ""
+
+#: config/tc-sparc.c:1000
+msgid "setx: temporary register same as destination register"
+msgstr ""
+
+#: config/tc-sparc.c:1145
+msgid "failed special case insn sanity check"
+msgstr ""
+
+#: config/tc-sparc.c:1235
+msgid ": invalid membar mask name"
+msgstr ""
+
+#: config/tc-sparc.c:1249
+msgid ": invalid membar mask expression"
+msgstr ""
+
+#: config/tc-sparc.c:1254
+msgid ": invalid membar mask number"
+msgstr ""
+
+#: config/tc-sparc.c:1272
+msgid ": invalid prefetch function name"
+msgstr ""
+
+#: config/tc-sparc.c:1280
+msgid ": invalid prefetch function expression"
+msgstr ""
+
+#: config/tc-sparc.c:1285
+msgid ": invalid prefetch function number"
+msgstr ""
+
+#: config/tc-sparc.c:1313 config/tc-sparc.c:1325
+msgid ": unrecognizable privileged register"
+msgstr ""
+
+#: config/tc-sparc.c:1349 config/tc-sparc.c:1366
+msgid ": unrecognizable v9a ancillary state register"
+msgstr ""
+
+#: config/tc-sparc.c:1354
+msgid ": rd on write only ancillary state register"
+msgstr ""
+
+#: config/tc-sparc.c:1390
+msgid ": asr number must be between 16 and 31"
+msgstr ""
+
+#: config/tc-sparc.c:1398
+msgid ": asr number must be between 0 and 31"
+msgstr ""
+
+#: config/tc-sparc.c:1408
+msgid ": expecting %asrN"
+msgstr ""
+
+#: config/tc-sparc.c:1799
+msgid ": There are only 64 f registers; [0-63]"
+msgstr ""
+
+#: config/tc-sparc.c:1801 config/tc-sparc.c:1813
+msgid ": There are only 32 f registers; [0-31]"
+msgstr ""
+
+#: config/tc-sparc.c:1982
+msgid ": PC-relative operand can't be a constant"
+msgstr ""
+
+#: config/tc-sparc.c:2015
+msgid ": invalid ASI name"
+msgstr ""
+
+#: config/tc-sparc.c:2023
+msgid ": invalid ASI expression"
+msgstr ""
+
+#: config/tc-sparc.c:2028
+msgid ": invalid ASI number"
+msgstr ""
+
+#: config/tc-sparc.c:2125
+msgid "OPF immediate operand out of range (0-0x1ff)"
+msgstr ""
+
+#: config/tc-sparc.c:2130
+msgid "non-immediate OPF operand, ignored"
+msgstr ""
+
+#: config/tc-sparc.c:2149
+msgid ": invalid cpreg name"
+msgstr ""
+
+#: config/tc-sparc.c:2178
+#, c-format
+msgid "Illegal operands%s"
+msgstr ""
+
+#: config/tc-sparc.c:2207
+#, c-format
+msgid "architecture bumped from \"%s\" to \"%s\" on \"%s\""
+msgstr ""
+
+#: config/tc-sparc.c:2243
+#, c-format
+msgid "Architecture mismatch on \"%s\"."
+msgstr ""
+
+#: config/tc-sparc.c:2244
+#, c-format
+msgid " (Requires %s; requested architecture is %s.)"
+msgstr ""
+
+#: config/tc-sparc.c:2760
+#, c-format
+msgid "bad or unhandled relocation type: 0x%02x"
+msgstr ""
+
+#: config/tc-sparc.c:3037
+msgid "bad .reserve segment -- expected BSS segment"
+msgstr ""
+
+#: config/tc-sparc.c:3054
+msgid "missing alignment"
+msgstr ""
+
+#: config/tc-sparc.c:3065 config/tc-sparc.c:3210
+#, c-format
+msgid "alignment too large; assuming %d"
+msgstr ""
+
+#: config/tc-sparc.c:3071 config/tc-sparc.c:3216
+msgid "negative alignment"
+msgstr ""
+
+#: config/tc-sparc.c:3081 config/tc-sparc.c:3239
+msgid "alignment not a power of 2"
+msgstr ""
+
+#: config/tc-sparc.c:3196
+msgid "Expected comma after common length"
+msgstr ""
+
+#: config/tc-tahoe.c:387
+msgid "The -a option doesn't exist. (Despite what the man page says!"
+msgstr ""
+
+#: config/tc-tahoe.c:391 config/tc-vax.c:3141
+#, c-format
+msgid "Displacement length %s ignored!"
+msgstr ""
+
+#: config/tc-tahoe.c:395 config/tc-vax.c:3133
+msgid "SYMBOL TABLE not implemented"
+msgstr ""
+
+#: config/tc-tahoe.c:399 config/tc-vax.c:3137
+msgid "TOKEN TRACE not implemented"
+msgstr ""
+
+#: config/tc-tahoe.c:403 config/tc-vax.c:3145
+#, c-format
+msgid "I don't need or use temp. file \"%s\"."
+msgstr ""
+
+#: config/tc-tahoe.c:407 config/tc-vax.c:3149
+msgid "I don't use an interpass file! -V ignored"
+msgstr ""
+
+#: config/tc-tahoe.c:421
+msgid ""
+"Tahoe options:\n"
+"-a\t\t\tignored\n"
+"-d LENGTH\t\tignored\n"
+"-J\t\t\tignored\n"
+"-S\t\t\tignored\n"
+"-t FILE\t\t\tignored\n"
+"-T\t\t\tignored\n"
+"-V\t\t\tignored\n"
+msgstr ""
+
+#: config/tc-tahoe.c:1075
+msgid "Casting a branch displacement is bad form, and is ignored."
+msgstr ""
+
+#: config/tc-tahoe.c:1131
+msgid "Couldn't parse the [index] in this operand."
+msgstr ""
+
+#: config/tc-tahoe.c:1137
+msgid "Couldn't find the opening '[' for the index of this operand."
+msgstr ""
+
+#: config/tc-tahoe.c:1177
+msgid "Couldn't find the opening '(' for the deref of this operand."
+msgstr ""
+
+#: config/tc-tahoe.c:1187
+msgid "Operand can't be both pre-inc and post-dec."
+msgstr ""
+
+#: config/tc-tahoe.c:1217
+msgid "I parsed 2 registers in this operand."
+msgstr ""
+
+#: config/tc-tahoe.c:1267
+msgid "Can't relocate expression error."
+msgstr ""
+
+#. This is an error. Tahoe doesn't allow any expressions
+#. bigger that a 32 bit long word. Any bigger has to be referenced
+#. by address.
+#: config/tc-tahoe.c:1274
+msgid "Expression is too large for a 32 bits."
+msgstr ""
+
+#: config/tc-tahoe.c:1279
+msgid "Junk at end of expression."
+msgstr ""
+
+#: config/tc-tahoe.c:1319
+msgid "Syntax error in direct register mode."
+msgstr ""
+
+#: config/tc-tahoe.c:1321
+msgid "You can't index a register in direct register mode."
+msgstr ""
+
+#: config/tc-tahoe.c:1324
+msgid "SP can't be the source operand with direct register addressing."
+msgstr ""
+
+#: config/tc-tahoe.c:1326
+msgid "Can't take the address of a register."
+msgstr ""
+
+#: config/tc-tahoe.c:1328
+msgid "Direct Register can't be used in a branch."
+msgstr ""
+
+#: config/tc-tahoe.c:1330
+msgid "For quad access, the register must be even and < 14."
+msgstr ""
+
+#: config/tc-tahoe.c:1332
+msgid "You can't cast a direct register."
+msgstr ""
+
+#: config/tc-tahoe.c:1338
+msgid "Using reg 14 for quadwords can tromp the FP register."
+msgstr ""
+
+#: config/tc-tahoe.c:1350
+msgid "Syntax error in auto-dec mode."
+msgstr ""
+
+#: config/tc-tahoe.c:1352
+msgid "You can't have an index auto dec mode."
+msgstr ""
+
+#: config/tc-tahoe.c:1354
+msgid "Auto dec mode cant be used for reading."
+msgstr ""
+
+#: config/tc-tahoe.c:1356
+msgid "Auto dec only works of the SP register."
+msgstr ""
+
+#: config/tc-tahoe.c:1358
+msgid "Auto dec can't be used in a branch."
+msgstr ""
+
+#: config/tc-tahoe.c:1360
+msgid "Auto dec won't work with quadwords."
+msgstr ""
+
+#: config/tc-tahoe.c:1367
+msgid "Syntax error in one of the auto-inc modes."
+msgstr ""
+
+#: config/tc-tahoe.c:1373
+msgid "Auto inc deferred only works of the SP register."
+msgstr ""
+
+#: config/tc-tahoe.c:1375
+msgid "You can't have an index auto inc deferred mode."
+msgstr ""
+
+#: config/tc-tahoe.c:1377 config/tc-tahoe.c:1388
+msgid "Auto inc can't be used in a branch."
+msgstr ""
+
+#: config/tc-tahoe.c:1384
+msgid "You can't write to an auto inc register."
+msgstr ""
+
+#: config/tc-tahoe.c:1386
+msgid "Auto inc only works of the SP register."
+msgstr ""
+
+#: config/tc-tahoe.c:1390
+msgid "Auto inc won't work with quadwords."
+msgstr ""
+
+#: config/tc-tahoe.c:1392
+msgid "You can't have an index in auto inc mode."
+msgstr ""
+
+#: config/tc-tahoe.c:1400
+msgid "You can't index the sp register."
+msgstr ""
+
+#: config/tc-tahoe.c:1406
+msgid "Syntax error in register displaced mode."
+msgstr ""
+
+#: config/tc-tahoe.c:1425
+msgid "An offest is needed for this operand."
+msgstr ""
+
+#: config/tc-tahoe.c:1437
+msgid "You can't index a register in immediate mode."
+msgstr ""
+
+#: config/tc-tahoe.c:1439
+msgid "Immediate access can't be used as an address."
+msgstr ""
+
+#: config/tc-tahoe.c:1550
+#, c-format
+msgid "Compiler bug: ODD number of bytes in arg structure %s."
+msgstr ""
+
+#: config/tc-tahoe.c:1577 config/tc-vax.c:1847
+msgid "Not enough operands"
+msgstr ""
+
+#: config/tc-tahoe.c:1587 config/tc-vax.c:1854
+msgid "Too many operands"
+msgstr ""
+
+#: config/tc-tahoe.c:1638 config/tc-vax.c:368
+#, c-format
+msgid "Ignoring statement due to \"%s\""
+msgstr ""
+
+#: config/tc-tahoe.c:1733
+#, c-format
+msgid "Compliler bug: Got a case (%d) I wasn't expecting."
+msgstr ""
+
+#: config/tc-tahoe.c:1827
+msgid "Real branch displacements must be expressions."
+msgstr ""
+
+#: config/tc-tahoe.c:1830
+#, c-format
+msgid "Complier error: I got an unknown synthetic branch :%c"
+msgstr ""
+
+#: config/tc-tahoe.c:1971
+#, c-format
+msgid "Barf, bad mode %x\n"
+msgstr ""
+
+#: config/tc-tic80.c:90
+msgid "Relaxation is a luxury we can't afford"
+msgstr ""
+
+#: config/tc-tic80.c:141
+msgid "bad call to md_atof ()"
+msgstr ""
+
+#: config/tc-tic80.c:245
+msgid "':' not followed by 'm' or 's'"
+msgstr ""
+
+#: config/tc-tic80.c:259
+msgid "paren nesting"
+msgstr ""
+
+#: config/tc-tic80.c:274
+msgid "mismatched parenthesis"
+msgstr ""
+
+#: config/tc-tic80.c:467
+msgid "unhandled expression type"
+msgstr ""
+
+#: config/tc-tic80.c:682
+msgid "symbol reloc that is not PC relative or 32 bits"
+msgstr ""
+
+#: config/tc-tic80.c:705
+msgid "unhandled operand modifier"
+msgstr ""
+
+#: config/tc-tic80.c:746
+msgid "unhandled expression"
+msgstr ""
+
+#: config/tc-tic80.c:797
+#, c-format
+msgid "Invalid mnemonic: '%s'"
+msgstr ""
+
+#: config/tc-tic80.c:813
+#, c-format
+msgid "Invalid operands: '%s'"
+msgstr ""
+
+#: config/tc-tic80.c:890
+msgid "unhandled predefined symbol bits"
+msgstr ""
+
+#: config/tc-tic80.c:986
+#, c-format
+msgid "PC offset 0x%lx outside range 0x%lx-0x%lx"
+msgstr ""
+
+#: config/tc-tic80.c:1001
+msgid "unhandled relocation type in fixup"
+msgstr ""
+
+#: config/tc-tic80.c:1038
+msgid "md_convert_frag() not implemented yet"
+msgstr ""
+
+#: config/tc-v850.c:273
+#, c-format
+msgid ".COMMon length (%d.) < 0! Ignored."
+msgstr ""
+
+#: config/tc-v850.c:1000
+#, c-format
+msgid "unknown operand shift: %x\n"
+msgstr ""
+
+#: config/tc-v850.c:1001
+msgid "internal failure in parse_register_list"
+msgstr ""
+
+#: config/tc-v850.c:1019
+msgid "constant expression or register list expected"
+msgstr ""
+
+#: config/tc-v850.c:1024 config/tc-v850.c:1037 config/tc-v850.c:1056
+msgid "high bits set in register list expression"
+msgstr ""
+
+#: config/tc-v850.c:1096 config/tc-v850.c:1160
+msgid "illegal register included in list"
+msgstr ""
+
+#: config/tc-v850.c:1103
+msgid "system registers cannot be included in list"
+msgstr ""
+
+#: config/tc-v850.c:1108
+msgid "PSW cannot be included in list"
+msgstr ""
+
+#: config/tc-v850.c:1115
+msgid "High value system registers cannot be included in list"
+msgstr ""
+
+#: config/tc-v850.c:1139
+msgid "second register should follow dash in register list"
+msgstr ""
+
+#: config/tc-v850.c:1187
+msgid " V850 options:\n"
+msgstr ""
+
+#: config/tc-v850.c:1188
+msgid "  -mwarn-signed-overflow    Warn if signed immediate values overflow\n"
+msgstr ""
+
+#: config/tc-v850.c:1189
+msgid ""
+"  -mwarn-unsigned-overflow  Warn if unsigned immediate values overflow\n"
+msgstr ""
+
+#: config/tc-v850.c:1190
+msgid "  -mv850                    The code is targeted at the v850\n"
+msgstr ""
+
+#: config/tc-v850.c:1191
+msgid "  -mv850e                   The code is targeted at the v850e\n"
+msgstr ""
+
+#: config/tc-v850.c:1192
+msgid "  -mv850ea                  The code is targeted at the v850ea\n"
+msgstr ""
+
+#: config/tc-v850.c:1193
+msgid ""
+"  -mv850any                 The code is generic, despite any processor "
+"specific instructions\n"
+msgstr ""
+
+#: config/tc-v850.c:1204 config/tc-v850.c:1239
+#, c-format
+msgid "unknown command line option: -%c%s\n"
+msgstr ""
+
+#: config/tc-v850.c:1393
+#, c-format
+msgid "Unable to determine default target processor from string: %s"
+msgstr ""
+
+#: config/tc-v850.c:1442
+msgid "ctoff() relocation used on an instruction which does not support it"
+msgstr ""
+
+#: config/tc-v850.c:1459
+msgid "sdaoff() relocation used on an instruction which does not support it"
+msgstr ""
+
+#: config/tc-v850.c:1476
+msgid "zdaoff() relocation used on an instruction which does not support it"
+msgstr ""
+
+#: config/tc-v850.c:1494
+msgid "tdaoff() relocation used on an instruction which does not support it"
+msgstr ""
+
+#: config/tc-v850.c:1712
+msgid "Target processor does not support this instruction."
+msgstr ""
+
+#: config/tc-v850.c:1802 config/tc-v850.c:1832 config/tc-v850.c:2018
+msgid "immediate operand is too large"
+msgstr ""
+
+#: config/tc-v850.c:1814
+msgid "AAARG -> unhandled constant reloc"
+msgstr ""
+
+#: config/tc-v850.c:1858
+msgid "invalid register name"
+msgstr ""
+
+#: config/tc-v850.c:1863
+msgid "register r0 cannot be used here"
+msgstr ""
+
+#: config/tc-v850.c:1875
+msgid "invalid system register name"
+msgstr ""
+
+#: config/tc-v850.c:1888
+msgid "expected EP register"
+msgstr ""
+
+#: config/tc-v850.c:1904
+msgid "invalid condition code name"
+msgstr ""
+
+#: config/tc-v850.c:1925 config/tc-v850.c:1929
+msgid "constant too big to fit into instruction"
+msgstr ""
+
+#: config/tc-v850.c:1981
+msgid "syntax error: value is missing before the register name"
+msgstr ""
+
+#: config/tc-v850.c:1983
+msgid "syntax error: register not expected"
+msgstr ""
+
+#: config/tc-v850.c:1997
+msgid "syntax error: system register not expected"
+msgstr ""
+
+#: config/tc-v850.c:2002
+msgid "syntax error: condition code not expected"
+msgstr ""
+
+#: config/tc-v850.c:2038
+msgid "invalid operand"
+msgstr ""
+
+#: config/tc-vax.c:263
+#, c-format
+msgid "VIP_BEGIN error:%s"
+msgstr ""
+
+#: config/tc-vax.c:387
+#, c-format
+msgid "Ignoring statement because \"%s\""
+msgstr ""
+
+#: config/tc-vax.c:434
+msgid "Can't relocate expression"
+msgstr ""
+
+#: config/tc-vax.c:537
+msgid "Bignum not permitted in short literal. Immediate mode assumed."
+msgstr ""
+
+#: config/tc-vax.c:546
+msgid "Can't do flonum short literal: immediate mode used."
+msgstr ""
+
+#: config/tc-vax.c:591
+#, c-format
+msgid "A bignum/flonum may not be a displacement: 0x%lx used"
+msgstr ""
+
+#: config/tc-vax.c:913
+#, c-format
+msgid "Short literal overflow(%ld.), immediate mode assumed."
+msgstr ""
+
+#: config/tc-vax.c:922
+#, c-format
+msgid "Forced short literal to immediate mode. now_seg=%s to_seg=%s"
+msgstr ""
+
+#: config/tc-vax.c:981
+msgid "Length specification ignored. Address mode 9F used"
+msgstr ""
+
+#: config/tc-vax.c:1030
+msgid "Invalid operand:  immediate value used as base address."
+msgstr ""
+
+#: config/tc-vax.c:1032
+msgid "Invalid operand:  immediate value used as address."
+msgstr ""
+
+#: config/tc-vax.c:1826
+msgid "odd number of bytes in operand description"
+msgstr ""
+
+#: config/tc-vax.c:1842
+msgid "Bad operand"
+msgstr ""
+
+#: config/tc-vax.c:2399
+msgid "no '[' to match ']'"
+msgstr ""
+
+#: config/tc-vax.c:2417
+msgid "bad register in []"
+msgstr ""
+
+#: config/tc-vax.c:2419
+msgid "[PC] index banned"
+msgstr ""
+
+#: config/tc-vax.c:2454
+msgid "no '(' to match ')'"
+msgstr ""
+
+#: config/tc-vax.c:2589
+msgid "invalid branch operand"
+msgstr ""
+
+#: config/tc-vax.c:2618
+msgid "address prohibits @"
+msgstr ""
+
+#: config/tc-vax.c:2620
+msgid "address prohibits #"
+msgstr ""
+
+#: config/tc-vax.c:2624
+msgid "address prohibits -()"
+msgstr ""
+
+#: config/tc-vax.c:2626
+msgid "address prohibits ()+"
+msgstr ""
+
+#: config/tc-vax.c:2629
+msgid "address prohibits ()"
+msgstr ""
+
+#: config/tc-vax.c:2631
+msgid "address prohibits []"
+msgstr ""
+
+#: config/tc-vax.c:2633
+msgid "address prohibits register"
+msgstr ""
+
+#: config/tc-vax.c:2635
+msgid "address prohibits displacement length specifier"
+msgstr ""
+
+#: config/tc-vax.c:2665
+msgid "invalid operand of S^#"
+msgstr ""
+
+#: config/tc-vax.c:2682
+msgid "S^# needs expression"
+msgstr ""
+
+#: config/tc-vax.c:2689
+msgid "S^# may only read-access"
+msgstr ""
+
+#: config/tc-vax.c:2714
+msgid "invalid operand of -()"
+msgstr ""
+
+#: config/tc-vax.c:2720
+msgid "-(PC) unpredictable"
+msgstr ""
+
+#: config/tc-vax.c:2722
+msgid "[]index same as -()register: unpredictable"
+msgstr ""
+
+#: config/tc-vax.c:2758
+msgid "invalid operand of ()+"
+msgstr ""
+
+#: config/tc-vax.c:2764
+msgid "(PC)+ unpredictable"
+msgstr ""
+
+#: config/tc-vax.c:2766
+msgid "[]index same as ()+register: unpredictable"
+msgstr ""
+
+#: config/tc-vax.c:2791
+msgid "# conflicts length"
+msgstr ""
+
+#: config/tc-vax.c:2793
+msgid "# bars register"
+msgstr ""
+
+#: config/tc-vax.c:2815
+msgid "writing or modifying # is unpredictable"
+msgstr ""
+
+#: config/tc-vax.c:2845
+msgid "length not needed"
+msgstr ""
+
+#: config/tc-vax.c:2852
+msgid "can't []index a register, because it has no address"
+msgstr ""
+
+#: config/tc-vax.c:2854
+msgid "a register has no address"
+msgstr ""
+
+#: config/tc-vax.c:2865
+msgid "PC part of operand unpredictable"
+msgstr ""
+
+#: config/tc-vax.c:3194
+msgid ""
+"VAX options:\n"
+"-d LENGTH\t\tignored\n"
+"-J\t\t\tignored\n"
+"-S\t\t\tignored\n"
+"-t FILE\t\t\tignored\n"
+"-T\t\t\tignored\n"
+"-V\t\t\tignored\n"
+msgstr ""
+
+#: config/tc-vax.c:3203
+msgid ""
+"VMS options:\n"
+"-+\t\t\thash encode names longer than 31 characters\n"
+"-1\t\t\t`const' handling compatible with gcc 1.x\n"
+"-H\t\t\tshow new symbol after hash truncation\n"
+"-h NUM\t\t\tdon't hash mixed-case names, and adjust case:\n"
+"\t\t\t0 = upper, 2 = lower, 3 = preserve case\n"
+"-v\"VERSION\"\t\tcode being assembled was produced by compiler \"VERSION\"\n"
+msgstr ""
+
+#: config/tc-w65.c:136
+msgid "need on or off."
+msgstr ""
+
+#: config/tc-w65.c:321 config/tc-w65.c:364
+msgid "syntax error after <exp"
+msgstr ""
+
+#: config/tc-z8k.c:290
+#, c-format
+msgid "register rr%d, out of range."
+msgstr ""
+
+#: config/tc-z8k.c:298
+#, c-format
+msgid "register rh%d, out of range."
+msgstr ""
+
+#: config/tc-z8k.c:306
+#, c-format
+msgid "register rl%d, out of range."
+msgstr ""
+
+#: config/tc-z8k.c:315
+#, c-format
+msgid "register rq%d, out of range."
+msgstr ""
+
+#: config/tc-z8k.c:323
+#, c-format
+msgid "register r%d, out of range."
+msgstr ""
+
+#: config/tc-z8k.c:374
+#, c-format
+msgid "expected %c"
+msgstr ""
+
+#: config/tc-z8k.c:390
+#, c-format
+msgid "register is wrong size for a word %s"
+msgstr ""
+
+#: config/tc-z8k.c:405
+#, c-format
+msgid "register is wrong size for address %s"
+msgstr ""
+
+#: config/tc-z8k.c:680
+msgid "Missing ) in ra(rb)"
+msgstr ""
+
+#: config/tc-z8k.c:947
+#, c-format
+msgid "operand %s0x%x out of range."
+msgstr ""
+
+#: config/tc-z8k.c:1086
+msgid "immediate must be 1 or 2"
+msgstr ""
+
+#: config/tc-z8k.c:1091
+msgid "immediate 1 or 2 expected"
+msgstr ""
+
+#: config/tc-z8k.c:1119
+msgid "can't use R0 here"
+msgstr ""
+
+#: config/tc-z8k.c:1278
+msgid "Can't find opcode to match operands"
+msgstr ""
+
+#: config/tc-z8k.c:1390
+#, c-format
+msgid "invalid architecture -z%s"
+msgstr ""
+
+#: config/tc-z8k.c:1406
+msgid ""
+"Z8K options:\n"
+"-z8001\t\t\tgenerate segmented code\n"
+"-z8002\t\t\tgenerate unsegmented code\n"
+msgstr ""
+
+#: config/tc-z8k.c:1543
+#, c-format
+msgid "Can't subtract symbols in different sections %s %s"
+msgstr ""
+
+#: depend.c:195
+#, c-format
+msgid "Can't open `%s' for writing"
+msgstr ""
+
+#: depend.c:207
+#, c-format
+msgid "Can't close `%s'"
+msgstr ""
+
+#: ecoff.c:1576
+#, c-format
+msgid "String too big (%lu bytes)"
+msgstr ""
+
+#: ecoff.c:1602
+#, c-format
+msgid "Inserting \"%s\" into string hash table: %s"
+msgstr ""
+
+#: ecoff.c:1634 ecoff.c:1827 ecoff.c:1853 ecoff.c:1885 ecoff.c:2041
+#: ecoff.c:2155
+msgid "no current file pointer"
+msgstr ""
+
+#: ecoff.c:1721
+msgid "too many st_End's"
+msgstr ""
+
+#: ecoff.c:2067
+#, c-format
+msgid "Inserting \"%s\" into tag hash table: %s"
+msgstr ""
+
+#: ecoff.c:2233
+msgid "fake .file after real one"
+msgstr ""
+
+#: ecoff.c:2321
+msgid "Filename goes over one page boundary."
+msgstr ""
+
+#: ecoff.c:2456
+msgid ".begin directive without a preceding .file directive"
+msgstr ""
+
+#: ecoff.c:2463
+msgid ".begin directive without a preceding .ent directive"
+msgstr ""
+
+#: ecoff.c:2495
+msgid ".bend directive without a preceding .file directive"
+msgstr ""
+
+#: ecoff.c:2502
+msgid ".bend directive without a preceding .ent directive"
+msgstr ""
+
+#: ecoff.c:2515
+msgid ".bend directive names unknown symbol"
+msgstr ""
+
+#: ecoff.c:2559
+msgid ".def pseudo-op used inside of .def/.endef; ignored"
+msgstr ""
+
+#: ecoff.c:2561
+msgid "Empty symbol name in .def; ignored"
+msgstr ""
+
+#: ecoff.c:2599
+msgid ".dim pseudo-op used outside of .def/.endef; ignored"
+msgstr ""
+
+#: ecoff.c:2614
+msgid "Badly formed .dim directive"
+msgstr ""
+
+#: ecoff.c:2627
+msgid "Too many .dim entries"
+msgstr ""
+
+#: ecoff.c:2648
+msgid ".scl pseudo-op used outside of .def/.endef; ignored"
+msgstr ""
+
+#: ecoff.c:2674
+msgid ".size pseudo-op used outside of .def/.endef; ignored"
+msgstr ""
+
+#: ecoff.c:2689
+msgid "Badly formed .size directive"
+msgstr ""
+
+#: ecoff.c:2702
+msgid "Too many .size entries"
+msgstr ""
+
+#: ecoff.c:2725
+msgid ".type pseudo-op used outside of .def/.endef; ignored"
+msgstr ""
+
+#. FIXME: We could handle this by setting the continued bit.
+#. There would still be a limit: the .type argument can not
+#. be infinite.
+#: ecoff.c:2743
+#, c-format
+msgid "The type of %s is too complex; it will be simplified"
+msgstr ""
+
+#: ecoff.c:2754
+msgid "Unrecognized .type argument"
+msgstr ""
+
+#: ecoff.c:2793
+msgid ".tag pseudo-op used outside of .def/.endef; ignored"
+msgstr ""
+
+#: ecoff.c:2820
+msgid ".val pseudo-op used outside of .def/.endef; ignored"
+msgstr ""
+
+#: ecoff.c:2828
+msgid ".val expression is too copmlex"
+msgstr ""
+
+#: ecoff.c:2859
+msgid ".endef pseudo-op used before .def; ignored"
+msgstr ""
+
+#: ecoff.c:2885
+msgid "Bad COFF debugging info"
+msgstr ""
+
+#: ecoff.c:2934
+#, c-format
+msgid "No tag specified for %s"
+msgstr ""
+
+#: ecoff.c:2966
+msgid "Bad COFF debugging information"
+msgstr ""
+
+#: ecoff.c:3038
+msgid ".end directive without a preceding .file directive"
+msgstr ""
+
+#: ecoff.c:3045
+msgid ".end directive without a preceding .ent directive"
+msgstr ""
+
+#: ecoff.c:3068
+msgid ".end directive names unknown symbol"
+msgstr ""
+
+#: ecoff.c:3097
+msgid "second .ent directive found before .end directive"
+msgstr ""
+
+#: ecoff.c:3172
+msgid "No way to handle .file within .ent/.end section"
+msgstr ""
+
+#: ecoff.c:3197
+msgid ".fmask outside of .ent"
+msgstr ""
+
+#: ecoff.c:3266
+msgid ".mask outside of .ent"
+msgstr ""
+
+#: ecoff.c:3296
+msgid ".loc before .file"
+msgstr ""
+
+#: ecoff.c:3303
+msgid ".loc outside of .text"
+msgstr ""
+
+#: ecoff.c:3422
+#, c-format
+msgid "Ignoring attempt to redefine symbol `%s'."
+msgstr ""
+
+#: ecoff.c:3435
+msgid "bad .weakext directive"
+msgstr ""
+
+#: ecoff.c:3504
+#, c-format
+msgid ".stab%c is not supported"
+msgstr ""
+
+#: ecoff.c:3514
+#, c-format
+msgid ".stab%c: ignoring non-zero other field"
+msgstr ""
+
+#: ecoff.c:3548
+#, c-format
+msgid ""
+"Line number (%d) for .stab%c directive cannot fit in index field (20 bits)"
+msgstr ""
+
+#: ecoff.c:3584
+#, c-format
+msgid "Illegal .stab%c directive, bad character"
+msgstr ""
+
+#: ecoff.c:4046 ecoff.c:4235 ecoff.c:4260
+msgid ".begin/.bend in different segments"
+msgstr ""
+
+#: ecoff.c:4761
+msgid "Missing .end or .bend at end of file"
+msgstr ""
+
+#: ecoff.c:5252
+msgid "GP prologue size exceeds field size, using 0 instead"
+msgstr ""
+
+#: expr.c:250
+msgid ""
+"bad floating-point constant: exponent overflow, probably assembling junk"
+msgstr ""
+
+#: expr.c:254
+#, c-format
+msgid "bad floating-point constant: unknown error code=%d."
+msgstr ""
+
+#: expr.c:434
+msgid ""
+"A bignum with underscores may not have more than 8 hex digits in any word."
+msgstr ""
+
+#: expr.c:454
+msgid "A bignum with underscores must have exactly 4 words."
+msgstr ""
+
+#. either not seen or not defined.
+#. @@ Should print out the original string instead of
+#. the parsed number.
+#: expr.c:581
+#, c-format
+msgid "backw. ref to unknown label \"%d:\", 0 assumed."
+msgstr ""
+
+#: expr.c:705
+msgid "Character constant too large"
+msgstr ""
+
+#: expr.c:941
+#, c-format
+msgid "expr.c(operand): bad atof_generic return val %d"
+msgstr ""
+
+#: expr.c:1001
+msgid "Missing ')' assumed"
+msgstr ""
+
+#: expr.c:1011 read.c:3824
+msgid "EBCDIC constants are not supported"
+msgstr ""
+
+#: expr.c:1078
+#, c-format
+msgid "Unary operator %c ignored because bad operand follows"
+msgstr ""
+
+#: expr.c:1122 expr.c:1147
+msgid "syntax error in .startof. or .sizeof."
+msgstr ""
+
+#: expr.c:1296
+msgid "Bad expression"
+msgstr ""
+
+#: expr.c:1644
+msgid "missing operand; zero assumed"
+msgstr ""
+
+#: expr.c:1677
+msgid "operation combines symbols in different segments"
+msgstr ""
+
+#: expr.c:1693
+msgid "left operand is a bignum; integer 0 assumed"
+msgstr ""
+
+#: expr.c:1695
+msgid "left operand is a float; integer 0 assumed"
+msgstr ""
+
+#: expr.c:1704
+msgid "right operand is a bignum; integer 0 assumed"
+msgstr ""
+
+#: expr.c:1706
+msgid "right operand is a float; integer 0 assumed"
+msgstr ""
+
+#: expr.c:1754 symbols.c:1092
+msgid "division by zero"
+msgstr ""
+
+#: frags.c:85
+#, c-format
+msgid "Can't extend frag %d. chars"
+msgstr ""
+
+#: frags.c:170
+msgid "attempt to allocate data in absolute section"
+msgstr ""
+
+#: frags.c:176
+msgid "attempt to allocate data in common section"
+msgstr ""
+
+#: gasp.c:484
+msgid "redefinition not allowed\n"
+msgstr ""
+
+#: gasp.c:558
+#, c-format
+msgid "the %c operator cannot take non-absolute arguments.\n"
+msgstr ""
+
+#: gasp.c:635
+msgid "string where expression expected.\n"
+msgstr ""
+
+#: gasp.c:641
+msgid "can't find primary in expression.\n"
+msgstr ""
+
+#: gasp.c:681
+msgid "misplaced closing parens.\n"
+msgstr ""
+
+#: gasp.c:718
+msgid "attempt to divide by zero.\n"
+msgstr ""
+
+#: gasp.c:750
+msgid "can't add two relocatable expressions\n"
+msgstr ""
+
+#: gasp.c:955
+msgid "unreasonable nesting.\n"
+msgstr ""
+
+#: gasp.c:1033
+msgid "End of file not at start of line.\n"
+msgstr ""
+
+#: gasp.c:1154
+#, c-format
+msgid "Illegal base character %c.\n"
+msgstr ""
+
+#: gasp.c:1269
+#, c-format
+msgid "radix is %c must be one of b, q, d or h"
+msgstr ""
+
+#: gasp.c:1305
+#, c-format
+msgid "size must be one of b, w or l, is %c.\n"
+msgstr ""
+
+#: gasp.c:1413
+msgid "datab repeat must be constant.\n"
+msgstr ""
+
+#: gasp.c:1415
+msgid "datab data must be absolute.\n"
+msgstr ""
+
+#: gasp.c:1429
+msgid "align needs absolute expression.\n"
+msgstr ""
+
+#: gasp.c:1436
+msgid ".align needs absolute fill value.\n"
+msgstr ""
+
+#: gasp.c:1444
+msgid "alignment must be one of 1, 2 or 4.\n"
+msgstr ""
+
+#: gasp.c:1469
+msgid "res needs absolute expression for fill count.\n"
+msgstr ""
+
+#: gasp.c:1549
+msgid "form LIN= needs absolute expresssion.\n"
+msgstr ""
+
+#: gasp.c:1552
+msgid "COL="
+msgstr ""
+
+#: gasp.c:1555
+msgid "form COL= needs absolute expresssion.\n"
+msgstr ""
+
+#. Turns the next expression into a string
+#: gasp.c:1597 macro.c:400
+#, c-format
+msgid "% operator needs absolute expression"
+msgstr ""
+
+#: gasp.c:1659
+msgid "misplaced ( .\n"
+msgstr ""
+
+#: gasp.c:1674
+msgid "misplaced ).\n"
+msgstr ""
+
+#: gasp.c:1728
+msgid ".instr needs absolute expresson.\n"
+msgstr ""
+
+#: gasp.c:1766
+msgid "need absolute position.\n"
+msgstr ""
+
+#: gasp.c:1768
+msgid "need absolute length.\n"
+msgstr ""
+
+#: gasp.c:2017
+msgid "END missing from end of file.\n"
+msgstr ""
+
+#: gasp.c:2047
+msgid ".ASSIGNA needs constant expression argument.\n"
+msgstr ""
+
+#: gasp.c:2051
+msgid ".ASSIGNA without label.\n"
+msgstr ""
+
+#: gasp.c:2076
+msgid ".ASSIGNS without label.\n"
+msgstr ""
+
+#: gasp.c:2143
+#, c-format
+msgid "Can't find preprocessor variable %s.\n"
+msgstr ""
+
+#: gasp.c:2208
+msgid "Comparison operator must be one of EQ, NE, LT, LE, GT or GE.\n"
+msgstr ""
+
+#: gasp.c:2242
+msgid "Comparison operator for strings must be EQ or NE\n"
+msgstr ""
+
+#: gasp.c:2254 gasp.c:2264 gasp.c:2366
+msgid "Conditional operator must have absolute operands.\n"
+msgstr ""
+
+#: gasp.c:2259
+msgid "String compared against expression.\n"
+msgstr ""
+
+#: gasp.c:2309
+msgid "AIF nesting unreasonable.\n"
+msgstr ""
+
+#: gasp.c:2324
+msgid "Multiple AELSEs in AIF.\n"
+msgstr ""
+
+#: gasp.c:2340
+msgid "AENDI without AIF.\n"
+msgstr ""
+
+#: gasp.c:2363 gasp.c:2445
+msgid "IF nesting unreasonable.\n"
+msgstr ""
+
+#: gasp.c:2455
+msgid "Bad format for IF or IFNC.\n"
+msgstr ""
+
+#: gasp.c:2475
+msgid "AENDR without a AREPEAT.\n"
+msgstr ""
+
+#: gasp.c:2477
+msgid "ENDR without a REPT.\n"
+msgstr ""
+
+#: gasp.c:2500
+#, c-format
+msgid "AWHILE without a AENDW at %d.\n"
+msgstr ""
+
+#: gasp.c:2538
+msgid "AENDW without a AENDW.\n"
+msgstr ""
+
+#: gasp.c:2583
+msgid "AREPEAT must have absolute operand.\n"
+msgstr ""
+
+#: gasp.c:2589
+#, c-format
+msgid "AREPEAT without a AENDR at %d.\n"
+msgstr ""
+
+#: gasp.c:2631
+msgid ".ENDM without a matching .MACRO.\n"
+msgstr ""
+
+#: gasp.c:2665
+msgid "LOCAL outside of MACRO"
+msgstr ""
+
+#: gasp.c:2678
+#, c-format
+msgid "macro at line %d: %s\n"
+msgstr ""
+
+#: gasp.c:2701
+msgid "macro expansion"
+msgstr ""
+
+#: gasp.c:2753
+msgid "Character code in string must be absolute expression.\n"
+msgstr ""
+
+#: gasp.c:2758
+msgid "Missing > for character code.\n"
+msgstr ""
+
+#: gasp.c:2817
+#, c-format
+msgid "string for SDATAC longer than 255 characters (%d).\n"
+msgstr ""
+
+#: gasp.c:2845
+#, c-format
+msgid "illegal character in SDATA line (0x%x).\n"
+msgstr ""
+
+#: gasp.c:2866
+msgid "Must have absolute SDATAB repeat count.\n"
+msgstr ""
+
+#: gasp.c:2869
+#, c-format
+msgid "Must have positive SDATAB repeat count (%d).\n"
+msgstr ""
+
+#: gasp.c:2897
+#, c-format
+msgid "Unreasonable include depth (%ld).\n"
+msgstr ""
+
+#: gasp.c:2951
+#, c-format
+msgid "Can't open include file `%s'.\n"
+msgstr ""
+
+#: gasp.c:3025
+msgid "Unreasonable expansion (-u turns off check).\n"
+msgstr ""
+
+#. This one causes lots of pain when trying to preprocess
+#. ordinary code
+#: gasp.c:3246
+#, c-format
+msgid "Unrecognised pseudo op `%s'.\n"
+msgstr ""
+
+#: gasp.c:3313
+msgid "ORG command not allowed.\n"
+msgstr ""
+
+#: gasp.c:3530
+msgid "Invalid expression on command line.\n"
+msgstr ""
+
+#: gasp.c:3571
+#, c-format
+msgid ""
+"Usage: %s \n"
+"  [-a]      [--alternate]         enter alternate macro mode\n"
+"  [-c char] [--commentchar char]  change the comment character from !\n"
+"  [-d]      [--debug]             print some debugging info\n"
+"  [-h]      [--help]              print this message\n"
+"  [-M]      [--mri]               enter MRI compatibility mode\n"
+"  [-o out]  [--output out]        set the output file\n"
+"  [-p]      [--print]             print line numbers\n"
+msgstr ""
+
+#: gasp.c:3580
+msgid ""
+"  [-s]      [--copysource]        copy source through as comments \n"
+"  [-u]      [--unreasonable]      allow unreasonable nesting\n"
+"  [-v]      [--version]           print the program version\n"
+"  [-Dname=value]                  create preprocessor variable called name, "
+"with value\n"
+"  [-Ipath]                        add to include path list\n"
+"  [in-file]\n"
+msgstr ""
+
+#: gasp.c:3596
+#, c-format
+msgid "%s: Gnu Assembler Macro Preprocessor\n"
+msgstr ""
+
+#. This output is intended to follow the GNU standards document.
+#: gasp.c:3680
+#, c-format
+msgid "GNU assembler pre-processor %s\n"
+msgstr ""
+
+#: gasp.c:3681
+msgid "Copyright 1996 Free Software Foundation, Inc.\n"
+msgstr ""
+
+#: gasp.c:3703
+#, c-format
+msgid "%s: Can't open output file `%s'.\n"
+msgstr ""
+
+#: gasp.c:3726
+#, c-format
+msgid "%s: Can't open input file `%s'.\n"
+msgstr ""
+
+#: gasp.c:3745
+#, c-format
+msgid "Internal error, aborting at %s line %d"
+msgstr ""
+
+#: gasp.c:3748
+msgid ""
+"\n"
+"Please report this bug.\n"
+msgstr ""
+
+#. Detect if we are reading from stdin by examining the file
+#. name returned by as_where().
+#.
+#. [FIXME: We rely upon the name in the strcmp below being the
+#. same as the one used by input_scrub_new_file(), if that is
+#. not true, then this code will fail].
+#.
+#. If we are reading from stdin, then we need to save each input line
+#. here (assuming of course that we actually have a line of input to read),
+#. so that it can be displayed in the listing that is produced at the end
+#. of the assembly.
+#: input-file.c:150 input-scrub.c:233 listing.c:353
+msgid "{standard input}"
+msgstr ""
+
+#: input-file.c:154
+#, c-format
+msgid "Can't open %s for reading."
+msgstr ""
+
+#: input-file.c:205 input-file.c:234
+#, c-format
+msgid "Can't read from %s"
+msgstr ""
+
+#: input-file.c:242
+#, c-format
+msgid "Can't close %s"
+msgstr ""
+
+#: input-scrub.c:263
+msgid "macros nested too deeply"
+msgstr ""
+
+#: input-scrub.c:349
+msgid "partial line at end of file ignored"
+msgstr ""
+
+#: input-scrub.c:371
+msgid "Partial line at end of file ignored"
+msgstr ""
+
+#: itbl-ops.c:359
+msgid "Unable to allocate memory for new instructions\n"
+msgstr ""
+
+#: listing.c:252
+msgid "Warning:"
+msgstr ""
+
+#: listing.c:259
+msgid "Error:"
+msgstr ""
+
+#: listing.c:1140
+#, c-format
+msgid "can't open list file: %s"
+msgstr ""
+
+#: listing.c:1164
+#, c-format
+msgid "error closing list file: %s"
+msgstr ""
+
+#: listing.c:1245
+msgid "strange paper height, set to no form"
+msgstr ""
+
+#: listing.c:1311
+msgid "New line in title"
+msgstr ""
+
+#: macro.c:563
+msgid "unexpected end of file in macro definition"
+msgstr ""
+
+#: macro.c:572
+msgid "missing ) after formals"
+msgstr ""
+
+#: macro.c:729
+msgid "missplaced )"
+msgstr ""
+
+#: macro.c:991
+msgid "confusion in formal parameters"
+msgstr ""
+
+#: macro.c:996
+msgid "macro formal argument does not exist"
+msgstr ""
+
+#: macro.c:1011
+msgid "can't mix positional and keyword arguments"
+msgstr ""
+
+#: macro.c:1019
+msgid "too many positional arguments"
+msgstr ""
+
+#: macro.c:1194
+msgid "unexpected end of file in irp or irpc"
+msgstr ""
+
+#: macro.c:1202
+msgid "missing model parameter"
+msgstr ""
+
+#: messages.c:105
+msgid "Assembler messages:\n"
+msgstr ""
+
+#: messages.c:222
+msgid "Warning: "
+msgstr ""
+
+#: messages.c:331
+msgid "Error: "
+msgstr ""
+
+#: messages.c:435 messages.c:452
+msgid "Fatal error: "
+msgstr ""
+
+#: messages.c:471
+msgid "Internal error!\n"
+msgstr ""
+
+#: messages.c:473
+#, c-format
+msgid "Assertion failure in %s at %s line %d.\n"
+msgstr ""
+
+#: messages.c:476
+#, c-format
+msgid "Assertion failure at %s line %d.\n"
+msgstr ""
+
+#: messages.c:477 messages.c:495
+msgid "Please report this bug.\n"
+msgstr ""
+
+#: messages.c:490
+#, c-format
+msgid "Internal error, aborting at %s line %d in %s\n"
+msgstr ""
+
+#: messages.c:493
+#, c-format
+msgid "Internal error, aborting at %s line %d\n"
+msgstr ""
+
+#: output-file.c:48
+#, c-format
+msgid "Can't open a bfd on stdout %s "
+msgstr ""
+
+#: output-file.c:72 output-file.c:79
+#, c-format
+msgid "FATAL: Can't close %s\n"
+msgstr ""
+
+#: output-file.c:130
+#, c-format
+msgid "FATAL: Can't close %s"
+msgstr ""
+
+#: output-file.c:148
+msgid "Failed to emit an object byte"
+msgstr ""
+
+#: output-file.c:149
+msgid "Can't continue"
+msgstr ""
+
+#: read.c:434
+#, c-format
+msgid "error constructing %s pseudo-op table: %s"
+msgstr ""
+
+#: read.c:802
+#, c-format
+msgid "Unknown pseudo-op:  `%s'"
+msgstr ""
+
+#: read.c:928
+#, c-format
+msgid "label \"%d$\" redefined"
+msgstr ""
+
+#: read.c:1145
+msgid ".abort detected.  Abandoning ship."
+msgstr ""
+
+#: read.c:1250 read.c:2031
+msgid "Alignment not a power of 2"
+msgstr ""
+
+#: read.c:1258
+#, c-format
+msgid "Alignment too large: %u assumed"
+msgstr ""
+
+#: read.c:1290
+msgid "expected fill pattern missing"
+msgstr ""
+
+#: read.c:1487
+#, c-format
+msgid "attempt to re-define symbol `%s'"
+msgstr ""
+
+#. Some of the back ends can't deal with non-positive line numbers.
+#. Besides, it's silly.
+#: read.c:1611
+#, c-format
+msgid "Line numbers must be positive; line number %d rejected."
+msgstr ""
+
+#: read.c:1638
+msgid "start address not supported"
+msgstr ""
+
+#: read.c:1648
+msgid ".err encountered"
+msgstr ""
+
+#: read.c:1667 read.c:1669
+#, c-format
+msgid ".fail %ld encountered"
+msgstr ""
+
+#: read.c:1706
+#, c-format
+msgid ".fill size clamped to %d."
+msgstr ""
+
+#: read.c:1711
+msgid "Size negative: .fill ignored."
+msgstr ""
+
+#: read.c:1717
+msgid "Repeat < 0, .fill ignored"
+msgstr ""
+
+#: read.c:1873
+#, c-format
+msgid "unrecognized .linkonce type `%s'"
+msgstr ""
+
+#: read.c:1886 read.c:1912
+msgid ".linkonce is not supported for this object file format"
+msgstr ""
+
+#: read.c:1908
+#, c-format
+msgid "bfd_set_section_flags: %s"
+msgstr ""
+
+#: read.c:1977
+#, c-format
+msgid "error setting flags for \".sbss\": %s"
+msgstr ""
+
+#: read.c:2009
+msgid "Expected comma after size"
+msgstr ""
+
+#: read.c:2017
+msgid "Missing alignment"
+msgstr ""
+
+#: read.c:2154
+msgid "bad expression"
+msgstr ""
+
+#: read.c:2289
+#, c-format
+msgid "attempt to redefine pseudo-op `%s' ignored"
+msgstr ""
+
+#: read.c:2353
+#, c-format
+msgid "invalid segment \"%s\"; segment \"%s\" assumed"
+msgstr ""
+
+#: read.c:2359
+msgid "ignoring fill value in absolute section"
+msgstr ""
+
+#: read.c:2362
+msgid "only constant offsets supported in absolute section"
+msgstr ""
+
+#: read.c:2394
+msgid "MRI style ORG pseudo-op not supported"
+msgstr ""
+
+#: read.c:2482
+msgid "unrecognized section type"
+msgstr ""
+
+#: read.c:2550
+#, c-format
+msgid "unrecognized section type `%s'"
+msgstr ""
+
+#: read.c:2564
+msgid "absolute sections are not supported"
+msgstr ""
+
+#: read.c:2579
+#, c-format
+msgid "unrecognized section command `%s'"
+msgstr ""
+
+#: read.c:2654
+msgid "rept without endr"
+msgstr ""
+
+#: read.c:2841
+msgid "Unsupported variable size or fill value"
+msgstr ""
+
+#: read.c:2866
+msgid ".space repeat count is zero, ignored"
+msgstr ""
+
+#: read.c:2868
+msgid ".space repeat count is negative, ignored"
+msgstr ""
+
+#: read.c:2897
+msgid "space allocation too complex in absolute section"
+msgstr ""
+
+#: read.c:2902
+msgid "space allocation too complex in common section"
+msgstr ""
+
+#: read.c:2989 read.c:4070
+#, c-format
+msgid "Bad floating literal: %s"
+msgstr ""
+
+#: read.c:3065
+#, c-format
+msgid "Rest of line ignored. First ignored character is `%c'."
+msgstr ""
+
+#: read.c:3068
+#, c-format
+msgid "Rest of line ignored. First ignored character valued 0x%x."
+msgstr ""
+
+#: read.c:3119
+msgid "illegal expression; zero assumed"
+msgstr ""
+
+#: read.c:3121
+msgid "missing expression; zero assumed"
+msgstr ""
+
+#: read.c:3288
+msgid "rva without symbol"
+msgstr ""
+
+#: read.c:3413
+msgid "attempt to store value in absolute section"
+msgstr ""
+
+#: read.c:3451 read.c:4347
+msgid "zero assumed for missing expression"
+msgstr ""
+
+#: read.c:3463 read.c:4359
+msgid "register value used as expression"
+msgstr ""
+
+#. Leading bits contain both 0s & 1s.
+#: read.c:3553
+#, c-format
+msgid "Value 0x%lx truncated to 0x%lx."
+msgstr ""
+
+#: read.c:3569
+#, c-format
+msgid "Bignum truncated to %d bytes"
+msgstr ""
+
+#: read.c:3646
+#, c-format
+msgid "unsupported BFD relocation size %u"
+msgstr ""
+
+#: read.c:3735
+msgid "using a bit field width of zero"
+msgstr ""
+
+#: read.c:3743
+#, c-format
+msgid "field width \"%s\" too complex for a bitfield"
+msgstr ""
+
+#: read.c:3751
+#, c-format
+msgid "field width %lu too big to fit in %d bytes: truncated to %d bits"
+msgstr ""
+
+#: read.c:3772
+#, c-format
+msgid "field value \"%s\" too complex for a bitfield"
+msgstr ""
+
+#: read.c:3894
+msgid "Unresolvable or nonpositive repeat count; using 1"
+msgstr ""
+
+#: read.c:3945
+#, c-format
+msgid "Unknown floating type type '%c'"
+msgstr ""
+
+#: read.c:3967
+msgid "Floating point constant too large"
+msgstr ""
+
+#: read.c:4092
+msgid "unresolvable or nonpositive repeat count; using 1"
+msgstr ""
+
+#: read.c:4496
+msgid "Expected <nn>"
+msgstr ""
+
+#. To be compatible with BSD 4.2 as: give the luser a linefeed!!
+#: read.c:4529 read.c:4612
+msgid "Unterminated string: Newline inserted."
+msgstr ""
+
+#: read.c:4620
+msgid "Bad escaped character in string, '?' assumed"
+msgstr ""
+
+#: read.c:4646
+msgid "expected address expression; zero assumed"
+msgstr ""
+
+#: read.c:4666
+#, c-format
+msgid "symbol \"%s\" undefined; zero assumed"
+msgstr ""
+
+#: read.c:4669
+msgid "some symbol undefined; zero assumed"
+msgstr ""
+
+#: read.c:4687
+msgid "bad or irreducible absolute expression; zero assumed"
+msgstr ""
+
+#: read.c:4725
+msgid "This string may not contain '\\0'"
+msgstr ""
+
+#: read.c:4764
+msgid "Missing string"
+msgstr ""
+
+#: read.c:4995
+msgid "missing .func"
+msgstr ""
+
+#: read.c:5012
+msgid ".endfunc missing for previous .func"
+msgstr ""
+
+#: stabs.c:209
+msgid ".stabs: Missing comma"
+msgstr ""
+
+#: stabs.c:217 stabs.c:225 stabs.c:236
+#, c-format
+msgid ".stab%c: Missing comma"
+msgstr ""
+
+#: stabs.c:415
+msgid "comma missing in .xstabs"
+msgstr ""
+
+#: subsegs.c:379
+#, c-format
+msgid "Attempt to switch to nonexistent segment \"%s\""
+msgstr ""
+
+#: symbols.c:364 symbols.c:459
+#, c-format
+msgid "Symbol %s already defined."
+msgstr ""
+
+#: symbols.c:439
+#, c-format
+msgid "Symbol \"%s\" is already defined as \"%s\"/%d.%d.%ld."
+msgstr ""
+
+#: symbols.c:445
+#, c-format
+msgid "Symbol \"%s\" is already defined as \"%s\"/%ld."
+msgstr ""
+
+#: symbols.c:528 symbols.c:535
+#, c-format
+msgid "Inserting \"%s\" into symbol table failed: %s"
+msgstr ""
+
+#: symbols.c:880
+#, c-format
+msgid "Symbol definition loop encountered at %s"
+msgstr ""
+
+#: symbols.c:1054 symbols.c:1058
+#, c-format
+msgid "undefined symbol %s in operation"
+msgstr ""
+
+#: symbols.c:1062
+msgid "invalid section for operation"
+msgstr ""
+
+#: symbols.c:1067 symbols.c:1071
+#, c-format
+msgid "undefined symbol %s in operation setting %s"
+msgstr ""
+
+#: symbols.c:1076
+#, c-format
+msgid "invalid section for operation setting %s"
+msgstr ""
+
+#: symbols.c:1094
+#, c-format
+msgid "division by zero when setting %s"
+msgstr ""
+
+#: symbols.c:1166 write.c:1877
+#, c-format
+msgid "can't resolve value for symbol \"%s\""
+msgstr ""
+
+#: symbols.c:1536
+#, c-format
+msgid "\"%d\" (instance number %d of a %s label)"
+msgstr ""
+
+#: symbols.c:1584
+#, c-format
+msgid "Attempt to get value of unresolved symbol %s"
+msgstr ""
+
+#: write.c:169
+#, c-format
+msgid "field fx_size too small to hold %d"
+msgstr ""
+
+#: write.c:306
+msgid "rva not supported"
+msgstr ""
+
+#: write.c:501
+#, c-format
+msgid "attempt to .org/.space backwards? (%ld)"
+msgstr ""
+
+#: write.c:975
+msgid "relocation out of range"
+msgstr ""
+
+#: write.c:978
+#, c-format
+msgid "%s:%u: bad return from bfd_install_relocation: %x"
+msgstr ""
+
+#: write.c:1023
+msgid "internal error: fixup not contained within frag"
+msgstr ""
+
+#: write.c:1039
+#, c-format
+msgid "%s:%u: bad return from bfd_install_relocation"
+msgstr ""
+
+#: write.c:1122 write.c:1146
+#, c-format
+msgid "FATAL: Can't write %s"
+msgstr ""
+
+#: write.c:1177
+msgid "Cannot write to output file."
+msgstr ""
+
+#: write.c:1408
+#, c-format
+msgid "%d error%s, %d warning%s, generating bad object file.\n"
+msgstr ""
+
+#: write.c:1415
+#, c-format
+msgid "%d error%s, %d warning%s, no object file generated.\n"
+msgstr ""
+
+#: write.c:1814
+#, c-format
+msgid "local label %s is not defined"
+msgstr ""
+
+#: write.c:2119
+#, c-format
+msgid "alignment padding (%lu bytes) not a multiple of %ld"
+msgstr ""
+
+#: write.c:2225
+#, c-format
+msgid ".word %s-%s+%s didn't fit"
+msgstr ""
+
+#. Growth may be negative, but variable part of frag
+#. cannot have fewer than 0 chars.  That is, we can't
+#. .org backwards.
+#: write.c:2304
+msgid "attempt to .org backwards ignored"
+msgstr ""
+
+#: write.c:2320
+msgid ".space specifies non-absolute value"
+msgstr ""
+
+#: write.c:2324
+msgid ".space or .fill with negative value, ignored"
+msgstr ""
+
+#: write.c:2575
+#, c-format
+msgid ""
+"Subtraction of two symbols in different sections \"%s\" {%s section} - "
+"\"%s\" {%s section} at file address %s."
+msgstr ""
+
+#: write.c:2750
+#, c-format
+msgid "Value of %s too large for field of %d bytes at %s"
+msgstr ""
diff --git a/gas/read.c b/gas/read.c
index 7fee241..886c028 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -89,6 +89,10 @@
 #define LEX_QM 0
 #endif
 
+#ifndef LEX_HASH
+#define LEX_HASH 0
+#endif
+
 #ifndef LEX_DOLLAR
 /* The a29k assembler does not permits labels to start with $.  */
 #define LEX_DOLLAR 3
@@ -104,7 +108,7 @@
 {
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* @ABCDEFGHIJKLMNO */
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ[\]^_ */
-  0, 0, 0, 0, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
+  0, 0, 0, LEX_HASH, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, LEX_QM,	/* 0123456789:;<=>? */
   LEX_AT, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,	/* @ABCDEFGHIJKLMNO */
   3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, LEX_BR, 0, LEX_BR, 0, 3, /* PQRSTUVWXYZ[\]^_ */
@@ -208,10 +212,18 @@
 #endif
 
 static void cons_worker PARAMS ((int, int));
-static int scrub_from_string PARAMS ((char **));
+static int scrub_from_string PARAMS ((char *, int));
 static void do_align PARAMS ((int, char *, int, int));
 static void s_align PARAMS ((int, int));
+static void s_lcomm_internal PARAMS ((int, int));
 static int hex_float PARAMS ((int, char *));
+static inline int sizeof_sleb128 PARAMS ((offsetT));
+static inline int sizeof_uleb128 PARAMS ((valueT));
+static inline int output_sleb128 PARAMS ((char *, offsetT));
+static inline int output_uleb128 PARAMS ((char *, valueT));
+static inline int output_big_sleb128 PARAMS ((char *, LITTLENUM_TYPE *, int));
+static inline int output_big_uleb128 PARAMS ((char *, LITTLENUM_TYPE *, int));
+static int output_big_leb128 PARAMS ((char *, LITTLENUM_TYPE *, int, int));
 static void do_org PARAMS ((segT, expressionS *, int));
 char *demand_copy_string PARAMS ((int *lenP));
 static segT get_segmented_expression PARAMS ((expressionS *expP));
@@ -407,7 +419,7 @@
   {"xstabs", s_xstab, 's'},
   {"word", cons, 2},
   {"zero", s_space, 0},
-  {NULL}			/* end sentinel */
+  {NULL, NULL, 0}			/* end sentinel */
 };
 
 static int pop_override_ok = 0;
@@ -472,15 +484,18 @@
 static char *scrub_string_end;
 
 static int
-scrub_from_string (from)
-     char **from;
+scrub_from_string (buf, buflen)
+     char *buf;
+     int buflen;
 {
-  int size;
+  int copy;
 
-  *from = scrub_string;
-  size = scrub_string_end - scrub_string;
-  scrub_string = scrub_string_end;
-  return size;
+  copy = scrub_string_end - scrub_string;
+  if (copy > buflen)
+    copy = buflen;
+  memcpy (buf, scrub_string, copy);
+  scrub_string += copy;
+  return copy;
 }
 
 /*	read_a_source_file()
@@ -780,7 +795,7 @@
 			  mri_pending_align = 0;
 			  if (line_label != NULL)
 			    {
-			      line_label->sy_frag = frag_now;
+			      symbol_set_frag (line_label, frag_now);
 			      S_SET_VALUE (line_label, frag_now_fix ());
 			    }
 			}
@@ -815,6 +830,9 @@
 		  else
 		    {
 		      int inquote = 0;
+#ifdef QUOTES_IN_INSN
+		      int inescape = 0;
+#endif
 
 		      /* WARNING: c has char, which may be end-of-line. */
 		      /* Also: input_line_pointer->`\0` where c was. */
@@ -828,6 +846,14 @@
 			{
 			  if (flag_m68k_mri && *input_line_pointer == '\'')
 			    inquote = ! inquote;
+#ifdef QUOTES_IN_INSN
+			  if (inescape)
+			    inescape = 0;
+			  else if (*input_line_pointer == '"')
+			    inquote = ! inquote;
+			  else if (*input_line_pointer == '\\')
+			    inescape = 1;
+#endif
 			  input_line_pointer++;
 			}
 
@@ -861,7 +887,7 @@
 			  mri_pending_align = 0;
 			  if (line_label != NULL)
 			    {
-			      line_label->sy_frag = frag_now;
+			      symbol_set_frag (line_label, frag_now);
 			      S_SET_VALUE (line_label, frag_now_fix ());
 			    }
 			}
@@ -1121,7 +1147,7 @@
 
 void 
 s_abort (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   as_fatal (_(".abort detected.  Abandoning ship."));
 }
@@ -1147,21 +1173,7 @@
 
   if (fill == NULL)
     {
-      int maybe_text;
-
-#ifdef BFD_ASSEMBLER
-      if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
-	maybe_text = 1;
-      else
-	maybe_text = 0;
-#else
-      if (now_seg != data_section && now_seg != bss_section)
-	maybe_text = 1;
-      else
-	maybe_text = 0;
-#endif
-
-      if (maybe_text)
+      if (subseg_text_p (now_seg))
 	default_fill = NOP_OPCODE;
       else
 	default_fill = 0;
@@ -1325,7 +1337,7 @@
 
 void 
 s_comm (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register char *name;
   register char c;
@@ -1407,7 +1419,7 @@
 
 void
 s_mri_common (small)
-     int small;
+     int small ATTRIBUTE_UNUSED;
 {
   char *name;
   char c;
@@ -1481,10 +1493,12 @@
 
   if (line_label != NULL)
     {
-      line_label->sy_value.X_op = O_symbol;
-      line_label->sy_value.X_add_symbol = sym;
-      line_label->sy_value.X_add_number = S_GET_VALUE (sym);
-      line_label->sy_frag = &zero_address_frag;
+      expressionS exp;
+      exp.X_op = O_symbol;
+      exp.X_add_symbol = sym;
+      exp.X_add_number = 0;
+      symbol_set_value_expression (line_label, &exp);
+      symbol_set_frag (line_label, &zero_address_frag);
       S_SET_SEGMENT (line_label, expr_section);
     }
 
@@ -1504,7 +1518,7 @@
 
 void
 s_data (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   segT section;
   register int temp;
@@ -1578,7 +1592,7 @@
 
 void
 s_app_line (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   int l;
 
@@ -1604,7 +1618,7 @@
 
 void
 s_end (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   if (flag_mri)
     {
@@ -1622,7 +1636,7 @@
 
 void
 s_err (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   as_bad (_(".err encountered"));
   demand_empty_rest_of_line ();
@@ -1632,7 +1646,7 @@
 
 void
 s_fail (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   offsetT temp;
   char *stop = NULL;
@@ -1655,7 +1669,7 @@
 
 void 
 s_fill (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   expressionS rep_exp;
   long size = 1;
@@ -1752,7 +1766,7 @@
 
 void 
 s_globl (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name;
   int c;
@@ -1768,9 +1782,11 @@
       name = input_line_pointer;
       c = get_symbol_end ();
       symbolP = symbol_find_or_make (name);
+      S_SET_EXTERNAL (symbolP);
+
       *input_line_pointer = c;
       SKIP_WHITESPACE ();
-      S_SET_EXTERNAL (symbolP);
+      c = *input_line_pointer;
       if (c == ',')
 	{
 	  input_line_pointer++;
@@ -1825,7 +1841,7 @@
 
 void
 s_linkonce (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   enum linkonce_type type;
 
@@ -2056,9 +2072,9 @@
 	frag_align (align, 0, 0);
 					/* detach from old frag	*/
       if (S_GET_SEGMENT (symbolP) == bss_seg)
-	symbolP->sy_frag->fr_symbol = NULL;
+	symbol_get_frag (symbolP)->fr_symbol = NULL;
 
-      symbolP->sy_frag = frag_now;
+      symbol_set_frag (symbolP, frag_now);
       pfrag = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
 			(offsetT) temp, (char *) 0);
       *pfrag = 0;
@@ -2103,7 +2119,7 @@
 
 void 
 s_lsym (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register char *name;
   register char c;
@@ -2225,7 +2241,7 @@
 
 void
 s_macro (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *file;
   unsigned int line;
@@ -2253,7 +2269,7 @@
 	{
 	  S_SET_SEGMENT (line_label, undefined_section);
 	  S_SET_VALUE (line_label, 0);
-	  line_label->sy_frag = &zero_address_frag;
+	  symbol_set_frag (line_label, &zero_address_frag);
 	}
 
       if (((flag_m68k_mri
@@ -2277,7 +2293,7 @@
 
 void
 s_mexit (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   cond_exit_macro (macro_nest);
   buffer_limit = input_scrub_next_buffer (&input_line_pointer);
@@ -2287,7 +2303,7 @@
 
 void
 s_mri (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   int on, old_flag;
 
@@ -2355,7 +2371,7 @@
 
 void 
 s_org (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register segT segment;
   expressionS exp;
@@ -2411,7 +2427,7 @@
 
 void
 s_mri_sect (type)
-     char *type;
+     char *type ATTRIBUTE_UNUSED;
 {
 #ifdef TC_M68K
 
@@ -2575,7 +2591,7 @@
 
 void
 s_print (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *s;
   int len;
@@ -2589,7 +2605,7 @@
 
 void
 s_purgem (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   if (is_it_end_of_statement ())
     {
@@ -2619,7 +2635,7 @@
 
 void
 s_rept (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   int count;
   sb one;
@@ -2775,9 +2791,12 @@
 	      S_SET_VALUE (mri_common_symbol, val + 1);
 	      if (line_label != NULL)
 		{
-		  know (line_label->sy_value.X_op == O_symbol);
-		  know (line_label->sy_value.X_add_symbol == mri_common_symbol);
-		  line_label->sy_value.X_add_number += 1;
+		  expressionS *symexp;
+
+		  symexp = symbol_get_value_expression (line_label);
+		  know (symexp->X_op == O_symbol);
+		  know (symexp->X_add_symbol == mri_common_symbol);
+		  symexp->X_add_number += 1;
 		}
 	    }
 	}
@@ -2786,7 +2805,7 @@
 	  do_align (1, (char *) NULL, 0, 0);
 	  if (line_label != NULL)
 	    {
-	      line_label->sy_frag = frag_now;
+	      symbol_set_frag (line_label, frag_now);
 	      S_SET_VALUE (line_label, frag_now_fix ());
 	    }
 	}
@@ -2988,7 +3007,7 @@
 
 void
 s_struct (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *stop = NULL;
   char stopc;
@@ -3004,7 +3023,7 @@
 
 void
 s_text (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register int temp;
 
@@ -3106,7 +3125,8 @@
 	   && (S_GET_SEGMENT (exp.X_add_symbol)
 	       == S_GET_SEGMENT (exp.X_op_symbol))
 	   && SEG_NORMAL (S_GET_SEGMENT (exp.X_add_symbol))
-	   && exp.X_add_symbol->sy_frag == exp.X_op_symbol->sy_frag)
+	   && (symbol_get_frag (exp.X_add_symbol)
+	       == symbol_get_frag (exp.X_op_symbol)))
     {
       exp.X_op = O_constant;
       exp.X_add_number = (S_GET_VALUE (exp.X_add_symbol)
@@ -3130,19 +3150,19 @@
 #endif /* OBJ_AOUT or OBJ_BOUT */
       S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
       if (exp.X_op != O_constant)
-        symbolP->sy_frag = &zero_address_frag;
+        symbol_set_frag (symbolP, &zero_address_frag);
       break;
 
     case O_register:
       S_SET_SEGMENT (symbolP, reg_section);
       S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
-      symbolP->sy_frag = &zero_address_frag;
+      symbol_set_frag (symbolP, &zero_address_frag);
       break;
 
     case O_symbol:
       if (S_GET_SEGMENT (exp.X_add_symbol) == undefined_section
 	  || exp.X_add_number != 0)
-	symbolP->sy_value = exp;
+	symbol_set_value_expression (symbolP, &exp);
       else
 	{
 	  symbolS *s = exp.X_add_symbol;
@@ -3156,7 +3176,7 @@
 #endif /* OBJ_AOUT or OBJ_BOUT */
 	  S_SET_VALUE (symbolP,
 		       exp.X_add_number + S_GET_VALUE (s));
-	  symbolP->sy_frag = s->sy_frag;
+	  symbol_set_frag (symbolP, symbol_get_frag (s));
 	  copy_symbol_attributes (symbolP, s);
 	}
       break;
@@ -3164,7 +3184,7 @@
     default:
       /* The value is some complex expression.
 	 FIXME: Should we set the segment to anything?  */
-      symbolP->sy_value = exp;
+      symbol_set_value_expression (symbolP, &exp);
       break;
     }
 }
@@ -3393,13 +3413,13 @@
   /* Handle a negative bignum.  */
   if (op == O_uminus
       && exp->X_add_number == 0
-      && exp->X_add_symbol->sy_value.X_op == O_big
-      && exp->X_add_symbol->sy_value.X_add_number > 0)
+      && symbol_get_value_expression (exp->X_add_symbol)->X_op == O_big
+      && symbol_get_value_expression (exp->X_add_symbol)->X_add_number > 0)
     {
       int i;
       unsigned long carry;
 
-      exp = &exp->X_add_symbol->sy_value;
+      exp = symbol_get_value_expression (exp->X_add_symbol);
 
       /* Negate the bignum: one's complement each digit and add 1.  */
       carry = 1;
@@ -4207,7 +4227,7 @@
    we don't output for NULL values of P.  It isn't really as critical as
    for "normal" values that this be streamlined.  */
 
-static int
+static inline int
 output_big_sleb128 (p, bignum, size)
      char *p;
      LITTLENUM_TYPE *bignum;
@@ -4253,7 +4273,7 @@
   return p - orig;
 }
 
-static int
+static inline int
 output_big_uleb128 (p, bignum, size)
      char *p;
      LITTLENUM_TYPE *bignum;
@@ -4295,7 +4315,7 @@
   return p - orig;
 }
 
-static inline int
+static int
 output_big_leb128 (p, bignum, size, sign)
      char *p;
      LITTLENUM_TYPE *bignum;
@@ -4388,7 +4408,7 @@
 /*
  *			stringer()
  *
- * We read 0 or more ',' seperated, double-quoted strings.
+ * We read 0 or more ',' separated, double-quoted strings.
  *
  * Caller should have checked need_pass_2 is FALSE because we don't check it.
  */
@@ -4812,7 +4832,7 @@
 /* ARGSUSED */
 void 
 s_include (arg)
-     int arg;
+     int arg ATTRIBUTE_UNUSED;
 {
   char *newbuf;
   char *filename;
@@ -5034,7 +5054,7 @@
 
 void 
 s_ignore (arg)
-     int arg;
+     int arg ATTRIBUTE_UNUSED;
 {
   while (!is_end_of_line[(unsigned char) *input_line_pointer])
     {
diff --git a/gas/read.h b/gas/read.h
index 61e2017..ae3b103 100644
--- a/gas/read.h
+++ b/gas/read.h
@@ -35,11 +35,14 @@
 
 #define	LEX_NAME	(1)	/* may continue a name */
 #define LEX_BEGIN_NAME	(2)	/* may begin a name */
+#define LEX_END_NAME	(4)	/* ends a name */
 
 #define is_name_beginner(c) \
   ( lex_type[(unsigned char) (c)] & LEX_BEGIN_NAME )
 #define is_part_of_name(c) \
   ( lex_type[(unsigned char) (c)] & LEX_NAME       )
+#define is_name_ender(c) \
+  ( lex_type[(unsigned char) (c)] & LEX_END_NAME   )
 
 #ifndef is_a_char
 #define CHAR_MASK	(0xff)
diff --git a/gas/stabs.c b/gas/stabs.c
index db7e1bf..c8d9a0b 100644
--- a/gas/stabs.c
+++ b/gas/stabs.c
@@ -1,5 +1,5 @@
 /* Generic stabs parsing for gas.
-   Copyright (C) 1989, 90, 91, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1989, 90, 91, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
@@ -152,14 +152,14 @@
   if (what == 's' || what == 'n')
     {
       /* Pick up the value from the input line.  */
-      symbol->sy_frag = &zero_address_frag;
+      symbol_set_frag (symbol, &zero_address_frag);
       pseudo_set (symbol);
     }
   else
     {
       /* .stabd sets the name to NULL.  Why?  */
       S_SET_NAME (symbol, NULL);
-      symbol->sy_frag = frag_now;
+      symbol_set_frag (symbol, frag_now);
       S_SET_VALUE (symbol, (valueT) frag_now_fix ());
     }
 
@@ -609,7 +609,7 @@
 
 void
 stabs_generate_asm_endfunc (funcname, startlabname)
-     const char *funcname;
+     const char *funcname ATTRIBUTE_UNUSED;
      const char *startlabname;
 {
   static int label_count;
diff --git a/gas/struc-symbol.h b/gas/struc-symbol.h
index aeb0405..7573566 100644
--- a/gas/struc-symbol.h
+++ b/gas/struc-symbol.h
@@ -1,5 +1,5 @@
 /* struct_symbol.h - Internal symbol structure
-   Copyright (C) 1987, 92, 93, 94, 95, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1987, 92, 93, 94, 95, 98, 1999 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -21,16 +21,16 @@
 #ifndef __struc_symbol_h__
 #define __struc_symbol_h__
 
-#ifdef BFD_ASSEMBLER
-/* The BFD code wants to walk the list in both directions.  */
-#undef  SYMBOLS_NEED_BACKPOINTERS
-#define SYMBOLS_NEED_BACKPOINTERS
-#endif
+/* The information we keep for a symbol.  Note that the symbol table
+   holds pointers both to this and to local_symbol structures.  See
+   below.  */
 
-/* our version of an nlist node */
 struct symbol
 {
-#ifndef BFD_ASSEMBLER
+#ifdef BFD_ASSEMBLER
+  /* BFD symbol */
+  asymbol *bsym;
+#else
   /* The (4-origin) position of sy_name in the symbol table of the object
      file.  This will be 0 for (nameless) .stabd symbols.
 
@@ -42,9 +42,6 @@
 
   /* The 24 bit symbol number.  Symbol numbers start at 0 and are unsigned. */
   long sy_number;
-#else
-  /* BFD symbol */
-  asymbol *bsym;
 #endif
 
   /* The value of the symbol.  */
@@ -91,75 +88,58 @@
 #ifdef TC_SYMFIELD_TYPE
   TC_SYMFIELD_TYPE sy_tc;
 #endif
-
-#ifdef TARGET_SYMBOL_FIELDS
-  TARGET_SYMBOL_FIELDS
-#endif
 };
 
-typedef struct symbol symbolS;
+#ifdef BFD_ASSEMBLER
 
-#ifndef WORKING_DOT_WORD
-struct broken_word
+/* A pointer in the symbol may point to either a complete symbol
+   (struct symbol above) or to a local symbol (struct local_symbol
+   defined here).  The symbol code can detect the case by examining
+   the first field.  It is always NULL for a local symbol.
+
+   We do this because we ordinarily only need a small amount of
+   information for a local symbol.  The symbol table takes up a lot of
+   space, and storing less information for a local symbol can make a
+   big difference in assembler memory usage when assembling a large
+   file.  */
+
+struct local_symbol
+{
+  /* This pointer is always NULL to indicate that this is a local
+     symbol.  */
+  asymbol *lsy_marker;
+
+  /* The symbol section.  This also serves as a flag.  If this is
+     reg_section, then this symbol has been converted into a regular
+     symbol, and sy_sym points to it.  */
+  segT lsy_section;
+
+  /* The symbol name.  */
+  const char *lsy_name;
+
+  /* The symbol frag or the real symbol, depending upon the value in
+     sy_section.  If the symbol has been fully resolved, lsy_frag is
+     set to NULL.  */
+  union
   {
-    /* Linked list -- one of these structures per ".word x-y+C"
-       expression.  */
-    struct broken_word *next_broken_word;
-    /* Segment and subsegment for broken word.  */
-    segT seg;
-    subsegT subseg;
-    /* Which frag is this broken word in?  */
-    fragS *frag;
-    /* Where in the frag is it?  */
-    char *word_goes_here;
-    /* Where to add the break.  */
-    fragS *dispfrag;		/* where to add the break */
-    /* Operands of expression.  */
-    symbolS *add;
-    symbolS *sub;
-    offsetT addnum;
+    fragS *lsy_frag;
+    symbolS *lsy_sym;
+  } u;
 
-    int added;			/* nasty thing happend yet? */
-    /* 1: added and has a long-jump */
-    /* 2: added but uses someone elses long-jump */
+  /* The offset within the frag.  */
+  valueT lsy_offset;
+};
 
-    /* Pointer to broken_word with a similar long-jump.  */
-    struct broken_word *use_jump;
-  };
-extern struct broken_word *broken_words;
-#endif /* ndef WORKING_DOT_WORD */
+#define local_symbol_converted_p(l) ((l)->lsy_section == reg_section)
+#define local_symbol_mark_converted(l) ((l)->lsy_section = reg_section)
+#define local_symbol_resolved_p(l) ((l)->u.lsy_frag == NULL)
+#define local_symbol_mark_resolved(l) ((l)->u.lsy_frag = NULL)
+#define local_symbol_get_frag(l) ((l)->u.lsy_frag)
+#define local_symbol_set_frag(l, f) ((l)->u.lsy_frag = (f))
+#define local_symbol_get_real_symbol(l) ((l)->u.lsy_sym)
+#define local_symbol_set_real_symbol(l, s) ((l)->u.lsy_sym = (s))
 
-/*
- * Current means for getting from symbols to segments and vice verse.
- * This will change for infinite-segments support (e.g. COFF).
- */
-extern const segT N_TYPE_seg[];	/* subseg.c */
-
-#define	SEGMENT_TO_SYMBOL_TYPE(seg)  ( seg_N_TYPE [(int) (seg)] )
-extern const short seg_N_TYPE[];/* subseg.c */
-
-#define	N_REGISTER	30	/* Fake N_TYPE value for SEG_REGISTER */
-
-void symbol_clear_list_pointers PARAMS ((symbolS * symbolP));
-
-#ifdef SYMBOLS_NEED_BACKPOINTERS
-
-void symbol_insert PARAMS ((symbolS * addme, symbolS * target,
-			    symbolS ** rootP, symbolS ** lastP));
-void symbol_remove PARAMS ((symbolS * symbolP, symbolS ** rootP,
-			    symbolS ** lastP));
-
-#define symbol_previous(s) ((s)->sy_previous)
-
-#endif /* SYMBOLS_NEED_BACKPOINTERS */
-
-void verify_symbol_chain PARAMS ((symbolS * rootP, symbolS * lastP));
-void verify_symbol_chain_2 PARAMS ((symbolS * symP));
-
-void symbol_append PARAMS ((symbolS * addme, symbolS * target,
-			    symbolS ** rootP, symbolS ** lastP));
-
-#define symbol_next(s)	((s)->sy_next)
+#endif /* BFD_ASSEMBLER */
 
 #endif /* __struc_symbol_h__ */
 
diff --git a/gas/subsegs.c b/gas/subsegs.c
index bdf2868..b2bf70d 100644
--- a/gas/subsegs.c
+++ b/gas/subsegs.c
@@ -1,5 +1,5 @@
 /* subsegs.c - subsegments -
-   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 1997
+   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -547,7 +547,7 @@
 	  if (S_GET_SEGMENT (s) == undefined_section)
 	    {
 	      S_SET_SEGMENT (s, sec);
-	      s->sy_frag = &zero_address_frag;
+	      symbol_set_frag (s, &zero_address_frag);
 	    }
 	}
     }
@@ -556,7 +556,7 @@
 
   /* Use the BFD section symbol, if possible.  */
   if (obj_sec_sym_ok_for_reloc (sec))
-    s->bsym = sec->symbol;
+    symbol_set_bfdsym (s, sec->symbol);
 
   seginfo->sym = s;
   return s;
@@ -564,6 +564,51 @@
 
 #endif /* BFD_ASSEMBLER */
 
+/* Return whether the specified segment is thought to hold text.  */
+
+#ifndef BFD_ASSEMBLER
+const char * const nontext_section_names[] =
+{
+  ".eh_frame",
+  ".gcc_except_table",
+#ifdef OBJ_COFF
+#ifndef COFF_LONG_SECTION_NAMES
+  ".eh_fram",
+  ".gcc_exc",
+#endif
+#endif
+  NULL
+};
+#endif /* ! BFD_ASSEMBLER */
+
+int
+subseg_text_p (sec)
+     segT sec;
+{
+#ifdef BFD_ASSEMBLER
+  return (bfd_get_section_flags (stdoutput, sec) & SEC_CODE) != 0;
+#else /* ! BFD_ASSEMBLER */
+  const char * const *p;
+
+  if (sec == data_section || sec == bss_section)
+    return 0;
+
+  for (p = nontext_section_names; *p != NULL; ++p)
+    {
+      if (strcmp (segment_name (sec), *p) == 0)
+	return 0;
+
+#ifdef obj_segment_name
+      if (strcmp (obj_segment_name (sec), *p) == 0)
+	return 0;
+#endif
+    }
+
+  return 1;
+
+#endif /* ! BFD_ASSEMBLER */
+}
+
 void
 subsegs_print_statistics (file)
      FILE *file;
diff --git a/gas/symbols.c b/gas/symbols.c
index a1cde6a..07b80ea 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -1,5 +1,5 @@
 /* symbols.c -symbol table-
-   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -28,6 +28,8 @@
 #include "obstack.h"		/* For "symbols.h" */
 #include "subsegs.h"
 
+#include "struc-symbol.h"
+
 /* This is non-zero if symbols are case sensitive, which is the
    default.  */
 int symbols_case_sensitive = 1;
@@ -39,6 +41,9 @@
 /* symbol-name => struct symbol pointer */
 static struct hash_control *sy_hash;
 
+/* Table of local symbols.  */
+static struct hash_control *local_hash;
+
 /* Below are commented in "symbols.h". */
 symbolS *symbol_rootP;
 symbolS *symbol_lastP;
@@ -93,6 +98,41 @@
   return symbolP;
 }
 
+/* Save a symbol name on a permanent obstack, and convert it according
+   to the object file format.  */
+
+static char *
+save_symbol_name (name)
+     const char *name;
+{
+  unsigned int name_length;
+  char *ret;
+
+  name_length = strlen (name) + 1;	/* +1 for \0 */
+  obstack_grow (&notes, name, name_length);
+  ret = obstack_finish (&notes);
+
+#ifdef STRIP_UNDERSCORE
+  if (ret[0] == '_')
+    ++ret;
+#endif
+
+#ifdef tc_canonicalize_symbol_name
+  ret = tc_canonicalize_symbol_name (ret);
+#endif
+
+  if (! symbols_case_sensitive)
+    {
+      unsigned char *s;
+
+      for (s = (unsigned char *) ret; *s != '\0'; s++)
+	if (islower (*s))
+	  *s = toupper (*s);
+    }
+
+  return ret;
+}
+
 symbolS *
 symbol_create (name, segment, valu, frag)
      const char *name;		/* It is copied, the caller can destroy/modify */
@@ -100,31 +140,10 @@
      valueT valu;		/* Symbol value */
      fragS *frag;		/* Associated fragment */
 {
-  unsigned int name_length;
   char *preserved_copy_of_name;
   symbolS *symbolP;
 
-  name_length = strlen (name) + 1;	/* +1 for \0 */
-  obstack_grow (&notes, name, name_length);
-  preserved_copy_of_name = obstack_finish (&notes);
-#ifdef STRIP_UNDERSCORE
-  if (preserved_copy_of_name[0] == '_')
-    preserved_copy_of_name++;
-#endif
-
-#ifdef tc_canonicalize_symbol_name
-  preserved_copy_of_name =
-    tc_canonicalize_symbol_name (preserved_copy_of_name);
-#endif
-
-  if (! symbols_case_sensitive)
-    {
-      unsigned char *s;
-
-      for (s = (unsigned char *) preserved_copy_of_name; *s != '\0'; s++)
-	if (islower (*s))
-	  *s = toupper (*s);
-    }
+  preserved_copy_of_name = save_symbol_name (name);
 
   symbolP = (symbolS *) obstack_alloc (&notes, sizeof (symbolS));
 
@@ -158,6 +177,101 @@
   return symbolP;
 }
 
+#ifdef BFD_ASSEMBLER
+
+/* Local symbol support.  If we can get away with it, we keep only a
+   small amount of information for local symbols.  */
+
+static struct local_symbol *local_symbol_make PARAMS ((const char *, segT,
+						       valueT, fragS *));
+static symbolS *local_symbol_convert PARAMS ((struct local_symbol *));
+
+/* Used for statistics.  */
+
+static unsigned long local_symbol_count;
+static unsigned long local_symbol_conversion_count;
+
+/* This macro is called with a symbol argument passed by reference.
+   It returns whether this is a local symbol.  If necessary, it
+   changes its argument to the real symbol.  */
+
+#define LOCAL_SYMBOL_CHECK(s)						\
+  (s->bsym == NULL							\
+   ? (local_symbol_converted_p ((struct local_symbol *) s)		\
+      ? (s = local_symbol_get_real_symbol ((struct local_symbol *) s),	\
+	 0)								\
+      : 1)								\
+   : 0)
+
+/* Create a local symbol and insert it into the local hash table.  */
+
+static struct local_symbol *
+local_symbol_make (name, section, offset, frag)
+     const char *name;
+     segT section;
+     valueT offset;
+     fragS *frag;
+{
+  char *name_copy;
+  struct local_symbol *ret;
+
+  ++local_symbol_count;
+
+  name_copy = save_symbol_name (name);
+
+  ret = (struct local_symbol *) obstack_alloc (&notes, sizeof *ret);
+  ret->lsy_marker = NULL;
+  ret->lsy_name = name_copy;
+  ret->lsy_section = section;
+  local_symbol_set_frag (ret, frag);
+  ret->lsy_offset = offset;
+
+  hash_jam (local_hash, name_copy, (PTR) ret);
+
+  return ret;
+}
+
+/* Convert a local symbol into a real symbol.  Note that we do not
+   reclaim the space used by the local symbol.  */
+
+static symbolS *
+local_symbol_convert (locsym)
+     struct local_symbol *locsym;
+{
+  symbolS *ret;
+
+  assert (locsym->lsy_marker == NULL);
+  if (local_symbol_converted_p (locsym))
+    return local_symbol_get_real_symbol (locsym);
+
+  ++local_symbol_conversion_count;
+
+  ret = symbol_new (locsym->lsy_name, locsym->lsy_section, locsym->lsy_offset,
+		    local_symbol_get_frag (locsym));
+
+  if (local_symbol_resolved_p (locsym))
+    ret->sy_resolved = 1;
+
+  /* Local symbols are always either defined or used.  */
+  ret->sy_used = 1;
+
+  symbol_table_insert (ret);
+
+  local_symbol_mark_converted (locsym);
+  local_symbol_set_real_symbol (locsym, ret);
+
+  hash_jam (local_hash, locsym->lsy_name, NULL);
+
+  return ret;
+}
+
+#else /* ! BFD_ASSEMBLER */
+
+#define LOCAL_SYMBOL_CHECK(s) 0
+#define local_symbol_convert(s) ((symbolS *) s)
+
+#endif /* ! BFD_ASSEMBLER */
+
 
 /*
  *			colon()
@@ -238,7 +352,26 @@
       /*
        *	Now check for undefined symbols
        */
-      if (!S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP))
+      if (LOCAL_SYMBOL_CHECK (symbolP))
+	{
+#ifdef BFD_ASSEMBLER
+	  struct local_symbol *locsym = (struct local_symbol *) symbolP;
+
+	  if (locsym->lsy_section != undefined_section
+	      && (local_symbol_get_frag (locsym) != frag_now
+		  || locsym->lsy_section != now_seg
+		  || locsym->lsy_offset != frag_now_fix ()))
+	    {
+	      as_bad (_("Symbol %s already defined."), sym_name);
+	      return symbolP;
+	    }
+
+	  locsym->lsy_section = now_seg;
+	  local_symbol_set_frag (locsym, frag_now);
+	  locsym->lsy_offset = frag_now_fix ();
+#endif
+	}
+      else if (!S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP))
 	{
 	  if (S_GET_VALUE (symbolP) == 0)
 	    {
@@ -329,6 +462,14 @@
 	}			/* if this symbol is not yet defined */
 
     }
+#ifdef BFD_ASSEMBLER
+  else if (! flag_keep_locals && bfd_is_local_label_name (stdoutput, sym_name))
+    {
+      symbolP = (symbolS *) local_symbol_make (sym_name, now_seg,
+					       (valueT) frag_now_fix (),
+					       frag_now);
+    }
+#endif /* BFD_ASSEMBLER */
   else
     {
       symbolP = symbol_new (sym_name, now_seg, (valueT) frag_now_fix (),
@@ -344,6 +485,8 @@
     {
       /* This symbol is actually being defined within an MRI common
          section.  This requires special handling.  */
+      if (LOCAL_SYMBOL_CHECK (symbolP))
+	symbolP = local_symbol_convert ((struct local_symbol *) symbolP);
       symbolP->sy_value.X_op = O_symbol;
       symbolP->sy_value.X_add_symbol = mri_common_symbol;
       symbolP->sy_value.X_add_number = S_GET_VALUE (mri_common_symbol);
@@ -379,6 +522,16 @@
   know (symbolP);
   know (S_GET_NAME (symbolP));
 
+  if (LOCAL_SYMBOL_CHECK (symbolP))
+    {
+      error_string = hash_jam (local_hash, S_GET_NAME (symbolP),
+			       (PTR) symbolP);
+      if (error_string != NULL)
+	as_fatal (_("Inserting \"%s\" into symbol table failed: %s"),
+		  S_GET_NAME (symbolP), error_string);
+      return;
+    }
+
   if ((error_string = hash_jam (sy_hash, S_GET_NAME (symbolP), (PTR) symbolP)))
     {
       as_fatal (_("Inserting \"%s\" into symbol table failed: %s"),
@@ -402,6 +555,20 @@
 
   if (symbolP == NULL)
     {
+#ifdef BFD_ASSEMBLER
+      if (! flag_keep_locals && bfd_is_local_label_name (stdoutput, name))
+	{
+	  symbolP = md_undefined_symbol ((char *) name);
+	  if (symbolP != NULL)
+	    return symbolP;
+
+	  symbolP = (symbolS *) local_symbol_make (name, undefined_section,
+						   (valueT) 0,
+						   &zero_address_frag);
+	  return symbolP;
+	}
+#endif
+
       symbolP = symbol_make (name);
 
       symbol_table_insert (symbolP);
@@ -456,25 +623,42 @@
 #ifdef tc_canonicalize_symbol_name
   {
     char *copy;
+    size_t len = strlen (name) + 1;
 
-    copy = (char *) alloca (strlen (name) + 1);
-    strcpy (copy, name);
+    copy = (char *) alloca (len);
+    memcpy (copy, name, len);
     name = tc_canonicalize_symbol_name (copy);
   }
 #endif
 
   if (! symbols_case_sensitive)
     {
-      unsigned char *copy;
+      char *copy;
+      const char *orig;
+      unsigned char c;
 
-      copy = (unsigned char *) alloca (strlen (name) + 1);
-      strcpy (copy, name);
-      name = (const char *) copy;
-      for (; *copy != '\0'; copy++)
-	if (islower (*copy))
-	  *copy = toupper (*copy);
+      orig = name;
+      name = copy = (char *) alloca (strlen (name) + 1);
+
+      while ((c = *orig++) != '\0')
+	{
+	  if (islower (c))
+	    c = toupper (c);
+	  *copy++ = c;
+	}
+      *copy = '\0';
     }
 
+#ifdef BFD_ASSEMBLER
+  {
+    struct local_symbol *locsym;
+
+    locsym = (struct local_symbol *) hash_find (local_hash, name);
+    if (locsym != NULL)
+      return (symbolS *) locsym;
+  }
+#endif
+
   return ((symbolS *) hash_find (sy_hash, name));
 }
 
@@ -494,6 +678,11 @@
      symbolS **rootPP;
      symbolS **lastPP;
 {
+  if (LOCAL_SYMBOL_CHECK (addme))
+    abort ();
+  if (target != NULL && LOCAL_SYMBOL_CHECK (target))
+    abort ();
+
   if (target == NULL)
     {
       know (*rootPP == NULL);
@@ -534,6 +723,8 @@
 symbol_clear_list_pointers (symbolP)
      symbolS *symbolP;
 {
+  if (LOCAL_SYMBOL_CHECK (symbolP))
+    abort ();
   symbolP->sy_next = NULL;
 #ifdef SYMBOLS_NEED_BACKPOINTERS
   symbolP->sy_previous = NULL;
@@ -548,6 +739,9 @@
      symbolS **rootPP;
      symbolS **lastPP;
 {
+  if (LOCAL_SYMBOL_CHECK (symbolP))
+    abort ();
+
   if (symbolP == *rootPP)
     {
       *rootPP = symbolP->sy_next;
@@ -577,8 +771,13 @@
      symbolS *addme;
      symbolS *target;
      symbolS **rootPP;
-     symbolS **lastPP;
+     symbolS **lastPP ATTRIBUTE_UNUSED;
 {
+  if (LOCAL_SYMBOL_CHECK (addme))
+    abort ();
+  if (LOCAL_SYMBOL_CHECK (target))
+    abort ();
+
   if (target->sy_previous != NULL)
     {
       target->sy_previous->sy_next = addme;
@@ -610,6 +809,9 @@
 
   for (; symbol_next (symbolP) != NULL; symbolP = symbol_next (symbolP))
     {
+#ifdef BFD_ASSEMBLER
+      assert (symbolP->bsym != NULL);
+#endif
 #ifdef SYMBOLS_NEED_BACKPOINTERS
       assert (symbolP->sy_next->sy_previous == symbolP);
 #else
@@ -648,6 +850,27 @@
   valueT final_val;
   segT final_seg;
 
+#ifdef BFD_ASSEMBLER
+  if (LOCAL_SYMBOL_CHECK (symp))
+    {
+      struct local_symbol *locsym = (struct local_symbol *) symp;
+
+      if (local_symbol_resolved_p (locsym))
+	return locsym->lsy_offset;
+
+      final_val = (local_symbol_get_frag (locsym)->fr_address
+		   + locsym->lsy_offset);
+
+      if (finalize)
+	{
+	  locsym->lsy_offset = final_val;
+	  local_symbol_mark_resolved (locsym);
+	}
+
+      return final_val;
+    }
+#endif
+
   if (symp->sy_resolved)
     {
       if (symp->sy_value.X_op == O_constant)
@@ -708,12 +931,17 @@
 	      /* This is a symbol inside an MRI common section.  The
                  relocation routines are going to handle it specially.
                  Don't change the value.  */
-	      resolved = add_symbol->sy_resolved;
+	      resolved = symbol_resolved_p (add_symbol);
 	      break;
 	    }
 
 	  if (finalize && final_val == 0)
-	    copy_symbol_attributes (symp, add_symbol);
+	    {
+	      if (LOCAL_SYMBOL_CHECK (add_symbol))
+		add_symbol = local_symbol_convert ((struct local_symbol *)
+						   add_symbol);
+	      copy_symbol_attributes (symp, add_symbol);
+	    }
 
 	  /* If we have equated this symbol to an undefined symbol, we
              keep X_op set to O_symbol, and we don't change
@@ -731,7 +959,7 @@
 		  symp->sy_value.X_add_number = final_val;
 		}
 	      final_val = 0;
-	      resolved = add_symbol->sy_resolved;
+	      resolved = symbol_resolved_p (add_symbol);
 	      goto exit_dont_set_value;
 	    }
 	  else
@@ -741,7 +969,7 @@
 		final_seg = S_GET_SEGMENT (add_symbol);
 	    }
 
-	  resolved = add_symbol->sy_resolved;
+	  resolved = symbol_resolved_p (add_symbol);
 	  break;
 
 	case O_uminus:
@@ -760,7 +988,7 @@
 	  if (final_seg == expr_section || final_seg == undefined_section)
 	    final_seg = absolute_section;
 
-	  resolved = add_symbol->sy_resolved;
+	  resolved = symbol_resolved_p (add_symbol);
 	  break;
 
 	case O_multiply:
@@ -820,8 +1048,11 @@
 	     expressions, such as IEEE-695.  */
 	  /* Don't emit messages unless we're finalizing the symbol value,
 	     otherwise we may get the same message multiple times.  */
-	  if ((seg_left != absolute_section || seg_right != absolute_section)
-	      && (op != O_subtract || seg_left != seg_right)
+	  if ((seg_left != absolute_section
+	       || seg_right != absolute_section)
+	      && (op != O_subtract
+		  || seg_left != seg_right
+		  || seg_left == undefined_section)
 	      && finalize)
 	    {
 	      char *file;
@@ -905,7 +1136,8 @@
 	  final_val += symp->sy_frag->fr_address + left;
 	  if (final_seg == expr_section || final_seg == undefined_section)
 	    final_seg = absolute_section;
-	  resolved = (add_symbol->sy_resolved && op_symbol->sy_resolved);
+	  resolved = (symbol_resolved_p (add_symbol)
+		      && symbol_resolved_p (op_symbol));
    	  break;
 
 	case O_register:
@@ -950,6 +1182,33 @@
   return final_val;
 }
 
+#ifdef BFD_ASSEMBLER
+
+static void resolve_local_symbol PARAMS ((const char *, PTR));
+
+/* A static function passed to hash_traverse.  */
+
+static void
+resolve_local_symbol (key, value)
+     const char *key ATTRIBUTE_UNUSED;
+     PTR value;
+{
+  if (value != NULL)
+    resolve_symbol_value (value, 1);
+}
+
+#endif
+
+/* Resolve all local symbols.  */
+
+void
+resolve_local_symbol_values ()
+{
+#ifdef BFD_ASSEMBLER
+  hash_traverse (local_hash, resolve_local_symbol);
+#endif
+}
+
 /* Dollar labels look like a number followed by a dollar sign.  Eg, "42$".
    They are *really* local.  That is, they go out of scope whenever we see a
    label that isn't local.  Also, like fb labels, there can be multiple
@@ -1073,6 +1332,9 @@
   know (n >= 0);
   know (augend == 0 || augend == 1);
   p = symbol_name_build;
+#ifdef LOCAL_LABEL_PREFIX
+  *p++ = LOCAL_LABEL_PREFIX;
+#endif
   *p++ = 'L';
 
   /* Next code just does sprintf( {}, "%d", n); */
@@ -1315,6 +1577,11 @@
 S_GET_VALUE (s)
      symbolS *s;
 {
+#ifdef BFD_ASSEMBLER
+  if (LOCAL_SYMBOL_CHECK (s))
+    return ((struct local_symbol *) s)->lsy_offset;
+#endif
+
   if (!s->sy_resolved && s->sy_value.X_op != O_constant)
     resolve_symbol_value (s, 1);
   if (s->sy_value.X_op != O_constant)
@@ -1344,6 +1611,14 @@
      symbolS *s;
      valueT val;
 {
+#ifdef BFD_ASSEMBLER
+  if (LOCAL_SYMBOL_CHECK (s))
+    {
+      ((struct local_symbol *) s)->lsy_offset = val;
+      return;
+    }
+#endif
+
   s->sy_value.X_op = O_constant;
   s->sy_value.X_add_number = (offsetT) val;
   s->sy_value.X_unsigned = 0;
@@ -1353,6 +1628,11 @@
 copy_symbol_attributes (dest, src)
      symbolS *dest, *src;
 {
+  if (LOCAL_SYMBOL_CHECK (dest))
+    dest = local_symbol_convert ((struct local_symbol *) dest);
+  if (LOCAL_SYMBOL_CHECK (src))
+    src = local_symbol_convert ((struct local_symbol *) src);
+
 #ifdef BFD_ASSEMBLER
   /* In an expression, transfer the settings of these flags.
      The user can override later, of course.  */
@@ -1371,7 +1651,12 @@
 S_IS_FUNCTION (s)
      symbolS *s;
 {
-  flagword flags = s->bsym->flags;
+  flagword flags;
+
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 0;
+
+  flags = s->bsym->flags;
 
   return (flags & BSF_FUNCTION) != 0;
 }
@@ -1380,7 +1665,12 @@
 S_IS_EXTERNAL (s)
      symbolS *s;
 {
-  flagword flags = s->bsym->flags;
+  flagword flags;
+
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 0;
+
+  flags = s->bsym->flags;
 
   /* sanity check */
   if ((flags & BSF_LOCAL) && (flags & BSF_GLOBAL))
@@ -1393,6 +1683,8 @@
 S_IS_WEAK (s)
      symbolS *s;
 {
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 0;
   return (s->bsym->flags & BSF_WEAK) != 0;
 }
 
@@ -1400,6 +1692,8 @@
 S_IS_COMMON (s)
      symbolS *s;
 {
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 0;
   return bfd_is_com_section (s->bsym->section);
 }
 
@@ -1407,6 +1701,8 @@
 S_IS_DEFINED (s)
      symbolS *s;
 {
+  if (LOCAL_SYMBOL_CHECK (s))
+    return ((struct local_symbol *) s)->lsy_section != undefined_section;
   return s->bsym->section != undefined_section;
 }
 
@@ -1414,6 +1710,8 @@
 S_IS_DEBUG (s)
      symbolS *s;
 {
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 0;
   if (s->bsym->flags & BSF_DEBUGGING)
     return 1;
   return 0;
@@ -1423,9 +1721,14 @@
 S_IS_LOCAL (s)
      symbolS *s;
 {
-  flagword flags = s->bsym->flags;
+  flagword flags;
   const char *name;
 
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 1;
+
+  flags = s->bsym->flags;
+
   /* sanity check */
   if ((flags & BSF_LOCAL) && (flags & BSF_GLOBAL))
     abort ();
@@ -1468,6 +1771,8 @@
 S_GET_NAME (s)
      symbolS *s;
 {
+  if (LOCAL_SYMBOL_CHECK (s))
+    return ((struct local_symbol *) s)->lsy_name;
   return s->bsym->name;
 }
 
@@ -1475,6 +1780,8 @@
 S_GET_SEGMENT (s)
      symbolS *s;
 {
+  if (LOCAL_SYMBOL_CHECK (s))
+    return ((struct local_symbol *) s)->lsy_section;
   return s->bsym->section;
 }
 
@@ -1487,6 +1794,17 @@
      faults assigning back to const global symbols such as *ABS*, but it
      shouldn't happen anyway.  */
 
+  if (LOCAL_SYMBOL_CHECK (s))
+    {
+      if (seg == reg_section)
+	s = local_symbol_convert ((struct local_symbol *) s);
+      else
+	{
+	  ((struct local_symbol *) s)->lsy_section = seg;
+	  return;
+	}
+    }
+
   if (s->bsym->flags & BSF_SECTION_SYM)
     {
       if (s->bsym->section != seg)
@@ -1500,6 +1818,8 @@
 S_SET_EXTERNAL (s)
      symbolS *s;
 {
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
   if ((s->bsym->flags & BSF_WEAK) != 0)
     {
       /* Let .weak override .global.  */
@@ -1513,6 +1833,8 @@
 S_CLEAR_EXTERNAL (s)
      symbolS *s;
 {
+  if (LOCAL_SYMBOL_CHECK (s))
+    return;
   if ((s->bsym->flags & BSF_WEAK) != 0)
     {
       /* Let .weak override.  */
@@ -1526,6 +1848,8 @@
 S_SET_WEAK (s)
      symbolS *s;
 {
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
   s->bsym->flags |= BSF_WEAK;
   s->bsym->flags &= ~(BSF_GLOBAL|BSF_LOCAL);
 }
@@ -1535,16 +1859,383 @@
      symbolS *s;
      char *name;
 {
+  if (LOCAL_SYMBOL_CHECK (s))
+    {
+      ((struct local_symbol *) s)->lsy_name = name;
+      return;
+    }
   s->bsym->name = name;
 }
 #endif /* BFD_ASSEMBLER */
 
+#ifdef SYMBOLS_NEED_BACKPOINTERS
+
+/* Return the previous symbol in a chain.  */
+
+symbolS *
+symbol_previous (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    abort ();
+  return s->sy_previous;
+}
+
+#endif /* SYMBOLS_NEED_BACKPOINTERS */
+
+/* Return the next symbol in a chain.  */
+
+symbolS *
+symbol_next (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    abort ();
+  return s->sy_next;
+}
+
+/* Return a pointer to the value of a symbol as an expression.  */
+
+expressionS *
+symbol_get_value_expression (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  return &s->sy_value;
+}
+
+/* Set the value of a symbol to an expression.  */
+
+void
+symbol_set_value_expression (s, exp)
+     symbolS *s;
+     const expressionS *exp;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  s->sy_value = *exp;
+}
+
+/* Set the frag of a symbol.  */
+
+void
+symbol_set_frag (s, f)
+     symbolS *s;
+     fragS *f;
+{
+#ifdef BFD_ASSEMBLER
+  if (LOCAL_SYMBOL_CHECK (s))
+    {
+      local_symbol_set_frag ((struct local_symbol *) s, f);
+      return;
+    }
+#endif
+  s->sy_frag = f;
+}
+
+/* Return the frag of a symbol.  */
+
+fragS *
+symbol_get_frag (s)
+     symbolS *s;
+{
+#ifdef BFD_ASSEMBLER
+  if (LOCAL_SYMBOL_CHECK (s))
+    return local_symbol_get_frag ((struct local_symbol *) s);
+#endif
+  return s->sy_frag;
+}
+
+/* Mark a symbol as having been used.  */
+
+void
+symbol_mark_used (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return;
+  s->sy_used = 1;
+}
+
+/* Clear the mark of whether a symbol has been used.  */
+
+void
+symbol_clear_used (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  s->sy_used = 0;
+}
+
+/* Return whether a symbol has been used.  */
+
+int
+symbol_used_p (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 1;
+  return s->sy_used;
+}
+
+/* Mark a symbol as having been used in a reloc.  */
+
+void
+symbol_mark_used_in_reloc (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  s->sy_used_in_reloc = 1;
+}
+
+/* Clear the mark of whether a symbol has been used in a reloc.  */
+
+void
+symbol_clear_used_in_reloc (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return;
+  s->sy_used_in_reloc = 0;
+}
+
+/* Return whether a symbol has been used in a reloc.  */
+
+int
+symbol_used_in_reloc_p (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 0;
+  return s->sy_used_in_reloc;
+}
+
+/* Mark a symbol as an MRI common symbol.  */
+
+void
+symbol_mark_mri_common (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  s->sy_mri_common = 1;
+}
+
+/* Clear the mark of whether a symbol is an MRI common symbol.  */
+
+void
+symbol_clear_mri_common (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return;
+  s->sy_mri_common = 0;
+}
+
+/* Return whether a symbol is an MRI common symbol.  */
+
+int
+symbol_mri_common_p (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 0;
+  return s->sy_mri_common;
+}
+
+/* Mark a symbol as having been written.  */
+
+void
+symbol_mark_written (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return;
+  s->written = 1;
+}
+
+/* Clear the mark of whether a symbol has been written.  */
+
+void
+symbol_clear_written (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return;
+  s->written = 0;
+}
+
+/* Return whether a symbol has been written.  */
+
+int
+symbol_written_p (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 0;
+  return s->written;
+}
+
+/* Mark a symbol has having been resolved.  */
+
+void
+symbol_mark_resolved (s)
+     symbolS *s;
+{
+#ifdef BFD_ASSEMBLER
+  if (LOCAL_SYMBOL_CHECK (s))
+    {
+      local_symbol_mark_resolved ((struct local_symbol *) s);
+      return;
+    }
+#endif
+  s->sy_resolved = 1;
+}
+
+/* Return whether a symbol has been resolved.  */
+
+int
+symbol_resolved_p (s)
+     symbolS *s;
+{
+#ifdef BFD_ASSEMBLER
+  if (LOCAL_SYMBOL_CHECK (s))
+    return local_symbol_resolved_p ((struct local_symbol *) s);
+#endif
+  return s->sy_resolved;
+}
+
+/* Return whether a symbol is a section symbol.  */
+
+int
+symbol_section_p (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 0;
+#ifdef BFD_ASSEMBLER
+  return (s->bsym->flags & BSF_SECTION_SYM) != 0;
+#else
+  /* FIXME */
+  return 0;
+#endif
+}
+
+/* Return whether a symbol is equated to another symbol.  */
+
+int
+symbol_equated_p (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 0;
+  return s->sy_value.X_op == O_symbol;
+}
+
+/* Return whether a symbol has a constant value.  */
+
+int
+symbol_constant_p (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    return 1;
+  return s->sy_value.X_op == O_constant;
+}
+
+#ifdef BFD_ASSEMBLER
+
+/* Return the BFD symbol for a symbol.  */
+
+asymbol *
+symbol_get_bfdsym (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  return s->bsym;
+}
+
+/* Set the BFD symbol for a symbol.  */
+
+void
+symbol_set_bfdsym (s, bsym)
+     symbolS *s;
+     asymbol *bsym;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  s->bsym = bsym;
+}
+
+#endif /* BFD_ASSEMBLER */
+
+#ifdef OBJ_SYMFIELD_TYPE
+
+/* Get a pointer to the object format information for a symbol.  */
+
+OBJ_SYMFIELD_TYPE *
+symbol_get_obj (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  return &s->sy_obj;
+}
+
+/* Set the object format information for a symbol.  */
+
+void
+symbol_set_obj (s, o)
+     symbolS *s;
+     OBJ_SYMFIELD_TYPE *o;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  s->sy_obj = *o;
+}
+
+#endif /* OBJ_SYMFIELD_TYPE */
+
+#ifdef TC_SYMFIELD_TYPE
+
+/* Get a pointer to the processor information for a symbol.  */
+
+TC_SYMFIELD_TYPE *
+symbol_get_tc (s)
+     symbolS *s;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  return &s->sy_tc;
+}
+
+/* Set the processor information for a symbol.  */
+
+void
+symbol_set_tc (s, o)
+     symbolS *s;
+     TC_SYMFIELD_TYPE *o;
+{
+  if (LOCAL_SYMBOL_CHECK (s))
+    s = local_symbol_convert ((struct local_symbol *) s);
+  s->sy_tc = *o;
+}
+
+#endif /* TC_SYMFIELD_TYPE */
+
 void
 symbol_begin ()
 {
   symbol_lastP = NULL;
   symbol_rootP = NULL;		/* In case we have 0 symbols (!!) */
   sy_hash = hash_new ();
+#ifdef BFD_ASSEMBLER
+  local_hash = hash_new ();
+#endif
 
   memset ((char *) (&abs_symbol), '\0', sizeof (abs_symbol));
 #ifdef BFD_ASSEMBLER
@@ -1562,6 +2253,7 @@
     fb_label_init ();
 }
 
+
 
 int indent_level;
 
@@ -1588,28 +2280,44 @@
   if (!name || !name[0])
     name = "(unnamed)";
   fprintf (file, "sym %lx %s", (unsigned long) sym, name);
-  if (sym->sy_frag != &zero_address_frag)
-    fprintf (file, " frag %lx", (long) sym->sy_frag);
-  if (sym->written)
-    fprintf (file, " written");
-  if (sym->sy_resolved)
-    fprintf (file, " resolved");
-  else if (sym->sy_resolving)
-    fprintf (file, " resolving");
-  if (sym->sy_used_in_reloc)
-    fprintf (file, " used-in-reloc");
-  if (sym->sy_used)
-    fprintf (file, " used");
-  if (S_IS_LOCAL (sym))
-    fprintf (file, " local");
-  if (S_IS_EXTERN (sym))
-    fprintf (file, " extern");
-  if (S_IS_DEBUG (sym))
-    fprintf (file, " debug");
-  if (S_IS_DEFINED (sym))
-    fprintf (file, " defined");
+
+  if (LOCAL_SYMBOL_CHECK (sym))
+    {
+#ifdef BFD_ASSEMBLER
+      struct local_symbol *locsym = (struct local_symbol *) sym;
+      if (local_symbol_get_frag (locsym) != &zero_address_frag
+	  && local_symbol_get_frag (locsym) != NULL)
+	fprintf (file, " frag %lx", (long) local_symbol_get_frag (locsym));
+      if (local_symbol_resolved_p (locsym))
+	fprintf (file, " resolved");
+      fprintf (file, " local");
+#endif
+    }
+  else
+    {
+      if (sym->sy_frag != &zero_address_frag)
+	fprintf (file, " frag %lx", (long) sym->sy_frag);
+      if (sym->written)
+	fprintf (file, " written");
+      if (sym->sy_resolved)
+	fprintf (file, " resolved");
+      else if (sym->sy_resolving)
+	fprintf (file, " resolving");
+      if (sym->sy_used_in_reloc)
+	fprintf (file, " used-in-reloc");
+      if (sym->sy_used)
+	fprintf (file, " used");
+      if (S_IS_LOCAL (sym))
+	fprintf (file, " local");
+      if (S_IS_EXTERN (sym))
+	fprintf (file, " extern");
+      if (S_IS_DEBUG (sym))
+	fprintf (file, " debug");
+      if (S_IS_DEFINED (sym))
+	fprintf (file, " defined");
+    }
   fprintf (file, " %s", segment_name (S_GET_SEGMENT (sym)));
-  if (sym->sy_resolved)
+  if (symbol_resolved_p (sym))
     {
       segT s = S_GET_SEGMENT (sym);
 
@@ -1622,7 +2330,13 @@
     {
       indent_level++;
       fprintf (file, "\n%*s<", indent_level * 4, "");
-      print_expr_1 (file, &sym->sy_value);
+#ifdef BFD_ASSEMBLER
+      if (LOCAL_SYMBOL_CHECK (sym))
+	fprintf (file, "constant %lx",
+		 (long) ((struct local_symbol *) sym)->lsy_offset);
+      else
+#endif
+	print_expr_1 (file, &sym->sy_value);
       fprintf (file, ">");
       indent_level--;
     }
@@ -1780,6 +2494,11 @@
      FILE *file;
 {
   hash_print_statistics (file, "symbol table", sy_hash);
+#ifdef BFD_ASSEMBLER
+  hash_print_statistics (file, "mini local symbol table", local_hash);
+  fprintf (file, "%lu mini local symbols created, %lu converted\n",
+	   local_symbol_count, local_symbol_conversion_count);
+#endif
 }
 
 /* end of symbols.c */
diff --git a/gas/symbols.h b/gas/symbols.h
index c6efbdb..f3b73af 100644
--- a/gas/symbols.h
+++ b/gas/symbols.h
@@ -1,5 +1,6 @@
 /* symbols.h -
-   Copyright (C) 1987, 90, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1987, 90, 92, 93, 94, 95, 97, 1999
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -18,6 +19,18 @@
    Software Foundation, 59 Temple Place - Suite 330, Boston, MA
    02111-1307, USA.  */
 
+#ifdef BFD_ASSEMBLER
+/* The BFD code wants to walk the list in both directions.  */
+#undef  SYMBOLS_NEED_BACKPOINTERS
+#define SYMBOLS_NEED_BACKPOINTERS
+#endif
+
+#ifndef BFD_ASSEMBLER
+/* The non-BFD code expects to be able to manipulate the symbol fields
+   directly.  */
+#include "struc-symbol.h"
+#endif
+
 extern struct obstack notes;	/* eg FixS live here. */
 
 extern struct obstack cond_obstack;	/* this is where we track .ifdef/.endif
@@ -49,6 +62,7 @@
 void symbol_print_statistics PARAMS ((FILE *));
 void symbol_table_insert PARAMS ((symbolS * symbolP));
 valueT resolve_symbol_value PARAMS ((symbolS *, int));
+void resolve_local_symbol_values PARAMS ((void));
 
 void print_symbol_value PARAMS ((symbolS *));
 void print_expr PARAMS ((expressionS *));
@@ -70,6 +84,7 @@
 extern void S_SET_VALUE PARAMS ((symbolS *, valueT));
 
 #ifdef BFD_ASSEMBLER
+extern int S_IS_FUNCTION PARAMS ((symbolS *));
 extern int S_IS_EXTERNAL PARAMS ((symbolS *));
 extern int S_IS_WEAK PARAMS ((symbolS *));
 extern int S_IS_COMMON PARAMS ((symbolS *));
@@ -87,4 +102,104 @@
 extern void S_SET_WEAK PARAMS ((symbolS *));
 #endif
 
+#ifndef WORKING_DOT_WORD
+struct broken_word
+  {
+    /* Linked list -- one of these structures per ".word x-y+C"
+       expression.  */
+    struct broken_word *next_broken_word;
+    /* Segment and subsegment for broken word.  */
+    segT seg;
+    subsegT subseg;
+    /* Which frag is this broken word in?  */
+    fragS *frag;
+    /* Where in the frag is it?  */
+    char *word_goes_here;
+    /* Where to add the break.  */
+    fragS *dispfrag;		/* where to add the break */
+    /* Operands of expression.  */
+    symbolS *add;
+    symbolS *sub;
+    offsetT addnum;
+
+    int added;			/* nasty thing happend yet? */
+    /* 1: added and has a long-jump */
+    /* 2: added but uses someone elses long-jump */
+
+    /* Pointer to broken_word with a similar long-jump.  */
+    struct broken_word *use_jump;
+  };
+extern struct broken_word *broken_words;
+#endif /* ndef WORKING_DOT_WORD */
+
+/*
+ * Current means for getting from symbols to segments and vice verse.
+ * This will change for infinite-segments support (e.g. COFF).
+ */
+extern const segT N_TYPE_seg[];	/* subseg.c */
+
+#define	SEGMENT_TO_SYMBOL_TYPE(seg)  ( seg_N_TYPE [(int) (seg)] )
+extern const short seg_N_TYPE[];/* subseg.c */
+
+#define	N_REGISTER	30	/* Fake N_TYPE value for SEG_REGISTER */
+
+void symbol_clear_list_pointers PARAMS ((symbolS * symbolP));
+
+#ifdef SYMBOLS_NEED_BACKPOINTERS
+
+void symbol_insert PARAMS ((symbolS * addme, symbolS * target,
+			    symbolS ** rootP, symbolS ** lastP));
+void symbol_remove PARAMS ((symbolS * symbolP, symbolS ** rootP,
+			    symbolS ** lastP));
+
+extern symbolS *symbol_previous PARAMS ((symbolS *));
+
+#endif /* SYMBOLS_NEED_BACKPOINTERS */
+
+void verify_symbol_chain PARAMS ((symbolS * rootP, symbolS * lastP));
+void verify_symbol_chain_2 PARAMS ((symbolS * symP));
+
+void symbol_append PARAMS ((symbolS * addme, symbolS * target,
+			    symbolS ** rootP, symbolS ** lastP));
+
+extern symbolS *symbol_next PARAMS ((symbolS *));
+
+extern expressionS *symbol_get_value_expression PARAMS ((symbolS *));
+extern void symbol_set_value_expression PARAMS ((symbolS *,
+						 const expressionS *));
+extern void symbol_set_frag PARAMS ((symbolS *, fragS *));
+extern fragS *symbol_get_frag PARAMS ((symbolS *));
+extern void symbol_mark_used PARAMS ((symbolS *));
+extern void symbol_clear_used PARAMS ((symbolS *));
+extern int symbol_used_p PARAMS ((symbolS *));
+extern void symbol_mark_used_in_reloc PARAMS ((symbolS *));
+extern void symbol_clear_used_in_reloc PARAMS ((symbolS *));
+extern int symbol_used_in_reloc_p PARAMS ((symbolS *));
+extern void symbol_mark_mri_common PARAMS ((symbolS *));
+extern void symbol_clear_mri_common PARAMS ((symbolS *));
+extern int symbol_mri_common_p PARAMS ((symbolS *));
+extern void symbol_mark_written PARAMS ((symbolS *));
+extern void symbol_clear_written PARAMS ((symbolS *));
+extern int symbol_written_p PARAMS ((symbolS *));
+extern void symbol_mark_resolved PARAMS ((symbolS *));
+extern int symbol_resolved_p PARAMS ((symbolS *));
+extern int symbol_section_p PARAMS ((symbolS *));
+extern int symbol_equated_p PARAMS ((symbolS *));
+extern int symbol_constant_p PARAMS ((symbolS *));
+
+#ifdef BFD_ASSEMBLER
+extern asymbol *symbol_get_bfdsym PARAMS ((symbolS *));
+extern void symbol_set_bfdsym PARAMS ((symbolS *, asymbol *));
+#endif
+
+#ifdef OBJ_SYMFIELD_TYPE
+OBJ_SYMFIELD_TYPE *symbol_get_obj PARAMS ((symbolS *));
+void symbol_set_obj PARAMS ((symbolS *, OBJ_SYMFIELD_TYPE *));
+#endif
+
+#ifdef TC_SYMFIELD_TYPE
+TC_SYMFIELD_TYPE *symbol_get_tc PARAMS ((symbolS *));
+void symbol_set_tc PARAMS ((symbolS *, TC_SYMFIELD_TYPE *));
+#endif
+
 /* end of symbols.h */
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index d8f8656..728c787 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,91 @@
+1999-06-13  Ian Lance Taylor  <ian@zembu.com>
+
+	* gas/i386/katmai.d: Tweak for recent disassembler changes.
+
+1999-06-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* gas/elf/elf.exp: Don't run tests on "*-*-linux*aout*" or
+	"*-*-linux*oldld*".
+	* gas/vtable/vtable.exp: Likewise.
+	* gas/i386/reloc.d: Modify expected reloc names to accept a.out
+	names.
+
+	* gas/i386/amd.s: Add a symbol so a.out tests will work.
+	* gas/i386/katmai.s: Likewise.
+	* gas/i386/amd.d: Corresponding change.
+	* gas/i386/katmai.d: Corresponding change.
+
+1999-06-10  Ian Lance Taylor  <ian@zembu.com>
+
+	* gas/mips/sync.d: Pass -mips2 to the assembler.
+
+	* gas/mips/elf_e_flags.s: Tweak code so that the tests pass for
+	mips-elf target as well as mips64-elf target.
+	* gas/mips/elf_e_flags1.d: Corresponding changes.
+	* gas/mips/elf_e_flags2.d: Likewise.
+	* gas/mips/elf_e_flags3.d: Likewise.
+	* gas/mips/elf_e_flags4.d: Likewise.
+
+	* gas/elf/elf.exp: Add setup_xfail for mips*-*-*.
+
+	* gas/all/itbl-test.c (main): Update itbl_get_reg_val call for new
+	parameter.
+
+1999-06-10  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* gas/sparc/synth64.s: Add checks for single register signx/clruw.
+	* gas/sparc/set64.s: Add tests for setuw and setsw synthetic insns.
+	* gas/sparc/prefetch.d: Add -64 as switch.
+	* gas/sparc/rdpr.d: Ditto.
+	* gas/sparc/wrpr.d: Ditto.
+	* gas/sparc/synth64.d: Ditto, reflect synth64.s changes.
+	* gas/sparc/reloc64.d: Add -64 as switch, be more tolerant, as
+	current gas outputs %hi(0) and not %hi(0x0).
+	* gas/sparc/set64.d: Add -64 as switch, reflect set64.s changes and
+	optimizations for setx instruction.
+	* gas/sparc/sparc.exp: Do sparc64*-*-* checks if it is any of the
+	compiled-in targets.
+
+1999-06-10  Richard Henderson  <rth@cygnus.com>
+
+	* gas/macros/irp.s: Use `foo' and `bar' instead of `r' and `s'.
+	* gas/macros/rept.s, gas/macros/test2.s, gas/macros/test3.s: Likewise.
+	* gas/macros/{irp,rept,test2,test3}.d: Update.
+
+1999-06-05  Richard Henderson  <rth@cygnus.com>
+
+	* gas/elf/elf.exp: New directory.
+	* gas/elf/section0.[sd]: New test.
+	* gas/elf/section1.[sd]: New test.
+
+1999-06-03  Philip Blundell  <philb@gnu.org>
+
+	* gas/arm/arm7t.d, gas/arm/inst.d: Update to match current gas,
+ 	bfd and opcodes.
+
+1999-05-28  Ian Lance Taylor  <ian@zembu.com>
+
+	* gas/vtable/vtable.exp: Don't run test for i960 yet.
+
+1999-05-17  Nick Clifton  <nickc@cygnus.com>
+
+	* gas/mcore/allinsn.d: Updated to match latest objdump output.
+
+1999-05-12  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* gas/i386/opcode.d: Modify callw to suit disasm fix.
+
+	* gas/i386/amd.d: Modify a '(bad)' to SIMD instruction.
+
+	* gas/i386/amd.s: Pad to multiple of 8
+	* gas/i386/amd.d: Here too.
+
+	* gas/i386/prefix.[sd]: Align with nops
+	* gas/i386/reloc.[sd]: Here too.
+
+	* gas/i386/katmai.[sd]: New for PIII SIMD
+	* gas/i386/i386.exp: Call it.
+
 1999-05-02  Nick Clifton  <nickc@cygnus.com>
 
 	* gas/mcore/allinsn.d: Update to match latest assembler
diff --git a/gas/testsuite/gas/all/itbl-test.c b/gas/testsuite/gas/all/itbl-test.c
index 023f5d9..d97454e 100644
--- a/gas/testsuite/gas/all/itbl-test.c
+++ b/gas/testsuite/gas/all/itbl-test.c
@@ -118,8 +118,8 @@
 	    n, processor, type, val);
 
   /* We require that names be unique amoung processors and types. */
-  v = itbl_get_reg_val (name);
-  if (!v || v != val)
+  if (! itbl_get_reg_val (name, &v)
+      || v != val)
     printf ("Error - reg val not found for processor=%d, type=%d, name=%s\n",
 	    processor, type, name);
   else
diff --git a/gas/testsuite/gas/arm/arm7t.d b/gas/testsuite/gas/arm/arm7t.d
index 143a161..9c4c83a 100644
--- a/gas/testsuite/gas/arm/arm7t.d
+++ b/gas/testsuite/gas/arm/arm7t.d
@@ -16,8 +16,8 @@
 00000018 <[^>]*> e15100bc ?	ldrh	r0, \[r1, -#12\]
 0000001c <[^>]*> e09100b2 ?	ldrh	r0, \[r1\], r2
 00000020 <[^>]*> e3a00cff ?	mov	r0, #65280
-00000024 <[^>]*> e1df0bb4 ?	ldrh	r0, 000000e0 <\$\$lit_1>
-00000028 <[^>]*> e1df0abc ?	ldrh	r0, 000000dc <.L2>
+00000024 <[^>]*> e1df0bb4 ?	ldrh	r0, \[pc, #b4\]	; 000000e0 <[^>]*>
+00000028 <[^>]*> e1df0abc ?	ldrh	r0, \[pc, #ac\]	; 000000dc <[^>]*>
 0000002c <[^>]*> e1c100b0 ?	strh	r0, \[r1\]
 00000030 <[^>]*> e1e100b0 ?	strh	r0, \[r1\]!
 00000034 <[^>]*> e18100b2 ?	strh	r0, \[r1, r2\]
@@ -26,7 +26,7 @@
 00000040 <[^>]*> e1e100bc ?	strh	r0, \[r1, #12\]!
 00000044 <[^>]*> e14100bc ?	strh	r0, \[r1, -#12\]
 00000048 <[^>]*> e08100b2 ?	strh	r0, \[r1\], r2
-0000004c <[^>]*> e1cf08b8 ?	strh	r0, 000000dc <.L2>
+0000004c <[^>]*> e1cf08b8 ?	strh	r0, \[pc, #88\]	; 000000dc <[^>]*>
 00000050 <[^>]*> e1d100d0 ?	ldrsb	r0, \[r1\]
 00000054 <[^>]*> e1f100d0 ?	ldrsb	r0, \[r1\]!
 00000058 <[^>]*> e19100d2 ?	ldrsb	r0, \[r1, r2\]
@@ -36,7 +36,7 @@
 00000068 <[^>]*> e15100dc ?	ldrsb	r0, \[r1, -#12\]
 0000006c <[^>]*> e09100d2 ?	ldrsb	r0, \[r1\], r2
 00000070 <[^>]*> e3a000de ?	mov	r0, #222
-00000074 <[^>]*> e1df06d0 ?	ldrsb	r0, 000000dc <.L2>
+00000074 <[^>]*> e1df06d0 ?	ldrsb	r0, \[pc, #60\]	; 000000dc <[^>]*>
 00000078 <[^>]*> e1d100f0 ?	ldrsh	r0, \[r1\]
 0000007c <[^>]*> e1f100f0 ?	ldrsh	r0, \[r1\]!
 00000080 <[^>]*> e19100f2 ?	ldrsh	r0, \[r1, r2\]
@@ -46,8 +46,8 @@
 00000090 <[^>]*> e15100fc ?	ldrsh	r0, \[r1, -#12\]
 00000094 <[^>]*> e09100f2 ?	ldrsh	r0, \[r1\], r2
 00000098 <[^>]*> e3a00cff ?	mov	r0, #65280
-0000009c <[^>]*> e1df03fc ?	ldrsh	r0, 000000e0 <\$\$lit_1>
-000000a0 <[^>]*> e1df03f4 ?	ldrsh	r0, 000000dc <.L2>
+0000009c <[^>]*> e1df03fc ?	ldrsh	r0, \[pc, #3c\]	; 000000e0 <[^>]*>
+000000a0 <[^>]*> e1df03f4 ?	ldrsh	r0, \[pc, #34\]	; 000000dc <[^>]*>
 000000a4 <[^>]*> e19100b2 ?	ldrh	r0, \[r1, r2\]
 000000a8 <[^>]*> 119100b2 ?	ldrneh	r0, \[r1, r2\]
 000000ac <[^>]*> 819100b2 ?	ldrhih	r0, \[r1, r2\]
@@ -60,9 +60,9 @@
 000000c8 <[^>]*> 119100d2 ?	ldrnesb	r0, \[r1, r2\]
 000000cc <[^>]*> 819100d2 ?	ldrhisb	r0, \[r1, r2\]
 000000d0 <[^>]*> b19100d2 ?	ldrltsb	r0, \[r1, r2\]
-000000d4 <[^>]*> e1df00f4 ?	ldrsh	r0, 000000e0 <\$\$lit_1>
-000000d8 <[^>]*> e1df00f4 ?	ldrsh	r0, 000000e4 <\$\$lit_1\+0x4>
+000000d4 <[^>]*> e1df00f4 ?	ldrsh	r0, \[pc, #4\]	; 000000e0 <[^>]*>
+000000d8 <[^>]*> e1df00f4 ?	ldrsh	r0, \[pc, #4\]	; 000000e4 <[^>]*>
 000000dc <[^>]*> 00000000 ?	andeq	r0, r0, r0
-[		]*dc:.*.LC0
+[		]*dc:.*.rdata
 000000e0 <[^>]*> 0000c0de ?	.*
 000000e4 <[^>]*> 0000dead ?	.*
diff --git a/gas/testsuite/gas/arm/inst.d b/gas/testsuite/gas/arm/inst.d
index decb8f0..53cfaf9 100644
--- a/gas/testsuite/gas/arm/inst.d
+++ b/gas/testsuite/gas/arm/inst.d
@@ -126,7 +126,7 @@
 000001d0 <[^>]*> 14954006 ?	ldrne	r4, \[r5\], #6
 000001d4 <[^>]*> e6b21003 ?	ldrt	r1, \[r2\], r3
 000001d8 <[^>]*> e6942425 ?	ldr	r2, \[r4\], r5, lsr #8
-000001dc <[^>]*> e51f0008 ?	ldr	r0, 000001dc <[^>]*>
+000001dc <[^>]*> e51f0008 ?	ldr	r0, \[pc, #fffffff8\]	; 000001dc <[^>]*>
 000001e0 <[^>]*> e5d43000 ?	ldrb	r3, \[r4\]
 000001e4 <[^>]*> 14f85000 ?	ldrnebt	r5, \[r8\]
 000001e8 <[^>]*> e5810000 ?	str	r0, \[r1\]
@@ -138,7 +138,7 @@
 00000200 <[^>]*> 14854006 ?	strne	r4, \[r5\], #6
 00000204 <[^>]*> e6821003 ?	str	r1, \[r2\], r3
 00000208 <[^>]*> e6a42425 ?	strt	r2, \[r4\], r5, lsr #8
-0000020c <[^>]*> e50f1004 ?	str	r1, 00000210 <[^>]*>
+0000020c <[^>]*> e50f1004 ?	str	r1, \[pc, #fffffffc\]	; 00000210 <[^>]*>
 00000210 <[^>]*> e5c71000 ?	strb	r1, \[r7\]
 00000214 <[^>]*> e4e02000 ?	strbt	r2, \[r0\]
 00000218 <[^>]*> e8900002 ?	ldmia	r0, {r1}
@@ -161,7 +161,8 @@
 0000025c <[^>]*> 2f000033 ?	swics	0x00000033
 00000260 <[^>]*> ebfffffe ?	bl	00000260 <[^>]*>
 [		]*260:.*_wombat.*
-00000264 <[^>]*> 5bffffe9 ?	blpl	00000210 <bar>
+00000264 <[^>]*> 5b000082 ?	blpl	00000474 <[^>]*>
+			264: R_ARM_PC24	\.text
 00000268 <[^>]*> eafffffe ?	b	00000268 <[^>]*>
 [		]*268:.*_wibble.*
 0000026c <[^>]*> dafffffe ?	ble	0000026c <[^>]*>
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
new file mode 100644
index 0000000..98684dd
--- /dev/null
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -0,0 +1,21 @@
+#
+# elf tests
+#
+
+# We're testing bits in obj-elf -- don't run on anything else.
+if { ([istarget "*-*-elf*"]		
+      || [istarget "*-*-linux*"]
+      || [istarget "sparc*-*-solaris*"]
+      || [istarget "mips*-*-irix6*"])
+     && ![istarget *-*-linux*aout*]
+     && ![istarget *-*-linux*oldld*]
+} then {
+
+    # FIXME: This doesn't work for MIPS targets because of the .reginfo
+    # and .mdebug sections.
+    setup_xfail mips*-*-*
+    run_dump_test "section0" 
+
+    setup_xfail mips*-*-*
+    run_dump_test "section1" 
+}
diff --git a/gas/testsuite/gas/elf/section0.d b/gas/testsuite/gas/elf/section0.d
new file mode 100644
index 0000000..60547c2
--- /dev/null
+++ b/gas/testsuite/gas/elf/section0.d
@@ -0,0 +1,14 @@
+#objdump: -s
+#name: elf section0
+
+.*: +file format .*
+
+Contents of section .text:
+Contents of section .data:
+ 0000 0000                                 ..              
+Contents of section A:
+ 0000 010101                               ...             
+Contents of section B:
+ 0000 0202                                 ..              
+Contents of section C:
+ 0000 03                                   .               
diff --git a/gas/testsuite/gas/elf/section0.s b/gas/testsuite/gas/elf/section0.s
new file mode 100644
index 0000000..bdc8f0c
--- /dev/null
+++ b/gas/testsuite/gas/elf/section0.s
@@ -0,0 +1,16 @@
+.data
+	.byte 0
+.section A
+	.byte 1
+.pushsection B
+	.byte 2
+.pushsection C
+	.byte 3
+.popsection
+	.byte 2
+.popsection
+	.byte 1
+.previous
+	.byte 0
+.previous
+	.byte 1
diff --git a/gas/testsuite/gas/elf/section1.d b/gas/testsuite/gas/elf/section1.d
new file mode 100644
index 0000000..52a16a3
--- /dev/null
+++ b/gas/testsuite/gas/elf/section1.d
@@ -0,0 +1,14 @@
+#objdump: -s
+#name: elf section1
+
+.*: +file format .*
+
+Contents of section .text:
+Contents of section .data:
+ 0000 000000                               ...             
+Contents of section A:
+ 0000 01010101 0101                        ......          
+Contents of section B:
+ 0000 02020202 02                          .....           
+Contents of section C:
+ 0000 0303                                 ..              
diff --git a/gas/testsuite/gas/elf/section1.s b/gas/testsuite/gas/elf/section1.s
new file mode 100644
index 0000000..1592adf
--- /dev/null
+++ b/gas/testsuite/gas/elf/section1.s
@@ -0,0 +1,32 @@
+.data
+	.byte 0
+.section A
+	.byte 1
+.previous
+	.byte 0
+.previous
+	.byte 1
+.pushsection B
+	.byte 2
+.previous
+	.byte 1
+.previous
+	.byte 2
+.pushsection C
+	.byte 3
+.previous
+	.byte 2
+.previous
+	.byte 3
+.popsection
+	.byte 2
+.previous
+	.byte 1
+.previous
+	.byte 2
+.popsection
+	.byte 1
+.previous
+	.byte 0
+.previous
+	.byte 1
diff --git a/gas/testsuite/gas/i386/amd.d b/gas/testsuite/gas/i386/amd.d
index 2fe8b0e..1ff1679 100644
--- a/gas/testsuite/gas/i386/amd.d
+++ b/gas/testsuite/gas/i386/amd.d
@@ -5,7 +5,7 @@
 
 Disassembly of section .text:
 
-0+000 <.text>:
+0+000 <foo>:
    0:	0f 0d 03 [ 	]*prefetch \(%ebx\)
    3:	0f 0d 0c 75 00 10 00 00 [ 	]*prefetchw 0x1000\(,%esi,2\)
    b:	0f 0e [ 	]*femms  
@@ -29,9 +29,12 @@
   6b:	0f 0f ce 0d [ 	]*pi2fd  %mm6,%mm1
   6f:	0f 0f d7 b7 [ 	]*pfmulhrw %mm7,%mm2
   73:	2e 0f [ 	]*\(bad\)  
-  75:	0f 54 [ 	]*\(bad\)  
-  77:	c3 [ 	]*ret    
+  75:	0f 54 c3 [ 	]*andps  %xmm3,%xmm0
   78:	07 [ 	]*pop    %es
   79:	c3 [ 	]*ret    
   7a:	90 [ 	]*nop    
   7b:	90 [ 	]*nop    
+  7c:	90 [ 	]*nop    
+  7d:	90 [ 	]*nop    
+  7e:	90 [ 	]*nop    
+  7f:	90 [ 	]*nop    
diff --git a/gas/testsuite/gas/i386/amd.s b/gas/testsuite/gas/i386/amd.s
index 5e4d581..b409c61 100644
--- a/gas/testsuite/gas/i386/amd.s
+++ b/gas/testsuite/gas/i386/amd.s
@@ -1,6 +1,7 @@
 #AMD 3DNow! instructions
 
 .text
+foo:
  prefetch	(%ebx)
  prefetchw	0x1000(,%esi,2)
  femms
@@ -28,6 +29,5 @@
 # Everything's good bar the opcode suffix
 .byte 0x2e, 0x0f, 0x0f, 0x54, 0xc3, 0x07, 0xc3
 
-# to make us insensitive to alignment
- nop
- nop
+# Pad out to a good alignment
+ .byte 0x90,0x90,0x90,0x90,0x90,0x90
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index cef1ff7..44049f7 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -24,6 +24,7 @@
     run_dump_test "opcode"
     run_dump_test "prefix"
     run_dump_test "amd"
+    run_dump_test "katmai"
 
     # The reloc and white tests require support for 8 and 16 bit
     # relocs, so we only run them for ELF targets.
diff --git a/gas/testsuite/gas/i386/katmai.d b/gas/testsuite/gas/i386/katmai.d
new file mode 100644
index 0000000..4215498c
--- /dev/null
+++ b/gas/testsuite/gas/i386/katmai.d
@@ -0,0 +1,177 @@
+#objdump: -dw
+#name: i386 katmai
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+000 <foo>:
+   0:	0f 58 01 [ 	]*addps  \(%ecx\),%xmm0
+   3:	0f 58 ca [ 	]*addps  %xmm2,%xmm1
+   6:	f3 0f 58 13 [ 	]*addss  \(%ebx\),%xmm2
+   a:	f3 0f 58 dc [ 	]*addss  %xmm4,%xmm3
+   e:	0f 55 65 00 [ 	]*andnps 0x0\(%ebp\),%xmm4
+  12:	0f 55 ee [ 	]*andnps %xmm6,%xmm5
+  15:	0f 54 37 [ 	]*andps  \(%edi\),%xmm6
+  18:	0f 54 f8 [ 	]*andps  %xmm0,%xmm7
+  1b:	0f c2 c1 02 [ 	]*cmpleps %xmm1,%xmm0
+  1f:	0f c2 0a 03 [ 	]*cmpunordps \(%edx\),%xmm1
+  23:	f3 0f c2 d2 04 [ 	]*cmpneqss %xmm2,%xmm2
+  28:	f3 0f c2 1c 24 05 [ 	]*cmpnltss \(%esp,1\),%xmm3
+  2e:	0f c2 e5 06 [ 	]*cmpnleps %xmm5,%xmm4
+  32:	0f c2 2e 07 [ 	]*cmpordps \(%esi\),%xmm5
+  36:	f3 0f c2 f7 00 [ 	]*cmpeqss %xmm7,%xmm6
+  3b:	f3 0f c2 38 01 [ 	]*cmpltss \(%eax\),%xmm7
+  40:	0f c2 c1 00 [ 	]*cmpeqps %xmm1,%xmm0
+  44:	0f c2 0a 00 [ 	]*cmpeqps \(%edx\),%xmm1
+  48:	f3 0f c2 d2 00 [ 	]*cmpeqss %xmm2,%xmm2
+  4d:	f3 0f c2 1c 24 00 [ 	]*cmpeqss \(%esp,1\),%xmm3
+  53:	0f c2 e5 01 [ 	]*cmpltps %xmm5,%xmm4
+  57:	0f c2 2e 01 [ 	]*cmpltps \(%esi\),%xmm5
+  5b:	f3 0f c2 f7 01 [ 	]*cmpltss %xmm7,%xmm6
+  60:	f3 0f c2 38 01 [ 	]*cmpltss \(%eax\),%xmm7
+  65:	0f c2 01 02 [ 	]*cmpleps \(%ecx\),%xmm0
+  69:	0f c2 ca 02 [ 	]*cmpleps %xmm2,%xmm1
+  6d:	f3 0f c2 13 02 [ 	]*cmpless \(%ebx\),%xmm2
+  72:	f3 0f c2 dc 02 [ 	]*cmpless %xmm4,%xmm3
+  77:	0f c2 65 00 03 [ 	]*cmpunordps 0x0\(%ebp\),%xmm4
+  7c:	0f c2 ee 03 [ 	]*cmpunordps %xmm6,%xmm5
+  80:	f3 0f c2 37 03 [ 	]*cmpunordss \(%edi\),%xmm6
+  85:	f3 0f c2 f8 03 [ 	]*cmpunordss %xmm0,%xmm7
+  8a:	0f c2 c1 04 [ 	]*cmpneqps %xmm1,%xmm0
+  8e:	0f c2 0a 04 [ 	]*cmpneqps \(%edx\),%xmm1
+  92:	f3 0f c2 d2 04 [ 	]*cmpneqss %xmm2,%xmm2
+  97:	f3 0f c2 1c 24 04 [ 	]*cmpneqss \(%esp,1\),%xmm3
+  9d:	0f c2 e5 05 [ 	]*cmpnltps %xmm5,%xmm4
+  a1:	0f c2 2e 05 [ 	]*cmpnltps \(%esi\),%xmm5
+  a5:	f3 0f c2 f7 05 [ 	]*cmpnltss %xmm7,%xmm6
+  aa:	f3 0f c2 38 05 [ 	]*cmpnltss \(%eax\),%xmm7
+  af:	0f c2 01 06 [ 	]*cmpnleps \(%ecx\),%xmm0
+  b3:	0f c2 ca 06 [ 	]*cmpnleps %xmm2,%xmm1
+  b7:	f3 0f c2 13 06 [ 	]*cmpnless \(%ebx\),%xmm2
+  bc:	f3 0f c2 dc 06 [ 	]*cmpnless %xmm4,%xmm3
+  c1:	0f c2 65 00 07 [ 	]*cmpordps 0x0\(%ebp\),%xmm4
+  c6:	0f c2 ee 07 [ 	]*cmpordps %xmm6,%xmm5
+  ca:	f3 0f c2 37 07 [ 	]*cmpordss \(%edi\),%xmm6
+  cf:	f3 0f c2 f8 07 [ 	]*cmpordss %xmm0,%xmm7
+  d4:	0f 2f c1 [ 	]*comiss %xmm1,%xmm0
+  d7:	0f 2f 0a [ 	]*comiss \(%edx\),%xmm1
+  da:	0f 2a d3 [ 	]*cvtpi2ps %mm3,%xmm2
+  dd:	0f 2a 1c 24 [ 	]*cvtpi2ps \(%esp,1\),%xmm3
+  e1:	f3 0f 2a e5 [ 	]*cvtsi2ss %ebp,%xmm4
+  e5:	f3 0f 2a 2e [ 	]*cvtsi2ss \(%esi\),%xmm5
+  e9:	0f 2d f7 [ 	]*cvtps2pi %xmm7,%mm6
+  ec:	0f 2d 38 [ 	]*cvtps2pi \(%eax\),%mm7
+  ef:	f3 0f 2d 01 [ 	]*cvtss2si \(%ecx\),%eax
+  f3:	f3 0f 2d ca [ 	]*cvtss2si %xmm2,%ecx
+  f7:	0f 2c 13 [ 	]*cvttps2pi \(%ebx\),%mm2
+  fa:	0f 2c dc [ 	]*cvttps2pi %xmm4,%mm3
+  fd:	f3 0f 2c 65 00 [ 	]*cvttss2si 0x0\(%ebp\),%esp
+ 102:	f3 0f 2c ee [ 	]*cvttss2si %xmm6,%ebp
+ 106:	0f 5e c1 [ 	]*divps  %xmm1,%xmm0
+ 109:	0f 5e 0a [ 	]*divps  \(%edx\),%xmm1
+ 10c:	f3 0f 5e d3 [ 	]*divss  %xmm3,%xmm2
+ 110:	f3 0f 5e 1c 24 [ 	]*divss  \(%esp,1\),%xmm3
+ 115:	0f ae 55 00 [ 	]*ldmxcsr 0x0\(%ebp\)
+ 119:	0f ae 1e [ 	]*stmxcsr \(%esi\)
+ 11c:	0f ae f8 [ 	]*sfence 
+ 11f:	0f 5f c1 [ 	]*maxps  %xmm1,%xmm0
+ 122:	0f 5f 0a [ 	]*maxps  \(%edx\),%xmm1
+ 125:	f3 0f 5f d3 [ 	]*maxss  %xmm3,%xmm2
+ 129:	f3 0f 5f 1c 24 [ 	]*maxss  \(%esp,1\),%xmm3
+ 12e:	0f 5d e5 [ 	]*minps  %xmm5,%xmm4
+ 131:	0f 5d 2e [ 	]*minps  \(%esi\),%xmm5
+ 134:	f3 0f 5d f7 [ 	]*minss  %xmm7,%xmm6
+ 138:	f3 0f 5d 38 [ 	]*minss  \(%eax\),%xmm7
+ 13c:	0f 28 c1 [ 	]*movaps %xmm1,%xmm0
+ 13f:	0f 29 11 [ 	]*movaps %xmm2,\(%ecx\)
+ 142:	0f 28 12 [ 	]*movaps \(%edx\),%xmm2
+ 145:	0f 16 dc [ 	]*movlhps %xmm4,%xmm3
+ 148:	0f 17 2c 24 [ 	]*movhps %xmm5,\(%esp,1\)
+ 14c:	0f 16 2e [ 	]*movhps \(%esi\),%xmm5
+ 14f:	0f 12 f7 [ 	]*movhlps %xmm7,%xmm6
+ 152:	0f 13 07 [ 	]*movlps %xmm0,\(%edi\)
+ 155:	0f 12 00 [ 	]*movlps \(%eax\),%xmm0
+ 158:	0f 50 ca [ 	]*movmskps %xmm2,%ecx
+ 15b:	0f 10 d3 [ 	]*movups %xmm3,%xmm2
+ 15e:	0f 11 22 [ 	]*movups %xmm4,\(%edx\)
+ 161:	0f 10 65 00 [ 	]*movups 0x0\(%ebp\),%xmm4
+ 165:	f3 0f 10 ee [ 	]*movss  %xmm6,%xmm5
+ 169:	f3 0f 11 3e [ 	]*movss  %xmm7,\(%esi\)
+ 16d:	f3 0f 10 38 [ 	]*movss  \(%eax\),%xmm7
+ 171:	0f 59 c1 [ 	]*mulps  %xmm1,%xmm0
+ 174:	0f 59 0a [ 	]*mulps  \(%edx\),%xmm1
+ 177:	f3 0f 59 d2 [ 	]*mulss  %xmm2,%xmm2
+ 17b:	f3 0f 59 1c 24 [ 	]*mulss  \(%esp,1\),%xmm3
+ 180:	0f 56 e5 [ 	]*orps   %xmm5,%xmm4
+ 183:	0f 56 2e [ 	]*orps   \(%esi\),%xmm5
+ 186:	0f 53 f7 [ 	]*rcpps  %xmm7,%xmm6
+ 189:	0f 53 38 [ 	]*rcpps  \(%eax\),%xmm7
+ 18c:	f3 0f 53 01 [ 	]*rcpss  \(%ecx\),%xmm0
+ 190:	f3 0f 53 ca [ 	]*rcpss  %xmm2,%xmm1
+ 194:	0f 52 13 [ 	]*rsqrtps \(%ebx\),%xmm2
+ 197:	0f 52 dc [ 	]*rsqrtps %xmm4,%xmm3
+ 19a:	f3 0f 52 65 00 [ 	]*rsqrtss 0x0\(%ebp\),%xmm4
+ 19f:	f3 0f 52 ee [ 	]*rsqrtss %xmm6,%xmm5
+ 1a3:	0f c6 37 02 [ 	]*shufps \$0x2,\(%edi\),%xmm6
+ 1a7:	0f c6 f8 03 [ 	]*shufps \$0x3,%xmm0,%xmm7
+ 1ab:	0f 51 c1 [ 	]*sqrtps %xmm1,%xmm0
+ 1ae:	0f 51 0a [ 	]*sqrtps \(%edx\),%xmm1
+ 1b1:	f3 0f 51 d2 [ 	]*sqrtss %xmm2,%xmm2
+ 1b5:	f3 0f 51 1c 24 [ 	]*sqrtss \(%esp,1\),%xmm3
+ 1ba:	0f 5c e5 [ 	]*subps  %xmm5,%xmm4
+ 1bd:	0f 5c 2e [ 	]*subps  \(%esi\),%xmm5
+ 1c0:	f3 0f 5c f7 [ 	]*subss  %xmm7,%xmm6
+ 1c4:	f3 0f 5c 38 [ 	]*subss  \(%eax\),%xmm7
+ 1c8:	0f 2e 01 [ 	]*ucomiss \(%ecx\),%xmm0
+ 1cb:	0f 2e ca [ 	]*ucomiss %xmm2,%xmm1
+ 1ce:	0f 15 13 [ 	]*unpckhps \(%ebx\),%xmm2
+ 1d1:	0f 15 dc [ 	]*unpckhps %xmm4,%xmm3
+ 1d4:	0f 14 65 00 [ 	]*unpcklps 0x0\(%ebp\),%xmm4
+ 1d8:	0f 14 ee [ 	]*unpcklps %xmm6,%xmm5
+ 1db:	0f 57 37 [ 	]*xorps  \(%edi\),%xmm6
+ 1de:	0f 57 f8 [ 	]*xorps  %xmm0,%xmm7
+ 1e1:	0f e0 c1 [ 	]*pavgb  %mm1,%mm0
+ 1e4:	0f e0 0a [ 	]*pavgb  \(%edx\),%mm1
+ 1e7:	0f e3 d3 [ 	]*pavgw  %mm3,%mm2
+ 1ea:	0f e3 1c 24 [ 	]*pavgw  \(%esp,1\),%mm3
+ 1ee:	0f c5 c8 00 [ 	]*pextrw \$0x0,%mm1,%eax
+ 1f2:	0f c4 09 01 [ 	]*pinsrw \$0x1,\(%ecx\),%mm1
+ 1f6:	0f c4 d2 02 [ 	]*pinsrw \$0x2,%edx,%mm2
+ 1fa:	0f ee c1 [ 	]*pmaxsw %mm1,%mm0
+ 1fd:	0f ee 0a [ 	]*pmaxsw \(%edx\),%mm1
+ 200:	0f de d2 [ 	]*pmaxub %mm2,%mm2
+ 203:	0f de 1c 24 [ 	]*pmaxub \(%esp,1\),%mm3
+ 207:	0f ea e5 [ 	]*pminsw %mm5,%mm4
+ 20a:	0f ea 2e [ 	]*pminsw \(%esi\),%mm5
+ 20d:	0f da f7 [ 	]*pminub %mm7,%mm6
+ 210:	0f da 38 [ 	]*pminub \(%eax\),%mm7
+ 213:	0f d7 e8 [ 	]*pmovmskb %mm5,%eax
+ 216:	0f e4 e5 [ 	]*pmulhuw %mm5,%mm4
+ 219:	0f e4 2e [ 	]*pmulhuw \(%esi\),%mm5
+ 21c:	0f f6 f7 [ 	]*psadbw %mm7,%mm6
+ 21f:	0f f6 38 [ 	]*psadbw \(%eax\),%mm7
+ 222:	0f 70 da 01 [ 	]*pshufw \$0x1,%mm2,%mm3
+ 226:	0f 70 75 00 04 [ 	]*pshufw \$0x4,0x0\(%ebp\),%mm6
+ 22b:	0f f7 c7 [ 	]*maskmovq %mm7,%mm0
+ 22e:	0f 2b 33 [ 	]*movntps %xmm6,\(%ebx\)
+ 231:	0f e7 10 [ 	]*movntq %mm2,\(%eax\)
+ 234:	0f 18 06 [ 	]*prefetchnta \(%esi\)
+ 237:	0f 18 0c 98 [ 	]*prefetcht0 \(%eax,%ebx,4\)
+ 23b:	0f 18 12 [ 	]*prefetcht1 \(%edx\)
+ 23e:	0f 18 19 [ 	]*prefetcht2 \(%ecx\)
+ 241:	2e 0f [ 	]*\(bad\)  
+ 243:	c2 0a 08 [ 	]*ret    \$0x80a
+ 246:	90 [ 	]*nop    
+ 247:	90 [ 	]*nop    
+ 248:	65 [ 	]*gs
+ 249:	0f [ 	]*sfence.*\(bad\).*
+ 24a:	ae [ 	]*scas   %es:\(%edi\),%al
+ 24b:	ff 90 90 90 90 90 [ 	]*call   \*0x90909090\(%eax\)
+ 251:	90 [ 	]*nop    
+ 252:	90 [ 	]*nop    
+ 253:	90 [ 	]*nop    
+ 254:	90 [ 	]*nop    
+ 255:	90 [ 	]*nop    
+ 256:	90 [ 	]*nop    
+ 257:	90 [ 	]*nop    
diff --git a/gas/testsuite/gas/i386/katmai.s b/gas/testsuite/gas/i386/katmai.s
new file mode 100644
index 0000000..d42a74d
--- /dev/null
+++ b/gas/testsuite/gas/i386/katmai.s
@@ -0,0 +1,167 @@
+#PIII SIMD instructions
+
+.text
+foo:
+ addps		(%ecx),%xmm0
+ addps		%xmm2,%xmm1
+ addss		(%ebx),%xmm2
+ addss		%xmm4,%xmm3
+ andnps		0x0(%ebp),%xmm4
+ andnps		%xmm6,%xmm5
+ andps		(%edi),%xmm6
+ andps		%xmm0,%xmm7
+ cmpps		$0x2,%xmm1,%xmm0
+ cmpps		$0x3,(%edx),%xmm1
+ cmpss		$0x4,%xmm2,%xmm2
+ cmpss		$0x5,(%esp,1),%xmm3
+ cmpps		$0x6,%xmm5,%xmm4
+ cmpps		$0x7,(%esi),%xmm5
+ cmpss		$0x0,%xmm7,%xmm6
+ cmpss		$0x1,(%eax),%xmm7
+ cmpeqps	%xmm1,%xmm0
+ cmpeqps	(%edx),%xmm1
+ cmpeqss	%xmm2,%xmm2
+ cmpeqss	(%esp,1),%xmm3
+ cmpltps	%xmm5,%xmm4
+ cmpltps	(%esi),%xmm5
+ cmpltss	%xmm7,%xmm6
+ cmpltss	(%eax),%xmm7
+ cmpleps	(%ecx),%xmm0
+ cmpleps	%xmm2,%xmm1
+ cmpless	(%ebx),%xmm2
+ cmpless	%xmm4,%xmm3
+ cmpunordps	0x0(%ebp),%xmm4
+ cmpunordps	%xmm6,%xmm5
+ cmpunordss	(%edi),%xmm6
+ cmpunordss	%xmm0,%xmm7
+ cmpneqps	%xmm1,%xmm0
+ cmpneqps	(%edx),%xmm1
+ cmpneqss	%xmm2,%xmm2
+ cmpneqss	(%esp,1),%xmm3
+ cmpnltps	%xmm5,%xmm4
+ cmpnltps	(%esi),%xmm5
+ cmpnltss	%xmm7,%xmm6
+ cmpnltss	(%eax),%xmm7
+ cmpnleps	(%ecx),%xmm0
+ cmpnleps	%xmm2,%xmm1
+ cmpnless	(%ebx),%xmm2
+ cmpnless	%xmm4,%xmm3
+ cmpordps	0x0(%ebp),%xmm4
+ cmpordps	%xmm6,%xmm5
+ cmpordss	(%edi),%xmm6
+ cmpordss	%xmm0,%xmm7
+ comiss		%xmm1,%xmm0
+ comiss		(%edx),%xmm1
+ cvtpi2ps	%mm3,%xmm2
+ cvtpi2ps	(%esp,1),%xmm3
+ cvtsi2ss	%ebp,%xmm4
+ cvtsi2ss	(%esi),%xmm5
+ cvtps2pi	%xmm7,%mm6
+ cvtps2pi	(%eax),%mm7
+ cvtss2si	(%ecx),%eax
+ cvtss2si	%xmm2,%ecx
+ cvttps2pi	(%ebx),%mm2
+ cvttps2pi	%xmm4,%mm3
+ cvttss2si	0x0(%ebp),%esp
+ cvttss2si	%xmm6,%ebp
+ divps		%xmm1,%xmm0
+ divps		(%edx),%xmm1
+ divss		%xmm3,%xmm2
+ divss		(%esp,1),%xmm3
+ ldmxcsr	0x0(%ebp)
+ stmxcsr	(%esi)
+ sfence
+ maxps		%xmm1,%xmm0
+ maxps		(%edx),%xmm1
+ maxss		%xmm3,%xmm2
+ maxss		(%esp,1),%xmm3
+ minps		%xmm5,%xmm4
+ minps		(%esi),%xmm5
+ minss		%xmm7,%xmm6
+ minss		(%eax),%xmm7
+ movaps		%xmm1,%xmm0
+ movaps		%xmm2,(%ecx)
+ movaps		(%edx),%xmm2
+ movlhps	%xmm4,%xmm3
+ movhps		%xmm5,(%esp,1)
+ movhps		(%esi),%xmm5
+ movhlps	%xmm7,%xmm6
+ movlps		%xmm0,(%edi)
+ movlps		(%eax),%xmm0
+ movmskps	%xmm2,%ecx
+ movups		%xmm3,%xmm2
+ movups		%xmm4,(%edx)
+ movups		0x0(%ebp),%xmm4
+ movss		%xmm6,%xmm5
+ movss		%xmm7,(%esi)
+ movss		(%eax),%xmm7
+ mulps		%xmm1,%xmm0
+ mulps		(%edx),%xmm1
+ mulss		%xmm2,%xmm2
+ mulss		(%esp,1),%xmm3
+ orps		%xmm5,%xmm4
+ orps		(%esi),%xmm5
+ rcpps		%xmm7,%xmm6
+ rcpps		(%eax),%xmm7
+ rcpss		(%ecx),%xmm0
+ rcpss		%xmm2,%xmm1
+ rsqrtps	(%ebx),%xmm2
+ rsqrtps	%xmm4,%xmm3
+ rsqrtss	0x0(%ebp),%xmm4
+ rsqrtss	%xmm6,%xmm5
+ shufps		$0x2,(%edi),%xmm6
+ shufps		$0x3,%xmm0,%xmm7
+ sqrtps		%xmm1,%xmm0
+ sqrtps		(%edx),%xmm1
+ sqrtss		%xmm2,%xmm2
+ sqrtss		(%esp,1),%xmm3
+ subps		%xmm5,%xmm4
+ subps		(%esi),%xmm5
+ subss		%xmm7,%xmm6
+ subss		(%eax),%xmm7
+ ucomiss	(%ecx),%xmm0
+ ucomiss	%xmm2,%xmm1
+ unpckhps	(%ebx),%xmm2
+ unpckhps	%xmm4,%xmm3
+ unpcklps	0x0(%ebp),%xmm4
+ unpcklps	%xmm6,%xmm5
+ xorps		(%edi),%xmm6
+ xorps		%xmm0,%xmm7
+ pavgb		%mm1,%mm0
+ pavgb		(%edx),%mm1
+ pavgw		%mm3,%mm2
+ pavgw		(%esp,1),%mm3
+ pextrw		$0x0,%mm1,%eax
+ pinsrw		$0x1,(%ecx),%mm1
+ pinsrw		$0x2,%edx,%mm2
+ pmaxsw		%mm1,%mm0
+ pmaxsw		(%edx),%mm1
+ pmaxub		%mm2,%mm2
+ pmaxub		(%esp,1),%mm3
+ pminsw		%mm5,%mm4
+ pminsw		(%esi),%mm5
+ pminub		%mm7,%mm6
+ pminub		(%eax),%mm7
+ pmovmskb	%mm5,%eax
+ pmulhuw	%mm5,%mm4
+ pmulhuw	(%esi),%mm5
+ psadbw		%mm7,%mm6
+ psadbw		(%eax),%mm7
+ pshufw		$0x1,%mm2,%mm3
+ pshufw		$0x4,0x0(%ebp),%mm6
+ maskmovq	%mm7,%mm0
+ movntps	%xmm6,(%ebx)
+ movntq		%mm2,(%eax)
+ prefetchnta	(%esi)
+ prefetcht0	(%eax,%ebx,4)
+ prefetcht1	(%edx)
+ prefetcht2	(%ecx)
+
+# A SIMD instruction with a bad extension byte
+.byte 0x2E,0x0F,0xC2,0x0A,0x08
+ nop
+ nop
+# A bad sfence modrm byte
+.byte 0x65,0x0F,0xAE,0xff
+# Pad out to goo alignment
+.byte 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90
diff --git a/gas/testsuite/gas/i386/opcode.d b/gas/testsuite/gas/i386/opcode.d
index fc3c158..6df49d7 100644
--- a/gas/testsuite/gas/i386/opcode.d
+++ b/gas/testsuite/gas/i386/opcode.d
@@ -526,7 +526,7 @@
  879:	66 d3 90 90 90 90 90 [ 	]*rclw   %cl,0x90909090\(%eax\)
  880:	66 e5 90 [ 	]*in     \$0x90,%ax
  883:	66 e7 90 [ 	]*out    %ax,\$0x90
- 886:	66 e8 8f 90 [ 	]*callw  (0x)?ffff9919.*
+ 886:	66 e8 8f 90 [ 	]*callw  (0x)?9919.*
  88a:	66 ea 90 90 90 90 [ 	]*ljmpw  \$0x9090,\$0x9090
  890:	66 ed [ 	]*in     \(%dx\),%ax
  892:	66 ef [ 	]*out    %ax,\(%dx\)
diff --git a/gas/testsuite/gas/i386/prefix.d b/gas/testsuite/gas/i386/prefix.d
index 054b658..61eba81 100644
--- a/gas/testsuite/gas/i386/prefix.d
+++ b/gas/testsuite/gas/i386/prefix.d
@@ -12,4 +12,4 @@
    b:	9b df e0 [ 	]*fstsw  %ax
    e:	9b 67 df e0 [ 	]*addr16 fstsw %ax
   12:	f3 67 66 36 a7 [ 	]*repz addr16 cmpsw %es:\(%di\),%ss:\(%si\)
-	...
+  17:	90 [ 	]*nop    
diff --git a/gas/testsuite/gas/i386/prefix.s b/gas/testsuite/gas/i386/prefix.s
index 043d310..a998b41 100644
--- a/gas/testsuite/gas/i386/prefix.s
+++ b/gas/testsuite/gas/i386/prefix.s
@@ -7,5 +7,5 @@
  addr16 fstsw %ax
  addr16 rep cmpsw %es:(%di),%ss:(%si)
 
- # Get a good alignment.
- .byte 0
+# Get a good alignment.
+ nop
diff --git a/gas/testsuite/gas/i386/reloc.d b/gas/testsuite/gas/i386/reloc.d
index c7903dd..b2968c5 100644
--- a/gas/testsuite/gas/i386/reloc.d
+++ b/gas/testsuite/gas/i386/reloc.d
@@ -6,10 +6,15 @@
 Disassembly of section .text:
 
 00000000 <foo>:
-   0:	b3 00 [ 	]*mov    \$0x0,%bl	1: R_386_8	.text
-   2:	68 00 00 00 00 [ 	]*push   \$0x0	3: R_386_32	.text
-   7:	05 00 00 00 00 [ 	]*add    \$0x0,%eax	8: R_386_32	.text
-   c:	81 c3 00 00 00 00 [ 	]*add    \$0x0,%ebx	e: R_386_32	.text
-  12:	69 d2 00 00 00 00 [ 	]*imul   \$0x0,%edx,%edx	14: R_386_32	.text
-  18:	9a 00 00 00 00 00 00 [ 	]*lcall  \$0x0,\$0x0	19: R_386_32	.text
-  1f:	66 68 00 00 [ 	]*pushw  \$0x0	21: R_386_16	.text
+   0:	b3 00 [ 	]*mov    \$0x0,%bl	1: (R_386_)?8	.text
+   2:	68 00 00 00 00 [ 	]*push   \$0x0	3: (R_386_)?32	.text
+   7:	05 00 00 00 00 [ 	]*add    \$0x0,%eax	8: (R_386_)?32	.text
+   c:	81 c3 00 00 00 00 [ 	]*add    \$0x0,%ebx	e: (R_386_)?32	.text
+  12:	69 d2 00 00 00 00 [ 	]*imul   \$0x0,%edx,%edx	14: (R_386_)?32	.text
+  18:	9a 00 00 00 00 00 00 [ 	]*lcall  \$0x0,\$0x0	19: (R_386_)?32	.text
+  1f:	66 68 00 00 [ 	]*pushw  \$0x0	21: (R_386_)?16	.text
+  23:	90 [ 	]*nop    
+  24:	90 [ 	]*nop    
+  25:	90 [ 	]*nop    
+  26:	90 [ 	]*nop    
+  27:	90 [ 	]*nop    
diff --git a/gas/testsuite/gas/i386/reloc.s b/gas/testsuite/gas/i386/reloc.s
index 13ee930..2bf95b6 100644
--- a/gas/testsuite/gas/i386/reloc.s
+++ b/gas/testsuite/gas/i386/reloc.s
@@ -6,3 +6,6 @@
 	imul	$foo, %edx
 	lcall	$0, $foo
 	pushw	$foo
+
+# Pad out to a good alignment
+ .byte 0x90,0x90,0x90,0x90,0x90
diff --git a/gas/testsuite/gas/macros/irp.d b/gas/testsuite/gas/macros/irp.d
index 6733622..e6d7bcf 100644
--- a/gas/testsuite/gas/macros/irp.d
+++ b/gas/testsuite/gas/macros/irp.d
@@ -5,9 +5,9 @@
 
 RELOCATION RECORDS FOR .*
 OFFSET[ 	]+TYPE[ 	]+VALUE.*
-0+00[ 	]+[a-zA-Z0-9_]+[ 	]+r1
-0+04[ 	]+[a-zA-Z0-9_]+[ 	]+r2
-0+08[ 	]+[a-zA-Z0-9_]+[ 	]+r3
-0+0c[ 	]+[a-zA-Z0-9_]+[ 	]+s1
-0+10[ 	]+[a-zA-Z0-9_]+[ 	]+s2
-0+14[ 	]+[a-zA-Z0-9_]+[ 	]+s3
+0+00[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
+0+04[ 	]+[a-zA-Z0-9_]+[ 	]+foo2
+0+08[ 	]+[a-zA-Z0-9_]+[ 	]+foo3
+0+0c[ 	]+[a-zA-Z0-9_]+[ 	]+bar1
+0+10[ 	]+[a-zA-Z0-9_]+[ 	]+bar2
+0+14[ 	]+[a-zA-Z0-9_]+[ 	]+bar3
diff --git a/gas/testsuite/gas/macros/irp.s b/gas/testsuite/gas/macros/irp.s
index 2f9a621..f37dd54 100644
--- a/gas/testsuite/gas/macros/irp.s
+++ b/gas/testsuite/gas/macros/irp.s
@@ -1,8 +1,8 @@
 	.irp	param,1,2,3
-	.long	r\param
+	.long	foo\param
 	.endr
 
 	.irpc	param,123
-	.long	s\param
+	.long	bar\param
 	.endr
 
diff --git a/gas/testsuite/gas/macros/rept.d b/gas/testsuite/gas/macros/rept.d
index efb5d99..0022d5f 100644
--- a/gas/testsuite/gas/macros/rept.d
+++ b/gas/testsuite/gas/macros/rept.d
@@ -5,6 +5,6 @@
 
 RELOCATION RECORDS FOR .*
 OFFSET[ 	]+TYPE[ 	]+VALUE.*
-0+00[ 	]+[a-zA-Z0-9_]+[ 	]+r1
-0+04[ 	]+[a-zA-Z0-9_]+[ 	]+r1
-0+08[ 	]+[a-zA-Z0-9_]+[ 	]+r1
+0+00[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
+0+04[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
+0+08[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
diff --git a/gas/testsuite/gas/macros/rept.s b/gas/testsuite/gas/macros/rept.s
index 243cf67..571b6f8 100644
--- a/gas/testsuite/gas/macros/rept.s
+++ b/gas/testsuite/gas/macros/rept.s
@@ -1,3 +1,3 @@
 	.rept	3
-	.long	r1
+	.long	foo1
 	.endr
diff --git a/gas/testsuite/gas/macros/test2.d b/gas/testsuite/gas/macros/test2.d
index 741d734..9a7d414 100644
--- a/gas/testsuite/gas/macros/test2.d
+++ b/gas/testsuite/gas/macros/test2.d
@@ -5,6 +5,6 @@
 
 RELOCATION RECORDS FOR .*
 OFFSET[ 	]+TYPE[ 	]+VALUE.*
-0+00[ 	]+[a-zA-Z0-9_]+[ 	]+r1
-0+04[ 	]+[a-zA-Z0-9_]+[ 	]+r2
-0+08[ 	]+[a-zA-Z0-9_]+[ 	]+r3
+0+00[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
+0+04[ 	]+[a-zA-Z0-9_]+[ 	]+foo2
+0+08[ 	]+[a-zA-Z0-9_]+[ 	]+foo3
diff --git a/gas/testsuite/gas/macros/test2.s b/gas/testsuite/gas/macros/test2.s
index 838ce94..a21b011 100644
--- a/gas/testsuite/gas/macros/test2.s
+++ b/gas/testsuite/gas/macros/test2.s
@@ -6,4 +6,4 @@
 	.endif
 	.endm
 
-	m	r1,r2,r3
+	m	foo1,foo2,foo3
diff --git a/gas/testsuite/gas/macros/test3.d b/gas/testsuite/gas/macros/test3.d
index 2580f76..7680ad4 100644
--- a/gas/testsuite/gas/macros/test3.d
+++ b/gas/testsuite/gas/macros/test3.d
@@ -5,4 +5,4 @@
 
 RELOCATION RECORDS FOR .*
 OFFSET[ 	]+TYPE[ 	]+VALUE.*
-0+00[ 	]+[a-zA-Z0-9_]+[ 	]+r1
+0+00[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
diff --git a/gas/testsuite/gas/macros/test3.s b/gas/testsuite/gas/macros/test3.s
index c6410ae..e80aa20 100644
--- a/gas/testsuite/gas/macros/test3.s
+++ b/gas/testsuite/gas/macros/test3.s
@@ -4,4 +4,4 @@
 	\arg2
 	.endm
 
-	m	".long r1",.garbage
+	m	".long foo1",.garbage
diff --git a/gas/testsuite/gas/mcore/allinsn.d b/gas/testsuite/gas/mcore/allinsn.d
index 913d8f5..ea4cedc 100644
--- a/gas/testsuite/gas/mcore/allinsn.d
+++ b/gas/testsuite/gas/mcore/allinsn.d
@@ -7,394 +7,393 @@
 Disassembly of section .text:
 
 0+000 <abs>:
-   0:	01 e0       	abs	r0
+   0:	01e0      	abs	r0
 
 0+002 <addc>:
-   2:	06 21       	addc	r1, r2
+   2:	0621      	addc	r1, r2
 
 0+004 <addi>:
-   4:	20 03       	addi	r3, 1
+   4:	2003      	addi	r3, 1
 
 0+006 <addu>:
-   6:	1c 54       	addu	r4, r5
+   6:	1c54      	addu	r4, r5
 
 0+008 <and>:
-   8:	16 76       	and	r6, r7
+   8:	1676      	and	r6, r7
 
 0+00a <andi>:
-   a:	2e 28       	andi	r8, 2
+   a:	2e28      	andi	r8, 2
 
 0+00c <andn>:
-   c:	1f a9       	andn	r9, r10
+   c:	1fa9      	andn	r9, r10
 
 0+00e <asr>:
-   e:	1a cb       	asr	r11, r12
+   e:	1acb      	asr	r11, r12
 
 0+010 <asrc>:
-  10:	3a 0d       	asrc	r13
+  10:	3a0d      	asrc	r13
 
 0+012 <asri>:
-  12:	3b fe       	asri	r14, 31
+  12:	3bfe      	asri	r14, 31
 
 0+014 <bclri>:
-  14:	30 0f       	bclri	r15, 0
+  14:	300f      	bclri	r15, 0
 
 0+016 <bf>:
-  16:	ef f4       	bf	0x0
+  16:	eff4      	bf	0x0
 
 0+018 <bgeni>:
-  18:	32 70       	bgeni	r0, 7
+  18:	3270      	bgeni	r0, 7
 
 0+01a <BGENI>:
-  1a:	32 80       	bgeni	r0, 8
+  1a:	3280      	bgeni	r0, 8
 
 0+01c <BGENi>:
-  1c:	33 f0       	bgeni	r0, 31
+  1c:	33f0      	bgeni	r0, 31
 
 0+01e <bgenr>:
-  1e:	13 21       	bgenr	r1, r2
+  1e:	1321      	bgenr	r1, r2
 
 0+020 <bkpt>:
 	...
 
 0+022 <bmaski>:
-  22:	2c 83       	bmaski	r3, 8
+  22:	2c83      	bmaski	r3, 8
 
 0+024 <BMASKI>:
-  24:	2d f3       	bmaski	r3, 31
+  24:	2df3      	bmaski	r3, 31
 
 0+026 <br>:
-  26:	f7 ff       	br	0x26
+  26:	f7ff      	br	0x26
 
 0+028 <brev>:
-  28:	00 f4       	brev	r4
+  28:	00f4      	brev	r4
 
 0+02a <bseti>:
-  2a:	35 e5       	bseti	r5, 30
+  2a:	35e5      	bseti	r5, 30
 
 0+02c <bsr>:
-  2c:	ff e9       	bsr	0x0
+  2c:	ffe9      	bsr	0x0
 
 0+02e <bt>:
-  2e:	e7 e8       	bt	0x0
+  2e:	e7e8      	bt	0x0
 
 0+030 <btsti>:
-  30:	37 b6       	btsti	r6, 27
+  30:	37b6      	btsti	r6, 27
 
 0+032 <clrc>:
-  32:	0f 00       	cmpne	r0, r0
+  32:	0f00      	cmpne	r0, r0
 
 0+034 <clrf>:
-  34:	01 d7       	clrf	r7
+  34:	01d7      	clrf	r7
 
 0+036 <clrt>:
-  36:	01 c8       	clrt	r8
+  36:	01c8      	clrt	r8
 
 0+038 <cmphs>:
-  38:	0c a9       	cmphs	r9, r10
+  38:	0ca9      	cmphs	r9, r10
 
 0+03a <cmplt>:
-  3a:	0d cb       	cmplt	r11, r12
+  3a:	0dcb      	cmplt	r11, r12
 
 0+03c <cmplei>:
-  3c:	22 eb       	cmplti	r11, 15
+  3c:	22eb      	cmplti	r11, 15
 
 0+03e <cmplti>:
-  3e:	23 fd       	cmplti	r13, 32
+  3e:	23fd      	cmplti	r13, 32
 
 0+040 <cmpne>:
-  40:	0f fe       	cmpne	r14, r15
+  40:	0ffe      	cmpne	r14, r15
 
 0+042 <cmpnei>:
-  42:	2a 00       	cmpnei	r0, 0
+  42:	2a00      	cmpnei	r0, 0
 
 0+044 <decf>:
-  44:	00 91       	decf	r1
+  44:	0091      	decf	r1
 
 0+046 <decgt>:
-  46:	01 a2       	decgt	r2
+  46:	01a2      	decgt	r2
 
 0+048 <declt>:
-  48:	01 83       	declt	r3
+  48:	0183      	declt	r3
 
 0+04a <decne>:
-  4a:	01 b4       	decne	r4
+  4a:	01b4      	decne	r4
 
 0+04c <dect>:
-  4c:	00 85       	dect	r5
+  4c:	0085      	dect	r5
 
 0+04e <divs>:
-  4e:	32 16       	divs	r6, r1
+  4e:	3216      	divs	r6, r1
 
 0+050 <divu>:
-  50:	2c 18       	divu	r8, r1
+  50:	2c18      	divu	r8, r1
 
 0+052 <doze>:
-  52:	00 06       	doze
+  52:	0006      	doze
 
 0+054 <ff1>:
-  54:	00 ea       	ff1	r10
+  54:	00ea      	ff1	r10
 
 0+056 <incf>:
-  56:	00 bb       	incf	r11
+  56:	00bb      	incf	r11
 
 0+058 <inct>:
-  58:	00 ac       	inct	r12
+  58:	00ac      	inct	r12
 
 0+05a <ixh>:
-  5a:	1d ed       	ixh	r13, r14
+  5a:	1ded      	ixh	r13, r14
 
 0+05c <ixw>:
-  5c:	15 0f       	ixw	r15, r0
+  5c:	150f      	ixw	r15, r0
 
 0+05e <jbf>:
-  5e:	ef d0       	bf	0x0
+  5e:	efd0      	bf	0x0
 
 0+060 <jbr>:
-  60:	f0 0e       	br	0x7e
+  60:	f00e      	br	0x7e
 
 0+062 <jbsr>:
-  62:	7f 0a       	jsri	0x.*
+  62:	7f0a      	jsri	0x.*
 
 0+064 <jbt>:
-  64:	e0 0c       	bt	0x7e
+  64:	e00c      	bt	0x7e
 
 0+066 <jmp>:
-  66:	00 c1       	jmp	r1
+  66:	00c1      	jmp	r1
 
 0+068 <jmpi>:
-  68:	70 09       	jmpi	0x.*
+  68:	7009      	jmpi	0x.*
 
 0+06a <jsr>:
-  6a:	00 d2       	jsr	r2
+  6a:	00d2      	jsr	r2
 
 0+06c <jsri>:
-  6c:	7f 08       	jsri	0x.*
+  6c:	7f08      	jsri	0x.*
 
 0+06e <ld.b>:
-  6e:	a3 04       	ldb	r3, \(r4, 0\)
+  6e:	a304      	ldb	r3, \(r4, 0\)
 
 0+070 <ld.h>:
-  70:	c5 16       	ldh	r5, \(r6, 2\)
+  70:	c516      	ldh	r5, \(r6, 2\)
 
 0+072 <ld.w>:
-  72:	87 18       	ld	r7, \(r8, 4\)
+  72:	8718      	ld	r7, \(r8, 4\)
 
 0+074 <ldb>:
-  74:	a9 fa       	ldb	r9, \(r10, 15\)
+  74:	a9fa      	ldb	r9, \(r10, 15\)
 
 0+076 <ldh>:
-  76:	cb fc       	ldh	r11, \(r12, 30\)
+  76:	cbfc      	ldh	r11, \(r12, 30\)
 
 0+078 <ld>:
-  78:	8d 5e       	ld	r13, \(r14, 20\)
+  78:	8d5e      	ld	r13, \(r14, 20\)
 
 0+07a <ldw>:
-  7a:	8d fe       	ld	r13, \(r14, 60\)
+  7a:	8dfe      	ld	r13, \(r14, 60\)
 
 0+07c <ldm>:
-  7c:	00 62       	ldm	r2-r15, \(r0\)
+  7c:	0062      	ldm	r2-r15, \(r0\)
 
 0+07e <fooloop>:
-  7e:	00 41       	ldq	r4-r7, \(r1\)
+  7e:	0041      	ldq	r4-r7, \(r1\)
 
 0+080 <loopt>:
-  80:	04 8e       	loopt	r8, 0x64
+  80:	048e      	loopt	r8, 0x64
 
 0+082 <LRW>:
-  82:	79 03       	lrw	r9, 0x.*
+  82:	7903      	lrw	r9, 0x.*
 
 0+084 <lrw>:
-  84:	79 04       	lrw	r9, 0x4321
+  84:	7904      	lrw	r9, 0x4321
 
 0+086 <foolit>:
-  86:	12 34       	mov	r4, r3
+  86:	1234      	mov	r4, r3
 
 0+088 <lsl>:
-  88:	1b ba       	lsl	r10, r11
+  88:	1bba      	lsl	r10, r11
 
 0+08a <lslc>:
-  8a:	3c 0c       	lslc	r12
+  8a:	3c0c      	lslc	r12
 
-0+08c <.XP0001>:
 	...
 			8c: ADDR32	.text
 			90: ADDR32	.text.*
-  94:	00 00       	bkpt
-  96:	43 21       	.word 0x4321
+  94:	0000      	bkpt
+  96:	4321      	.short 0x4321
 
 0+098 <lsli>:
-  98:	3d fd       	lsli	r13, 31
+  98:	3dfd      	lsli	r13, 31
 
 0+09a <lsr>:
-  9a:	0b fe       	lsr	r14, r15
+  9a:	0bfe      	lsr	r14, r15
 
 0+09c <lsrc>:
-  9c:	3e 00       	lsrc	r0
+  9c:	3e00      	lsrc	r0
 
 0+09e <lsri>:
-  9e:	3e 11       	lsri	r1, 1
+  9e:	3e11      	lsri	r1, 1
 
 0+0a0 <mclri>:
-  a0:	30 64       	bclri	r4, 6
+  a0:	3064      	bclri	r4, 6
 
 0+0a2 <mfcr>:
-  a2:	10 02       	mfcr	r2, psr
+  a2:	1002      	mfcr	r2, psr
 
 0+0a4 <mov>:
-  a4:	12 43       	mov	r3, r4
+  a4:	1243      	mov	r3, r4
 
 0+0a6 <movf>:
-  a6:	0a 65       	movf	r5, r6
+  a6:	0a65      	movf	r5, r6
 
 0+0a8 <movi>:
-  a8:	67 f7       	movi	r7, 127
+  a8:	67f7      	movi	r7, 127
 
 0+0aa <movt>:
-  aa:	02 98       	movt	r8, r9
+  aa:	0298      	movt	r8, r9
 
 0+0ac <mtcr>:
-  ac:	18 0a       	mtcr	r10, psr
+  ac:	180a      	mtcr	r10, psr
 
 0+0ae <mult>:
-  ae:	03 cb       	mult	r11, r12
+  ae:	03cb      	mult	r11, r12
 
 0+0b0 <mvc>:
-  b0:	00 2d       	mvc	r13
+  b0:	002d      	mvc	r13
 
 0+0b2 <mvcv>:
-  b2:	00 3e       	mvcv	r14
+  b2:	003e      	mvcv	r14
 
 0+0b4 <neg>:
-  b4:	28 02       	rsubi	r2, 0
+  b4:	2802      	rsubi	r2, 0
 
 0+0b6 <not>:
-  b6:	01 ff       	not	r15
+  b6:	01ff      	not	r15
 
 0+0b8 <or>:
-  b8:	1e 10       	or	r0, r1
+  b8:	1e10      	or	r0, r1
 
 0+0ba <rfi>:
-  ba:	00 03       	rfi
+  ba:	0003      	rfi
 
 0+0bc <rolc>:
-  bc:	06 66       	addc	r6, r6
+  bc:	0666      	addc	r6, r6
 
 0+0be <rori>:
-  be:	39 a9       	rotli	r9, 26
+  be:	39a9      	rotli	r9, 26
 
 0+0c0 <rotlc>:
-  c0:	06 66       	addc	r6, r6
+  c0:	0666      	addc	r6, r6
 
 0+0c2 <rotli>:
-  c2:	38 a2       	rotli	r2, 10
+  c2:	38a2      	rotli	r2, 10
 
 0+0c4 <rotri>:
-  c4:	39 a9       	rotli	r9, 26
+  c4:	39a9      	rotli	r9, 26
 
 0+0c6 <rsub>:
-  c6:	14 43       	rsub	r3, r4
+  c6:	1443      	rsub	r3, r4
 
 0+0c8 <rsubi>:
-  c8:	28 05       	rsubi	r5, 0
+  c8:	2805      	rsubi	r5, 0
 
 0+0ca <rte>:
-  ca:	00 02       	rte
+  ca:	0002      	rte
 
 0+0cc <rts>:
-  cc:	00 cf       	jmp	r15
+  cc:	00cf      	jmp	r15
 
 0+0ce <setc>:
-  ce:	0c 00       	cmphs	r0, r0
+  ce:	0c00      	cmphs	r0, r0
 
 0+0d0 <sextb>:
-  d0:	01 56       	sextb	r6
+  d0:	0156      	sextb	r6
 
 0+0d2 <sexth>:
-  d2:	01 77       	sexth	r7
+  d2:	0177      	sexth	r7
 
 0+0d4 <st.b>:
-  d4:	b8 09       	stb	r8, \(r9, 0\)
+  d4:	b809      	stb	r8, \(r9, 0\)
 
 0+0d6 <st.h>:
-  d6:	da 1b       	sth	r10, \(r11, 2\)
+  d6:	da1b      	sth	r10, \(r11, 2\)
 
 0+0d8 <st.w>:
-  d8:	9c 1d       	st	r12, \(r13, 4\)
+  d8:	9c1d      	st	r12, \(r13, 4\)
 
 0+0da <stb>:
-  da:	be ff       	stb	r14, \(r15, 15\)
+  da:	beff      	stb	r14, \(r15, 15\)
 
 0+0dc <sth>:
-  dc:	d0 f1       	sth	r0, \(r1, 30\)
+  dc:	d0f1      	sth	r0, \(r1, 30\)
 
 0+0de <stw>:
-  de:	92 f3       	st	r2, \(r3, 60\)
+  de:	92f3      	st	r2, \(r3, 60\)
 
 0+0e0 <st>:
-  e0:	94 05       	st	r4, \(r5, 0\)
+  e0:	9405      	st	r4, \(r5, 0\)
 
 0+0e2 <stm>:
-  e2:	00 7e       	stm	r14-r15, \(r0\)
+  e2:	007e      	stm	r14-r15, \(r0\)
 
 0+0e4 <stop>:
-  e4:	00 04       	stop
+  e4:	0004      	stop
 
 0+0e6 <stq>:
-  e6:	00 51       	stq	r4-r7, \(r1\)
+  e6:	0051      	stq	r4-r7, \(r1\)
 
 0+0e8 <subc>:
-  e8:	07 d7       	subc	r7, r13
+  e8:	07d7      	subc	r7, r13
 
 0+0ea <subi>:
-  ea:	25 fe       	subi	r14, 32
+  ea:	25fe      	subi	r14, 32
 
 0+0ec <subu>:
-  ec:	05 39       	subu	r9, r3
+  ec:	0539      	subu	r9, r3
 
 0+0ee <sync>:
-  ee:	00 01       	sync
+  ee:	0001      	sync
 
 0+0f0 <tstlt>:
-  f0:	37 f5       	btsti	r5, 31
+  f0:	37f5      	btsti	r5, 31
 
 0+0f2 <tstne>:
-  f2:	2a 07       	cmpnei	r7, 0
+  f2:	2a07      	cmpnei	r7, 0
 
 0+0f4 <trap>:
-  f4:	00 0a       	trap	2
+  f4:	000a      	trap	2
 
 0+0f6 <tst>:
-  f6:	0e ee       	tst	r14, r14
+  f6:	0eee      	tst	r14, r14
 
 0+0f8 <tstnbz>:
-  f8:	01 92       	tstnbz	r2
+  f8:	0192      	tstnbz	r2
 
 0+0fa <wait>:
-  fa:	00 05       	wait
+  fa:	0005      	wait
 
 0+0fc <xor>:
-  fc:	17 0f       	xor	r15, r0
+  fc:	170f      	xor	r15, r0
 
 0+0fe <xsr>:
-  fe:	38 0b       	xsr	r11
+  fe:	380b      	xsr	r11
 
 0+0100 <xtrb0>:
- 100:	01 31       	xtrb0	r1, r1
+ 100:	0131      	xtrb0	r1, r1
 
 0+0102 <xtrb1>:
- 102:	01 22       	xtrb1	r1, r2
+ 102:	0122      	xtrb1	r1, r2
 
 0+0104 <xtrb2>:
- 104:	01 10       	xtrb2	r1, r0
+ 104:	0110      	xtrb2	r1, r0
 
 0+0106 <xtrb3>:
- 106:	01 0d       	xtrb3	r1, r13
+ 106:	010d      	xtrb3	r1, r13
 
 0+0108 <zextb>:
- 108:	01 48       	zextb	r8
+ 108:	0148      	zextb	r8
 
 0+010a <zexth>:
- 10a:	01 64       	zexth	r4
- 10c:	0f 00       	cmpne	r0, r0
- 10e:	0f 00       	cmpne	r0, r0
+ 10a:	0164      	zexth	r4
+ 10c:	0f00      	cmpne	r0, r0
+ 10e:	0f00      	cmpne	r0, r0
diff --git a/gas/testsuite/gas/mips/elf_e_flags.c b/gas/testsuite/gas/mips/elf_e_flags.c
index 17fb111..7615f9c 100644
--- a/gas/testsuite/gas/mips/elf_e_flags.c
+++ b/gas/testsuite/gas/mips/elf_e_flags.c
@@ -9,7 +9,11 @@
    We use the -m4650 flag to get the 4650-specific 'mul' instruction
    in there; the test suite wants to be sure that GAS's -m4650 flag
    will indeed cause it to generate the 4650 mul instruction, and not
-   expand it as a macro.  */
+   expand it as a macro.
+
+   Ian 10 June 1999: I tweaked the resulting assembler file so that it
+   would generate the same code when gas was configured for mips-elf
+   and for mips64-elf.  */
 
 int
 foo (int a, int b)
diff --git a/gas/testsuite/gas/mips/elf_e_flags.s b/gas/testsuite/gas/mips/elf_e_flags.s
index 5fc32ea..1eca8c4 100644
--- a/gas/testsuite/gas/mips/elf_e_flags.s
+++ b/gas/testsuite/gas/mips/elf_e_flags.s
@@ -28,11 +28,11 @@
 	.mask	0x80000000,-8
 	.fmask	0x00000000,0
 	subu	$sp,$sp,40
-	sd	$31,32($sp)
+	sw	$31,32($sp)
 	jal	__gccmain
 	move	$2,$0
-	ld	$31,32($sp)
-	#nop
+	lw	$31,32($sp)
+	nop
 	.set	noreorder
 	.set	nomacro
 	j	$31
diff --git a/gas/testsuite/gas/mips/elf_e_flags1.d b/gas/testsuite/gas/mips/elf_e_flags1.d
index 6faa7c1..0dde67d 100644
--- a/gas/testsuite/gas/mips/elf_e_flags1.d
+++ b/gas/testsuite/gas/mips/elf_e_flags1.d
@@ -3,7 +3,7 @@
 # objdump: -fd
 
 .*:.*file format.*mips.*
-architecture: mips:4000, flags 0x00000011:
+architecture: mips:[34]000, flags 0x00000011:
 HAS_RELOC, HAS_SYMS
 start address 0x0000000000000000
 
@@ -17,10 +17,11 @@
 
 0000000000000010 <main>:
   10:	27bdffd8 	addiu	\$sp,\$sp,-40
-  14:	ffbf0020 	sd	\$ra,32\(\$sp\)
+  14:	afbf0020 	sw	\$ra,32\(\$sp\)
   18:	0c000000 	jal	0 <foo>
   1c:	00000000 	nop
-  20:	0000102d 	move	\$v0,\$zero
-  24:	dfbf0020 	ld	\$ra,32\(\$sp\)
-  28:	03e00008 	jr	\$ra
-  2c:	27bd0028 	addiu	\$sp,\$sp,40
+  20:	0000102[1d] 	move	\$v0,\$zero
+  24:	8fbf0020 	lw	\$ra,32\(\$sp\)
+  28:	00000000 	nop
+  2c:	03e00008 	jr	\$ra
+  30:	27bd0028 	addiu	\$sp,\$sp,40
diff --git a/gas/testsuite/gas/mips/elf_e_flags2.d b/gas/testsuite/gas/mips/elf_e_flags2.d
index 50661c2..e313bd3 100644
--- a/gas/testsuite/gas/mips/elf_e_flags2.d
+++ b/gas/testsuite/gas/mips/elf_e_flags2.d
@@ -17,10 +17,11 @@
 
 000000000000000c <main>:
    c:	27bdffd8 	addiu	\$sp,\$sp,-40
-  10:	ffbf0020 	sd	\$ra,32\(\$sp\)
+  10:	afbf0020 	sw	\$ra,32\(\$sp\)
   14:	0c000000 	jal	0 <foo>
   18:	00000000 	nop
   1c:	0000102d 	move	\$v0,\$zero
-  20:	dfbf0020 	ld	\$ra,32\(\$sp\)
-  24:	03e00008 	jr	\$ra
-  28:	27bd0028 	addiu	\$sp,\$sp,40
+  20:	8fbf0020 	lw	\$ra,32\(\$sp\)
+  24:	00000000 	nop
+  28:	03e00008 	jr	\$ra
+  2c:	27bd0028 	addiu	\$sp,\$sp,40
diff --git a/gas/testsuite/gas/mips/elf_e_flags3.d b/gas/testsuite/gas/mips/elf_e_flags3.d
index aacc49e..9813491 100644
--- a/gas/testsuite/gas/mips/elf_e_flags3.d
+++ b/gas/testsuite/gas/mips/elf_e_flags3.d
@@ -17,10 +17,11 @@
 
 000000000000000c <main>:
    c:	27bdffd8 	addiu	\$sp,\$sp,-40
-  10:	ffbf0020 	sd	\$ra,32\(\$sp\)
+  10:	afbf0020 	sw	\$ra,32\(\$sp\)
   14:	0c000000 	jal	0 <foo>
   18:	00000000 	nop
   1c:	0000102d 	move	\$v0,\$zero
-  20:	dfbf0020 	ld	\$ra,32\(\$sp\)
-  24:	03e00008 	jr	\$ra
-  28:	27bd0028 	addiu	\$sp,\$sp,40
+  20:	8fbf0020 	lw	\$ra,32\(\$sp\)
+  24:	00000000 	nop
+  28:	03e00008 	jr	\$ra
+  2c:	27bd0028 	addiu	\$sp,\$sp,40
diff --git a/gas/testsuite/gas/mips/elf_e_flags4.d b/gas/testsuite/gas/mips/elf_e_flags4.d
index 5eb7050..833eba0 100644
--- a/gas/testsuite/gas/mips/elf_e_flags4.d
+++ b/gas/testsuite/gas/mips/elf_e_flags4.d
@@ -17,10 +17,11 @@
 
 000000000000000c <main>:
    c:	27bdffd8 	addiu	\$sp,\$sp,-40
-  10:	ffbf0020 	sd	\$ra,32\(\$sp\)
+  10:	afbf0020 	sw	\$ra,32\(\$sp\)
   14:	0c000000 	jal	0 <foo>
   18:	00000000 	nop
   1c:	0000102d 	move	\$v0,\$zero
-  20:	dfbf0020 	ld	\$ra,32\(\$sp\)
-  24:	03e00008 	jr	\$ra
-  28:	27bd0028 	addiu	\$sp,\$sp,40
+  20:	8fbf0020 	lw	\$ra,32\(\$sp\)
+  24:	00000000 	nop
+  28:	03e00008 	jr	\$ra
+  2c:	27bd0028 	addiu	\$sp,\$sp,40
diff --git a/gas/testsuite/gas/mips/sync.d b/gas/testsuite/gas/mips/sync.d
index 9b50ea2..0b9a187 100644
--- a/gas/testsuite/gas/mips/sync.d
+++ b/gas/testsuite/gas/mips/sync.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: sync instructions
-#as:
+#as: -mips2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/sparc/prefetch.d b/gas/testsuite/gas/sparc/prefetch.d
index 41803ed..48f4215 100644
--- a/gas/testsuite/gas/sparc/prefetch.d
+++ b/gas/testsuite/gas/sparc/prefetch.d
@@ -1,4 +1,4 @@
-#as: -Av9
+#as: -64 -Av9
 #objdump: -dr
 #name: sparc64 prefetch
 
diff --git a/gas/testsuite/gas/sparc/rdpr.d b/gas/testsuite/gas/sparc/rdpr.d
index 60a7b61..e36ea9b 100644
--- a/gas/testsuite/gas/sparc/rdpr.d
+++ b/gas/testsuite/gas/sparc/rdpr.d
@@ -1,4 +1,4 @@
-#as: -Av9
+#as: -64 -Av9
 #objdump: -dr
 #name: sparc64 rdpr
 
diff --git a/gas/testsuite/gas/sparc/reloc64.d b/gas/testsuite/gas/sparc/reloc64.d
index f4b825a..da40d0c 100644
--- a/gas/testsuite/gas/sparc/reloc64.d
+++ b/gas/testsuite/gas/sparc/reloc64.d
@@ -1,4 +1,4 @@
-#as: -Av9
+#as: -64 -Av9
 #objdump: -dr
 #name: sparc64 reloc64
 
@@ -10,12 +10,12 @@
    0:	03 04 8d 15 	sethi  %hi\(0x12345400\), %g1
    4:	82 10 62 78 	or  %g1, 0x278, %g1.*
    8:	01 00 00 00 	nop 
-   c:	03 00 00 00 	sethi  %hi\(0x0\), %g1
+   c:	03 00 00 00 	sethi  %hi\((0x|)0\), %g1
 			c: R_SPARC_HH22	.text
   10:	82 10 60 00 	mov  %g1, %g1	! 0 <foo>
 			10: R_SPARC_HM10	.text
   14:	01 00 00 00 	nop 
-  18:	03 00 00 00 	sethi  %hi\(0x0\), %g1
+  18:	03 00 00 00 	sethi  %hi\((0x|)0\), %g1
 			18: R_SPARC_HH22	.text\+0x1234567800000000
   1c:	82 10 60 00 	mov  %g1, %g1	! 0 <foo>
 			1c: R_SPARC_HM10	.text\+0x1234567800000000
@@ -25,20 +25,20 @@
   2c:	05 1d 95 0c 	sethi  %hi\(0x76543000\), %g2
   30:	84 10 62 10 	or  %g1, 0x210, %g2
   34:	01 00 00 00 	nop 
-  38:	03 00 00 00 	sethi  %hi\(0x0\), %g1
+  38:	03 00 00 00 	sethi  %hi\((0x|)0\), %g1
 			38: R_SPARC_HH22	.text
   3c:	82 10 60 00 	mov  %g1, %g1	! 0 <foo>
 			3c: R_SPARC_HM10	.text
-  40:	05 00 00 00 	sethi  %hi\(0x0\), %g2
+  40:	05 00 00 00 	sethi  %hi\((0x|)0\), %g2
 			40: R_SPARC_LM22	.text
   44:	84 10 60 00 	mov  %g1, %g2
 			44: R_SPARC_LO10	.text
   48:	01 00 00 00 	nop 
-  4c:	03 00 00 00 	sethi  %hi\(0x0\), %g1
+  4c:	03 00 00 00 	sethi  %hi\((0x|)0\), %g1
 			4c: R_SPARC_HH22	.text\+0xfedcba9876543210
   50:	82 10 60 00 	mov  %g1, %g1	! 0 <foo>
 			50: R_SPARC_HM10	.text\+0xfedcba9876543210
-  54:	05 00 00 00 	sethi  %hi\(0x0\), %g2
+  54:	05 00 00 00 	sethi  %hi\((0x|)0\), %g2
 			54: R_SPARC_LM22	.text\+0xfedcba9876543210
   58:	84 10 60 00 	mov  %g1, %g2
 			58: R_SPARC_LO10	.text\+0xfedcba9876543210
@@ -47,14 +47,14 @@
   64:	82 10 61 43 	or  %g1, 0x143, %g1.*
   68:	82 10 62 10 	or  %g1, 0x210, %g1
   6c:	01 00 00 00 	nop 
-  70:	03 00 00 00 	sethi  %hi\(0x0\), %g1
+  70:	03 00 00 00 	sethi  %hi\((0x|)0\), %g1
 			70: R_SPARC_H44	.text
   74:	82 10 60 00 	mov  %g1, %g1	! 0 <foo>
 			74: R_SPARC_M44	.text
   78:	82 10 60 00 	mov  %g1, %g1
 			78: R_SPARC_L44	.text
   7c:	01 00 00 00 	nop 
-  80:	03 00 00 00 	sethi  %hi\(0x0\), %g1
+  80:	03 00 00 00 	sethi  %hi\((0x|)0\), %g1
 			80: R_SPARC_H44	.text\+0xa9876543210
   84:	82 10 60 00 	mov  %g1, %g1	! 0 <foo>
 			84: R_SPARC_M44	.text\+0xa9876543210
@@ -64,12 +64,12 @@
   90:	03 22 6a f3 	sethi  %hi\(0x89abcc00\), %g1
   94:	82 18 7e 10 	xor  %g1, -496, %g1
   98:	01 00 00 00 	nop 
-  9c:	03 00 00 00 	sethi  %hi\(0x0\), %g1
+  9c:	03 00 00 00 	sethi  %hi\((0x|)0\), %g1
 			9c: R_SPARC_HIX22	.text
   a0:	82 18 60 00 	xor  %g1, 0, %g1
 			a0: R_SPARC_LOX10	.text
   a4:	01 00 00 00 	nop 
-  a8:	03 00 00 00 	sethi  %hi\(0x0\), %g1
+  a8:	03 00 00 00 	sethi  %hi\((0x|)0\), %g1
 			a8: R_SPARC_HIX22	.text\+0xffffffff76543210
   ac:	82 18 60 00 	xor  %g1, 0, %g1
 			ac: R_SPARC_LOX10	.text\+0xffffffff76543210
diff --git a/gas/testsuite/gas/sparc/set64.d b/gas/testsuite/gas/sparc/set64.d
index 121beca..f16023e 100644
--- a/gas/testsuite/gas/sparc/set64.d
+++ b/gas/testsuite/gas/sparc/set64.d
@@ -1,4 +1,4 @@
-#as: -Av9
+#as: -64 -Av9
 #objdump: -dr
 #name: sparc64 set64
 
@@ -7,22 +7,22 @@
 Disassembly of section .text:
 
 0+ <foo>:
-   0:	05 00 00 00 	sethi  %hi\(0x0\), %g2
+   0:	05 00 00 00 	sethi  %hi\((0x|)0\), %g2
 			0: R_SPARC_HI22	.text
    4:	84 10 a0 00 	mov  %g2, %g2	! 0 <foo>
 			4: R_SPARC_LO10	.text
    8:	07 1d 95 0c 	sethi  %hi\(0x76543000\), %g3
-   c:	86 10 e2 10 	or  %g3, 0x210, %g3	! 76543210 <\*ABS\*\+(0x|)0x76543210>
+   c:	86 10 e2 10 	or  %g3, 0x210, %g3	! 76543210 <(\*ABS\*|foo)\+(0x|)0x76543210>
   10:	88 10 20 00 	clr  %g4
   14:	0b 00 00 3f 	sethi  %hi\(0xfc00\), %g5
-  18:	8a 11 63 ff 	or  %g5, 0x3ff, %g5	! ffff <\*ABS\*\+(0x|)ffff>
-  1c:	03 00 00 00 	sethi  %hi\(0x0\), %g1
+  18:	8a 11 63 ff 	or  %g5, 0x3ff, %g5	! ffff <(\*ABS\*|foo)\+(0x|)ffff>
+  1c:	03 00 00 00 	sethi  %hi\((0x|)0\), %g1
 			1c: R_SPARC_HH22	.text
-  20:	82 10 60 00 	mov  %g1, %g1	! 0 <foo>
-			20: R_SPARC_HM10	.text
-  24:	05 00 00 00 	sethi  %hi\(0x0\), %g2
-			24: R_SPARC_HI22	.text
-  28:	84 10 a0 00 	mov  %g2, %g2	! 0 <foo>
+  20:	05 00 00 00 	sethi  %hi\((0x|)0\), %g2
+			20: R_SPARC_LM22	.text
+  24:	82 10 60 00 	mov  %g1, %g1
+			24: R_SPARC_HM10	.text
+  28:	84 10 a0 00 	mov  %g2, %g2
 			28: R_SPARC_LO10	.text
   2c:	83 28 70 20 	sllx  %g1, 0x20, %g1
   30:	84 10 80 01 	or  %g2, %g1, %g2
@@ -32,57 +32,78 @@
   40:	86 10 2f ff 	mov  0xfff, %g3
   44:	07 00 00 04 	sethi  %hi\(0x1000\), %g3
   48:	86 10 30 00 	mov  -4096, %g3
-  4c:	07 3f ff fb 	sethi  %hi\(0xffffec00\), %g3
-  50:	86 10 e3 ff 	or  %g3, 0x3ff, %g3	! ffffefff <\*ABS\*\+(0x|)ffffefff>
-  54:	87 38 e0 00 	sra  %g3, 0, %g3
-  58:	07 00 00 3f 	sethi  %hi\(0xfc00\), %g3
-  5c:	86 10 e3 ff 	or  %g3, 0x3ff, %g3	! ffff <\*ABS\*\+(0x|)ffff>
-  60:	07 3f ff c0 	sethi  %hi\(0xffff0000\), %g3
-  64:	87 38 e0 00 	sra  %g3, 0, %g3
-  68:	09 1f ff ff 	sethi  %hi\(0x7ffffc00\), %g4
-  6c:	88 11 23 ff 	or  %g4, 0x3ff, %g4	! 7fffffff <\*ABS\*\+(0x|)7fffffff>
-  70:	09 20 00 00 	sethi  %hi\(0x80000000\), %g4
-  74:	09 20 00 00 	sethi  %hi\(0x80000000\), %g4
-  78:	89 39 20 00 	sra  %g4, 0, %g4
-  7c:	82 10 3f ff 	mov  -1, %g1
-  80:	09 1f ff ff 	sethi  %hi\(0x7ffffc00\), %g4
-  84:	88 11 23 ff 	or  %g4, 0x3ff, %g4	! 7fffffff <\*ABS\*\+(0x|)7fffffff>
-  88:	83 28 70 20 	sllx  %g1, 0x20, %g1
-  8c:	88 11 00 01 	or  %g4, %g1, %g4
-  90:	09 3f ff ff 	sethi  %hi\(0xfffffc00\), %g4
-  94:	88 11 23 ff 	or  %g4, 0x3ff, %g4	! ffffffff <\*ABS\*\+(0x|)ffffffff>
-  98:	88 10 20 01 	mov  1, %g4
-  9c:	89 29 30 20 	sllx  %g4, 0x20, %g4
-  a0:	03 1f ff ff 	sethi  %hi\(0x7ffffc00\), %g1
-  a4:	82 10 63 ff 	or  %g1, 0x3ff, %g1	! 7fffffff <\*ABS\*\+(0x|)7fffffff>
-  a8:	0b 3f ff ff 	sethi  %hi\(0xfffffc00\), %g5
-  ac:	8a 11 63 ff 	or  %g5, 0x3ff, %g5	! ffffffff <\*ABS\*\+(0x|)ffffffff>
-  b0:	83 28 70 20 	sllx  %g1, 0x20, %g1
-  b4:	8a 11 40 01 	or  %g5, %g1, %g5
-  b8:	0b 20 00 00 	sethi  %hi\(0x80000000\), %g5
-  bc:	8b 29 70 20 	sllx  %g5, 0x20, %g5
-  c0:	8a 10 3f ff 	mov  -1, %g5
-  c4:	8b 29 70 20 	sllx  %g5, 0x20, %g5
-  c8:	0b 20 00 00 	sethi  %hi\(0x80000000\), %g5
-  cc:	8b 39 60 00 	sra  %g5, 0, %g5
+  4c:	07 00 00 04 	sethi  %hi\(0x1000\), %g3
+  50:	86 18 ff ff 	xor  %g3, -1, %g3
+  54:	07 00 00 3f 	sethi  %hi\(0xfc00\), %g3
+  58:	86 10 e3 ff 	or  %g3, 0x3ff, %g3	! ffff <(\*ABS\*|foo)\+(0x|)ffff>
+  5c:	07 00 00 3f 	sethi  %hi\(0xfc00\), %g3
+  60:	86 18 fc 00 	xor  %g3, -1024, %g3
+  64:	09 1f ff ff 	sethi  %hi\(0x7ffffc00\), %g4
+  68:	88 11 23 ff 	or  %g4, 0x3ff, %g4	! 7fffffff <(\*ABS\*|foo)\+(0x|)7fffffff>
+  6c:	09 20 00 00 	sethi  %hi\(0x80000000\), %g4
+  70:	09 1f ff ff 	sethi  %hi\(0x7ffffc00\), %g4
+  74:	88 19 3c 00 	xor  %g4, -1024, %g4
+  78:	09 20 00 00 	sethi  %hi\(0x80000000\), %g4
+  7c:	88 19 3f ff 	xor  %g4, -1, %g4
+  80:	09 3f ff ff 	sethi  %hi\(0xfffffc00\), %g4
+  84:	88 11 23 ff 	or  %g4, 0x3ff, %g4	! ffffffff <(\*ABS\*|foo)\+(0x|)ffffffff>
+  88:	88 10 20 01 	mov  1, %g4
+  8c:	89 29 30 20 	sllx  %g4, 0x20, %g4
+  90:	03 1f ff ff 	sethi  %hi\(0x7ffffc00\), %g1
+  94:	0b 3f ff ff 	sethi  %hi\(0xfffffc00\), %g5
+  98:	82 10 63 ff 	or  %g1, 0x3ff, %g1
+  9c:	8a 11 63 ff 	or  %g5, 0x3ff, %g5
+  a0:	83 28 70 20 	sllx  %g1, 0x20, %g1
+  a4:	8a 11 40 01 	or  %g5, %g1, %g5
+  a8:	0b 20 00 00 	sethi  %hi\(0x80000000\), %g5
+  ac:	8b 29 70 20 	sllx  %g5, 0x20, %g5
+  b0:	0b 3f ff ff 	sethi  %hi\(0xfffffc00\), %g5
+  b4:	8a 19 7c 00 	xor  %g5, -1024, %g5
+  b8:	0b 1f ff ff 	sethi  %hi\(0x7ffffc00\), %g5
+  bc:	8a 19 7c 00 	xor  %g5, -1024, %g5
+  c0:	03 3f ff c0 	sethi  %hi\(0xffff0000\), %g1
+  c4:	0b 3f ff c0 	sethi  %hi\(0xffff0000\), %g5
+  c8:	83 28 70 20 	sllx  %g1, 0x20, %g1
+  cc:	8a 11 40 01 	or  %g5, %g1, %g5
   d0:	03 3f ff c0 	sethi  %hi\(0xffff0000\), %g1
-  d4:	0b 3f ff c0 	sethi  %hi\(0xffff0000\), %g5
+  d4:	8a 10 20 01 	mov  1, %g5
   d8:	83 28 70 20 	sllx  %g1, 0x20, %g1
   dc:	8a 11 40 01 	or  %g5, %g1, %g5
-  e0:	03 3f ff c0 	sethi  %hi\(0xffff0000\), %g1
-  e4:	8a 10 20 01 	mov  1, %g5
-  e8:	83 28 70 20 	sllx  %g1, 0x20, %g1
-  ec:	8a 11 40 01 	or  %g5, %g1, %g5
-  f0:	82 10 20 01 	mov  1, %g1
+  e0:	0b 3f ff c0 	sethi  %hi\(0xffff0000\), %g5
+  e4:	82 10 20 01 	mov  1, %g1
+  e8:	8a 11 60 01 	or  %g5, 1, %g5
+  ec:	83 28 70 20 	sllx  %g1, 0x20, %g1
+  f0:	8a 11 40 01 	or  %g5, %g1, %g5
   f4:	0b 3f ff c0 	sethi  %hi\(0xffff0000\), %g5
-  f8:	8a 11 60 01 	or  %g5, 1, %g5	! ffff0001 <\*ABS\*\+(0x|)ffff0001>
+  f8:	82 10 20 01 	mov  1, %g1
   fc:	83 28 70 20 	sllx  %g1, 0x20, %g1
  100:	8a 11 40 01 	or  %g5, %g1, %g5
  104:	82 10 20 01 	mov  1, %g1
- 108:	0b 3f ff c0 	sethi  %hi\(0xffff0000\), %g5
+ 108:	8a 10 20 01 	mov  1, %g5
  10c:	83 28 70 20 	sllx  %g1, 0x20, %g1
  110:	8a 11 40 01 	or  %g5, %g1, %g5
- 114:	82 10 20 01 	mov  1, %g1
- 118:	8a 10 20 01 	mov  1, %g5
- 11c:	83 28 70 20 	sllx  %g1, 0x20, %g1
- 120:	8a 11 40 01 	or  %g5, %g1, %g5
+ 114:	05 00 00 00 	sethi  %hi\((0x|)0\), %g2
+			114: R_SPARC_HI22	.text
+ 118:	84 10 a0 00 	mov  %g2, %g2	! 0 <foo>
+			118: R_SPARC_LO10	.text
+ 11c:	07 1d 95 0c 	sethi  %hi\(0x76543000\), %g3
+ 120:	86 10 e2 10 	or  %g3, 0x210, %g3	! 76543210 <(\*ABS\*|foo)\+0x76543210>
+ 124:	88 10 20 00 	clr  %g4
+ 128:	0b 00 00 3f 	sethi  %hi\(0xfc00\), %g5
+ 12c:	8a 11 63 ff 	or  %g5, 0x3ff, %g5	! ffff <(\*ABS\*|foo)\+0xffff>
+ 130:	05 00 00 00 	sethi  %hi\((0x|)0\), %g2
+			130: R_SPARC_HI22	.text
+ 134:	84 10 a0 00 	mov  %g2, %g2	! 0 <foo>
+			134: R_SPARC_LO10	.text
+ 138:	85 38 80 00 	signx  %g2
+ 13c:	07 1d 95 0c 	sethi  %hi\(0x76543000\), %g3
+ 140:	86 10 e2 10 	or  %g3, 0x210, %g3	! 76543210 <(\*ABS\*|foo)\+0x76543210>
+ 144:	88 10 20 00 	clr  %g4
+ 148:	0b 00 00 3f 	sethi  %hi\(0xfc00\), %g5
+ 14c:	8a 11 63 ff 	or  %g5, 0x3ff, %g5	! ffff <(\*ABS\*|foo)\+0xffff>
+ 150:	82 10 3f ff 	mov  -1, %g1
+ 154:	05 1f ff ff 	sethi  %hi\(0x7ffffc00\), %g2
+ 158:	84 10 a3 ff 	or  %g2, 0x3ff, %g2	! 7fffffff <(\*ABS\*|foo)\+0x7fffffff>
+ 15c:	07 00 00 3f 	sethi  %hi\(0xfc00\), %g3
+ 160:	86 18 fc 00 	xor  %g3, -1024, %g3
+ 164:	88 10 3f ff 	mov  -1, %g4
diff --git a/gas/testsuite/gas/sparc/set64.s b/gas/testsuite/gas/sparc/set64.s
index 92dc931..825036d 100644
--- a/gas/testsuite/gas/sparc/set64.s
+++ b/gas/testsuite/gas/sparc/set64.s
@@ -1,5 +1,4 @@
 # sparc64 set insn handling (includes set, setuw, setsw, setx)
-# FIXME: setuw,setsw not tested for yet.
 
 foo:
 	set foo,%g2
@@ -41,3 +40,17 @@
 	setx 0x00000001ffff0001,%g1,%g5		! test hm10,hi22,lo10
 	setx 0x00000001ffff0000,%g1,%g5		! test hm10,hi22
 	setx 0x0000000100000001,%g1,%g5		! test hm10,lo10
+
+	setuw foo,%g2
+	setuw 0x76543210,%g3
+	setuw 0,%g4
+	setuw 65535,%g5
+
+	setsw foo,%g2
+	setsw 0x76543210,%g3
+	setsw 0,%g4
+	setsw 65535,%g5
+	setsw 0xffffffff,%g1
+	setsw 0x7fffffff,%g2
+	setsw 0xffff0000,%g3
+	setsw -1,%g4
diff --git a/gas/testsuite/gas/sparc/sparc.exp b/gas/testsuite/gas/sparc/sparc.exp
index 1a79358..17dcaaa 100644
--- a/gas/testsuite/gas/sparc/sparc.exp
+++ b/gas/testsuite/gas/sparc/sparc.exp
@@ -5,20 +5,29 @@
 # disassembly.  The way to fix this is to include a hex dump of the insns
 # and test that as well.  Later.
 
-if [istarget sparc*-*-*] {
-    run_dump_test "synth"
+# Find out if these binutils are either sparc64*-*-* or
+# sparc*-*-* with --enable-targets=sparc64-*-*
+proc gas_64_check { } {
+    global NM
+    global NMFLAGS
+    global srcdir
+
+    catch "exec $srcdir/lib/run $NM $NMFLAGS --help" nm_help
+    return [regexp "elf64\[_-\]sparc" $nm_help];
 }
 
-
-if [istarget sparc64*-*-*] {
-    run_dump_test "asi"
-    run_dump_test "membar"
-    run_dump_test "prefetch"
-    run_dump_test "set64"
-    run_dump_test "synth64"
-    run_dump_test "rdpr"
-    run_dump_test "wrpr"
-    run_dump_test "reloc64"
+if [istarget sparc*-*-*] {
+    run_dump_test "synth"
+    if [gas_64_check] {
+	run_dump_test "asi"
+	run_dump_test "membar"
+	run_dump_test "prefetch"
+	run_dump_test "set64"
+	run_dump_test "synth64"
+	run_dump_test "rdpr"
+	run_dump_test "wrpr"
+	run_dump_test "reloc64"
+    }
 }
 
 if [istarget sparclet*-*-*] {
diff --git a/gas/testsuite/gas/sparc/synth64.d b/gas/testsuite/gas/sparc/synth64.d
index a29dab7..8b6c8c8 100644
--- a/gas/testsuite/gas/sparc/synth64.d
+++ b/gas/testsuite/gas/sparc/synth64.d
@@ -1,4 +1,4 @@
-#as: -Av9
+#as: -64 -Av9
 #objdump: -dr --prefix-addresses
 #name: sparc64 synth64
 
@@ -17,3 +17,5 @@
 0+0024 <foo\+(0x|)20> clrx  \[ %g1 \+ 1 \]
 0+0028 <foo\+(0x|)24> clrx  \[ %g1 \+ 0x2a \]
 0+002c <foo\+(0x|)28> clrx  \[ 0x42 \]
+0+0030 <foo\+(0x|)2c> signx  %g1
+0+0034 <foo\+(0x|)30> clruw  %g2
diff --git a/gas/testsuite/gas/sparc/synth64.s b/gas/testsuite/gas/sparc/synth64.s
index 659f3c2..3cab873 100644
--- a/gas/testsuite/gas/sparc/synth64.s
+++ b/gas/testsuite/gas/sparc/synth64.s
@@ -14,3 +14,6 @@
 	clrx [%g1+1]
 	clrx [42+%g1]
 	clrx [0x42]
+
+	signx %g1
+	clruw %g2
diff --git a/gas/testsuite/gas/sparc/wrpr.d b/gas/testsuite/gas/sparc/wrpr.d
index e75dcb8..1d3c80e 100644
--- a/gas/testsuite/gas/sparc/wrpr.d
+++ b/gas/testsuite/gas/sparc/wrpr.d
@@ -1,4 +1,4 @@
-#as: -Av9
+#as: -64 -Av9
 #objdump: -dr
 #name: sparc64 wrpr
 
diff --git a/gas/testsuite/gas/vtable/vtable.exp b/gas/testsuite/gas/vtable/vtable.exp
index 5d14451..f970772 100644
--- a/gas/testsuite/gas/vtable/vtable.exp
+++ b/gas/testsuite/gas/vtable/vtable.exp
@@ -15,14 +15,21 @@
 }
 
 # Vtable bits are only supported by ELF targets.
-if {[istarget "*-*-elf*"] || [istarget "*-*-linux*"]} then {
-
+if { ([istarget "*-*-elf*"]		
+      || [istarget "*-*-linux*"])
+     && ![istarget *-*-linux*aout*]
+     && ![istarget *-*-linux*oldld*] } then {
 
     # not supported by D30V
     if {[istarget "d30v-*-*"]} {
       return
     }
 
+    # not yet supported by i960
+    if {[istarget "i960-*-*"]} {
+      return
+    }
+
     run_dump_test "inherit0" 
     run_list_test "inherit1" "-al"
 
diff --git a/gas/write.c b/gas/write.c
index 18e6e10..0c28ac7 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -1,5 +1,5 @@
 /* write.c - emit .o file
-   Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -382,7 +382,7 @@
 
 static void
 renumber_sections (abfd, sec, countparg)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      PTR countparg;
 {
@@ -433,9 +433,9 @@
 
 static void
 chain_frchains_together (abfd, section, xxx)
-     bfd *abfd;			/* unused */
+     bfd *abfd ATTRIBUTE_UNUSED;
      segT section;
-     PTR xxx;			/* unused */
+     PTR xxx ATTRIBUTE_UNUSED;
 {
   segment_info_type *info;
 
@@ -498,8 +498,9 @@
 			  - fragP->fr_fix) / fragP->fr_var;
       if (fragP->fr_offset < 0)
 	{
-	  as_bad (_("attempt to .org/.space backwards? (%ld)"),
-		  (long) fragP->fr_offset);
+	  as_bad_where (fragP->fr_file, fragP->fr_line,
+			_("attempt to .org/.space backwards? (%ld)"),
+			(long) fragP->fr_offset);
 	}
       fragP->fr_type = rs_fill;
       break;
@@ -578,7 +579,7 @@
 relax_and_size_seg (abfd, sec, xxx)
      bfd *abfd;
      asection *sec;
-     PTR xxx;
+     PTR xxx ATTRIBUTE_UNUSED;
 {
   flagword flags;
   fragS *fragp;
@@ -688,9 +689,9 @@
 
 static void
 adjust_reloc_syms (abfd, sec, xxx)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
-     PTR xxx;
+     PTR xxx ATTRIBUTE_UNUSED;
 {
   segment_info_type *seginfo = seg_info (sec);
   fixS *fixp;
@@ -719,23 +720,23 @@
 	   point.  It is possible to see unresolved expression
 	   symbols, though, since they are not in the regular symbol
 	   table.  */
-	if (sym != NULL && ! sym->sy_resolved)
+	if (sym != NULL)
 	  resolve_symbol_value (sym, 1);
 	
-	if (fixp->fx_subsy != NULL && ! fixp->fx_subsy->sy_resolved)
+	if (fixp->fx_subsy != NULL)
 	  resolve_symbol_value (fixp->fx_subsy, 1);
 
 	/* If this symbol is equated to an undefined symbol, convert
            the fixup to being against that symbol.  */
-	if (sym != NULL && sym->sy_value.X_op == O_symbol
+	if (sym != NULL && symbol_equated_p (sym)
 	    && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym)))
 	  {
-	    fixp->fx_offset += sym->sy_value.X_add_number;
-	    sym = sym->sy_value.X_add_symbol;
+	    fixp->fx_offset += symbol_get_value_expression (sym)->X_add_number;
+	    sym = symbol_get_value_expression (sym)->X_add_symbol;
 	    fixp->fx_addsy = sym;
 	  }
 
-	if (sym != NULL && sym->sy_mri_common)
+	if (sym != NULL && symbol_mri_common_p (sym))
 	  {
 	    /* These symbols are handled specially in fixup_segment.  */
 	    goto done;
@@ -752,10 +753,10 @@
                relocation unless TC_FORCE_RELOCATION returns 1.  */
 	    if (TC_FORCE_RELOCATION (fixp))
 	      {
-		fixp->fx_addsy->sy_used_in_reloc = 1;
+		symbol_mark_used_in_reloc (fixp->fx_addsy);
 #ifdef UNDEFINED_DIFFERENCE_OK
 		if (fixp->fx_subsy != NULL)
-		  fixp->fx_subsy->sy_used_in_reloc = 1;
+		  symbol_mark_used_in_reloc (fixp->fx_subsy);
 #endif
 	      }
 	    goto done;
@@ -769,22 +770,22 @@
 	if (bfd_is_und_section (symsec)
 	    || bfd_is_com_section (symsec))
 	  {
-	    fixp->fx_addsy->sy_used_in_reloc = 1;
+	    symbol_mark_used_in_reloc (fixp->fx_addsy);
 #ifdef UNDEFINED_DIFFERENCE_OK
 	    /* We have the difference of an undefined symbol and some
 	       other symbol.  Make sure to mark the other symbol as used
 	       in a relocation so that it will always be output.  */
 	    if (fixp->fx_subsy)
-	      fixp->fx_subsy->sy_used_in_reloc = 1;
+	      symbol_mark_used_in_reloc (fixp->fx_subsy);
 #endif
 	    goto done;
 	  }
 
-	/* Don't try to reduce relocs which refer to .linkonce
-           sections.  It can lead to confusion when a debugging
-           section refers to a .linkonce section.  I hope this will
-           always be correct.  */
-	if (symsec != sec)
+	/* Don't try to reduce relocs which refer to non-local symbols
+           in .linkonce sections.  It can lead to confusion when a
+           debugging section refers to a .linkonce section.  I hope
+           this will always be correct.  */
+	if (symsec != sec && ! S_IS_LOCAL (sym))
 	  {
 	    boolean linkonce;
 
@@ -805,10 +806,10 @@
 
 	    if (linkonce)
 	      {
-		fixp->fx_addsy->sy_used_in_reloc = 1;
+		symbol_mark_used_in_reloc (fixp->fx_addsy);
 #ifdef UNDEFINED_DIFFERENCE_OK
 		if (fixp->fx_subsy != NULL)
-		  fixp->fx_subsy->sy_used_in_reloc = 1;
+		  symbol_mark_used_in_reloc (fixp->fx_subsy);
 #endif
 		goto done;
 	      }
@@ -816,9 +817,9 @@
 
 	/* Since we're reducing to section symbols, don't attempt to reduce
 	   anything that's already using one.  */
-	if (sym->bsym->flags & BSF_SECTION_SYM)
+	if (symbol_section_p (sym))
 	  {
-	    fixp->fx_addsy->sy_used_in_reloc = 1;
+	    symbol_mark_used_in_reloc (fixp->fx_addsy);
 	    goto done;
 	  }
 
@@ -829,7 +830,7 @@
            the wrong area of memory.  */
 	if (S_IS_WEAK (sym))
 	  {
-	    fixp->fx_addsy->sy_used_in_reloc = 1;
+	    symbol_mark_used_in_reloc (fixp->fx_addsy);
 	    goto done;
 	  }
 #endif
@@ -839,7 +840,7 @@
 #ifdef obj_fix_adjustable
 	if (! obj_fix_adjustable (fixp))
 	  {
-	    fixp->fx_addsy->sy_used_in_reloc = 1;
+	    symbol_mark_used_in_reloc (fixp->fx_addsy);
 	    goto done;
 	  }
 #endif
@@ -850,7 +851,7 @@
 #ifdef tc_fix_adjustable
 	if (! tc_fix_adjustable (fixp))
 	  {
-	    fixp->fx_addsy->sy_used_in_reloc = 1;
+	    symbol_mark_used_in_reloc (fixp->fx_addsy);
 	    goto done;
 	  }
 #endif
@@ -864,7 +865,7 @@
 	   the section when it calls resolve_symbol_value. */
 	fixp->fx_offset += S_GET_VALUE (sym);
 	fixp->fx_addsy = section_symbol (S_GET_SEGMENT (sym));
-	fixp->fx_addsy->sy_used_in_reloc = 1;
+	symbol_mark_used_in_reloc (fixp->fx_addsy);
 
       done:
 	;
@@ -889,7 +890,7 @@
 write_relocs (abfd, sec, xxx)
      bfd *abfd;
      asection *sec;
-     PTR xxx;
+     PTR xxx ATTRIBUTE_UNUSED;
 {
   segment_info_type *seginfo = seg_info (sec);
   int i;
@@ -931,17 +932,17 @@
          symbol, then use generate the reloc against the latter symbol
          rather than the former.  */
       sym = fixp->fx_addsy;
-      while (sym->sy_value.X_op == O_symbol
+      while (symbol_equated_p (sym)
 	     && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym)))
 	{
 	  symbolS *n;
 
 	  /* We must avoid looping, as that can occur with a badly
 	     written program.  */
-	  n = sym->sy_value.X_add_symbol;
+	  n = symbol_get_value_expression (sym)->X_add_symbol;
 	  if (n == sym)
 	    break;
-	  fixp->fx_offset += sym->sy_value.X_add_number;
+	  fixp->fx_offset += symbol_get_value_expression (sym)->X_add_number;
 	  sym = n;
 	}
       fixp->fx_addsy = sym;
@@ -1004,9 +1005,9 @@
          symbol, then use generate the reloc against the latter symbol
          rather than the former.  */
       sym = fixp->fx_addsy;
-      while (sym->sy_value.X_op == O_symbol
+      while (symbol_equated_p (sym)
 	     && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym)))
-	sym = sym->sy_value.X_add_symbol;
+	sym = symbol_get_value_expression (sym)->X_add_symbol;
       fixp->fx_addsy = sym;
 
       reloc = tc_gen_reloc (sec, fixp);
@@ -1088,9 +1089,9 @@
 
 static void
 write_contents (abfd, sec, xxx)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
-     PTR xxx;
+     PTR xxx ATTRIBUTE_UNUSED;
 {
   segment_info_type *seginfo = seg_info (sec);
   unsigned long offset = 0;
@@ -1333,8 +1334,8 @@
       symp = symbol_rootP;
       for (i = 0; i < nsyms; i++, symp = symbol_next (symp))
 	{
-	  asympp[i] = symp->bsym;
-	  symp->written = 1;
+	  asympp[i] = symbol_get_bfdsym (symp);
+	  symbol_mark_written (symp);
 	}
     }
   else
@@ -1372,7 +1373,8 @@
          any alignment is meaningless, and, moreover, will look weird
          if we are generating a listing.  */
       frag_align (had_errors () ? 0 : SUB_SEGMENT_ALIGN (now_seg),
-		  NOP_OPCODE, 0);
+		  subseg_text_p (now_seg) ? NOP_OPCODE : 0,
+		  0);
 
       /* frag_align will have left a new frag.
 	 Use this last frag for an empty ".fill".
@@ -1623,7 +1625,7 @@
 	    /* This is the offset from ??? to table_ptr+0 */
 	    to_addr = table_addr - S_GET_VALUE (lie->sub);
 #ifdef BFD_ASSEMBLER
-	    to_addr -= lie->sub->sy_frag->fr_address;
+	    to_addr -= symbol_get_frag (lie->sub)->fr_address;
 #endif
 	    md_number_to_chars (lie->word_goes_here, to_addr, 2);
 	    for (untruth = lie->next_broken_word; untruth && untruth->dispfrag == fragP; untruth = untruth->next_broken_word)
@@ -1637,7 +1639,7 @@
 	    from_addr = table_addr;
 	    to_addr = S_GET_VALUE (lie->add) + lie->addnum;
 #ifdef BFD_ASSEMBLER
-	    to_addr += lie->add->sy_frag->fr_address;
+	    to_addr += symbol_get_frag (lie->add)->fr_address;
 #endif
 	    md_create_long_jump (table_ptr, from_addr, to_addr, lie->dispfrag, lie->add);
 	    table_ptr += md_long_jump_size;
@@ -1770,9 +1772,9 @@
       symbolS *symp;
 
       for (symp = symbol_rootP; symp; symp = symbol_next (symp))
-	if (!symp->sy_resolved)
-	  resolve_symbol_value (symp, 1);
+	resolve_symbol_value (symp, 1);
     }
+  resolve_local_symbol_values ();
 
   PROGRESS (1);
 
@@ -1795,7 +1797,7 @@
 	  int punt = 0;
 	  const char *name;
 
-	  if (symp->sy_mri_common)
+	  if (symbol_mri_common_p (symp))
 	    {
 	      if (S_IS_EXTERNAL (symp))
 		as_bad (_("%s: global symbols not supported in common sections"),
@@ -1817,23 +1819,11 @@
 	  /* Do it again, because adjust_reloc_syms might introduce
 	     more symbols.  They'll probably only be section symbols,
 	     but they'll still need to have the values computed.  */
-	  if (! symp->sy_resolved)
-	    {
-	      if (symp->sy_value.X_op == O_constant)
-		{
-		  /* This is the normal case; skip the call.  */
-		  S_SET_VALUE (symp,
-			       (S_GET_VALUE (symp)
-				+ symp->sy_frag->fr_address));
-		  symp->sy_resolved = 1;
-		}
-	      else
-		resolve_symbol_value (symp, 1);
-	    }
+	  resolve_symbol_value (symp, 1);
 
 	  /* Skip symbols which were equated to undefined or common
              symbols.  */
-	  if (symp->sy_value.X_op == O_symbol
+	  if (symbol_equated_p (symp)
 	      && (! S_IS_DEFINED (symp) || S_IS_COMMON (symp)))
 	    {
 	      symbol_remove (symp, &symbol_rootP, &symbol_lastP);
@@ -1849,15 +1839,15 @@
 	  printf ("symbol `%s'\n\t@%x: value=%d flags=%x seg=%s\n",
 		  S_GET_NAME (symp), symp,
 		  S_GET_VALUE (symp),
-		  symp->bsym->flags,
-		  segment_name (symp->bsym->section));
+		  symbol_get_bfdsym (symp)->flags,
+		  segment_name (S_GET_SEGMENT (symp)));
 #endif
 
 #ifdef obj_frob_symbol
 	  obj_frob_symbol (symp, punt);
 #endif
 #ifdef tc_frob_symbol
-	  if (! punt || symp->sy_used_in_reloc)
+	  if (! punt || symbol_used_in_reloc_p (symp))
 	    tc_frob_symbol (symp, punt);
 #endif
 
@@ -1867,13 +1857,13 @@
 	     and symbols that the frob_symbol macros told us to punt,
 	     but we keep such symbols if they are used in relocs.  */
 	  if ((! EMIT_SECTION_SYMBOLS
-	       && (symp->bsym->flags & BSF_SECTION_SYM) != 0)
+	       && symbol_section_p (symp))
 	      /* Note that S_IS_EXTERN and S_IS_LOCAL are not always
 		 opposites.  Sometimes the former checks flags and the
 		 latter examines the name...  */
 	      || (!S_IS_EXTERN (symp)
 		  && (S_IS_LOCAL (symp) || punt)
-		  && ! symp->sy_used_in_reloc))
+		  && ! symbol_used_in_reloc_p (symp)))
 	    {
 	      symbol_remove (symp, &symbol_rootP, &symbol_lastP);
 	      /* After symbol_remove, symbol_next(symp) still returns
@@ -1884,16 +1874,16 @@
 	    }
 
 	  /* Make sure we really got a value for the symbol.  */
-	  if (! symp->sy_resolved)
+	  if (! symbol_resolved_p (symp))
 	    {
 	      as_bad (_("can't resolve value for symbol \"%s\""),
 		      S_GET_NAME (symp));
-	      symp->sy_resolved = 1;
+	      symbol_mark_resolved (symp);
 	    }
 
 	  /* Set the value into the BFD symbol.  Up til now the value
 	     has only been kept in the gas symbolS struct.  */
-	  symp->bsym->value = S_GET_VALUE (symp);
+	  symbol_get_bfdsym (symp)->value = S_GET_VALUE (symp);
 	}
     }
 
@@ -2002,9 +1992,7 @@
 #endif
       know (!(S_GET_SEGMENT (symbolP) == absolute_section)
 	    || symbolP->sy_frag == &zero_address_frag);
-      target +=
-	S_GET_VALUE (symbolP)
-	  + symbolP->sy_frag->fr_address;
+      target +=	S_GET_VALUE (symbolP) + symbol_get_frag (symbolP)->fr_address;
 
       /* If frag has yet to be reached on this pass,
 	 assume it will move by STRETCH just as we did.
@@ -2015,8 +2003,8 @@
 
 	 There should be a faster way to do this.  */
 
-      if (symbolP->sy_frag->fr_address >= was_address
-	  && is_dnrange (fragP, symbolP->sy_frag))
+      if (symbol_get_frag (symbolP)->fr_address >= was_address
+	  && is_dnrange (fragP, symbol_get_frag (symbolP)))
 	{
 	  target += stretch;
 	}
@@ -2225,10 +2213,10 @@
 		      if (lie->added)
 			continue;
 
-		      offset = (lie->add->sy_frag->fr_address
+		      offset = (symbol_get_frag (lie->add)->fr_address
 				+ S_GET_VALUE (lie->add)
 				+ lie->addnum
-				- (lie->sub->sy_frag->fr_address
+				- (symbol_get_frag (lie->sub)->fr_address
 				   + S_GET_VALUE (lie->sub)));
 		      if (offset <= -32768 || offset >= 32767)
 			{
@@ -2250,8 +2238,10 @@
 			  for (untruth = lie->next_broken_word;
 			       untruth && untruth->dispfrag == lie->dispfrag;
 			       untruth = untruth->next_broken_word)
-			    if ((untruth->add->sy_frag == lie->add->sy_frag)
-				&& S_GET_VALUE (untruth->add) == S_GET_VALUE (lie->add))
+			    if ((symbol_get_frag (untruth->add)
+				 == symbol_get_frag (lie->add))
+				&& (S_GET_VALUE (untruth->add)
+				    == S_GET_VALUE (lie->add)))
 			      {
 				untruth->added = 2;
 				untruth->use_jump = lie;
@@ -2301,8 +2291,8 @@
 		      know (!(S_GET_SEGMENT (symbolP) == SEG_ABSOLUTE)
 			    || (symbolP->sy_frag == &zero_address_frag));
 #endif
-		      target += S_GET_VALUE (symbolP)
-			+ symbolP->sy_frag->fr_address;
+		      target += (S_GET_VALUE (symbolP)
+				 + symbol_get_frag (symbolP)->fr_address);
 		    }		/* if we have a symbol */
 
 		  know (fragP->fr_next);
@@ -2313,8 +2303,16 @@
 		      /* Growth may be negative, but variable part of frag
 			 cannot have fewer than 0 chars.  That is, we can't
 			 .org backwards. */
-		      as_bad (_("attempt to .org backwards ignored"));
-		      growth = 0;
+		      as_bad_where (fragP->fr_file, fragP->fr_line,
+				    _("attempt to .org backwards ignored"));
+
+		      /* We've issued an error message.  Change the
+                         frag to avoid cascading errors.  */
+		      fragP->fr_type = rs_align;
+		      fragP->fr_subtype = 0;
+		      fragP->fr_offset = 0;
+		      fragP->fr_fix = after - address;
+		      growth = stretch;
 		    }
 
 		  growth -= stretch;	/* This is an absolute growth factor */
@@ -2325,7 +2323,7 @@
 		if (symbolP)
 		  {
 		    growth = S_GET_VALUE (symbolP);
-		    if (symbolP->sy_frag != &zero_address_frag
+		    if (symbol_get_frag (symbolP) != &zero_address_frag
 			|| S_IS_COMMON (symbolP)
 			|| ! S_IS_DEFINED (symbolP))
 		      as_bad_where (fragP->fr_file, fragP->fr_line,
@@ -2465,12 +2463,13 @@
       plt = fixP->fx_plt;
 
       if (add_symbolP != NULL
-	  && add_symbolP->sy_mri_common)
+	  && symbol_mri_common_p (add_symbolP))
 	{
 	  know (add_symbolP->sy_value.X_op == O_symbol);
 	  add_number += S_GET_VALUE (add_symbolP);
 	  fixP->fx_offset = add_number;
-	  add_symbolP = fixP->fx_addsy = add_symbolP->sy_value.X_add_symbol;
+	  add_symbolP = fixP->fx_addsy =
+	    symbol_get_value_expression (add_symbolP)->X_add_symbol;
 	}
 
       if (add_symbolP)
@@ -2682,12 +2681,14 @@
 #if !(defined (TC_V850) && defined (OBJ_ELF))
 #if !(defined (TC_M68K) && defined (OBJ_ELF))
 #if !(defined (TC_ARM)  && defined (OBJ_ELF))
+#if !(defined (TC_I960) && defined (OBJ_ELF))
 #if !defined (TC_I386) || !(defined (OBJ_ELF) || defined (OBJ_COFF)) || defined (TE_PE)
 		  add_number += S_GET_VALUE (add_symbolP);
 #endif
 #endif
 #endif
 #endif
+#endif
 		}
 	    }
 	}
@@ -2702,11 +2703,32 @@
 #else
 	      fixP->fx_addsy = section_symbol (absolute_section);
 #endif
-	      fixP->fx_addsy->sy_used_in_reloc = 1;
+	      symbol_mark_used_in_reloc (fixP->fx_addsy);
 	      ++seg_reloc_count;
 	    }
 	}
 
+      if (!fixP->fx_done)
+	{
+#ifdef MD_APPLY_FIX3
+	  md_apply_fix3 (fixP, &add_number, this_segment_type);
+#else
+#ifdef BFD_ASSEMBLER
+	  md_apply_fix (fixP, &add_number);
+#else
+	  md_apply_fix (fixP, add_number);
+#endif
+#endif
+
+#ifndef TC_HANDLES_FX_DONE
+	  /* If the tc-* files haven't been converted, assume it's handling
+	     it the old way, where a null fx_addsy means that the fix has
+	     been applied completely, and no further work is needed.  */
+	  if (fixP->fx_addsy == 0 && fixP->fx_pcrel == 0)
+	    fixP->fx_done = 1;
+#endif
+	}
+
       if (!fixP->fx_bit_fixP && !fixP->fx_no_overflow && size > 0)
 	{
 	  if ((size_t) size < sizeof (valueT))
@@ -2755,28 +2777,9 @@
 #endif
 	}			/* not a bit fix */
 
-      if (!fixP->fx_done)
-	{
-#ifdef MD_APPLY_FIX3
-	  md_apply_fix3 (fixP, &add_number, this_segment_type);
-#else
-#ifdef BFD_ASSEMBLER
-	  md_apply_fix (fixP, &add_number);
-#else
-	  md_apply_fix (fixP, add_number);
-#endif
-#endif
-
-#ifndef TC_HANDLES_FX_DONE
-	  /* If the tc-* files haven't been converted, assume it's handling
-	     it the old way, where a null fx_addsy means that the fix has
-	     been applied completely, and no further work is needed.  */
-	  if (fixP->fx_addsy == 0 && fixP->fx_pcrel == 0)
-	    fixP->fx_done = 1;
-#endif
-	}
 #ifdef TC_VALIDATE_FIX
-    skip: ;
+    skip:  ATTRIBUTE_UNUSED_LABEL
+      ;
 #endif
 #ifdef DEBUG5
       fprintf (stderr, "result:\n");
@@ -2824,7 +2827,7 @@
 write_print_statistics (file)
      FILE *file;
 {
-  fprintf (stderr, "fixups: %d\n", n_fixups);
+  fprintf (file, "fixups: %d\n", n_fixups);
 }
 
 /* for debugging */
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 24626c2..25daa3f 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,32 @@
+1999-07-15  Ian Lance Taylor  <ian@zembu.com>
+
+	* configure.in: Bump version number to 2.9.5.
+	* configure: Rebuild.
+
+1999-07-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* corefile.c (core_create_function_syms): Add ATTRIBUTED_UNUSED.
+	* sym-ids.c (non_existent_file): Fully initialize structure.
+
+1999-07-01  Ian Lance Taylor  <ian@zembu.com>
+
+	* Many files: Add casts in many print statements to cast bfd_vma
+	values to unsigned long when calling printf.
+	* Makefile.am ($(OBJECTS)): Add gmon.h.
+	* Makefile.in: Rebuild.
+
+Mon Jun 14 10:35:28 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* gprof.texi: Fix typo.
+
+1999-06-13  Ian Lance Taylor  <ian@zembu.com>
+
+	From Bob Byrnes <byrnes@curl.com>:
+	* cg_dfn.c: Include "libiberty.h"
+	(DFN_INCR_DEPTH): Define instead of DFN_DEPTH.
+	(dfn_stack): Define as pointer rather than array.
+	(pre_visit): Reallocate dfn_stack as needed.
+
 1999-04-26  Tom Tromey  <tromey@cygnus.com>
 
 	* aclocal.m4, configure: Updated for new version of libtool.
diff --git a/gprof/Makefile.am b/gprof/Makefile.am
index 7ae1492..f71e4c5 100644
--- a/gprof/Makefile.am
+++ b/gprof/Makefile.am
@@ -45,7 +45,7 @@
 
 # Dependencies.
 $(OBJECTS): ../bfd/bfd.h call_graph.h cg_arcs.h cg_print.h \
-	corefile.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \
+	corefile.h gmon_io.h gmon.h gmon_out.h gprof.h hertz.h hist.h \
 	search_list.h source.h sym_ids.h symtab.h utils.h \
 	$(srcdir)/../include/libiberty.h $(srcdir)/../bfd/sysdep.h \
 	gconfig.h ../bfd/config.h
diff --git a/gprof/Makefile.in b/gprof/Makefile.in
index 4aadd88..a710aa1 100644
--- a/gprof/Makefile.in
+++ b/gprof/Makefile.in
@@ -169,7 +169,7 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = tar
+TAR = gtar
 GZIP_ENV = --best
 SOURCES = $(gprof_SOURCES)
 OBJECTS = $(gprof_OBJECTS)
@@ -693,7 +693,7 @@
 
 # Dependencies.
 $(OBJECTS): ../bfd/bfd.h call_graph.h cg_arcs.h cg_print.h \
-	corefile.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \
+	corefile.h gmon_io.h gmon.h gmon_out.h gprof.h hertz.h hist.h \
 	search_list.h source.h sym_ids.h symtab.h utils.h \
 	$(srcdir)/../include/libiberty.h $(srcdir)/../bfd/sysdep.h \
 	gconfig.h ../bfd/config.h
diff --git a/gprof/alpha.c b/gprof/alpha.c
index ad4f22e..8aad74d 100644
--- a/gprof/alpha.c
+++ b/gprof/alpha.c
@@ -104,7 +104,8 @@
       p_highpc = s_highpc;
     }
   DBG (CALLDEBUG, printf (_("[find_call] %s: 0x%lx to 0x%lx\n"),
-			  parent->name, p_lowpc, p_highpc));
+			  parent->name, (unsigned long) p_lowpc,
+			  (unsigned long) p_highpc));
   for (pc = (alpha_Instruction *) (p_lowpc + delta);
        pc < (alpha_Instruction *) (p_highpc + delta);
        ++pc)
@@ -125,7 +126,7 @@
 	    {
 	      DBG (CALLDEBUG,
 		   printf (_("[find_call] 0x%lx: jsr%s <indirect_child>\n"),
-			   (bfd_vma) pc - delta,
+			   (unsigned long) pc - delta,
 			   pc->j.func == Jxx_FUNC_JSR ? "" : "_coroutine"));
 	      arc_add (parent, &indirect_child, (unsigned long) 0);
 	    }
@@ -133,7 +134,8 @@
 
 	case OP_BSR:
 	  DBG (CALLDEBUG,
-	       printf (_("[find_call] 0x%lx: bsr"), (bfd_vma) pc - delta));
+	       printf (_("[find_call] 0x%lx: bsr"),
+		       (unsigned long) pc - delta));
 	  /*
 	   * Regular PC relative addressing.  Check that this is the
 	   * address of a function.  The linker sometimes redirects
@@ -146,7 +148,8 @@
 	      child = sym_lookup (&symtab, dest_pc);
 	      DBG (CALLDEBUG,
 		   printf (" 0x%lx\t; name=%s, addr=0x%lx",
-			   dest_pc, child->name, child->addr));
+			   (unsigned long) dest_pc, child->name,
+			   (unsigned long) child->addr));
 	      if (child->addr == dest_pc || child->addr == dest_pc - 8)
 		{
 		  DBG (CALLDEBUG, printf ("\n"));
diff --git a/gprof/basic_blocks.c b/gprof/basic_blocks.c
index 07b6f8d..43dd762b 100644
--- a/gprof/basic_blocks.c
+++ b/gprof/basic_blocks.c
@@ -190,7 +190,8 @@
 
 	      DBG (BBDEBUG,
 		   printf ("[bb_read_rec] 0x%lx->0x%lx (%s:%d) cnt=%lu\n",
-			   addr, sym->addr, sym->name, sym->line_num, ncalls));
+			   (unsigned long) addr, (unsigned long) sym->addr,
+			   sym->name, sym->line_num, ncalls));
 
 	      for (i = 0; i < NBBS; i++)
 		{
@@ -319,17 +320,20 @@
     {
       if (sym->ncalls > 0 || ! ignore_zeros)
 	{
+	  /* FIXME: This only works if bfd_vma is unsigned long.  */
 	  printf (_("%s:%d: (%s:0x%lx) %lu executions\n"),
 		  sym->file ? sym->file->name : _("<unknown>"), sym->line_num,
-		  sym->name, sym->addr, sym->ncalls);
+		  sym->name, (unsigned long) sym->addr, sym->ncalls);
 	}
       for (j = 0; j < NBBS && sym->bb_addr[j]; j ++)
 	{
 	  if (sym->bb_calls[j] > 0 || ! ignore_zeros)
 	    {
+	      /* FIXME: This only works if bfd_vma is unsigned long.  */
 	      printf (_("%s:%d: (%s:0x%lx) %lu executions\n"),
 		      sym->file ? sym->file->name : _("<unknown>"), sym->line_num,
-		      sym->name, sym->bb_addr[j], sym->bb_calls[j]);
+		      sym->name, (unsigned long) sym->bb_addr[j],
+		      sym->bb_calls[j]);
 	    }
 	}
     }
diff --git a/gprof/call_graph.c b/gprof/call_graph.c
index 8f12cbd..6eee251 100644
--- a/gprof/call_graph.c
+++ b/gprof/call_graph.c
@@ -76,7 +76,7 @@
   count = bfd_get_32 (core_bfd, (bfd_byte *) arc.count);
   DBG (SAMPLEDEBUG,
        printf ("[cg_read_rec] frompc 0x%lx selfpc 0x%lx count %lu\n",
-	       from_pc, self_pc, count));
+	       (unsigned long) from_pc, (unsigned long) self_pc, count));
   /* add this arc: */
   cg_tally (from_pc, self_pc, count);
 }
@@ -110,7 +110,8 @@
 	    }
 	  DBG (SAMPLEDEBUG,
 	     printf ("[cg_write_arcs] frompc 0x%lx selfpc 0x%lx count %lu\n",
-		     arc->parent->addr, arc->child->addr, arc->count));
+		     (unsigned long) arc->parent->addr,
+		     (unsigned long) arc->child->addr, arc->count));
 	}
     }
 }
diff --git a/gprof/cg_dfn.c b/gprof/cg_dfn.c
index c9e37ab..02d64e7 100644
--- a/gprof/cg_dfn.c
+++ b/gprof/cg_dfn.c
@@ -17,13 +17,14 @@
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 #include <stdio.h>
+#include "libiberty.h"
 #include "gprof.h"
 #include "cg_arcs.h"
 #include "cg_dfn.h"
 #include "symtab.h"
 #include "utils.h"
 
-#define	DFN_DEPTH	100
+#define	DFN_INCR_DEPTH (128)
 
 typedef struct
   {
@@ -32,7 +33,8 @@
   }
 DFN_Stack;
 
-DFN_Stack dfn_stack[DFN_DEPTH];
+DFN_Stack *dfn_stack = NULL;
+int dfn_maxdepth = 0;
 int dfn_depth = 0;
 int dfn_counter = DFN_NAN;
 
@@ -194,11 +196,13 @@
 DEFUN (pre_visit, (parent), Sym * parent)
 {
   ++dfn_depth;
-  if (dfn_depth >= DFN_DEPTH)
+
+  if (dfn_depth >= dfn_maxdepth)
     {
-      fprintf (stderr, "[pre_visit] dfn_stack overflow\n");
-      done (1);
+      dfn_maxdepth += DFN_INCR_DEPTH;
+      dfn_stack = xrealloc (dfn_stack, dfn_maxdepth * sizeof *dfn_stack);
     }
+
   dfn_stack[dfn_depth].sym = parent;
   dfn_stack[dfn_depth].cycle_top = dfn_depth;
   parent->cg.top_order = DFN_BUSY;
diff --git a/gprof/configure b/gprof/configure
index 5ff5137..a47d71a 100755
--- a/gprof/configure
+++ b/gprof/configure
@@ -45,6 +45,7 @@
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -159,6 +160,7 @@
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
+  --site-file=FILE        use FILE as the site file
   --version               print the version of autoconf that created configure
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -329,6 +331,11 @@
   -site=* | --site=* | --sit=*)
     site="$ac_optarg" ;;
 
+  -site-file | --site-file | --site-fil | --site-fi | --site-f)
+    ac_prev=sitefile ;;
+  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+    sitefile="$ac_optarg" ;;
+
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -494,12 +501,16 @@
 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+  if test -z "$CONFIG_SITE"; then
+    if test "x$prefix" != xNONE; then
+      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+    else
+      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+    fi
   fi
+else
+  CONFIG_SITE="$sitefile"
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
@@ -586,7 +597,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:590: checking host system type" >&5
+echo "configure:601: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -607,7 +618,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:611: checking target system type" >&5
+echo "configure:622: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -625,7 +636,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:629: checking build system type" >&5
+echo "configure:640: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -660,7 +671,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:664: checking for a BSD compatible install" >&5
+echo "configure:675: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -713,7 +724,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:717: checking whether build environment is sane" >&5
+echo "configure:728: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -770,7 +781,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:774: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:785: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -799,7 +810,7 @@
 
 PACKAGE=gprof
 
-VERSION=2.9.4
+VERSION=2.9.5
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -816,7 +827,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:820: checking for working aclocal" >&5
+echo "configure:831: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -829,7 +840,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:833: checking for working autoconf" >&5
+echo "configure:844: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -842,7 +853,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:846: checking for working automake" >&5
+echo "configure:857: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -855,7 +866,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:859: checking for working autoheader" >&5
+echo "configure:870: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -868,7 +879,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:872: checking for working makeinfo" >&5
+echo "configure:883: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -954,7 +965,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:958: checking for $ac_word" >&5
+echo "configure:969: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -984,7 +995,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:988: checking for $ac_word" >&5
+echo "configure:999: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1014,7 +1025,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1018: checking for $ac_word" >&5
+echo "configure:1029: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1065,7 +1076,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1069: checking for $ac_word" >&5
+echo "configure:1080: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1097,7 +1108,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1101: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1112: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1108,12 +1119,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1112 "configure"
+#line 1123 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1139,12 +1150,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1143: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1154: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1148: checking whether we are using GNU C" >&5
+echo "configure:1159: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1153,7 +1164,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1172,7 +1183,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1176: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1187: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1215,7 +1226,7 @@
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1219: checking for ld used by GCC" >&5
+echo "configure:1230: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
     # Accept absolute paths.
@@ -1239,10 +1250,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1243: checking for GNU ld" >&5
+echo "configure:1254: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1246: checking for non-GNU ld" >&5
+echo "configure:1257: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1278,7 +1289,7 @@
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1282: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1293: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1294,7 +1305,7 @@
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1298: checking for BSD-compatible nm" >&5
+echo "configure:1309: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1332,7 +1343,7 @@
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:1336: checking command to parse $NM output" >&5
+echo "configure:1347: checking command to parse $NM output" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1395,11 +1406,11 @@
 int main(){nm_test_var='a';nm_test_func;return 0;}
 EOF
 
-  if { (eval echo configure:1399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:1410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     # Now try to grab the symbols.
     ac_nlist=conftest.nm
   
-    if { (eval echo configure:1403: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+    if { (eval echo configure:1414: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
 
       # Try sorting and uniquifying the output.
       if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
@@ -1451,7 +1462,7 @@
 	  ac_save_CFLAGS="$CFLAGS"
 	  LIBS="conftestm.$ac_objext"
 	  CFLAGS="$CFLAGS$no_builtin_flag"
-	  if { (eval echo configure:1455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+	  if { (eval echo configure:1466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
 	    ac_pipe_works=yes
 	  else
 	    echo "configure: failed program was:" >&5
@@ -1497,7 +1508,7 @@
 echo "$ac_t""$ac_result" 1>&6
 
 echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
-echo "configure:1501: checking for _ prefix in compiled symbols" >&5
+echo "configure:1512: checking for _ prefix in compiled symbols" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1506,10 +1517,10 @@
 void nm_test_func(){}
 int main(){nm_test_func;return 0;}
 EOF
-if { (eval echo configure:1510: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   # Now try to grab the symbols.
   ac_nlist=conftest.nm
-  if { (eval echo configure:1513: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+  if { (eval echo configure:1524: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
     # See whether the symbols have a leading underscore.
     if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
       ac_cv_sys_symbol_underscore=yes
@@ -1535,7 +1546,7 @@
 USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1539: checking whether ln -s works" >&5
+echo "configure:1550: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1577,8 +1588,8 @@
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1581 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1592 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1599,19 +1610,19 @@
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1603: checking whether the C compiler needs -belf" >&5
+echo "configure:1614: checking whether the C compiler needs -belf" >&5
 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1608 "configure"
+#line 1619 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -1634,7 +1645,7 @@
   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1638: checking for $ac_word" >&5
+echo "configure:1649: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1666,7 +1677,7 @@
   # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1670: checking for $ac_word" >&5
+echo "configure:1681: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1701,7 +1712,7 @@
 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
 set dummy ${ac_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1705: checking for $ac_word" >&5
+echo "configure:1716: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1733,7 +1744,7 @@
   # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1737: checking for $ac_word" >&5
+echo "configure:1748: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1871,7 +1882,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1875: checking for $ac_word" >&5
+echo "configure:1886: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1901,7 +1912,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1905: checking for $ac_word" >&5
+echo "configure:1916: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1952,7 +1963,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1956: checking for $ac_word" >&5
+echo "configure:1967: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1984,7 +1995,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1988: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1999: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1995,12 +2006,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1999 "configure"
+#line 2010 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2026,12 +2037,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2030: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2041: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2035: checking whether we are using GNU C" >&5
+echo "configure:2046: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2040,7 +2051,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2059,7 +2070,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2063: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2074: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2102,7 +2113,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2106: checking for a BSD compatible install" >&5
+echo "configure:2117: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2156,7 +2167,7 @@
 
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:2160: checking for POSIXized ISC" >&5
+echo "configure:2171: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -2179,7 +2190,7 @@
 
 ALL_LINGUAS=
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2183: checking how to run the C preprocessor" >&5
+echo "configure:2194: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2194,13 +2205,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2198 "configure"
+#line 2209 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2211,13 +2222,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2215 "configure"
+#line 2226 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2228,13 +2239,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2232 "configure"
+#line 2243 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2259,12 +2270,12 @@
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2263: checking for ANSI C header files" >&5
+echo "configure:2274: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2268 "configure"
+#line 2279 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2272,7 +2283,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2289,7 +2300,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2293 "configure"
+#line 2304 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2307,7 +2318,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2311 "configure"
+#line 2322 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2328,7 +2339,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2332 "configure"
+#line 2343 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2339,7 +2350,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2363,12 +2374,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2367: checking for working const" >&5
+echo "configure:2378: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2372 "configure"
+#line 2383 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2417,7 +2428,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2438,21 +2449,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2442: checking for inline" >&5
+echo "configure:2453: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 2449 "configure"
+#line 2460 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2478,12 +2489,12 @@
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2482: checking for off_t" >&5
+echo "configure:2493: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2487 "configure"
+#line 2498 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2511,12 +2522,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2515: checking for size_t" >&5
+echo "configure:2526: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2520 "configure"
+#line 2531 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2546,19 +2557,19 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2550: checking for working alloca.h" >&5
+echo "configure:2561: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2555 "configure"
+#line 2566 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:2562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -2579,12 +2590,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2583: checking for alloca" >&5
+echo "configure:2594: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2588 "configure"
+#line 2599 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -2612,7 +2623,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:2616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -2644,12 +2655,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2648: checking whether alloca needs Cray hooks" >&5
+echo "configure:2659: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2653 "configure"
+#line 2664 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -2674,12 +2685,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2678: checking for $ac_func" >&5
+echo "configure:2689: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2683 "configure"
+#line 2694 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2702,7 +2713,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2729,7 +2740,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2733: checking stack direction for C alloca" >&5
+echo "configure:2744: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2737,7 +2748,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2741 "configure"
+#line 2752 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -2756,7 +2767,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:2760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -2781,17 +2792,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2785: checking for $ac_hdr" >&5
+echo "configure:2796: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2790 "configure"
+#line 2801 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2820,12 +2831,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2824: checking for $ac_func" >&5
+echo "configure:2835: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2829 "configure"
+#line 2840 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2848,7 +2859,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2873,7 +2884,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2877: checking for working mmap" >&5
+echo "configure:2888: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2881,7 +2892,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 2885 "configure"
+#line 2896 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3021,7 +3032,7 @@
 }
 
 EOF
-if { (eval echo configure:3025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -3049,17 +3060,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3053: checking for $ac_hdr" >&5
+echo "configure:3064: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3058 "configure"
+#line 3069 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3089,12 +3100,12 @@
 __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3093: checking for $ac_func" >&5
+echo "configure:3104: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3098 "configure"
+#line 3109 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3117,7 +3128,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3146,12 +3157,12 @@
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3150: checking for $ac_func" >&5
+echo "configure:3161: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3155 "configure"
+#line 3166 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3174,7 +3185,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3208,19 +3219,19 @@
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3212: checking for LC_MESSAGES" >&5
+echo "configure:3223: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3217 "configure"
+#line 3228 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:3224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -3241,7 +3252,7 @@
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3245: checking whether NLS is requested" >&5
+echo "configure:3256: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -3261,7 +3272,7 @@
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3265: checking whether included gettext is requested" >&5
+echo "configure:3276: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -3280,17 +3291,17 @@
 
 	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3284: checking for libintl.h" >&5
+echo "configure:3295: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3289 "configure"
+#line 3300 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3307,19 +3318,19 @@
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:3311: checking for gettext in libc" >&5
+echo "configure:3322: checking for gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3316 "configure"
+#line 3327 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libc=yes
 else
@@ -3335,7 +3346,7 @@
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 	     echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3339: checking for bindtextdomain in -lintl" >&5
+echo "configure:3350: checking for bindtextdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3343,7 +3354,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3347 "configure"
+#line 3358 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3354,7 +3365,7 @@
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3370,19 +3381,19 @@
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3374: checking for gettext in libintl" >&5
+echo "configure:3385: checking for gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3379 "configure"
+#line 3390 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libintl=yes
 else
@@ -3410,7 +3421,7 @@
 	      # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3414: checking for $ac_word" >&5
+echo "configure:3425: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3444,12 +3455,12 @@
 		for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3448: checking for $ac_func" >&5
+echo "configure:3459: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3453 "configure"
+#line 3464 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3472,7 +3483,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3499,7 +3510,7 @@
 		# Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3503: checking for $ac_word" >&5
+echo "configure:3514: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3535,7 +3546,7 @@
 		# Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3539: checking for $ac_word" >&5
+echo "configure:3550: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3567,7 +3578,7 @@
 fi
 
 		cat > conftest.$ac_ext <<EOF
-#line 3571 "configure"
+#line 3582 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3575,7 +3586,7 @@
 			       return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:3579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
 		   DATADIRNAME=share
@@ -3607,7 +3618,7 @@
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3611: checking for $ac_word" >&5
+echo "configure:3622: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3641,7 +3652,7 @@
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3645: checking for $ac_word" >&5
+echo "configure:3656: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3677,7 +3688,7 @@
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3681: checking for $ac_word" >&5
+echo "configure:3692: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3767,7 +3778,7 @@
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3771: checking for catalogs to be installed" >&5
+echo "configure:3782: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -3795,17 +3806,17 @@
       if test "$CATOBJEXT" = ".cat"; then
 	 ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:3799: checking for linux/version.h" >&5
+echo "configure:3810: checking for linux/version.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3804 "configure"
+#line 3815 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3868,7 +3879,7 @@
   
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:3872: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:3883: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -3891,12 +3902,12 @@
   
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:3895: checking for Cygwin environment" >&5
+echo "configure:3906: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3900 "configure"
+#line 3911 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3907,7 +3918,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:3911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -3924,19 +3935,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:3928: checking for mingw32 environment" >&5
+echo "configure:3939: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3933 "configure"
+#line 3944 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:3940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -3955,7 +3966,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3959: checking for executable suffix" >&5
+echo "configure:3970: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3965,7 +3976,7 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:3969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
diff --git a/gprof/configure.in b/gprof/configure.in
index b50b55d..6ab289f 100644
--- a/gprof/configure.in
+++ b/gprof/configure.in
@@ -4,7 +4,7 @@
 
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(gprof, 2.9.4)
+AM_INIT_AUTOMAKE(gprof, 2.9.5)
 
 AM_PROG_LIBTOOL
 
diff --git a/gprof/corefile.c b/gprof/corefile.c
index a6e6f83..24539bc 100644
--- a/gprof/corefile.c
+++ b/gprof/corefile.c
@@ -195,8 +195,8 @@
 
   if (!core_text_space)
     {
-      fprintf (stderr, _("%s: ran out room for %ld bytes of text space\n"),
-	       whoami, core_text_sect->_raw_size);
+      fprintf (stderr, _("%s: ran out room for %lu bytes of text space\n"),
+	       whoami, (unsigned long) core_text_sect->_raw_size);
       done (1);
     }
   if (!bfd_get_section_contents (core_bfd, core_text_sect, core_text_space,
@@ -371,7 +371,7 @@
       && fname && func_name && l)
     {
       DBG (AOUTDEBUG, printf ("[get_src_info] 0x%lx -> %s:%d (%s)\n",
-			      addr, fname, l, func_name));
+			      (unsigned long) addr, fname, l, func_name));
       *filename = fname;
       *name = func_name;
       *line_num = l;
@@ -392,7 +392,8 @@
  * entered.
  */
 void
-DEFUN (core_create_function_syms, (core_bfd), bfd * core_bfd)
+core_create_function_syms (core_bfd)
+     bfd *core_bfd ATTRIBUTE_UNUSED;
 {
   bfd_vma min_vma = ~0, max_vma = 0;
   int class;
@@ -446,7 +447,8 @@
 	{
 	  DBG (AOUTDEBUG,
 	       printf ("[core_create_function_syms] rejecting: 0x%lx %s\n",
-		       core_syms[i]->value, core_syms[i]->name));
+		       (unsigned long) core_syms[i]->value,
+		       core_syms[i]->name));
 	  continue;
 	}
       /* This should be replaced with a binary search or hashed
@@ -545,7 +547,8 @@
 
       DBG (AOUTDEBUG, printf ("[core_create_function_syms] %ld %s 0x%lx\n",
 			      (long) (symtab.limit - symtab.base),
-			      symtab.limit->name, symtab.limit->addr));
+			      symtab.limit->name,
+			      (unsigned long) symtab.limit->addr));
       ++symtab.limit;
     }
 
@@ -722,7 +725,7 @@
 
       DBG (AOUTDEBUG, printf ("[core_create_line_syms] %d %s 0x%lx\n",
 			      ltab.limit - ltab.base, ltab.limit->name,
-			      ltab.limit->addr));
+			      (unsigned long) ltab.limit->addr));
       ++ltab.limit;
     }
 
diff --git a/gprof/gmon_io.c b/gprof/gmon_io.c
index ff294f5..067323c 100644
--- a/gprof/gmon_io.c
+++ b/gprof/gmon_io.c
@@ -242,11 +242,12 @@
       hist_num_bins = samp_bytes / sizeof (UNIT);
       DBG (SAMPLEDEBUG,
 	   printf ("[gmon_out_read] lowpc 0x%lx highpc 0x%lx ncnt %d\n",
-		   h.low_pc, h.high_pc, h.ncnt);
+		   (unsigned long) h.low_pc, (unsigned long) h.high_pc,
+		   h.ncnt);
 	   printf ("[gmon_out_read]   s_lowpc 0x%lx   s_highpc 0x%lx\n",
-		   s_lowpc, s_highpc);
+		   (unsigned long) s_lowpc, (unsigned long) s_highpc);
 	   printf ("[gmon_out_read]     lowpc 0x%lx     highpc 0x%lx\n",
-		   lowpc, highpc);
+		   (unsigned long) lowpc, (unsigned long) highpc);
 	   printf ("[gmon_out_read] samp_bytes %d hist_num_bins %d\n",
 		   samp_bytes, hist_num_bins));
 
@@ -286,7 +287,7 @@
 	  count = bfd_get_32 (core_bfd, (bfd_byte *) raw_arc.count);
 	  DBG (SAMPLEDEBUG,
 	     printf ("[gmon_out_read] frompc 0x%lx selfpc 0x%lx count %lu\n",
-		     from_pc, self_pc, count));
+		     (unsigned long) from_pc, (unsigned long) self_pc, count));
 	  /* add this arc: */
 	  cg_tally (from_pc, self_pc, count);
 	}
@@ -440,7 +441,8 @@
 		}
 	      DBG (SAMPLEDEBUG,
 		   printf ("[dumpsum] frompc 0x%lx selfpc 0x%lx count %lu\n",
-			   arc->parent->addr, arc->child->addr, arc->count));
+			   (unsigned long) arc->parent->addr,
+			   (unsigned long) arc->child->addr, arc->count));
 	    }
 	}
       fclose (ofp);
diff --git a/gprof/gprof.texi b/gprof/gprof.texi
index 43d8b9f..b4606b4 100644
--- a/gprof/gprof.texi
+++ b/gprof/gprof.texi
@@ -687,7 +687,7 @@
 function name is unique in a program, you must use the colon notation
 explained below to specify a function from a specific source file.
 
-Sometimes, function names contain dots.  In such cases, it is necessar
+Sometimes, function names contain dots.  In such cases, it is necessary
 to add a leading colon to the name.  For example, @samp{:.mul} selects
 function @samp{.mul}.
 
diff --git a/gprof/hist.c b/gprof/hist.c
index 5cdbbbb..56ef25a 100644
--- a/gprof/hist.c
+++ b/gprof/hist.c
@@ -130,11 +130,12 @@
 
   DBG (SAMPLEDEBUG,
        printf ("[hist_read_rec] n_lowpc 0x%lx n_highpc 0x%lx ncnt %d\n",
-	       n_lowpc, n_highpc, ncnt);
+	       (unsigned long) n_lowpc, (unsigned long) n_highpc, ncnt);
        printf ("[hist_read_rec] s_lowpc 0x%lx s_highpc 0x%lx nsamples %d\n",
-	       s_lowpc, s_highpc, hist_num_bins);
+	       (unsigned long) s_lowpc, (unsigned long) s_highpc,
+	       hist_num_bins);
        printf ("[hist_read_rec]   lowpc 0x%lx   highpc 0x%lx\n",
-	       lowpc, highpc));
+	       (unsigned long) lowpc, (unsigned long) highpc));
 
   if (n_lowpc != s_lowpc || n_highpc != s_highpc
       || ncnt != hist_num_bins || hz != profrate)
@@ -229,8 +230,9 @@
 	{
 	  DBG (SAMPLEDEBUG,
 	       printf ("[scale_and_align_entries] pushing 0x%lx to 0x%lx\n",
-		       sym->hist.scaled_addr,
-		       sym->hist.scaled_addr + UNITS_TO_CODE));
+		       (unsigned long) sym->hist.scaled_addr,
+		       (unsigned long) (sym->hist.scaled_addr
+					+ UNITS_TO_CODE)));
 	  sym->hist.scaled_addr += UNITS_TO_CODE;
 	}
     }
@@ -305,7 +307,8 @@
       DBG (SAMPLEDEBUG,
 	   printf (
       "[assign_samples] bin_low_pc=0x%lx, bin_high_pc=0x%lx, bin_count=%d\n",
-		    sizeof (UNIT) * bin_low_pc, sizeof (UNIT) * bin_high_pc,
+		    (unsigned long) (sizeof (UNIT) * bin_low_pc),
+		    (unsigned long) (sizeof (UNIT) * bin_high_pc),
 		    bin_count));
       total_time += time;
 
@@ -338,9 +341,10 @@
 	      DBG (SAMPLEDEBUG,
 		   printf (
 			    "[assign_samples] [0x%lx,0x%lx) %s gets %f ticks %ld overlap\n",
-			    symtab.base[j].addr, sizeof (UNIT) * sym_high_pc,
+			    (unsigned long) symtab.base[j].addr,
+			    (unsigned long) (sizeof (UNIT) * sym_high_pc),
 			    symtab.base[j].name, overlap * time / hist_scale,
-			    overlap));
+			    (long) overlap));
 	      addr = symtab.base[j].addr;
 	      credit = overlap * time / hist_scale;
 	      /*
diff --git a/gprof/i386.c b/gprof/i386.c
index 18aad1c..2abf2dc 100644
--- a/gprof/i386.c
+++ b/gprof/i386.c
@@ -55,7 +55,8 @@
       p_highpc = s_highpc;
     }
   DBG (CALLDEBUG, printf ("[findcall] %s: 0x%lx to 0x%lx\n",
-			  parent->name, p_lowpc, p_highpc));
+			  parent->name, (unsigned long) p_lowpc,
+			  (unsigned long) p_highpc));
 
   delta = (bfd_vma) core_text_space - core_text_sect->vma;
 
@@ -85,7 +86,8 @@
 		   *      a hit
 		   */
 		  DBG (CALLDEBUG,
-		       printf ("\tdestpc 0x%lx (%s)\n", destpc, child->name));
+		       printf ("\tdestpc 0x%lx (%s)\n",
+			       (unsigned long) destpc, child->name));
 		  arc_add (parent, child, (unsigned long) 0);
 		  instructp += 4;	/* call is a 5 byte instruction */
 		  continue;
diff --git a/gprof/po/POTFILES.in b/gprof/po/POTFILES.in
index 56d8641..5ae8116 100644
--- a/gprof/po/POTFILES.in
+++ b/gprof/po/POTFILES.in
@@ -1,7 +1,6 @@
 alpha.c
 basic_blocks.c
 basic_blocks.h
-bb_exit_func.c
 call_graph.c
 call_graph.h
 cg_arcs.c
diff --git a/gprof/po/gprof.pot b/gprof/po/gprof.pot
index 36bf787..b1cf0ee 100644
--- a/gprof/po/gprof.pot
+++ b/gprof/po/gprof.pot
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1998-06-12 19:33-0400\n"
+"POT-Creation-Date: 1999-07-01 01:36-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -23,12 +23,12 @@
 msgid "[find_call] %s: 0x%lx to 0x%lx\n"
 msgstr ""
 
-#: alpha.c:127
+#: alpha.c:128
 #, c-format
 msgid "[find_call] 0x%lx: jsr%s <indirect_child>\n"
 msgstr ""
 
-#: alpha.c:136
+#: alpha.c:137
 #, c-format
 msgid "[find_call] 0x%lx: bsr"
 msgstr ""
@@ -38,21 +38,22 @@
 msgid "%s: %s: unexpected end of file\n"
 msgstr ""
 
-#: basic_blocks.c:214
+#: basic_blocks.c:215
 #, c-format
 msgid "%s: warning: ignoring basic-block exec counts (use -l or --line)\n"
 msgstr ""
 
-#: basic_blocks.c:322 basic_blocks.c:330
+#. FIXME: This only works if bfd_vma is unsigned long.
+#: basic_blocks.c:324 basic_blocks.c:333
 #, c-format
-msgid "%s:%d: (%s:0x%lx) %d executions\n"
+msgid "%s:%d: (%s:0x%lx) %lu executions\n"
 msgstr ""
 
-#: basic_blocks.c:323 basic_blocks.c:331
+#: basic_blocks.c:325 basic_blocks.c:334
 msgid "<unknown>"
 msgstr ""
 
-#: basic_blocks.c:584
+#: basic_blocks.c:596
 #, c-format
 msgid ""
 "\n"
@@ -63,43 +64,43 @@
 "\n"
 msgstr ""
 
-#: basic_blocks.c:608
+#: basic_blocks.c:620
 msgid ""
 "\n"
 "Execution Summary:\n"
 "\n"
 msgstr ""
 
-#: basic_blocks.c:609
+#: basic_blocks.c:621
 #, c-format
 msgid "%9ld   Executable lines in this file\n"
 msgstr ""
 
-#: basic_blocks.c:611
+#: basic_blocks.c:623
 #, c-format
 msgid "%9ld   Lines executed\n"
 msgstr ""
 
-#: basic_blocks.c:612
+#: basic_blocks.c:624
 #, c-format
 msgid "%9.2f   Percent of the file executed\n"
 msgstr ""
 
-#: basic_blocks.c:616
+#: basic_blocks.c:628
 #, c-format
 msgid ""
 "\n"
-"%9d   Total number of line executions\n"
+"%9lu   Total number of line executions\n"
 msgstr ""
 
-#: basic_blocks.c:617
+#: basic_blocks.c:630
 #, c-format
 msgid "%9.2f   Average executions per line\n"
 msgstr ""
 
 #: call_graph.c:48
 #, c-format
-msgid "[cg_tally] arc from %s to %s traversed %d times\n"
+msgid "[cg_tally] arc from %s to %s traversed %lu times\n"
 msgstr ""
 
 #: cg_print.c:39
@@ -114,7 +115,7 @@
 "\n"
 msgstr ""
 
-#: cg_print.c:46 hist.c:381
+#: cg_print.c:46 hist.c:385
 #, c-format
 msgid ""
 "\n"
@@ -161,7 +162,7 @@
 msgid "descendents"
 msgstr ""
 
-#: cg_print.c:67 hist.c:405
+#: cg_print.c:67 hist.c:409
 msgid "name"
 msgstr ""
 
@@ -221,7 +222,7 @@
 
 #: corefile.c:198
 #, c-format
-msgid "%s: ran out room for %ld bytes of text space\n"
+msgid "%s: ran out room for %lu bytes of text space\n"
 msgstr ""
 
 #: corefile.c:211
@@ -239,7 +240,7 @@
 msgid "%s: file `%s' has no symbols\n"
 msgstr ""
 
-#: corefile.c:726
+#: corefile.c:753
 #, c-format
 msgid "%s: somebody miscounted: ltab.len=%d instead of %ld\n"
 msgstr ""
@@ -249,12 +250,12 @@
 msgid "%s: bfd_vma has unexpected size of %ld bytes\n"
 msgstr ""
 
-#: gmon_io.c:87 gmon_io.c:179
+#: gmon_io.c:87 gmon_io.c:182
 #, c-format
 msgid "%s: file too short to be a gmon file\n"
 msgstr ""
 
-#: gmon_io.c:97
+#: gmon_io.c:97 gmon_io.c:215
 #, c-format
 msgid "%s: file `%s' has bad magic cookie\n"
 msgstr ""
@@ -269,46 +270,46 @@
 msgid "%s: %s: found bad tag %d (file corrupted?)\n"
 msgstr ""
 
-#: gmon_io.c:197
+#: gmon_io.c:203
 #, c-format
 msgid "%s: profiling rate incompatible with first gmon file\n"
 msgstr ""
 
-#: gmon_io.c:207
+#: gmon_io.c:232
 #, c-format
 msgid "%s: incompatible with first gmon file\n"
 msgstr ""
 
-#: gmon_io.c:245
+#: gmon_io.c:271
 #, c-format
 msgid "%s: unexpected EOF after reading %d/%d bins\n"
 msgstr ""
 
-#: gmon_io.c:280
+#: gmon_io.c:306
 msgid "time is in ticks, not seconds\n"
 msgstr ""
 
-#: gmon_io.c:286 gmon_io.c:410
+#: gmon_io.c:312 gmon_io.c:452
 #, c-format
 msgid "%s: don't know how to deal with file format %d\n"
 msgstr ""
 
-#: gmon_io.c:293
+#: gmon_io.c:319
 #, c-format
 msgid "File `%s' (version %d) contains:\n"
 msgstr ""
 
-#: gmon_io.c:295
+#: gmon_io.c:321
 #, c-format
 msgid "\t%d histogram record%s\n"
 msgstr ""
 
-#: gmon_io.c:297
+#: gmon_io.c:323
 #, c-format
 msgid "\t%d call-graph record%s\n"
 msgstr ""
 
-#: gmon_io.c:299
+#: gmon_io.c:325
 #, c-format
 msgid "\t%d basic-block count record%s\n"
 msgstr ""
@@ -346,103 +347,103 @@
 msgid "%s: debugging not supported; -d ignored\n"
 msgstr ""
 
-#: gprof.c:306
+#: gprof.c:309
 #, c-format
 msgid "%s: unknown file format %s\n"
 msgstr ""
 
 #. This output is intended to follow the GNU standards document.
-#: gprof.c:390
+#: gprof.c:393
 #, c-format
 msgid "GNU gprof %s\n"
 msgstr ""
 
-#: gprof.c:391
+#: gprof.c:394
 msgid ""
 "Based on BSD gprof, copyright 1983 Regents of the University of California.\n"
 msgstr ""
 
-#: gprof.c:392
+#: gprof.c:395
 msgid ""
 "This program is free software.  This program has absolutely no warranty.\n"
 msgstr ""
 
-#: gprof.c:438
+#: gprof.c:441
 #, c-format
 msgid ""
 "%s: Only one of --function-ordering and --file-ordering may be specified.\n"
 msgstr ""
 
-#: gprof.c:538
+#: gprof.c:541
 #, c-format
 msgid "%s: sorry, file format `prof' is not yet supported\n"
 msgstr ""
 
-#: gprof.c:599
+#: gprof.c:602
 #, c-format
 msgid "%s: gmon.out file is missing histogram\n"
 msgstr ""
 
-#: gprof.c:606
+#: gprof.c:609
 #, c-format
 msgid "%s: gmon.out file is missing call-graph data\n"
 msgstr ""
 
-#: hist.c:142
+#: hist.c:143
 #, c-format
 msgid "%s: `%s' is incompatible with first gmon file\n"
 msgstr ""
 
-#: hist.c:158
+#: hist.c:159
 #, c-format
 msgid "%s: %s: unexpected EOF after reading %d of %d samples\n"
 msgstr ""
 
-#: hist.c:377
+#: hist.c:381
 #, c-format
 msgid "%c%c/call"
 msgstr ""
 
-#: hist.c:385
+#: hist.c:389
 msgid ""
 " for %.2f%% of %.2f %s\n"
 "\n"
 msgstr ""
 
-#: hist.c:391
+#: hist.c:395
 #, c-format
 msgid ""
 "\n"
 "Each sample counts as %g %s.\n"
 msgstr ""
 
-#: hist.c:396
+#: hist.c:400
 msgid ""
 " no time accumulated\n"
 "\n"
 msgstr ""
 
-#: hist.c:402
+#: hist.c:406
 msgid "cumulative"
 msgstr ""
 
-#: hist.c:402
+#: hist.c:406
 msgid "self  "
 msgstr ""
 
-#: hist.c:402
+#: hist.c:406
 msgid "total "
 msgstr ""
 
-#: hist.c:404
+#: hist.c:408
 msgid "time"
 msgstr ""
 
-#: hist.c:404
+#: hist.c:408
 msgid "calls"
 msgstr ""
 
-#: hist.c:515
+#: hist.c:517
 msgid ""
 "\n"
 "\n"
@@ -450,7 +451,7 @@
 "flat profile:\n"
 msgstr ""
 
-#: hist.c:521
+#: hist.c:523
 msgid "Flat profile:\n"
 msgstr ""
 
diff --git a/gprof/sparc.c b/gprof/sparc.c
index ad702b1..0365827 100644
--- a/gprof/sparc.c
+++ b/gprof/sparc.c
@@ -52,7 +52,8 @@
       p_highpc = s_highpc;
     }
   DBG (CALLDEBUG, printf ("[find_call] %s: 0x%lx to 0x%lx\n",
-			  parent->name, p_lowpc, p_highpc));
+			  parent->name, (unsigned long) p_lowpc,
+			  (unsigned long) p_highpc));
   for (instr = (unsigned int *) (((p_lowpc + delta) + 3) &~ 3);
        instr < (unsigned int *) (p_highpc + delta);
        ++instr)
@@ -60,7 +61,8 @@
       if ((*instr & CALL))
 	{
 	  DBG (CALLDEBUG,
-	       printf ("[find_call] 0x%lx: callf", (bfd_vma) instr - delta));
+	       printf ("[find_call] 0x%lx: callf",
+		       (unsigned long) instr - delta));
 	  /*
 	   * Regular pc relative addressing check that this is the
 	   * address of a function.
@@ -71,7 +73,8 @@
 	      child = sym_lookup (&symtab, dest_pc);
 	      DBG (CALLDEBUG,
 		   printf ("\tdest_pc=0x%lx, (name=%s, addr=0x%lx)\n",
-			   dest_pc, child->name, child->addr));
+			   (unsigned long) dest_pc, child->name,
+			   (unsigned long) child->addr));
 	      if (child->addr == dest_pc)
 		{
 		  /* a hit:  */
diff --git a/gprof/sym_ids.c b/gprof/sym_ids.c
index ba3ca28..412c8d4 100644
--- a/gprof/sym_ids.c
+++ b/gprof/sym_ids.c
@@ -46,7 +46,7 @@
 
 static Source_File non_existent_file =
 {
-  0, "<non-existent-file>"
+  0, "<non-existent-file>", 0, 0, 0, NULL
 };
 
 
@@ -323,11 +323,13 @@
 		       printf (
 				"[sym_id_parse]: arc %s:%s(%lx-%lx) -> %s:%s(%lx-%lx) to %s\n",
 				left->file ? left->file->name : "*",
-				left->name ? left->name : "*", left->addr,
-				left->end_addr,
+				left->name ? left->name : "*",
+				(unsigned long) left->addr,
+				(unsigned long) left->end_addr,
 				right->file ? right->file->name : "*",
-				right->name ? right->name : "*", right->addr,
-				right->end_addr,
+				right->name ? right->name : "*",
+				(unsigned long) right->addr,
+				(unsigned long) right->end_addr,
 				table_name[id->which_table]));
 		  arc_add (left, right, (unsigned long) 0);
 		}
diff --git a/gprof/symtab.c b/gprof/symtab.c
index 182c657..53b261a 100644
--- a/gprof/symtab.c
+++ b/gprof/symtab.c
@@ -108,7 +108,7 @@
 			   src->is_func ? 'F' : 'f',
 			   dst[-1].name, dst[-1].is_static ? 't' : 'T',
 			   dst[-1].is_func ? 'F' : 'f');
-		   printf (" (addr=%lx)\n", src->addr));
+		   printf (" (addr=%lx)\n", (unsigned long) src->addr));
 	      dst[-1] = *src;
 	    }
 	  else
@@ -119,7 +119,7 @@
 			   dst[-1].is_func ? 'F' : 'f',
 			   src->name, src->is_static ? 't' : 'T',
 			   src->is_func ? 'F' : 'f');
-		   printf (" (addr=%lx)\n", src->addr));
+		   printf (" (addr=%lx)\n", (unsigned long) src->addr));
 	    }
 	}
       else
@@ -170,7 +170,8 @@
   long low, mid, high;
   Sym *sym;
 
-  fprintf (stderr, "[dbg_sym_lookup] address 0x%lx\n", address);
+  fprintf (stderr, "[dbg_sym_lookup] address 0x%lx\n",
+	   (unsigned long) address);
 
   sym = symtab->base;
   for (low = 0, high = symtab->len - 1; low != high;)
@@ -179,7 +180,8 @@
       fprintf (stderr, "[dbg_sym_lookup] low=0x%lx, mid=0x%lx, high=0x%lx\n",
 	       low, mid, high);
       fprintf (stderr, "[dbg_sym_lookup] sym[m]=0x%lx sym[m + 1]=0x%lx\n",
-	       sym[mid].addr, sym[mid + 1].addr);
+	       (unsigned long) sym[mid].addr,
+	       (unsigned long) sym[mid + 1].addr);
       if (sym[mid].addr <= address && sym[mid + 1].addr > address)
 	{
 	  return &sym[mid];
diff --git a/gprof/tahoe.c b/gprof/tahoe.c
index d133c17..414b358 100644
--- a/gprof/tahoe.c
+++ b/gprof/tahoe.c
@@ -247,7 +247,8 @@
       p_highpc = s_highpc;
     }
   DBG (CALLDEBUG, printf ("[findcall] %s: 0x%lx to 0x%lx\n",
-			  parent->name, p_lowpc, p_highpc));
+			  parent->name, (unsigned long) p_lowpc,
+			  (unsigned long) p_highpc));
   for (instructp = (unsigned char *) core_text_space + p_lowpc;
        instructp < (unsigned char *) core_text_space + p_highpc;
        instructp += length)
@@ -310,9 +311,11 @@
 		{
 		  child = sym_lookup (&symtab, destpc);
 		  DBG (CALLDEBUG,
-		       printf ("[findcall]\tdestpc 0x%lx", destpc);
+		       printf ("[findcall]\tdestpc 0x%lx",
+			       (unsigned long) destpc);
 		       printf (" child->name %s", child->name);
-		       printf (" child->addr 0x%lx\n", child->addr);
+		       printf (" child->addr 0x%lx\n",
+			       (unsigned long) child->addr);
 		    );
 		  if (child->addr == destpc)
 		    {
diff --git a/gprof/vax.c b/gprof/vax.c
index 1a7bd8d..33fdf43 100644
--- a/gprof/vax.c
+++ b/gprof/vax.c
@@ -250,7 +250,8 @@
       p_highpc = s_highpc;
     }
   DBG (CALLDEBUG, printf ("[findcall] %s: 0x%lx to 0x%lx\n",
-			  parent->name, p_lowpc, p_highpc));
+			  parent->name, (unsigned long) p_lowpc,
+			  (unsigned long) p_highpc));
   for (instructp = (unsigned char *) core_text_space + p_lowpc;
        instructp < (unsigned char *) core_text_space + p_highpc;
        instructp += length)
@@ -314,9 +315,11 @@
 		{
 		  child = sym_lookup (&symtab, destpc);
 		  DBG (CALLDEBUG,
-		       printf ("[findcall]\tdestpc 0x%lx", destpc);
+		       printf ("[findcall]\tdestpc 0x%lx",
+			       (unsigned long) destpc);
 		       printf (" child->name %s", child->name);
-		       printf (" child->addr 0x%lx\n", child->addr);
+		       printf (" child->addr 0x%lx\n",
+			       (unsigned long) child->addr);
 		    );
 		  if (child->addr == destpc)
 		    {
diff --git a/include/ChangeLog b/include/ChangeLog
index fbadf92..263dc94 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,25 @@
+1999-07-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* ansidecl.h: Copy attribute support macros from egcs.
+
+1999-06-22  Mark Mitchell  <mark@codesourcery.com>
+
+	* bfdlink.h (struct bfd_link_hash_entry): Add init_function and
+	fini_function.
+
+1999-06-20  Mark Mitchell  <mark@codesourcery.com>
+
+	* mips.h (Elf32_Internal_Msym): New structure.
+	(Elf32_External_Msym): Likewise.
+	(ELF32_MS_REL_INDEX): New macro.
+	(ELF32_MS_FLAGS): Likewise.
+	(ELF32_MS_INFO): Likewise.
+	
+1999-06-14  Nick Clifton  <nickc@cygnus.com>
+
+	* dis-asm.h (arm_toggle_regnames): New prototype.
+	(struct diassemble_info): New field: disassembler_options.
+
 1999-04-11  Richard Henderson  <rth@cygnus.com>
 
 	* bfdlink.h (bfd_elf_version_expr): Rename `match' to `pattern'.
diff --git a/include/ansidecl.h b/include/ansidecl.h
index cdb9fb7..989dd67 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -1,5 +1,5 @@
 /* ANSI and traditional C compatability macros
-   Copyright 1991, 1992, 1996 Free Software Foundation, Inc.
+   Copyright 1991, 1992, 1996, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
 This program is free software; you can redistribute it and/or modify
@@ -160,4 +160,37 @@
 
 #endif	/* ANSI C.  */
 
+/* Define macros for some gcc attributes.  This permits us to use the
+   macros freely, and know that they will come into play for the
+   version of gcc in which they are supported.  */
+
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+# define __attribute__(x)
+#endif
+
+#ifndef ATTRIBUTE_UNUSED_LABEL
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93)
+#  define ATTRIBUTE_UNUSED_LABEL
+# else
+#  define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
+# endif /* GNUC < 2.93 */
+#endif /* ATTRIBUTE_UNUSED_LABEL */
+
+#ifndef ATTRIBUTE_UNUSED
+#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#endif /* ATTRIBUTE_UNUSED */
+
+#ifndef ATTRIBUTE_NORETURN
+#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#endif /* ATTRIBUTE_NORETURN */
+
+#ifndef ATTRIBUTE_PRINTF
+#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((format (__printf__, m, n)))
+#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
+#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
+#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
+#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
+#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
+#endif /* ATTRIBUTE_PRINTF */
+
 #endif	/* ansidecl.h	*/
diff --git a/include/aout/ChangeLog b/include/aout/ChangeLog
index 854cfd5..63f17ec 100644
--- a/include/aout/ChangeLog
+++ b/include/aout/ChangeLog
@@ -1,3 +1,8 @@
+1999-07-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* aout64.h (N_SHARED_LIB): Define as 0 if TEXT_START_ADDR is
+	defined as 0.
+
 Sun Jun 28 11:33:48 1998  Peter Schauer  <pes@regent.e-technik.tu-muenchen.de>
 
 	* stab.def:  Add N_ALIAS from SunPro F77.
diff --git a/include/aout/aout64.h b/include/aout/aout64.h
index 76f1140..bf743c4 100644
--- a/include/aout/aout64.h
+++ b/include/aout/aout64.h
@@ -121,8 +121,12 @@
 /* Sun shared libraries, not linux.  This macro is only relevant for ZMAGIC
    files.  */
 #ifndef N_SHARED_LIB
+#if defined (TEXT_START_ADDR) && TEXT_START_ADDR == 0
+#define N_SHARED_LIB(x) (0)
+#else
 #define N_SHARED_LIB(x) ((x).a_entry < TEXT_START_ADDR)
 #endif
+#endif
 
 /* Returning 0 not TEXT_START_ADDR for OMAGIC and NMAGIC is based on
    the assumption that we are dealing with a .o file, not an
diff --git a/include/bfdlink.h b/include/bfdlink.h
index a055fa0..f7f113c 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -237,6 +237,13 @@
   MPC860 C0 (or earlier) should be checked for and modified.  It gives the
   number of bytes that should be checked at the end of each text page. */
   int mpc860c0;
+
+  /* The function to call when the executable or shared object is
+     loaded.  */
+  const char *init_function;
+  /* The function to call when the executable or shared object is
+     unloaded.  */
+  const char *fini_function;
 };
 
 /* This structures holds a set of callback functions.  These are
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index 8ad6e0c..659dcdc 100644
--- a/include/coff/ChangeLog
+++ b/include/coff/ChangeLog
@@ -1,3 +1,29 @@
+1999-07-17  Nick Clifton  <nickc@cygnus.com>
+
+	* arm.h (F_SOFT_FLOAT): Rename from F_SOFTFLOAT.
+
+1999-06-21  Philip Blundell  <pb@nexus.co.uk>
+
+	* arm.h (F_SOFTFLOAT): Define.
+
+1999-07-05  Nick Clifton  <nickc@cygnus.com>
+
+	* arm.h (F_ARM_5): Define.
+
+Wed Jun  2 18:08:18 1999  Richard Henderson  <rth@cygnus.com>
+
+	* internal.h (BEOS_EXE_IMAGE_BASE, BEOS_DLL_IMAGE_BASE): New.
+
+Mon May 17 13:35:35 1999  Stan Cox  <scox@cygnus.com>
+
+	* coff/arm.h (F_PIC, F_ARM_2, F_ARM_2a, F_ARM_3, F_ARM_3M,
+	F_ARM_4, F_ARM_4T, F_APCS26): Changed values to distinguish
+	F_ARM_2a, F_ARM_3M, F_ARM_4T.
+
+1999-05-15  Nick Clifton  <nickc@cygnus.com>
+
+	* mcore.h (IMAGE_REL_MCORE_RVA): Define.
+
 1999-04-21  Nick Clifton  <nickc@cygnus.com>
 
 	* mcore.h (GET_LINENO_LNNO): New macro.
diff --git a/include/coff/arm.h b/include/coff/arm.h
index dd578b1..d5163f8 100644
--- a/include/coff/arm.h
+++ b/include/coff/arm.h
@@ -1,10 +1,28 @@
-/*** coff information for the ARM */
+/* ARM COFF support for BFD.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 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.  */
 
 #define COFFARM 1
 
 /********************** FILE HEADER **********************/
 
-struct external_filehdr {
+struct external_filehdr
+{
 	char f_magic[2];	/* magic number			*/
 	char f_nscns[2];	/* number of sections		*/
 	char f_timdat[4];	/* time & date stamp		*/
@@ -26,6 +44,7 @@
  *	F_AR32WR	file has byte ordering of an AR32WR machine (e.g. vax)
  *	F_APCS_26	file uses 26 bit ARM Procedure Calling Standard
  *	F_APCS_SET	the F_APCS_26, F_APCS_FLOAT and F_PIC bits have been initialised
+ *	F_SOFT_FLOAT	code does not use floating point instructions
  */
 
 #define F_RELFLG	(0x0001)
@@ -40,20 +59,22 @@
 #define	F_AR32WR	(0x0100)
 #define F_APCS_26	(0x0400)
 #define F_APCS_SET	(0x0800)
+#define F_SOFT_FLOAT	(0x2000)
 
 /* Bits stored in flags field of the internal_f structure */
 
 #define F_INTERWORK	(0x0010)
-#define F_PIC_INT	(0x0020)
 #define F_APCS_FLOAT	(0x0040)
-#define F_ARM_ARCHITECTURE_MASK	(0x0c00)
-#define F_ARM_2		(0x0000)
-#define F_ARM_2a	(0x0000)
-#define F_ARM_3		(0x0400)
-#define F_ARM_3M	(0x0400)
-#define F_ARM_4		(0x0800)
-#define F_ARM_4T	(0x0c00)
-#define F_APCS26	(0x4000)
+#define F_PIC		(0x0080)
+#define F_APCS26	(0x1000)
+#define F_ARM_ARCHITECTURE_MASK (0x4000+0x0800+0x0400)
+#define F_ARM_2		(0x0400)
+#define F_ARM_2a	(0x0800)
+#define F_ARM_3		(0x0c00)
+#define F_ARM_3M	(0x4000)
+#define F_ARM_4		(0x4400)
+#define F_ARM_4T	(0x4800)
+#define F_ARM_5		(0x4c00)
 
 /*
  * ARMMAGIC ought to encoded the procesor type,
@@ -85,8 +106,6 @@
   char	entry[4];		/* entry pt.				*/
   char 	text_start[4];		/* base of text used for this file */
   char 	data_start[4];		/* base of data used for this file */
-
-
 }
 AOUTHDR;
 
@@ -108,9 +127,8 @@
 #define NT_DEF_COMMIT        0x1000
 
 /********************** SECTION HEADER **********************/
-
-
-struct external_scnhdr {
+struct external_scnhdr
+{
 	char		s_name[8];	/* section name			*/
 	char		s_paddr[4];	/* physical address, aliased s_nlib */
 	char		s_vaddr[4];	/* virtual address		*/
@@ -145,8 +163,10 @@
  * grouping will have l_lnno = 0 and in place of physical address will be the
  * symbol table index of the function name.
  */
-struct external_lineno {
-	union {
+struct external_lineno
+{
+	union
+	{
 		char l_symndx[4];	/* function name symbol index, iff l_lnno == 0*/
 		char l_paddr[4];	/* (physical) address of line number	*/
 	} l_addr;
@@ -166,9 +186,11 @@
 
 struct external_syment 
 {
-  union {
+  union
+  {
     char e_name[E_SYMNMLEN];
-    struct {
+    struct
+    {
       char e_zeroes[4];
       char e_offset[4];
     } e;
@@ -185,37 +207,47 @@
 #define N_BTSHFT	(4)
 #define N_TSHIFT	(2)
 
-union external_auxent {
-	struct {
+union external_auxent
+{
+	struct
+	{
 		char x_tagndx[4];	/* str, un, or enum tag indx */
-		union {
-			struct {
+		union
+		{
+			struct
+			{
 			    char  x_lnno[2]; /* declaration line number */
 			    char  x_size[2]; /* str/union/array size */
 			} x_lnsz;
 			char x_fsize[4];	/* size of function */
 		} x_misc;
-		union {
-			struct {		/* if ISFCN, tag, or .bb */
+		union
+		{
+			struct 			/* if ISFCN, tag, or .bb */
+			{
 			    char x_lnnoptr[4];	/* ptr to fcn line # */
 			    char x_endndx[4];	/* entry ndx past block end */
 			} x_fcn;
-			struct {		/* if ISARY, up to 4 dimen. */
+			struct 			/* if ISARY, up to 4 dimen. */
+			{
 			    char x_dimen[E_DIMNUM][2];
 			} x_ary;
 		} x_fcnary;
 		char x_tvndx[2];		/* tv index */
 	} x_sym;
 
-	union {
+	union
+	{
 		char x_fname[E_FILNMLEN];
-		struct {
+		struct
+		{
 			char x_zeroes[4];
 			char x_offset[4];
 		} x_n;
 	} x_file;
 
-	struct {
+	struct
+	{
 		char x_scnlen[4];	/* section length */
 		char x_nreloc[2];	/* # relocation entries */
 		char x_nlinno[2];	/* # line numbers */
@@ -224,13 +256,12 @@
 		char x_comdat[1];	/* COMDAT selection number */
 	} x_scn;
 
-        struct {
+        struct
+	{
 		char x_tvfill[4];	/* tv fill value */
 		char x_tvlen[2];	/* length of .tv */
 		char x_tvran[2][2];	/* tv range */
 	} x_tv;		/* info about .tv section (in auxent of symbol .tv)) */
-
-
 };
 
 #define	SYMENT	struct external_syment
@@ -238,21 +269,16 @@
 #define	AUXENT	union external_auxent
 #define	AUXESZ	18
 
-
-#	define _ETEXT	"etext"
-
+#define _ETEXT	"etext"
 
 /********************** RELOCATION DIRECTIVES **********************/
-
-
-
-struct external_reloc {
+struct external_reloc
+{
   char r_vaddr[4];
   char r_symndx[4];
   char r_type[2];
   char r_offset[4];
 };
 
-
 #define RELOC struct external_reloc
 #define RELSZ 14
diff --git a/include/coff/internal.h b/include/coff/internal.h
index d5ea951..b01730e 100644
--- a/include/coff/internal.h
+++ b/include/coff/internal.h
@@ -89,10 +89,14 @@
 }  IMAGE_DATA_DIRECTORY;
 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES  16
 
-/* default image base for NT */
+/* Default image base for NT.  */
 #define NT_EXE_IMAGE_BASE 0x400000
 #define NT_DLL_IMAGE_BASE 0x10000000
 
+/* Default image base for BeOS. */
+#define BEOS_EXE_IMAGE_BASE 0x80000000
+#define BEOS_DLL_IMAGE_BASE 0x10000000
+
 /* Extra stuff in a PE aouthdr */
 
 #define PE_DEF_SECTION_ALIGNMENT 0x1000
diff --git a/include/coff/mcore.h b/include/coff/mcore.h
index 974b62e..f318947 100644
--- a/include/coff/mcore.h
+++ b/include/coff/mcore.h
@@ -32,6 +32,7 @@
 #define IMAGE_REL_MCORE_PCREL_IMM4BY2		0x0004
 #define IMAGE_REL_MCORE_PCREL_32		0x0005
 #define IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2	0x0006
+#define IMAGE_REL_MCORE_RVA			0x0007
 
 #define PEMCORE
 
diff --git a/include/dis-asm.h b/include/dis-asm.h
index 666ed69..b42a5ca 100644
--- a/include/dis-asm.h
+++ b/include/dis-asm.h
@@ -133,6 +133,9 @@
 				   zero if unknown.  */
   bfd_vma target2;		/* Second target address for dref2 */
 
+  /* Command line options specific to the target disassembler.  */
+  char * disassembler_options;
+
 } disassemble_info;
 
 
@@ -181,6 +184,8 @@
 extern int print_insn_vax		PARAMS ((bfd_vma, disassemble_info*));
 extern int print_insn_tic80		PARAMS ((bfd_vma, disassemble_info*));
 
+extern int arm_toggle_regnames          PARAMS ((void));
+
 /* Fetch the disassembler for a given BFD, if that support is available.  */
 extern disassembler_ftype disassembler	PARAMS ((bfd *));
 
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index deaccd4..2b14309 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,77 @@
+1999-07-16  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* sparc.h (EF_SPARC_SUN_US3): Define in Cheetah extensions
+	flag (as per SCD2.4.1).
+
+1999-07-16  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* sparc.h (ELF64_R_TYPE_DATA): Only use ELF64_R_TYPE bits, not
+	ELF64_R_SYM bits.
+
+1999-06-21  Philip Blundell  <pb@nexus.co.uk>
+
+	* arm.h (EF_SOFT_FLOAT, F_SOFT_FLOAT): Define.
+
+1999-07-13  Andreas Schwab  <schwab@suse.de>
+
+	* m68k.h (EF_CPU32): Move definition inside multiple inclusion
+	guard.
+
+1999-07-08  Richard Henderson  <rth@cygnus.com>
+
+	* sparc.h (ELF64_R_TYPE_DATA): Sign extend the value.
+	(ELF64_R_TYPE_INFO): Mask out all but low 24 bits of data.
+	(DT_SPARC_PLTFMT): Delete.
+	Based on a patch from Jakub Jelinek.
+
+Mon Jun 21 16:36:02 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* hppa.h (elf_hppa_reloc_type): Renamed from elf32_hppa_reloc_type.
+
+1999-06-10  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* sparc.h (R_SPARC_max_std): Define.
+
+Wed Jun  9 15:16:34 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* hppa.h: Update with various changes from newest PA ELF
+	specifications.
+
+1999-06-03  Ian Lance Taylor  <ian@zembu.com>
+
+	* common.h (EM_PPC64): Define.
+
+1999-06-02  Stu Grossman  <grossman@babylon-5.cygnus.com>
+
+	* dwarf.h: Add LANG_JAVA.
+	* dwarf2.h: Add DW_LANG_Java.
+
+1999-05-29  Nick Clifton  <nickc@cygnus.com>
+
+	* common.h (ELFOSABI_ARM): Define.
+
+1999-05-28  Nick Clifton  <nickc@cygnus.com>
+
+	* reloc-macros.h: Update comment.
+
+1999-05-28  Ian Lance Taylor  <ian@zembu.com>
+
+	* i960.h: New file.
+
+1999-05-16  Nick Clifton  <nickc@cygnus.com>
+
+	* mcore.h (R_MCORE_COPY): Define.
+	(R_MCORE_GLOB_DAT): Define.
+	(R_MCORE_JUMP_SLOT): Define.
+
+1999-05-15  Nick Clifton  <nickc@cygnus.com>
+
+	* mcore.h (R_MCORE_RELATIVE): Define.
+
+999-05-05  Catherine Moore  <clm@cygnus.com>
+ 
+        * m68k.h (EF_CPU32): Define.
+ 
 1999-04-21  Nick Clifton  <nickc@cygnus.com>
 
 	* reloc-macros.h (START_RELOC_NUMBERS): Prepend an underscore to
diff --git a/include/elf/arm.h b/include/elf/arm.h
index 2c94b13..82c1698 100644
--- a/include/elf/arm.h
+++ b/include/elf/arm.h
@@ -32,12 +32,14 @@
 #define EF_ALIGN8	   0x40		/* 8-bit structure alignment is in use */
 #define EF_NEW_ABI         0x80
 #define EF_OLD_ABI         0x100
+#define EF_SOFT_FLOAT      0x200
 
 /* Local aliases for some flags to match names used by COFF port.  */
 #define F_INTERWORK	   EF_INTERWORK
 #define F_APCS26	   EF_APCS_26
 #define F_APCS_FLOAT	   EF_APCS_FLOAT
 #define F_PIC              EF_PIC
+#define F_SOFT_FLOAT	   EF_SOFT_FLOAT
 
 /* Additional symbol types for Thumb */
 #define STT_ARM_TFUNC     0xd
diff --git a/include/elf/common.h b/include/elf/common.h
index cda3ba0..ba5df40 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -1,5 +1,5 @@
 /* ELF support for BFD.
-   Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
+   Copyright (C) 1991,92,93,94,95,96,97,98,1999 Free Software Foundation, Inc.
 
    Written by Fred Fish @ Cygnus Support, from information published
    in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -60,6 +60,7 @@
 #define ELFOSABI_SYSV   0       /* UNIX System V ABI */
 #define ELFOSABI_HPUX   1       /* HP-UX operating system */
 #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
+#define ELFOSABI_ARM   97		/* ARM */
 
 #define EI_ABIVERSION   8       /* ABI version */
 
@@ -97,6 +98,7 @@
 #define EM_SPARC32PLUS 18	/* Sun's "v8plus" */
 #define EM_960         19       /* Intel 80960 */
 #define EM_PPC	       20	/* PowerPC */
+#define EM_PPC64       21	/* 64-bit PowerPC */
 
 #define EM_V800        36	/* NEC V800 series */
 #define EM_FR20	       37	/* Fujitsu FR20 */
diff --git a/include/elf/dwarf.h b/include/elf/dwarf.h
index 4333d5e..1e72cd7 100644
--- a/include/elf/dwarf.h
+++ b/include/elf/dwarf.h
@@ -3,7 +3,7 @@
 
    Written by Ron Guilmette (rfg@ncd.com)
 
-Copyright (C) 1992 Free Software Foundation, Inc.
+Copyright (C) 1992, 1999 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -301,7 +301,8 @@
 
     /* GNU extensions */
 
-    LANG_CHILL		= 0x00009af3	/* random value for GNU Chill */
+    LANG_CHILL		= 0x00009af3,	/* random value for GNU Chill */
+    LANG_JAVA		= 0x00009af4    /* random value + 1 for GNU Java */
 };
 
 #define LANG_lo_user	0x00008000  /* implementation-defined range start */
diff --git a/include/elf/dwarf2.h b/include/elf/dwarf2.h
index b2cbb24..1bd4fa6 100644
--- a/include/elf/dwarf2.h
+++ b/include/elf/dwarf2.h
@@ -616,6 +616,7 @@
     DW_LANG_Fortran90 = 0x0008,
     DW_LANG_Pascal83 = 0x0009,
     DW_LANG_Modula2 = 0x000a,
+    DW_LANG_Java = 0x9af4,
     DW_LANG_Mips_Assembler = 0x8001
   };
 
diff --git a/include/elf/hppa.h b/include/elf/hppa.h
index 2952e23..ba50729 100644
--- a/include/elf/hppa.h
+++ b/include/elf/hppa.h
@@ -1,5 +1,5 @@
 /* HPPA ELF support for BFD.
-   Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -25,87 +25,92 @@
 
 /* Processor specific flags for the ELF header e_flags field.  */
 
-/* Target processor IDs to be placed in the low 16 bits of the flags
-   field.  Note these names are shared with SOM, and therefore do not
-   follow ELF naming conventions.  */
-
-/* PA 1.0 big endian.  */
-#ifndef CPU_PA_RISC1_0
-#define CPU_PA_RISC1_0		0x0000020b
-#endif
-
-/* PA 1.1 big endian.  */
-#ifndef CPU_PA_RISC1_1
-#define CPU_PA_RISC1_1		0x00000210
-#endif
-
-/* PA 1.0 little endian (unsupported) is 0x0000028b.  */
-/* PA 1.1 little endian (unsupported) is 0x00000290.  */
-
 /* Trap null address dereferences.  */
-#define ELF_PARISC_TRAPNIL	0x00010000
+#define EF_PARISC_TRAPNIL	0x00010000
 
 /* .PARISC.archext section is present.  */
 #define EF_PARISC_EXT		0x00020000
 
+/* Program expects little-endian mode.  */
+#define EF_PARISC_LSB		0x00040000
+
+/* Program expects wide mode.  */
+#define EF_PARISC_WIDE		0x00080000
+
+/* Do not allow kernel-assisted branch prediction.  */
+#define EF_PARISC_NO_KABP	0x00100000
+
+/* Allow lazy swap for dynamically allocated program segments.  */
+#define EF_PARISC_LAZYSWAP	0x00400000
+
+/* Architecture version */
+#define EF_PARISC_ARCH		0x0000ffff
+
+#define EFA_PARISC_1_0			0x020b
+#define EFA_PARISC_1_1			0x0210
+#define EFA_PARISC_2_0			0x0214
+
+/* Special section indices.  */
+/* A symbol that has been declared as a tentative definition in an ANSI C
+   compilation.  */
+#define SHN_PARISC_ANSI_COMMON 	0xff00
+
+/* A symbol that has been declared as a common block using the 
+   huge memory model.  */
+#define SHN_PARISC_HUGE_COMMON	0xff01
+
 /* Processor specific section types.  */
 
-/* Holds the global offset table, a table of pointers to external
-   data.  */
-#define SHT_PARISC_GOT		SHT_LOPROC+0
+/* Section contains product specific extension bits.  */
+#define SHT_PARISC_EXT		0x70000000
 
-/* Nonloadable section containing information in architecture
-   extensions used by the code.  */
-#define SHT_PARISC_ARCH		SHT_LOPROC+1
+/* Section contains unwind table entries.  */
+#define SHT_PARISC_UNWIND	0x70000001
 
-/* Section in which $global$ is defined.  */
-#define SHT_PARISC_GLOBAL	SHT_LOPROC+2
+/* Section contains debug information for optimized code.  */
+#define SHT_PARISC_DOC		0x70000002
 
-/* Section holding millicode routines (mul, div, rem, dyncall, etc.  */
-#define SHT_PARISC_MILLI	SHT_LOPROC+3
+/* Section contains code annotations.  */
+#define SHT_PARISC_ANNOT	0x70000003
 
-/* Section holding unwind information for use by debuggers.  */
-#define SHT_PARISC_UNWIND	SHT_LOPROC+4
-
-/* Section holding the procedure linkage table.  */
-#define SHT_PARISC_PLT		SHT_LOPROC+5
-
-/* Short initialized and uninitialized data.  */
-#define SHT_PARISC_SDATA	SHT_LOPROC+6
-#define SHT_PARISC_SBSS		SHT_LOPROC+7
-
+/* These are strictly for compatibility with the older elf32-hppa
+   implementation.  Hopefully we can eliminate them in the future.  */
 /* Optional section holding argument location/relocation info.  */
-#define SHT_PARISC_SYMEXTN	SHT_LOPROC+8
+#define SHT_PARISC_SYMEXTN    SHT_LOPROC+8
 
 /* Option section for linker stubs.  */
-#define SHT_PARISC_STUBS	SHT_LOPROC+9
+#define SHT_PARISC_STUBS      SHT_LOPROC+9
 
 /* Processor specific section flags.  */
 
-/* This section is near the global data pointer and thus allows short
-   addressing modes to be used.  */
-#define SHF_PARISC_SHORT        0x20000000
+/* Section contains code compiled for static branch prediction.  */
+#define SHF_PARISC_SBP		0x80000000
 
-/* Processor specific symbol types.  */
+/* Section should be allocated from from GP.  */
+#define SHF_PARISC_HUGE		0x40000000
 
-/* Millicode function entry point.  */
-#define STT_PARISC_MILLICODE	STT_LOPROC+0
+/* Section should go near GP.  */
+#define SHF_PARISC_SHORT	0x20000000
 
 
+/* Identifies the entry point of a millicode routine.  */
+#define STT_PARISC_MILLI	13
+
 /* ELF/HPPA relocation types */
 
+/* Note: PA-ELF is defined to use only RELA relocations.  */
 #include "reloc-macros.h"
 
-START_RELOC_NUMBERS (elf32_hppa_reloc_type)
+START_RELOC_NUMBERS (elf_hppa_reloc_type)
      RELOC_NUMBER (R_PARISC_NONE,      0)	/* No reloc */
      
      /* These relocation types do simple base + offset relocations.  */
 
-     RELOC_NUMBER (R_PARISC_DIR32,  0x01)
-     RELOC_NUMBER (R_PARISC_DIR21L, 0x02)
-     RELOC_NUMBER (R_PARISC_DIR17R, 0x03)
-     RELOC_NUMBER (R_PARISC_DIR17F, 0x04)
-     RELOC_NUMBER (R_PARISC_DIR14R, 0x06)
+     RELOC_NUMBER (R_PARISC_DIR32,  1)
+     RELOC_NUMBER (R_PARISC_DIR21L, 2)
+     RELOC_NUMBER (R_PARISC_DIR17R, 3)
+     RELOC_NUMBER (R_PARISC_DIR17F, 4)
+     RELOC_NUMBER (R_PARISC_DIR14R, 6)
 
     /* PC-relative relocation types
        Typically used for calls.
@@ -121,17 +126,20 @@
        addend being zero.  A consequence of this limitation is GAS
        can not perform relocation reductions for function symbols.  */
      
-     RELOC_NUMBER (R_PARISC_PCREL21L, 0x0a)
-     RELOC_NUMBER (R_PARISC_PCREL17R, 0x0b)
-     RELOC_NUMBER (R_PARISC_PCREL17F, 0x0c)
-     RELOC_NUMBER (R_PARISC_PCREL17C, 0x0d)
-     RELOC_NUMBER (R_PARISC_PCREL14R, 0x0e)
-     RELOC_NUMBER (R_PARISC_PCREL14F, 0x0f)
+    RELOC_NUMBER (R_PARISC_PCREL32, 9)
+    RELOC_NUMBER (R_PARISC_PCREL21L, 10)
+    RELOC_NUMBER (R_PARISC_PCREL17R, 11)
+    RELOC_NUMBER (R_PARISC_PCREL17F, 12)
+    RELOC_NUMBER (R_PARISC_PCREL17C, 13)
+    RELOC_NUMBER (R_PARISC_PCREL14R, 14)
+    RELOC_NUMBER (R_PARISC_PCREL14F, 15)
 
     /* DP-relative relocation types.  */
-     RELOC_NUMBER (R_PARISC_DPREL21L, 0x12)
-     RELOC_NUMBER (R_PARISC_DPREL14R, 0x16)
-     RELOC_NUMBER (R_PARISC_DPREL14F, 0x17)
+    RELOC_NUMBER (R_PARISC_DPREL21L, 18)
+    RELOC_NUMBER (R_PARISC_DPREL14WR, 19)
+    RELOC_NUMBER (R_PARISC_DPREL14DR, 20)
+    RELOC_NUMBER (R_PARISC_DPREL14R, 22)
+    RELOC_NUMBER (R_PARISC_DPREL14F, 23)
 
     /* Data linkage table (DLT) relocation types
 
@@ -139,49 +147,134 @@
        from position-independent code within shared libraries.  They are
        similar to the GOT relocation types in some SVR4 implementations.  */
 
-     RELOC_NUMBER (R_PARISC_DLTREL21L, 0x1a)
-     RELOC_NUMBER (R_PARISC_DLTREL14R, 0x1e)
-     RELOC_NUMBER (R_PARISC_DLTREL14F, 0x1f)
+    RELOC_NUMBER (R_PARISC_DLTREL21L, 26)
+    RELOC_NUMBER (R_PARISC_DLTREL14R, 30)
+    RELOC_NUMBER (R_PARISC_DLTREL14F, 31)
 
     /* DLT indirect relocation types  */
-     RELOC_NUMBER (R_PARISC_DLTIND21L, 0x22)
-     RELOC_NUMBER (R_PARISC_DLTIND14R, 0x26)
-     RELOC_NUMBER (R_PARISC_DLTIND14F, 0x27)
+    RELOC_NUMBER (R_PARISC_DLTIND21L, 34)
+    RELOC_NUMBER (R_PARISC_DLTIND14R, 38)
+    RELOC_NUMBER (R_PARISC_DLTIND14F, 39)
 
     /* Base relative relocation types.  Ugh.  These imply lots of state */
-     RELOC_NUMBER (R_PARISC_SETBASE,    0x28)
-     RELOC_NUMBER (R_PARISC_BASEREL32,  0x29)
-     RELOC_NUMBER (R_PARISC_BASEREL21L, 0x2a)
-     RELOC_NUMBER (R_PARISC_BASEREL17R, 0x2b)
-     RELOC_NUMBER (R_PARISC_BASEREL17F, 0x2c)
-     RELOC_NUMBER (R_PARISC_BASEREL14R, 0x2e)
-     RELOC_NUMBER (R_PARISC_BASEREL14F, 0x2f)
+    RELOC_NUMBER (R_PARISC_SETBASE, 40)
+    RELOC_NUMBER (R_PARISC_SECREL32, 41)
+    RELOC_NUMBER (R_PARISC_BASEREL21L, 42)
+    RELOC_NUMBER (R_PARISC_BASEREL17R, 43)
+    RELOC_NUMBER (R_PARISC_BASEREL17F, 44)
+    RELOC_NUMBER (R_PARISC_BASEREL14R, 46)
+    RELOC_NUMBER (R_PARISC_BASEREL14F, 47)
 
     /* Segment relative relocation types.  */
-     RELOC_NUMBER (R_PARISC_TEXTREL32, 0x31)
-     RELOC_NUMBER (R_PARISC_DATAREL32, 0x39)
+    RELOC_NUMBER (R_PARISC_SEGBASE, 48)
+    RELOC_NUMBER (R_PARISC_SEGREL32, 49)
+
+    /* Offsets from the PLT.  */
+    RELOC_NUMBER (R_PARISC_PLTOFF21L, 50)
+    RELOC_NUMBER (R_PARISC_PLTOFF14R, 54)
+    RELOC_NUMBER (R_PARISC_PLTOFF14F, 55)
+
+    RELOC_NUMBER (R_PARISC_LTOFF_FPTR32, 57)
+    RELOC_NUMBER (R_PARISC_LTOFF_FPTR21L, 58)
+    RELOC_NUMBER (R_PARISC_LTOFF_FPTR14R, 62)
+
+    RELOC_NUMBER (R_PARISC_FPTR64, 64)
 
     /* Plabel relocation types.  */
-     RELOC_NUMBER (R_PARISC_PLABEL32,  0x41)
-     RELOC_NUMBER (R_PARISC_PLABEL21L, 0x42)
-     RELOC_NUMBER (R_PARISC_PLABEL14R, 0x46)
+    RELOC_NUMBER (R_PARISC_PLABEL32, 65)
+    RELOC_NUMBER (R_PARISC_PLABEL21L, 66)
+    RELOC_NUMBER (R_PARISC_PLABEL14R, 70)
 
-    /* PLT relocations.  */
-     RELOC_NUMBER (R_PARISC_PLTIND21L, 0x82)
-     RELOC_NUMBER (R_PARISC_PLTIND14R, 0x86)
-     RELOC_NUMBER (R_PARISC_PLTIND14F, 0x87)
+    /* PCREL relocations.  */
+    RELOC_NUMBER (R_PARISC_PCREL64, 72)
+    RELOC_NUMBER (R_PARISC_PCREL22C, 73)
+    RELOC_NUMBER (R_PARISC_PCREL22F, 74)
+    RELOC_NUMBER (R_PARISC_PCREL14WR, 75)
+    RELOC_NUMBER (R_PARISC_PCREL14DR, 76)
+    RELOC_NUMBER (R_PARISC_PCREL16F, 77)
+    RELOC_NUMBER (R_PARISC_PCREL16WF, 78)
+    RELOC_NUMBER (R_PARISC_PCREL16DF, 79)
 
-    /* Misc relocation types.  */
-     RELOC_NUMBER (R_PARISC_COPY,     0x88)
-     RELOC_NUMBER (R_PARISC_GLOB_DAT, 0x89)
-     RELOC_NUMBER (R_PARISC_JMP_SLOT, 0x8a)
-     RELOC_NUMBER (R_PARISC_RELATIVE, 0x8b)
-     
-     EMPTY_RELOC (R_PARISC_UNIMPLEMENTED)
+
+    RELOC_NUMBER (R_PARISC_DIR64, 80)
+    RELOC_NUMBER (R_PARISC_DIR64WR, 81)
+    RELOC_NUMBER (R_PARISC_DIR64DR, 82)
+    RELOC_NUMBER (R_PARISC_DIR14WR, 83)
+    RELOC_NUMBER (R_PARISC_DIR14DR, 84)
+    RELOC_NUMBER (R_PARISC_DIR16F, 85)
+    RELOC_NUMBER (R_PARISC_DIR16WF, 86)
+    RELOC_NUMBER (R_PARISC_DIR16DF, 87)
+
+    RELOC_NUMBER (R_PARISC_GPREL64, 88)
+
+    RELOC_NUMBER (R_PARISC_DLTREL14WR, 91)
+    RELOC_NUMBER (R_PARISC_DLTREL14DR, 92)
+    RELOC_NUMBER (R_PARISC_GPREL16F, 93)
+    RELOC_NUMBER (R_PARISC_GPREL16WF, 94)
+    RELOC_NUMBER (R_PARISC_GPREL16DF, 95)
+
+
+    RELOC_NUMBER (R_PARISC_LTOFF64, 96)
+    RELOC_NUMBER (R_PARISC_DLTIND14WR, 99)
+    RELOC_NUMBER (R_PARISC_DLTIND14DR, 100)
+    RELOC_NUMBER (R_PARISC_LTOFF16F, 101)
+    RELOC_NUMBER (R_PARISC_LTOFF16WF, 102)
+    RELOC_NUMBER (R_PARISC_LTOFF16DF, 103)
+
+    RELOC_NUMBER (R_PARISC_SECREL64, 104)
+
+    RELOC_NUMBER (R_PARISC_BASEREL14WR, 107)
+    RELOC_NUMBER (R_PARISC_BASEREL14DR, 108)
+
+    RELOC_NUMBER (R_PARISC_SEGREL64, 112)
+
+    RELOC_NUMBER (R_PARISC_PLTOFF14WR, 115)
+    RELOC_NUMBER (R_PARISC_PLTOFF14DR, 116)
+    RELOC_NUMBER (R_PARISC_PLTOFF16F, 117)
+    RELOC_NUMBER (R_PARISC_PLTOFF16WF, 118)
+    RELOC_NUMBER (R_PARISC_PLTOFF16DF, 119)
+
+    RELOC_NUMBER (R_PARISC_LTOFF_FPTR64, 120)
+    RELOC_NUMBER (R_PARISC_LTOFF_FPTR14WR, 123)
+    RELOC_NUMBER (R_PARISC_LTOFF_FPTR14DR, 124)
+    RELOC_NUMBER (R_PARISC_LTOFF_FPTR16F, 125)
+    RELOC_NUMBER (R_PARISC_LTOFF_FPTR16WF, 126)
+    RELOC_NUMBER (R_PARISC_LTOFF_FPTR16DF, 127)
+
+ 
+    RELOC_NUMBER (R_PARISC_COPY, 128)
+    RELOC_NUMBER (R_PARISC_IPLT, 129)
+    RELOC_NUMBER (R_PARISC_EPLT, 130)
+
+    RELOC_NUMBER (R_PARISC_TPREL32, 153)
+    RELOC_NUMBER (R_PARISC_TPREL21L, 154)
+    RELOC_NUMBER (R_PARISC_TPREL14R, 158)
+
+    RELOC_NUMBER (R_PARISC_LTOFF_TP21L, 162)
+    RELOC_NUMBER (R_PARISC_LTOFF_TP14R, 166)
+    RELOC_NUMBER (R_PARISC_LTOFF_TP14F, 167)
+
+    RELOC_NUMBER (R_PARISC_TPREL64, 216)
+    RELOC_NUMBER (R_PARISC_TPREL14WR, 219)
+    RELOC_NUMBER (R_PARISC_TPREL14DR, 220)
+    RELOC_NUMBER (R_PARISC_TPREL16F, 221)
+    RELOC_NUMBER (R_PARISC_TPREL16WF, 222)
+    RELOC_NUMBER (R_PARISC_TPREL16DF, 223)
+
+    RELOC_NUMBER (R_PARISC_LTOFF_TP64, 224)
+    RELOC_NUMBER (R_PARISC_LTOFF_TP14WR, 227)
+    RELOC_NUMBER (R_PARISC_LTOFF_TP14DR, 228)
+    RELOC_NUMBER (R_PARISC_LTOFF_TP16F, 229)
+    RELOC_NUMBER (R_PARISC_LTOFF_TP16WF, 230)
+    RELOC_NUMBER (R_PARISC_LTOFF_TP16DF, 231)
+    EMPTY_RELOC (R_PARISC_UNIMPLEMENTED)
 END_RELOC_NUMBERS
 
 #ifndef RELOC_MACROS_GEN_FUNC
-typedef enum elf32_hppa_reloc_type elf32_hppa_reloc_type;
+typedef enum elf_hppa_reloc_type elf_hppa_reloc_type;
 #endif
 
+#define PT_PARISC_ARCHEXT	0x70000000
+#define PT_PARISC_UNWIND	0x70000001
+#define PF_PARISC_SBP		0x08000000
 #endif /* _ELF_HPPA_H */
diff --git a/include/elf/i960.h b/include/elf/i960.h
new file mode 100644
index 0000000..7939d28
--- /dev/null
+++ b/include/elf/i960.h
@@ -0,0 +1,37 @@
+/* Intel 960 ELF support for BFD.
+   Copyright (C) 1999 Free Software Foundation, Inc.
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 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 _ELF_I960_H
+#define _ELF_I960_H
+
+#include "reloc-macros.h"
+
+START_RELOC_NUMBERS (elf_i960_reloc_type)
+     RELOC_NUMBER (R_960_NONE,	    0)
+     RELOC_NUMBER (R_960_12,	    1)
+     RELOC_NUMBER (R_960_32,	    2)
+     RELOC_NUMBER (R_960_IP24,	    3)
+     RELOC_NUMBER (R_960_SUB,	    4)
+     RELOC_NUMBER (R_960_OPTCALL,   5)
+     RELOC_NUMBER (R_960_OPTCALLX,  6)
+     RELOC_NUMBER (R_960_OPTCALLXA, 7)
+     EMPTY_RELOC (R_960_max)
+END_RELOC_NUMBERS
+
+#endif /* _ELF_I960_H */
diff --git a/include/elf/m68k.h b/include/elf/m68k.h
index db31cdcd..e2d51ef 100644
--- a/include/elf/m68k.h
+++ b/include/elf/m68k.h
@@ -53,4 +53,6 @@
   EMPTY_RELOC  (R_68K_max)   
 END_RELOC_NUMBERS
 
+#define EF_CPU32    0x00810000
+
 #endif
diff --git a/include/elf/mcore.h b/include/elf/mcore.h
index a7c4dad..068a93a 100644
--- a/include/elf/mcore.h
+++ b/include/elf/mcore.h
@@ -34,6 +34,10 @@
   RELOC_NUMBER (R_MCORE_PCRELJSR_IMM11BY2, 6)
   RELOC_NUMBER (R_MCORE_GNU_VTINHERIT, 7)
   RELOC_NUMBER (R_MCORE_GNU_VTENTRY, 8)
+  RELOC_NUMBER (R_MCORE_RELATIVE, 9)
+  RELOC_NUMBER (R_MCORE_COPY, 10)
+  RELOC_NUMBER (R_MCORE_GLOB_DAT, 11)
+  RELOC_NUMBER (R_MCORE_JUMP_SLOT, 12)
   EMPTY_RELOC  (R_MCORE_max)
 END_RELOC_NUMBERS
 
diff --git a/include/elf/mips.h b/include/elf/mips.h
index c967248..203acbe 100644
--- a/include/elf/mips.h
+++ b/include/elf/mips.h
@@ -816,6 +816,40 @@
   bfd_vma ri_gp_value;
 } Elf64_Internal_RegInfo;
 
+typedef struct
+{
+  /* The hash value computed from the name of the corresponding
+     dynamic symbol.  */
+  unsigned char ms_hash_value[4];
+  /* Contains both the dynamic relocation index and the symbol flags
+     field.  The macros ELF32_MS_REL_INDEX and ELF32_MS_FLAGS are used
+     to access the individual values.  The dynamic relocation index
+     identifies the first entry in the .rel.dyn section that
+     references the dynamic symbol corresponding to this msym entry.
+     If the index is 0, no dynamic relocations are associated with the
+     symbol.  The symbol flags field is reserved for future use.  */
+  unsigned char ms_info[4];
+} Elf32_External_Msym;
+
+typedef struct
+{
+  /* The hash value computed from the name of the corresponding
+     dynamic symbol.  */
+  unsigned long ms_hash_value;
+  /* Contains both the dynamic relocation index and the symbol flags
+     field.  The macros ELF32_MS_REL_INDEX and ELF32_MS_FLAGS are used
+     to access the individual values.  The dynamic relocation index
+     identifies the first entry in the .rel.dyn section that
+     references the dynamic symbol corresponding to this msym entry.
+     If the index is 0, no dynamic relocations are associated with the
+     symbol.  The symbol flags field is reserved for future use.  */
+  unsigned long ms_info;
+} Elf32_Internal_Msym;
+
+#define ELF32_MS_REL_INDEX(i) ((i) >> 8)
+#define ELF32_MS_FLAGS(i)     (i) & 0xff)
+#define ELF32_MS_INFO(r, f)   (((r) << 8) + ((f) & 0xff))
+
 /* MIPS ELF reginfo swapping routines.  */
 extern void bfd_mips_elf64_swap_reginfo_in
   PARAMS ((bfd *, const Elf64_External_RegInfo *, Elf64_Internal_RegInfo *));
diff --git a/include/elf/reloc-macros.h b/include/elf/reloc-macros.h
index 9762291..42174ca 100644
--- a/include/elf/reloc-macros.h
+++ b/include/elf/reloc-macros.h
@@ -46,8 +46,8 @@
    If RELOC_MACROS_GEN_FUNC *is* defined, then instead the
    following function will be generated:
 
-   	static char * foo PARAMS ((unsigned long rtype));
-   	static char *
+   	static const char * foo PARAMS ((unsigned long rtype));
+   	static const char *
    	foo (rtype)
    	    unsigned long rtype;
    	{
diff --git a/include/elf/sparc.h b/include/elf/sparc.h
index c9e4cdd..390e4a8 100644
--- a/include/elf/sparc.h
+++ b/include/elf/sparc.h
@@ -29,6 +29,7 @@
 #define EF_SPARC_32PLUS		0x000100	/* generic V8+ features */
 #define EF_SPARC_SUN_US1	0x000200	/* Sun UltraSPARC1 extensions */
 #define EF_SPARC_HAL_R1		0x000400	/* HAL R1 extensions */
+#define EF_SPARC_SUN_US3	0x000800	/* Sun UltraSPARCIII extensions */
 
 #define EF_SPARC_LEDATA         0x800000	/* little endian data */
 
@@ -128,6 +129,8 @@
   /* little endian data relocs */
   RELOC_NUMBER (R_SPARC_REV32, 56)
 
+  EMPTY_RELOC  (R_SPARC_max_std)
+
   RELOC_NUMBER (R_SPARC_GNU_VTINHERIT, 250)
   RELOC_NUMBER (R_SPARC_GNU_VTENTRY, 251)
 
@@ -136,21 +139,15 @@
 
 /* Relocation macros.  */
 
-#define ELF64_R_TYPE_DATA(info)		(((bfd_vma) (info) << 32) >> 40)
-#define ELF64_R_TYPE_ID(info)		(((bfd_vma) (info) << 56) >> 56)
-#define ELF64_R_TYPE_INFO(data, type)	(((bfd_vma) (data) << 8) \
-					 + (bfd_vma) (type))
+#define ELF64_R_TYPE_DATA(info) \
+  (((bfd_signed_vma)(ELF64_R_TYPE(info) >> 8) ^ 0x800000) - 0x800000)
+#define ELF64_R_TYPE_ID(info) \
+  ((info) & 0xff)
+#define ELF64_R_TYPE_INFO(data, type) \
+  (((bfd_vma) ((data) & 0xffffff) << 8) | (bfd_vma) (type))
+
+/* Values for Elf64_Dyn.d_tag.  */
 
 #define DT_SPARC_REGISTER	0x70000001
 
-/*
- * FIXME: NOT ABI -- GET RID OF THIS
- * Defines the format used by the .plt.  Currently defined values are
- *   0 -- reserved to SI
- *   1 -- absolute address in .got.plt
- *   2 -- got-relative address in .got.plt
- */
-
-#define DT_SPARC_PLTFMT		0x70000001
-
 #endif /* _ELF_SPARC_H */
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index 79bc3cc..cb8d1b8 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,63 @@
+1999-07-13  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* i386.h: Add "undocumented" AMD 3DNow! pf2iw, pi2fw, pswapw insns.
+
+Thu Jul  1 00:17:24 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* hppa.h (struct pa_opcode): Add new field "flags".
+	(FLAGS_STRICT): Define.
+
+Fri Jun 25 04:22:04 1999  Jerry Quinn <jquinn@nortelnetworks.com>
+			  Jeff Law <law@cygnus.com>
+
+	* hppa.h (pa_opcodes): Add pa2.0 clrbts instruction.
+
+	* hppa.h (pa_opcodes): Add entries for mfia and mtsarcm instructions.
+
+1999-06-23  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* i386.h: Allow `l' suffix on bswap.  Allow `w' suffix on arpl,
+	lldt, lmsw, ltr, str, verr, verw.  Add FP flag to fcmov*.  Add FP
+	flag to fcomi and friends.
+
+Fri May 28 15:26:11 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* hppa.h (pa_opcodes): Move integer arithmetic instructions after
+	integer logical instructions.  
+
+1999-05-28  Linus Nordberg  <linus.nordberg@canit.se>
+
+	* m68k.h: Document new formats `E', `G', `H' and new places `N',
+	`n', `o'.
+
+	* m68k.h: Define mcf5206e, mcf5307, mcf.  Document new format `u'
+	and new places `m', `M', `h'.
+
+Thu May 27 04:13:54 1999  Joel Sherrill (joel@OARcorp.com
+
+	* hppa.h (pa_opcodes): Add several processor specific system
+	instructions.
+
+Wed May 26 16:57:44 1999  Jeffrey A Law  (law@cygnus.com)
+
+	* hppa.h (pa_opcodes): Add second entry for "comb", "comib", 
+	"addb", and "addib" to be used by the disassembler.
+
+1999-05-12  Alan Modra  <alan@apri.levels.unisa.edu.au>
+
+	* i386.h (ReverseModrm): Remove all occurences.
+	(InvMem): Add to control/debug/test mov insns, movhlps, movlhps,
+	movmskps, pextrw, pmovmskb, maskmovq.
+	Change NoSuf to FP on all MMX, XMM and AMD insns as these all
+	ignore the data size prefix.
+
+	* i386.h (i386_optab, i386_regtab): Add support for PIII SIMD.
+	Mostly stolen from Doug Ledford <dledford@redhat.com>
+
+Sat May  8 23:27:35 1999  Richard Henderson  <rth@cygnus.com>
+
+	* ppc.h (PPC_OPCODE_64_BRIDGE): New.
+
 1999-04-14  Doug Evans  <devans@casey.cygnus.com>
 
 	* cgen.h (CGEN_ATTR): Delete member num_nonbools.
diff --git a/include/opcode/hppa.h b/include/opcode/hppa.h
index 30ccb6c..f454be1 100644
--- a/include/opcode/hppa.h
+++ b/include/opcode/hppa.h
@@ -43,8 +43,12 @@
     unsigned long int mask;	/* ... in these bits. */
     char *args;
     enum pa_arch arch;
+    char flags;
 };
 
+/* Enable/disable strict syntax checking.  Not currently used, but will
+   be necessary for PA2.0 support in the future.  */
+#define FLAG_STRICT 0x1
 
 /*
    All hppa opcodes are 32 bits.
@@ -184,9 +188,21 @@
 { "b",		0xe8000000, 0xffe0e000, "nW", pa10}, /* bl foo,r0 */
 { "ldi",	0x34000000, 0xffe0c000, "j,x", pa10},	/* ldo val(r0),r */
 { "comib", 	0x84000000, 0xfc000000, "?n5,b,w", pa10}, /* comib{tf}*/
+/* This entry is for the disassembler only.  It will never be used by
+   assembler.  */
+{ "comib", 	0x8c000000, 0xfc000000, "?n5,b,w", pa10}, /* comib{tf}*/
 { "comb",	0x80000000, 0xfc000000, "?nx,b,w", pa10}, /* comb{tf} */
+/* This entry is for the disassembler only.  It will never be used by
+   assembler.  */
+{ "comb",	0x88000000, 0xfc000000, "?nx,b,w", pa10}, /* comb{tf} */
 { "addb",	0xa0000000, 0xfc000000, "@nx,b,w", pa10}, /* addb{tf} */
+/* This entry is for the disassembler only.  It will never be used by
+   assembler.  */
+{ "addb",	0xa8000000, 0xfc000000, "@nx,b,w", pa10},
 { "addib",	0xa4000000, 0xfc000000, "@n5,b,w", pa10}, /* addib{tf}*/
+/* This entry is for the disassembler only.  It will never be used by
+   assembler.  */
+{ "addib",	0xac000000, 0xfc000000, "@n5,b,w", pa10}, /* addib{tf}*/
 { "nop",        0x08000240, 0xffffffff, "", pa10},      /* or 0,0,0 */
 { "copy",       0x08000240, 0xffe0ffe0, "x,t", pa10},   /* or r,0,t */
 { "mtsar",      0x01601840, 0xffe0ffff, "x", pa10}, /* mtctl r,cr11 */
@@ -261,30 +277,10 @@
 { "addibf",	0xac000000, 0xfc000000, "!n5,b,w", pa10},
 { "bb",		0xc4004000, 0xfc004000, "~nx,Q,w", pa10}, 
 { "bvb",	0xc0004000, 0xffe04000, "~nx,w", pa10},
+{ "clrbts",	0xe8004005, 0xffffffff, "", pa20},
 
 /* Computation Instructions */
 
-{ "add",        0x08000600, 0xfc000fe0, "dx,b,t", pa10},
-{ "addl",       0x08000a00, 0xfc000fe0, "dx,b,t", pa10},
-{ "addo",       0x08000e00, 0xfc000fe0, "dx,b,t", pa10},
-{ "addc",       0x08000700, 0xfc000fe0, "dx,b,t", pa10},
-{ "addco",      0x08000f00, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh1add",     0x08000640, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh1addl",    0x08000a40, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh1addo",    0x08000e40, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh2add",     0x08000680, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh2addl",    0x08000a80, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh2addo",    0x08000e80, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh3add",     0x080006c0, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh3addl",    0x08000ac0, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh3addo",    0x08000ec0, 0xfc000fe0, "dx,b,t", pa10},
-{ "sub",        0x08000400, 0xfc000fe0, "ax,b,t", pa10},
-{ "subo",       0x08000c00, 0xfc000fe0, "ax,b,t", pa10},
-{ "subb",       0x08000500, 0xfc000fe0, "ax,b,t", pa10},
-{ "subbo",      0x08000d00, 0xfc000fe0, "ax,b,t", pa10},
-{ "subt",       0x080004c0, 0xfc000fe0, "ax,b,t", pa10},
-{ "subto",      0x08000cc0, 0xfc000fe0, "ax,b,t", pa10},
-{ "ds",         0x08000440, 0xfc000fe0, "ax,b,t", pa10},
 { "comclr",     0x08000880, 0xfc000fe0, "ax,b,t", pa10},
 { "or",         0x08000240, 0xfc000fe0, "&x,b,t", pa10},
 { "xor",        0x08000280, 0xfc000fe0, "&x,b,t", pa10},
@@ -299,9 +295,30 @@
 { "addio",      0xb4000800, 0xfc000800, "di,b,x", pa10},
 { "addit",      0xb0000000, 0xfc000800, "di,b,x", pa10},
 { "addito",     0xb0000800, 0xfc000800, "di,b,x", pa10},
+{ "add",        0x08000600, 0xfc000fe0, "dx,b,t", pa10},
+{ "addl",       0x08000a00, 0xfc000fe0, "dx,b,t", pa10},
+{ "addo",       0x08000e00, 0xfc000fe0, "dx,b,t", pa10},
+{ "addc",       0x08000700, 0xfc000fe0, "dx,b,t", pa10},
+{ "addco",      0x08000f00, 0xfc000fe0, "dx,b,t", pa10},
+{ "sub",        0x08000400, 0xfc000fe0, "ax,b,t", pa10},
+{ "subo",       0x08000c00, 0xfc000fe0, "ax,b,t", pa10},
+{ "subb",       0x08000500, 0xfc000fe0, "ax,b,t", pa10},
+{ "subbo",      0x08000d00, 0xfc000fe0, "ax,b,t", pa10},
+{ "subt",       0x080004c0, 0xfc000fe0, "ax,b,t", pa10},
+{ "subto",      0x08000cc0, 0xfc000fe0, "ax,b,t", pa10},
+{ "ds",         0x08000440, 0xfc000fe0, "ax,b,t", pa10},
 { "subi",       0x94000000, 0xfc000800, "ai,b,x", pa10},
 { "subio",      0x94000800, 0xfc000800, "ai,b,x", pa10},
 { "comiclr",    0x90000000, 0xfc000800, "ai,b,x", pa10},
+{ "sh1add",     0x08000640, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh1addl",    0x08000a40, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh1addo",    0x08000e40, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh2add",     0x08000680, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh2addl",    0x08000a80, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh2addo",    0x08000e80, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh3add",     0x080006c0, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh3addl",    0x08000ac0, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh3addo",    0x08000ec0, 0xfc000fe0, "dx,b,t", pa10},
 
 /* Extract and Deposit Instructions */
 
@@ -332,6 +349,8 @@
 { "ldsid",      0x000010a0, 0xfc1f3fe0, "(b),t", pa10},
 { "mtsp",       0x00001820, 0xffe01fff, "x,S", pa10},
 { "mtctl",      0x00001840, 0xfc00ffff, "x,^", pa10},
+{ "mtsarcm",    0x016018C0, 0xffe0ffff, "x", pa20},
+{ "mfia",       0x000014A0, 0xffffffe0, "t", pa20},
 { "mfsp",       0x000004a0, 0xffff1fe0, "S,t", pa10},
 { "mfctl",      0x000008a0, 0xfc1fffe0, "^,t", pa10},
 { "sync",       0x00000400, 0xffffffff, "", pa10},
@@ -378,6 +397,16 @@
 { "fice",       0x040002c0, 0xfc001fdf, "Zx(b)", pa10},
 { "diag",       0x14000000, 0xfc000000, "D", pa10},
 
+/* These may be specific to certain versions of the PA.  Joel claimed
+   they were 72000 (7200?) specific.  However, I'm almost certain the
+   mtcpu/mfcpu were undocumented, but available in the older 700 machines.  */
+{ "mtcpu",      0x14001600, 0xfc00ffff, "x,^"},
+{ "mfcpu",      0x14001A00, 0xfc00ffff, "^,x"},
+{ "tocen",      0x14403600, 0xffffffff, ""},
+{ "tocdis",     0x14401620, 0xffffffff, ""},
+{ "shdwgr",     0x14402600, 0xffffffff, ""},
+{ "grshdw",     0x14400620, 0xffffffff, ""},
+
 /* gfw and gfr are not in the HP PA 1.1 manual, but they are in either
    the Timex FPU or the Mustang ERS (not sure which) manual.  */
 { "gfw",	0x04001680, 0xfc003fdf, "Zx(s,b)", pa11},
diff --git a/include/opcode/i386.h b/include/opcode/i386.h
index ef8fece..e7e78c8 100644
--- a/include/opcode/i386.h
+++ b/include/opcode/i386.h
@@ -42,7 +42,6 @@
 static const template i386_optab[] = {
 
 #define X None
-#define ReverseModrm (ReverseRegRegmem|Modrm)
 #define NoSuf (No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_dSuf|No_xSuf)
 #define b_Suf (No_wSuf|No_lSuf|No_sSuf|No_dSuf|No_xSuf)
 #define w_Suf (No_bSuf|No_lSuf|No_sSuf|No_dSuf|No_xSuf)
@@ -84,43 +83,43 @@
 { "mov",   2,	0x8c, X, wl_Suf|Modrm,			{ SReg3|SReg2, WordReg|WordMem, 0 } },
 { "mov",   2,	0x8e, X, wl_Suf|Modrm|IgnoreSize,	{ WordReg|WordMem, SReg3|SReg2, 0 } },
 /* move to/from control debug registers */
-{ "mov",   2, 0x0f20, X, l_Suf|D|Modrm|IgnoreSize,	{ Control, Reg32, 0} },
-{ "mov",   2, 0x0f21, X, l_Suf|D|Modrm|IgnoreSize,	{ Debug, Reg32, 0} },
-{ "mov",   2, 0x0f24, X, l_Suf|D|Modrm|IgnoreSize,	{ Test, Reg32, 0} },
+{ "mov",   2, 0x0f20, X, l_Suf|D|Modrm|IgnoreSize,	{ Control, Reg32|InvMem, 0} },
+{ "mov",   2, 0x0f21, X, l_Suf|D|Modrm|IgnoreSize,	{ Debug, Reg32|InvMem, 0} },
+{ "mov",   2, 0x0f24, X, l_Suf|D|Modrm|IgnoreSize,	{ Test, Reg32|InvMem, 0} },
 
 /* move with sign extend */
 /* "movsbl" & "movsbw" must not be unified into "movsb" to avoid
    conflict with the "movs" string move instruction.  */
-{"movsbl", 2, 0x0fbe, X, NoSuf|ReverseModrm,	{ Reg8|ByteMem, Reg32, 0} },
-{"movsbw", 2, 0x0fbe, X, NoSuf|ReverseModrm,	{ Reg8|ByteMem, Reg16, 0} },
-{"movswl", 2, 0x0fbf, X, NoSuf|ReverseModrm,	{ Reg16|ShortMem, Reg32, 0} },
+{"movsbl", 2, 0x0fbe, X, NoSuf|Modrm,			{ Reg8|ByteMem, Reg32, 0} },
+{"movsbw", 2, 0x0fbe, X, NoSuf|Modrm,			{ Reg8|ByteMem, Reg16, 0} },
+{"movswl", 2, 0x0fbf, X, NoSuf|Modrm,			{ Reg16|ShortMem, Reg32, 0} },
 /* Intel Syntax */
-{"movsx",  2, 0x0fbf, X, w_Suf|ReverseModrm|IgnoreSize,    { Reg16|ShortMem, Reg32, 0} },
-{"movsx",  2, 0x0fbe, X, b_Suf|ReverseModrm,    { Reg8|ByteMem, WordReg, 0} },
+{"movsx",  2, 0x0fbf, X, w_Suf|Modrm|IgnoreSize,	{ Reg16|ShortMem, Reg32, 0} },
+{"movsx",  2, 0x0fbe, X, b_Suf|Modrm,			{ Reg8|ByteMem, WordReg, 0} },
 
 /* move with zero extend */
-{"movzb",  2, 0x0fb6, X, wl_Suf|ReverseModrm,	{ Reg8|ByteMem, WordReg, 0} },
-{"movzwl", 2, 0x0fb7, X, NoSuf|ReverseModrm,	{ Reg16|ShortMem, Reg32, 0} },
+{"movzb",  2, 0x0fb6, X, wl_Suf|Modrm,			{ Reg8|ByteMem, WordReg, 0} },
+{"movzwl", 2, 0x0fb7, X, NoSuf|Modrm,			{ Reg16|ShortMem, Reg32, 0} },
 /* Intel Syntax */
-{"movzx",  2, 0x0fb7, X, w_Suf|ReverseModrm|IgnoreSize,  { Reg16|ShortMem, Reg32, 0} },
-{"movzx",  2, 0x0fb6, X, b_Suf|ReverseModrm,   { Reg8|ByteMem, WordReg, 0} },
+{"movzx",  2, 0x0fb7, X, w_Suf|Modrm|IgnoreSize,	{ Reg16|ShortMem, Reg32, 0} },
+{"movzx",  2, 0x0fb6, X, b_Suf|Modrm,			{ Reg8|ByteMem, WordReg, 0} },
 
 /* push instructions */
-{"push",   1,	0x50, X, wl_Suf|ShortForm,	{ WordReg,0,0 } },
+{"push",   1,	0x50, X, wl_Suf|ShortForm,	{ WordReg, 0, 0 } },
 {"push",   1,	0xff, 6, wl_Suf|Modrm,		{ WordReg|WordMem, 0, 0 } },
 {"push",   1,	0x6a, X, wl_Suf,		{ Imm8S, 0, 0} },
 {"push",   1,	0x68, X, wl_Suf,		{ Imm16|Imm32, 0, 0} },
-{"push",   1,	0x06, X, wl_Suf|Seg2ShortForm,	{ SReg2,0,0 } },
-{"push",   1, 0x0fa0, X, wl_Suf|Seg3ShortForm,	{ SReg3,0,0 } },
+{"push",   1,	0x06, X, wl_Suf|Seg2ShortForm,	{ SReg2, 0, 0 } },
+{"push",   1, 0x0fa0, X, wl_Suf|Seg3ShortForm,	{ SReg3, 0, 0 } },
 /* push all */
 {"pusha",  0,	0x60, X, wl_Suf,		{ 0, 0, 0 } },
 
 /* pop instructions */
-{"pop",	   1,	0x58, X, wl_Suf|ShortForm,	{ WordReg,0,0 } },
+{"pop",	   1,	0x58, X, wl_Suf|ShortForm,	{ WordReg, 0, 0 } },
 {"pop",	   1,	0x8f, 0, wl_Suf|Modrm,		{ WordReg|WordMem, 0, 0 } },
 #define POP_SEG_SHORT 0x07
-{"pop",	   1,	0x07, X, wl_Suf|Seg2ShortForm,	{ SReg2,0,0 } },
-{"pop",	   1, 0x0fa1, X, wl_Suf|Seg3ShortForm,	{ SReg3,0,0 } },
+{"pop",	   1,	0x07, X, wl_Suf|Seg2ShortForm,	{ SReg2, 0, 0 } },
+{"pop",	   1, 0x0fa1, X, wl_Suf|Seg3ShortForm,	{ SReg3, 0, 0 } },
 /* pop all */
 {"popa",   0,	0x61, X, wl_Suf,		{ 0, 0, 0 } },
 
@@ -250,9 +249,9 @@
    These multiplies can only be selected with single operand forms.  */
 {"mul",	   1,	0xf6, 4, bwl_Suf|W|Modrm,	{ Reg|AnyMem, 0, 0} },
 {"imul",   1,	0xf6, 5, bwl_Suf|W|Modrm,	{ Reg|AnyMem, 0, 0} },
-{"imul",   2, 0x0faf, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"imul",   3,	0x6b, X, wl_Suf|ReverseModrm,	{ Imm8S, WordReg|WordMem, WordReg} },
-{"imul",   3,	0x69, X, wl_Suf|ReverseModrm,	{ Imm16|Imm32, WordReg|WordMem, WordReg} },
+{"imul",   2, 0x0faf, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"imul",   3,	0x6b, X, wl_Suf|Modrm,		{ Imm8S, WordReg|WordMem, WordReg} },
+{"imul",   3,	0x69, X, wl_Suf|Modrm,		{ Imm16|Imm32, WordReg|WordMem, WordReg} },
 /* imul with 2 operands mimics imul with 3 by putting the register in
    both i.rm.reg & i.rm.regmem fields.  regKludge enables this
    transformation.  */
@@ -315,7 +314,7 @@
 {"call",   1,	0xe8, X, wl_Suf|JumpDword,	{ Disp16|Disp32, 0, 0} },
 {"call",   1,	0xff, 2, wl_Suf|Modrm,		{ WordReg|WordMem|JumpAbsolute, 0, 0} },
 /* Intel Syntax */
-{"call",   2, 0x9a, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
+{"call",   2,	0x9a, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
 {"lcall",  2,	0x9a, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
 {"lcall",  1,	0xff, 3, wl_Suf|Modrm,		{ WordMem, 0, 0} },
 
@@ -323,8 +322,8 @@
 {"jmp",	   1,	0xeb, X, NoSuf|Jump,		{ Disp, 0, 0} },
 {"jmp",	   1,	0xff, 4, wl_Suf|Modrm,		{ WordReg|WordMem|JumpAbsolute, 0, 0} },
 /* Intel Syntax */
-{"jmp",   2,	0xea, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
-{"jmp",   1,	0xff, 5, wl_Suf|Modrm,		{ WordMem, 0, 0} },
+{"jmp",    2,	0xea, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
+{"jmp",    1,	0xff, 5, wl_Suf|Modrm,		{ WordMem, 0, 0} },
 {"ljmp",   2,	0xea, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
 {"ljmp",   1,	0xff, 5, wl_Suf|Modrm,		{ WordMem, 0, 0} },
 
@@ -448,8 +447,8 @@
 {"xlat",   1,	0xd7, X, b_Suf|IsString,	{ AnyMem, 0, 0} },
 
 /* bit manipulation */
-{"bsf",	   2, 0x0fbc, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"bsr",	   2, 0x0fbd, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
+{"bsf",	   2, 0x0fbc, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"bsr",	   2, 0x0fbd, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
 {"bt",	   2, 0x0fa3, X, wl_Suf|Modrm,		{ WordReg, WordReg|WordMem, 0} },
 {"bt",	   2, 0x0fba, 4, wl_Suf|Modrm,		{ Imm8, WordReg|WordMem, 0} },
 {"btc",	   2, 0x0fbb, X, wl_Suf|Modrm,		{ WordReg, WordReg|WordMem, 0} },
@@ -478,23 +477,23 @@
 {"nop",	   0,	0x90, X, NoSuf,			{ 0, 0, 0} },
 
 /* protection control */
-{"arpl",   2,	0x63, X, NoSuf|Modrm|IgnoreSize,{ Reg16, Reg16|ShortMem, 0} },
-{"lar",	   2, 0x0f02, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
+{"arpl",   2,	0x63, X, w_Suf|Modrm|IgnoreSize,{ Reg16, Reg16|ShortMem, 0} },
+{"lar",	   2, 0x0f02, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
 {"lgdt",   1, 0x0f01, 2, wl_Suf|Modrm,		{ WordMem, 0, 0} },
 {"lidt",   1, 0x0f01, 3, wl_Suf|Modrm,		{ WordMem, 0, 0} },
-{"lldt",   1, 0x0f00, 2, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
-{"lmsw",   1, 0x0f01, 6, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
-{"lsl",	   2, 0x0f03, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"ltr",	   1, 0x0f00, 3, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"lldt",   1, 0x0f00, 2, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"lmsw",   1, 0x0f01, 6, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"lsl",	   2, 0x0f03, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"ltr",	   1, 0x0f00, 3, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
 
 {"sgdt",   1, 0x0f01, 0, wl_Suf|Modrm,		{ WordMem, 0, 0} },
 {"sidt",   1, 0x0f01, 1, wl_Suf|Modrm,		{ WordMem, 0, 0} },
 {"sldt",   1, 0x0f00, 0, wl_Suf|Modrm,		{ WordReg|WordMem, 0, 0} },
 {"smsw",   1, 0x0f01, 4, wl_Suf|Modrm,		{ WordReg|WordMem, 0, 0} },
-{"str",	   1, 0x0f00, 1, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"str",	   1, 0x0f00, 1, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
 
-{"verr",   1, 0x0f00, 4, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
-{"verw",   1, 0x0f00, 5, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"verr",   1, 0x0f00, 4, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"verw",   1, 0x0f00, 5, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
 
 /* floating point instructions */
 
@@ -767,7 +766,7 @@
 
 /* 486 extensions */
 
-{"bswap",   1, 0x0fc8, X, NoSuf|ShortForm,	{ Reg32,0,0 } },
+{"bswap",   1, 0x0fc8, X, l_Suf|ShortForm,	{ Reg32, 0, 0 } },
 {"xadd",    2, 0x0fc0, X, bwl_Suf|W|Modrm,	{ Reg, Reg|AnyMem, 0 } },
 {"cmpxchg", 2, 0x0fb0, X, bwl_Suf|W|Modrm,	{ Reg, Reg|AnyMem, 0 } },
 {"invd",    0, 0x0f08, X, NoSuf,		{ 0, 0, 0} },
@@ -782,10 +781,10 @@
 {"rdtsc",   0, 0x0f31, X, NoSuf,		{ 0, 0, 0} },
 {"rdmsr",   0, 0x0f32, X, NoSuf,		{ 0, 0, 0} },
 {"cmpxchg8b",1,0x0fc7, 1, NoSuf|Modrm,		{ LLongMem, 0, 0} },
-{"sysenter", 0, 0x0f34, X, NoSuf,		{ 0, 0, 0} },
-{"sysexit",  0, 0x0f35, X, NoSuf,		{ 0, 0, 0} },
-{"fxsave",   1,	0x0fae, 0, FP|Modrm,		{ LLongMem, 0, 0} },
-{"fxrstor",  1,	0x0fae, 1, FP|Modrm,		{ LLongMem, 0, 0} },
+{"sysenter",0, 0x0f34, X, NoSuf,		{ 0, 0, 0} },
+{"sysexit", 0, 0x0f35, X, NoSuf,		{ 0, 0, 0} },
+{"fxsave",  1, 0x0fae, 0, FP|Modrm,		{ LLongMem, 0, 0} },
+{"fxrstor", 1, 0x0fae, 1, FP|Modrm,		{ LLongMem, 0, 0} },
 
 /* Pentium Pro extensions */
 {"rdpmc",   0, 0x0f33, X, NoSuf,		{ 0, 0, 0} },
@@ -794,154 +793,244 @@
 {"ud2a",    0, 0x0f0b, X, NoSuf,		{ 0, 0, 0} }, /* alias for ud2 */
 {"ud2b",    0, 0x0fb9, X, NoSuf,		{ 0, 0, 0} }, /* 2nd. official undefined instr. */
 
-{"cmovo",   2, 0x0f40, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovno",  2, 0x0f41, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovb",   2, 0x0f42, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovc",   2, 0x0f42, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovnae", 2, 0x0f42, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovae",  2, 0x0f43, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovnc",  2, 0x0f43, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovnb",  2, 0x0f43, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmove",   2, 0x0f44, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovz",   2, 0x0f44, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovne",  2, 0x0f45, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovnz",  2, 0x0f45, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovbe",  2, 0x0f46, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovna",  2, 0x0f46, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmova",   2, 0x0f47, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovnbe", 2, 0x0f47, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovs",   2, 0x0f48, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovns",  2, 0x0f49, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovp",   2, 0x0f4a, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovnp",  2, 0x0f4b, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovl",   2, 0x0f4c, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovnge", 2, 0x0f4c, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovge",  2, 0x0f4d, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovnl",  2, 0x0f4d, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovle",  2, 0x0f4e, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovng",  2, 0x0f4e, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovg",   2, 0x0f4f, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
-{"cmovnle", 2, 0x0f4f, X, wl_Suf|ReverseModrm,	{ WordReg|WordMem, WordReg, 0} },
+{"cmovo",   2, 0x0f40, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovno",  2, 0x0f41, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovb",   2, 0x0f42, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovc",   2, 0x0f42, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovnae", 2, 0x0f42, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovae",  2, 0x0f43, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovnc",  2, 0x0f43, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovnb",  2, 0x0f43, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmove",   2, 0x0f44, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovz",   2, 0x0f44, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovne",  2, 0x0f45, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovnz",  2, 0x0f45, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovbe",  2, 0x0f46, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovna",  2, 0x0f46, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmova",   2, 0x0f47, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovnbe", 2, 0x0f47, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovs",   2, 0x0f48, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovns",  2, 0x0f49, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovp",   2, 0x0f4a, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovnp",  2, 0x0f4b, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovl",   2, 0x0f4c, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovnge", 2, 0x0f4c, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovge",  2, 0x0f4d, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovnl",  2, 0x0f4d, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovle",  2, 0x0f4e, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovng",  2, 0x0f4e, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovg",   2, 0x0f4f, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
+{"cmovnle", 2, 0x0f4f, X, wl_Suf|Modrm,		{ WordReg|WordMem, WordReg, 0} },
 
-{"fcmovb",  2, 0xdac0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmovnae",2, 0xdac0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmove",  2, 0xdac8, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmovbe", 2, 0xdad0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmovna", 2, 0xdad0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmovu",  2, 0xdad8, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmovae", 2, 0xdbc0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmovnb", 2, 0xdbc0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmovne", 2, 0xdbc8, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmova",  2, 0xdbd0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmovnbe",2, 0xdbd0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcmovnu", 2, 0xdbd8, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
+{"fcmovb",  2, 0xdac0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmovnae",2, 0xdac0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmove",  2, 0xdac8, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmovbe", 2, 0xdad0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmovna", 2, 0xdad0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmovu",  2, 0xdad8, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmovae", 2, 0xdbc0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmovnb", 2, 0xdbc0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmovne", 2, 0xdbc8, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmova",  2, 0xdbd0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmovnbe",2, 0xdbd0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcmovnu", 2, 0xdbd8, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
 
-{"fcomi",   2, 0xdbf0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcomi",   0, 0xdbf1, X, NoSuf|ShortForm,	{ 0, 0, 0} },
-{"fcomi",   1, 0xdbf0, X, NoSuf|ShortForm,	{ FloatReg, 0, 0} },
-{"fucomi",  2, 0xdbe8, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fucomi",  0, 0xdbe9, X, NoSuf|ShortForm,	{ 0, 0, 0} },
-{"fucomi",  1, 0xdbe8, X, NoSuf|ShortForm,	{ FloatReg, 0, 0} },
-{"fcomip",  2, 0xdff0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcompi",  2, 0xdff0, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fcompi",  0, 0xdff1, X, NoSuf|ShortForm,	{ 0, 0, 0} },
-{"fcompi",  1, 0xdff0, X, NoSuf|ShortForm,	{ FloatReg, 0, 0} },
-{"fucomip", 2, 0xdfe8, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fucompi", 2, 0xdfe8, X, NoSuf|ShortForm,	{ FloatReg, FloatAcc, 0} },
-{"fucompi", 0, 0xdfe9, X, NoSuf|ShortForm,	{ 0, 0, 0} },
-{"fucompi", 1, 0xdfe8, X, NoSuf|ShortForm,	{ FloatReg, 0, 0} },
+{"fcomi",   2, 0xdbf0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcomi",   0, 0xdbf1, X, FP|ShortForm,		{ 0, 0, 0} },
+{"fcomi",   1, 0xdbf0, X, FP|ShortForm,		{ FloatReg, 0, 0} },
+{"fucomi",  2, 0xdbe8, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fucomi",  0, 0xdbe9, X, FP|ShortForm,		{ 0, 0, 0} },
+{"fucomi",  1, 0xdbe8, X, FP|ShortForm,		{ FloatReg, 0, 0} },
+{"fcomip",  2, 0xdff0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcompi",  2, 0xdff0, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fcompi",  0, 0xdff1, X, FP|ShortForm,		{ 0, 0, 0} },
+{"fcompi",  1, 0xdff0, X, FP|ShortForm,		{ FloatReg, 0, 0} },
+{"fucomip", 2, 0xdfe8, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fucompi", 2, 0xdfe8, X, FP|ShortForm,		{ FloatReg, FloatAcc, 0} },
+{"fucompi", 0, 0xdfe9, X, FP|ShortForm,		{ 0, 0, 0} },
+{"fucompi", 1, 0xdfe8, X, FP|ShortForm,		{ FloatReg, 0, 0} },
 
 /* MMX instructions.  */
 
-{"emms",     0, 0x0f77, X, NoSuf,		{ 0, 0, 0 } },
-{"movd",     2, 0x0f6e, X, NoSuf|Modrm,		{ Reg32|LongMem, RegMMX, 0 } },
-{"movd",     2, 0x0f7e, X, NoSuf|Modrm,		{ RegMMX, Reg32|LongMem, 0 } },
-{"movq",     2, 0x0f6f, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"movq",     2, 0x0f7f, X, NoSuf|Modrm,		{ RegMMX, RegMMX|LongMem, 0 } },
-{"packssdw", 2, 0x0f6b, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"packsswb", 2, 0x0f63, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"packuswb", 2, 0x0f67, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"paddb",    2, 0x0ffc, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"paddw",    2, 0x0ffd, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"paddd",    2, 0x0ffe, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"paddsb",   2, 0x0fec, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"paddsw",   2, 0x0fed, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"paddusb",  2, 0x0fdc, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"paddusw",  2, 0x0fdd, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pand",     2, 0x0fdb, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pandn",    2, 0x0fdf, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpeqb",  2, 0x0f74, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpeqw",  2, 0x0f75, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpeqd",  2, 0x0f76, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpgtb",  2, 0x0f64, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpgtw",  2, 0x0f65, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpgtd",  2, 0x0f66, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pmaddwd",  2, 0x0ff5, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pmulhw",   2, 0x0fe5, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pmullw",   2, 0x0fd5, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"por",	     2, 0x0feb, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psllw",    2, 0x0ff1, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psllw",    2, 0x0f71, 6, NoSuf|Modrm,		{ Imm8, RegMMX, 0 } },
-{"pslld",    2, 0x0ff2, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pslld",    2, 0x0f72, 6, NoSuf|Modrm,		{ Imm8, RegMMX, 0 } },
-{"psllq",    2, 0x0ff3, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psllq",    2, 0x0f73, 6, NoSuf|Modrm,		{ Imm8, RegMMX, 0 } },
-{"psraw",    2, 0x0fe1, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psraw",    2, 0x0f71, 4, NoSuf|Modrm,		{ Imm8, RegMMX, 0 } },
-{"psrad",    2, 0x0fe2, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psrad",    2, 0x0f72, 4, NoSuf|Modrm,		{ Imm8, RegMMX, 0 } },
-{"psrlw",    2, 0x0fd1, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psrlw",    2, 0x0f71, 2, NoSuf|Modrm,		{ Imm8, RegMMX, 0 } },
-{"psrld",    2, 0x0fd2, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psrld",    2, 0x0f72, 2, NoSuf|Modrm,		{ Imm8, RegMMX, 0 } },
-{"psrlq",    2, 0x0fd3, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psrlq",    2, 0x0f73, 2, NoSuf|Modrm,		{ Imm8, RegMMX, 0 } },
-{"psubb",    2, 0x0ff8, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psubw",    2, 0x0ff9, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psubd",    2, 0x0ffa, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psubsb",   2, 0x0fe8, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psubsw",   2, 0x0fe9, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psubusb",  2, 0x0fd8, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"psubusw",  2, 0x0fd9, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"punpckhbw",2, 0x0f68, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"punpckhwd",2, 0x0f69, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"punpckhdq",2, 0x0f6a, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"punpcklbw",2, 0x0f60, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"punpcklwd",2, 0x0f61, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"punpckldq",2, 0x0f62, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
-{"pxor",     2, 0x0fef, X, NoSuf|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"emms",     0, 0x0f77, X, FP,			{ 0, 0, 0 } },
+{"movd",     2, 0x0f6e, X, FP|Modrm,		{ Reg32|LongMem, RegMMX, 0 } },
+{"movd",     2, 0x0f7e, X, FP|Modrm,		{ RegMMX, Reg32|LongMem, 0 } },
+{"movq",     2, 0x0f6f, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"movq",     2, 0x0f7f, X, FP|Modrm,		{ RegMMX, RegMMX|LongMem, 0 } },
+{"packssdw", 2, 0x0f6b, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"packsswb", 2, 0x0f63, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"packuswb", 2, 0x0f67, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"paddb",    2, 0x0ffc, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"paddw",    2, 0x0ffd, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"paddd",    2, 0x0ffe, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"paddsb",   2, 0x0fec, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"paddsw",   2, 0x0fed, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"paddusb",  2, 0x0fdc, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"paddusw",  2, 0x0fdd, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pand",     2, 0x0fdb, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pandn",    2, 0x0fdf, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpeqb",  2, 0x0f74, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpeqw",  2, 0x0f75, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpeqd",  2, 0x0f76, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpgtb",  2, 0x0f64, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpgtw",  2, 0x0f65, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpgtd",  2, 0x0f66, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pmaddwd",  2, 0x0ff5, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pmulhw",   2, 0x0fe5, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pmullw",   2, 0x0fd5, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"por",	     2, 0x0feb, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psllw",    2, 0x0ff1, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psllw",    2, 0x0f71, 6, FP|Modrm,		{ Imm8, RegMMX, 0 } },
+{"pslld",    2, 0x0ff2, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pslld",    2, 0x0f72, 6, FP|Modrm,		{ Imm8, RegMMX, 0 } },
+{"psllq",    2, 0x0ff3, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psllq",    2, 0x0f73, 6, FP|Modrm,		{ Imm8, RegMMX, 0 } },
+{"psraw",    2, 0x0fe1, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psraw",    2, 0x0f71, 4, FP|Modrm,		{ Imm8, RegMMX, 0 } },
+{"psrad",    2, 0x0fe2, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psrad",    2, 0x0f72, 4, FP|Modrm,		{ Imm8, RegMMX, 0 } },
+{"psrlw",    2, 0x0fd1, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psrlw",    2, 0x0f71, 2, FP|Modrm,		{ Imm8, RegMMX, 0 } },
+{"psrld",    2, 0x0fd2, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psrld",    2, 0x0f72, 2, FP|Modrm,		{ Imm8, RegMMX, 0 } },
+{"psrlq",    2, 0x0fd3, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psrlq",    2, 0x0f73, 2, FP|Modrm,		{ Imm8, RegMMX, 0 } },
+{"psubb",    2, 0x0ff8, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psubw",    2, 0x0ff9, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psubd",    2, 0x0ffa, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psubsb",   2, 0x0fe8, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psubsw",   2, 0x0fe9, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psubusb",  2, 0x0fd8, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"psubusw",  2, 0x0fd9, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"punpckhbw",2, 0x0f68, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"punpckhwd",2, 0x0f69, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"punpckhdq",2, 0x0f6a, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"punpcklbw",2, 0x0f60, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"punpcklwd",2, 0x0f61, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"punpckldq",2, 0x0f62, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
+{"pxor",     2, 0x0fef, X, FP|Modrm,		{ RegMMX|LongMem, RegMMX, 0 } },
 
-  
+
+/* PIII Katmai New Instructions / SIMD instructions */
+
+{"addps",     2, 0x0f58,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"addss",     2, 0xf30f58,  X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"andnps",    2, 0x0f55,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"andps",     2, 0x0f54,    X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"cmpps",     3, 0x0fc2,    X, FP|Modrm,	{ Imm8, RegXMM|LLongMem, RegXMM } },
+{"cmpss",     3, 0xf30fc2,  X, FP|Modrm,	{ Imm8, RegXMM|WordMem, RegXMM } },
+{"cmpeqps",   2, 0x0fc2,    0, FP|Modrm|ImmExt,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpeqss",   2, 0xf30fc2,  0, FP|Modrm|ImmExt,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"cmpltps",   2, 0x0fc2,    1, FP|Modrm|ImmExt,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpltss",   2, 0xf30fc2,  1, FP|Modrm|ImmExt,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"cmpleps",   2, 0x0fc2,    2, FP|Modrm|ImmExt,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpless",   2, 0xf30fc2,  2, FP|Modrm|ImmExt,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"cmpunordps",2, 0x0fc2,    3, FP|Modrm|ImmExt,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpunordss",2, 0xf30fc2,  3, FP|Modrm|ImmExt,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"cmpneqps",  2, 0x0fc2,    4, FP|Modrm|ImmExt,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpneqss",  2, 0xf30fc2,  4, FP|Modrm|ImmExt,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"cmpnltps",  2, 0x0fc2,    5, FP|Modrm|ImmExt,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpnltss",  2, 0xf30fc2,  5, FP|Modrm|ImmExt,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"cmpnleps",  2, 0x0fc2,    6, FP|Modrm|ImmExt,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpnless",  2, 0xf30fc2,  6, FP|Modrm|ImmExt,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"cmpordps",  2, 0x0fc2,    7, FP|Modrm|ImmExt,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpordss",  2, 0xf30fc2,  7, FP|Modrm|ImmExt,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"comiss",    2, 0x0f2f,    X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"cvtpi2ps",  2, 0x0f2a,    X, FP|Modrm,	{ RegMMX|LLongMem, RegXMM, 0 } },
+{"cvtsi2ss",  2, 0xf30f2a,  X, FP|Modrm,	{ Reg32|WordMem, RegXMM, 0 } },
+{"cvtps2pi",  2, 0x0f2d,    X, FP|Modrm,	{ RegXMM|LLongMem, RegMMX, 0 } },
+{"cvtss2si",  2, 0xf30f2d,  X, FP|Modrm,	{ RegXMM|WordMem, Reg32, 0 } },
+{"cvttps2pi", 2, 0x0f2c,    X, FP|Modrm,	{ RegXMM|LLongMem, RegMMX, 0 } },
+{"cvttss2si", 2, 0xf30f2c,  X, FP|Modrm,	{ RegXMM|WordMem, Reg32, 0 } },
+{"divps",     2, 0x0f5e,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"divss",     2, 0xf30f5e,  X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"ldmxcsr",   1, 0x0fae,    2, FP|Modrm, 	{ WordMem, 0, 0 } },
+{"stmxcsr",   1, 0x0fae,    3, FP|Modrm, 	{ WordMem, 0, 0 } },
+{"sfence",    0, 0x0faef8,  X, FP,		{ 0, 0, 0 } },
+{"maxps",     2, 0x0f5f,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"maxss",     2, 0xf30f5f,  X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"minps",     2, 0x0f5d,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"minss",     2, 0xf30f5d,  X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"movaps",    2, 0x0f28,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"movaps",    2, 0x0f29,    X, FP|Modrm,	{ RegXMM, RegXMM|LLongMem, 0 } },
+{"movhlps",   2, 0x0f12,    X, FP|Modrm,	{ RegXMM|InvMem, RegXMM, 0 } },
+{"movhps",    2, 0x0f16,    X, FP|Modrm,	{ LLongMem, RegXMM, 0 } },
+{"movhps",    2, 0x0f17,    X, FP|Modrm,	{ RegXMM, LLongMem, 0 } },
+{"movlhps",   2, 0x0f16,    X, FP|Modrm,	{ RegXMM|InvMem, RegXMM, 0 } },
+{"movlps",    2, 0x0f12,    X, FP|Modrm,	{ LLongMem, RegXMM, 0 } },
+{"movlps",    2, 0x0f13,    X, FP|Modrm,	{ RegXMM, LLongMem, 0 } },
+{"movmskps",  2, 0x0f50,    X, FP|Modrm,	{ RegXMM|InvMem, Reg32, 0 } },
+{"movups",    2, 0x0f10,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"movups",    2, 0x0f11,    X, FP|Modrm,	{ RegXMM, RegXMM|LLongMem, 0 } },
+{"movss",     2, 0xf30f10,  X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"movss",     2, 0xf30f11,  X, FP|Modrm,	{ RegXMM, RegXMM|WordMem, 0 } },
+{"mulps",     2, 0x0f59,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"mulss",     2, 0xf30f59,  X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"orps",      2, 0x0f56,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"rcpps",     2, 0x0f53,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"rcpss",     2, 0xf30f53,  X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"rsqrtps",   2, 0x0f52,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"rsqrtss",   2, 0xf30f52,  X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"shufps",    3, 0x0fc6,    X, FP|Modrm,	{ Imm8, RegXMM|LLongMem, RegXMM } },
+{"sqrtps",    2, 0x0f51,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"sqrtss",    2, 0xf30f51,  X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"subps",     2, 0x0f5c,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"subss",     2, 0xf30f5c,  X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"ucomiss",   2, 0x0f2e,    X, FP|Modrm,	{ RegXMM|WordMem, RegXMM, 0 } },
+{"unpckhps",  2, 0x0f15,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"unpcklps",  2, 0x0f14,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"xorps",     2, 0x0f57,    X, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
+{"pavgb",     2, 0x0fe0,    X, FP|Modrm,	{ RegMMX|LLongMem, RegMMX, 0 } },
+{"pavgw",     2, 0x0fe3,    X, FP|Modrm,	{ RegMMX|LLongMem, RegMMX, 0 } },
+{"pextrw",    3, 0x0fc5,    X, FP|Modrm,	{ Imm8, RegMMX, Reg32|InvMem } },
+{"pinsrw",    3, 0x0fc4,    X, FP|Modrm,	{ Imm8, Reg32|ShortMem, RegMMX } },
+{"pmaxsw",    2, 0x0fee,    X, FP|Modrm,	{ RegMMX|LLongMem, RegMMX, 0 } },
+{"pmaxub",    2, 0x0fde,    X, FP|Modrm,	{ RegMMX|LLongMem, RegMMX, 0 } },
+{"pminsw",    2, 0x0fea,    X, FP|Modrm,	{ RegMMX|LLongMem, RegMMX, 0 } },
+{"pminub",    2, 0x0fda,    X, FP|Modrm,	{ RegMMX|LLongMem, RegMMX, 0 } },
+{"pmovmskb",  2, 0x0fd7,    X, FP|Modrm,	{ RegMMX, Reg32|InvMem, 0 } },
+{"pmulhuw",   2, 0x0fe4,    X, FP|Modrm,	{ RegMMX|LLongMem, RegMMX, 0 } },
+{"psadbw",    2, 0x0ff6,    X, FP|Modrm,	{ RegMMX|LLongMem, RegMMX, 0 } },
+{"pshufw",    3, 0x0f70,    X, FP|Modrm,	{ Imm8, RegMMX|LLongMem, RegMMX } },
+{"maskmovq",  2, 0x0ff7,    X, FP|Modrm,	{ RegMMX|InvMem, RegMMX, 0 } },
+{"movntps",   2, 0x0f2b,    X, FP|Modrm, 	{ RegXMM, LLongMem, 0 } },
+{"movntq",    2, 0x0fe7,    X, FP|Modrm, 	{ RegMMX, LLongMem, 0 } },
+{"prefetchnta", 1, 0x0f18,  0, FP|Modrm, 	{ LLongMem, 0, 0 } },
+{"prefetcht0",  1, 0x0f18,  1, FP|Modrm, 	{ LLongMem, 0, 0 } },
+{"prefetcht1",  1, 0x0f18,  2, FP|Modrm, 	{ LLongMem, 0, 0 } },
+{"prefetcht2",  1, 0x0f18,  3, FP|Modrm, 	{ LLongMem, 0, 0 } },
+
 /* AMD 3DNow! instructions */
-#define AMD_3DNOW_OPCODE 0x0f0f
 
-{"prefetch", 1, 0x0f0d,	   0, NoSuf|Modrm,	{ ByteMem, 0, 0 } },
-{"prefetchw",1, 0x0f0d,	   1, NoSuf|Modrm,	{ ByteMem, 0, 0 } },
-{"femms",    0, 0x0f0e,	   X, NoSuf,		{ 0, 0, 0 } },
-{"pavgusb",  2, 0x0f0f, 0xbf, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pf2id",    2, 0x0f0f, 0x1d, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfacc",    2, 0x0f0f, 0xae, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfadd",    2, 0x0f0f, 0x9e, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfcmpeq",  2, 0x0f0f, 0xb0, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfcmpge",  2, 0x0f0f, 0x90, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfcmpgt",  2, 0x0f0f, 0xa0, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfmax",    2, 0x0f0f, 0xa4, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfmin",    2, 0x0f0f, 0x94, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfmul",    2, 0x0f0f, 0xb4, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfrcp",    2, 0x0f0f, 0x96, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfrcpit1", 2, 0x0f0f, 0xa6, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfrcpit2", 2, 0x0f0f, 0xb6, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfrsqit1", 2, 0x0f0f, 0xa7, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfrsqrt",  2, 0x0f0f, 0x97, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfsub",    2, 0x0f0f, 0x9a, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pfsubr",   2, 0x0f0f, 0xaa, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pi2fd",    2, 0x0f0f, 0x0d, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
-{"pmulhrw",  2, 0x0f0f, 0xb7, NoSuf|Modrm,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"prefetch", 1, 0x0f0d,	   0, FP|Modrm,		{ ByteMem, 0, 0 } },
+{"prefetchw",1, 0x0f0d,	   1, FP|Modrm,		{ ByteMem, 0, 0 } },
+{"femms",    0, 0x0f0e,	   X, FP,		{ 0, 0, 0 } },
+{"pavgusb",  2, 0x0f0f, 0xbf, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pf2id",    2, 0x0f0f, 0x1d, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pf2iw",    2, 0x0f0f, 0x1c, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } }, /* Unofficial! See http://www.x86.org/articles/3dnow/amd_3dnow.html */
+{"pfacc",    2, 0x0f0f, 0xae, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfadd",    2, 0x0f0f, 0x9e, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfcmpeq",  2, 0x0f0f, 0xb0, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfcmpge",  2, 0x0f0f, 0x90, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfcmpgt",  2, 0x0f0f, 0xa0, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfmax",    2, 0x0f0f, 0xa4, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfmin",    2, 0x0f0f, 0x94, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfmul",    2, 0x0f0f, 0xb4, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfrcp",    2, 0x0f0f, 0x96, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfrcpit1", 2, 0x0f0f, 0xa6, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfrcpit2", 2, 0x0f0f, 0xb6, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfrsqit1", 2, 0x0f0f, 0xa7, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfrsqrt",  2, 0x0f0f, 0x97, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfsub",    2, 0x0f0f, 0x9a, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pfsubr",   2, 0x0f0f, 0xaa, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pi2fd",    2, 0x0f0f, 0x0d, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pi2fw",    2, 0x0f0f, 0x0c, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } }, /* Unofficial! */
+{"pmulhrw",  2, 0x0f0f, 0xb7, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } },
+{"pswapw",   2, 0x0f0f, 0xbb, FP|Modrm|ImmExt,	{ RegMMX|LongMem, RegMMX, 0 } }, /* Unofficial! */
 
 {NULL, 0, 0, 0, 0, { 0, 0, 0} }	/* sentinel */
 };
 #undef X
-#undef ReverseModrm
 #undef NoSuf
 #undef b_Suf
 #undef w_Suf
@@ -1047,7 +1136,15 @@
   {"mm4", RegMMX, 4},
   {"mm5", RegMMX, 5},
   {"mm6", RegMMX, 6},
-  {"mm7", RegMMX, 7}
+  {"mm7", RegMMX, 7},
+  {"xmm0", RegXMM, 0},
+  {"xmm1", RegXMM, 1},
+  {"xmm2", RegXMM, 2},
+  {"xmm3", RegXMM, 3},
+  {"xmm4", RegXMM, 4},
+  {"xmm5", RegXMM, 5},
+  {"xmm6", RegXMM, 6},
+  {"xmm7", RegXMM, 7}
 };
 
 #define MAX_REG_NAME_SIZE 8	/* for parsing register names from input */
diff --git a/include/opcode/m68k.h b/include/opcode/m68k.h
index ecb3f95..3208b77 100644
--- a/include/opcode/m68k.h
+++ b/include/opcode/m68k.h
@@ -1,5 +1,5 @@
 /* Opcode table header for m680[01234]0/m6888[12]/m68851.
-   Copyright 1989, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation.
+   Copyright 1989, 91, 92, 93, 94, 95, 96, 97, 1999 Free Software Foundation.
 
 This file is part of GDB, GAS, and the GNU binutils.
 
@@ -36,6 +36,8 @@
 #define	m68851  0x080
 #define cpu32	0x100	/* e.g., 68332 */
 #define mcf5200 0x200
+#define mcf5206e 0x400
+#define mcf5307 0x800
 
  /* handy aliases */
 #define	m68040up  (m68040 | m68060)
@@ -43,6 +45,7 @@
 #define	m68020up  (m68020 | m68030up)
 #define	m68010up  (m68010 | cpu32 | m68020up)
 #define	m68000up  (m68000 | m68010up)
+#define mcf       (mcf5200 | mcf5206e | mcf5307)
 
 #define	mfloat  (m68881 | m68882 | m68040 | m68060)
 #define	mmmu    (m68851 | m68030 | m68040 | m68060)
@@ -87,7 +90,7 @@
    operand; the second, the place it is stored.  */
 
 /* Kinds of operands:
-   Characters used: AaBCcDdFfIJkLlMmnOopQqRrSsTtUVvWXYZ0123|*~%;@!&$?/<>#^+-
+   Characters used: AaBCcDdEFfGHIJkLlMmnOopQqRrSsTtU VvWXYZ0123|*~%;@!&$?/<>#^+-
 
    D  data register only.  Stored as 3 bits.
    A  address register only.  Stored as 3 bits.
@@ -121,6 +124,9 @@
    C  the CCR.  No need to store it; this is just for filtering validity.
    S  the SR.  No need to store, just as with CCR.
    U  the USP.  No need to store, just as with CCR.
+   E  the ACC.  No need to store, just as with CCR.
+   G  the MACSR.  No need to store, just as with CCR.
+   H  the MASK.  No need to store, just as with CCR.
 
    I  Coprocessor ID.   Not printed if 1.   The Coprocessor ID is always
       extracted from the 'd' field of word one, which means that an extended
@@ -170,6 +176,9 @@
        for both caches.  Used in cinv and cpush.  Always
        stored in position "d".
 
+    u  Any register, with ``upper'' or ``lower'' specification.  Used
+       in the mac instructions with size word.
+
  The remainder are all stored as 6 bits using an address mode and a
  register number; they differ in which addressing modes they match.
 
@@ -260,6 +269,8 @@
 */
 
 /* Places to put an operand, for non-general operands:
+   Characters used: BbCcDdghijkLlMmNnostWw123456789
+
    s  source, low bits of first word.
    d  dest, shifted 9 in first word
    1  second word, shifted 12
@@ -293,6 +304,24 @@
    C  floating point coprocessor constant - 7 bits.  Also used for static
       K-factors...
    j  Movec register #, stored in 12 low bits of second word.
+   m  For M[S]ACx; 4 bits split with MSB shifted 6 bits in first word
+      and remaining 3 bits of register shifted 9 bits in first word.
+      Indicate upper/lower in 1 bit shifted 7 bits in second word.
+      Use with `R' or `u' format.
+   n  `m' withouth upper/lower indication. (For M[S]ACx; 4 bits split
+      with MSB shifted 6 bits in first word and remaining 3 bits of
+      register shifted 9 bits in first word.  No upper/lower
+      indication is done.)  Use with `R' or `u' format.
+   o  For M[S]ACw; 4 bits shifted 12 in second word (like `1').
+      Indicate upper/lower in 1 bit shifted 7 bits in second word.
+      Use with `R' or `u' format.
+   M  For M[S]ACw; 4 bits in low bits of first word.  Indicate
+      upper/lower in 1 bit shifted 6 bits in second word.  Use with
+      `R' or `u' format.
+   N  For M[S]ACw; 4 bits in low bits of second word.  Indicate
+      upper/lower in 1 bit shifted 6 bits in second word.  Use with
+      `R' or `u' format.
+   h  shift indicator (scale factor), 1 bit shifted 10 in second word
 
  Places to put operand, for general operands:
    d  destination, shifted 6 bits in first word
diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h
index a9e3b24..974f0df 100644
--- a/include/opcode/ppc.h
+++ b/include/opcode/ppc.h
@@ -85,6 +85,9 @@
    for the assembler's -many option, and it eliminates duplicates).  */
 #define PPC_OPCODE_ANY (0200)
 
+/* Opcode is supported as part of the 64-bit bridge.  */
+#define PPC_OPCODE_64_BRIDGE (0400)
+
 /* A macro to extract the major opcode from an instruction.  */
 #define PPC_OP(i) (((i) >> 26) & 0x3f)
 
diff --git a/intl/ChangeLog.Cygnus b/intl/ChangeLog.Cygnus
deleted file mode 100644
index 6d32da6..0000000
--- a/intl/ChangeLog.Cygnus
+++ /dev/null
@@ -1,30 +0,0 @@
-Tue May 26 18:29:09 1998  Ian Lance Taylor  <ian@cygnus.com>
-
-	* Makefile.in (distclean): Remove config.log.
-
-Sun May 10 22:35:54 1998  Jeffrey A Law  (law@cygnus.com)
-
-        * po/Makefile.in (install-info): New target.
-
-Sun Apr 19 19:20:00 1998  Tom Tromey  <tromey@cygnus.com>
-
-	* aclocal.m4, configure: Rebuilt.
-	* configure.in: Call AC_LINK_FILES so that <libintl.h> will
-	always exist.
-
-Fri Mar 27 16:37:25 1998  Tom Tromey  <tromey@cygnus.com>
-
-	* aclocal.m4, configure: Rebuilt with new cygettext.m4.
-
-Wed Mar 25 15:00:14 1998  Tom Tromey  <tromey@cygnus.com>
-
-	* configure.in: Build config.h from config.in.
-	* config.h.in: Removed.
-	* config.in: New file.
-
-	* config.h.in: New file.
-
-	* configure.in, configure, acconfig.h, aclocal.m4: New files.
-	* Makefile.in (OBJECTS): Depend on config.h, not ../config.h.
-	(Makefile): Rebuild Makefile here, not in `..'.
-
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 2302da3..48ffb22 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,20 +1,325 @@
-1999-04-29  Nick Clifton  <nickc@cygnus.com>
+Tue Jul 20 15:18:46 1999  Bob Manson  <manson@charmed.cygnus.com>
 
-	* emulparams/elf32mcore.sh (OTHER_BSS_SYMBOLS): Define.
-	(OTHER_BSS_END_SYMBOLS): Define.
+	* ldlang.c (lang_gc_sections): Only handle the start symbol
+	specially if there is one.
 
-	* scripttempl/mcorepe.sc: New file: Duplicte of pe.sc with stack
-	section added.
+Mon Jul 19 14:19:14 1999  Mark P. Mitchell  <mark@codesourcery.com>
+
+	* emulparams/elf32bmipn32.sh (OTHER_RELOCATING_SECTIONS): Add
+	.MIPS.events and .MIPS.content handling.
+	* emulparams/elf64bmip.sh (OTHER_RELOCATING_SECTIONS): Likewise.
+
+1999-07-17  Nick Clifton  <nickc@cygnus.com>
+
+	* ldlang.c (get_target): New function: Return true iff the
+	given target is the target being sought.
+	(stricpy): New function:  Like strcpy but convert to lower
+	case as well.
+	(strcut): New function:  Like strstr but remove the located
+	substring as well.
+	(name_compare): New function: Compute a compatability rating
+	for two target names.
+	(winner): New variable: Best target found by
+	closest_target_match() so far.
+	(closest_target_match): New function: Find the target which is
+	the closest match to the original target.
+	(get_first_input_target): New function: Find the target format
+	of the first of the linker's input file.
+	(open_output): Be more clever about deciding the output target
+	format. 
+
+1999-07-16  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* emulparams/elf64_sparc.sh: Add 64-bit directories to native LIB_PATH.
+
+Thu Jul 15 15:55:15 1999  Mark P. Mitchell  <mark@codesourcery.com>
+
+	* configure.host: Set up HOSTING_CRT0 and HOSTING_LIBS for IRIX6.
+
+1999-07-15  Ian Lance Taylor  <ian@zembu.com>
+
+	* configure.in: Bump version number to 2.9.5.
+	* configure: Rebuild.
+
+1999-07-14  Richard Henderson  <rth@cygnus.com>
+
+	* ldlang.c (wild_doit): Copy SEC_SHORT to output section.
+
+	* scripttempl/elf.sc: Re-order .rel[a].foo outputs to the
+	same order seen for the main sections.  Add
+	OTHER_READONLY_RELOC_SECTIONS and OTHER_GOT_RELOC_SECTIONS.
+
+1999-07-12  Andreas Schwab  <schwab@suse.de>
+
+	* emultempl/linux.em (ld_${EMULATION_NAME}_emulation): Fill in
+	structure initializations.
+
+	* emultempl/elf32.em (ld_${EMULATION_NAME}_emulation): Add missing
+	comma in initializer.
+
+1999-07-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
+	as appropriate.  Fill in structure initializations.
+
+1999-07-10  Ian Lance Taylor  <ian@zembu.com>
+
+	* ldfile.c: Revert patch of 1999-07-08.
+	(ldfile_try_open_bfd): If we are searching for the file, skip
+	files with an incompatible architecture.
+
+1999-07-09  Nick Clifton  <nickc@cygnus.com>
+
+	* scripttempl/armcoff.sc (OUTPUT_FORMAT): Include big endian and
+	little endian formats.
+
+1999-07-08  Felix Lee  <flee@cygnus.com>
+
+	* scripttempl/mcorepe.sc: fix quoting problem, for bash 2.x
+
+1999-07-08  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* ldfile.c (ldfile_open_file_search): Skip libraries made for
+	incompatible architectures in the search path. Let the user know
+	about any such skips.
+
+Thu Jul  8 12:32:23 1999  John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+        * configure.tgt (hppa*-linux-gnu*): New target.
+
+1999-07-07  Mark Mitchell  <mark@codesourcery.com>
+
+	* Makefile.am (ALL_64_EMULATIONS): Add eelf64bmip.
+	(eelf64bmip): New target.
+	* Makefile.in: Regenerated.
+	* configure.tgt (mips-sgi-irix6*): Add 64-bit emulation.
+	* emulparams/elf64bmip.sh: New file.
+
+1999-07-05  Nick Clifton  <nickc@cygnus.com>
+
+	* emultempl/pe.em (after_open): Abort if input format is ARM and
+	output format is not. 
+	* emultempl/armcoff.em (after_open): Abort if input format is ARM
+	and output format is not. 
+	* emultempl/armelf.em (after_open): Abort if input format is ARM
+	and output format is not. 
+
+1999-07-02  Ian Lance Taylor  <ian@zembu.com>
+
+	* ldlang.c: Revert change of 1999-06-23.
+
+1999-06-30  Mark Mitchell  <mark@codesourcery.com>
+
+	* Makefile.am (ALL_EMULATIONS): Add eelf32bmipn32.o.
+	(eelf32bmipn32.c): New target.
+	* Makefile.in: Regenerated.
+	* configure.tgt (mips-sgi-irix6*): Make n32 the default
+	emulation.
+	* emulparams/elf32bmipn32.sh: New file.
+	
+1999-06-28  Jim Pick <jim@jimpick.com>
+
+	* emultempl/armelf.em: Added code so that .xs linker scripts are
+	called so that ARM shared libraries are built correctly.
+
+1999-06-22  Mark Mitchell  <mark@codesourcery.com>
+
+	* ldmain.c (main): Initialize link_info.init_function and
+	link_info.fini_function.
+	* lexsup.c (OPTION_INIT): New macro.
+	(OPTION_FINI): Likewise.
+	(ld_options): Add descriptions for them.
+	(parse_args): Handle them.
+
+1999-06-23  Ian Lance Taylor  <ian@zembu.com>
+
+	* ldlang.c (section_already_linked): Only discard link once
+	sections if we are building constructors.
+
+1999-06-22  Nick Clifton  <nickc@cygnus.com>
+
+	* ld.texinfo (Location Counter): Describe behaviour of
+	location counter inside section statements.
+
+1999-06-20  Mark Mitchell  <mark@codesourcery.com>
+
+	* scripttempl/elf.sc (WRITABLE_RODATA): New variable for
+	controlling whether or not .rodata is in the data segment or the
+	text segment.
+
+1999-06-18  Nick Clifton  <nickc@cygnus.com>
+
+	* emultempl/pe.em: Add new command line switch --thumb-entry.
+	* emultempl/armelf.em: Add new command line switch --thumb-entry.
+	* emultempl/armcoff.em: Add new command line switch --thumb-entry.
+	* ld.texinfo: Document new ARM command line switch: --thumb-entry.	
+1999-06-20  H.J. Lu  <hjl@gnu.org>
+
+	* configure.in (all_libpath): Accumulate across all enabled targets.
+
+Sun Jun 20 14:10:33 1999  Richard Henderson  <rth@cygnus.com>
+
+	* emultempl/armelf.em: Watch EMULATION_LIBPATH instead of
+	DEFAULT_EMULATION.
+	* emultempl/elf32.em: Likewise.
+	* emultempl/sunos.em: Likewise.
+
+Fri Jun 18 15:24:48 1999  Richard Henderson  <rth@cygnus.com>
+
+	* Makefile.am (GENSCRIPTS): Pass EMULATION_LIBPATH, not EMUL.
+	* configure.in (all_emuls): Add targ_extra_libpath.
+	(all_libpath, EMULATION_LIBPATH): Define.
+	* configure.tgt (powerpc-*-linux-gnu*): Define targ_extra_libpath.
+	* genscripts.sh (LIB_PATH): Define if emulation in EMULATION_LIBPATH.
+
+Mon Jun 14 10:38:36 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* ld.texinfo: Fix use of @item vs. @itemx.
+
+1999-06-13  Ian Lance Taylor  <ian@zembu.com>
+
+	From Thomas Zenker <thz@lennartz-electronic.de>:
+	* ldgram.y (attributes_opt): Use attributes_list instead of NAME.
+	(attributes_list, attributes_string): New nonterminals.
+	* ldlang.c (lang_set_flags): Add invert parameter.  Don't handle
+	'!'.
+	* ldlang.c (lang_set_flags): Update declaration.
+
+1999-06-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* emultempl/pe.em (gld_${EMULATION_NAME}_after_parse): Don't add
+	entry_symbol as an undefined symbol when doing a relocateable
+	link.  From <jeffdb@goodnet.com>.
+
+1999-06-12  David O'Brien  <obrien@freebsd.org>
+
+	* configure.tgt: (i[3456]86-*-freebsd*): Now defaults to ELF.
+
+1999-06-09  Nick Clifton  <nickc@cygnus.com>
+
+	* lexsup.c (help): Restore previous format of output.
+
+1999-06-04  Nick Clifton  <nickc@cygnus.com>
+
+	* emultempl/pe.em: If compiling for arm_epoc_pe rename
+	interworking functions to avoid a name space clash.
+
+1999-06-02  Jason Merrill  <jason@yorick.cygnus.com>
+
+	* scripttempl/v850.sc: Add initp support.
+
+1999-06-02  Nick Clifton  <nickc@cygnus.com>
+
+	* emultempl/pe.em: Rename global arm interworking functions to
+	avoid name collision when all targets BFD is built.
+
+1999-05-30  Cort Dougan  <cort@attis.cs.nmt.edu>
+
+	* Makefile.am (ALL_EMULATIONS): Add eelf32ppclinux.o.
+	* configure.tgt (powerpc-*-linux-gnu): Use it.
+	* emulparams/elf32ppclinux.sh: New file.
+
+1999-05-29  Ian Lance Taylor  <ian@zembu.com>
+
+	* ld.texinfo (Options): Clarify that options which refer to files
+	must be properly ordered.
+
+1999-05-29  Nick Clifton  <nickc@cygnus.com>
+
+	* emultempl/armelf.em (..._parse_args): New function: Parse
+	command line option.  Accept arm-elf specific command line option
+	'-p' or '--no-pipeline-knowledge'.
+	(..._list_options): New function: Describe the new command line
+	option.
+	(..._before_allocation): Pass the value of the new variable
+	no_pipeline_knowledge to bfd_elf32_arm_process_before_allocation.
+	
+	* emultemp/armelf_oabi.em (..._before_allocation): Pass zero as
+	the third parameter to bfd_elf32_arm_process_before_allocation.
+
+1999-05-28  Nick Clifton  <nickc@cygnus.com>
+
+	* lexsup.c (help): Minor formatting changes.
+
+1999-05-28  Martin Dorey  <mdorey@madge.com>
+
+	* configure.tgt (i960-*-elf*): New target.
+	* emulparams/elf32_i960.sh: New file.
+	* Makefile.am (ALL_EMULATIONS): Add eelf32_i960.o.
+	(eelf32_i960.c): New target.
+	* Makefile.in: Rebuild.
+
+1999-05-26  Nick Clifton  <nickc@cygnus.com>
+
+	* emulparams/armelf_oabi.sh (TEMPLATE_NAME): Set to armelf_oabi. 
+
+1999-05-24  Philip Blundell  <philb@gnu.org>
+
+	* emultempl/armelf.em (before_parse): Set config.dynamic_link and
+ 	config.has_shared.
+	* emulparams/armelf.sh (GENERATE_SHLIB_SCRIPT): Define.
+	* emulparams/armelf_linux.sh (GENERATE_SHLIB_SCRIPT): Likewise.
+
+1999-04-13  Philip Blundell  <philb@gnu.org>
+
+	* emultempl/armelf.em: Add definitions related to shared objects
+	(copied from elf32.em).
+
+Wed May 19 12:44:26 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* Makefile.am (ALL_EMULATIONS): Remove earmlinux.o and
+	earm26linux.o, add earmelf_linux.o and earmelf_linux26.o.
+	* Makefile.in: Regenerated.
+
+1999-05-16  Nick Clifton  <nickc@cygnus.com>
+
+	* emulparams/elf32mcore.sh (GENERATE_SHLIB_SCRIPT): Define.
+	(TEMPLATE_NAME): Define.
+
+Thu May 13 09:48:09 1999  Joel Sherrill (joel@OARcorp.com)
+
+	* configure.tgt (i386-*-rtemself*, sh-*-rtemself*): New targets.
+	(mips*el-*-rtems*, powerpcle-*-rtems*): New targets.
+
+1999-05-10  DJ Delorie  <dj@cygnus.com>
+
+	* scripttempl/pe.sc: Specify the output arch, which Ian says is
+	the Right Thing to do.
+
+	* emultempl/pe.em: various changes to parameterize the
+	target-specific information.
+	(gld_i386pe_after_open): Detect and fix MS import libraries
+	by renaming the member objects (which are all named the same).
+
+	* pe-dll.c: various changes to parameterize the target-specific
+	information.
+	(generate_reloc): support relocs more generically to allow for
+	expansion.
+	(pe_exe_build_sections): new; used to add .relocs to .exes
+	(pe_exe_fill_sections): ditto
+
+1999-05-10  Catherine Moore  <clm@cygnus.com>
+
+	* emultempl/pe.em (gld_${EMULATION_NAME}_after_open):
+	Check for TARGET_IS_arm_epoc_pe.
+	(gld_${EMULATION_NAME}_before_allocation): Likewise.
+
+1999-05-12  Anthony Green  <green@cygnus.com>
+
+	* ldlang.c (walk_wild, walk_wild_file, walk_wild_section,
+	output_section_callback, gc_section_callback): New functions for
+	generic section walks.
+	(wild, lang_gc_wild): Use walk_wild.
+	(wild_file, lang_gc_wild_file): Deleted. Common logic moved to
+	walk_wild_file.
+	(wild_section, lang_gc_wild_section): Deleted. Common logic moved
+	to walk_fild_section.  Unique logic moved into callbacks
+	output_section_callback and gc_section_callback.
 
 1999-04-26  Tom Tromey  <tromey@cygnus.com>
 
 	* aclocal.m4, configure: Updated for new version of libtool.
 
-1999-04-22  Nick Clifton  <nickc@cygnus.com>
-
-	* emulparams/elf32mcore.sh (OTHER_RELOCATING_SECTIONS): Define to
-	generate _stack section.
-
 1999-04-12  Philip Blundell  <pb@nexus.co.uk>
 
 	* emulparams/armelf_linux.sh: New file.  Support for ARM 
@@ -57,17 +362,6 @@
 	* ldmain.c (main): Init link_info.no_undefined.
 	* lexsup.c: Add command-line option --no-undefined.
 
-1999-04-08  Nick Clifton  <nickc@cygnus.com>
-
-	* configure.tgt: Add support for MCore targets.
-	* Makefile.am: Add support for MCore targets.
-	* Makefile.in: Regenerate.
-	
-	* emulparams/elf32mcore.sh: New file:  Definitions for mcore-elf
-	target. 
-	* emulparams/mcorepe.sh: New file:  Definitions for mcore-pe
-	target.  
-
 1999-04-06  Ian Lance Taylor  <ian@zembu.com>
 
 	* ld.h (LC_MESSAGES): Never define.
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 1f02098..6113e8d 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -103,8 +103,8 @@
 	earcelf.o \
 	earmelf.o \
 	earmelf_oabi.o \
-	earmlinux.o \
-	earm26linux.o \
+	earmelf_linux.o \
+	earmelf_linux26.o \
 	earmaoutb.o \
 	earmaoutl.o \
 	earmcoff.o \
@@ -117,14 +117,17 @@
 	edelta68.o \
 	eebmon29k.o \
 	eelf32_sparc.o \
+	eelf32_i960.o \
 	eelf32b4300.o \
 	eelf32bmip.o \
 	eelf32ebmip.o \
 	eelf32elmip.o \
+	eelf32bmipn32.o \
 	eelf32l4300.o \
 	eelf32lmip.o \
 	eelf32lppc.o \
 	eelf32ppc.o \
+	eelf32ppclinux.o \
 	eelf_i386.o \
 	eelf_i386_be.o \
 	egld960.o \
@@ -205,7 +208,8 @@
 
 ALL_64_EMULATIONS = \
 	eelf64_sparc.o \
-	eelf64alpha.o
+	eelf64alpha.o \
+	eelf64bmip.o
 
 ALL_EMUL_EXTRA_OFILES = \
 	pe-dll.o \
@@ -258,7 +262,7 @@
 
 # These all start with e so 'make clean' can find them.
 
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
 GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
 @TDIRS@
 
@@ -334,6 +338,9 @@
 eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
+eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
 eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
@@ -349,6 +356,9 @@
 eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
+eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32bmipn32 "$(tdir_elf32bmipn32)"
 eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
@@ -364,12 +374,18 @@
 eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
+eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)"
 eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
 eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
+eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf64bmip "$(tdir_elf64bmip)"
 eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
diff --git a/ld/Makefile.in b/ld/Makefile.in
index e5961ae..83ac2f4 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -63,6 +63,8 @@
 host_triplet = @host@
 target_alias = @target_alias@
 target_triplet = @target@
+AMTAR = @AMTAR@
+AMTARFLAGS = @AMTARFLAGS@
 AS = @AS@
 CATALOGS = @CATALOGS@
 CATOBJEXT = @CATOBJEXT@
@@ -70,6 +72,7 @@
 CC_FOR_BUILD = @CC_FOR_BUILD@
 DATADIRNAME = @DATADIRNAME@
 DLLTOOL = @DLLTOOL@
+EMULATION_LIBPATH = @EMULATION_LIBPATH@
 EXEEXT = @EXEEXT@
 EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
 GMOFILES = @GMOFILES@
@@ -90,13 +93,13 @@
 MSGFMT = @MSGFMT@
 NATIVE_LIB_DIRS = @NATIVE_LIB_DIRS@
 NM = @NM@
+OBJDUMP = @OBJDUMP@
 PACKAGE = @PACKAGE@
 POFILES = @POFILES@
 POSUB = @POSUB@
 RANLIB = @RANLIB@
 USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
 USE_NLS = @USE_NLS@
-USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
 VERSION = @VERSION@
 l = @l@
 
@@ -206,8 +209,8 @@
 	earcelf.o \
 	earmelf.o \
 	earmelf_oabi.o \
-	earmlinux.o \
-	earm26linux.o \
+	earmelf_linux.o \
+	earmelf_linux26.o \
 	earmaoutb.o \
 	earmaoutl.o \
 	earmcoff.o \
@@ -220,14 +223,17 @@
 	edelta68.o \
 	eebmon29k.o \
 	eelf32_sparc.o \
+	eelf32_i960.o \
 	eelf32b4300.o \
 	eelf32bmip.o \
 	eelf32ebmip.o \
 	eelf32elmip.o \
+	eelf32bmipn32.o \
 	eelf32l4300.o \
 	eelf32lmip.o \
 	eelf32lppc.o \
 	eelf32ppc.o \
+	eelf32ppclinux.o \
 	eelf_i386.o \
 	eelf_i386_be.o \
 	egld960.o \
@@ -309,7 +315,8 @@
 
 ALL_64_EMULATIONS = \
 	eelf64_sparc.o \
-	eelf64alpha.o
+	eelf64alpha.o \
+	eelf64bmip.o
 
 
 ALL_EMUL_EXTRA_OFILES = \
@@ -345,7 +352,7 @@
 
 # These all start with e so 'make clean' can find them.
 
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
 GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
 
 ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
@@ -407,7 +414,7 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = tar
+TAR = gtar
 GZIP_ENV = --best
 SOURCES = $(ld_new_SOURCES)
 OBJECTS = $(ld_new_OBJECTS)
@@ -1033,6 +1040,9 @@
 eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
+eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
 eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
@@ -1048,6 +1058,9 @@
 eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
+eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32bmipn32 "$(tdir_elf32bmipn32)"
 eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
@@ -1063,12 +1076,18 @@
 eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
+eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)"
 eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
 eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
+eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf64bmip "$(tdir_elf64bmip)"
 eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
diff --git a/ld/NEWS b/ld/NEWS
index aa2e845..267890e 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -14,11 +14,17 @@
 
 * Added ASSERT to the linker script language.
 
+* Added EXCLUDE_FILE to the linker script language for further control over
+  wildcard file names.
+
 * Added -O option to optimize linker output (as of this writing, this only
 affects ELF shared library generation).
 
 * The -e option now accepts a number as well as a symbol name.
 
+* Added --no-undefined option to disallow undefined symbols when creating a
+  shared library.
+
 * Added --demangle and --no-demangle options.
 
 Changes in version 2.9:
diff --git a/ld/configure b/ld/configure
index 9d573b2..00a8d9d 100755
--- a/ld/configure
+++ b/ld/configure
@@ -49,6 +49,7 @@
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -163,6 +164,7 @@
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
+  --site-file=FILE        use FILE as the site file
   --version               print the version of autoconf that created configure
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -333,6 +335,11 @@
   -site=* | --site=* | --sit=*)
     site="$ac_optarg" ;;
 
+  -site-file | --site-file | --site-fil | --site-fi | --site-f)
+    ac_prev=sitefile ;;
+  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+    sitefile="$ac_optarg" ;;
+
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -498,12 +505,16 @@
 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+  if test -z "$CONFIG_SITE"; then
+    if test "x$prefix" != xNONE; then
+      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+    else
+      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+    fi
   fi
+else
+  CONFIG_SITE="$sitefile"
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
@@ -590,7 +601,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:594: checking host system type" >&5
+echo "configure:605: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -611,7 +622,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:615: checking target system type" >&5
+echo "configure:626: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -629,7 +640,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:633: checking build system type" >&5
+echo "configure:644: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -664,7 +675,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:668: checking for a BSD compatible install" >&5
+echo "configure:679: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -717,7 +728,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:721: checking whether build environment is sane" >&5
+echo "configure:732: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -774,7 +785,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:778: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:789: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -803,7 +814,7 @@
 
 PACKAGE=ld
 
-VERSION=2.9.4
+VERSION=2.9.5
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -820,7 +831,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:824: checking for working aclocal" >&5
+echo "configure:835: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -833,7 +844,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:837: checking for working autoconf" >&5
+echo "configure:848: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -846,7 +857,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:850: checking for working automake" >&5
+echo "configure:861: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -859,7 +870,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:863: checking for working autoheader" >&5
+echo "configure:874: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -872,7 +883,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:876: checking for working makeinfo" >&5
+echo "configure:887: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -958,7 +969,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:962: checking for $ac_word" >&5
+echo "configure:973: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -988,7 +999,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:992: checking for $ac_word" >&5
+echo "configure:1003: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1018,7 +1029,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1022: checking for $ac_word" >&5
+echo "configure:1033: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1069,7 +1080,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1073: checking for $ac_word" >&5
+echo "configure:1084: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1101,7 +1112,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1105: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1116: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1112,12 +1123,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1116 "configure"
+#line 1127 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1143,12 +1154,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1147: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1158: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1152: checking whether we are using GNU C" >&5
+echo "configure:1163: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1157,7 +1168,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1176,7 +1187,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1180: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1191: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1219,7 +1230,7 @@
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1223: checking for ld used by GCC" >&5
+echo "configure:1234: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
     # Accept absolute paths.
@@ -1243,10 +1254,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1247: checking for GNU ld" >&5
+echo "configure:1258: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1250: checking for non-GNU ld" >&5
+echo "configure:1261: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1282,7 +1293,7 @@
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1286: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1297: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1298,7 +1309,7 @@
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1302: checking for BSD-compatible nm" >&5
+echo "configure:1313: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1336,7 +1347,7 @@
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:1340: checking command to parse $NM output" >&5
+echo "configure:1351: checking command to parse $NM output" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1399,11 +1410,11 @@
 int main(){nm_test_var='a';nm_test_func;return 0;}
 EOF
 
-  if { (eval echo configure:1403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:1414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     # Now try to grab the symbols.
     ac_nlist=conftest.nm
   
-    if { (eval echo configure:1407: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+    if { (eval echo configure:1418: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
 
       # Try sorting and uniquifying the output.
       if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
@@ -1455,7 +1466,7 @@
 	  ac_save_CFLAGS="$CFLAGS"
 	  LIBS="conftestm.$ac_objext"
 	  CFLAGS="$CFLAGS$no_builtin_flag"
-	  if { (eval echo configure:1459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+	  if { (eval echo configure:1470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
 	    ac_pipe_works=yes
 	  else
 	    echo "configure: failed program was:" >&5
@@ -1501,7 +1512,7 @@
 echo "$ac_t""$ac_result" 1>&6
 
 echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
-echo "configure:1505: checking for _ prefix in compiled symbols" >&5
+echo "configure:1516: checking for _ prefix in compiled symbols" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1510,10 +1521,10 @@
 void nm_test_func(){}
 int main(){nm_test_func;return 0;}
 EOF
-if { (eval echo configure:1514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   # Now try to grab the symbols.
   ac_nlist=conftest.nm
-  if { (eval echo configure:1517: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+  if { (eval echo configure:1528: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
     # See whether the symbols have a leading underscore.
     if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
       ac_cv_sys_symbol_underscore=yes
@@ -1539,7 +1550,7 @@
 USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1543: checking whether ln -s works" >&5
+echo "configure:1554: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1581,8 +1592,8 @@
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1585 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1596 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1603,19 +1614,19 @@
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1607: checking whether the C compiler needs -belf" >&5
+echo "configure:1618: checking whether the C compiler needs -belf" >&5
 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1612 "configure"
+#line 1623 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -1638,7 +1649,7 @@
   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1642: checking for $ac_word" >&5
+echo "configure:1653: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1670,7 +1681,7 @@
   # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1674: checking for $ac_word" >&5
+echo "configure:1685: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1705,7 +1716,7 @@
 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
 set dummy ${ac_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1709: checking for $ac_word" >&5
+echo "configure:1720: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1737,7 +1748,7 @@
   # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1741: checking for $ac_word" >&5
+echo "configure:1752: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1906,7 +1917,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1910: checking for $ac_word" >&5
+echo "configure:1921: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1936,7 +1947,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1940: checking for $ac_word" >&5
+echo "configure:1951: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1987,7 +1998,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1991: checking for $ac_word" >&5
+echo "configure:2002: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2019,7 +2030,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2023: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2034: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2030,12 +2041,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 2034 "configure"
+#line 2045 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2061,12 +2072,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2065: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2076: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2070: checking whether we are using GNU C" >&5
+echo "configure:2081: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2075,7 +2086,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2094,7 +2105,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2098: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2109: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2137,7 +2148,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2141: checking for a BSD compatible install" >&5
+echo "configure:2152: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2192,7 +2203,7 @@
 
 ALL_LINGUAS=
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2196: checking how to run the C preprocessor" >&5
+echo "configure:2207: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2207,13 +2218,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2211 "configure"
+#line 2222 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2224,13 +2235,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2228 "configure"
+#line 2239 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2241,13 +2252,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2245 "configure"
+#line 2256 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2272,7 +2283,7 @@
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:2276: checking for POSIXized ISC" >&5
+echo "configure:2287: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -2293,12 +2304,12 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2297: checking for ANSI C header files" >&5
+echo "configure:2308: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2302 "configure"
+#line 2313 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2306,7 +2317,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2323,7 +2334,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2327 "configure"
+#line 2338 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2341,7 +2352,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2345 "configure"
+#line 2356 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2362,7 +2373,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2366 "configure"
+#line 2377 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2373,7 +2384,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2397,12 +2408,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2401: checking for working const" >&5
+echo "configure:2412: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2406 "configure"
+#line 2417 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2451,7 +2462,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2472,21 +2483,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2476: checking for inline" >&5
+echo "configure:2487: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 2483 "configure"
+#line 2494 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2512,12 +2523,12 @@
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2516: checking for off_t" >&5
+echo "configure:2527: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2521 "configure"
+#line 2532 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2545,12 +2556,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2549: checking for size_t" >&5
+echo "configure:2560: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2554 "configure"
+#line 2565 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2580,19 +2591,19 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2584: checking for working alloca.h" >&5
+echo "configure:2595: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2589 "configure"
+#line 2600 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:2596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -2613,12 +2624,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2617: checking for alloca" >&5
+echo "configure:2628: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2622 "configure"
+#line 2633 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -2646,7 +2657,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:2650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -2678,12 +2689,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2682: checking whether alloca needs Cray hooks" >&5
+echo "configure:2693: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2687 "configure"
+#line 2698 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -2708,12 +2719,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2712: checking for $ac_func" >&5
+echo "configure:2723: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2717 "configure"
+#line 2728 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2736,7 +2747,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2763,7 +2774,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2767: checking stack direction for C alloca" >&5
+echo "configure:2778: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2771,7 +2782,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2775 "configure"
+#line 2786 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -2790,7 +2801,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:2794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -2815,17 +2826,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2819: checking for $ac_hdr" >&5
+echo "configure:2830: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2824 "configure"
+#line 2835 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2854,12 +2865,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2858: checking for $ac_func" >&5
+echo "configure:2869: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2863 "configure"
+#line 2874 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2882,7 +2893,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2907,7 +2918,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2911: checking for working mmap" >&5
+echo "configure:2922: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2915,7 +2926,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 2919 "configure"
+#line 2930 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3055,7 +3066,7 @@
 }
 
 EOF
-if { (eval echo configure:3059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -3083,17 +3094,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3087: checking for $ac_hdr" >&5
+echo "configure:3098: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3092 "configure"
+#line 3103 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3123,12 +3134,12 @@
 __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3127: checking for $ac_func" >&5
+echo "configure:3138: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3132 "configure"
+#line 3143 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3151,7 +3162,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3180,12 +3191,12 @@
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3184: checking for $ac_func" >&5
+echo "configure:3195: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3189 "configure"
+#line 3200 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3208,7 +3219,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3242,19 +3253,19 @@
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3246: checking for LC_MESSAGES" >&5
+echo "configure:3257: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3251 "configure"
+#line 3262 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:3258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -3275,7 +3286,7 @@
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3279: checking whether NLS is requested" >&5
+echo "configure:3290: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -3295,7 +3306,7 @@
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3299: checking whether included gettext is requested" >&5
+echo "configure:3310: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -3314,17 +3325,17 @@
 
 	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3318: checking for libintl.h" >&5
+echo "configure:3329: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3323 "configure"
+#line 3334 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3341,19 +3352,19 @@
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:3345: checking for gettext in libc" >&5
+echo "configure:3356: checking for gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3350 "configure"
+#line 3361 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libc=yes
 else
@@ -3369,7 +3380,7 @@
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 	     echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3373: checking for bindtextdomain in -lintl" >&5
+echo "configure:3384: checking for bindtextdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3377,7 +3388,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3381 "configure"
+#line 3392 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3388,7 +3399,7 @@
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3404,19 +3415,19 @@
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3408: checking for gettext in libintl" >&5
+echo "configure:3419: checking for gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3413 "configure"
+#line 3424 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libintl=yes
 else
@@ -3444,7 +3455,7 @@
 	      # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3448: checking for $ac_word" >&5
+echo "configure:3459: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3478,12 +3489,12 @@
 		for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3482: checking for $ac_func" >&5
+echo "configure:3493: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3487 "configure"
+#line 3498 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3506,7 +3517,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3533,7 +3544,7 @@
 		# Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3537: checking for $ac_word" >&5
+echo "configure:3548: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3569,7 +3580,7 @@
 		# Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3573: checking for $ac_word" >&5
+echo "configure:3584: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3601,7 +3612,7 @@
 fi
 
 		cat > conftest.$ac_ext <<EOF
-#line 3605 "configure"
+#line 3616 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3609,7 +3620,7 @@
 			       return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:3613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
 		   DATADIRNAME=share
@@ -3641,7 +3652,7 @@
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3645: checking for $ac_word" >&5
+echo "configure:3656: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3675,7 +3686,7 @@
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3679: checking for $ac_word" >&5
+echo "configure:3690: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3711,7 +3722,7 @@
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3715: checking for $ac_word" >&5
+echo "configure:3726: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3801,7 +3812,7 @@
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3805: checking for catalogs to be installed" >&5
+echo "configure:3816: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -3829,17 +3840,17 @@
       if test "$CATOBJEXT" = ".cat"; then
 	 ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:3833: checking for linux/version.h" >&5
+echo "configure:3844: checking for linux/version.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3838 "configure"
+#line 3849 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3902,12 +3913,12 @@
   
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:3906: checking for Cygwin environment" >&5
+echo "configure:3917: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3911 "configure"
+#line 3922 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3918,7 +3929,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:3922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -3935,19 +3946,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:3939: checking for mingw32 environment" >&5
+echo "configure:3950: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3944 "configure"
+#line 3955 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:3951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -3966,7 +3977,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3970: checking for executable suffix" >&5
+echo "configure:3981: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3976,7 +3987,7 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:3991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -4002,7 +4013,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4006: checking for $ac_word" >&5
+echo "configure:4017: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4038,7 +4049,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4042: checking for $ac_word" >&5
+echo "configure:4053: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4071,7 +4082,7 @@
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4075: checking for $ac_word" >&5
+echo "configure:4086: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4105,7 +4116,7 @@
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:4109: checking for yywrap in -l$ac_lib" >&5
+echo "configure:4120: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4113,7 +4124,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4117 "configure"
+#line 4128 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4124,7 +4135,7 @@
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:4128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4147,7 +4158,7 @@
 fi
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:4151: checking lex output file root" >&5
+echo "configure:4162: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4168,7 +4179,7 @@
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:4172: checking whether yytext is a pointer" >&5
+echo "configure:4183: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4180,14 +4191,14 @@
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 4184 "configure"
+#line 4195 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -4210,7 +4221,7 @@
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4214: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4225: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -4244,17 +4255,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4248: checking for $ac_hdr" >&5
+echo "configure:4259: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4253 "configure"
+#line 4264 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4269: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4283,12 +4294,12 @@
 for ac_func in sbrk
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4287: checking for $ac_func" >&5
+echo "configure:4298: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4292 "configure"
+#line 4303 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4311,7 +4322,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4340,12 +4351,12 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:4344: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4355: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4349 "configure"
+#line 4360 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4353,7 +4364,7 @@
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4378,7 +4389,7 @@
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:4382: checking for opendir in -ldir" >&5
+echo "configure:4393: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4386,7 +4397,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4390 "configure"
+#line 4401 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4397,7 +4408,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4419,7 +4430,7 @@
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4423: checking for opendir in -lx" >&5
+echo "configure:4434: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4427,7 +4438,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4431 "configure"
+#line 4442 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4438,7 +4449,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4471,12 +4482,12 @@
 esac
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4475: checking whether strstr must be declared" >&5
+echo "configure:4486: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4480 "configure"
+#line 4491 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4497,7 +4508,7 @@
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:4501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -4518,12 +4529,12 @@
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4522: checking whether free must be declared" >&5
+echo "configure:4533: checking whether free must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4527 "configure"
+#line 4538 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4544,7 +4555,7 @@
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:4548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -4565,12 +4576,12 @@
 fi
 
 echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-echo "configure:4569: checking whether sbrk must be declared" >&5
+echo "configure:4580: checking whether sbrk must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4574 "configure"
+#line 4585 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4591,7 +4602,7 @@
 char *(*pfn) = (char *(*)) sbrk
 ; return 0; }
 EOF
-if { (eval echo configure:4595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_sbrk=no
 else
@@ -4612,12 +4623,12 @@
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:4616: checking whether getenv must be declared" >&5
+echo "configure:4627: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4621 "configure"
+#line 4632 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4638,7 +4649,7 @@
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:4642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -4659,12 +4670,12 @@
 fi
 
 echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6
-echo "configure:4663: checking whether environ must be declared" >&5
+echo "configure:4674: checking whether environ must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4668 "configure"
+#line 4679 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4685,7 +4696,7 @@
 char *(*pfn) = (char *(*)) environ
 ; return 0; }
 EOF
-if { (eval echo configure:4689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_environ=no
 else
@@ -4712,6 +4723,7 @@
 EMUL=
 all_emuls=
 all_emul_extras=
+all_libpath=
 
 rm -f tdirs
 
@@ -4734,7 +4746,7 @@
       EMUL=$targ_emul
     fi
 
-    for i in $targ_emul $targ_extra_emuls; do
+    for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
 	case " $all_emuls " in
 	*" e${i}.o "*) ;;
 	*)
@@ -4746,6 +4758,19 @@
 	esac
     done
 
+    for i in $targ_emul $targ_extra_libpath; do
+	case " $all_libpath " in
+	*" ${i} "*) ;;
+	*)
+	  if test -z "$all_libpath"; then
+	    all_libpath=${i}
+	  else
+	    all_libpath="$all_libpath ${i}"
+	  fi
+	  ;;
+	esac
+    done
+
     for i in $targ_extra_ofiles; do
 	case " $all_emul_extras " in
 	*" ${i} "*) ;;
@@ -4776,6 +4801,9 @@
 
 
 
+EMULATION_LIBPATH=$all_libpath
+
+
 if test x${enable_static} = xno; then
   TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
 else
@@ -4990,6 +5018,7 @@
 s%@TDIRS@%%g
 s%@EMULATION_OFILES@%$EMULATION_OFILES%g
 s%@EMUL_EXTRA_OFILES@%$EMUL_EXTRA_OFILES%g
+s%@EMULATION_LIBPATH@%$EMULATION_LIBPATH%g
 s%@TESTBFDLIB@%$TESTBFDLIB%g
 
 CEOF
diff --git a/ld/configure.host b/ld/configure.host
index 88eb311..701d46c 100644
--- a/ld/configure.host
+++ b/ld/configure.host
@@ -109,11 +109,16 @@
   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
   ;;
 
-mips*-sgi-irix[56]*)
+mips*-sgi-irix5*)
   HOSTING_CRT0=/usr/lib/crt1.o
   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
   ;;
 
+mips*-sgi-irix6*)
+  HOSTING_CRT0='/usr/lib32/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o ; else gcc -print-file-name=crtbegin.o; fi`'
+  HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -L/usr/lib32 -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o ; else gcc -print-file-name=crtend.o; fi` /usr/lib32/crtn.o -init __do_global_ctors -fini __do_global_dtors'
+  ;;
+
 m68*-*-linux*aout*)
   HOSTING_CRT0=/usr/lib/crt0.o
   ;;
diff --git a/ld/configure.in b/ld/configure.in
index 7f3c1da..01b802e 100644
--- a/ld/configure.in
+++ b/ld/configure.in
@@ -5,7 +5,7 @@
 
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(ld, 2.9.4)
+AM_INIT_AUTOMAKE(ld, 2.9.5)
 
 AM_PROG_LIBTOOL
 
@@ -74,6 +74,7 @@
 EMUL=
 all_emuls=
 all_emul_extras=
+all_libpath=
 
 dnl We need to get an arbitrary number of tdir definitions into
 dnl Makefile.  We can't do it using AC_SUBST, because autoconf does
@@ -100,7 +101,7 @@
       EMUL=$targ_emul
     fi
 
-    for i in $targ_emul $targ_extra_emuls; do
+    for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
 	case " $all_emuls " in
 	*" e${i}.o "*) ;;
 	*)
@@ -112,6 +113,19 @@
 	esac
     done
 
+    for i in $targ_emul $targ_extra_libpath; do
+	case " $all_libpath " in
+	*" ${i} "*) ;;
+	*)
+	  if test -z "$all_libpath"; then
+	    all_libpath=${i}
+	  else
+	    all_libpath="$all_libpath ${i}"
+	  fi
+	  ;;
+	esac
+    done
+
     for i in $targ_extra_ofiles; do
 	case " $all_emul_extras " in
 	*" ${i} "*) ;;
@@ -145,6 +159,9 @@
 AC_SUBST(EMULATION_OFILES)
 AC_SUBST(EMUL_EXTRA_OFILES)
 
+EMULATION_LIBPATH=$all_libpath
+AC_SUBST(EMULATION_LIBPATH)
+
 if test x${enable_static} = xno; then
   TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
 else
diff --git a/ld/configure.tgt b/ld/configure.tgt
index d0555ce..65203a9 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -7,6 +7,7 @@
 # following shell variables:
 #  targ_emul		name of linker emulation to use
 #  targ_extra_emuls	additional linker emulations to provide
+#  targ_extra_libpath	additional linker emulations using LIB_PATH
 #  targ_extra_ofiles	additional objects needed by the emulation
 
 targ_extra_emuls=
@@ -59,6 +60,7 @@
 i960-*-coff)		targ_emul=gld960coff ;;
 i960-intel-nindy)	targ_emul=gld960 ;;
 i960-*-rtems*)		targ_emul=gld960coff ;;
+i960-*-elf*)		targ_emul=elf32_i960 ;;
 m32r-*-*)		targ_emul=m32relf ;;
 m68*-sun-sunos[34]*)	targ_emul=sun3 ;;
 m68*-wrs-vxworks*)	targ_emul=sun3 ;;
@@ -74,6 +76,7 @@
 i[3456]86-*-isc*)	targ_emul=i386coff ;;
 i[3456]86-*-lynxos*)	targ_emul=i386lynx ;;
 i[3456]86-*-coff)	targ_emul=i386coff ;;
+i[3456]86-*-rtemself*)  targ_emul=elf_i386 ;;
 i[3456]86-*-rtems*)	targ_emul=i386coff ;;
 i[3456]86-*-bsd)	targ_emul=i386bsd ;;
 i[3456]86-*-bsd386)	targ_emul=i386bsd ;;
@@ -95,8 +98,9 @@
 i[3456]86-*-netbsd*)	targ_emul=i386nbsd ;;
 i[3456]86-*-netware)	targ_emul=i386nw ;;
 i[3456]86-*-elf*)	targ_emul=elf_i386 ;;
-i[3456]86-*-freebsdelf*) targ_emul=elf_i386 ;;
-i[3456]86-*-freebsd*)	targ_emul=i386bsd ;;
+i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | i[3456]86-*-freebsd[12])
+			targ_emul=i386bsd ;;
+i[3456]86-*-freebsd*)	targ_emul=elf_i386 ;;
 i[3456]86-*-sysv*)	targ_emul=i386coff ;;
 i[3456]86-*-ptx*)	targ_emul=i386coff ;;
 i[3456]86-*-mach*)	targ_emul=i386mach ;;
@@ -140,7 +144,8 @@
 			targ_emul=h8500
 			targ_extra_emuls="h8500s h8500b h8500m h8500c"
 			;;
-sh-*-elf*)		targ_emul=shelf
+sh-*-elf* | sh-*-rtemself*)
+			targ_emul=shelf
 			targ_extra_emuls="shlelf sh shl"
 			;;
 sh-*-*|sh-*-rtems*)	targ_emul=sh; targ_extra_emuls=shl ;;
@@ -166,12 +171,16 @@
 m68*-*-psos*)		targ_emul=m68kpsos ;;
 m68*-*-rtems*)		targ_emul=m68kcoff ;;
 hppa*-*-*elf*)		targ_emul=hppaelf ;;
+hppa*-*-linux-gnu*)	targ_emul=hppaelf ;;
 hppa*-*-lites*)		targ_emul=hppaelf ;;
 hppa*-*-rtems*)		targ_emul=hppaelf ;;
 vax-dec-ultrix* | vax-dec-bsd*) targ_emul=vax ;;
 mips*-dec-ultrix*)	targ_emul=mipslit ;;
 mips*-dec-osf*)		targ_emul=mipslit ;;
-mips*-sgi-irix[56]*)	targ_emul=elf32bsmip ;;
+mips*-sgi-irix5*)	targ_emul=elf32bsmip ;;
+mips*-sgi-irix6*)	targ_emul=elf32bmipn32
+	                targ_extra_emuls="elf32bsmip elf64bmip"
+	                ;;
 mips*-sgi-irix*)	targ_emul=mipsbig ;;
 mips*el-*-ecoff*)	targ_emul=mipsidtl ;;
 mips*-*-ecoff*)		targ_emul=mipsidt ;;
@@ -186,6 +195,7 @@
 mips*vr5000-*-elf*)	targ_emul=elf32b4300 ;;
 mips*el-*-elf*)		targ_emul=elf32elmip ;;
 mips*-*-elf*)		targ_emul=elf32ebmip ;;
+mips*el-*-rtems*)	targ_emul=elf32elmip ;;
 mips*-*-rtems*)		targ_emul=elf32ebmip ;;
 mips*-*-vxworks*)	targ_emul=elf32ebmip ;;
 mips*el-*-linux-gnu*)	targ_emul=elf32lsmip
@@ -210,12 +220,15 @@
 z8k-*-coff) 		targ_emul=z8002; targ_extra_emuls=z8001 ;;
 ns32k-pc532-mach* | ns32k-pc532-ux*)	targ_emul=pc532macha ;;
 ns32k-pc532-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;;
-powerpc-*-elf* | powerpc-*-eabi* | powerpc-*-linux-gnu* | powerpc-*-sysv* \
+powerpc-*-linux-gnu*)	targ_emul=elf32ppclinux; targ_extra_emuls=elf32ppc;
+			targ_extra_libpath=elf32ppc ;;
+powerpc-*-elf* | powerpc-*-eabi* | powerpc-*-sysv* \
   | powerpc-*-netbsd* | powerpc-*-vxworks*)
 	targ_emul=elf32ppc ;;
 powerpcle-*-elf* | powerpcle-*-eabi* | powerpcle-*-solaris* \
   | powerpcle-*-sysv* | powerpcle-*-vxworks*)
 	targ_emul=elf32lppc ;;
+powerpcle-*-rtems*)	targ_emul=elf32leppc ;;
 powerpc-*-rtems*)	targ_emul=elf32ppc ;;
 powerpc-*-macos*)	targ_emul=ppcmacos ;;
 powerpc-*-netware*)	targ_emul=ppcnw ;;
diff --git a/ld/emulparams/armelf.sh b/ld/emulparams/armelf.sh
index 2b8b02b..a184b5e 100644
--- a/ld/emulparams/armelf.sh
+++ b/ld/emulparams/armelf.sh
@@ -9,6 +9,7 @@
 OTHER_BSS_SYMBOLS='__bss_start__ = .;'
 OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
 
+GENERATE_SHLIB_SCRIPT=yes
 
 ARCH=arm
 MACHINE=
diff --git a/ld/emulparams/armelf_linux.sh b/ld/emulparams/armelf_linux.sh
index 2d7d57b..a0d740b 100644
--- a/ld/emulparams/armelf_linux.sh
+++ b/ld/emulparams/armelf_linux.sh
@@ -6,6 +6,8 @@
 MAXPAGESIZE=0x8000
 TEMPLATE_NAME=armelf
 
+GENERATE_SHLIB_SCRIPT=yes
+
 OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
 OTHER_BSS_SYMBOLS='__bss_start__ = .;'
 OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
diff --git a/ld/emulparams/armelf_oabi.sh b/ld/emulparams/armelf_oabi.sh
index 257753e..d568328 100644
--- a/ld/emulparams/armelf_oabi.sh
+++ b/ld/emulparams/armelf_oabi.sh
@@ -4,7 +4,7 @@
 BIG_OUTPUT_FORMAT="elf32-bigarm-oabi"
 LITTLE_OUTPUT_FORMAT="elf32-littlearm-oabi"
 TEXT_START_ADDR=0x8000
-TEMPLATE_NAME=armelf
+TEMPLATE_NAME=armelf_oabi
 OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
 OTHER_BSS_SYMBOLS='__bss_start__ = .;'
 OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
diff --git a/ld/emulparams/elf32_i960.sh b/ld/emulparams/elf32_i960.sh
new file mode 100644
index 0000000..10ec3fa
--- /dev/null
+++ b/ld/emulparams/elf32_i960.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=elf
+TEMPLATE_NAME=elf32
+OUTPUT_FORMAT="elf32-i960"
+ARCH=i960
+MACHINE=
+TEXT_START_ADDR=0
+EMBEDDED=yes
+MAXPAGESIZE=0x2000
diff --git a/ld/emulparams/elf32bmipn32.sh b/ld/emulparams/elf32bmipn32.sh
new file mode 100755
index 0000000..56f42a9
--- /dev/null
+++ b/ld/emulparams/elf32bmipn32.sh
@@ -0,0 +1,75 @@
+# This is an ELF platform.
+SCRIPT_NAME=elf
+
+# Handle both big- and little-ended 32-bit MIPS objects.
+ARCH=mips
+OUTPUT_FORMAT="elf32-bigmips"
+BIG_OUTPUT_FORMAT="elf32-bigmips"
+LITTLE_OUTPUT_FORMAT="elf32-littlemips"
+
+TEMPLATE_NAME=elf32
+
+TEXT_START_ADDR=0x10000000
+MAXPAGESIZE=0x100000
+ENTRY=__start
+
+# GOT-related settings.  
+OTHER_GOT_SYMBOLS='
+  _gp = ALIGN(16) + 0x7ff0;
+'
+OTHER_GOT_SECTIONS='
+  .lit8 : { *(.lit8) }
+  .lit4 : { *(.lit4) }
+  .srdata : { *(.srdata) }
+'
+
+# Magic symbols.
+TEXT_START_SYMBOLS='_ftext = . ;'
+DATA_START_SYMBOLS='_fdata = . ;'
+OTHER_BSS_SYMBOLS='_fbss = .;'
+# IRIX6 defines these symbols.  0x34 is the size of the ELF header.
+EXECUTABLE_SYMBOLS="
+  __dso_displacement = 0;
+  __elf_header = ${TEXT_START_ADDR};
+  __program_header_table = ${TEXT_START_ADDR} + 0x34;
+"
+
+# There are often dynamic relocations against the .rodata section.
+# Setting DT_TEXTREL in the .dynamic section does not convince the
+# IRIX6 linker to permit relocations against the text segment.
+# Following the IRIX linker, we simply put .rodata in the data
+# segment.
+WRITABLE_RODATA=
+
+OTHER_RELOCATING_SECTIONS='
+  .MIPS.events.text :
+    {
+       *(.MIPS.events.text)
+       *(.MIPS.events.gnu.linkonce.t*)
+    }
+  .MIPS.content.text : 
+    {
+       *(.MIPS.content.text)
+       *(.MIPS.content.gnu.linkonce.t*)
+    }
+  .MIPS.events.data : 
+    {
+       *(.MIPS.events.data)
+       *(.MIPS.events.gnu.linkonce.d*)
+    }
+  .MIPS.content.data : 
+    {
+       *(.MIPS.content.data)
+       *(.MIPS.content.gnu.linkonce.d*)
+    }
+  .MIPS.events.rodata : 
+    {
+       *(.MIPS.events.rodata)
+       *(.MIPS.events.gnu.linkonce.r*)
+    }
+  .MIPS.content.rodata : 
+    {
+       *(.MIPS.content.rodata)
+       *(.MIPS.content.gnu.linkonce.r*)
+    }
+'
diff --git a/ld/emulparams/elf32mcore.sh b/ld/emulparams/elf32mcore.sh
index 47d960f..bd1fdae 100644
--- a/ld/emulparams/elf32mcore.sh
+++ b/ld/emulparams/elf32mcore.sh
@@ -8,13 +8,25 @@
 TEXT_START_ADDR=0
 NONPAGED_TEXT_START_ADDR=0
 ARCH=mcore
-# 1211 == mov r1,r1
-NOP=0x1211
 EMBEDDED=yes
 
+# There is a problem with the NOP value - it must work for both
+# big endian and little endian systems.  Unfortunately there is
+# no symmetrical mcore opcode that functions as a noop.  The
+# chosen solution is to use "tst r0, r14".  This is a symetrical
+# value, and apart from the corruption of the C bit, it has no other
+# side effects.  Since the carry bit is never tested without being
+# explicitly set first, and since the NOP code is only used as a
+# fill value between independantly viable peices of code, it should
+# not matter.
+NOP=0x0e0e
+
 OTHER_BSS_SYMBOLS="__bss_start__ = . ;"
 OTHER_BSS_END_SYMBOLS="__bss_end__ = . ;"
 
 # Hmmm, there's got to be a better way.  This sets the stack to the
 # top of the simulator memory (2^19 bytes).
 OTHER_RELOCATING_SECTIONS='.stack 0x80000 : { _stack = .; *(.stack) }'
+
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
diff --git a/ld/emulparams/elf32ppclinux.sh b/ld/emulparams/elf32ppclinux.sh
new file mode 100644
index 0000000..5808e4d
--- /dev/null
+++ b/ld/emulparams/elf32ppclinux.sh
@@ -0,0 +1,8 @@
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+SCRIPT_NAME=elfppc
+OUTPUT_FORMAT="elf32-powerpc"
+TEXT_START_ADDR=0x10000000
+MAXPAGESIZE=0x40000
+ARCH=powerpc
+MACHINE=
diff --git a/ld/emulparams/elf64_sparc.sh b/ld/emulparams/elf64_sparc.sh
index d0fbdfd..2ab2e4f 100644
--- a/ld/emulparams/elf64_sparc.sh
+++ b/ld/emulparams/elf64_sparc.sh
@@ -10,3 +10,37 @@
 DATA_PLT=
 GENERATE_SHLIB_SCRIPT=yes
 NOP=0x01000000
+
+if [ "x${host}" = "x${target}" ]; then
+  case " $EMULATION_LIBPATH " in
+    *" ${EMULATION_NAME} "*)
+      # Native, and default or emulation requesting LIB_PATH.
+
+      # Linux and Solaris modify the default library search path
+      # to first include a 64-bit specific directory.  It's put
+      # in slightly different places on the two systems.
+      case "$target" in
+        sparc*-linux*)
+          suffix=64 ;;
+        sparc*-solaris*)
+          suffix=/sparcv9 ;;
+      esac
+
+      if [ -n "${suffix}" ]; then
+
+	LIB_PATH=/lib${suffix}:/lib
+	LIB_PATH=${LIB_PATH}:/usr/lib${suffix}:/usr/lib
+	if [ -n "${NATIVE_LIB_DIRS}" ]; then
+	  LIB_PATH=${LIB_PATH}:`echo ${NATIVE_LIB_DIRS} | sed s/:/${suffix}:/g`${suffix}:${NATIVE_LIB_DIRS}
+	fi
+	if [ "${libdir}" != /usr/lib ]; then
+	  LIB_PATH=${LIB_PATH}:${libdir}${suffix}:${libdir}
+	fi
+	if [ "${libdir}" != /usr/local/lib ]; then
+	  LIB_PATH=${LIB_PATH}:/usr/local/lib${suffix}:/usr/local/lib
+	fi
+
+      fi
+    ;;
+  esac
+fi
diff --git a/ld/emulparams/elf64bmip.sh b/ld/emulparams/elf64bmip.sh
new file mode 100755
index 0000000..a4852d5
--- /dev/null
+++ b/ld/emulparams/elf64bmip.sh
@@ -0,0 +1,79 @@
+# This is an ELF platform.
+SCRIPT_NAME=elf
+
+# Handle both big- and little-ended 32-bit MIPS objects.
+ARCH=mips
+OUTPUT_FORMAT="elf64-bigmips"
+BIG_OUTPUT_FORMAT="elf64-bigmips"
+LITTLE_OUTPUT_FORMAT="elf64-littlemips"
+
+# Note that the elf32 template is used for 64-bit emulations as well 
+# as 32-bit emulations.
+ELFSIZE=64
+TEMPLATE_NAME=elf32
+
+TEXT_START_ADDR=0x10000000
+MAXPAGESIZE=0x100000
+ENTRY=__start
+
+# GOT-related settings.  
+OTHER_GOT_SYMBOLS='
+  _gp = ALIGN(16) + 0x7ff0;
+'
+OTHER_GOT_SECTIONS='
+  .lit8 : { *(.lit8) }
+  .lit4 : { *(.lit4) }
+  .srdata : { *(.srdata) }
+'
+
+# Magic symbols.
+TEXT_START_SYMBOLS='_ftext = . ;'
+DATA_START_SYMBOLS='_fdata = . ;'
+OTHER_BSS_SYMBOLS='_fbss = .;'
+# IRIX6 defines these symbols.  0x40 is the size of the ELF header.
+EXECUTABLE_SYMBOLS="
+  __dso_displacement = 0;
+  __elf_header = ${TEXT_START_ADDR};
+  __program_header_table = ${TEXT_START_ADDR} + 0x40;
+"
+
+# There are often dynamic relocations against the .rodata section.
+# Setting DT_TEXTREL in the .dynamic section does not convince the
+# IRIX6 linker to permit relocations against the text segment.
+# Following the IRIX linker, we simply put .rodata in the data
+# segment.
+WRITABLE_RODATA=
+
+
+OTHER_RELOCATING_SECTIONS='
+  .MIPS.events.text :
+    {
+       *(.MIPS.events.text)
+       *(.MIPS.events.gnu.linkonce.t*)
+    }
+  .MIPS.content.text : 
+    {
+       *(.MIPS.content.text)
+       *(.MIPS.content.gnu.linkonce.t*)
+    }
+  .MIPS.events.data : 
+    {
+       *(.MIPS.events.data)
+       *(.MIPS.events.gnu.linkonce.d*)
+    }
+  .MIPS.content.data : 
+    {
+       *(.MIPS.content.data)
+       *(.MIPS.content.gnu.linkonce.d*)
+    }
+  .MIPS.events.rodata : 
+    {
+       *(.MIPS.events.rodata)
+       *(.MIPS.events.gnu.linkonce.r*)
+    }
+  .MIPS.content.rodata : 
+    {
+       *(.MIPS.content.rodata)
+       *(.MIPS.content.gnu.linkonce.r*)
+    }
+'
diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em
index 9955fda..484ff83 100644
--- a/ld/emultempl/armcoff.em
+++ b/ld/emultempl/armcoff.em
@@ -43,18 +43,22 @@
 static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
 static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
 static int  gld${EMULATION_NAME}_parse_args PARAMS((int, char **));
-static void gld_${EMULATION_NAME}_list_options PARAMS ((FILE *));
+static void gld${EMULATION_NAME}_list_options PARAMS ((FILE *));
+static void gld_${EMULATION_NAME}_finish PARAMS ((void));
 
 /* If true, then interworking stubs which support calls to old, non-interworking
    aware ARM code should be generated.  */
 
 static int support_old_code = 0;
+static char * thumb_entry_symbol = NULL;
 
 #define OPTION_SUPPORT_OLD_CODE		300
+#define OPTION_THUMB_ENTRY		301
 
 static struct option longopts[] =
 {
   {"support-old-code", no_argument, NULL, OPTION_SUPPORT_OLD_CODE},
+  {"thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
   {NULL, no_argument, NULL, 0}
 };
 
@@ -63,6 +67,7 @@
      FILE * file;
 {
   fprintf (file, _("  --support-old-code   Support interworking with old code\n"));
+  fprintf (file, _("  --thumb-entry=<sym>  Set the entry point to be Thumb symbol <sym>\n"));
 }
 
 static int
@@ -97,6 +102,10 @@
     case OPTION_SUPPORT_OLD_CODE:
       support_old_code = 1;
       break;
+
+    case OPTION_THUMB_ENTRY:
+      thumb_entry_symbol = optarg;
+      break;
     }
   
   return 1;
@@ -139,11 +148,66 @@
 static void
 gld${EMULATION_NAME}_after_open ()
 {
-  LANG_FOR_EACH_INPUT_STATEMENT (is)
+  if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
     {
-      if (bfd_arm_get_bfd_for_interworking (is->the_bfd, & link_info))
-	break;
+      /* The arm backend needs special fields in the output hash structure.
+	 These will only be created if the output format is an arm format,
+	 hence we do not support linking and changing output formats at the
+	 same time.  Use a link followed by objcopy to change output formats.  */
+      einfo ("%F%X%P: error: cannot change output format whilst linking ARM binaries\n");
+      return;
     }
+  
+  {
+    LANG_FOR_EACH_INPUT_STATEMENT (is)
+      {
+	if (bfd_arm_get_bfd_for_interworking (is->the_bfd, & link_info))
+	  break;
+      }
+  }
+}
+
+static void
+gld${EMULATION_NAME}_finish PARAMS((void))
+{
+  struct bfd_link_hash_entry * h;
+
+  if (thumb_entry_symbol == NULL)
+    return;
+  
+  h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, false, false, true);
+
+  if (h != (struct bfd_link_hash_entry *) NULL
+      && (h->type == bfd_link_hash_defined
+	  || h->type == bfd_link_hash_defweak)
+      && h->u.def.section->output_section != NULL)
+    {
+      static char buffer[32];
+      bfd_vma val;
+      
+      /* Special procesing is required for a Thumb entry symbol.  The
+	 bottom bit of its address must be set.  */
+      val = (h->u.def.value
+	     + bfd_get_section_vma (output_bfd,
+				    h->u.def.section->output_section)
+	     + h->u.def.section->output_offset);
+      
+      val |= 1;
+
+      /* Now convert this value into a string and store it in entry_symbol
+         where the lang_finish() function will pick it up.  */
+      buffer[0] = '0';
+      buffer[1] = 'x';
+      
+      sprintf_vma (buffer + 2, val);
+
+      if (entry_symbol != NULL && entry_from_cmdline)
+	einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"),
+	       thumb_entry_symbol, entry_symbol);
+      entry_symbol = buffer;
+    }
+  else
+    einfo (_("%P: warning: connot find thumb start symbol %s\n"), thumb_entry_symbol);
 }
 
 static char *
@@ -214,7 +278,7 @@
   gld${EMULATION_NAME}_get_script,
   "${EMULATION_NAME}",
   "${OUTPUT_FORMAT}",
-  NULL, /* finish */
+  gld${EMULATION_NAME}_finish, /* finish */
   NULL, /* create output section statements */
   NULL, /* open dynamic archive */
   NULL, /* place orphan */
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
index d9409f2..a0f1a0d 100644
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -1,10 +1,11 @@
 # This shell script emits a C file. -*- C -*-
 # It does some substitutions.
+ELFSIZE=32
 cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* emulate the original gld for the given ${EMULATION_NAME}
-   Copyright (C) 1991, 93, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1991, 93, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Written by Steve Chamberlain steve@cygnus.com
 
 This file is part of GLD, the Gnu Linker.
@@ -38,10 +39,96 @@
 
 #include "ldexp.h"
 #include "ldlang.h"
+#include "ldgram.h"
 
+static boolean gld${EMULATION_NAME}_open_dynamic_archive
+  PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
+static void gld${EMULATION_NAME}_after_open PARAMS ((void));
+static void gld${EMULATION_NAME}_check_needed
+  PARAMS ((lang_input_statement_type *));
+static void gld${EMULATION_NAME}_stat_needed
+  PARAMS ((lang_input_statement_type *));
+static boolean gld${EMULATION_NAME}_search_needed
+  PARAMS ((const char *, const char *, int));
+static boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *, int));
+static void gld${EMULATION_NAME}_vercheck
+  PARAMS ((lang_input_statement_type *));
+static void gld${EMULATION_NAME}_find_statement_assignment
+  PARAMS ((lang_statement_union_type *));
+static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *));
+static boolean gld${EMULATION_NAME}_place_orphan
+  PARAMS ((lang_input_statement_type *, asection *));
+static void gld${EMULATION_NAME}_place_section
+  PARAMS ((lang_statement_union_type *));
 static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
 static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
 static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
+static int  gld${EMULATION_NAME}_parse_args PARAMS((int, char **));
+static void gld${EMULATION_NAME}_list_options PARAMS ((FILE *));
+static void gld_${EMULATION_NAME}_finish PARAMS ((void));
+
+
+static int no_pipeline_knowledge = 0;
+static char * thumb_entry_symbol = NULL;
+
+#define OPTION_THUMB_ENTRY		301
+
+static struct option longopts[] =
+{
+  { "no-pipeline-knowledge", no_argument, NULL, 'p'},
+  { "thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
+  { NULL, no_argument, NULL, 0 }
+};
+
+static void
+gld${EMULATION_NAME}_list_options (file)
+     FILE * file;
+{
+  fprintf (file, _("  -p --no-pipeline-knowledge  Stop the linker knowing about the pipeline length\n"));
+  fprintf (file, _("     --thumb-entry=<sym>      Set the entry point to be Thumb symbol <sym>\n"));
+}
+
+static int
+gld${EMULATION_NAME}_parse_args (argc, argv)
+     int     argc;
+     char ** argv;
+{
+  int        longind;
+  int        optc;
+  int        prevoptind = optind;
+  int        prevopterr = opterr;
+  int        wanterror;
+  static int lastoptind = -1;
+
+  if (lastoptind != optind)
+    opterr = 0;
+  
+  wanterror  = opterr;
+  lastoptind = optind;
+
+  optc   = getopt_long_only (argc, argv, "-p", longopts, & longind);
+  opterr = prevopterr;
+
+  switch (optc)
+    {
+    default:
+      if (wanterror)
+	xexit (1);
+      optind =  prevoptind;
+      return 0;
+
+    case 'p':
+      no_pipeline_knowledge = 1;
+      break;
+
+    case OPTION_THUMB_ENTRY:
+      thumb_entry_symbol = optarg;
+      break;
+    }
+  
+  return 1;
+}
+
 
 static void
 gld${EMULATION_NAME}_before_parse ()
@@ -49,6 +136,933 @@
 #ifndef TARGET_			/* I.e., if not generic.  */
   ldfile_set_output_arch ("`echo ${ARCH}`");
 #endif /* not TARGET_ */
+  config.dynamic_link = ${DYNAMIC_LINK-true};
+  config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
+}
+
+/* Try to open a dynamic archive.  This is where we know that ELF
+   dynamic libraries have an extension of .so.  */
+
+static boolean
+gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
+     const char *arch;
+     search_dirs_type *search;
+     lang_input_statement_type *entry;
+{
+  const char *filename;
+  char *string;
+
+  if (! entry->is_archive)
+    return false;
+
+  filename = entry->filename;
+
+  string = (char *) xmalloc (strlen (search->name)
+			     + strlen (filename)
+			     + strlen (arch)
+			     + sizeof "/lib.so");
+
+  sprintf (string, "%s/lib%s%s.so", search->name, filename, arch);
+
+  if (! ldfile_try_open_bfd (string, entry))
+    {
+      free (string);
+      return false;
+    }
+
+  entry->filename = string;
+
+  /* We have found a dynamic object to include in the link.  The ELF
+     backend linker will create a DT_NEEDED entry in the .dynamic
+     section naming this file.  If this file includes a DT_SONAME
+     entry, it will be used.  Otherwise, the ELF linker will just use
+     the name of the file.  For an archive found by searching, like
+     this one, the DT_NEEDED entry should consist of just the name of
+     the file, without the path information used to find it.  Note
+     that we only need to do this if we have a dynamic object; an
+     archive will never be referenced by a DT_NEEDED entry.
+
+     FIXME: This approach--using bfd_elf_set_dt_needed_name--is not
+     very pretty.  I haven't been able to think of anything that is
+     pretty, though.  */
+  if (bfd_check_format (entry->the_bfd, bfd_object)
+      && (entry->the_bfd->flags & DYNAMIC) != 0)
+    {
+      char *needed_name;
+
+      ASSERT (entry->is_archive && entry->search_dirs_flag);
+      needed_name = (char *) xmalloc (strlen (filename)
+				      + strlen (arch)
+				      + sizeof "lib.so");
+      sprintf (needed_name, "lib%s%s.so", filename, arch);
+      bfd_elf_set_dt_needed_name (entry->the_bfd, needed_name);
+    }
+
+  return true;
+}
+
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+  case " ${EMULATION_LIBPATH} " in
+  *" ${EMULATION_NAME} "*)
+cat >>e${EMULATION_NAME}.c <<EOF
+
+/* For a native linker, check the file /etc/ld.so.conf for directories
+   in which we may find shared libraries.  /etc/ld.so.conf is really
+   only meaningful on Linux, but we check it on other systems anyhow.  */
+
+static boolean gld${EMULATION_NAME}_check_ld_so_conf
+  PARAMS ((const char *, int));
+
+static boolean
+gld${EMULATION_NAME}_check_ld_so_conf (name, force)
+     const char *name;
+     int force;
+{
+  static boolean initialized;
+  static char *ld_so_conf;
+
+  if (! initialized)
+    {
+      FILE *f;
+
+      f = fopen ("/etc/ld.so.conf", FOPEN_RT);
+      if (f != NULL)
+	{
+	  char *b;
+	  size_t len, alloc;
+	  int c;
+
+	  len = 0;
+	  alloc = 100;
+	  b = (char *) xmalloc (alloc);
+
+	  while ((c = getc (f)) != EOF)
+	    {
+	      if (len + 1 >= alloc)
+		{
+		  alloc *= 2;
+		  b = (char *) xrealloc (b, alloc);
+		}
+	      if (c != ':'
+		  && c != ' '
+		  && c != '\t'
+		  && c != '\n'
+		  && c != ',')
+		{
+		  b[len] = c;
+		  ++len;
+		}
+	      else
+		{
+		  if (len > 0 && b[len - 1] != ':')
+		    {
+		      b[len] = ':';
+		      ++len;
+		    }
+		}
+	    }
+
+	  if (len > 0 && b[len - 1] == ':')
+	    --len;
+
+	  if (len > 0)
+	    b[len] = '\0';
+	  else
+	    {
+	      free (b);
+	      b = NULL;
+	    }
+
+	  fclose (f);
+
+	  ld_so_conf = b;
+	}
+
+      initialized = true;
+    }
+
+  if (ld_so_conf == NULL)
+    return false;
+
+  return gld${EMULATION_NAME}_search_needed (ld_so_conf, name, force);
+}
+
+EOF
+  ;;
+  esac
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+
+/* These variables are required to pass information back and forth
+   between after_open and check_needed and stat_needed and vercheck.  */
+
+static struct bfd_link_needed_list *global_needed;
+static struct stat global_stat;
+static boolean global_found;
+static struct bfd_link_needed_list *global_vercheck_needed;
+static boolean global_vercheck_failed;
+
+static void
+gld${EMULATION_NAME}_after_open ()
+{
+  struct bfd_link_needed_list *needed, *l;
+
+  if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
+    {
+      /* The arm backend needs special fields in the output hash structure.
+	 These will only be created if the output format is an arm format,
+	 hence we do not support linking and changing output formats at the
+	 same time.  Use a link followed by objcopy to change output formats.  */
+      einfo ("%F%X%P: error: cannot change output format whilst linking ARM binaries\n");
+      return;
+    }
+
+  {
+    LANG_FOR_EACH_INPUT_STATEMENT (is)
+      {
+	/* The interworking bfd must be the last one to be processed */
+	if (!is->next)
+	  bfd_elf32_arm_get_bfd_for_interworking (is->the_bfd, & link_info);
+      }
+  }
+
+  /* We only need to worry about this when doing a final link.  */
+  if (link_info.relocateable || link_info.shared)
+    return;
+
+  /* Get the list of files which appear in DT_NEEDED entries in
+     dynamic objects included in the link (often there will be none).
+     For each such file, we want to track down the corresponding
+     library, and include the symbol table in the link.  This is what
+     the runtime dynamic linker will do.  Tracking the files down here
+     permits one dynamic object to include another without requiring
+     special action by the person doing the link.  Note that the
+     needed list can actually grow while we are stepping through this
+     loop.  */
+  needed = bfd_elf_get_needed_list (output_bfd, &link_info);
+  for (l = needed; l != NULL; l = l->next)
+    {
+      struct bfd_link_needed_list *ll;
+      int force;
+
+      /* If we've already seen this file, skip it.  */
+      for (ll = needed; ll != l; ll = ll->next)
+	if (strcmp (ll->name, l->name) == 0)
+	  break;
+      if (ll != l)
+	continue;
+
+      /* See if this file was included in the link explicitly.  */
+      global_needed = l;
+      global_found = false;
+      lang_for_each_input_file (gld${EMULATION_NAME}_check_needed);
+      if (global_found)
+	continue;
+
+      /* We need to find this file and include the symbol table.  We
+	 want to search for the file in the same way that the dynamic
+	 linker will search.  That means that we want to use
+	 rpath_link, rpath, then the environment variable
+	 LD_LIBRARY_PATH (native only), then the linker script
+	 LIB_SEARCH_DIRS.  We do not search using the -L arguments.
+
+	 We search twice.  The first time, we skip objects which may
+	 introduce version mismatches.  The second time, we force
+	 their use.  See gld${EMULATION_NAME}_vercheck comment.  */
+      for (force = 0; force < 2; force++)
+	{
+	  const char *lib_path;
+	  size_t len;
+	  search_dirs_type *search;
+
+	  if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
+						  l->name, force))
+	    break;
+	  if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
+						  l->name, force))
+	    break;
+	  if (command_line.rpath_link == NULL
+	      && command_line.rpath == NULL)
+	    {
+	      lib_path = (const char *) getenv ("LD_RUN_PATH");
+	      if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
+						      force))
+		break;
+	    }
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+  case " ${EMULATION_LIBPATH} " in
+  *" ${EMULATION_NAME} "*)
+cat >>e${EMULATION_NAME}.c <<EOF
+	  lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
+	  if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force))
+	    break;
+EOF
+  ;;
+  esac
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+	  len = strlen (l->name);
+	  for (search = search_head; search != NULL; search = search->next)
+	    {
+	      char *filename;
+
+	      if (search->cmdline)
+		continue;
+	      filename = (char *) xmalloc (strlen (search->name) + len + 2);
+	      sprintf (filename, "%s/%s", search->name, l->name);
+	      if (gld${EMULATION_NAME}_try_needed (filename, force))
+		break;
+	      free (filename);
+	    }
+	  if (search != NULL)
+	    break;
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+  case " ${EMULATION_LIBPATH} " in
+  *" ${EMULATION_NAME} "*)
+cat >>e${EMULATION_NAME}.c <<EOF
+	  if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
+	    break;
+EOF
+  ;;
+  esac
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+	}
+
+      if (force < 2)
+	continue;
+
+      einfo ("%P: warning: %s, needed by %B, not found (try using --rpath)\n",
+	     l->name, l->by);
+    }
+}
+
+/* Search for a needed file in a path.  */
+
+static boolean
+gld${EMULATION_NAME}_search_needed (path, name, force)
+     const char *path;
+     const char *name;
+     int force;
+{
+  const char *s;
+  size_t len;
+
+  if (path == NULL || *path == '\0')
+    return false;
+  len = strlen (name);
+  while (1)
+    {
+      char *filename, *sset;
+
+      s = strchr (path, ':');
+      if (s == NULL)
+	s = path + strlen (path);
+
+      filename = (char *) xmalloc (s - path + len + 2);
+      if (s == path)
+	sset = filename;
+      else
+	{
+	  memcpy (filename, path, s - path);
+	  filename[s - path] = '/';
+	  sset = filename + (s - path) + 1;
+	}
+      strcpy (sset, name);
+
+      if (gld${EMULATION_NAME}_try_needed (filename, force))
+	return true;
+
+      free (filename);
+
+      if (*s == '\0')
+	break;
+      path = s + 1;
+    }
+
+  return false;	  
+}
+
+/* This function is called for each possible name for a dynamic object
+   named by a DT_NEEDED entry.  The FORCE parameter indicates whether
+   to skip the check for a conflicting version.  */
+
+static boolean
+gld${EMULATION_NAME}_try_needed (name, force)
+     const char *name;
+     int force;
+{
+  bfd *abfd;
+
+  abfd = bfd_openr (name, bfd_get_target (output_bfd));
+  if (abfd == NULL)
+    return false;
+  if (! bfd_check_format (abfd, bfd_object))
+    {
+      (void) bfd_close (abfd);
+      return false;
+    }
+  if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0)
+    {
+      (void) bfd_close (abfd);
+      return false;
+    }
+
+  /* Check whether this object would include any conflicting library
+     versions.  If FORCE is set, then we skip this check; we use this
+     the second time around, if we couldn't find any compatible
+     instance of the shared library.  */
+
+  if (! force)
+    {
+      struct bfd_link_needed_list *needed;
+
+      if (! bfd_elf_get_bfd_needed_list (abfd, &needed))
+	einfo ("%F%P:%B: bfd_elf_get_bfd_needed_list failed: %E\n", abfd);
+
+      if (needed != NULL)
+	{
+	  global_vercheck_needed = needed;
+	  global_vercheck_failed = false;
+	  lang_for_each_input_file (gld${EMULATION_NAME}_vercheck);
+	  if (global_vercheck_failed)
+	    {
+	      (void) bfd_close (abfd);
+	      /* Return false to force the caller to move on to try
+                 another file on the search path.  */
+	      return false;
+	    }
+
+	  /* But wait!  It gets much worse.  On Linux, if a shared
+             library does not use libc at all, we are supposed to skip
+             it the first time around in case we encounter a shared
+             library later on with the same name which does use the
+             version of libc that we want.  This is much too horrible
+             to use on any system other than Linux.  */
+
+EOF
+case ${target} in
+  *-*-linux-gnu*)
+    cat >>e${EMULATION_NAME}.c <<EOF
+	  {
+	    struct bfd_link_needed_list *l;
+
+	    for (l = needed; l != NULL; l = l->next)
+	      if (strncmp (l->name, "libc.so", 7) == 0)
+		break;
+	    if (l == NULL)
+	      {
+		(void) bfd_close (abfd);
+		return false;
+	      }
+	  }
+
+EOF
+    ;;
+esac
+cat >>e${EMULATION_NAME}.c <<EOF
+	}
+    }
+
+  /* We've found a dynamic object matching the DT_NEEDED entry.  */
+
+  /* We have already checked that there is no other input file of the
+     same name.  We must now check again that we are not including the
+     same file twice.  We need to do this because on many systems
+     libc.so is a symlink to, e.g., libc.so.1.  The SONAME entry will
+     reference libc.so.1.  If we have already included libc.so, we
+     don't want to include libc.so.1 if they are the same file, and we
+     can only check that using stat.  */
+
+  if (bfd_stat (abfd, &global_stat) != 0)
+    einfo ("%F%P:%B: bfd_stat failed: %E\n", abfd);
+  global_found = false;
+  lang_for_each_input_file (gld${EMULATION_NAME}_stat_needed);
+  if (global_found)
+    {
+      /* Return true to indicate that we found the file, even though
+         we aren't going to do anything with it.  */
+      return true;
+    }
+
+  /* Tell the ELF backend that don't want the output file to have a
+     DT_NEEDED entry for this file.  */
+  bfd_elf_set_dt_needed_name (abfd, "");
+
+  /* Add this file into the symbol table.  */
+  if (! bfd_link_add_symbols (abfd, &link_info))
+    einfo ("%F%B: could not read symbols: %E\n", abfd);
+
+  return true;
+}
+
+/* See if an input file matches a DT_NEEDED entry by name.  */
+
+static void
+gld${EMULATION_NAME}_check_needed (s)
+     lang_input_statement_type *s;
+{
+  if (global_found)
+    return;
+
+  if (s->filename != NULL
+      && strcmp (s->filename, global_needed->name) == 0)
+    {
+      global_found = true;
+      return;
+    }
+
+  if (s->the_bfd != NULL)
+    {
+      const char *soname;
+
+      soname = bfd_elf_get_dt_soname (s->the_bfd);
+      if (soname != NULL
+	  && strcmp (soname, global_needed->name) == 0)
+	{
+	  global_found = true;
+	  return;
+	}
+    }
+	  
+  if (s->search_dirs_flag
+      && s->filename != NULL
+      && strchr (global_needed->name, '/') == NULL)
+    {
+      const char *f;
+
+      f = strrchr (s->filename, '/');
+      if (f != NULL
+	  && strcmp (f + 1, global_needed->name) == 0)
+	{
+	  global_found = true;
+	  return;
+	}
+    }
+}
+
+/* See if an input file matches a DT_NEEDED entry by running stat on
+   the file.  */
+
+static void
+gld${EMULATION_NAME}_stat_needed (s)
+     lang_input_statement_type *s;
+{
+  struct stat st;
+  const char *suffix;
+  const char *soname;
+  const char *f;
+
+  if (global_found)
+    return;
+  if (s->the_bfd == NULL)
+    return;
+
+  if (bfd_stat (s->the_bfd, &st) != 0)
+    {
+      einfo ("%P:%B: bfd_stat failed: %E\n", s->the_bfd);
+      return;
+    }
+
+  if (st.st_dev == global_stat.st_dev
+      && st.st_ino == global_stat.st_ino)
+    {
+      global_found = true;
+      return;
+    }
+
+  /* We issue a warning if it looks like we are including two
+     different versions of the same shared library.  For example,
+     there may be a problem if -lc picks up libc.so.6 but some other
+     shared library has a DT_NEEDED entry of libc.so.5.  This is a
+     hueristic test, and it will only work if the name looks like
+     NAME.so.VERSION.  FIXME: Depending on file names is error-prone.
+     If we really want to issue warnings about mixing version numbers
+     of shared libraries, we need to find a better way.  */
+
+  if (strchr (global_needed->name, '/') != NULL)
+    return;
+  suffix = strstr (global_needed->name, ".so.");
+  if (suffix == NULL)
+    return;
+  suffix += sizeof ".so." - 1;
+
+  soname = bfd_elf_get_dt_soname (s->the_bfd);
+  if (soname == NULL)
+    soname = s->filename;
+
+  f = strrchr (soname, '/');
+  if (f != NULL)
+    ++f;
+  else
+    f = soname;
+
+  if (strncmp (f, global_needed->name, suffix - global_needed->name) == 0)
+    einfo ("%P: warning: %s, needed by %B, may conflict with %s\n",
+	   global_needed->name, global_needed->by, f);
+}
+
+/* On Linux, it's possible to have different versions of the same
+   shared library linked against different versions of libc.  The
+   dynamic linker somehow tags which libc version to use in
+   /etc/ld.so.cache, and, based on the libc that it sees in the
+   executable, chooses which version of the shared library to use.
+
+   We try to do a similar check here by checking whether this shared
+   library needs any other shared libraries which may conflict with
+   libraries we have already included in the link.  If it does, we
+   skip it, and try to find another shared library farther on down the
+   link path.
+
+   This is called via lang_for_each_input_file.
+   GLOBAL_VERCHECK_NEEDED is the list of objects needed by the object
+   which we ar checking.  This sets GLOBAL_VERCHECK_FAILED if we find
+   a conflicting version.  */
+
+static void
+gld${EMULATION_NAME}_vercheck (s)
+     lang_input_statement_type *s;
+{
+  const char *soname, *f;
+  struct bfd_link_needed_list *l;
+
+  if (global_vercheck_failed)
+    return;
+  if (s->the_bfd == NULL
+      || (bfd_get_file_flags (s->the_bfd) & DYNAMIC) == 0)
+    return;
+
+  soname = bfd_elf_get_dt_soname (s->the_bfd);
+  if (soname == NULL)
+    soname = bfd_get_filename (s->the_bfd);
+
+  f = strrchr (soname, '/');
+  if (f != NULL)
+    ++f;
+  else
+    f = soname;
+
+  for (l = global_vercheck_needed; l != NULL; l = l->next)
+    {
+      const char *suffix;
+
+      if (strcmp (f, l->name) == 0)
+	{
+	  /* Probably can't happen, but it's an easy check.  */
+	  continue;
+	}
+
+      if (strchr (l->name, '/') != NULL)
+	continue;
+
+      suffix = strstr (l->name, ".so.");
+      if (suffix == NULL)
+	continue;
+
+      suffix += sizeof ".so." - 1;
+
+      if (strncmp (f, l->name, suffix - l->name) == 0)
+	{
+	  /* Here we know that S is a dynamic object FOO.SO.VER1, and
+             the object we are considering needs a dynamic object
+             FOO.SO.VER2, and VER1 and VER2 are different.  This
+             appears to be a version mismatch, so we tell the caller
+             to try a different version of this library.  */
+	  global_vercheck_failed = true;
+	  return;
+	}
+    }
+}
+
+/* Place an orphan section.  We use this to put random SHF_ALLOC
+   sections in the right segment.  */
+
+static asection *hold_section;
+static lang_output_section_statement_type *hold_use;
+static lang_output_section_statement_type *hold_text;
+static lang_output_section_statement_type *hold_rodata;
+static lang_output_section_statement_type *hold_data;
+static lang_output_section_statement_type *hold_bss;
+static lang_output_section_statement_type *hold_rel;
+static lang_output_section_statement_type *hold_interp;
+
+/*ARGSUSED*/
+static boolean
+gld${EMULATION_NAME}_place_orphan (file, s)
+     lang_input_statement_type *file;
+     asection *s;
+{
+  lang_output_section_statement_type *place;
+  asection *snew, **pps;
+  lang_statement_list_type *old;
+  lang_statement_list_type add;
+  etree_type *address;
+  const char *secname, *ps;
+  const char *outsecname;
+  lang_output_section_statement_type *os;
+
+  if ((s->flags & SEC_ALLOC) == 0)
+    return false;
+
+  /* Look through the script to see where to place this section.  */
+  hold_section = s;
+  hold_use = NULL;
+  lang_for_each_statement (gld${EMULATION_NAME}_place_section);
+
+  if (hold_use != NULL)
+    {
+      /* We have already placed a section with this name.  */
+      wild_doit (&hold_use->children, s, hold_use, file);
+      return true;
+    }
+
+  secname = bfd_get_section_name (s->owner, s);
+
+  /* If this is a final link, then always put .gnu.warning.SYMBOL
+     sections into the .text section to get them out of the way.  */
+  if (! link_info.shared
+      && ! link_info.relocateable
+      && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0
+      && hold_text != NULL)
+    {
+      wild_doit (&hold_text->children, s, hold_text, file);
+      return true;
+    }
+
+  /* Decide which segment the section should go in based on the
+     section name and section flags.  We put loadable .note sections
+     right after the .interp section, so that the PT_NOTE segment is
+     stored right after the program headers where the OS can read it
+     in the first page.  */
+  place = NULL;
+  if (s->flags & SEC_EXCLUDE)
+    return false;
+  else if ((s->flags & SEC_LOAD) != 0
+      && strncmp (secname, ".note", 4) == 0
+      && hold_interp != NULL)
+    place = hold_interp;
+  else if ((s->flags & SEC_HAS_CONTENTS) == 0
+	   && hold_bss != NULL)
+    place = hold_bss;
+  else if ((s->flags & SEC_READONLY) == 0
+	   && hold_data != NULL)
+    place = hold_data;
+  else if (strncmp (secname, ".rel", 4) == 0
+	   && hold_rel != NULL)
+    place = hold_rel;
+  else if ((s->flags & SEC_CODE) == 0
+	   && (s->flags & SEC_READONLY) != 0
+	   && hold_rodata != NULL)
+    place = hold_rodata;
+  else if ((s->flags & SEC_READONLY) != 0
+	   && hold_text != NULL)
+    place = hold_text;
+  if (place == NULL)
+    return false;
+
+  /* Choose a unique name for the section.  This will be needed if the
+     same section name appears in the input file with different
+     loadable or allocateable characteristics.  */
+  outsecname = secname;
+  if (bfd_get_section_by_name (output_bfd, outsecname) != NULL)
+    {
+      unsigned int len;
+      char *newname;
+      unsigned int i;
+
+      len = strlen (outsecname);
+      newname = xmalloc (len + 5);
+      strcpy (newname, outsecname);
+      i = 0;
+      do
+	{
+	  sprintf (newname + len, "%d", i);
+	  ++i;
+	}
+      while (bfd_get_section_by_name (output_bfd, newname) != NULL);
+
+      outsecname = newname;
+    }
+
+  /* Create the section in the output file, and put it in the right
+     place.  This shuffling is to make the output file look neater.  */
+  snew = bfd_make_section (output_bfd, outsecname);
+  if (snew == NULL)
+      einfo ("%P%F: output format %s cannot represent section called %s\n",
+	     output_bfd->xvec->name, outsecname);
+  if (place->bfd_section != NULL)
+    {
+      for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next)
+	;
+      *pps = snew->next;
+      snew->next = place->bfd_section->next;
+      place->bfd_section->next = snew;
+    }
+
+  /* Start building a list of statements for this section.  */
+  old = stat_ptr;
+  stat_ptr = &add;
+  lang_list_init (stat_ptr);
+
+  /* If the name of the section is representable in C, then create
+     symbols to mark the start and the end of the section.  */
+  for (ps = outsecname; *ps != '\0'; ps++)
+    if (! isalnum ((unsigned char) *ps) && *ps != '_')
+      break;
+  if (*ps == '\0' && config.build_constructors)
+    {
+      char *symname;
+
+      symname = (char *) xmalloc (ps - outsecname + sizeof "__start_");
+      sprintf (symname, "__start_%s", outsecname);
+      lang_add_assignment (exp_assop ('=', symname,
+				      exp_unop (ALIGN_K,
+						exp_intop ((bfd_vma) 1
+							   << s->alignment_power))));
+    }
+
+  if (! link_info.relocateable)
+    address = NULL;
+  else
+    address = exp_intop ((bfd_vma) 0);
+
+  lang_enter_output_section_statement (outsecname, address, 0,
+				       (bfd_vma) 0,
+				       (etree_type *) NULL,
+				       (etree_type *) NULL,
+				       (etree_type *) NULL);
+
+  os = lang_output_section_statement_lookup (outsecname);
+  wild_doit (&os->children, s, os, file);
+
+  lang_leave_output_section_statement
+    ((bfd_vma) 0, "*default*", (struct lang_output_section_phdr_list *) NULL);
+  stat_ptr = &add;
+
+  if (*ps == '\0' && config.build_constructors)
+    {
+      char *symname;
+
+      symname = (char *) xmalloc (ps - outsecname + sizeof "__stop_");
+      sprintf (symname, "__stop_%s", outsecname);
+      lang_add_assignment (exp_assop ('=', symname,
+				      exp_nameop (NAME, ".")));
+    }
+
+  /* Now stick the new statement list right after PLACE.  */
+  *add.tail = place->header.next;
+  place->header.next = add.head;
+
+  stat_ptr = old;
+
+  return true;
+}
+
+static void
+gld${EMULATION_NAME}_place_section (s)
+     lang_statement_union_type *s;
+{
+  lang_output_section_statement_type *os;
+
+  if (s->header.type != lang_output_section_statement_enum)
+    return;
+
+  os = &s->output_section_statement;
+
+  if (strcmp (os->name, hold_section->name) == 0
+      && os->bfd_section != NULL
+      && ((hold_section->flags & (SEC_LOAD | SEC_ALLOC))
+	  == (os->bfd_section->flags & (SEC_LOAD | SEC_ALLOC))))
+    hold_use = os;
+
+  if (strcmp (os->name, ".text") == 0)
+    hold_text = os;
+  else if (strcmp (os->name, ".rodata") == 0)
+    hold_rodata = os;
+  else if (strcmp (os->name, ".data") == 0)
+    hold_data = os;
+  else if (strcmp (os->name, ".bss") == 0)
+    hold_bss = os;
+  else if (hold_rel == NULL
+	   && os->bfd_section != NULL
+	   && (os->bfd_section->flags & SEC_ALLOC) != 0
+	   && strncmp (os->name, ".rel", 4) == 0)
+    hold_rel = os;
+  else if (strcmp (os->name, ".interp") == 0)
+    hold_interp = os;
+}
+
+/* Look through an expression for an assignment statement.  */
+
+static void
+gld${EMULATION_NAME}_find_exp_assignment (exp)
+     etree_type *exp;
+{
+  struct bfd_link_hash_entry *h;
+
+  switch (exp->type.node_class)
+    {
+    case etree_provide:
+      h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
+				false, false, false);
+      if (h == NULL)
+	break;
+
+      /* We call record_link_assignment even if the symbol is defined.
+	 This is because if it is defined by a dynamic object, we
+	 actually want to use the value defined by the linker script,
+	 not the value from the dynamic object (because we are setting
+	 symbols like etext).  If the symbol is defined by a regular
+	 object, then, as it happens, calling record_link_assignment
+	 will do no harm.  */
+
+      /* Fall through.  */
+    case etree_assign:
+      if (strcmp (exp->assign.dst, ".") != 0)
+	{
+	  if (! (bfd_elf${ELFSIZE}_record_link_assignment
+		 (output_bfd, &link_info, exp->assign.dst,
+		  exp->type.node_class == etree_provide ? true : false)))
+	    einfo ("%P%F: failed to record assignment to %s: %E\n",
+		   exp->assign.dst);
+	}
+      gld${EMULATION_NAME}_find_exp_assignment (exp->assign.src);
+      break;
+
+    case etree_binary:
+      gld${EMULATION_NAME}_find_exp_assignment (exp->binary.lhs);
+      gld${EMULATION_NAME}_find_exp_assignment (exp->binary.rhs);
+      break;
+
+    case etree_trinary:
+      gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.cond);
+      gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.lhs);
+      gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.rhs);
+      break;
+
+    case etree_unary:
+      gld${EMULATION_NAME}_find_exp_assignment (exp->unary.child);
+      break;
+
+    default:
+      break;
+    }
+}
+
+/* This is called by the before_allocation routine via
+   lang_for_each_statement.  It locates any assignment statements, and
+   tells the ELF backend about them, in case they are assignments to
+   symbols which are referred to by dynamic objects.  */
+
+static void
+gld${EMULATION_NAME}_find_statement_assignment (s)
+     lang_statement_union_type *s;
+{
+  if (s->header.type == lang_assignment_statement_enum)
+    gld${EMULATION_NAME}_find_exp_assignment (s->assignment_statement.exp);
 }
 
 /* This is called after the sections have been attached to output
@@ -57,6 +1071,73 @@
 static void
 gld${EMULATION_NAME}_before_allocation ()
 {
+  const char *rpath;
+  asection *sinterp;
+
+  /* If we are going to make any variable assignments, we need to let
+     the ELF backend know about them in case the variables are
+     referred to by dynamic objects.  */
+  lang_for_each_statement (gld${EMULATION_NAME}_find_statement_assignment);
+
+  /* Let the ELF backend work out the sizes of any sections required
+     by dynamic linking.  */
+  rpath = command_line.rpath;
+  if (rpath == NULL)
+    rpath = (const char *) getenv ("LD_RUN_PATH");
+  if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
+         (output_bfd, command_line.soname, rpath,
+	  command_line.export_dynamic, command_line.filter_shlib,
+	  (const char * const *) command_line.auxiliary_filters,
+	  &link_info, &sinterp, lang_elf_version_info)))
+    einfo ("%P%F: failed to set dynamic section sizes: %E\n");
+
+  /* Let the user override the dynamic linker we are using.  */
+  if (command_line.interpreter != NULL
+      && sinterp != NULL)
+    {
+      sinterp->contents = (bfd_byte *) command_line.interpreter;
+      sinterp->_raw_size = strlen (command_line.interpreter) + 1;
+    }
+
+  /* Look for any sections named .gnu.warning.  As a GNU extensions,
+     we treat such sections as containing warning messages.  We print
+     out the warning message, and then zero out the section size so
+     that it does not get copied into the output file.  */
+
+  {
+    LANG_FOR_EACH_INPUT_STATEMENT (is)
+      {
+	asection *s;
+	bfd_size_type sz;
+	char *msg;
+	boolean ret;
+
+	if (is->just_syms_flag)
+	  continue;
+
+	s = bfd_get_section_by_name (is->the_bfd, ".gnu.warning");
+	if (s == NULL)
+	  continue;
+
+	sz = bfd_section_size (is->the_bfd, s);
+	msg = xmalloc ((size_t) sz + 1);
+	if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz))
+	  einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n",
+		 is->the_bfd);
+	msg[sz] = '\0';
+	ret = link_info.callbacks->warning (&link_info, msg,
+					    (const char *) NULL,
+					    is->the_bfd, (asection *) NULL,
+					    (bfd_vma) 0);
+	ASSERT (ret);
+	free (msg);
+
+	/* Clobber the section size, so that we don't waste copying the
+	   warning into the output file.  */
+	s->_raw_size = 0;
+      }
+  }
+
   /* we should be able to set the size of the interworking stub section */
 
   /* Here we rummage through the found bfds to collect glue information */
@@ -64,7 +1145,8 @@
   {
     LANG_FOR_EACH_INPUT_STATEMENT (is)
       {
-	if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info))
+	if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, & link_info,
+						      no_pipeline_knowledge))
 	  {
 	    /* xgettext:c-format */
 	    einfo (_("Errors encountered processing file %s"), is->filename);
@@ -77,15 +1159,46 @@
 }
 
 static void
-gld${EMULATION_NAME}_after_open ()
+gld${EMULATION_NAME}_finish PARAMS((void))
 {
+  struct bfd_link_hash_entry * h;
 
-  LANG_FOR_EACH_INPUT_STATEMENT (is)
+  if (thumb_entry_symbol == NULL)
+    return;
+  
+  h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, false, false, true);
+
+  if (h != (struct bfd_link_hash_entry *) NULL
+      && (h->type == bfd_link_hash_defined
+	  || h->type == bfd_link_hash_defweak)
+      && h->u.def.section->output_section != NULL)
     {
-      /* The interworking bfd must be the last one to be processed */
-      if (!is->next)
-         bfd_elf32_arm_get_bfd_for_interworking (is->the_bfd, & link_info);
+      static char buffer[32];
+      bfd_vma val;
+      
+      /* Special procesing is required for a Thumb entry symbol.  The
+	 bottom bit of its address must be set.  */
+      val = (h->u.def.value
+	     + bfd_get_section_vma (output_bfd,
+				    h->u.def.section->output_section)
+	     + h->u.def.section->output_offset);
+      
+      val |= 1;
+
+      /* Now convert this value into a string and store it in entry_symbol
+         where the lang_finish() function will pick it up.  */
+      buffer[0] = '0';
+      buffer[1] = 'x';
+      
+      sprintf_vma (buffer + 2, val);
+
+      if (entry_symbol != NULL && entry_from_cmdline)
+	einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"),
+	       thumb_entry_symbol, entry_symbol);
+      entry_symbol = buffer;
     }
+  else
+    einfo (_("%P: warning: connot find thumb start symbol %s\n"), thumb_entry_symbol);
 }
 
 static char *
@@ -114,6 +1227,10 @@
 sed $sc ldscripts/${EMULATION_NAME}.xbn                    >> e${EMULATION_NAME}.c
 echo '  ; else if (!config.magic_demand_paged) return'     >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xn                     >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_SHLIB_SCRIPT" ; then
+        echo '  ; else if (link_info.shared) return'       >> e${EMULATION_NAME}.c
+        sed $sc ldscripts/${EMULATION_NAME}.xs             >> e${EMULATION_NAME}.c
+fi
 echo '  ; else return'                                     >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.x                      >> e${EMULATION_NAME}.c
 echo '; }'                                                 >> e${EMULATION_NAME}.c
@@ -133,6 +1250,8 @@
     return "ldscripts/${EMULATION_NAME}.xbn";
   else if (!config.magic_demand_paged)
     return "ldscripts/${EMULATION_NAME}.xn";
+  else if (link_info.shared)
+    return "ldscripts/${EMULATION_NAME}.xs";
   else
     return "ldscripts/${EMULATION_NAME}.x";
 }
@@ -156,13 +1275,14 @@
   gld${EMULATION_NAME}_get_script,
   "${EMULATION_NAME}",
   "${OUTPUT_FORMAT}",
-  NULL, /* finish */
+  gld${EMULATION_NAME}_finish, /* finish */
   NULL, /* create output section statements */
-  NULL, /* open dynamic archive */
-  NULL, /* place orphan */
+  gld${EMULATION_NAME}_open_dynamic_archive,
+  gld${EMULATION_NAME}_place_orphan,
   NULL, /* set_symbols */
-  NULL,
+  gld${EMULATION_NAME}_parse_args,
   NULL, /* unrecognised file */
-  NULL
+  gld${EMULATION_NAME}_list_options,
+  NULL /* recognized file */
 };
 EOF
diff --git a/ld/emultempl/armelf_oabi.em b/ld/emultempl/armelf_oabi.em
index c0526e5..20a50df 100644
--- a/ld/emultempl/armelf_oabi.em
+++ b/ld/emultempl/armelf_oabi.em
@@ -71,7 +71,7 @@
   {
     LANG_FOR_EACH_INPUT_STATEMENT (is)
       {
-	if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info))
+	if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info, 0))
 	  {
 	    /* xgettext:c-format */
 	    einfo (_("Errors encountered processing file %s"), is->filename);
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 0358676..4ec259c 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -7,7 +7,8 @@
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
-   Copyright (C) 1991, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1991, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    ELF support by Ian Lance Taylor <ian@cygnus.com>
 
@@ -139,7 +140,8 @@
 
 EOF
 if [ "x${host}" = "x${target}" ] ; then
-  if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+  case " ${EMULATION_LIBPATH} " in
+  *" ${EMULATION_NAME} "*)
 cat >>e${EMULATION_NAME}.c <<EOF
 
 /* For a native linker, check the file /etc/ld.so.conf for directories
@@ -224,7 +226,8 @@
 }
 
 EOF
-  fi
+  ;;
+  esac
 fi
 cat >>e${EMULATION_NAME}.c <<EOF
 
@@ -309,13 +312,15 @@
 	    }
 EOF
 if [ "x${host}" = "x${target}" ] ; then
-  if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+  case " ${EMULATION_LIBPATH} " in
+  *" ${EMULATION_NAME} "*)
 cat >>e${EMULATION_NAME}.c <<EOF
 	  lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
 	  if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force))
 	    break;
 EOF
-  fi
+  ;;
+  esac
 fi
 cat >>e${EMULATION_NAME}.c <<EOF
 	  len = strlen (l->name);
@@ -335,12 +340,14 @@
 	    break;
 EOF
 if [ "x${host}" = "x${target}" ] ; then
-  if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+  case " ${EMULATION_LIBPATH} " in
+  *" ${EMULATION_NAME} "*)
 cat >>e${EMULATION_NAME}.c <<EOF
 	  if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
 	    break;
 EOF
-  fi
+  ;;
+  esac
 fi
 cat >>e${EMULATION_NAME}.c <<EOF
 	}
@@ -1138,6 +1145,11 @@
   NULL,
   NULL,
   gld${EMULATION_NAME}_open_dynamic_archive,
-  gld${EMULATION_NAME}_place_orphan
+  gld${EMULATION_NAME}_place_orphan,
+  NULL,		/* set_symbols */
+  NULL,		/* parse_args */
+  NULL,		/* unrecognized_file */
+  NULL,		/* list_options */
+  NULL		/* recognized_file */
 };
 EOF
diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em
index dc0855d..29f5bd1 100644
--- a/ld/emultempl/linux.em
+++ b/ld/emultempl/linux.em
@@ -203,6 +203,12 @@
   "${OUTPUT_FORMAT}",
   NULL,
   gld${EMULATION_NAME}_create_output_section_statements,
-  gld${EMULATION_NAME}_open_dynamic_archive
+  gld${EMULATION_NAME}_open_dynamic_archive,
+  NULL,
+  NULL,
+  NULL,
+  NULL,
+  NULL,
+  NULL
 };
 EOF
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 46ebbe9..bdab4f9 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1,8 +1,9 @@
 # This shell script emits a C file. -*- C -*-
 # It does some substitutions.
-cat >e${EMULATION_NAME}.c <<EOF
+(echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
+cat >>e${EMULATION_NAME}.c <<EOF
 /* This file is part of GLD, the Gnu Linker.
-   Copyright 1995, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright 1995, 96, 97, 98, 1999 Free Software Foundation, Inc.
 
 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
@@ -42,10 +43,26 @@
 #include "ldfile.h"
 #include "coff/internal.h"
 #include "../bfd/libcoff.h"
+#include "../bfd/libbfd.h"
 #include "deffile.h"
 
 #define TARGET_IS_${EMULATION_NAME}
 
+#if defined(TARGET_IS_i386pe)
+#define DLL_SUPPORT
+#endif
+
+#define	PE_DEF_SUBSYSTEM		3
+
+#ifdef TARGET_IS_arm_epoc_pe
+#define bfd_arm_pe_allocate_interworking_sections \
+	bfd_arm_epoc_pe_allocate_interworking_sections
+#define bfd_arm_pe_get_bfd_for_interworking \
+	bfd_arm_epoc_pe_get_bfd_for_interworking
+#define bfd_arm_pe_process_before_allocation \
+	bfd_arm_epoc_pe_process_before_allocation
+#endif
+
 static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void));
 static void gld_${EMULATION_NAME}_after_open PARAMS ((void));
 static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
@@ -57,10 +74,12 @@
   PARAMS ((lang_statement_union_type *));
 static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *));
 static int gld_${EMULATION_NAME}_parse_args PARAMS ((int, char **));
+static void gld_${EMULATION_NAME}_finish PARAMS ((void));
 
 static struct internal_extra_pe_aouthdr pe;
 static int dll;
 static int support_old_code = 0;
+static char * thumb_entry_symbol = NULL;
 extern def_file *pe_def_file;
 static lang_assignment_statement_type *image_base_statement = 0;
 
@@ -78,7 +97,7 @@
 {
   output_filename = "a.exe";
   ldfile_output_architecture = bfd_arch_${ARCH};
-#ifdef TARGET_IS_i386pe
+#ifdef DLL_SUPPORT
   config.has_shared = 1;
 #endif
 }
@@ -109,6 +128,7 @@
 #define OPTION_ENABLE_STDCALL_FIXUP	(OPTION_STDCALL_ALIASES + 1)
 #define OPTION_DISABLE_STDCALL_FIXUP	(OPTION_ENABLE_STDCALL_FIXUP + 1)
 #define OPTION_IMPLIB_FILENAME		(OPTION_DISABLE_STDCALL_FIXUP + 1)
+#define OPTION_THUMB_ENTRY		(OPTION_IMPLIB_FILENAME + 1)
 
 static struct option longopts[] =
 {
@@ -128,7 +148,8 @@
   {"stack", required_argument, NULL, OPTION_STACK},
   {"subsystem", required_argument, NULL, OPTION_SUBSYSTEM},
   {"support-old-code", no_argument, NULL, OPTION_SUPPORT_OLD_CODE},
-#ifdef TARGET_IS_i386pe
+  {"thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
+#ifdef DLL_SUPPORT
   /* getopt allows abbreviations, so we do this to stop it from treating -o
      as an abbreviation for this option */
   {"output-def", required_argument, NULL, OPTION_OUT_DEF},
@@ -174,7 +195,7 @@
   D(MinorImageVersion,"__minor_image_version__", 0),
   D(MajorSubsystemVersion,"__major_subsystem_version__", 4),
   D(MinorSubsystemVersion,"__minor_subsystem_version__", 0),
-  D(Subsystem,"__subsystem__", 3),
+  D(Subsystem,"__subsystem__", PE_DEF_SUBSYSTEM),
   D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x2000000),
   D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000),
   D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000),
@@ -202,7 +223,8 @@
   fprintf (file, _("  --stack <size>                     Set size of the initial stack\n"));
   fprintf (file, _("  --subsystem <name>[:<version>]     Set required OS subsystem [& version]\n"));
   fprintf (file, _("  --support-old-code                 Support interworking with old code\n"));
-#ifdef TARGET_IS_i386pe
+  fprintf (file, _("  --thumb-entry=<symbol>             Set the entry point to be Thumb <symbol>\n"));
+#ifdef DLL_SUPPORT
   fprintf (file, _("  --add-stdcall-alias                Export symbols with and without @nn\n"));
   fprintf (file, _("  --disable-stdcall-fixup            Don't link _sym to _sym@nn\n"));
   fprintf (file, _("  --enable-stdcall-fixup             Link _sym to _sym@nn without warnings\n"));
@@ -410,6 +432,10 @@
     case OPTION_SUPPORT_OLD_CODE:
       support_old_code = 1;
       break;
+    case OPTION_THUMB_ENTRY:
+      thumb_entry_symbol = optarg;
+      break;
+#ifdef DLL_SUPPORT
     case OPTION_OUT_DEF:
       pe_out_def_filename = xstrdup (optarg);
       break;
@@ -417,9 +443,7 @@
       pe_dll_export_everything = 1;
       break;
     case OPTION_EXCLUDE_SYMBOLS:
-#ifdef TARGET_IS_i386pe
       pe_dll_add_excludes (optarg);
-#endif
       break;
     case OPTION_KILL_ATS:
       pe_dll_kill_ats = 1;
@@ -436,6 +460,7 @@
     case OPTION_IMPLIB_FILENAME:
       pe_implib_filename = xstrdup (optarg);
       break;
+#endif
     }
   return 1;
 }
@@ -517,7 +542,7 @@
      opened, so registering the symbol as undefined will make a
      difference.  */
 
-  if (entry_symbol)
+  if (! link_info.relocateable && entry_symbol != NULL)
     ldlang_add_undef (entry_symbol);
 }
 
@@ -617,7 +642,7 @@
   pe_data (output_bfd)->pe_opthdr = pe;
   pe_data (output_bfd)->dll = init[DLLOFF].value;
 
-#ifdef TARGET_IS_i386pe
+#ifdef DLL_SUPPORT
   if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */
     pe_fixup_stdcalls ();
 
@@ -626,16 +651,89 @@
     pe_dll_build_sections (output_bfd, &link_info);
 #endif
 
-#ifdef TARGET_IS_armpe
+#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe)
+  if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
+    {
+      /* The arm backend needs special fields in the output hash structure.
+	 These will only be created if the output format is an arm format,
+	 hence we do not support linking and changing output formats at the
+	 same time.  Use a link followed by objcopy to change output formats.  */
+      einfo ("%F%X%P: error: cannot change output format whilst linking ARM binaries\n");
+      return;
+    }
   {
     /* Find a BFD that can hold the interworking stubs.  */
     LANG_FOR_EACH_INPUT_STATEMENT (is)
       {
-	if (bfd_arm_get_bfd_for_interworking (is->the_bfd, & link_info))
+	if (bfd_arm_pe_get_bfd_for_interworking (is->the_bfd, & link_info))
 	  break;
       }
   }
 #endif
+
+  {
+    static int sequence = 0;
+    int is_ms_arch;
+    bfd *cur_arch = 0, *elt;
+    lang_input_statement_type *is2;
+    /* Careful - this is a shell script.  Watch those dollar signs! */
+    /* Microsoft import libraries have every member named the same,
+       and not in the right order for us to link them correctly.  We
+       must detect these and rename the members so that they'll link
+       correctly.  There are three types of objects: the head, the
+       thunks, and the sentinel(s).  The head is easy; it's the one
+       with idata2.  We assume that the sentinels won't have relocs,
+       and the thunks will.  It's easier than checking the symbol
+       table for external references. */
+    LANG_FOR_EACH_INPUT_STATEMENT (is)
+      {
+	if (is->the_bfd->my_archive)
+	  {
+	    bfd *arch = is->the_bfd->my_archive;
+	    if (cur_arch != arch)
+	      {
+		cur_arch = arch;
+		is_ms_arch = 1;
+		for (is2 = is;
+		     is2 && is2->the_bfd->my_archive == arch;
+		     is2 = (lang_input_statement_type *)is2->next)
+		  {
+		    if (strcmp (is->the_bfd->filename, is2->the_bfd->filename))
+		      is_ms_arch = 0;
+		  }
+	      }
+
+	    if (is_ms_arch)
+	      {
+		int idata2 = 0, i, reloc_count=0;
+		asection *sec;
+		char *new_name, seq;
+		for (sec = is->the_bfd->sections; sec; sec = sec->next)
+		  {
+		    if (strcmp (sec->name, ".idata\$2") == 0)
+		      idata2 = 1;
+		    reloc_count += sec->reloc_count;
+		  }
+
+		if (idata2) /* .idata2 is the TOC */
+		  seq = 'a';
+		else if (reloc_count > 0) /* thunks */
+		  seq = 'b';
+		else /* sentinel */
+		  seq = 'c';
+
+		new_name = bfd_alloc (is->the_bfd,
+				      strlen (is->the_bfd->filename)+2);
+		sprintf (new_name, "%s.%c", is->the_bfd->filename, seq);
+		is->the_bfd->filename = new_name;
+
+		new_name = bfd_alloc(is->the_bfd, strlen(is->filename)+2);
+		sprintf (new_name, "%s.%c", is->filename, seq);
+		is->filename = new_name;
+	      }
+	  }
+      }
+  }
 }
 
 static void  
@@ -658,7 +756,7 @@
   ppc_allocate_toc_section (&link_info);
 #endif /* TARGET_IS_ppcpe */
 
-#ifdef TARGET_IS_armpe
+#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe)
   /* FIXME: we should be able to set the size of the interworking stub
      section.
 
@@ -668,7 +766,7 @@
   {
     LANG_FOR_EACH_INPUT_STATEMENT (is)
       {
-	if (! bfd_arm_process_before_allocation
+	if (! bfd_arm_pe_process_before_allocation
 	    (is->the_bfd, & link_info, support_old_code))
 	  {
 	    /* xgettext:c-format */
@@ -679,7 +777,7 @@
   }
 
   /* We have seen it all. Allocate it, and carry on */
-  bfd_arm_allocate_interworking_sections (& link_info);
+  bfd_arm_pe_allocate_interworking_sections (& link_info);
 #endif /* TARGET_IS_armpe */
 }
 
@@ -701,7 +799,7 @@
 gld_${EMULATION_NAME}_unrecognized_file(entry)
   lang_input_statement_type *entry;
 {
-#ifdef TARGET_IS_i386pe
+#ifdef DLL_SUPPORT
   const char *ext = entry->filename + strlen (entry->filename) - 4;
 
   if (strcmp (ext, ".def") == 0 || strcmp (ext, ".DEF") == 0)
@@ -786,7 +884,10 @@
 gld_${EMULATION_NAME}_recognized_file(entry)
   lang_input_statement_type *entry;
 {
+#ifdef DLL_SUPPORT
 #ifdef TARGET_IS_i386pe
+  pe_dll_id_target ("pei-i386");
+#endif
   if (bfd_get_format (entry->the_bfd) == bfd_object)
     {
       const char *ext = entry->filename + strlen (entry->filename) - 4;
@@ -800,7 +901,48 @@
 static void
 gld_${EMULATION_NAME}_finish ()
 {
-#ifdef TARGET_IS_i386pe
+#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe)
+  struct bfd_link_hash_entry * h;
+
+  if (thumb_entry_symbol != NULL)
+    {
+      h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, false, false, true);
+      
+      if (h != (struct bfd_link_hash_entry *) NULL
+	  && (h->type == bfd_link_hash_defined
+	      || h->type == bfd_link_hash_defweak)
+	  && h->u.def.section->output_section != NULL)
+	{
+	  static char buffer[32];
+	  bfd_vma val;
+	  
+	  /* Special procesing is required for a Thumb entry symbol.  The
+	     bottom bit of its address must be set.  */
+	  val = (h->u.def.value
+		 + bfd_get_section_vma (output_bfd,
+					h->u.def.section->output_section)
+		 + h->u.def.section->output_offset);
+	  
+	  val |= 1;
+	  
+	  /* Now convert this value into a string and store it in entry_symbol
+	     where the lang_finish() function will pick it up.  */
+	  buffer[0] = '0';
+	  buffer[1] = 'x';
+	  
+	  sprintf_vma (buffer + 2, val);
+	  
+	  if (entry_symbol != NULL && entry_from_cmdline)
+	    einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"),
+		   thumb_entry_symbol, entry_symbol);
+	  entry_symbol = buffer;
+	}
+      else
+	einfo (_("%P: warning: connot find thumb start symbol %s\n"), thumb_entry_symbol);
+    }
+#endif /* defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) */
+
+#ifdef DLL_SUPPORT
   if (link_info.shared)
     {
       pe_dll_fill_sections (output_bfd, &link_info);
diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em
index 8e9599c..61a5c01 100644
--- a/ld/emultempl/sunos.em
+++ b/ld/emultempl/sunos.em
@@ -100,7 +100,8 @@
 {
 EOF
 if [ "x${host}" = "x${target}" ] ; then
-  if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+  case " ${EMULATION_LIBPATH} " in
+  *" ${EMULATION_NAME} "*)
 cat >>e${EMULATION_NAME}.c <<EOF
   const char *env;
 
@@ -125,7 +126,8 @@
 	}
     }
 EOF
-  fi
+  ;;
+  esac
 fi
 cat >>e${EMULATION_NAME}.c <<EOF
 }
@@ -464,7 +466,8 @@
 	}
 EOF
 if [ "x${host}" = "x${target}" ] ; then
-  if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+  case " ${EMULATION_LIBPATH} " in
+  *" ${EMULATION_NAME} "*)
 cat >>e${EMULATION_NAME}.c <<EOF
       {
 	const char *lib_path;
@@ -474,7 +477,8 @@
 	  continue;
       }
 EOF
-  fi
+  ;;
+  esac
 fi
 cat >>e${EMULATION_NAME}.c <<EOF
       if (command_line.rpath != NULL)
diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index eea5401..8294af7 100755
--- a/ld/genscripts.sh
+++ b/ld/genscripts.sh
@@ -14,7 +14,7 @@
 host=$3
 target=$4
 target_alias=$5
-DEFAULT_EMULATION=$6
+EMULATION_LIBPATH=$6
 NATIVE_LIB_DIRS=$7
 EMULATION_NAME=$8
 tool_lib=`echo ${libdir} | sed -e 's|/lib$||'`/${9-$target_alias}/lib
@@ -36,26 +36,24 @@
 # To force a logically empty LIB_PATH, do LIBPATH=":".
 
 if [ "x${LIB_PATH}" = "x" ] ; then
+  # Cross, or native non-default emulation not requesting LIB_PATH.
+  LIB_PATH=
+
   if [ "x${host}" = "x${target}" ] ; then
-    if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
-      # Native.
-      LIB_PATH=/lib:/usr/lib
-      if [ -n "${NATIVE_LIB_DIRS}" ]; then
-	LIB_PATH=${LIB_PATH}:${NATIVE_LIB_DIRS}
-      fi
-      if [ "${libdir}" != /usr/lib ]; then
-	LIB_PATH=${LIB_PATH}:${libdir}
-      fi
-      if [ "${libdir}" != /usr/local/lib ] ; then
-	LIB_PATH=${LIB_PATH}:/usr/local/lib
-      fi
-    else
-      # Native, but not default emulation.
-      LIB_PATH=
-    fi
-  else
-    # Cross.
-    LIB_PATH=
+    case " $EMULATION_LIBPATH " in
+      *" ${EMULATION_NAME} "*)
+        # Native, and default or emulation requesting LIB_PATH.
+        LIB_PATH=/lib:/usr/lib
+        if [ -n "${NATIVE_LIB_DIRS}" ]; then
+	  LIB_PATH=${LIB_PATH}:${NATIVE_LIB_DIRS}
+        fi
+        if [ "${libdir}" != /usr/lib ]; then
+	  LIB_PATH=${LIB_PATH}:${libdir}
+        fi
+        if [ "${libdir}" != /usr/local/lib ] ; then
+	  LIB_PATH=${LIB_PATH}:/usr/local/lib
+        fi
+    esac
   fi
 fi
 
@@ -127,7 +125,9 @@
     ldscripts/${EMULATION_NAME}.xs
 fi
 
-test "$DEFAULT_EMULATION" = "$EMULATION_NAME" && COMPILE_IN=true
+for i in $EMULATION_LIBPATH ; do
+  test "$i" = "$EMULATION_NAME" && COMPILE_IN=true
+done
 
 # Generate e${EMULATION_NAME}.c.
 . ${srcdir}/emultempl/${TEMPLATE_NAME-generic}.em
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 027f196..115f7a2 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -179,18 +179,21 @@
 the library @code{libc.a}, which will come from the standard search
 directories.  (See the discussion of the @samp{-l} option below.)
 
-The command-line options to @code{ld} may be specified in any order, and
-may be repeated at will.  Repeating most options with a different
-argument will either have no further effect, or override prior
+Some of the command-line options to @code{ld} may be specified at any
+point in the command line.  However, options which refer to files, such
+as @samp{-l} or @samp{-T}, cause the file to be read at the point at
+which the option appears in the command line, relative to the object
+files and other file options.  Repeating non-file options with a
+different argument will either have no further effect, or override prior
 occurrences (those further to the left on the command line) of that
 option.  Options which may be meaningfully specified more than once are
 noted in the descriptions below.
 
 @cindex object files
-Non-option arguments are objects files which are to be linked together.
-They may follow, precede, or be mixed in with command-line options,
-except that an object file argument may not be placed between an option
-and its argument.
+Non-option arguments are object files or archives which are to be linked
+together.  They may follow, precede, or be mixed in with command-line
+options, except that an object file argument may not be placed between
+an option and its argument.
 
 Usually the linker is invoked with at least one object file, but you can
 specify other forms of binary input files using @samp{-l}, @samp{-R},
@@ -401,6 +404,14 @@
 environment variable.  The @sc{gnu} linker will ignore the @code{-F}
 option when not creating an ELF shared object.
 
+@cindex finalization function
+@kindex -fini
+@item -fini @var{name}
+When creating an ELF executable or shared object, call NAME when the
+executable or shared object is unloaded, by setting DT_FINI to the
+address of the function.  By default, the linker uses @code{_fini} as
+the function to call.
+
 @kindex -g
 @item -g
 Ignored.  Provided for compatibility with other tools.
@@ -431,6 +442,14 @@
 @item -i
 Perform an incremental link (same as option @samp{-r}).
 
+@cindex initialization function
+@kindex -init
+@item -init @var{name}
+When creating an ELF executable or shared object, call NAME when the
+executable or shared object is loaded, by setting DT_INIT to the address
+of the function.  By default, the linker uses @code{_init} as the
+function to call.
+
 @cindex archive files, from cmd line
 @kindex -l@var{archive}
 @kindex --library=@var{archive}
@@ -754,7 +773,7 @@
 @kindex --check-sections
 @kindex --no-check-sections
 @item --check-sections
-@item --no-check-sections
+@itemx --no-check-sections
 Asks the linker @emph{not} to check section addresses after they have
 been assigned to see if there any overlaps.  Normally the linker will
 perform this check, and if it finds any overlaps it will produce
@@ -1115,7 +1134,7 @@
 @kindex --verbose
 @cindex verbose
 @item --dll-verbose
-@item --verbose
+@itemx --verbose
 Display the version number for @code{ld} and list the linker emulations
 supported.  Display which input files can and cannot be opened.  Display
 the linker script if using a default builtin script.
@@ -3407,6 +3426,39 @@
 @samp{.text} section from @file{file3}.  The notation @samp{= 0x1234}
 specifies what data to write in the gaps (@pxref{Output Section Fill}).
 
+@cindex dot inside sections
+Note: @code{.} actually refers to the byte offset from the start of the
+current containing object.  Normally this is the @code{SECTIONS}
+statement, whoes start address is 0, hence @code{.} can be used as an
+absolute address.  If @code{.} is used inside a section description
+however, it refers to the byte offset from the start of that section,
+not an absolute address.  Thus in a script like this:
+
+@smallexample
+SECTIONS
+@{
+    . = 0x100
+    .text: @{
+      *(.text)
+      . = 0x200
+    @}
+    . = 0x500
+    .data: @{
+      *(.data)
+      . += 0x600
+    @}
+@}
+@end smallexample
+
+The @samp{.text} section will be assigned a starting address of 0x100
+and a size of exactly 0x200 bytes, even if there is not enough data in
+the @samp{.text} input sections to fill this area.  (If there is too
+much data, an error will be produced because this would be an attempt to
+move @code{.} backwards).  The @samp{.data} section will start at 0x500
+and it will have an extra 0x600 bytes worth of space after the end of
+the values from the @samp{.data} input sections and before the end of
+the @samp{.data} output section itself.
+
 @need 2000
 @node Operators
 @subsection Operators
@@ -3876,7 +3928,7 @@
 @section @code{ld}'s support for interworking between ARM and Thumb code
 
 @cindex ARM interworking support
-@cindex --support-old-code
+@kindex --support-old-code
 For the ARM, @code{ld} will generate code stubs to allow functions calls
 betweem ARM and Thumb code.  These stubs only work with code that has
 been compiled and assembled with the @samp{-mthumb-interwork} command
@@ -3888,6 +3940,15 @@
 the linker does not support generating stubs for function calls to
 non-interworking aware Thumb code.
 
+@cindex thumb entry point
+@cindex entry point, thumb
+@kindex --thumb-entry=@var{entry}
+The @samp{--thumb-entry} switch is a duplicate of the generic
+@samp{--entry} switch, in that it sets the program's starting address.  
+But it also sets the bottom bit of the address, so that it can be
+branched to using a BX instruction, and the program will start
+executing in Thumb mode straight away.
+
 @ifclear GENERIC
 @lowersections
 @end ifclear
diff --git a/ld/ldcref.c b/ld/ldcref.c
index 96e0d2d..c75b8e6 100644
--- a/ld/ldcref.c
+++ b/ld/ldcref.c
@@ -1,5 +1,5 @@
 /* ldcref.c -- output a cross reference table
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>
 
 This file is part of GLD, the Gnu Linker.
@@ -151,7 +151,7 @@
      const char *name;
      bfd *abfd;
      asection *section;
-     bfd_vma value;
+     bfd_vma value ATTRIBUTE_UNUSED;
 {
   struct cref_hash_entry *h;
   struct cref_ref *r;
@@ -354,7 +354,7 @@
 static boolean
 check_nocrossref (h, ignore)
      struct cref_hash_entry *h;
-     PTR ignore;
+     PTR ignore ATTRIBUTE_UNUSED;
 {
   struct bfd_link_hash_entry *hl;
   asection *defsec;
diff --git a/ld/ldemul.c b/ld/ldemul.c
index eab0432..85a2894 100644
--- a/ld/ldemul.c
+++ b/ld/ldemul.c
@@ -1,5 +1,6 @@
 /* ldemul.c -- clearing house for ld emulation states
-   Copyright (C) 1991, 92, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
 
 This file is part of GLD, the Gnu Linker.
 
@@ -218,7 +219,7 @@
 /*ARGSUSED*/
 void
 syslib_default(ignore)
-     char  *ignore;
+     char  *ignore ATTRIBUTE_UNUSED;
 {
   info_msg (_("%S SYSLIB ignored\n"));
 }
@@ -226,7 +227,7 @@
 /*ARGSUSED*/
 void
 hll_default(ignore)
-     char  *ignore;
+     char  *ignore ATTRIBUTE_UNUSED;
 {
   info_msg (_("%S HLL ignored\n"));
 }
diff --git a/ld/ldexp.c b/ld/ldexp.c
index 6c9d726..121ed88 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -1,6 +1,7 @@
 /* This module handles expression trees.
-Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
-Written by Steve Chamberlain of Cygnus Support (sac@cygnus.com).
+   Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
+   Written by Steve Chamberlain of Cygnus Support (sac@cygnus.com).
 
 This file is part of GLD, the Gnu Linker.
 
@@ -967,7 +968,7 @@
 bfd_vma
 exp_get_abs_int (tree, def, name, allocation_done)
      etree_type *tree;
-     int def;
+     int def ATTRIBUTE_UNUSED;
      char *name;
      lang_phase_type allocation_done;
 {
diff --git a/ld/ldfile.c b/ld/ldfile.c
index 1dfa31f..6c00cab 100644
--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -111,14 +111,40 @@
 	info_msg (_("attempt to open %s succeeded\n"), attempt);
     }
 
-  if (entry->the_bfd != NULL)
-    return true;
-  else
+  if (entry->the_bfd == NULL)
     {
       if (bfd_get_error () == bfd_error_invalid_target)
 	einfo (_("%F%P: invalid BFD target `%s'\n"), entry->target);
       return false;
     }
+
+  /* If we are searching for this file, see if the architecture is
+     compatible with the output file.  If it isn't, keep searching.
+     If we can't open the file as an object file, stop the search
+     here.  */
+
+  if (entry->search_dirs_flag)
+    {
+      bfd *check;
+
+      if (bfd_check_format (entry->the_bfd, bfd_archive))
+	check = bfd_openr_next_archived_file (entry->the_bfd, NULL);
+      else
+	check = entry->the_bfd;
+
+      if (! bfd_check_format (check, bfd_object))
+	return true;
+      if (bfd_arch_get_compatible (check, output_bfd) == NULL)
+	{
+	  einfo (_("%P: skipping incompatible %s when searching for %s"),
+		 attempt, entry->local_sym_name);
+	  bfd_close (entry->the_bfd);
+	  entry->the_bfd = NULL;
+	  return false;
+	}
+    }
+
+  return true;
 }
 
 /* Search for and open the file specified by ENTRY.  If it is an
diff --git a/ld/ldgram.y b/ld/ldgram.y
index a1f3ed6..002b9fb 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -1,5 +1,5 @@
 /* A YACC grammer to parse a superset of the AT&T linker scripting languaue.
-   Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
 
@@ -132,7 +132,7 @@
 %token ORIGIN FILL
 %token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
 %token ALIGNMOD AT PROVIDE
-%type <token> assign_op atype
+%type <token> assign_op atype attributes_opt
 %type <name>  filename
 %token CHIP LIST SECT ABSOLUTE  LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
 %token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
@@ -610,15 +610,24 @@
 					       "length",
 					       lang_first_phase_enum);
 		}
-	
+	;
 
 attributes_opt:
-		  '(' NAME ')'
-			{
-			lang_set_flags(region, $2);
-			}
-	|
-  
+		/* empty */
+		  { /* dummy action to avoid bison 1.25 error message */ }
+	|	'(' attributes_list ')'
+	;
+
+attributes_list:
+		attributes_string
+	|	attributes_list attributes_string
+	;
+
+attributes_string:
+		NAME
+		  { lang_set_flags (region, $1, 0); }
+	|	'!' NAME
+		  { lang_set_flags (region, $2, 1); }
 	;
 
 startup:
diff --git a/ld/ldlang.c b/ld/ldlang.c
index aa5c681..eab4b5f 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -77,16 +77,9 @@
 static lang_statement_union_type *wild_sort
   PARAMS ((lang_wild_statement_type *, lang_input_statement_type *,
 	   asection *));
-static void wild_section PARAMS ((lang_wild_statement_type *ptr,
-				  const char *section,
-				  lang_input_statement_type *file,
-				  lang_output_section_statement_type *output));
 static lang_input_statement_type *lookup_name PARAMS ((const char *name));
 static void load_symbols PARAMS ((lang_input_statement_type *entry,
 				  lang_statement_list_type *));
-static void wild_file PARAMS ((lang_wild_statement_type *, const char *,
-			       lang_input_statement_type *,
-			       lang_output_section_statement_type *));
 static void wild PARAMS ((lang_wild_statement_type *s,
 			  const char *section, const char *file,
 			  const char *target,
@@ -142,24 +135,34 @@
 static void lang_set_startof PARAMS ((void));
 static void reset_memory_regions PARAMS ((void));
 static void lang_record_phdrs PARAMS ((void));
-static void lang_gc_wild_section
-  PARAMS ((lang_wild_statement_type *, const char *,
-	   lang_input_statement_type *));
-static void lang_gc_wild_file
-  PARAMS ((lang_wild_statement_type *, const char *,
-	   lang_input_statement_type *));
 static void lang_gc_wild
   PARAMS ((lang_wild_statement_type *, const char *, const char *));
 static void lang_gc_sections_1 PARAMS ((lang_statement_union_type *));
 static void lang_gc_sections PARAMS ((void));
 static void lang_do_version_exports_section PARAMS ((void));
 static void lang_check_section_addresses PARAMS ((void));
-					
 
+typedef void (*callback_t) PARAMS ((lang_wild_statement_type *,
+				    asection *, lang_input_statement_type *,
+				    void *));
+static void walk_wild_section
+  PARAMS ((lang_wild_statement_type *, const char *,
+	   lang_input_statement_type *, callback_t, void *));
+static void walk_wild_file
+  PARAMS ((lang_wild_statement_type *, const char *,
+	   lang_input_statement_type *, callback_t, void *));
+
+static int    get_target PARAMS ((const bfd_target *, void *));
+static void   stricpy PARAMS ((char *, char *));
+static void   strcut PARAMS ((char *, char *));
+static int    name_compare PARAMS ((char *, char *));
+static int    closest_target_match PARAMS ((const bfd_target *, void *));
+static char * get_first_input_target PARAMS ((void));
+					
 /* EXPORTS */
 lang_output_section_statement_type *abs_output_section;
 lang_statement_list_type *stat_ptr = &statement_list;
-lang_statement_list_type file_chain = { 0 };
+lang_statement_list_type file_chain = { NULL, NULL };
 const char *entry_symbol = NULL;
 boolean entry_from_cmdline;
 boolean lang_has_input_file = false;
@@ -193,6 +196,138 @@
 }
 
 /*----------------------------------------------------------------------
+  Generic traversal routines for finding matching sections.
+*/
+
+static void
+walk_wild_section (ptr, section, file, callback, data)
+     lang_wild_statement_type *ptr;
+     const char *section;
+     lang_input_statement_type *file;
+     callback_t callback;
+     void *data;
+{
+  /* Don't process sections from files which were excluded. */
+  if (ptr->exclude_filename != NULL)
+    {
+      boolean match;
+
+      if (wildcardp (ptr->exclude_filename))
+         match = fnmatch (ptr->exclude_filename, file->filename, 0) == 0 ? true : false;
+      else
+         match = strcmp (ptr->exclude_filename, file->filename) == 0 ? true : false;
+
+      if (match)
+        return;
+    }
+
+  if (file->just_syms_flag == false)
+    {
+      register asection *s;
+      boolean wildcard;
+
+      if (section == NULL)
+	wildcard = false;
+      else
+	wildcard = wildcardp (section);
+
+      for (s = file->the_bfd->sections; s != NULL; s = s->next)
+	{
+	  boolean match;
+
+	  if (section == NULL)
+	    match = true;
+	  else
+	    {
+	      const char *name;
+
+	      name = bfd_get_section_name (file->the_bfd, s);
+	      if (wildcard)
+		match = fnmatch (section, name, 0) == 0 ? true : false;
+	      else
+		match = strcmp (section, name) == 0 ? true : false;
+	    }
+
+	  if (match)
+	    (*callback) (ptr, s, file, data);
+	}
+    }
+}
+
+/* Handle a wild statement for a single file F.  */
+
+static void
+walk_wild_file (s, section, f, callback, data)
+     lang_wild_statement_type *s;
+     const char *section;
+     lang_input_statement_type *f;
+     callback_t callback;
+     void *data;
+{
+  if (f->the_bfd == NULL
+      || ! bfd_check_format (f->the_bfd, bfd_archive))
+    walk_wild_section (s, section, f, callback, data);
+  else
+    {
+      bfd *member;
+
+      /* This is an archive file.  We must map each member of the
+	 archive separately.  */
+      member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL);
+      while (member != NULL)
+	{
+	  /* When lookup_name is called, it will call the add_symbols
+	     entry point for the archive.  For each element of the
+	     archive which is included, BFD will call ldlang_add_file,
+	     which will set the usrdata field of the member to the
+	     lang_input_statement.  */
+	  if (member->usrdata != NULL)
+	    {
+	      walk_wild_section (s, section,
+				 (lang_input_statement_type *) member->usrdata,
+				 callback, data);
+	    }
+
+	  member = bfd_openr_next_archived_file (f->the_bfd, member);
+	}
+    }
+}
+
+static void
+walk_wild (s, section, file, callback, data)
+     lang_wild_statement_type *s;
+     const char *section;
+     const char *file;
+     callback_t callback;
+     void *data;
+{
+  if (file == (char *) NULL)
+    {
+      /* Perform the iteration over all files in the list.  */
+      LANG_FOR_EACH_INPUT_STATEMENT (f)
+	{
+	  walk_wild_file (s, section, f, callback, data);
+	}
+    }
+  else if (wildcardp (file))
+    {
+      LANG_FOR_EACH_INPUT_STATEMENT (f)
+	{
+	  if (fnmatch (file, f->filename, FNM_FILE_NAME) == 0)
+	    walk_wild_file (s, section, f, callback, data);
+	}
+    }
+  else
+    {
+      lang_input_statement_type *f;
+
+      /* Perform the iteration over a single file.  */
+      f = lookup_name (file);
+      walk_wild_file (s, section, f, callback, data);
+    }
+}  
+     
+/*----------------------------------------------------------------------
   lang_for_each_statement walks the parse tree and calls the provided
   function for each node
 */
@@ -763,6 +898,23 @@
   if ((flags & SEC_LINK_ONCE) == 0)
     return;
 
+  /* FIXME: When doing a relocateable link, we may have trouble
+     copying relocations in other sections that refer to local symbols
+     in the section being discarded.  Those relocations will have to
+     be converted somehow; as of this writing I'm not sure that any of
+     the backends handle that correctly.
+
+     It is tempting to instead not discard link once sections when
+     doing a relocateable link (technically, they should be discarded
+     whenever we are building constructors).  However, that fails,
+     because the linker winds up combining all the link once sections
+     into a single large link once section, which defeats the purpose
+     of having link once sections in the first place.
+
+     Also, not merging link once sections in a relocateable link
+     causes trouble for MIPS ELF, which relies in link once semantics
+     to handle the .reginfo section correctly.  */
+
   name = bfd_get_section_name (abfd, sec);
 
   for (l = sec_link_once_list; l != NULL; l = l->next)
@@ -956,6 +1108,10 @@
 	  break;
 	}
 
+      /* Copy over SEC_SHORT.  */
+      if (section->flags & SEC_SHORT)
+	section->output_section->flags |= SEC_SHORT;
+
       if (section->alignment_power > output->bfd_section->alignment_power)
 	output->bfd_section->alignment_power = section->alignment_power;
 
@@ -1070,104 +1226,53 @@
    NULL, in which case it is a wild card.  */
 
 static void
-wild_section (ptr, section, file, output)
+output_section_callback (ptr, section, file, output)
      lang_wild_statement_type *ptr;
-     const char *section;
+     asection *section;
      lang_input_statement_type *file;
-     lang_output_section_statement_type *output;
+     void *output;
 {
-
-  /* Don't process sections from files which were excluded. */
-  if (ptr->exclude_filename != NULL)
+  lang_statement_union_type *before;
+  
+  /* If the wild pattern was marked KEEP, the member sections
+     should be as well.  */
+  if (ptr->keep_sections)
+    section->flags |= SEC_KEEP;
+  
+  before = wild_sort (ptr, file, section);
+  
+  /* Here BEFORE points to the lang_input_section which
+     should follow the one we are about to add.  If BEFORE
+     is NULL, then the section should just go at the end
+     of the current list.  */
+  
+  if (before == NULL)
+    wild_doit (&ptr->children, section, 
+	       (lang_output_section_statement_type *) output, 
+	       file);
+  else
     {
-      boolean match;
-
-      if (wildcardp (ptr->exclude_filename))
-         match = fnmatch (ptr->exclude_filename, file->filename, 0) == 0 ? true : false;
-      else
-         match = strcmp (ptr->exclude_filename, file->filename) == 0 ? true : false;
-
-      if (match)
-        return;
-    }
-
-  if (file->just_syms_flag == false)
-    {
-      register asection *s;
-      boolean wildcard;
-
-      if (section == NULL)
-	wildcard = false;
-      else
-	wildcard = wildcardp (section);
-
-      for (s = file->the_bfd->sections; s != NULL; s = s->next)
+      lang_statement_list_type list;
+      lang_statement_union_type **pp;
+      
+      lang_list_init (&list);
+      wild_doit (&list, section, 
+		 (lang_output_section_statement_type *) output, 
+		 file);
+      
+      /* If we are discarding the section, LIST.HEAD will
+	 be NULL.  */
+      if (list.head != NULL)
 	{
-	  boolean match;
-
-	  /* Attach all sections named SECTION.  If SECTION is NULL,
-	     then attach all sections.
-
-	     Previously, if SECTION was NULL, this code did not call
-	     wild_doit if the SEC_IS_COMMON flag was set for the
-	     section.  I did not understand that, and I took it out.
-	     --ian@cygnus.com.  */
-
-	  if (section == NULL)
-	    match = true;
-	  else
-	    {
-	      const char *name;
-
-	      name = bfd_get_section_name (file->the_bfd, s);
-	      if (wildcard)
-		match = fnmatch (section, name, 0) == 0 ? true : false;
-	      else
-		match = strcmp (section, name) == 0 ? true : false;
-	    }
-
-	  if (match)
-	    {
-	      lang_statement_union_type *before;
-
-	      /* If the wild pattern was marked KEEP, the member sections
-		 should be as well.  */
-	      if (ptr->keep_sections)
-		s->flags |= SEC_KEEP;
-
-	      before = wild_sort (ptr, file, s);
-
-	      /* Here BEFORE points to the lang_input_section which
-		 should follow the one we are about to add.  If BEFORE
-		 is NULL, then the section should just go at the end
-		 of the current list.  */
-
-	      if (before == NULL)
-		wild_doit (&ptr->children, s, output, file);
-	      else
-		{
-		  lang_statement_list_type list;
-		  lang_statement_union_type **pp;
-
-		  lang_list_init (&list);
-		  wild_doit (&list, s, output, file);
-
-		  /* If we are discarding the section, LIST.HEAD will
-                     be NULL.  */
-		  if (list.head != NULL)
-		    {
-		      ASSERT (list.head->next == NULL);
-
-		      for (pp = &ptr->children.head;
-			   *pp != before;
-			   pp = &(*pp)->next)
-			ASSERT (*pp != NULL);
-
-		      list.head->next = *pp;
-		      *pp = list.head;
-		    }
-		}
-	    }
+	  ASSERT (list.head->next == NULL);
+	  
+	  for (pp = &ptr->children.head;
+	       *pp != before;
+	       pp = &(*pp)->next)
+	    ASSERT (*pp != NULL);
+	  
+	  list.head->next = *pp;
+	  *pp = list.head;
 	}
     }
 }
@@ -1320,43 +1425,7 @@
   entry->loaded = true;
 }
 
-/* Handle a wild statement for a single file F.  */
-
-static void
-wild_file (s, section, f, output)
-     lang_wild_statement_type *s;
-     const char *section;
-     lang_input_statement_type *f;
-     lang_output_section_statement_type *output;
-{
-  if (f->the_bfd == NULL
-      || ! bfd_check_format (f->the_bfd, bfd_archive))
-    wild_section (s, section, f, output);
-  else
-    {
-      bfd *member;
-
-      /* This is an archive file.  We must map each member of the
-	 archive separately.  */
-      member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL);
-      while (member != NULL)
-	{
-	  /* When lookup_name is called, it will call the add_symbols
-	     entry point for the archive.  For each element of the
-	     archive which is included, BFD will call ldlang_add_file,
-	     which will set the usrdata field of the member to the
-	     lang_input_statement.  */
-	  if (member->usrdata != NULL)
-	    {
-	      wild_section (s, section,
-			    (lang_input_statement_type *) member->usrdata,
-			    output);
-	    }
-
-	  member = bfd_openr_next_archived_file (f->the_bfd, member);
-	}
-    }
-}
+     
 
 /* Handle a wild statement.  SECTION or FILE or both may be NULL,
    indicating that it is a wildcard.  Separate lang_input_section
@@ -1368,37 +1437,10 @@
      lang_wild_statement_type *s;
      const char *section;
      const char *file;
-     const char *target;
+     const char *target ATTRIBUTE_UNUSED;
      lang_output_section_statement_type *output;
 {
-  lang_input_statement_type *f;
-
-  if (file == (char *) NULL)
-    {
-      /* Perform the iteration over all files in the list */
-      for (f = (lang_input_statement_type *) file_chain.head;
-	   f != (lang_input_statement_type *) NULL;
-	   f = (lang_input_statement_type *) f->next)
-	{
-	  wild_file (s, section, f, output);
-	}
-    }
-  else if (wildcardp (file))
-    {
-      for (f = (lang_input_statement_type *) file_chain.head;
-	   f != (lang_input_statement_type *) NULL;
-	   f = (lang_input_statement_type *) f->next)
-	{
-	  if (fnmatch (file, f->filename, FNM_FILE_NAME) == 0)
-	    wild_file (s, section, f, output);
-	}
-    }
-  else
-    {
-      /* Perform the iteration over a single file */
-      f = lookup_name (file);
-      wild_file (s, section, f, output);
-    }
+  walk_wild (s, section, file, output_section_callback, (void *) output);
 
   if (section != (char *) NULL
       && strcmp (section, "COMMON") == 0
@@ -1410,29 +1452,234 @@
     }
 }
 
+/* Return true iff target is the sought target.  */
+static int
+get_target (target, data)
+     const bfd_target * target;
+     void * data;
+{
+  const char * sought = (const char *) data;
+  
+  return strcmp (target->name, sought) == 0;
+}
+
+/* Like strcpy() but convert to lower case as well.  */
+static void
+stricpy (dest, src)
+     char * dest;
+     char * src;
+{
+  char c;
+  
+  while ((c = * src ++) != 0)
+    {
+      if (isupper ((unsigned char) c))
+	c = tolower (c);
+
+      * dest ++ = c;
+    }
+
+  * dest = 0;
+}
+
+/* Remove the first occurance of needle (if any) in haystack
+   from haystack.  */
+static void
+strcut (haystack, needle)
+     char * haystack;
+     char * needle;
+{
+  haystack = strstr (haystack, needle);
+  
+  if (haystack)
+    {
+      char * src;
+
+      for (src = haystack + strlen (needle); * src;)
+	* haystack ++ = * src ++;
+      
+      * haystack = 0;
+    }
+}
+
+/* Compare two target format name strings.
+   Return a value indicating how "similar" they are.  */
+static int
+name_compare (first, second)
+     char * first;
+     char * second;
+{
+  char * copy1;
+  char * copy2;
+  int    result;
+  
+  copy1 = xmalloc (strlen (first) + 1);
+  copy2 = xmalloc (strlen (second) + 1);
+
+  /* Convert the names to lower case.  */
+  stricpy (copy1, first);
+  stricpy (copy2, second);
+
+  /* Remove and endian strings from the name.  */
+  strcut (copy1, "big");
+  strcut (copy1, "little");
+  strcut (copy2, "big");
+  strcut (copy2, "little");
+
+  /* Return a value based on how many characters match,
+     starting from the beginning.   If both strings are
+     the same then return 10 * their length.  */
+  for (result = 0; copy1 [result] == copy2 [result]; result ++)
+    if (copy1 [result] == 0)
+      {
+	result *= 10;
+	break;
+      }
+  
+  free (copy1);
+  free (copy2);
+
+  return result;
+}
+
+/* Set by closest_target_match() below.  */
+static const bfd_target * winner;
+
+/* Scan all the valid bfd targets looking for one that has the endianness
+   requirement that was specified on the command line, and is the nearest
+   match to the original output target.  */
+static int
+closest_target_match (target, data)
+     const bfd_target * target;
+     void * data;
+{
+  const bfd_target * original = (const bfd_target *) data;
+  
+  if (command_line.endian == ENDIAN_BIG && target->byteorder != BFD_ENDIAN_BIG)
+    return 0;
+  
+  if (command_line.endian == ENDIAN_LITTLE && target->byteorder != BFD_ENDIAN_LITTLE)
+    return 0;
+
+  /* Must be the same flavour.  */
+  if (target->flavour != original->flavour)
+    return 0;
+
+  /* If we have not found a potential winner yet, then record this one.  */
+  if (winner == NULL)
+    {
+      winner = target;
+      return 0;
+    }
+
+  /* Oh dear, we now have two potential candidates for a successful match.
+     Compare their names and choose the better one. */
+  if (name_compare (target->name, original->name) > name_compare (winner->name, original->name))
+    winner = target;
+
+  /* Keep on searching until wqe have checked them all.  */
+  return 0;
+}
+
+/* Return the BFD target format of the first input file.  */
+static char *
+get_first_input_target ()
+{
+  char * target = NULL;
+
+  LANG_FOR_EACH_INPUT_STATEMENT (s)
+    {
+      if (s->header.type == lang_input_statement_enum
+	  && s->real)
+	{
+	  ldfile_open_file (s);
+	  
+	  if (s->the_bfd != NULL
+	      && bfd_check_format (s->the_bfd, bfd_object))
+	    {
+	      target = bfd_get_target (s->the_bfd);
+	  
+	      if (target != NULL)
+		break;
+	    }
+	}
+    }
+  
+  return target;
+}
+
 /* Open the output file.  */
 
 static bfd *
 open_output (name)
-     const char *name;
+     const char * name;
 {
-  bfd *output;
+  bfd * output;
 
+  /* Has the user told us which output format to use ?  */
   if (output_target == (char *) NULL)
     {
-      if (current_target != (char *) NULL)
+      /* No - has the current target been set to something other than the default ?  */
+      if (current_target != default_target)
 	output_target = current_target;
+
+      /* No - can we determine the format of the first input file ? */
       else
-	output_target = default_target;
+	{
+	  output_target = get_first_input_target ();
+
+	  /* Failed - use the default output target.  */
+	  if (output_target == NULL)
+	    output_target = default_target;
+	}
     }
+  
+  /* Has the user requested a particular endianness on the command line ?  */
+  if (command_line.endian != ENDIAN_UNSET)
+    {
+      const bfd_target * target;
+      int desired_endian;
+
+      /* Get the chosen target.  */
+      target = bfd_search_for_target (get_target, (void *) output_target);
+
+      if (command_line.endian == ENDIAN_BIG)
+	desired_endian = BFD_ENDIAN_BIG;
+      else
+	desired_endian = BFD_ENDIAN_LITTLE;
+      
+      /* See if the target has the wrong endianness.  This should not happen
+	 if the linker script has provided big and little endian alternatives,
+	 but some scrips don't do this.  */
+      if (target->byteorder != desired_endian)
+	{
+	  /* If it does, then see if the target provides
+	     an alternative with the correct endianness.  */
+	  if (target->alternative_target != NULL
+	      && (target->alternative_target->byteorder == desired_endian))
+	    output_target = target->alternative_target->name;
+	  else
+	    {
+	      /* Try to find a target as similar as possible to the default
+		 target, but which has the desired endian characteristic.  */
+	      (void) bfd_search_for_target (closest_target_match, (void *) target);
+	      
+	      /* Oh dear - we could not find any targets that satisfy our requirements.  */
+	      if (winner == NULL)
+		einfo (_("%P: warning: could not find any targets that match endianness requirement\n"));
+	      else
+		output_target = winner->name;
+	    }
+	}
+    }
+      
   output = bfd_openw (name, output_target);
 
   if (output == (bfd *) NULL)
     {
       if (bfd_get_error () == bfd_error_invalid_target)
-	{
-	  einfo (_("%P%F: target %s not found\n"), output_target);
-	}
+	einfo (_("%P%F: target %s not found\n"), output_target);
+
       einfo (_("%P%F: cannot open output file %s: %E\n"), name);
     }
 
@@ -1455,9 +1702,6 @@
   return output;
 }
 
-
-
-
 static void
 ldlang_open_output (statement)
      lang_statement_union_type * statement;
@@ -1534,7 +1778,7 @@
 	  current_target = s->target_statement.target;
 	  break;
 	case lang_input_statement_enum:
-	  if (s->input_statement.real == true)
+	  if (s->input_statement.real)
 	    {
 	      lang_statement_list_type add;
 
@@ -2257,7 +2501,7 @@
      lang_output_section_statement_type * output_section_statement;
      fill_type fill;
      bfd_vma dot;
-     boolean relax;
+     boolean relax ATTRIBUTE_UNUSED;
 {
   lang_input_section_type *is = &((*this_ptr)->input_section);
   asection *i = is->section;
@@ -2988,10 +3232,10 @@
 
 static void
 #ifdef ANSI_PROTOTYPES
-ignore_bfd_errors (const char *s, ...)
+ignore_bfd_errors (const char *s ATTRIBUTE_UNUSED, ...)
 #else
 ignore_bfd_errors (s)
-     const char *s;
+     const char *s ATTRIBUTE_UNUSED;
 #endif
 {
   /* Don't do anything.  */
@@ -3172,11 +3416,7 @@
 static void
 lang_place_orphans ()
 {
-  lang_input_statement_type *file;
-
-  for (file = (lang_input_statement_type *) file_chain.head;
-       file != (lang_input_statement_type *) NULL;
-       file = (lang_input_statement_type *) file->next)
+  LANG_FOR_EACH_INPUT_STATEMENT (file)
     {
       asection *s;
 
@@ -3237,21 +3477,18 @@
 
 
 void
-lang_set_flags (ptr, flags)
+lang_set_flags (ptr, flags, invert)
      lang_memory_region_type *ptr;
      CONST char *flags;
+     int invert;
 {
-  flagword *ptr_flags = &ptr->flags;
+  flagword *ptr_flags;
 
-  ptr->flags = ptr->not_flags = 0;
+  ptr_flags = invert ? &ptr->not_flags : &ptr->flags;
   while (*flags)
     {
       switch (*flags)
 	{
-	case '!':
-	  ptr_flags = (ptr_flags == &ptr->flags) ? &ptr->not_flags : &ptr->flags;
-	  break;
-
 	case 'A': case 'a':
 	  *ptr_flags |= SEC_ALLOC;
 	  break;
@@ -3304,11 +3541,7 @@
 lang_for_each_file (func)
      void (*func) PARAMS ((lang_input_statement_type *));
 {
-  lang_input_statement_type *f;
-
-  for (f = (lang_input_statement_type *) file_chain.head;
-       f != (lang_input_statement_type *) NULL;
-       f = (lang_input_statement_type *) f->next)
+  LANG_FOR_EACH_INPUT_STATEMENT (f)
     {
       func (f);
     }
@@ -3322,13 +3555,9 @@
 lang_for_each_input_section (func)
      void (*func) PARAMS ((bfd * ab, asection * as));
 {
-  lang_input_statement_type *f;
-
-  for (f = (lang_input_statement_type *) file_chain.head;
-       f != (lang_input_statement_type *) NULL;
-       f = (lang_input_statement_type *) f->next)
+  LANG_FOR_EACH_INPUT_STATEMENT (f)
     {
-      asection *s;
+      asection * s;
 
       for (s = f->the_bfd->sections;
 	   s != (asection *) NULL;
@@ -3487,90 +3716,20 @@
     }
 }
 
-/* ??? At some point this traversal for GC should share code with the
-   traversal for manipulating the output file.  */
-
 /* Expand a wild statement for a particular FILE, marking its sections KEEP
    as needed.  SECTION may be NULL, in which case it is a wild card.  */
 
 static void
-lang_gc_wild_section (ptr, section, file)
+gc_section_callback (ptr, section, file, data)
      lang_wild_statement_type *ptr;
-     const char *section;
-     lang_input_statement_type *file;
+     asection *section;
+     lang_input_statement_type *file ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
-  if (file->just_syms_flag == false)
-    {
-      register asection *s;
-      boolean wildcard;
-
-      if (section == NULL)
-	wildcard = false;
-      else
-	wildcard = wildcardp (section);
-
-      for (s = file->the_bfd->sections; s != NULL; s = s->next)
-	{
-	  boolean match;
-
-	  if (section == NULL)
-	    match = true;
-	  else
-	    {
-	      const char *name;
-
-	      name = bfd_get_section_name (file->the_bfd, s);
-	      if (wildcard)
-		match = fnmatch (section, name, 0) == 0 ? true : false;
-	      else
-		match = strcmp (section, name) == 0 ? true : false;
-	    }
-
-	  if (match)
-	    {
-	      /* If the wild pattern was marked KEEP, the member sections
-		 should be as well.  */
-	      if (ptr->keep_sections)
-		s->flags |= SEC_KEEP;
-	    }
-	}
-    }
-}
-
-/* Handle a wild statement for a single file F.  */
-
-static void
-lang_gc_wild_file (s, section, f)
-     lang_wild_statement_type *s;
-     const char *section;
-     lang_input_statement_type *f;
-{
-  if (f->the_bfd == NULL
-      || ! bfd_check_format (f->the_bfd, bfd_archive))
-    lang_gc_wild_section (s, section, f);
-  else
-    {
-      bfd *member;
-
-      /* This is an archive file.  We must map each member of the
-	 archive separately.  */
-      member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL);
-      while (member != NULL)
-	{
-	  /* When lookup_name is called, it will call the add_symbols
-	     entry point for the archive.  For each element of the
-	     archive which is included, BFD will call ldlang_add_file,
-	     which will set the usrdata field of the member to the
-	     lang_input_statement.  */
-	  if (member->usrdata != NULL)
-	    {
-	      lang_gc_wild_section (s, section,
-			    (lang_input_statement_type *) member->usrdata);
-	    }
-
-	  member = bfd_openr_next_archived_file (f->the_bfd, member);
-	}
-    }
+  /* If the wild pattern was marked KEEP, the member sections
+     should be as well.  */
+  if (ptr->keep_sections)
+    section->flags |= SEC_KEEP;
 }
 
 /* Handle a wild statement, marking it against GC.  SECTION or FILE or both
@@ -3582,34 +3741,7 @@
      const char *section;
      const char *file;
 {
-  lang_input_statement_type *f;
-
-  if (file == (char *) NULL)
-    {
-      /* Perform the iteration over all files in the list */
-      for (f = (lang_input_statement_type *) file_chain.head;
-	   f != (lang_input_statement_type *) NULL;
-	   f = (lang_input_statement_type *) f->next)
-	{
-	  lang_gc_wild_file (s, section, f);
-	}
-    }
-  else if (wildcardp (file))
-    {
-      for (f = (lang_input_statement_type *) file_chain.head;
-	   f != (lang_input_statement_type *) NULL;
-	   f = (lang_input_statement_type *) f->next)
-	{
-	  if (fnmatch (file, f->filename, FNM_FILE_NAME) == 0)
-	    lang_gc_wild_file (s, section, f);
-	}
-    }
-  else
-    {
-      /* Perform the iteration over a single file */
-      f = lookup_name (file);
-      lang_gc_wild_file (s, section, f);
-    }
+  walk_wild (s, section, file, gc_section_callback, NULL);
 }
 
 /* Iterate over sections marking them against GC.  */
@@ -3654,14 +3786,17 @@
 
   /* Keep all sections containing symbols undefined on the command-line.
      Handle the entry symbol at the same time.  */
-
-  fake_list_start.next = ldlang_undef_chain_list_head;
-  if (entry_symbol == NULL)
-    fake_list_start.name = "start";
+  
+  if (entry_symbol != NULL)
+    {
+      fake_list_start.next = ldlang_undef_chain_list_head;
+      fake_list_start.name = (char *) entry_symbol;
+      ulist = &fake_list_start;
+    }
   else
-    fake_list_start.name = (char *) entry_symbol;
+    ulist = ldlang_undef_chain_list_head;
 
-  for (ulist = &fake_list_start; ulist; ulist = ulist->next)
+  for (; ulist; ulist = ulist->next)
     {
       h = bfd_link_hash_lookup (link_info.hash, ulist->name, 
 				false, false, false);
diff --git a/ld/ldlang.h b/ld/ldlang.h
index 7bd7972..8c63938 100644
--- a/ld/ldlang.h
+++ b/ld/ldlang.h
@@ -1,5 +1,6 @@
 /* ldlang.h - linker command language support
-   Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    
    This file is part of GLD, the Gnu Linker.
    
@@ -383,7 +384,8 @@
 extern struct memory_region_struct *lang_memory_region_default
   PARAMS ((asection *));
 extern void lang_map PARAMS ((void));
-extern void lang_set_flags PARAMS ((lang_memory_region_type *, const char *));
+extern void lang_set_flags PARAMS ((lang_memory_region_type *, const char *,
+				    int));
 extern void lang_add_output PARAMS ((const char *, int from_script));
 extern void lang_enter_output_section_statement
   PARAMS ((const char *output_section_statement_name,
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 1e710db..734bc32 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -231,7 +231,11 @@
   link_info.notice_hash = NULL;
   link_info.wrap_hash = NULL;
   link_info.mpc860c0 = 0;
-  
+  /* SVR4 linkers seem to set DT_INIT and DT_FINI based on magic _init
+     and _fini symbols.  We are compatible.  */
+  link_info.init_function = "_init";
+  link_info.fini_function = "_fini";
+
   ldfile_add_arch ("");
 
   config.make_executable = true;
@@ -701,7 +705,7 @@
 /*ARGSUSED*/
 static boolean
 add_archive_element (info, abfd, name)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      bfd *abfd;
      const char *name;
 {
@@ -816,7 +820,7 @@
 /*ARGSUSED*/
 static boolean
 multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      const char *name;
      bfd *obfd;
      asection *osec;
@@ -853,7 +857,7 @@
 /*ARGSUSED*/
 static boolean
 multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      const char *name;
      bfd *obfd;
      enum bfd_link_hash_type otype;
@@ -920,7 +924,7 @@
 /*ARGSUSED*/
 static boolean
 add_to_set (info, h, reloc, abfd, section, value)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      struct bfd_link_hash_entry *h;
      bfd_reloc_code_real_type reloc;
      bfd *abfd;
@@ -1019,7 +1023,7 @@
 /*ARGSUSED*/
 static boolean
 warning_callback (info, warning, symbol, abfd, section, address)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      const char *warning;
      const char *symbol;
      bfd *abfd;
@@ -1141,7 +1145,7 @@
 /*ARGSUSED*/
 static boolean
 undefined_symbol (info, name, abfd, section, address)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      const char *name;
      bfd *abfd;
      asection *section;
@@ -1213,7 +1217,7 @@
 /*ARGSUSED*/
 static boolean
 reloc_overflow (info, name, reloc_name, addend, abfd, section, address)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      const char *name;
      const char *reloc_name;
      bfd_vma addend;
@@ -1237,7 +1241,7 @@
 /*ARGSUSED*/
 static boolean
 reloc_dangerous (info, message, abfd, section, address)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      const char *message;
      bfd *abfd;
      asection *section;
@@ -1257,7 +1261,7 @@
 /*ARGSUSED*/
 static boolean
 unattached_reloc (info, name, abfd, section, address)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      const char *name;
      bfd *abfd;
      asection *section;
diff --git a/ld/lexsup.c b/ld/lexsup.c
index 7ee5087..8f4785b 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -120,6 +120,8 @@
 #define OPTION_NO_CHECK_SECTIONS	(OPTION_CHECK_SECTIONS + 1)
 #define OPTION_MPC860C0                 (OPTION_NO_CHECK_SECTIONS + 1)
 #define OPTION_NO_UNDEFINED		(OPTION_MPC860C0 + 1)
+#define OPTION_INIT                     (OPTION_NO_UNDEFINED + 1)
+#define OPTION_FINI                     (OPTION_INIT + 1)
 
 /* The long options.  This structure is used for both the option
    parsing and the help text.  */
@@ -270,6 +272,8 @@
       '\0', N_("PROGRAM"), N_("Set the dynamic linker to use"), TWO_DASHES },
   { {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS},
       '\0', NULL, N_("Generate embedded relocs"), TWO_DASHES},
+  { {"fini", required_argument, NULL, OPTION_FINI},
+     '\0', N_("SYMBOL"), N_("Call SYMBOL at unload-time"), ONE_DASH },
   { {"force-exe-suffix", no_argument, NULL, OPTION_FORCE_EXE_SUFFIX},
       '\0', NULL, N_("Force generation of file with .exe suffix"), TWO_DASHES},
   { {"gc-sections", no_argument, NULL, OPTION_GC_SECTIONS},
@@ -280,6 +284,8 @@
       TWO_DASHES },
   { {"help", no_argument, NULL, OPTION_HELP},
       '\0', NULL, N_("Print option help"), TWO_DASHES },
+  { {"init", required_argument, NULL, OPTION_INIT},
+     '\0', N_("SYMBOL"), N_("Call SYMBOL at load-time"), ONE_DASH },
   { {"Map", required_argument, NULL, OPTION_MAP},
       '\0', N_("FILE"), N_("Write a map file"), ONE_DASH },
   { {"no-demangle", no_argument, NULL, OPTION_NO_DEMANGLE },
@@ -341,7 +347,7 @@
       '\0', N_("FILE"), N_("Read version information script"), TWO_DASHES },
   { {"version-exports-section", required_argument, NULL,
      OPTION_VERSION_EXPORTS_SECTION },
-    '\0', N_("SYMBOL"), N_("Take export symbols list from .exports, using SYMBOL as the version."),
+    '\0', N_("SYMBOL"), N_("Take export symbols list from .exports, using\n\t\t\t\tSYMBOL as the version."),
     TWO_DASHES },
   { {"warn-common", no_argument, NULL, OPTION_WARN_COMMON},
       '\0', NULL, N_("Warn about duplicate common symbols"), TWO_DASHES },
@@ -360,7 +366,7 @@
   { {"wrap", required_argument, NULL, OPTION_WRAP},
       '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
   { {"mpc860c0", optional_argument, NULL, OPTION_MPC860C0},
-      '\0', N_("[=WORDS]"), N_("Modify problematic branches in last WORDS (1-10, default 5) words of a page"), TWO_DASHES }
+      '\0', N_("[=WORDS]"), N_("Modify problematic branches in last WORDS (1-10,\n\t\t\t\tdefault 5) words of a page"), TWO_DASHES }
 };
 
 #define OPTION_COUNT ((int) (sizeof ld_options / sizeof ld_options[0]))
@@ -988,6 +994,14 @@
             }
           command_line.relax = true;
           break;
+
+	case OPTION_INIT:
+	  link_info.init_function = optarg;
+	  break;
+	  
+	case OPTION_FINI:
+	  link_info.fini_function = optarg;
+	  break;
 	}
     }
 
@@ -1118,6 +1132,8 @@
 	}
     }
 
+  /* Note: Various tools (such as libtool) depend upon the
+     format of the listings below - do not change them.  */
   /* xgettext:c-format */
   printf (_("%s: supported targets:"), program_name);
   targets = bfd_target_list ();
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 6d7306c..1752d66 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -73,6 +73,48 @@
 static unsigned char *edata_d, *reloc_d;
 static int edata_sz, reloc_sz;
 
+typedef struct {
+  char *target_name;
+  char *object_target;
+  int imagebase_reloc;
+  int pe_arch;
+  int bfd_arch;
+  int underscored;
+} pe_details_type;
+
+#define PE_ARCH_i386	1
+
+static pe_details_type pe_detail_list[] = {
+  {
+    "pei-i386",
+    "pe-i386",
+    7 /* R_IMAGEBASE */,
+    PE_ARCH_i386,
+    bfd_arch_i386,
+    1
+  },
+  { 0 }
+};
+
+static pe_details_type *pe_details;
+
+#define U(str) (pe_details->underscored ? "_" str : str)
+
+void
+pe_dll_id_target (target)
+     char *target;
+{
+  int i;
+  for (i=0; pe_detail_list[i].target_name; i++)
+    if (strcmp (pe_detail_list[i].target_name, target) == 0)
+      {
+	pe_details = pe_detail_list+i;
+	return;
+      }
+  einfo (_("%XUnsupported PEI architecture: %s\n"), target);
+  exit (1);
+}
+
 /************************************************************************
 
  Helper functions for qsort.  Relocs must be sorted so that we can write
@@ -80,13 +122,19 @@
 
  ************************************************************************/
 
+typedef struct {
+  bfd_vma vma;
+  char type;
+  short extra;
+} reloc_data_type;
+
 static int
 reloc_sort (va, vb)
      const void *va, *vb;
 {
-  bfd_vma a = *(bfd_vma *) va;
-  bfd_vma b = *(bfd_vma *) vb;
-  return (a > b) - (a < b);
+  bfd_vma a = ((reloc_data_type *) va)->vma;
+  bfd_vma b = ((reloc_data_type *) vb)->vma;
+  return (a > b) ? 1 : ((a < b) ? -1 : 0);
 }
 
 static int
@@ -323,8 +371,13 @@
   for (i = 0; i < NE; i++)
     {
       char *name = (char *) xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
-      *name = '_';
-      strcpy (name + 1, pe_def_file->exports[i].internal_name);
+      if (pe_details->underscored)
+	{
+	  *name = '_';
+	  strcpy (name + 1, pe_def_file->exports[i].internal_name);
+	}
+      else
+	strcpy (name, pe_def_file->exports[i].internal_name);
 
       blhe = bfd_link_hash_lookup (info->hash,
 				   name,
@@ -376,7 +429,8 @@
  ************************************************************************/
 
 static void
-build_filler_bfd ()
+build_filler_bfd (include_edata)
+     int include_edata;
 {
   lang_input_statement_type *filler_file;
   filler_file = lang_add_input_file ("dll stuff",
@@ -392,19 +446,22 @@
       return;
     }
 
-  edata_s = bfd_make_section_old_way (filler_bfd, ".edata");
-  if (edata_s == NULL
-      || !bfd_set_section_flags (filler_bfd, edata_s,
-				 (SEC_HAS_CONTENTS
-				  | SEC_ALLOC
-				  | SEC_LOAD
-				  | SEC_KEEP
-				  | SEC_IN_MEMORY)))
+  if (include_edata)
     {
-      einfo ("%X%P: can not create .edata section: %E\n");
-      return;
+      edata_s = bfd_make_section_old_way (filler_bfd, ".edata");
+      if (edata_s == NULL
+	  || !bfd_set_section_flags (filler_bfd, edata_s,
+				     (SEC_HAS_CONTENTS
+				      | SEC_ALLOC
+				      | SEC_LOAD
+				      | SEC_KEEP
+				      | SEC_IN_MEMORY)))
+	{
+	  einfo ("%X%P: can not create .edata section: %E\n");
+	  return;
+	}
+      bfd_set_section_size (filler_bfd, edata_s, edata_sz);
     }
-  bfd_set_section_size (filler_bfd, edata_s, edata_sz);
 
   reloc_s = bfd_make_section_old_way (filler_bfd, ".reloc");
   if (reloc_s == NULL
@@ -598,7 +655,7 @@
 {
 
   /* for .reloc stuff */
-  bfd_vma *reloc_addresses;
+  reloc_data_type *reloc_data;
   int total_relocs = 0;
   int i;
   unsigned long sec_page = (unsigned long) (-1);
@@ -612,7 +669,7 @@
     for (s = b->sections; s; s = s->next)
       total_relocs += s->reloc_count;
 
-  reloc_addresses = (bfd_vma *) xmalloc (total_relocs * sizeof (bfd_vma));
+  reloc_data = (reloc_data_type *) xmalloc (total_relocs * sizeof (reloc_data_type));
 
   total_relocs = 0;
   bi = 0;
@@ -656,12 +713,22 @@
 	  for (i = 0; i < nrelocs; i++)
 	    {
 	      if (!relocs[i]->howto->pc_relative
-		  && relocs[i]->howto->type != R_IMAGEBASE)
+		  && relocs[i]->howto->type != pe_details->imagebase_reloc)
 		{
-		  switch (relocs[i]->howto->bitsize)
+		  bfd_vma sym_vma;
+		  struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr;
+		  sym_vma = (relocs[i]->addend
+			     + sym->value
+			     + sym->section->vma
+			     + sym->section->output_offset
+			     + sym->section->output_section->vma);
+		  reloc_data[total_relocs].vma = sec_vma + relocs[i]->address;
+		  switch (relocs[i]->howto->bitsize*1000
+			  + relocs[i]->howto->rightshift)
 		    {
-		    case 32:
-		      reloc_addresses[total_relocs++] = sec_vma + relocs[i]->address;
+		    case 32000:
+		      reloc_data[total_relocs].type = 3;
+		      total_relocs++;
 		      break;
 		    default:
 		      /* xgettext:c-format */
@@ -682,11 +749,11 @@
      reloc_addresses, which are all suitable for the .reloc section.
      We must now create the new sections. */
 
-  qsort (reloc_addresses, total_relocs, sizeof (bfd_vma), reloc_sort);
+  qsort (reloc_data, total_relocs, sizeof (*reloc_data), reloc_sort);
 
   for (i = 0; i < total_relocs; i++)
     {
-      unsigned long this_page = (reloc_addresses[i] >> 12);
+      unsigned long this_page = (reloc_data[i].vma >> 12);
       if (this_page != sec_page)
 	{
 	  reloc_sz = (reloc_sz + 3) & ~3;	/* 4-byte align */
@@ -705,7 +772,7 @@
   page_count = 0;
   for (i = 0; i < total_relocs; i++)
     {
-      unsigned long rva = reloc_addresses[i] - image_base;
+      unsigned long rva = reloc_data[i].vma - image_base;
       unsigned long this_page = (rva & ~0xfff);
       if (this_page != sec_page)
 	{
@@ -719,8 +786,14 @@
 	  sec_page = this_page;
 	  page_count = 0;
 	}
-      bfd_put_16 (abfd, (rva & 0xfff) + 0x3000, reloc_d + reloc_sz);
+      bfd_put_16 (abfd, (rva & 0xfff) + (reloc_data[i].type<<12),
+		  reloc_d + reloc_sz);
       reloc_sz += 2;
+      if (reloc_data[i].type == 4)
+	{
+	  bfd_put_16 (abfd, reloc_data[i].extra, reloc_d + reloc_sz);
+	  reloc_sz += 2;
+	}
       page_count++;
     }
   while (reloc_sz & 3)
@@ -1049,19 +1122,25 @@
   tmp_seq++;
 
   abfd = bfd_create (oname, parent);
-  bfd_find_target ("pe-i386", abfd);
+  bfd_find_target (pe_details->object_target, abfd);
   bfd_make_writable (abfd);
 
   bfd_set_format (abfd, bfd_object);
-  bfd_set_arch_mach (abfd, bfd_arch_i386, 0);
+  bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
 
   symptr = 0;
   symtab = (asymbol **) xmalloc (6 * sizeof (asymbol *));
   id2 = quick_section (abfd, ".idata$2", SEC_HAS_CONTENTS, 2);
   id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
   id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
-  quick_symbol (abfd, "__head_", dll_symname, "", id2, BSF_GLOBAL, 0);
-  quick_symbol (abfd, "_", dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
+  quick_symbol (abfd, U("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0);
+  quick_symbol (abfd, U(""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
+
+  /* OK, pay attention here.  I got confused myself looking back at
+     it.  We create a four-byte section to mark the beginning of the
+     list, and we include an offset of 4 in the section, so that the
+     pointer to the list points to the *end* of this section, which is
+     the start of the list of sections from other objects. */
 
   bfd_set_section_size (abfd, id2, 20);
   d2 = (unsigned char *) xmalloc (20);
@@ -1119,18 +1198,18 @@
   tmp_seq++;
 
   abfd = bfd_create (oname, parent);
-  bfd_find_target ("pe-i386", abfd);
+  bfd_find_target (pe_details->object_target, abfd);
   bfd_make_writable (abfd);
 
   bfd_set_format (abfd, bfd_object);
-  bfd_set_arch_mach (abfd, bfd_arch_i386, 0);
+  bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
 
   symptr = 0;
   symtab = (asymbol **) xmalloc (5 * sizeof (asymbol *));
   id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
   id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
   id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2);
-  quick_symbol (abfd, "_", dll_symname, "_iname", id7, BSF_GLOBAL, 0);
+  quick_symbol (abfd, U(""), dll_symname, "_iname", id7, BSF_GLOBAL, 0);
 
   bfd_set_section_size (abfd, id4, 4);
   d4 = (unsigned char *) xmalloc (4);
@@ -1198,17 +1277,27 @@
   int len;
   char *oname;
   bfd *abfd;
+  unsigned char *jmp_bytes;
+  int jmp_byte_count;
+
+  switch (pe_details->pe_arch)
+    {
+    case PE_ARCH_i386:
+      jmp_bytes = jmp_ix86_bytes;
+      jmp_byte_count = sizeof (jmp_ix86_bytes);
+      break;
+    }
 
   oname = (char *) xmalloc (20);
   sprintf (oname, "d%06d.o", tmp_seq);
   tmp_seq++;
 
   abfd = bfd_create (oname, parent);
-  bfd_find_target ("pe-i386", abfd);
+  bfd_find_target (pe_details->object_target, abfd);
   bfd_make_writable (abfd);
 
   bfd_set_format (abfd, bfd_object);
-  bfd_set_arch_mach (abfd, bfd_arch_i386, 0);
+  bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
 
   symptr = 0;
   symtab = (asymbol **) xmalloc (10 * sizeof (asymbol *));
@@ -1217,16 +1306,21 @@
   id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
   id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
   id6 = quick_section (abfd, ".idata$6", SEC_HAS_CONTENTS, 2);
-  quick_symbol (abfd, "_", exp->internal_name, "", tx, BSF_GLOBAL, 0);
-  quick_symbol (abfd, "__head_", dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
-  quick_symbol (abfd, "___imp_", exp->internal_name, "", id5, BSF_GLOBAL, 0);
-  quick_symbol (abfd, "__imp__", exp->internal_name, "", id5, BSF_GLOBAL, 0);
+  quick_symbol (abfd, U(""), exp->internal_name, "", tx, BSF_GLOBAL, 0);
+  quick_symbol (abfd, U("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
+  quick_symbol (abfd, U("__imp_"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
+  quick_symbol (abfd, U("_imp__"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
 
-  bfd_set_section_size (abfd, tx, 8);
-  td = (unsigned char *) xmalloc (8);
+  bfd_set_section_size (abfd, tx, jmp_byte_count);
+  td = (unsigned char *) xmalloc (jmp_byte_count);
   tx->contents = td;
-  memcpy (td, jmp_ix86_bytes, 8);
-  quick_reloc (abfd, 2, BFD_RELOC_32, 2);
+  memcpy (td, jmp_bytes, jmp_byte_count);
+  switch (pe_details->pe_arch)
+    {
+    case PE_ARCH_i386:
+      quick_reloc (abfd, 2, BFD_RELOC_32, 2);
+      break;
+    }
   save_relocs (tx);
 
   bfd_set_section_size (abfd, id7, 4);
@@ -1289,7 +1383,7 @@
 
   bfd_set_symtab (abfd, symtab, symptr);
 
-  bfd_set_section_contents (abfd, tx, td, 0, 4);
+  bfd_set_section_contents (abfd, tx, td, 0, jmp_byte_count);
   bfd_set_section_contents (abfd, id7, d7, 0, 4);
   bfd_set_section_contents (abfd, id5, d5, 0, 4);
   bfd_set_section_contents (abfd, id4, d4, 0, 4);
@@ -1344,10 +1438,6 @@
   /* Work out a reasonable size of things to put onto one line. */
 
   ar_head = make_head (outarch);
-  ar_tail = make_tail (outarch);
-
-  if (ar_head == NULL || ar_tail == NULL)
-    return;
 
   for (i = 0; i<def->num_exports; i++)
     {
@@ -1361,6 +1451,11 @@
       def->exports[i].internal_name = internal;
     }
 
+  ar_tail = make_tail (outarch);
+
+  if (ar_head == NULL || ar_tail == NULL)
+    return;
+
   /* Now stick them all into the archive */
 
   ar_head->next = head;
@@ -1403,6 +1498,7 @@
      struct bfd_link_info *link_info;
 {
   def_file_module *module;
+  pe_dll_id_target(bfd_get_target (output_bfd));
 
   if (!pe_def_file)
     return;
@@ -1427,7 +1523,7 @@
 
 	    /* see if we need this import */
 	    char *name = (char *) xmalloc (strlen (pe_def_file->imports[i].internal_name) + 2);
-	    sprintf (name, "_%s", pe_def_file->imports[i].internal_name);
+	    sprintf (name, "%s%s", U(""), pe_def_file->imports[i].internal_name);
 	    blhe = bfd_link_hash_lookup (link_info->hash, name,
 					 false, false, false);
 	    free (name);
@@ -1527,7 +1623,7 @@
   /* No, I can't use bfd here.  kernel32.dll puts its export table in
      the middle of the .rdata section. */
 
-  dll = bfd_openr (filename, "pei-i386");
+  dll = bfd_openr (filename, pe_details->target_name);
   if (!dll)
     {
       einfo ("%Xopen %s: %s\n", filename, bfd_errmsg (bfd_get_error ()));
@@ -1611,10 +1707,20 @@
      bfd *abfd;
      struct bfd_link_info *info;
 {
+  pe_dll_id_target (bfd_get_target (abfd));
   process_def_file (abfd, info);
 
   generate_edata (abfd, info);
-  build_filler_bfd ();
+  build_filler_bfd (1);
+}
+
+void
+pe_exe_build_sections (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  pe_dll_id_target (bfd_get_target (abfd));
+  build_filler_bfd (0);
 }
 
 void
@@ -1622,6 +1728,7 @@
      bfd *abfd;
      struct bfd_link_info *info;
 {
+  pe_dll_id_target (bfd_get_target (abfd));
   image_base = pe_data (abfd)->pe_opthdr.ImageBase;
 
   generate_reloc (abfd, info);
@@ -1649,3 +1756,31 @@
   edata_s->contents = edata_d;
   reloc_s->contents = reloc_d;
 }
+
+void
+pe_exe_fill_sections (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  pe_dll_id_target (bfd_get_target (abfd));
+  image_base = pe_data (abfd)->pe_opthdr.ImageBase;
+
+  generate_reloc (abfd, info);
+  if (reloc_sz > 0)
+    {
+      bfd_set_section_size (filler_bfd, reloc_s, reloc_sz);
+
+      /* Resize the sections.  */
+      lang_size_sections (stat_ptr->head, abs_output_section,
+			  &stat_ptr->head, 0, (bfd_vma) 0, false);
+
+      /* Redo special stuff.  */
+      ldemul_after_allocation ();
+
+      /* Do the assignments again.  */
+      lang_do_assignments (stat_ptr->head,
+			   abs_output_section,
+			   (fill_type) 0, (bfd_vma) 0);
+    }
+  reloc_s->contents = reloc_d;
+}
diff --git a/ld/po/POTFILES.in b/ld/po/POTFILES.in
index 468a8a6..fea0c8e 100644
--- a/ld/po/POTFILES.in
+++ b/ld/po/POTFILES.in
@@ -1,4 +1,6 @@
 deffile.h
+emultempl/armcoff.em
+emultempl/pe.em
 ld.h
 ldcref.c
 ldctor.c
@@ -21,44 +23,6 @@
 ldwrite.c
 ldwrite.h
 lexsup.c
-mpw-elfmips.c
-mpw-eppcmac.c
-mpw-esh.c
-mpw-idtmips.c
 mri.c
 mri.h
 pe-dll.c
-sysdep.h
-testsuite/ld-cdtest/cdtest-foo.h
-testsuite/ld-elfvers/vers1.c
-testsuite/ld-elfvers/vers15.c
-testsuite/ld-elfvers/vers16.c
-testsuite/ld-elfvers/vers16a.c
-testsuite/ld-elfvers/vers2.c
-testsuite/ld-elfvers/vers3.c
-testsuite/ld-elfvers/vers4.c
-testsuite/ld-elfvers/vers5.c
-testsuite/ld-elfvers/vers6.c
-testsuite/ld-elfvers/vers7.c
-testsuite/ld-elfvers/vers7a.c
-testsuite/ld-elfvers/vers8.c
-testsuite/ld-elfvers/vers9.c
-testsuite/ld-empic/relax1.c
-testsuite/ld-empic/relax2.c
-testsuite/ld-empic/relax3.c
-testsuite/ld-empic/relax4.c
-testsuite/ld-empic/run.c
-testsuite/ld-empic/runtest1.c
-testsuite/ld-empic/runtest2.c
-testsuite/ld-scripts/cross1.c
-testsuite/ld-scripts/cross2.c
-testsuite/ld-scripts/cross3.c
-testsuite/ld-selective/1.c
-testsuite/ld-selective/2.c
-testsuite/ld-sh/sh2.c
-testsuite/ld-shared/main.c
-testsuite/ld-shared/sh1.c
-testsuite/ld-shared/sh2.c
-testsuite/ld-srec/sr1.c
-testsuite/ld-srec/sr2.c
-testsuite/ld-undefined/undefined.c
diff --git a/ld/po/ld.pot b/ld/po/ld.pot
index faaaeb0..43034ce 100644
--- a/ld/po/ld.pot
+++ b/ld/po/ld.pot
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-02-11 21:00+0000\n"
+"POT-Creation-Date: 1999-06-03 03:11-0700\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -23,169 +23,169 @@
 msgid "Errors encountered processing file %s"
 msgstr ""
 
-#: emultempl/pe.em:190
+#: emultempl/pe.em:198
 msgid ""
 "  --base_file <basefile>             Generate a base file for relocatable "
 "DLLs\n"
 msgstr ""
 
-#: emultempl/pe.em:191
+#: emultempl/pe.em:199
 msgid ""
 "  --dll                              Set image base to the default for DLLs\n"
 msgstr ""
 
-#: emultempl/pe.em:192
+#: emultempl/pe.em:200
 msgid "  --file-alignment <size>            Set file alignment\n"
 msgstr ""
 
-#: emultempl/pe.em:193
+#: emultempl/pe.em:201
 msgid "  --heap <size>                      Set initial size of the heap\n"
 msgstr ""
 
-#: emultempl/pe.em:194
+#: emultempl/pe.em:202
 msgid ""
 "  --image-base <address>             Set start address of the executable\n"
 msgstr ""
 
-#: emultempl/pe.em:195
+#: emultempl/pe.em:203
 msgid ""
 "  --major-image-version <number>     Set version number of the executable\n"
 msgstr ""
 
-#: emultempl/pe.em:196
+#: emultempl/pe.em:204
 msgid "  --major-os-version <number>        Set minimum required OS version\n"
 msgstr ""
 
-#: emultempl/pe.em:197
+#: emultempl/pe.em:205
 msgid ""
 "  --major-subsystem-version <number> Set minimum required OS subsystem "
 "version\n"
 msgstr ""
 
-#: emultempl/pe.em:198
+#: emultempl/pe.em:206
 msgid ""
 "  --minor-image-version <number>     Set revision number of the executable\n"
 msgstr ""
 
-#: emultempl/pe.em:199
+#: emultempl/pe.em:207
 msgid "  --minor-os-version <number>        Set minimum required OS revision\n"
 msgstr ""
 
-#: emultempl/pe.em:200
+#: emultempl/pe.em:208
 msgid ""
 "  --minor-subsystem-version <number> Set minimum required OS subsystem "
 "revision\n"
 msgstr ""
 
-#: emultempl/pe.em:201
+#: emultempl/pe.em:209
 msgid "  --section-alignment <size>         Set section alignment\n"
 msgstr ""
 
-#: emultempl/pe.em:202
+#: emultempl/pe.em:210
 msgid "  --stack <size>                     Set size of the initial stack\n"
 msgstr ""
 
-#: emultempl/pe.em:203
+#: emultempl/pe.em:211
 msgid ""
 "  --subsystem <name>[:<version>]     Set required OS subsystem [& version]\n"
 msgstr ""
 
-#: emultempl/pe.em:204
+#: emultempl/pe.em:212
 msgid ""
 "  --support-old-code                 Support interworking with old code\n"
 msgstr ""
 
-#: emultempl/pe.em:206
+#: emultempl/pe.em:214
 msgid ""
 "  --add-stdcall-alias                Export symbols with and without @nn\n"
 msgstr ""
 
-#: emultempl/pe.em:207
+#: emultempl/pe.em:215
 msgid "  --disable-stdcall-fixup            Don't link _sym to _sym@nn\n"
 msgstr ""
 
-#: emultempl/pe.em:208
+#: emultempl/pe.em:216
 msgid ""
 "  --enable-stdcall-fixup             Link _sym to _sym@nn without warnings\n"
 msgstr ""
 
-#: emultempl/pe.em:209
+#: emultempl/pe.em:217
 msgid ""
 "  --exclude-symbols sym,sym,...      Exclude symbols from automatic export\n"
 msgstr ""
 
-#: emultempl/pe.em:210
+#: emultempl/pe.em:218
 msgid ""
 "  --export-all-symbols               Automatically export all globals to "
 "DLL\n"
 msgstr ""
 
-#: emultempl/pe.em:211
+#: emultempl/pe.em:219
 msgid "  --kill-at                          Remove @nn from exported symbols\n"
 msgstr ""
 
-#: emultempl/pe.em:212
+#: emultempl/pe.em:220
 msgid "  --out-implib <file>                Generate import library\n"
 msgstr ""
 
-#: emultempl/pe.em:213
+#: emultempl/pe.em:221
 msgid ""
 "  --output-def <file>                Generate a .DEF file for the built DLL\n"
 msgstr ""
 
-#: emultempl/pe.em:276
+#: emultempl/pe.em:284
 msgid "%P: warning: bad version number in -subsystem option\n"
 msgstr ""
 
-#: emultempl/pe.em:292
+#: emultempl/pe.em:300
 msgid "%P%F: invalid subsystem type %s\n"
 msgstr ""
 
-#: emultempl/pe.em:307
+#: emultempl/pe.em:315
 msgid "%P%F: invalid hex number for PE parameter '%s'\n"
 msgstr ""
 
-#: emultempl/pe.em:325
+#: emultempl/pe.em:333
 msgid "%P%F: strange hex info for PE parameter '%s'\n"
 msgstr ""
 
-#: emultempl/pe.em:364
+#: emultempl/pe.em:372
 #, c-format
 msgid "%s: Can't open base file %s\n"
 msgstr ""
 
-#: emultempl/pe.em:497
+#: emultempl/pe.em:505
 msgid "%P: warning, file alignment > section alignment.\n"
 msgstr ""
 
-#: emultempl/pe.em:567 emultempl/pe.em:593
+#: emultempl/pe.em:575 emultempl/pe.em:601
 #, c-format
 msgid "Warning: resolving %s by linking to %s\n"
 msgstr ""
 
-#: emultempl/pe.em:572 emultempl/pe.em:598
+#: emultempl/pe.em:580 emultempl/pe.em:606
 msgid "Use --enable-stdcall-fixup to disable these warnings\n"
 msgstr ""
 
-#: emultempl/pe.em:573 emultempl/pe.em:599
+#: emultempl/pe.em:581 emultempl/pe.em:607
 msgid "Use --disable-stdcall-fixup to disable these fixups\n"
 msgstr ""
 
-#: emultempl/pe.em:615
+#: emultempl/pe.em:623
 msgid "%F%P: PE operations on non PE file.\n"
 msgstr ""
 
-#: emultempl/pe.em:652
+#: emultempl/pe.em:724
 #, c-format
 msgid "Errors encountered processing file %s\n"
 msgstr ""
 
-#: emultempl/pe.em:675
+#: emultempl/pe.em:747
 #, c-format
 msgid "Errors encountered processing file %s for interworking"
 msgstr ""
 
-#: emultempl/pe.em:730 ldlang.c:1623 ldlang.c:3990 ldlang.c:4024 ldmain.c:978
+#: emultempl/pe.em:802 ldlang.c:1657 ldlang.c:3934 ldlang.c:3968 ldmain.c:992
 msgid "%P%F: bfd_link_hash_lookup failed: %E\n"
 msgstr ""
 
@@ -224,11 +224,11 @@
 msgid "%B%F: could not read symbols; %E\n"
 msgstr ""
 
-#: ldcref.c:445 ldmain.c:1046 ldmain.c:1050
+#: ldcref.c:445 ldmain.c:1060 ldmain.c:1064
 msgid "%B%F: could not read symbols: %E\n"
 msgstr ""
 
-#: ldcref.c:517 ldcref.c:524 ldmain.c:1096 ldmain.c:1103
+#: ldcref.c:517 ldcref.c:524 ldmain.c:1110 ldmain.c:1117
 msgid "%B%F: could not read relocs: %E\n"
 msgstr ""
 
@@ -349,213 +349,221 @@
 msgid "%F%P: invalid BFD target `%s'\n"
 msgstr ""
 
-#: ldfile.c:222
+#: ldfile.c:204
+msgid "%F%P: cannot open %s for %s: %E\n"
+msgstr ""
+
+#: ldfile.c:207
 msgid "%F%P: cannot open %s: %E\n"
 msgstr ""
 
-#: ldfile.c:239 ldfile.c:254
+#: ldfile.c:225
+msgid "%F%P: cannot find %s\n"
+msgstr ""
+
+#: ldfile.c:243 ldfile.c:258
 #, c-format
 msgid "cannot find script file %s\n"
 msgstr ""
 
-#: ldfile.c:241 ldfile.c:256
+#: ldfile.c:245 ldfile.c:260
 #, c-format
 msgid "opened script file %s\n"
 msgstr ""
 
-#: ldfile.c:299
+#: ldfile.c:303
 msgid "%P%F: cannot open linker script file %s: %E\n"
 msgstr ""
 
-#: ldfile.c:340
+#: ldfile.c:344
 msgid "%P%F: unknown architecture: %s\n"
 msgstr ""
 
-#: ldfile.c:357
+#: ldfile.c:361
 msgid "%P%F: target architecture respecified\n"
 msgstr ""
 
-#: ldfile.c:410
+#: ldfile.c:414
 msgid "%P%F: cannot represent machine `%s'\n"
 msgstr ""
 
-#: ldlang.c:590
+#: ldlang.c:723
 msgid ""
 "\n"
 "Memory Configuration\n"
 "\n"
 msgstr ""
 
-#: ldlang.c:592
+#: ldlang.c:725
 msgid "Name"
 msgstr ""
 
-#: ldlang.c:592
+#: ldlang.c:725
 msgid "Origin"
 msgstr ""
 
-#: ldlang.c:592
+#: ldlang.c:725
 msgid "Length"
 msgstr ""
 
-#: ldlang.c:592
+#: ldlang.c:725
 msgid "Attributes"
 msgstr ""
 
-#: ldlang.c:634
+#: ldlang.c:767
 msgid ""
 "\n"
 "Linker script and memory map\n"
 "\n"
 msgstr ""
 
-#: ldlang.c:651
+#: ldlang.c:784
 msgid "%P%F: Illegal use of `%s' section"
 msgstr ""
 
-#: ldlang.c:661
+#: ldlang.c:794
 msgid "%P%F: output format %s cannot represent section called %s\n"
 msgstr ""
 
-#: ldlang.c:782
+#: ldlang.c:915
 msgid "%P: %B: warning: ignoring duplicate section `%s'\n"
 msgstr ""
 
-#: ldlang.c:796
+#: ldlang.c:929
 msgid "%P: %B: warning: duplicate section `%s' has different size\n"
 msgstr ""
 
-#: ldlang.c:1223
+#: ldlang.c:1320
 msgid "%B: file not recognized: %E\n"
 msgstr ""
 
-#: ldlang.c:1224
+#: ldlang.c:1321
 msgid "%B: matching formats:"
 msgstr ""
 
-#: ldlang.c:1231
+#: ldlang.c:1328
 msgid "%F%B: file not recognized: %E\n"
 msgstr ""
 
-#: ldlang.c:1284
+#: ldlang.c:1381
 msgid "%F%B: object %B in archive is not object\n"
 msgstr ""
 
-#: ldlang.c:1290 ldlang.c:1302
+#: ldlang.c:1387 ldlang.c:1399
 msgid "%F%B: could not read symbols: %E\n"
 msgstr ""
 
-#: ldlang.c:1418
+#: ldlang.c:1452
 msgid "%P%F: target %s not found\n"
 msgstr ""
 
-#: ldlang.c:1420
+#: ldlang.c:1454
 msgid "%P%F: cannot open output file %s: %E\n"
 msgstr ""
 
-#: ldlang.c:1428
+#: ldlang.c:1462
 msgid "%P%F:%s: can not make object file: %E\n"
 msgstr ""
 
-#: ldlang.c:1432
+#: ldlang.c:1466
 msgid "%P%F:%s: can not set architecture: %E\n"
 msgstr ""
 
-#: ldlang.c:1436
+#: ldlang.c:1470
 msgid "%P%F: can not create link hash table: %E\n"
 msgstr ""
 
-#: ldlang.c:1746
+#: ldlang.c:1780
 msgid " load address 0x%V"
 msgstr ""
 
-#: ldlang.c:1875
+#: ldlang.c:1909
 msgid "%W (size before relaxing)\n"
 msgstr ""
 
-#: ldlang.c:1954
+#: ldlang.c:1988
 #, c-format
 msgid "Address of section %s set to "
 msgstr ""
 
-#: ldlang.c:2091
+#: ldlang.c:2127
 #, c-format
 msgid "Fail with %d\n"
 msgstr ""
 
-#: ldlang.c:2320
+#: ldlang.c:2357
 msgid "%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n"
 msgstr ""
 
-#: ldlang.c:2372
+#: ldlang.c:2408
 msgid "%P%X: Internal error on COFF shared library section %s\n"
 msgstr ""
 
-#: ldlang.c:2413
+#: ldlang.c:2449
 msgid "%P: warning: no memory region specified for section `%s'\n"
 msgstr ""
 
-#: ldlang.c:2426
+#: ldlang.c:2462
 msgid "%P: warning: changing start of section %s by %u bytes\n"
 msgstr ""
 
-#: ldlang.c:2440
+#: ldlang.c:2476
 msgid "%F%S: non constant address expression for section %s\n"
 msgstr ""
 
-#: ldlang.c:2492
+#: ldlang.c:2528
 msgid "%X%P: address 0x%v of %B section %s is not within region %s\n"
 msgstr ""
 
-#: ldlang.c:2500
+#: ldlang.c:2536
 msgid "%X%P: region %s is full (%B section %s)\n"
 msgstr ""
 
-#: ldlang.c:2602
+#: ldlang.c:2638
 msgid "%P%F: can't relax section: %E\n"
 msgstr ""
 
-#: ldlang.c:2763
+#: ldlang.c:2799
 msgid "%F%P: invalid data statement\n"
 msgstr ""
 
-#: ldlang.c:2792
+#: ldlang.c:2828
 msgid "%F%P: invalid reloc statement\n"
 msgstr ""
 
-#: ldlang.c:2926
+#: ldlang.c:2962
 msgid "%P%F:%s: can't set start address\n"
 msgstr ""
 
-#: ldlang.c:2939 ldlang.c:2956
+#: ldlang.c:2975 ldlang.c:2992
 msgid "%P%F: can't set start address\n"
 msgstr ""
 
-#: ldlang.c:2951
+#: ldlang.c:2987
 msgid "%P: warning: cannot find entry symbol %s; defaulting to %V\n"
 msgstr ""
 
-#: ldlang.c:2961
+#: ldlang.c:2997
 msgid "%P: warning: cannot find entry symbol %s; not setting start address\n"
 msgstr ""
 
-#: ldlang.c:3003
+#: ldlang.c:3039
 msgid ""
 "%P: warning: %s architecture of input file `%B' is incompatible with %s "
 "output\n"
 msgstr ""
 
-#: ldlang.c:3021
+#: ldlang.c:3057
 msgid "%E%X: failed to merge target specific data of file %B\n"
 msgstr ""
 
-#: ldlang.c:3106
+#: ldlang.c:3142
 msgid ""
 "\n"
 "Allocating common symbols\n"
 msgstr ""
 
-#: ldlang.c:3107
+#: ldlang.c:3143
 msgid ""
 "Common symbol       size              file\n"
 "\n"
@@ -564,255 +572,263 @@
 #. This message happens when using the
 #. svr3.ifile linker script, so I have
 #. disabled it.
-#: ldlang.c:3196
+#: ldlang.c:3232
 msgid "%P: no [COMMON] command, defaulting to .bss\n"
 msgstr ""
 
-#: ldlang.c:3259
+#: ldlang.c:3295
 msgid "%P%F: invalid syntax in flags\n"
 msgstr ""
 
-#: ldlang.c:3947
+#: ldlang.c:3891
 msgid "%P%Fmultiple STARTUP files\n"
 msgstr ""
 
-#: ldlang.c:4209
+#: ldlang.c:4153
 msgid "%F%P: bfd_record_phdr failed: %E\n"
 msgstr ""
 
-#: ldlang.c:4228
+#: ldlang.c:4172
 msgid "%X%P: section `%s' assigned to non-existent phdr `%s'\n"
 msgstr ""
 
-#: ldlang.c:4497
+#: ldlang.c:4471
+msgid "%X%P: unknown language `%s' in version information\n"
+msgstr ""
+
+#: ldlang.c:4520
 msgid "%X%P: duplicate version tag `%s'\n"
 msgstr ""
 
-#: ldlang.c:4510 ldlang.c:4523
+#: ldlang.c:4533 ldlang.c:4546
 msgid "%X%P: duplicate expression `%s' in version information\n"
 msgstr ""
 
-#: ldlang.c:4560
+#: ldlang.c:4583
 msgid "%X%P: unable to find version dependency `%s'\n"
 msgstr ""
 
-#: ldlang.c:4582
+#: ldlang.c:4605
 msgid "%X%P: unable to read .exports section contents"
 msgstr ""
 
-#: ldmain.c:188
+#: ldmain.c:192
 msgid "%X%P: can't set BFD default target to `%s': %E\n"
 msgstr ""
 
-#: ldmain.c:245
+#: ldmain.c:258
+msgid "%P%F: -r and --mpc860c0 may not be used together\n"
+msgstr ""
+
+#: ldmain.c:260
 msgid "%P%F: --relax and -r may not be used together\n"
 msgstr ""
 
-#: ldmain.c:247
+#: ldmain.c:262
 msgid "%P%F: -r and -shared may not be used together\n"
 msgstr ""
 
-#: ldmain.c:276
+#: ldmain.c:291
 msgid "using internal linker script:\n"
 msgstr ""
 
-#: ldmain.c:295
+#: ldmain.c:310
 msgid "%P%F: no input files\n"
 msgstr ""
 
-#: ldmain.c:300
+#: ldmain.c:315
 msgid "%P: mode %s\n"
 msgstr ""
 
-#: ldmain.c:318
+#: ldmain.c:333
 msgid "%P%F: cannot open map file %s: %E\n"
 msgstr ""
 
-#: ldmain.c:364
+#: ldmain.c:379
 msgid "%P: link errors found, deleting executable `%s'\n"
 msgstr ""
 
-#: ldmain.c:375
+#: ldmain.c:390
 msgid "%F%B: final close failed: %E\n"
 msgstr ""
 
-#: ldmain.c:399
+#: ldmain.c:414
 msgid "%X%P: unable to open for source of copy `%s'\n"
 msgstr ""
 
-#: ldmain.c:401
+#: ldmain.c:416
 msgid "%X%P: unable to open for destination of copy `%s'\n"
 msgstr ""
 
-#: ldmain.c:407
+#: ldmain.c:422
 msgid "%P: Error writing file `%s'\n"
 msgstr ""
 
-#: ldmain.c:413 pe-dll.c:899
+#: ldmain.c:428 pe-dll.c:981
 #, c-format
 msgid "%P: Error closing file `%s'\n"
 msgstr ""
 
-#: ldmain.c:431
+#: ldmain.c:445
 #, c-format
 msgid "%s: total time in link: %ld.%06ld\n"
 msgstr ""
 
-#: ldmain.c:434
+#: ldmain.c:448
 #, c-format
 msgid "%s: data size %ld\n"
 msgstr ""
 
-#: ldmain.c:475
+#: ldmain.c:489
 msgid "%P%F: missing argument to -m\n"
 msgstr ""
 
-#: ldmain.c:589 ldmain.c:610 ldmain.c:641
+#: ldmain.c:603 ldmain.c:624 ldmain.c:655
 msgid "%P%F: bfd_hash_table_init failed: %E\n"
 msgstr ""
 
-#: ldmain.c:594 ldmain.c:613
+#: ldmain.c:608 ldmain.c:627
 msgid "%P%F: bfd_hash_lookup failed: %E\n"
 msgstr ""
 
-#: ldmain.c:628
+#: ldmain.c:642
 msgid "%X%P: error: duplicate retain-symbols-file\n"
 msgstr ""
 
-#: ldmain.c:672
+#: ldmain.c:686
 msgid "%P%F: bfd_hash_lookup for insertion failed: %E\n"
 msgstr ""
 
-#: ldmain.c:677
+#: ldmain.c:691
 msgid "%P: `-retain-symbols-file' overrides `-s' and `-S'\n"
 msgstr ""
 
-#: ldmain.c:754
+#: ldmain.c:768
 msgid "Archive member included"
 msgstr ""
 
-#: ldmain.c:755
+#: ldmain.c:769
 msgid "because of file (symbol)"
 msgstr ""
 
-#: ldmain.c:827
+#: ldmain.c:841
 msgid "%X%C: multiple definition of `%T'\n"
 msgstr ""
 
-#: ldmain.c:830
+#: ldmain.c:844
 msgid "%D: first defined here\n"
 msgstr ""
 
-#: ldmain.c:859
+#: ldmain.c:873
 msgid "%B: warning: definition of `%T' overriding common\n"
 msgstr ""
 
-#: ldmain.c:862
+#: ldmain.c:876
 msgid "%B: warning: common is here\n"
 msgstr ""
 
-#: ldmain.c:869
+#: ldmain.c:883
 msgid "%B: warning: common of `%T' overridden by definition\n"
 msgstr ""
 
-#: ldmain.c:872
+#: ldmain.c:886
 msgid "%B: warning: defined here\n"
 msgstr ""
 
-#: ldmain.c:879
+#: ldmain.c:893
 msgid "%B: warning: common of `%T' overridden by larger common\n"
 msgstr ""
 
-#: ldmain.c:882
+#: ldmain.c:896
 msgid "%B: warning: larger common is here\n"
 msgstr ""
 
-#: ldmain.c:886
+#: ldmain.c:900
 msgid "%B: warning: common of `%T' overriding smaller common\n"
 msgstr ""
 
-#: ldmain.c:889
+#: ldmain.c:903
 msgid "%B: warning: smaller common is here\n"
 msgstr ""
 
-#: ldmain.c:893
+#: ldmain.c:907
 msgid "%B: warning: multiple common of `%T'\n"
 msgstr ""
 
-#: ldmain.c:895
+#: ldmain.c:909
 msgid "%B: warning: previous common is here\n"
 msgstr ""
 
-#: ldmain.c:917 ldmain.c:956
+#: ldmain.c:931 ldmain.c:970
 msgid "%P: warning: global constructor %s used\n"
 msgstr ""
 
-#: ldmain.c:966
+#: ldmain.c:980
 msgid "%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n"
 msgstr ""
 
-#: ldmain.c:1152
+#: ldmain.c:1166
 msgid "%F%P: bfd_hash_table_init failed: %E\n"
 msgstr ""
 
-#: ldmain.c:1159
+#: ldmain.c:1173
 msgid "%F%P: bfd_hash_lookup failed: %E\n"
 msgstr ""
 
-#: ldmain.c:1178
+#: ldmain.c:1192
 msgid "%X%C: undefined reference to `%T'\n"
 msgstr ""
 
-#: ldmain.c:1181
+#: ldmain.c:1195
 msgid "%D: more undefined references to `%T' follow\n"
 msgstr ""
 
-#: ldmain.c:1187
+#: ldmain.c:1201
 msgid "%X%B: undefined reference to `%T'\n"
 msgstr ""
 
-#: ldmain.c:1190
+#: ldmain.c:1204
 msgid "%B: more undefined references to `%T' follow\n"
 msgstr ""
 
-#: ldmain.c:1211 ldmain.c:1233 ldmain.c:1253
+#: ldmain.c:1225 ldmain.c:1247 ldmain.c:1267
 msgid "%P%X: generated"
 msgstr ""
 
-#: ldmain.c:1214
+#: ldmain.c:1228
 msgid " relocation truncated to fit: %s %T"
 msgstr ""
 
-#: ldmain.c:1236
+#: ldmain.c:1250
 #, c-format
 msgid "dangerous relocation: %s\n"
 msgstr ""
 
-#: ldmain.c:1256
+#: ldmain.c:1270
 msgid " reloc refers to symbol `%T' which is not being output\n"
 msgstr ""
 
-#: ldmisc.c:177
+#: ldmisc.c:178
 msgid "no symbol"
 msgstr ""
 
-#: ldmisc.c:239
+#: ldmisc.c:242
 #, c-format
 msgid "built in linker script:%u"
 msgstr ""
 
-#: ldmisc.c:289 ldmisc.c:293
+#: ldmisc.c:292 ldmisc.c:296
 msgid "%B%F: could not read symbols\n"
 msgstr ""
 
 #. We use abfd->filename in this initial line,
 #. in case filename is a .h file or something
 #. similarly unhelpful.
-#: ldmisc.c:329
+#: ldmisc.c:332
 msgid "%B: In function `%T':\n"
 msgstr ""
 
-#: ldmisc.c:461
+#: ldmisc.c:464
 msgid "%F%P: internal error %s %d\n"
 msgstr ""
 
@@ -821,7 +837,7 @@
 msgid "GNU ld version %s (with BFD %s)\n"
 msgstr ""
 
-#: ldver.c:42 lexsup.c:829
+#: ldver.c:42 lexsup.c:872
 msgid "  Supported emulations:\n"
 msgstr ""
 
@@ -838,476 +854,508 @@
 msgid "%F%P: final link failed: %E\n"
 msgstr ""
 
-#: lexsup.c:148 lexsup.c:231 lexsup.c:237
+#: lexsup.c:152 lexsup.c:235 lexsup.c:241
 msgid "KEYWORD"
 msgstr ""
 
-#: lexsup.c:148
+#: lexsup.c:152
 msgid "Shared library control for HP/UX compatibility"
 msgstr ""
 
-#: lexsup.c:151
+#: lexsup.c:155
 msgid "ARCH"
 msgstr ""
 
-#: lexsup.c:151
+#: lexsup.c:155
 msgid "Set architecture"
 msgstr ""
 
-#: lexsup.c:153 lexsup.c:290
+#: lexsup.c:157 lexsup.c:300
 msgid "TARGET"
 msgstr ""
 
-#: lexsup.c:153
+#: lexsup.c:157
 msgid "Specify target for following input files"
 msgstr ""
 
-#: lexsup.c:155 lexsup.c:194 lexsup.c:204 lexsup.c:213 lexsup.c:278
-#: lexsup.c:297 lexsup.c:331
+#: lexsup.c:159 lexsup.c:198 lexsup.c:208 lexsup.c:217 lexsup.c:284
+#: lexsup.c:307 lexsup.c:341
 msgid "FILE"
 msgstr ""
 
-#: lexsup.c:155
+#: lexsup.c:159
 msgid "Read MRI format linker script"
 msgstr ""
 
-#: lexsup.c:157
+#: lexsup.c:161
 msgid "Force common symbols to be defined"
 msgstr ""
 
-#: lexsup.c:161 lexsup.c:321 lexsup.c:323 lexsup.c:325
+#: lexsup.c:165 lexsup.c:331 lexsup.c:333 lexsup.c:335
 msgid "ADDRESS"
 msgstr ""
 
-#: lexsup.c:161
+#: lexsup.c:165
 msgid "Set start address"
 msgstr ""
 
-#: lexsup.c:163
+#: lexsup.c:167
 msgid "Export all dynamic symbols"
 msgstr ""
 
-#: lexsup.c:165
+#: lexsup.c:169
 msgid "Link big-endian objects"
 msgstr ""
 
-#: lexsup.c:167
+#: lexsup.c:171
 msgid "Link little-endian objects"
 msgstr ""
 
-#: lexsup.c:169 lexsup.c:172
+#: lexsup.c:173 lexsup.c:176
 msgid "SHLIB"
 msgstr ""
 
-#: lexsup.c:169
+#: lexsup.c:173
 msgid "Auxiliary filter for shared object symbol table"
 msgstr ""
 
-#: lexsup.c:172
+#: lexsup.c:176
 msgid "Filter for shared object symbol table"
 msgstr ""
 
-#: lexsup.c:174
+#: lexsup.c:178
 msgid "Ignored"
 msgstr ""
 
-#: lexsup.c:176
+#: lexsup.c:180
 msgid "SIZE"
 msgstr ""
 
-#: lexsup.c:176
+#: lexsup.c:180
 msgid "Small data size (if no size, same as --shared)"
 msgstr ""
 
-#: lexsup.c:179
+#: lexsup.c:183
 msgid "FILENAME"
 msgstr ""
 
-#: lexsup.c:179
+#: lexsup.c:183
 msgid "Set internal name of shared library"
 msgstr ""
 
-#: lexsup.c:181
+#: lexsup.c:185
 msgid "LIBNAME"
 msgstr ""
 
-#: lexsup.c:181
+#: lexsup.c:185
 msgid "Search for library LIBNAME"
 msgstr ""
 
-#: lexsup.c:183
+#: lexsup.c:187
 msgid "DIRECTORY"
 msgstr ""
 
-#: lexsup.c:183
+#: lexsup.c:187
 msgid "Add DIRECTORY to library search path"
 msgstr ""
 
-#: lexsup.c:185
+#: lexsup.c:189
 msgid "EMULATION"
 msgstr ""
 
-#: lexsup.c:185
+#: lexsup.c:189
 msgid "Set emulation"
 msgstr ""
 
-#: lexsup.c:187
+#: lexsup.c:191
 msgid "Print map file on standard output"
 msgstr ""
 
-#: lexsup.c:189
+#: lexsup.c:193
 msgid "Do not page align data"
 msgstr ""
 
-#: lexsup.c:191
+#: lexsup.c:195
 msgid "Do not page align data, do not make text readonly"
 msgstr ""
 
-#: lexsup.c:194
+#: lexsup.c:198
 msgid "Set output file name"
 msgstr ""
 
-#: lexsup.c:196
+#: lexsup.c:200
 msgid "Optimize output file"
 msgstr ""
 
-#: lexsup.c:198
+#: lexsup.c:202
 msgid "Ignored for SVR4 compatibility"
 msgstr ""
 
-#: lexsup.c:200
+#: lexsup.c:204
 msgid "Generate relocateable output"
 msgstr ""
 
-#: lexsup.c:204
+#: lexsup.c:208
 msgid "Just link symbols (if directory, same as --rpath)"
 msgstr ""
 
-#: lexsup.c:207
+#: lexsup.c:211
 msgid "Strip all symbols"
 msgstr ""
 
-#: lexsup.c:209
+#: lexsup.c:213
 msgid "Strip debugging symbols"
 msgstr ""
 
-#: lexsup.c:211
+#: lexsup.c:215
 msgid "Trace file opens"
 msgstr ""
 
-#: lexsup.c:213
+#: lexsup.c:217
 msgid "Read linker script"
 msgstr ""
 
-#: lexsup.c:215 lexsup.c:227 lexsup.c:317 lexsup.c:334 lexsup.c:351
+#: lexsup.c:219 lexsup.c:231 lexsup.c:327 lexsup.c:344 lexsup.c:361
 msgid "SYMBOL"
 msgstr ""
 
-#: lexsup.c:215
+#: lexsup.c:219
 msgid "Start with undefined reference to SYMBOL"
 msgstr ""
 
-#: lexsup.c:217
+#: lexsup.c:221
 msgid "Build global constructor/destructor tables"
 msgstr ""
 
-#: lexsup.c:219
+#: lexsup.c:223
 msgid "Print version information"
 msgstr ""
 
-#: lexsup.c:221
+#: lexsup.c:225
 msgid "Print version and emulation information"
 msgstr ""
 
-#: lexsup.c:223
+#: lexsup.c:227
 msgid "Discard all local symbols"
 msgstr ""
 
-#: lexsup.c:225
+#: lexsup.c:229
 msgid "Discard temporary local symbols"
 msgstr ""
 
-#: lexsup.c:227
+#: lexsup.c:231
 msgid "Trace mentions of SYMBOL"
 msgstr ""
 
-#: lexsup.c:229 lexsup.c:299 lexsup.c:301
+#: lexsup.c:233 lexsup.c:309 lexsup.c:311
 msgid "PATH"
 msgstr ""
 
-#: lexsup.c:229
+#: lexsup.c:233
 msgid "Default search path for Solaris compatibility"
 msgstr ""
 
-#: lexsup.c:231
+#: lexsup.c:235
 msgid "Ignored for Solaris compatibility"
 msgstr ""
 
-#: lexsup.c:233
+#: lexsup.c:237
 msgid "Start a group"
 msgstr ""
 
-#: lexsup.c:235
+#: lexsup.c:239
 msgid "End a group"
 msgstr ""
 
-#: lexsup.c:237
+#: lexsup.c:241
 msgid "Ignored for SunOS compatibility"
 msgstr ""
 
-#: lexsup.c:239
+#: lexsup.c:243
 msgid "Link against shared libraries"
 msgstr ""
 
-#: lexsup.c:245
+#: lexsup.c:249
 msgid "Do not link against shared libraries"
 msgstr ""
 
-#: lexsup.c:253
+#: lexsup.c:257
 msgid "Bind global references locally"
 msgstr ""
 
-#: lexsup.c:255
+#: lexsup.c:259
 msgid "Check section addresses for overlaps (default)"
 msgstr ""
 
-#: lexsup.c:257
+#: lexsup.c:261
 msgid "Do not check section addresses for overlaps"
 msgstr ""
 
-#: lexsup.c:260
+#: lexsup.c:264
 msgid "Output cross reference table"
 msgstr ""
 
-#: lexsup.c:262
+#: lexsup.c:266
 msgid "SYMBOL=EXPRESSION"
 msgstr ""
 
-#: lexsup.c:262
+#: lexsup.c:266
 msgid "Define a symbol"
 msgstr ""
 
-#: lexsup.c:264
-msgid "PROGRAM"
-msgstr ""
-
-#: lexsup.c:264
-msgid "Set the dynamic linker to use"
-msgstr ""
-
-#: lexsup.c:266
-msgid "Generate embedded relocs"
-msgstr ""
-
 #: lexsup.c:268
-msgid "Force generation of file with .exe suffix"
+msgid "Demangle symbol names"
 msgstr ""
 
 #: lexsup.c:270
-msgid "Remove unused sections (on some targets)"
+msgid "PROGRAM"
 msgstr ""
 
-#: lexsup.c:273
-msgid "Don't remove unused sections (default)"
+#: lexsup.c:270
+msgid "Set the dynamic linker to use"
+msgstr ""
+
+#: lexsup.c:272
+msgid "Generate embedded relocs"
+msgstr ""
+
+#: lexsup.c:274
+msgid "Force generation of file with .exe suffix"
 msgstr ""
 
 #: lexsup.c:276
-msgid "Print option help"
+msgid "Remove unused sections (on some targets)"
 msgstr ""
 
-#: lexsup.c:278
-msgid "Write a map file"
-msgstr ""
-
-#: lexsup.c:280
-msgid "Use less memory and more disk I/O"
+#: lexsup.c:279
+msgid "Don't remove unused sections (default)"
 msgstr ""
 
 #: lexsup.c:282
-msgid "Don't warn about mismatched input files"
+msgid "Print option help"
 msgstr ""
 
 #: lexsup.c:284
-msgid "Turn off --whole-archive"
+msgid "Write a map file"
 msgstr ""
 
 #: lexsup.c:286
-msgid "Create an output file even if errors occur"
+msgid "Do not demangle symbol names"
+msgstr ""
+
+#: lexsup.c:288
+msgid "Use less memory and more disk I/O"
 msgstr ""
 
 #: lexsup.c:290
-msgid "Specify target of output file"
+msgid "Allow no undefined symbols"
 msgstr ""
 
 #: lexsup.c:292
-msgid "Ignored for Linux compatibility"
+msgid "Don't warn about mismatched input files"
 msgstr ""
 
 #: lexsup.c:294
+msgid "Turn off --whole-archive"
+msgstr ""
+
+#: lexsup.c:296
+msgid "Create an output file even if errors occur"
+msgstr ""
+
+#: lexsup.c:300
+msgid "Specify target of output file"
+msgstr ""
+
+#: lexsup.c:302
+msgid "Ignored for Linux compatibility"
+msgstr ""
+
+#: lexsup.c:304
 msgid "Relax branches on certain targets"
 msgstr ""
 
-#: lexsup.c:297
+#: lexsup.c:307
 msgid "Keep only symbols listed in FILE"
 msgstr ""
 
-#: lexsup.c:299
+#: lexsup.c:309
 msgid "Set runtime shared library search path"
 msgstr ""
 
-#: lexsup.c:301
+#: lexsup.c:311
 msgid "Set link time shared library search path"
 msgstr ""
 
-#: lexsup.c:303
+#: lexsup.c:313
 msgid "Create a shared library"
 msgstr ""
 
-#: lexsup.c:307
+#: lexsup.c:317
 msgid "Sort common symbols by size"
 msgstr ""
 
-#: lexsup.c:311
+#: lexsup.c:321
 msgid "Split output sections for each file"
 msgstr ""
 
-#: lexsup.c:313
+#: lexsup.c:323
 msgid "COUNT"
 msgstr ""
 
-#: lexsup.c:313
+#: lexsup.c:323
 msgid "Split output sections every COUNT relocs"
 msgstr ""
 
-#: lexsup.c:315
+#: lexsup.c:325
 msgid "Print memory usage statistics"
 msgstr ""
 
-#: lexsup.c:317
+#: lexsup.c:327
 msgid "Do task level linking"
 msgstr ""
 
-#: lexsup.c:319
+#: lexsup.c:329
 msgid "Use same format as native linker"
 msgstr ""
 
-#: lexsup.c:321
+#: lexsup.c:331
 msgid "Set address of .bss section"
 msgstr ""
 
-#: lexsup.c:323
+#: lexsup.c:333
 msgid "Set address of .data section"
 msgstr ""
 
-#: lexsup.c:325
+#: lexsup.c:335
 msgid "Set address of .text section"
 msgstr ""
 
-#: lexsup.c:327
+#: lexsup.c:337
 msgid "Output lots of information during link"
 msgstr ""
 
-#: lexsup.c:331
+#: lexsup.c:341
 msgid "Read version information script"
 msgstr ""
 
-#: lexsup.c:334
-msgid "Take export symbols list from .exports, using SYMBOL as the version."
+#: lexsup.c:344
+msgid ""
+"Take export symbols list from .exports, using\n"
+"\t\t\t\tSYMBOL as the version."
 msgstr ""
 
-#: lexsup.c:337
+#: lexsup.c:347
 msgid "Warn about duplicate common symbols"
 msgstr ""
 
-#: lexsup.c:339
+#: lexsup.c:349
 msgid "Warn if global constructors/destructors are seen"
 msgstr ""
 
-#: lexsup.c:342
+#: lexsup.c:352
 msgid "Warn if the multiple GP values are used"
 msgstr ""
 
-#: lexsup.c:344
+#: lexsup.c:354
 msgid "Warn only once per undefined symbol"
 msgstr ""
 
-#: lexsup.c:346
+#: lexsup.c:356
 msgid "Warn if start of section changes due to alignment"
 msgstr ""
 
-#: lexsup.c:349
+#: lexsup.c:359
 msgid "Include all objects from following archives"
 msgstr ""
 
-#: lexsup.c:351
+#: lexsup.c:361
 msgid "Use wrapper functions for SYMBOL"
 msgstr ""
 
-#: lexsup.c:491
+#: lexsup.c:363
+msgid "[=WORDS]"
+msgstr ""
+
+#: lexsup.c:363
+msgid ""
+"Modify problematic branches in last WORDS (1-10,\n"
+"\t\t\t\tdefault 5) words of a page"
+msgstr ""
+
+#: lexsup.c:525
 msgid "%P%F: unrecognized -a option `%s'\n"
 msgstr ""
 
-#: lexsup.c:504
+#: lexsup.c:538
 msgid "%P%F: unrecognized -assert option `%s'\n"
 msgstr ""
 
-#: lexsup.c:592
+#: lexsup.c:629
 msgid "%P%F: invalid number `%s'\n"
 msgstr ""
 
-#: lexsup.c:758
+#: lexsup.c:801
 msgid "%P%F: -shared not supported\n"
 msgstr ""
 
-#: lexsup.c:822
+#: lexsup.c:865
 msgid "Copyright 1997 Free Software Foundation, Inc.\n"
 msgstr ""
 
-#: lexsup.c:823
+#: lexsup.c:866
 msgid ""
 "This program is free software; you may redistribute it under the terms of\n"
 "the GNU General Public License.  This program has absolutely no warranty.\n"
 msgstr ""
 
-#: lexsup.c:914
+#: lexsup.c:957
 #, c-format
 msgid "%s: may not nest groups (--help for usage)\n"
 msgstr ""
 
-#: lexsup.c:925
+#: lexsup.c:968
 #, c-format
 msgid "%s: group ended before it began (--help for usage)\n"
 msgstr ""
 
-#: lexsup.c:973
+#: lexsup.c:984
+msgid "Invalid argument to option \"mpc860c0\"\n"
+msgstr ""
+
+#: lexsup.c:1031
 msgid "%P%F: invalid hex number `%s'\n"
 msgstr ""
 
-#: lexsup.c:985
+#: lexsup.c:1043
 #, c-format
 msgid "Usage: %s [options] file...\n"
 msgstr ""
 
-#: lexsup.c:987
+#: lexsup.c:1045
 msgid "Options:\n"
 msgstr ""
 
-#: lexsup.c:1064
+#: lexsup.c:1122
 #, c-format
-msgid "%s: supported targets:"
+msgid ""
+"%s: supported targets:\n"
+"  "
 msgstr ""
 
-#: lexsup.c:1072
+#: lexsup.c:1130
 #, c-format
-msgid "%s: supported emulations: "
+msgid ""
+"%s: supported emulations:\n"
+"  "
 msgstr ""
 
-#: lexsup.c:1077
+#: lexsup.c:1135
 #, c-format
 msgid "%s: emulation specific options:\n"
 msgstr ""
 
-#: lexsup.c:1081
+#: lexsup.c:1139
 msgid ""
 "\n"
 "Report bugs to bug-gnu-utils@gnu.org\n"
@@ -1317,56 +1365,61 @@
 msgid "%P%F: unknown format type %s\n"
 msgstr ""
 
-#: pe-dll.c:294
+#: pe-dll.c:114
+#, c-format
+msgid "%XUnsupported PEI architecture: %s\n"
+msgstr ""
+
+#: pe-dll.c:346
 #, c-format
 msgid "%XError, duplicate EXPORT with oridinals: %s (%d vs %d)\n"
 msgstr ""
 
-#: pe-dll.c:300
+#: pe-dll.c:352
 #, c-format
 msgid "Warning, duplicate EXPORT: %s\n"
 msgstr ""
 
-#: pe-dll.c:348
+#: pe-dll.c:405
 #, c-format
 msgid "%XCannot export %s: symbol not defined\n"
 msgstr ""
 
-#: pe-dll.c:354
+#: pe-dll.c:411
 #, c-format
 msgid "%XCannot export %s: symbol wrong type (%d vs %d)\n"
 msgstr ""
 
-#: pe-dll.c:361
+#: pe-dll.c:418
 #, c-format
 msgid "%XCannot export %s: symbol not found\n"
 msgstr ""
 
-#: pe-dll.c:482
+#: pe-dll.c:543
 #, c-format
 msgid "%XError, oridinal used twice: %d (%s vs %s)\n"
 msgstr ""
 
-#: pe-dll.c:664
+#: pe-dll.c:735
 #, c-format
 msgid "%XError: %d-bit reloc in dll\n"
 msgstr ""
 
-#: pe-dll.c:773
+#: pe-dll.c:854
 #, c-format
 msgid "%s: Can't open output def file %s\n"
 msgstr ""
 
-#: pe-dll.c:894
+#: pe-dll.c:976
 msgid "; no contents available\n"
 msgstr ""
 
-#: pe-dll.c:1326
+#: pe-dll.c:1428
 #, c-format
 msgid "%XCan't open .lib file: %s\n"
 msgstr ""
 
-#: pe-dll.c:1331
+#: pe-dll.c:1433
 #, c-format
 msgid "Creating library file: %s\n"
 msgstr ""
diff --git a/ld/scripttempl/armcoff.sc b/ld/scripttempl/armcoff.sc
index 8e07169..9f9cd7c 100644
--- a/ld/scripttempl/armcoff.sc
+++ b/ld/scripttempl/armcoff.sc
@@ -7,7 +7,7 @@
   fi
 fi
 cat <<EOF
-OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", "${LITTLE_OUTPUT_FORMAT}")
 ${LIB_SEARCH_DIRS}
 
 ENTRY(${ENTRY})
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index e1fea97..3ffd3e1 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -25,6 +25,7 @@
 #	SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
 #		start address of shared library.
 #	INPUT_FILES - INPUT command of files to always include
+#	WRITABLE_RODATA - if set, the .rodata section should be writable
 #
 # When adding sections, do note that the names of some sections are used
 # when specifying the start address of the next.
@@ -40,7 +41,7 @@
 INTERP=".interp   ${RELOCATING-0} : { *(.interp) 	}"
 PLT=".plt    ${RELOCATING-0} : { *(.plt)	}"
 DYNAMIC=".dynamic     ${RELOCATING-0} : { *(.dynamic) }"
-
+RODATA=".rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r*)} }"
 CTOR=".ctors ${CONSTRUCTING-0} : 
   {
     ${CONSTRUCTING+${CTOR_START}}
@@ -114,6 +115,9 @@
   .gnu.version ${RELOCATING-0} : { *(.gnu.version)	}
   .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d)	}
   .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r)	}
+
+  .rel.init    ${RELOCATING-0} : { *(.rel.init)	}
+  .rela.init   ${RELOCATING-0} : { *(.rela.init)	}
   .rel.text    ${RELOCATING-0} :
     {
       *(.rel.text)
@@ -126,18 +130,8 @@
       ${RELOCATING+*(.rela.text.*)}
       ${RELOCATING+*(.rela.gnu.linkonce.t*)}
     }
-  .rel.data    ${RELOCATING-0} :
-    {
-      *(.rel.data)
-      ${RELOCATING+*(.rel.data.*)}
-      ${RELOCATING+*(.rel.gnu.linkonce.d*)}
-    }
-  .rela.data   ${RELOCATING-0} :
-    {
-      *(.rela.data)
-      ${RELOCATING+*(.rela.data.*)}
-      ${RELOCATING+*(.rela.gnu.linkonce.d*)}
-    }
+  .rel.fini    ${RELOCATING-0} : { *(.rel.fini)	}
+  .rela.fini   ${RELOCATING-0} : { *(.rela.fini)	}
   .rel.rodata  ${RELOCATING-0} :
     {
       *(.rel.rodata)
@@ -150,20 +144,31 @@
       ${RELOCATING+*(.rela.rodata.*)}
       ${RELOCATING+*(.rela.gnu.linkonce.r*)}
     }
-  .rel.got     ${RELOCATING-0} : { *(.rel.got)		}
-  .rela.got    ${RELOCATING-0} : { *(.rela.got)		}
+  ${OTHER_READONLY_RELOC_SECTIONS}
+  .rel.data    ${RELOCATING-0} :
+    {
+      *(.rel.data)
+      ${RELOCATING+*(.rel.data.*)}
+      ${RELOCATING+*(.rel.gnu.linkonce.d*)}
+    }
+  .rela.data   ${RELOCATING-0} :
+    {
+      *(.rela.data)
+      ${RELOCATING+*(.rela.data.*)}
+      ${RELOCATING+*(.rela.gnu.linkonce.d*)}
+    }
   .rel.ctors   ${RELOCATING-0} : { *(.rel.ctors)	}
   .rela.ctors  ${RELOCATING-0} : { *(.rela.ctors)	}
   .rel.dtors   ${RELOCATING-0} : { *(.rel.dtors)	}
   .rela.dtors  ${RELOCATING-0} : { *(.rela.dtors)	}
-  .rel.init    ${RELOCATING-0} : { *(.rel.init)	}
-  .rela.init   ${RELOCATING-0} : { *(.rela.init)	}
-  .rel.fini    ${RELOCATING-0} : { *(.rel.fini)	}
-  .rela.fini   ${RELOCATING-0} : { *(.rela.fini)	}
+  .rel.got     ${RELOCATING-0} : { *(.rel.got)		}
+  .rela.got    ${RELOCATING-0} : { *(.rela.got)		}
+  ${OTHER_GOT_RELOC_SECTIONS}
   .rel.bss     ${RELOCATING-0} : { *(.rel.bss)		}
   .rela.bss    ${RELOCATING-0} : { *(.rela.bss)		}
   .rel.plt     ${RELOCATING-0} : { *(.rel.plt)		}
   .rela.plt    ${RELOCATING-0} : { *(.rela.plt)		}
+
   .init        ${RELOCATING-0} : { KEEP (*(.init))	} =${NOP-0}
   ${DATA_PLT-${PLT}}
   .text    ${RELOCATING-0} :
@@ -180,12 +185,7 @@
   ${RELOCATING+_etext = .;}
   ${RELOCATING+PROVIDE (etext = .);}
   .fini    ${RELOCATING-0} : { KEEP (*(.fini))		} =${NOP-0}
-  .rodata  ${RELOCATING-0} :
-  {
-    *(.rodata)
-    ${RELOCATING+*(.rodata.*)}
-    ${RELOCATING+*(.gnu.linkonce.r*)}
-  }
+  ${WRITABLE_RODATA-${RODATA}}
   .rodata1 ${RELOCATING-0} : { *(.rodata1) }
   ${RELOCATING+${OTHER_READONLY_SECTIONS}}
 
@@ -205,6 +205,7 @@
   .data1 ${RELOCATING-0} : { *(.data1) }
   .eh_frame : { *(.eh_frame) }
   .gcc_except_table : { *(.gcc_except_table) }
+  ${WRITABLE_RODATA+${RODATA}}
   ${RELOCATING+${OTHER_READWRITE_SECTIONS}}
   ${RELOCATING+${CTOR}}
   ${RELOCATING+${DTOR}}
@@ -217,7 +218,7 @@
      we can shorten the on-disk segment size.  */
   .sdata   ${RELOCATING-0} : { *(.sdata) *(.sdata.*) }
   ${RELOCATING+${OTHER_GOT_SECTIONS}}
-  ${RELOCATING+_edata  =  .;}
+  ${RELOCATING+_edata = .;}
   ${RELOCATING+PROVIDE (edata = .);}
   ${RELOCATING+__bss_start = .;}
   ${RELOCATING+${OTHER_BSS_SYMBOLS}}
@@ -233,7 +234,7 @@
    ${RELOCATING+. = ALIGN(${ALIGNMENT});}
   }
   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
-  ${RELOCATING+_end = . ;}
+  ${RELOCATING+_end = .;}
   ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
   ${RELOCATING+PROVIDE (end = .);}
 
diff --git a/ld/scripttempl/mcorepe.sc b/ld/scripttempl/mcorepe.sc
index 8111bf2..65f770c 100644
--- a/ld/scripttempl/mcorepe.sc
+++ b/ld/scripttempl/mcorepe.sc
@@ -1,4 +1,4 @@
-# Linker script for PE.
+# Linker script for MCore PE.
 
 if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
   RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
@@ -35,10 +35,16 @@
   R_RSRC=
 fi
 
-cat <<EOF
-${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
-${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
+if test "$RELOCATING"; then
+  # Can't use ${RELOCATING+blah "blah" blah} for this,
+  # because bash 2.x will lose the doublequotes.
+  cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
+	  	           "${LITTLE_OUTPUT_FORMAT}")}
+EOF
+fi
 
+cat <<EOF
 ${LIB_SEARCH_DIRS}
 
 ENTRY(_mainCRTStartup)
diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc
index 7926bfe..6212d42 100644
--- a/ld/scripttempl/pe.sc
+++ b/ld/scripttempl/pe.sc
@@ -38,6 +38,7 @@
 cat <<EOF
 ${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
 ${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
+${OUTPUT_ARCH+OUTPUT_ARCH(${OUTPUT_ARCH})}
 
 ${LIB_SEARCH_DIRS}
 
diff --git a/ld/scripttempl/v850.sc b/ld/scripttempl/v850.sc
index 6b2f7e5..0a20954 100644
--- a/ld/scripttempl/v850.sc
+++ b/ld/scripttempl/v850.sc
@@ -94,13 +94,17 @@
   .data1	: { *(.data1) }
   .ctors	: {
     ${RELOCATING+___ctors = .;}
-    KEEP (*(.ctors))
+    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
+    KEEP (*(SORT(.ctors.*)))
+    KEEP (*crtend(.ctors))
     ${RELOCATING+___ctors_end = .;}
   }
 
   .dtors	: {
     ${RELOCATING+___dtors = .;}
-    KEEP (*(.dtors))
+    KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
+    KEEP (*(SORT(.dtors.*)))
+    KEEP (*crtend.o(.dtors))
     ${RELOCATING+___dtors_end = .;}
   }
 
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 6610cbf..e0074d2 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,53 @@
+Thu Jul 15 18:00:30 1999  Mark P. Mitchell  <mark@codesourcery.com>
+
+	* ld-undefined/undefined.exp: XFAIL on IRIX6 for the usual as
+	with other DWARF2 targets.
+
+1999-07-13  Nick Clifton  <nickc@cygnus.com>
+
+	* ld-undefined/undefined.exp: Do not expect arm toolchains to fail
+	the undefined line test.
+
+1999-07-10  Ian Lance Taylor  <ian@zembu.com>
+
+	* ld-elfvers/vers.exp: Use -rpath in new vers19 test.
+
+1999-07-07  Ian Lance Taylor  <ian@zembu.com>
+
+	* ld-elfvers/vers.exp: Add new tests vers17 to vers19.
+	* ld/elfvers/{vers17.*, vers18.*, vers19.*}: New files.
+
+1999-06-13  Ian Lance Taylor  <ian@zembu.com>
+
+	* ld-checks/asm.s: Use a symbol name for .lcomm.
+	* ld-checks/checks.exp: Use different names for the two tests.
+	Don't add extra text when invoking fail.
+
+1999-06-12  Ian Lance Taylor  <ian@zembu.com>
+
+	* ld-scripts/phdrs.exp: Change target check from "*-*-linuxaout*"
+	to "*-*-linux*aout*".
+	* ld-scripts/weak.exp: Likewise.
+	* ld-shared/shared.exp: Likewise.  Simplify condition a bit.
+
+Wed Jun  9 12:02:33 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* ld-cdtest/cdtest-main.cc: Avoid `implicit int' warning.
+	* ld-shared/sh1.c: Fix typo.
+
+1999-06-04  H.J. Lu  <hjl@gnu.org>
+
+	* lib/ld-lib.exp (default_ld_nm): Clear nm_output first if
+	necessary.
+
+1999-05-17  Nick Clifton  <nickc@cygnus.com>
+
+	* ld-undefined/undefined.exp: Add xfail for mcore-elf.
+
+1999-05-11  DJ Delorie  <dj@cygnus.com>
+
+	* ld-srec/srec.exp: Do not run tests for PE based ports.
+
 1999-03-05  Nick Clifton  <nickc@cygnus.com>
 
 	* ld-selective/selective.exp: Do not run tests for COFF or PE
diff --git a/ld/testsuite/ld-cdtest/cdtest-main.cc b/ld/testsuite/ld-cdtest/cdtest-main.cc
index 4b99b5c..bc881da 100644
--- a/ld/testsuite/ld-cdtest/cdtest-main.cc
+++ b/ld/testsuite/ld-cdtest/cdtest-main.cc
@@ -27,7 +27,7 @@
 
 static Foo static_foo( "static_foo"); 
 
-main() 
+int main() 
 { 
     assert (Foo::nb_foos() == 2);
     Foo automatic_foo( "automatic_foo");
diff --git a/ld/testsuite/ld-checks/asm.s b/ld/testsuite/ld-checks/asm.s
index e4e0c33..ad5e177 100644
--- a/ld/testsuite/ld-checks/asm.s
+++ b/ld/testsuite/ld-checks/asm.s
@@ -8,7 +8,4 @@
 bar:
 	.long 0x87654321
 
-	.lcomm 0x12
-
-
-	
\ No newline at end of file
+	.lcomm dummy, 0x12
diff --git a/ld/testsuite/ld-checks/checks.exp b/ld/testsuite/ld-checks/checks.exp
index af3ef7d..16fafe3 100644
--- a/ld/testsuite/ld-checks/checks.exp
+++ b/ld/testsuite/ld-checks/checks.exp
@@ -24,7 +24,7 @@
     global srcdir
     global subdir
     
-    set test "check sections"
+    set test "check sections 1"
     
     set ldflags "--check-sections"
 
@@ -34,11 +34,13 @@
     }
 
     if ![ld_simple_link $ld tmpdir/asm.x "$ldflags tmpdir/asm.o"] {
-	fail "$test : using default linker script"
+	fail $test
     } else {
 	pass $test
     }
 
+    set test "check sections 2"
+
     # Change the linker flags so that our "buggy" linker
     # script is used.
     set ldflags "--check-sections -T $srcdir/$subdir/script -e foo"
@@ -51,7 +53,7 @@
 
     # Make sure that we got some output from the linker
     if [string match "" $exec_output] then {
-	fail "$test - error message expected but not found"
+	fail $test
     } 
 
     # Now remove our expected error message
@@ -62,8 +64,7 @@
 	pass $test
     } else {
 	verbose -log "Unexpected linker message(s): $exec_output"
-	
-	fail "$test - using erroneous linker script"
+	fail $test
     }
 }
 
diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp
index 5dfaa93..e11db60 100644
--- a/ld/testsuite/ld-elfvers/vers.exp
+++ b/ld/testsuite/ld-elfvers/vers.exp
@@ -1,5 +1,5 @@
 # Expect script for ld-version tests
-#   Copyright (C) 1997, 1998 Free Software Foundation
+#   Copyright (C) 1997, 1998, 1999 Free Software Foundation
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -806,3 +806,8 @@
 #
 build_vers_lib "vers16a" vers16a.c vers16a "" vers16.map vers16a.ver vers16a.dsym ""
 build_exec "vers16" vers16.c vers16 "" vers16a.so "" vers16.dsym ""
+
+# Test a weak versioned symbol.
+build_vers_lib "vers17" vers17.c vers17 "" vers17.map vers17.ver vers17.dsym ""
+build_vers_lib "vers18" vers18.c vers18 vers17.so vers18.map vers18.ver vers18.dsym vers18.sym
+build_exec "vers19" vers19.c vers19 "-rpath ." vers18.so vers19.ver vers19.dsym ""
diff --git a/ld/testsuite/ld-elfvers/vers17.c b/ld/testsuite/ld-elfvers/vers17.c
new file mode 100644
index 0000000..3bcd647
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers17.c
@@ -0,0 +1,5 @@
+int
+show_foo ()
+{
+  return 99;
+}
diff --git a/ld/testsuite/ld-elfvers/vers17.dsym b/ld/testsuite/ld-elfvers/vers17.dsym
new file mode 100644
index 0000000..8decc0a
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers17.dsym
@@ -0,0 +1,2 @@
+[0]* g    DO \*ABS\*	[0]*  VERS_2.0    VERS_2.0
+[0-9a-f]* g    DF (.text|\*ABS\*)	[0-9a-f]*  VERS_2.0    (0x[0-9a-f][0-9a-f] )?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers17.map b/ld/testsuite/ld-elfvers/vers17.map
new file mode 100644
index 0000000..a5c9cf6
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers17.map
@@ -0,0 +1,4 @@
+VERS_2.0 {
+	 global:
+		 show_foo;
+};
diff --git a/ld/testsuite/ld-elfvers/vers17.ver b/ld/testsuite/ld-elfvers/vers17.ver
new file mode 100644
index 0000000..e78d59c
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers17.ver
@@ -0,0 +1,3 @@
+Version definitions:
+1 0x01 0x02605d3f tmpdir/vers17.so
+2 0x00 0x0a7922b0 VERS_2.0
diff --git a/ld/testsuite/ld-elfvers/vers18.c b/ld/testsuite/ld-elfvers/vers18.c
new file mode 100644
index 0000000..25dcc25
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers18.c
@@ -0,0 +1,42 @@
+int
+bar ()
+{
+  return 3;
+}
+
+#pragma weak hide_original_foo
+
+int
+hide_original_foo ()
+{
+  return 1 + bar ();
+}
+
+#pragma weak hide_old_foo
+
+int
+hide_old_foo ()
+{
+  return 10 + bar();
+}
+
+#pragma weak hide_old_foo1
+
+int
+hide_old_foo1 ()
+{
+  return 100 + bar ();
+}
+
+#pragma weak hide_new_foo
+
+int
+hide_new_foo ()
+{
+  return 1000 + bar ();
+}
+
+__asm__(".symver hide_original_foo,show_foo@");
+__asm__(".symver hide_old_foo,show_foo@VERS_1.1");
+__asm__(".symver hide_old_foo1,show_foo@VERS_1.2");
+__asm__(".symver hide_new_foo,show_foo@@VERS_2.0");
diff --git a/ld/testsuite/ld-elfvers/vers18.dsym b/ld/testsuite/ld-elfvers/vers18.dsym
new file mode 100644
index 0000000..dc3ad7b
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers18.dsym
@@ -0,0 +1,7 @@
+[0-9a-f]*  w   DF (\*UND\*)	[0-9a-f]*  VERS_2.0    (0x[0-9a-f][0-9a-f] )?show_foo
+[0]* g    DO \*ABS\*	[0]*  VERS_1.1    VERS_1.1
+[0]* g    DO \*ABS\*	[0]*  VERS_1.2    VERS_1.2
+[0]* g    DO \*ABS\*	[0]*  VERS_2.0    VERS_2.0
+[0-9a-f]*  w   DF (.text|\*ABS\*)	[0-9a-f]* \(Base\)       (0x[0-9a-f][0-9a-f] )?show_foo
+[0-9a-f]*  w   DF (.text|\*ABS\*)	[0-9a-f]* \(VERS_1.1\)   (0x[0-9a-f][0-9a-f] )?show_foo
+[0-9a-f]*  w   DF (.text|\*ABS\*)	[0-9a-f]* \(VERS_1.2\)   (0x[0-9a-f][0-9a-f] )?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers18.map b/ld/testsuite/ld-elfvers/vers18.map
new file mode 100644
index 0000000..eac2b0e
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers18.map
@@ -0,0 +1,15 @@
+VERS_1.1 {
+	 global:
+		 foo1;
+	 local:
+		 hide_old*; 
+		 hide_original*; 
+		 hide_new*; 
+};
+
+VERS_1.2 {
+		 foo2;
+} VERS_1.1;
+
+VERS_2.0 {
+} VERS_1.2;
diff --git a/ld/testsuite/ld-elfvers/vers18.sym b/ld/testsuite/ld-elfvers/vers18.sym
new file mode 100644
index 0000000..f9cefdf
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers18.sym
@@ -0,0 +1,4 @@
+[0-9a-f]*  w    F .text	[0-9a-f]* (0x[0-9a-f][0-9a-f] )?show_foo@
+[0-9a-f]*  w    F .text	[0-9a-f]* (0x[0-9a-f][0-9a-f] )?show_foo@VERS_1.1
+[0-9a-f]*  w    F .text	[0-9a-f]* (0x[0-9a-f][0-9a-f] )?show_foo@VERS_1.2
+[0-9a-f]*  w    F .text	[0-9a-f]* (0x[0-9a-f][0-9a-f] )?show_foo@@VERS_2.0
diff --git a/ld/testsuite/ld-elfvers/vers18.ver b/ld/testsuite/ld-elfvers/vers18.ver
new file mode 100644
index 0000000..d252996
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers18.ver
@@ -0,0 +1,12 @@
+Version definitions:
+1 0x01 0x02608d3f tmpdir/vers18.so
+2 0x00 0x0a7927b1 VERS_1.1
+3 0x00 0x0a7927b2 VERS_1.2
+	VERS_1.1 
+4 0x02 0x0a7922b0 VERS_2.0
+	VERS_1.2 
+
+Version References:
+  required from tmpdir/vers17.so:
+    0x0a7922b0 0x00 05 VERS_2.0
+
diff --git a/ld/testsuite/ld-elfvers/vers19.c b/ld/testsuite/ld-elfvers/vers19.c
new file mode 100644
index 0000000..bc2d83c
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers19.c
@@ -0,0 +1,6 @@
+int
+main ()
+{
+  printf ("%d\n", show_foo ());
+  return 0;
+}
diff --git a/ld/testsuite/ld-elfvers/vers19.dsym b/ld/testsuite/ld-elfvers/vers19.dsym
new file mode 100644
index 0000000..c9c2642
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers19.dsym
@@ -0,0 +1 @@
+[0-9a-f]*      DF \*UND\*	[0-9a-f]*  VERS_2.0    (0x[0-9a-f][0-9a-f] )?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers19.ver b/ld/testsuite/ld-elfvers/vers19.ver
new file mode 100644
index 0000000..ccbdc88
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers19.ver
@@ -0,0 +1,3 @@
+Version References:
+  required from *tmpdir/vers17.so:
+    0x0a7922b0 0x00 02 VERS_2.0
diff --git a/ld/testsuite/ld-scripts/phdrs.exp b/ld/testsuite/ld-scripts/phdrs.exp
index 34ee00f..5a37fa0 100644
--- a/ld/testsuite/ld-scripts/phdrs.exp
+++ b/ld/testsuite/ld-scripts/phdrs.exp
@@ -13,8 +13,8 @@
     return
 }
 
-if { [istarget *-*-linuxaout*] \
-     || [istarget *-*-linuxoldld*] } {
+if { [istarget *-*-linux*aout*] \
+     || [istarget *-*-linux*oldld*] } {
     return
 }
 
diff --git a/ld/testsuite/ld-scripts/weak.exp b/ld/testsuite/ld-scripts/weak.exp
index f69db57..e965967 100644
--- a/ld/testsuite/ld-scripts/weak.exp
+++ b/ld/testsuite/ld-scripts/weak.exp
@@ -17,8 +17,8 @@
     return
 }
 
-if { [istarget *-*-linuxaout*] \
-     || [istarget *-*-linuxoldld*] } {
+if { [istarget *-*-linux*aout*] \
+     || [istarget *-*-linux*oldld*] } {
     return
 }
 
diff --git a/ld/testsuite/ld-shared/sh1.c b/ld/testsuite/ld-shared/sh1.c
index e31e06a..20f183c 100644
--- a/ld/testsuite/ld-shared/sh1.c
+++ b/ld/testsuite/ld-shared/sh1.c
@@ -64,7 +64,7 @@
 /* This function calls a function defined in this object in the shared
    library.  The main program will override the called function.  */
 
-extern int shlib_overiddencall2 ();
+extern int shlib_overriddencall2 ();
 
 int
 shlib_shlibcall2 ()
diff --git a/ld/testsuite/ld-shared/shared.exp b/ld/testsuite/ld-shared/shared.exp
index 8939c3d..f8f1479 100644
--- a/ld/testsuite/ld-shared/shared.exp
+++ b/ld/testsuite/ld-shared/shared.exp
@@ -52,13 +52,8 @@
     return
 }
 
-if { [istarget i386-*-linuxaout*] \
-     || [istarget i486-*-linuxaout*] \
-     || [istarget i586-*-linuxaout*] \
-     || [istarget i386-*-linuxoldld*] \
-     || [istarget i486-*-linuxoldld*] \
-     || [istarget i586-*-linuxoldld*] \
-     || [istarget m68k-*-linuxaout*] } {
+if { [istarget *-*-linux*aout*] \
+     || [istarget *-*-linux*oldld*] } {
     return
 }
 
diff --git a/ld/testsuite/ld-srec/srec.exp b/ld/testsuite/ld-srec/srec.exp
index 63a70ab..6551d36 100644
--- a/ld/testsuite/ld-srec/srec.exp
+++ b/ld/testsuite/ld-srec/srec.exp
@@ -343,6 +343,11 @@
 setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*"
 setup_xfail "alpha*-*-netbsd*"
 
+# The S-record linker doesn't support the special PE headers - the PE
+# emulation tries to write pe-specific information to the PE headers
+# in the output bfd, but it's not a PE bfd (it's an srec bfd)
+setup_xfail "*-*-cygwin*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*"
+
 run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
 
 # Now try linking a C++ program with global constructors and
@@ -370,5 +375,6 @@
 setup_xfail "v850*-*-elf"
 setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*"
 setup_xfail "alpha*-*-netbsd*"
+setup_xfail "*-*-cygwin*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*"
 
 run_srec_test $test2 "tmpdir/sr3.o"
diff --git a/ld/testsuite/ld-undefined/undefined.exp b/ld/testsuite/ld-undefined/undefined.exp
index 29b3bdd..5f55192 100644
--- a/ld/testsuite/ld-undefined/undefined.exp
+++ b/ld/testsuite/ld-undefined/undefined.exp
@@ -119,8 +119,10 @@
 #
 # hence the xfails below.
 
-setup_xfail arm-*-elf
-setup_xfail strongarm-*-elf
-setup_xfail thumb-*-elf
+#setup_xfail arm-*-elf
+#setup_xfail strongarm-*-elf
+#setup_xfail thumb-*-elf
+setup_xfail mcore-*-elf
+setup_xfail mips-sgi-irix6*
 
 checkund $ml $testline
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 24a4131..19a180b 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -207,6 +207,10 @@
 	return 0
     }
 
+    if {[info exists nm_output]} {
+      unset nm_output
+    }
+
     if ![info exists NMFLAGS] { set NMFLAGS "" }
 
     verbose -log "$nm $NMFLAGS $object >tmpdir/nm.out"
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 7032feb..9248429 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,27 @@
+1999-07-14  Richard Henderson  <rth@cygnus.com>
+
+	* argv.c: Include stdlib.h and string.h instead of
+	prototyping directly.
+	* choose-temp.c: Conditionally include string.h.
+
+1999-07-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* splay-tree.c (splay_tree_insert): Add initialization to avoid
+	warning.
+
+1999-05-11  Jim Blandy  <jimb@zwingli.cygnus.com>
+
+	* cplus-dem.c (main): Use table lookup to distinguish identifier
+	characters from non-identifier characters.
+	(standard_symbol_alphabet, hp_symbol_alphabet): New functions.
+
+Thu May  6 20:34:42 1999  Fred Fish  <fnf@be.com>
+
+	* configure.in (sys/resource.h): Add to AC_CHECK_HEADERS list.
+	* getruntime.c: Only attempt to include sys/resource.h and
+	use getrusage if both HAVE_GETRUSAGE and HAVE_SYS_RESOURCE_H
+	are defined.
+
 1999-04-20  Jim Blandy  <jimb@zwingli.cygnus.com>
 
 	Fix from Dale Hawkins:
diff --git a/libiberty/argv.c b/libiberty/argv.c
index 85c17e9..f596ffd 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -35,12 +35,8 @@
 #ifdef __STDC__
 
 #include <stddef.h>
-extern void *memcpy (void *s1, const void *s2, size_t n);	/* 4.11.2.1 */
-extern size_t strlen (const char *s);				/* 4.11.6.3 */
-extern void *malloc (size_t size);				/* 4.10.3.3 */
-extern void *realloc (void *ptr, size_t size);			/* 4.10.3.4 */
-extern void free (void *ptr);					/* 4.10.3.2 */
-extern char *strdup (const char *s);				/* Non-ANSI */
+#include <string.h>
+#include <stdlib.h>
 
 #else	/* !__STDC__ */
 
diff --git a/libiberty/choose-temp.c b/libiberty/choose-temp.c
index 49c7386..7aae318 100644
--- a/libiberty/choose-temp.c
+++ b/libiberty/choose-temp.c
@@ -34,6 +34,9 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>   /* May get R_OK, etc. on some systems.  */
 #endif
diff --git a/libiberty/configure b/libiberty/configure
index 98407e7..0755510 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1055,7 +1055,7 @@
 fi
 echo "$ac_t""$CPP" 1>&6
 
-for ac_hdr in sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h
+for ac_hdr in sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
diff --git a/libiberty/configure.in b/libiberty/configure.in
index f02f035..1c1cb0b 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -106,7 +106,7 @@
 # It's OK to check for header files.  Although the compiler may not be
 # able to link anything, it had better be able to at least compile
 # something.
-AC_CHECK_HEADERS(sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h)
+AC_CHECK_HEADERS(sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h)
 AC_HEADER_SYS_WAIT
 
 # This is the list of functions which libiberty will provide if they
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 4be587a..14ef56a 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -4379,6 +4379,66 @@
   fatal ("Internal gcc abort.");
 }
 
+
+/* Fill in TABLE so that TABLE[C] is true iff C (as an unsigned char)
+   is a valid symbol component, in the standard assembler symbol
+   syntax.  */
+void
+standard_symbol_alphabet (char *table)
+{
+  int c;
+
+  for (c = 0; c < 256; c++)
+    table[c] = isalnum(c);
+
+  table['_'] = 1;
+  table['$'] = 1;
+  table['.'] = 1;
+}
+
+
+/* Fill in TABLE so that TABLE[C] is true iff C (as an unsigned char)
+   is a valid symbol name component in an HP object file.
+
+   Note that, since HP's compiler generates object code straight from
+   C++ source, without going through an assembler, its mangled
+   identifiers can use all sorts of characters that no assembler would
+   tolerate, so the alphabet this function creates is a little odd.
+   Here are some sample mangled identifiers offered by HP:
+
+	typeid*__XT24AddressIndExpClassMember_
+	[Vftptr]key:__dt__32OrdinaryCompareIndExpClassMemberFv
+	__ct__Q2_9Elf64_Dyn18{unnamed.union.#1}Fv
+
+   This still seems really weird to me, since nowhere else in this
+   file is there anything to recognize curly brackets, parens, etc.
+   I've talked with Srikanth <srikanth@cup.hp.com>, and he assures me
+   this is right, but I still strongly suspect that there's a
+   misunderstanding here.
+
+   If we decide it's better for c++filt to use HP's assembler syntax
+   to scrape identifiers out of its input, here's the definition of
+   the symbol name syntax from the HP assembler manual:
+
+       Symbols are composed of uppercase and lowercase letters, decimal
+       digits, dollar symbol, period (.), ampersand (&), pound sign(#) and
+       underscore (_). A symbol can begin with a letter, digit underscore or
+       dollar sign. If a symbol begins with a digit, it must contain a
+       non-digit character.
+
+   So have fun.  */
+void
+hp_symbol_alphabet (char *table)
+{
+  char *c;
+
+  standard_symbol_alphabet (table);
+
+  for (c = "<>#,*&[]:(){}"; *c; c++)
+    table[(unsigned char) *c] = 1;
+}
+
+
 int
 main (argc, argv)
      int argc;
@@ -4386,6 +4446,7 @@
 {
   char *result;
   int c;
+  char symbol_alphabet[256];
 
   program_name = argv[0];
 
@@ -4452,16 +4513,30 @@
     }
   else
     {
+      switch (current_demangling_style)
+	{
+	case gnu_demangling:
+	case lucid_demangling:
+	case arm_demangling:
+	case edg_demangling:
+	  standard_symbol_alphabet (symbol_alphabet);
+	  break;
+	case hp_demangling:
+	  hp_symbol_alphabet (symbol_alphabet);
+	  break;
+	default:
+	  /* Folks should explicitly indicate the appropriate alphabet for
+	     each demangling.  Providing a default would allow the
+	     question to go unconsidered.  */
+	  abort ();
+	}
+
       for (;;)
 	{
 	  int i = 0;
 	  c = getchar ();
 	  /* Try to read a label.  */
-	  while (c != EOF && (isalnum(c) || c == '_' || c == '$' || c == '.' ||
-                              c == '<' || c == '>' || c == '#' || c == ',' || c == '*' || c == '&' ||
-                              c == '[' || c == ']' || c == ':' || c == '(' || c == ')'))
-                              /* the ones in the 2nd & 3rd lines were added to handle
-                                 HP aCC template specialization manglings */
+	  while (c != EOF && symbol_alphabet[c])
 	    {
 	      if (i >= MBUF_SIZE-1)
 		break;
diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c
index 6e70773..b855ea6 100644
--- a/libiberty/getruntime.c
+++ b/libiberty/getruntime.c
@@ -28,7 +28,7 @@
 
 #include <time.h>
 
-#ifdef HAVE_GETRUSAGE
+#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
 #include <sys/time.h>
 #include <sys/resource.h>
 #endif
@@ -66,7 +66,7 @@
 long
 get_run_time ()
 {
-#ifdef HAVE_GETRUSAGE
+#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
   struct rusage rusage;
 
   getrusage (0, &rusage);
diff --git a/libiberty/splay-tree.c b/libiberty/splay-tree.c
index b6bb5a6..1cb6bd9 100644
--- a/libiberty/splay-tree.c
+++ b/libiberty/splay-tree.c
@@ -1,5 +1,5 @@
 /* A splay-tree datatype.  
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
    Contributed by Mark Mitchell (mark@markmitchell.com).
 
 This file is part of GNU CC.
@@ -264,7 +264,7 @@
      splay_tree_key key;
      splay_tree_value value;
 {
-  int comparison;
+  int comparison = 0;
 
   splay_tree_splay (sp, key);
 
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 0e5ea17..2af30c4 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,18 +1,204 @@
+1999-07-11  Ian Lance Taylor  <ian@zembu.com>
+
+	* dis-buf.c: Add ATTRIBUTE_UNUSED as appropriate.
+	(generic_strcat_address): Add cast to avoid warning.
+	* i386-dis.c: Initialize all structure fields to avoid warnings.
+	Add ATTRIBUTE_UNUSED as appropriate.
+
+1999-07-08  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* sparc-dis.c (print_insn_sparc): Differentiate between
+	addition and oring when guessing symbol for comment.
+
+1999-07-05  Nick Clifton  <nickc@cygnus.com>
+
+	* arm-dis.c (print_insn_arm): Display hex equivalent of rotated
+	constant. 
+
+1999-06-23  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* i386-dis.c: Mention intel mode specials in macro char comment.
+
+1999-06-21  Ian Lance Taylor  <ian@zembu.com>
+
+	* alpha-dis.c: Don't include <stdlib.h>.
+	* arm-dis.c: Include "sysdep.h".
+	* tic30-dis.c: Don't include <stdlib.h> or <string.h>.  Include
+	"sysdep.h".
+	* Makefile.am: Rebuild dependencies.
+	* Makefile.in: Rebuild.
+
+1999-06-16  Nick Clifton  <nickc@cygnus.com>
+
+	* arm-dis.c (print_insn_arm): Add detection of IMB and IMBRange
+	SWIs. 
+
+1999-06-14  Nick Clifton  <nickc@cygnus.com> & Drew Mosley <dmoseley@cygnus.com>
+
+	* arm-dis.c (arm_regnames): Turn into a pointer to a register
+	name set.
+	(arm_regnames_standard): New variable: Array of ARM register
+	names according to ARM instruction set nomenclature. 
+	(arm_regnames_apcs): New variable: Array of ARM register names
+	according to ARM Procedure Call Standard.
+	(arm_regnames_raw): New variable: Array of ARM register names
+	using just 'r' and the register number.
+	(arm_toggle_regnames): New function: Toggle the chosen register set
+	naming scheme.
+	(parse_disassembler_options): New function: Parse any target
+	disassembler command line options.
+	(print_insn_big_arm): Call parse_disassembler_options if any
+	are defined.
+	(print_insn_little_arm): Call parse_disassembler_options if any
+	are defined.
+
+1999-06-13  Ian Lance Taylor  <ian@zembu.com>
+
+	* i386-dis.c (FWAIT_OPCODE): Define.
+	(used_prefixes): New static variable.
+	(fetch_data): Don't print an error message if we have already
+	fetched some bytes successfully.
+	(ckprefix): Clear used_prefixes.  Use FWAIT_OPCODE, not 0x9b.
+	(prefix_name): New static function.
+	(print_insn_i386): If setjmp fails, indicating a data error, but
+	we have managed to fetch some bytes, print the first one as a
+	prefix or a .byte pseudo-op.  If fwait is followed by a non
+	floating point instruction, print the first prefix.  Set
+	used_prefixes when prefixes are used.  If any prefixes were not
+	used after disassembling the instruction, print the first prefix
+	instead of printing the instruction.
+	(putop): Set used_prefixes when prefixes are used.
+	(append_seg, OP_E, OP_G, OP_REG, OP_I, OP_sI, OP_J): Likewise.
+	(OP_DIR, OP_SIMD_Suffix): Likewise.
+
+1999-06-07  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* sparc-opc.c: Fix up set, setsw, setuw operand kinds.
+	Support signx %reg, clruw %reg.
+
+1999-06-07  Jakub Jelinek  <jj@ultra.linux.cz>
+
+	* sparc-opc.c: Add aliases Solaris as supports.
+
+Mon Jun  7 12:04:52 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* Makefile.am (CFILES): Add arc-{dis,opc}.c and v850-{dis,opc}.c.
+	* Makefile.in: Regenerated.
+
+1999-06-03  Philip Blundell  <philb@gnu.org>
+
+	* arm-dis.c (print_insn_arm): Make LDRH/LDRB consistent with LDR
+	when target is PC-relative.
+
+1999-05-28  Linus Nordberg  <linus.nordberg@canit.se>
+
+	* m68k-opc.c: Rename MACL/MSACL to MAC/MSAC.  Add MACM/MSACM.  Add
+	MOVE MACSR,CCR.
+
+	* m68k-dis.c (fetch_arg): Add places `n', `o'.
+
+	* m68k-opc.c: Add MSAC, MACL, MOVE to/from ACC, MACSR, MASK.
+	Add mcf5206e to appropriate instructions.
+	Add alias for MAC, MSAC.
+
+	* m68k-dis.c (print_insn_arg): Add formats `E', `G', `H' and place
+	`N'.
+
+	* m68k-opc.c (m68k_opcodes): Add divsw, divsl, divuw, divul, macl,
+	macw, remsl, remul for mcf5307.  Change mcf5200 --> mcf.
+
+	* m68k-dis.c: Add format `u' and places `h', `m', `M'.
+
+1999-05-18  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* i386-dis.c (Ed): Define.
+	(dis386_twobyte_att, dis386_twobyte_intel): Use Ed for movd.
+	(Rw): Remove.
+	(OP_rm): Rename to OP_Rd.
+	(ONE): Remove.
+	(OP_ONE): Remove.
+	(putop): Add const to template and p.
+	(print_insn_x86): Delete.
+	(print_insn_i386): Merge old function print_insn_x86.  Add const
+	to dp.
+	(struct dis386): Add const to name.
+	(dis386_att, dis386_intel): Add const.
+	(dis386_twobyte_att, dis386_twobyte_intel): Add const.
+	(names32, names16, names8, names_seg, index16): Add const.
+	(grps, prefix_user_table, float_reg): Add const.
+	(float_mem_att, float_mem_intel): Add const.
+	(oappend): Add const to s.
+	(OP_REG): Add const to s.
+	(ptr_reg): Add const to s.
+	(dofloat): Add const to dp.
+	(OP_C): Don't skip modrm, it's now done in OP_Rd.
+	(OP_D): Ditto.
+	(OP_T): Ditto.
+	(OP_Rd): Check for valid mod.  Call Op_E to print.
+	(OP_E): Handle d_mode arg.  Check for bad sfence,lea,lds etc.
+	(OP_MS): Check for valid mod.  Call Op_EM to print.
+	(OP_3DNowSuffix): Set obufp and use oappend rather than
+	strcat.  Call BadOp() for errors.
+	(OP_SIMD_Suffix): Likewise.
+	(BadOp): New function.
+
+1999-05-12  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+	* i386-dis.c (dis386_intel): Remove macro chars, except for
+	jEcxz.  Change cWtR and cRtd to cW and cR.
+	(dis386_twobyte_intel): Remove macro chars here too.
+	(putop): Handle R and W macros for intel mode.
+
+	* i386-dis.c (SIMD_Fixup): New function.
+	(dis386_twobyte_att): Use it on movlps and movhps, and change
+	Ev to EX on these insns.  Change movmskps Ev, XM to Gv, EX.
+	(dis386_twobyte_intel): Same here.
+
+	* i386-dis.c (Av): Remove.
+	(Ap): remove lptr.
+	(lptr): Remove.
+	(OPSIMD): Define.
+	(OP_SIMD_Suffix): New function.
+	(OP_DIR): Remove dead code.
+	(eAX_reg..eDI_reg): Renumber.
+	(onebyte_has_modrm): Table numbering comments.
+	(INTERNAL_DISASSEMBLER_ERROR): Move to before print_insn_x86.
+	(print_insn_x86): Move all prefix oappends to after uses_f3_prefix
+	checks.  Print error on invalid dp->bytemode2.  Remove simd_cmp,
+	and handle SIMD cmp insns in OP_SIMD_Suffix.
+	(info->bytes_per_line): Bump from 5 to 6.
+	(OP_None): Remove.
+	(OP_E): Use INTERNAL_DISASSEMBLER_ERROR.  Handle sfence.
+	(OP_3DNowSuffix): Ensure mnemonic index unsigned.
+
+	PIII SIMD support from Doug Ledford <dledford@redhat.com>
+	* i386-dis.c (XM, EX, None): Define.
+	(OP_XMM, OP_EX, OP_None): New functions.
+	(USE_GROUPS, USE_PREFIX_USER_TABLE): Define.
+	(GRP14): Rename to GRPAMD.
+	(GRP*): Add USE_GROUPS flag.
+	(PREGRP*): Define.
+	(dis386_twobyte_att, dis386_twobyte_intel): Add SIMD insns.
+	(twobyte_has_modrm): Add SIMD entries.
+	(twobyte_uses_f3_prefix, simd_cmp_op, prefix_user_table): New.
+	(grps): Add SIMD insns.
+	(print_insn_x86): New vars uses_f3_prefix and simd_cmp.  Don't
+	oappend repz if uses_f3_prefix.  Add code to handle new groups for
+	SIMD insns.
+
+	From Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+	* i386-dis.c (dis386_att, dis386_intel): Change 0xE8 call insn
+	operand from Av to Jv.
+
+1999-05-07  Nick Clifton  <nickc@cygnus.com>
+
+	* mcore-dis.c (print_insn_mcore): Use .short to display
+	unidentified instructions, not .word.
+
 1999-04-26  Tom Tromey  <tromey@cygnus.com>
 
 	* aclocal.m4, configure: Updated for new version of libtool.
 
-1999-04-22  Nick Clifton  <nickc@cygnus.com>
-
-	* mcore-dis.c (print_insn_mcore): Display locaiton of address pool
-	for LRW instructions.
-
-1999-04-18  Nick Clifton  <nickc@cygnus.com>
-
-	* mcore-dis.c (print_insn_mcore): Display location of address pool
-	for JMP instructions.
-	* mcore-opc.h (mcore_table): Add 'nop'.
-
 1999-04-14  Doug Evans  <devans@casey.cygnus.com>
 
 	* fr30-desc.c,fr30-desc.h,fr30-dis.c,fr30-ibld.c,fr30-opc.c: Rebuild.
@@ -28,16 +214,6 @@
 	* fr30-desc.c,fr30-desc.h,fr30-ibld.c: Rebuild.
 	* m32r-desc.c,m32r-desc.h,m32r-opinst.c: Rebuild.
 
-1999-04-08  Nick Clifton  <nickc@cygnus.com>
-
-	* mcore-dis.c: New file: Disassemble MCore opcodes.
-	* mcore-opc.h: New file: Definitions of MCore opcodes.
-	* Makefile.am: Add Mcore source files.
-	* Makefile.in: Regenerate.
-	* configure.in: Add support for MCore targets.
-	* configure: Regenerate.
-	* disassemble.c: Add support for MCore targets.
-
 1999-04-06  Ian Lance Taylor  <ian@zembu.com>
 
 	* opintl.h (LC_MESSAGES): Never define.
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index d997298..79fabc5 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -30,6 +30,8 @@
 	a29k-dis.c \
 	alpha-dis.c \
 	alpha-opc.c \
+	arc-dis.c \
+	arc-opc.c \
 	arm-dis.c \
 	cgen-asm.c \
 	cgen-dis.c \
@@ -76,6 +78,8 @@
 	tic30-dis.c \
 	tic80-dis.c \
 	tic80-opc.c \
+	v850-dis.c \
+	v850-opc.c \
 	vax-dis.c \
 	w65-dis.c \
 	z8k-dis.c \
@@ -235,11 +239,18 @@
   config.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/opcode/alpha.h
 alpha-opc.lo: alpha-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/alpha.h \
   $(BFD_H) opintl.h
-arm-dis.lo: arm-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
-  $(INCDIR)/ansidecl.h arm-opc.h $(INCDIR)/coff/internal.h \
-  $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h opintl.h $(BFDDIR)/elf-bfd.h \
+arc-dis.lo: arc-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+  $(INCDIR)/ansidecl.h $(INCDIR)/opcode/arc.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \
+  opintl.h
+arc-opc.lo: arc-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/arc.h \
+  opintl.h
+arm-dis.lo: arm-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+  $(BFD_H) arm-opc.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
+  $(INCDIR)/bfdlink.h opintl.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/arm.h \
+  $(INCDIR)/elf/reloc-macros.h
 cgen-asm.lo: cgen-asm.c sysdep.h config.h $(INCDIR)/libiberty.h \
   $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen.h \
   opintl.h
@@ -333,11 +344,15 @@
   config.h $(INCDIR)/opcode/sparc.h $(INCDIR)/dis-asm.h \
   $(BFD_H) $(INCDIR)/libiberty.h opintl.h
 sparc-opc.lo: sparc-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/sparc.h
-tic30-dis.lo: tic30-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
-  $(INCDIR)/ansidecl.h $(INCDIR)/opcode/tic30.h
+tic30-dis.lo: tic30-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+  $(BFD_H) $(INCDIR)/opcode/tic30.h
 tic80-dis.lo: tic80-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/tic80.h \
   $(INCDIR)/dis-asm.h $(BFD_H)
 tic80-opc.lo: tic80-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/tic80.h
+v850-dis.lo: v850-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/v850.h \
+  $(INCDIR)/dis-asm.h $(BFD_H) opintl.h
+v850-opc.lo: v850-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/v850.h \
+  opintl.h
 vax-dis.lo: vax-dis.c $(INCDIR)/opcode/vax.h $(INCDIR)/dis-asm.h \
   $(BFD_H) $(INCDIR)/ansidecl.h
 w65-dis.lo: w65-dis.c w65-opc.h $(INCDIR)/dis-asm.h \
diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in
index ed8f64f..86ed179 100644
--- a/opcodes/Makefile.in
+++ b/opcodes/Makefile.in
@@ -103,8 +103,6 @@
 WIN32LDFLAGS = @WIN32LDFLAGS@
 WIN32LIBADD = @WIN32LIBADD@
 archdefs = @archdefs@
-cgen = @cgen@
-cgendir = @cgendir@
 l = @l@
 
 AUTOMAKE_OPTIONS = cygnus
@@ -138,6 +136,8 @@
 	a29k-dis.c \
 	alpha-dis.c \
 	alpha-opc.c \
+	arc-dis.c \
+	arc-opc.c \
 	arm-dis.c \
 	cgen-asm.c \
 	cgen-dis.c \
@@ -184,6 +184,8 @@
 	tic30-dis.c \
 	tic80-dis.c \
 	tic80-opc.c \
+	v850-dis.c \
+	v850-opc.c \
 	vax-dis.c \
 	w65-dis.c \
 	z8k-dis.c \
@@ -268,10 +270,6 @@
 CLEANFILES = \
 	libopcodes.a stamp-lib dep.sed .dep .dep1
 
-
-
-
-# The start marker is written this way to pass through automake unscathed.
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = config.h
@@ -300,7 +298,7 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = tar
+TAR = gtar
 GZIP_ENV = --best
 SOURCES = libopcodes.a.c $(libopcodes_la_SOURCES)
 OBJECTS = libopcodes.a.o $(libopcodes_la_OBJECTS)
@@ -688,8 +686,7 @@
 config.status: $(srcdir)/configure $(srcdir)/../bfd/configure.in
 	$(SHELL) ./config.status --recheck
 
-
-
+# The start marker is written this way to pass through automake unscathed.
 
 # This dependency stuff is copied from BFD.
 
@@ -741,11 +738,18 @@
   config.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/opcode/alpha.h
 alpha-opc.lo: alpha-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/alpha.h \
   $(BFD_H) opintl.h
-arm-dis.lo: arm-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
-  $(INCDIR)/ansidecl.h arm-opc.h $(INCDIR)/coff/internal.h \
-  $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h opintl.h $(BFDDIR)/elf-bfd.h \
+arc-dis.lo: arc-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+  $(INCDIR)/ansidecl.h $(INCDIR)/opcode/arc.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \
+  opintl.h
+arc-opc.lo: arc-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/arc.h \
+  opintl.h
+arm-dis.lo: arm-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+  $(BFD_H) arm-opc.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
+  $(INCDIR)/bfdlink.h opintl.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/arm.h \
+  $(INCDIR)/elf/reloc-macros.h
 cgen-asm.lo: cgen-asm.c sysdep.h config.h $(INCDIR)/libiberty.h \
   $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen.h \
   opintl.h
@@ -839,11 +843,15 @@
   config.h $(INCDIR)/opcode/sparc.h $(INCDIR)/dis-asm.h \
   $(BFD_H) $(INCDIR)/libiberty.h opintl.h
 sparc-opc.lo: sparc-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/sparc.h
-tic30-dis.lo: tic30-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
-  $(INCDIR)/ansidecl.h $(INCDIR)/opcode/tic30.h
+tic30-dis.lo: tic30-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+  $(BFD_H) $(INCDIR)/opcode/tic30.h
 tic80-dis.lo: tic80-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/tic80.h \
   $(INCDIR)/dis-asm.h $(BFD_H)
 tic80-opc.lo: tic80-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/tic80.h
+v850-dis.lo: v850-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/v850.h \
+  $(INCDIR)/dis-asm.h $(BFD_H) opintl.h
+v850-opc.lo: v850-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/v850.h \
+  opintl.h
 vax-dis.lo: vax-dis.c $(INCDIR)/opcode/vax.h $(INCDIR)/dis-asm.h \
   $(BFD_H) $(INCDIR)/ansidecl.h
 w65-dis.lo: w65-dis.c w65-opc.h $(INCDIR)/dis-asm.h \
diff --git a/opcodes/alpha-dis.c b/opcodes/alpha-dis.c
index db55799..db2d8fa 100644
--- a/opcodes/alpha-dis.c
+++ b/opcodes/alpha-dis.c
@@ -20,7 +20,6 @@
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
-#include <stdlib.h>
 #include <stdio.h>
 #include "ansidecl.h"
 #include "sysdep.h"
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index 4aabf72..baac4a4 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -1,5 +1,5 @@
 /* Instruction printing code for the ARM
-   Copyright (C) 1994, 95, 96, 97, 1998 Free Software Foundation, Inc. 
+   Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. 
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
    Modification by James G. Smith (jsmith@cygnus.co.uk)
 
@@ -31,36 +31,49 @@
 #include "elf/internal.h"
 #include "elf/arm.h"
 
-static char *arm_conditional[] =
+static char * arm_conditional[] =
 {"eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc",
  "hi", "ls", "ge", "lt", "gt", "le", "", "nv"};
 
-static char *arm_regnames[] =
+static char * arm_regnames_raw[] =
 {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc"};
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"};
 
-static char *arm_fp_const[] =
+static char * arm_regnames_standard[] =
+{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "r12", "sp", "lr", "pc"};
+
+static char * arm_regnames_apcs[] =
+{"a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4",
+ "v5", "v6", "sl", "fp", "ip", "sp", "lr", "pc"};
+
+/* Choose which register name set to use.  */
+static char ** arm_regnames = arm_regnames_standard;
+
+static char * arm_fp_const[] =
 {"0.0", "1.0", "2.0", "3.0", "4.0", "5.0", "0.5", "10.0"};
 
-static char *arm_shift[] = 
+static char * arm_shift[] = 
 {"lsl", "lsr", "asr", "ror"};
 
-static int print_insn_arm PARAMS ((bfd_vma, struct disassemble_info *,
-				   long));
+static int print_insn_arm
+  PARAMS ((bfd_vma, struct disassemble_info *, long));
 
 static void
 arm_decode_shift (given, func, stream)
      long given;
      fprintf_ftype func;
-     void *stream;
+     void * stream;
 {
   func (stream, "%s", arm_regnames[given & 0xf]);
+  
   if ((given & 0xff0) != 0)
     {
       if ((given & 0x10) == 0)
 	{
 	  int amount = (given & 0xf80) >> 7;
 	  int shift = (given & 0x60) >> 5;
+	  
 	  if (amount == 0)
 	    {
 	      if (shift == 3)
@@ -68,8 +81,10 @@
 		  func (stream, ", rrx");
 		  return;
 		}
+	      
 	      amount = 32;
 	    }
+	  
 	  func (stream, ", %s #%d", arm_shift[shift], amount);
 	}
       else
@@ -83,9 +98,9 @@
 
 static int
 print_insn_arm (pc, info, given)
-     bfd_vma         pc;
-     struct disassemble_info *info;
-     long given;
+     bfd_vma                   pc;
+     struct disassemble_info * info;
+     long                      given;
 {
   struct arm_opcode *  insn;
   void *               stream = info->stream;
@@ -195,8 +210,12 @@
 			{
                           /* PC relative with immediate offset */
 			  int offset = ((given & 0xf00) >> 4) | (given & 0xf);
+			  
 			  if ((given & 0x00800000) == 0)
 			    offset = -offset;
+			  
+			  func (stream, "[pc, #%x]\t; ", offset);
+			  
 			  (*info->print_address_func)
 			    (offset + pc + 8, info);
 			}
@@ -287,9 +306,9 @@
 			{
 			  int rotate = (given & 0xf00) >> 7;
 			  int immed = (given & 0xff);
-			  func (stream, "#%d",
-				((immed << (32 - rotate))
-				 | (immed >> rotate)) & 0xffffffff);
+			  immed = (((immed << (32 - rotate))
+				    | (immed >> rotate)) & 0xffffffff);
+			  func (stream, "#%d\t; 0x%x", immed, immed);
 			}
 		      else
 			arm_decode_shift (given, func, stream);
@@ -463,6 +482,12 @@
 				  reg = given >> bitstart;
 				  reg &= (2 << (bitend - bitstart)) - 1;
 				  func (stream, "0x%08x", reg);
+				  
+				  /* Some SWI instructions have special meanings.  */
+				  if ((given & 0x0fffffff) == 0x0FF00000)
+				    func (stream, "\t; IMB");
+				  else if ((given & 0x0fffffff) == 0x0FF00001)
+				    func (stream, "\t; IMBRange");
 				}
 				break;
 			      case 'f':
@@ -522,19 +547,19 @@
 
 static int
 print_insn_thumb (pc, info, given)
-     bfd_vma         pc;
-     struct disassemble_info *info;
-     long given;
+     bfd_vma                   pc;
+     struct disassemble_info * info;
+     long                      given;
 {
-  struct thumb_opcode *insn;
-  void *stream = info->stream;
-  fprintf_ftype func = info->fprintf_func;
+  struct thumb_opcode * insn;
+  void *                stream = info->stream;
+  fprintf_ftype         func = info->fprintf_func;
 
   for (insn = thumb_opcodes; insn->assembler; insn++)
     {
       if ((given & insn->mask) == insn->value)
         {
-          char *c = insn->assembler;
+          char * c = insn->assembler;
 
           /* Special processing for Thumb 2 instruction BL sequence: */
           if (!*c) /* check for empty (not NULL) assembler string */
@@ -554,12 +579,14 @@
 	  	      
               given &= 0xffff;
               func (stream, "%04x\t", given);
+	      
               for (; *c; c++)
                 {
                   if (*c == '%')
                     {
                       int domaskpc = 0;
                       int domasklr = 0;
+		      
                       switch (*++c)
                         {
                         case '%':
@@ -579,6 +606,7 @@
                         case 'D':
                           {
                             long reg;
+			    
                             reg = given & 0x7;
                             if (given & (1 << 7))
                              reg += 8;
@@ -603,6 +631,7 @@
                           {
                             int started = 0;
                             int reg;
+			    
                             func (stream, "{");
                             /* It would be nice if we could spot
                                ranges, and generate the rS-rE format: */
@@ -640,6 +669,7 @@
                           {
                             int bitstart = *c++ - '0';
                             int bitend = 0;
+			    
                             while (*c >= '0' && *c <= '9')
                               bitstart = (bitstart * 10) + *c++ - '0';
 
@@ -648,6 +678,7 @@
                               case '-':
                                 {
                                   long reg;
+				  
                                   c++;
                                   while (*c >= '0' && *c <= '9')
                                     bitend = (bitend * 10) + *c++ - '0';
@@ -697,7 +728,7 @@
                                       break;
 
                                     default:
-                                      abort();
+                                      abort ();
                                     }
                                 }
                                 break;
@@ -717,7 +748,7 @@
                                 break;
 
                               default:
-                                 abort();
+                                 abort ();
                               }
                           }
                           break;
@@ -738,40 +769,86 @@
   abort ();
 }
 
+/* Select a different register name set.
+   Returns true if the name set selected is the APCS name set.  */
+int
+arm_toggle_regnames ()
+{
+  if (arm_regnames == arm_regnames_standard)
+    arm_regnames = arm_regnames_apcs;
+  else
+    arm_regnames = arm_regnames_standard;
+
+  return arm_regnames == arm_regnames_apcs;
+}
+
+static void
+parse_disassembler_options (options)
+     char * options;
+{
+  if (options == NULL)
+    return;
+      
+  if (strncmp (options, "reg-names-", 10) == 0)
+    {
+      options += 10;
+      
+      if (strcmp (options, "std") == 0)
+	arm_regnames = arm_regnames_standard;
+      else if (strcmp (options, "apcs") == 0)
+	arm_regnames = arm_regnames_apcs;
+      else if (strcmp (options, "raw") == 0)
+	arm_regnames = arm_regnames_raw;
+      else
+	fprintf (stderr, "Unrecognised register name set: %s\n", options);
+    }
+  else
+    fprintf (stderr, "Unrecognised disassembler option: %s\n", options);
+  
+  return;
+}
+
 /* NOTE: There are no checks in these routines that the relevant number of data bytes exist */
 
 int
 print_insn_big_arm (pc, info)
      bfd_vma pc;
-     struct disassemble_info *info;
+     struct disassemble_info * info;
 {
   unsigned char      b[4];
   long               given;
   int                status;
-  coff_symbol_type   *cs;
-  elf_symbol_type    *es;
+  coff_symbol_type * cs;
+  elf_symbol_type *  es;
   int                is_thumb;
   
+  if (info->disassembler_options)
+    {
+      parse_disassembler_options (info->disassembler_options);
+      
+      /* To avoid repeated parsing of this option, we remove it here.  */
+      info->disassembler_options = NULL;
+    }
+  
   is_thumb = false;
   if (info->symbols != NULL)
     {
-    if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
-     {
-       cs = coffsymbol (*info->symbols);
-       is_thumb = (cs->native->u.syment.n_sclass == C_THUMBEXT
-                   || cs->native->u.syment.n_sclass == C_THUMBSTAT
-                   || cs->native->u.syment.n_sclass == C_THUMBLABEL
-                   || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC
-                   || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC);
-  
-     }
-    else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour)
-     {
-       es = *(elf_symbol_type **)(info->symbols);
-       is_thumb = ELF_ST_TYPE (es->internal_elf_sym.st_info) ==
-	 STT_ARM_TFUNC;
-      }
-   }
+      if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
+	{
+	  cs = coffsymbol (*info->symbols);
+	  is_thumb = (   cs->native->u.syment.n_sclass == C_THUMBEXT
+		      || cs->native->u.syment.n_sclass == C_THUMBSTAT
+		      || cs->native->u.syment.n_sclass == C_THUMBLABEL
+		      || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC
+		      || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC);
+	}
+      else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour)
+	{
+	  es = *(elf_symbol_type **)(info->symbols);
+	  is_thumb = ELF_ST_TYPE (es->internal_elf_sym.st_info) ==
+	    STT_ARM_TFUNC;
+	}
+    }
 
   info->bytes_per_chunk = 4;
   info->display_endian = BFD_ENDIAN_BIG;
@@ -801,23 +878,15 @@
 	  given |= (b[0] << 24) | (b[1] << 16);
 	}
       else
-	{
-	  given = (b[0] << 8) | b[1] | (b[2] << 24) | (b[3] << 16);
-	}
+	given = (b[0] << 8) | b[1] | (b[2] << 24) | (b[3] << 16);
     }
   else
-    {
-      given = (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | (b[3]);
-    }
+    given = (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | (b[3]);
 
   if (is_thumb)
-    {
-      status = print_insn_thumb (pc, info, given);
-    }
+    status = print_insn_thumb (pc, info, given);
   else
-    {
-      status = print_insn_arm (pc, info, given);
-    }
+    status = print_insn_arm (pc, info, given);
 
   return status;
 }
@@ -830,31 +899,39 @@
   unsigned char      b[4];
   long               given;
   int                status;
-  coff_symbol_type   *cs;
-  elf_symbol_type    *es;
+  coff_symbol_type * cs;
+  elf_symbol_type *  es;
   int                is_thumb;
 
+  if (info->disassembler_options)
+    {
+      parse_disassembler_options (info->disassembler_options);
+      
+      /* To avoid repeated parsing of this option, we remove it here.  */
+      info->disassembler_options = NULL;
+    }
+  
   is_thumb = false;
+  
   if (info->symbols != NULL)
     {
-    if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
-     {
-       cs = coffsymbol (*info->symbols);
-       is_thumb = (cs->native->u.syment.n_sclass == C_THUMBEXT
-                   || cs->native->u.syment.n_sclass == C_THUMBSTAT
-                   || cs->native->u.syment.n_sclass == C_THUMBLABEL
-                   || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC
-                   || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC);
+      if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
+	{
+	  cs = coffsymbol (*info->symbols);
+	  is_thumb = (   cs->native->u.syment.n_sclass == C_THUMBEXT
+		      || cs->native->u.syment.n_sclass == C_THUMBSTAT
+		      || cs->native->u.syment.n_sclass == C_THUMBLABEL
+		      || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC
+		      || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC);
+	}
+      else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour)
+	{
+	  es = *(elf_symbol_type **)(info->symbols);
+	  is_thumb = ELF_ST_TYPE (es->internal_elf_sym.st_info) ==
+	    STT_ARM_TFUNC;
+	}
+    }
   
-     }
-    else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour)
-     {
-       es = *(elf_symbol_type **)(info->symbols);
-       is_thumb = ELF_ST_TYPE (es->internal_elf_sym.st_info) ==
-	 STT_ARM_TFUNC;
-      }
-   }
-
   info->bytes_per_chunk = 4;
   info->display_endian = BFD_ENDIAN_LITTLE;
 
@@ -875,13 +952,9 @@
   given = (b[0]) | (b[1] << 8) | (b[2] << 16) | (b[3] << 24);
 
   if (is_thumb)
-    {
-      status = print_insn_thumb (pc, info, given);
-    }
+    status = print_insn_thumb (pc, info, given);
   else
-    {
-      status = print_insn_arm (pc, info, given);
-    }
+    status = print_insn_arm (pc, info, given);
 
   return status;
 }
diff --git a/opcodes/dis-buf.c b/opcodes/dis-buf.c
index d76be2e..c6e5121 100644
--- a/opcodes/dis-buf.c
+++ b/opcodes/dis-buf.c
@@ -1,5 +1,5 @@
 /* Disassemble from a buffer, for GNU.
-   Copyright (C) 1993, 1994, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 1998, 1999 Free Software Foundation, Inc.
 
 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
@@ -85,7 +85,7 @@
       char tmpBuf[30];
 
       sprintf_vma (tmpBuf, addr);
-      if ((strlen (buf) + strlen (tmpBuf)) <= len)
+      if ((strlen (buf) + strlen (tmpBuf)) <= (unsigned int) len)
 	strcat (buf, tmpBuf);
       else
 	strncat (buf, tmpBuf, (len - strlen(buf)));
@@ -97,8 +97,8 @@
 
 int
 generic_symbol_at_address (addr, info)
-     bfd_vma addr;
-     struct disassemble_info * info;
+     bfd_vma addr ATTRIBUTE_UNUSED;
+     struct disassemble_info *info ATTRIBUTE_UNUSED;
 {
   return 1;
 }
diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c
index 4898b42..da6d5d5 100644
--- a/opcodes/disassemble.c
+++ b/opcodes/disassemble.c
@@ -245,4 +245,3 @@
     }
   return disassemble;
 }
-
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 19144cb..3c77a74 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -47,7 +47,6 @@
 #define UNIXWARE_COMPAT 1
 #endif
 
-
 static int fetch_data PARAMS ((struct disassemble_info *, bfd_byte *));
 
 struct dis_private
@@ -59,6 +58,31 @@
   jmp_buf bailout;
 };
 
+/* The opcode for the fwait instruction, which we treat as a prefix
+   when we can.  */
+#define FWAIT_OPCODE (0x9b)
+
+/* Flags for the prefixes for the current instruction.  See below.  */
+static int prefixes;
+
+/* Flags for prefixes which we somehow handled when printing the
+   current instruction.  */
+static int used_prefixes;
+
+/* Flags stored in PREFIXES.  */
+#define PREFIX_REPZ 1
+#define PREFIX_REPNZ 2
+#define PREFIX_LOCK 4
+#define PREFIX_CS 8
+#define PREFIX_SS 0x10
+#define PREFIX_DS 0x20
+#define PREFIX_ES 0x40
+#define PREFIX_FS 0x80
+#define PREFIX_GS 0x100
+#define PREFIX_DATA 0x200
+#define PREFIX_ADDR 0x400
+#define PREFIX_FWAIT 0x800
+
 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
    to ADDR (exclusive) are valid.  Returns 1 for success, longjmps
    on error.  */
@@ -81,7 +105,12 @@
 				      info);
   if (status != 0)
     {
-      (*info->memory_error_func) (status, start, info);
+      /* If we did manage to read at least one byte, then
+         print_insn_i386 will do something sensible.  Otherwise, print
+         an error.  We do that here because this is where we know
+         STATUS.  */
+      if (priv->max_fetched == priv->the_buffer)
+	(*info->memory_error_func) (status, start, info);
       longjmp (priv->bailout, 1);
     }
   else
@@ -89,28 +118,27 @@
   return 1;
 }
 
+#define XX NULL, 0
+
 #define Eb OP_E, b_mode
 #define indirEb OP_indirE, b_mode
 #define Gb OP_G, b_mode
 #define Ev OP_E, v_mode
+#define Ed OP_E, d_mode
 #define indirEv OP_indirE, v_mode
 #define Ew OP_E, w_mode
 #define Ma OP_E, v_mode
-#define M OP_E, 0
-#define Mp OP_E, 0		/* ? */
+#define M OP_E, 0		/* lea */
+#define Mp OP_E, 0		/* 32 or 48 bit memory operand for LDS, LES etc */
 #define Gv OP_G, v_mode
 #define Gw OP_G, w_mode
-#define Rw OP_rm, w_mode
-#define Rd OP_rm, d_mode
+#define Rd OP_Rd, d_mode
 #define Ib OP_I, b_mode
 #define sIb OP_sI, b_mode	/* sign extened byte */
 #define Iv OP_I, v_mode
 #define Iw OP_I, w_mode
 #define Jb OP_J, b_mode
 #define Jv OP_J, v_mode
-#if 0
-#define ONE OP_ONE, 0
-#endif
 #define Cd OP_C, d_mode
 #define Dd OP_D, d_mode
 #define Td OP_T, d_mode
@@ -136,8 +164,7 @@
 #define indirDX OP_REG, indir_dx_reg
 
 #define Sw OP_SEG, w_mode
-#define Ap OP_DIR, lptr
-#define Av OP_DIR, v_mode
+#define Ap OP_DIR, 0
 #define Ob OP_OFF, b_mode
 #define Ov OP_OFF, v_mode
 #define Xb OP_DSreg, eSI_reg
@@ -154,9 +181,13 @@
 #define gs OP_REG, gs_reg
 
 #define MX OP_MMX, 0
+#define XM OP_XMM, 0
 #define EM OP_EM, v_mode
-#define MS OP_MS, b_mode
+#define EX OP_EX, v_mode
+#define MS OP_MS, v_mode
+#define None OP_E, 0
 #define OPSUF OP_3DNowSuffix, 0
+#define OPSIMD OP_SIMD_Suffix, 0
 
 /* bits in sizeflag */
 #if 0 /* leave undefined until someone adds the extra flag to objdump */
@@ -165,7 +196,7 @@
 #define AFLAG 2
 #define DFLAG 1
 
-typedef void (*op_rtn) PARAMS ((int bytemode, int sizeflag ));
+typedef void (*op_rtn) PARAMS ((int bytemode, int sizeflag));
 
 static void OP_E PARAMS ((int, int));
 static void OP_G PARAMS ((int, int));
@@ -182,25 +213,28 @@
 static void OP_C PARAMS ((int, int));
 static void OP_D PARAMS ((int, int));
 static void OP_T PARAMS ((int, int));
-static void OP_rm PARAMS ((int, int));
+static void OP_Rd PARAMS ((int, int));
 static void OP_ST PARAMS ((int, int));
 static void OP_STi  PARAMS ((int, int));
-#if 0
-static void OP_ONE PARAMS ((int, int));
-#endif
 static void OP_MMX PARAMS ((int, int));
+static void OP_XMM PARAMS ((int, int));
 static void OP_EM PARAMS ((int, int));
+static void OP_EX PARAMS ((int, int));
 static void OP_MS PARAMS ((int, int));
 static void OP_3DNowSuffix PARAMS ((int, int));
+static void OP_SIMD_Suffix PARAMS ((int, int));
+static void SIMD_Fixup PARAMS ((int, int));
 
 static void append_seg PARAMS ((void));
 static void set_op PARAMS ((unsigned int op));
-static void putop PARAMS ((char *template, int sizeflag));
+static void putop PARAMS ((const char *template, int sizeflag));
 static void dofloat PARAMS ((int sizeflag));
 static int get16 PARAMS ((void));
 static int get32 PARAMS ((void));
 static void ckprefix PARAMS ((void));
+static const char *prefix_name PARAMS ((int, int));
 static void ptr_reg PARAMS ((int, int));
+static void BadOp PARAMS ((void));
 
 #define b_mode 1
 #define v_mode 2
@@ -214,16 +248,15 @@
 #define ds_reg 103
 #define fs_reg 104
 #define gs_reg 105
-#define eAX_reg 107
-#define eCX_reg 108
-#define eDX_reg 109
-#define eBX_reg 110
-#define eSP_reg 111
-#define eBP_reg 112
-#define eSI_reg 113
-#define eDI_reg 114
 
-#define lptr 115
+#define eAX_reg 108
+#define eCX_reg 109
+#define eDX_reg 110
+#define eBX_reg 111
+#define eSP_reg 112
+#define eBP_reg 113
+#define eSI_reg 114
+#define eDI_reg 115
 
 #define al_reg 116
 #define cl_reg 117
@@ -245,34 +278,54 @@
 
 #define indir_dx_reg 150
 
-#define GRP1b NULL, NULL, 0
-#define GRP1S NULL, NULL, 1
-#define GRP1Ss NULL, NULL, 2
-#define GRP2b NULL, NULL, 3
-#define GRP2S NULL, NULL, 4
-#define GRP2b_one NULL, NULL, 5
-#define GRP2S_one NULL, NULL, 6
-#define GRP2b_cl NULL, NULL, 7
-#define GRP2S_cl NULL, NULL, 8
-#define GRP3b NULL, NULL, 9
-#define GRP3S NULL, NULL, 10
-#define GRP4  NULL, NULL, 11
-#define GRP5  NULL, NULL, 12
-#define GRP6  NULL, NULL, 13
-#define GRP7 NULL, NULL, 14
-#define GRP8 NULL, NULL, 15
-#define GRP9 NULL, NULL, 16
-#define GRP10 NULL, NULL, 17
-#define GRP11 NULL, NULL, 18
-#define GRP12 NULL, NULL, 19
-#define GRP13 NULL, NULL, 20
-#define GRP14 NULL, NULL, 21
+#define USE_GROUPS 1
+#define USE_PREFIX_USER_TABLE 2
+
+#define GRP1b NULL, NULL, 0, NULL, USE_GROUPS, NULL, 0
+#define GRP1S NULL, NULL, 1, NULL, USE_GROUPS, NULL, 0
+#define GRP1Ss NULL, NULL, 2, NULL, USE_GROUPS, NULL, 0
+#define GRP2b NULL, NULL, 3, NULL, USE_GROUPS, NULL, 0
+#define GRP2S NULL, NULL, 4, NULL, USE_GROUPS, NULL, 0
+#define GRP2b_one NULL, NULL, 5, NULL, USE_GROUPS, NULL, 0
+#define GRP2S_one NULL, NULL, 6, NULL, USE_GROUPS, NULL, 0
+#define GRP2b_cl NULL, NULL, 7, NULL, USE_GROUPS, NULL, 0
+#define GRP2S_cl NULL, NULL, 8, NULL, USE_GROUPS, NULL, 0
+#define GRP3b NULL, NULL, 9, NULL, USE_GROUPS, NULL, 0
+#define GRP3S NULL, NULL, 10, NULL, USE_GROUPS, NULL, 0
+#define GRP4  NULL, NULL, 11, NULL, USE_GROUPS, NULL, 0
+#define GRP5  NULL, NULL, 12, NULL, USE_GROUPS, NULL, 0
+#define GRP6  NULL, NULL, 13, NULL, USE_GROUPS, NULL, 0
+#define GRP7 NULL, NULL, 14, NULL, USE_GROUPS, NULL, 0
+#define GRP8 NULL, NULL, 15, NULL, USE_GROUPS, NULL, 0
+#define GRP9 NULL, NULL, 16, NULL, USE_GROUPS, NULL, 0
+#define GRP10 NULL, NULL, 17, NULL, USE_GROUPS, NULL, 0
+#define GRP11 NULL, NULL, 18, NULL, USE_GROUPS, NULL, 0
+#define GRP12 NULL, NULL, 19, NULL, USE_GROUPS, NULL, 0
+#define GRP13 NULL, NULL, 20, NULL, USE_GROUPS, NULL, 0
+#define GRP14 NULL, NULL, 21, NULL, USE_GROUPS, NULL, 0
+#define GRPAMD NULL, NULL, 22, NULL, USE_GROUPS, NULL, 0
+
+#define PREGRP0 NULL, NULL, 0, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP1 NULL, NULL, 1, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP2 NULL, NULL, 2, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP3 NULL, NULL, 3, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP4 NULL, NULL, 4, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP5 NULL, NULL, 5, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP6 NULL, NULL, 6, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP7 NULL, NULL, 7, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP8 NULL, NULL, 8, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP9 NULL, NULL, 9, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP10 NULL, NULL, 10, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP11 NULL, NULL, 11, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP12 NULL, NULL, 12, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP13 NULL, NULL, 13, NULL, USE_PREFIX_USER_TABLE, NULL, 0
+#define PREGRP14 NULL, NULL, 14, NULL, USE_PREFIX_USER_TABLE, NULL, 0
 
 #define FLOATCODE 50
-#define FLOAT NULL, NULL, FLOATCODE
+#define FLOAT NULL, NULL, FLOATCODE, NULL, 0, NULL, 0
 
 struct dis386 {
-  char *name;
+  const char *name;
   op_rtn op1;
   int bytemode1;
   op_rtn op2;
@@ -290,255 +343,255 @@
    'P' => print 'w' or 'l' if instruction has an operand size prefix,
                               or suffix_always is true
    'Q' => print 'w' or 'l' if no register operands or suffix_always is true
-   'R' => print 'w' or 'l'
+   'R' => print 'w' or 'l' ("wd" or "dq" in intel mode)
    'S' => print 'w' or 'l' if suffix_always is true
-   'W' => print 'b' or 'w'
+   'W' => print 'b' or 'w' ("w" or "de" in intel mode)
 */
 
-static struct dis386 dis386_att[] = {
+static const struct dis386 dis386_att[] = {
   /* 00 */
-  { "addB",	Eb, Gb },
-  { "addS",	Ev, Gv },
-  { "addB",	Gb, Eb },
-  { "addS",	Gv, Ev },
-  { "addB",	AL, Ib },
-  { "addS",	eAX, Iv },
-  { "pushP",	es },
-  { "popP",	es },
+  { "addB",	Eb, Gb, XX },
+  { "addS",	Ev, Gv, XX },
+  { "addB",	Gb, Eb, XX },
+  { "addS",	Gv, Ev, XX },
+  { "addB",	AL, Ib, XX },
+  { "addS",	eAX, Iv, XX },
+  { "pushP",	es, XX, XX },
+  { "popP",	es, XX, XX },
   /* 08 */
-  { "orB",	Eb, Gb },
-  { "orS",	Ev, Gv },
-  { "orB",	Gb, Eb },
-  { "orS",	Gv, Ev },
-  { "orB",	AL, Ib },
-  { "orS",	eAX, Iv },
-  { "pushP",	cs },
-  { "(bad)" },	/* 0x0f extended opcode escape */
+  { "orB",	Eb, Gb, XX },
+  { "orS",	Ev, Gv, XX },
+  { "orB",	Gb, Eb, XX },
+  { "orS",	Gv, Ev, XX },
+  { "orB",	AL, Ib, XX },
+  { "orS",	eAX, Iv, XX },
+  { "pushP",	cs, XX, XX },
+  { "(bad)",	XX, XX, XX },	/* 0x0f extended opcode escape */
   /* 10 */
-  { "adcB",	Eb, Gb },
-  { "adcS",	Ev, Gv },
-  { "adcB",	Gb, Eb },
-  { "adcS",	Gv, Ev },
-  { "adcB",	AL, Ib },
-  { "adcS",	eAX, Iv },
-  { "pushP",	ss },
-  { "popP",	ss },
+  { "adcB",	Eb, Gb, XX },
+  { "adcS",	Ev, Gv, XX },
+  { "adcB",	Gb, Eb, XX },
+  { "adcS",	Gv, Ev, XX },
+  { "adcB",	AL, Ib, XX },
+  { "adcS",	eAX, Iv, XX },
+  { "pushP",	ss, XX, XX },
+  { "popP",	ss, XX, XX },
   /* 18 */
-  { "sbbB",	Eb, Gb },
-  { "sbbS",	Ev, Gv },
-  { "sbbB",	Gb, Eb },
-  { "sbbS",	Gv, Ev },
-  { "sbbB",	AL, Ib },
-  { "sbbS",	eAX, Iv },
-  { "pushP",	ds },
-  { "popP",	ds },
+  { "sbbB",	Eb, Gb, XX },
+  { "sbbS",	Ev, Gv, XX },
+  { "sbbB",	Gb, Eb, XX },
+  { "sbbS",	Gv, Ev, XX },
+  { "sbbB",	AL, Ib, XX },
+  { "sbbS",	eAX, Iv, XX },
+  { "pushP",	ds, XX, XX },
+  { "popP",	ds, XX, XX },
   /* 20 */
-  { "andB",	Eb, Gb },
-  { "andS",	Ev, Gv },
-  { "andB",	Gb, Eb },
-  { "andS",	Gv, Ev },
-  { "andB",	AL, Ib },
-  { "andS",	eAX, Iv },
-  { "(bad)" },			/* SEG ES prefix */
-  { "daa" },
+  { "andB",	Eb, Gb, XX },
+  { "andS",	Ev, Gv, XX },
+  { "andB",	Gb, Eb, XX },
+  { "andS",	Gv, Ev, XX },
+  { "andB",	AL, Ib, XX },
+  { "andS",	eAX, Iv, XX },
+  { "(bad)",	XX, XX, XX },			/* SEG ES prefix */
+  { "daa",	XX, XX, XX },
   /* 28 */
-  { "subB",	Eb, Gb },
-  { "subS",	Ev, Gv },
-  { "subB",	Gb, Eb },
-  { "subS",	Gv, Ev },
-  { "subB",	AL, Ib },
-  { "subS",	eAX, Iv },
-  { "(bad)" },			/* SEG CS prefix */
-  { "das" },
+  { "subB",	Eb, Gb, XX },
+  { "subS",	Ev, Gv, XX },
+  { "subB",	Gb, Eb, XX },
+  { "subS",	Gv, Ev, XX },
+  { "subB",	AL, Ib, XX },
+  { "subS",	eAX, Iv, XX },
+  { "(bad)",	XX, XX, XX },			/* SEG CS prefix */
+  { "das",	XX, XX, XX },
   /* 30 */
-  { "xorB",	Eb, Gb },
-  { "xorS",	Ev, Gv },
-  { "xorB",	Gb, Eb },
-  { "xorS",	Gv, Ev },
-  { "xorB",	AL, Ib },
-  { "xorS",	eAX, Iv },
-  { "(bad)" },			/* SEG SS prefix */
-  { "aaa" },
+  { "xorB",	Eb, Gb, XX },
+  { "xorS",	Ev, Gv, XX },
+  { "xorB",	Gb, Eb, XX },
+  { "xorS",	Gv, Ev, XX },
+  { "xorB",	AL, Ib, XX },
+  { "xorS",	eAX, Iv, XX },
+  { "(bad)",	XX, XX, XX },			/* SEG SS prefix */
+  { "aaa",	XX, XX, XX },
   /* 38 */
-  { "cmpB",	Eb, Gb },
-  { "cmpS",	Ev, Gv },
-  { "cmpB",	Gb, Eb },
-  { "cmpS",	Gv, Ev },
-  { "cmpB",	AL, Ib },
-  { "cmpS",	eAX, Iv },
-  { "(bad)" },			/* SEG DS prefix */
-  { "aas" },
+  { "cmpB",	Eb, Gb, XX },
+  { "cmpS",	Ev, Gv, XX },
+  { "cmpB",	Gb, Eb, XX },
+  { "cmpS",	Gv, Ev, XX },
+  { "cmpB",	AL, Ib, XX },
+  { "cmpS",	eAX, Iv, XX },
+  { "(bad)",	XX, XX, XX },			/* SEG DS prefix */
+  { "aas",	XX, XX, XX },
   /* 40 */
-  { "incS",	eAX },
-  { "incS",	eCX },
-  { "incS",	eDX },
-  { "incS",	eBX },
-  { "incS",	eSP },
-  { "incS",	eBP },
-  { "incS",	eSI },
-  { "incS",	eDI },
+  { "incS",	eAX, XX, XX },
+  { "incS",	eCX, XX, XX },
+  { "incS",	eDX, XX, XX },
+  { "incS",	eBX, XX, XX },
+  { "incS",	eSP, XX, XX },
+  { "incS",	eBP, XX, XX },
+  { "incS",	eSI, XX, XX },
+  { "incS",	eDI, XX, XX },
   /* 48 */
-  { "decS",	eAX },
-  { "decS",	eCX },
-  { "decS",	eDX },
-  { "decS",	eBX },
-  { "decS",	eSP },
-  { "decS",	eBP },
-  { "decS",	eSI },
-  { "decS",	eDI },
+  { "decS",	eAX, XX, XX },
+  { "decS",	eCX, XX, XX },
+  { "decS",	eDX, XX, XX },
+  { "decS",	eBX, XX, XX },
+  { "decS",	eSP, XX, XX },
+  { "decS",	eBP, XX, XX },
+  { "decS",	eSI, XX, XX },
+  { "decS",	eDI, XX, XX },
   /* 50 */
-  { "pushS",	eAX },
-  { "pushS",	eCX },
-  { "pushS",	eDX },
-  { "pushS",	eBX },
-  { "pushS",	eSP },
-  { "pushS",	eBP },
-  { "pushS",	eSI },
-  { "pushS",	eDI },
+  { "pushS",	eAX, XX, XX },
+  { "pushS",	eCX, XX, XX },
+  { "pushS",	eDX, XX, XX },
+  { "pushS",	eBX, XX, XX },
+  { "pushS",	eSP, XX, XX },
+  { "pushS",	eBP, XX, XX },
+  { "pushS",	eSI, XX, XX },
+  { "pushS",	eDI, XX, XX },
   /* 58 */
-  { "popS",	eAX },
-  { "popS",	eCX },
-  { "popS",	eDX },
-  { "popS",	eBX },
-  { "popS",	eSP },
-  { "popS",	eBP },
-  { "popS",	eSI },
-  { "popS",	eDI },
+  { "popS",	eAX, XX, XX },
+  { "popS",	eCX, XX, XX },
+  { "popS",	eDX, XX, XX },
+  { "popS",	eBX, XX, XX },
+  { "popS",	eSP, XX, XX },
+  { "popS",	eBP, XX, XX },
+  { "popS",	eSI, XX, XX },
+  { "popS",	eDI, XX, XX },
   /* 60 */
-  { "pushaP" },
-  { "popaP" },
-  { "boundS",	Gv, Ma },
-  { "arpl",	Ew, Gw },
-  { "(bad)" },			/* seg fs */
-  { "(bad)" },			/* seg gs */
-  { "(bad)" },			/* op size prefix */
-  { "(bad)" },			/* adr size prefix */
+  { "pushaP",	XX, XX, XX },
+  { "popaP",	XX, XX, XX },
+  { "boundS",	Gv, Ma, XX },
+  { "arpl",	Ew, Gw, XX },
+  { "(bad)",	XX, XX, XX },			/* seg fs */
+  { "(bad)",	XX, XX, XX },			/* seg gs */
+  { "(bad)",	XX, XX, XX },			/* op size prefix */
+  { "(bad)",	XX, XX, XX },			/* adr size prefix */
   /* 68 */
-  { "pushP",	Iv },		/* 386 book wrong */
+  { "pushP",	Iv, XX, XX },		/* 386 book wrong */
   { "imulS",	Gv, Ev, Iv },
-  { "pushP",	sIb },		/* push of byte really pushes 2 or 4 bytes */
+  { "pushP",	sIb, XX, XX },	/* push of byte really pushes 2 or 4 bytes */
   { "imulS",	Gv, Ev, sIb },
-  { "insb",	Yb, indirDX },
-  { "insR",	Yv, indirDX },
-  { "outsb",	indirDX, Xb },
-  { "outsR",	indirDX, Xv },
+  { "insb",	Yb, indirDX, XX },
+  { "insR",	Yv, indirDX, XX },
+  { "outsb",	indirDX, Xb, XX },
+  { "outsR",	indirDX, Xv, XX },
   /* 70 */
-  { "jo",	Jb },
-  { "jno",	Jb },
-  { "jb",	Jb },
-  { "jae",	Jb },
-  { "je",	Jb },
-  { "jne",	Jb },
-  { "jbe",	Jb },
-  { "ja",	Jb },
+  { "jo",	Jb, XX, XX },
+  { "jno",	Jb, XX, XX },
+  { "jb",	Jb, XX, XX },
+  { "jae",	Jb, XX, XX },
+  { "je",	Jb, XX, XX },
+  { "jne",	Jb, XX, XX },
+  { "jbe",	Jb, XX, XX },
+  { "ja",	Jb, XX, XX },
   /* 78 */
-  { "js",	Jb },
-  { "jns",	Jb },
-  { "jp",	Jb },
-  { "jnp",	Jb },
-  { "jl",	Jb },
-  { "jge",	Jb },
-  { "jle",	Jb },
-  { "jg",	Jb },
+  { "js",	Jb, XX, XX },
+  { "jns",	Jb, XX, XX },
+  { "jp",	Jb, XX, XX },
+  { "jnp",	Jb, XX, XX },
+  { "jl",	Jb, XX, XX },
+  { "jge",	Jb, XX, XX },
+  { "jle",	Jb, XX, XX },
+  { "jg",	Jb, XX, XX },
   /* 80 */
   { GRP1b },
   { GRP1S },
-  { "(bad)" },
+  { "(bad)",	XX, XX, XX },
   { GRP1Ss },
-  { "testB",	Eb, Gb },
-  { "testS",	Ev, Gv },
-  { "xchgB",	Eb, Gb },
-  { "xchgS",	Ev, Gv },
+  { "testB",	Eb, Gb, XX },
+  { "testS",	Ev, Gv, XX },
+  { "xchgB",	Eb, Gb, XX },
+  { "xchgS",	Ev, Gv, XX },
   /* 88 */
-  { "movB",	Eb, Gb },
-  { "movS",	Ev, Gv },
-  { "movB",	Gb, Eb },
-  { "movS",	Gv, Ev },
-  { "movQ",	Ev, Sw },
-  { "leaS",	Gv, M },
-  { "movQ",	Sw, Ev },
-  { "popQ",	Ev },
+  { "movB",	Eb, Gb, XX },
+  { "movS",	Ev, Gv, XX },
+  { "movB",	Gb, Eb, XX },
+  { "movS",	Gv, Ev, XX },
+  { "movQ",	Ev, Sw, XX },
+  { "leaS",	Gv, M, XX },
+  { "movQ",	Sw, Ev, XX },
+  { "popQ",	Ev, XX, XX },
   /* 90 */
-  { "nop" },
-  { "xchgS",	eCX, eAX },
-  { "xchgS",	eDX, eAX },
-  { "xchgS",	eBX, eAX },
-  { "xchgS",	eSP, eAX },
-  { "xchgS",	eBP, eAX },
-  { "xchgS",	eSI, eAX },
-  { "xchgS",	eDI, eAX },
+  { "nop",	XX, XX, XX },
+  { "xchgS",	eCX, eAX, XX },
+  { "xchgS",	eDX, eAX, XX },
+  { "xchgS",	eBX, eAX, XX },
+  { "xchgS",	eSP, eAX, XX },
+  { "xchgS",	eBP, eAX, XX },
+  { "xchgS",	eSI, eAX, XX },
+  { "xchgS",	eDI, eAX, XX },
   /* 98 */
-  { "cWtR" },
-  { "cRtd" },
-  { "lcallP",	Ap },
-  { "(bad)" },		/* fwait */
-  { "pushfP" },
-  { "popfP" },
-  { "sahf" },
-  { "lahf" },
+  { "cWtR",	XX, XX, XX },
+  { "cRtd",	XX, XX, XX },
+  { "lcallP",	Ap, XX, XX },
+  { "(bad)",	XX, XX, XX },		/* fwait */
+  { "pushfP",	XX, XX, XX },
+  { "popfP",	XX, XX, XX },
+  { "sahf",	XX, XX, XX },
+  { "lahf",	XX, XX, XX },
   /* a0 */
-  { "movB",	AL, Ob },
-  { "movS",	eAX, Ov },
-  { "movB",	Ob, AL },
-  { "movS",	Ov, eAX },
-  { "movsb",	Yb, Xb },
-  { "movsR",	Yv, Xv },
-  { "cmpsb",	Xb, Yb },
-  { "cmpsR",	Xv, Yv },
+  { "movB",	AL, Ob, XX },
+  { "movS",	eAX, Ov, XX },
+  { "movB",	Ob, AL, XX },
+  { "movS",	Ov, eAX, XX },
+  { "movsb",	Yb, Xb, XX },
+  { "movsR",	Yv, Xv, XX },
+  { "cmpsb",	Xb, Yb, XX },
+  { "cmpsR",	Xv, Yv, XX },
   /* a8 */
-  { "testB",	AL, Ib },
-  { "testS",	eAX, Iv },
-  { "stosB",	Yb, AL },
-  { "stosS",	Yv, eAX },
-  { "lodsB",	AL, Xb },
-  { "lodsS",	eAX, Xv },
-  { "scasB",	AL, Yb },
-  { "scasS",	eAX, Yv },
+  { "testB",	AL, Ib, XX },
+  { "testS",	eAX, Iv, XX },
+  { "stosB",	Yb, AL, XX },
+  { "stosS",	Yv, eAX, XX },
+  { "lodsB",	AL, Xb, XX },
+  { "lodsS",	eAX, Xv, XX },
+  { "scasB",	AL, Yb, XX },
+  { "scasS",	eAX, Yv, XX },
   /* b0 */
-  { "movB",	AL, Ib },
-  { "movB",	CL, Ib },
-  { "movB",	DL, Ib },
-  { "movB",	BL, Ib },
-  { "movB",	AH, Ib },
-  { "movB",	CH, Ib },
-  { "movB",	DH, Ib },
-  { "movB",	BH, Ib },
+  { "movB",	AL, Ib, XX },
+  { "movB",	CL, Ib, XX },
+  { "movB",	DL, Ib, XX },
+  { "movB",	BL, Ib, XX },
+  { "movB",	AH, Ib, XX },
+  { "movB",	CH, Ib, XX },
+  { "movB",	DH, Ib, XX },
+  { "movB",	BH, Ib, XX },
   /* b8 */
-  { "movS",	eAX, Iv },
-  { "movS",	eCX, Iv },
-  { "movS",	eDX, Iv },
-  { "movS",	eBX, Iv },
-  { "movS",	eSP, Iv },
-  { "movS",	eBP, Iv },
-  { "movS",	eSI, Iv },
-  { "movS",	eDI, Iv },
+  { "movS",	eAX, Iv, XX },
+  { "movS",	eCX, Iv, XX },
+  { "movS",	eDX, Iv, XX },
+  { "movS",	eBX, Iv, XX },
+  { "movS",	eSP, Iv, XX },
+  { "movS",	eBP, Iv, XX },
+  { "movS",	eSI, Iv, XX },
+  { "movS",	eDI, Iv, XX },
   /* c0 */
   { GRP2b },
   { GRP2S },
-  { "retP",	Iw },
-  { "retP" },
-  { "lesS",	Gv, Mp },
-  { "ldsS",	Gv, Mp },
-  { "movA",	Eb, Ib },
-  { "movQ",	Ev, Iv },
+  { "retP",	Iw, XX, XX },
+  { "retP",	XX, XX, XX },
+  { "lesS",	Gv, Mp, XX },
+  { "ldsS",	Gv, Mp, XX },
+  { "movA",	Eb, Ib, XX },
+  { "movQ",	Ev, Iv, XX },
   /* c8 */
-  { "enterP",	Iw, Ib },
-  { "leaveP" },
-  { "lretP",	Iw },
-  { "lretP" },
-  { "int3" },
-  { "int",	Ib },
-  { "into" },
-  { "iretP" },
+  { "enterP",	Iw, Ib, XX },
+  { "leaveP",	XX, XX, XX },
+  { "lretP",	Iw, XX, XX },
+  { "lretP",	XX, XX, XX },
+  { "int3",	XX, XX, XX },
+  { "int",	Ib, XX, XX },
+  { "into",	XX, XX, XX},
+  { "iretP",	XX, XX, XX },
   /* d0 */
   { GRP2b_one },
   { GRP2S_one },
   { GRP2b_cl },
   { GRP2S_cl },
-  { "aam",	sIb },
-  { "aad",	sIb },
-  { "(bad)" },
-  { "xlat",	DSBX },
+  { "aam",	sIb, XX, XX },
+  { "aad",	sIb, XX, XX },
+  { "(bad)",	XX, XX, XX },
+  { "xlat",	DSBX, XX, XX },
   /* d8 */
   { FLOAT },
   { FLOAT },
@@ -549,287 +602,287 @@
   { FLOAT },
   { FLOAT },
   /* e0 */
-  { "loopne",	Jb },
-  { "loope",	Jb },
-  { "loop",	Jb },
-  { "jEcxz",	Jb },
-  { "inB",	AL, Ib },
-  { "inS",	eAX, Ib },
-  { "outB",	Ib, AL },
-  { "outS",	Ib, eAX },
+  { "loopne",	Jb, XX, XX },
+  { "loope",	Jb, XX, XX },
+  { "loop",	Jb, XX, XX },
+  { "jEcxz",	Jb, XX, XX },
+  { "inB",	AL, Ib, XX },
+  { "inS",	eAX, Ib, XX },
+  { "outB",	Ib, AL, XX },
+  { "outS",	Ib, eAX, XX },
   /* e8 */
-  { "callP",	Av },
-  { "jmpP",	Jv },
-  { "ljmpP",	Ap },
-  { "jmp",	Jb },
-  { "inB",	AL, indirDX },
-  { "inS",	eAX, indirDX },
-  { "outB",	indirDX, AL },
-  { "outS",	indirDX, eAX },
+  { "callP",	Jv, XX, XX },
+  { "jmpP",	Jv, XX, XX },
+  { "ljmpP",	Ap, XX, XX },
+  { "jmp",	Jb, XX, XX },
+  { "inB",	AL, indirDX, XX },
+  { "inS",	eAX, indirDX, XX },
+  { "outB",	indirDX, AL, XX },
+  { "outS",	indirDX, eAX, XX },
   /* f0 */
-  { "(bad)" },			/* lock prefix */
-  { "(bad)" },
-  { "(bad)" },			/* repne */
-  { "(bad)" },			/* repz */
-  { "hlt" },
-  { "cmc" },
+  { "(bad)",	XX, XX, XX },			/* lock prefix */
+  { "(bad)",	XX, XX, XX },
+  { "(bad)",	XX, XX, XX },			/* repne */
+  { "(bad)",	XX, XX, XX },			/* repz */
+  { "hlt",	XX, XX, XX },
+  { "cmc",	XX, XX, XX },
   { GRP3b },
   { GRP3S },
   /* f8 */
-  { "clc" },
-  { "stc" },
-  { "cli" },
-  { "sti" },
-  { "cld" },
-  { "std" },
+  { "clc",	XX, XX, XX },
+  { "stc",	XX, XX, XX },
+  { "cli",	XX, XX, XX },
+  { "sti",	XX, XX, XX },
+  { "cld",	XX, XX, XX },
+  { "std",	XX, XX, XX },
   { GRP4 },
   { GRP5 },
 };
 
-static struct dis386 dis386_intel[] = {
+static const struct dis386 dis386_intel[] = {
   /* 00 */
-  { "addB",	Eb, Gb },
-  { "addS",	Ev, Gv },
-  { "addB",	Gb, Eb },
-  { "addS",	Gv, Ev },
-  { "addB",	AL, Ib },
-  { "addS",	eAX, Iv },
-  { "pushP",	es },
-  { "popP",	es },
+  { "add",	Eb, Gb, XX },
+  { "add",	Ev, Gv, XX },
+  { "add",	Gb, Eb, XX },
+  { "add",	Gv, Ev, XX },
+  { "add",	AL, Ib, XX },
+  { "add",	eAX, Iv, XX },
+  { "push",	es, XX, XX },
+  { "pop",	es, XX, XX },
   /* 08 */
-  { "orB",	Eb, Gb },
-  { "orS",	Ev, Gv },
-  { "orB",	Gb, Eb },
-  { "orS",	Gv, Ev },
-  { "orB",	AL, Ib },
-  { "orS",	eAX, Iv },
-  { "pushP",	cs },
-  { "(bad)" },	/* 0x0f extended opcode escape */
+  { "or",	Eb, Gb, XX },
+  { "or",	Ev, Gv, XX },
+  { "or",	Gb, Eb, XX },
+  { "or",	Gv, Ev, XX },
+  { "or",	AL, Ib, XX },
+  { "or",	eAX, Iv, XX },
+  { "push",	cs, XX, XX },
+  { "(bad)",	XX, XX, XX },	/* 0x0f extended opcode escape */
   /* 10 */
-  { "adcB",	Eb, Gb },
-  { "adcS",	Ev, Gv },
-  { "adcB",	Gb, Eb },
-  { "adcS",	Gv, Ev },
-  { "adcB",	AL, Ib },
-  { "adcS",	eAX, Iv },
-  { "pushP",	ss },
-  { "popP",	ss },
+  { "adc",	Eb, Gb, XX },
+  { "adc",	Ev, Gv, XX },
+  { "adc",	Gb, Eb, XX },
+  { "adc",	Gv, Ev, XX },
+  { "adc",	AL, Ib, XX },
+  { "adc",	eAX, Iv, XX },
+  { "push",	ss, XX, XX },
+  { "pop",	ss, XX, XX },
   /* 18 */
-  { "sbbB",	Eb, Gb },
-  { "sbbS",	Ev, Gv },
-  { "sbbB",	Gb, Eb },
-  { "sbbS",	Gv, Ev },
-  { "sbbB",	AL, Ib },
-  { "sbbS",	eAX, Iv },
-  { "pushP",	ds },
-  { "popP",	ds },
+  { "sbb",	Eb, Gb, XX },
+  { "sbb",	Ev, Gv, XX },
+  { "sbb",	Gb, Eb, XX },
+  { "sbb",	Gv, Ev, XX },
+  { "sbb",	AL, Ib, XX },
+  { "sbb",	eAX, Iv, XX },
+  { "push",	ds, XX, XX },
+  { "pop",	ds, XX, XX },
   /* 20 */
-  { "andB",	Eb, Gb },
-  { "andS",	Ev, Gv },
-  { "andB",	Gb, Eb },
-  { "andS",	Gv, Ev },
-  { "andB",	AL, Ib },
-  { "andS",	eAX, Iv },
-  { "(bad)" },			/* SEG ES prefix */
-  { "daa" },
+  { "and",	Eb, Gb, XX },
+  { "and",	Ev, Gv, XX },
+  { "and",	Gb, Eb, XX },
+  { "and",	Gv, Ev, XX },
+  { "and",	AL, Ib, XX },
+  { "and",	eAX, Iv, XX },
+  { "(bad)",	XX, XX, XX },			/* SEG ES prefix */
+  { "daa",	XX, XX, XX },
   /* 28 */
-  { "subB",	Eb, Gb },
-  { "subS",	Ev, Gv },
-  { "subB",	Gb, Eb },
-  { "subS",	Gv, Ev },
-  { "subB",	AL, Ib },
-  { "subS",	eAX, Iv },
-  { "(bad)" },			/* SEG CS prefix */
-  { "das" },
+  { "sub",	Eb, Gb, XX },
+  { "sub",	Ev, Gv, XX },
+  { "sub",	Gb, Eb, XX },
+  { "sub",	Gv, Ev, XX },
+  { "sub",	AL, Ib, XX },
+  { "sub",	eAX, Iv, XX },
+  { "(bad)",	XX, XX, XX },			/* SEG CS prefix */
+  { "das",	XX, XX, XX },
   /* 30 */
-  { "xorB",	Eb, Gb },
-  { "xorS",	Ev, Gv },
-  { "xorB",	Gb, Eb },
-  { "xorS",	Gv, Ev },
-  { "xorB",	AL, Ib },
-  { "xorS",	eAX, Iv },
-  { "(bad)" },			/* SEG SS prefix */
-  { "aaa" },
+  { "xor",	Eb, Gb, XX },
+  { "xor",	Ev, Gv, XX },
+  { "xor",	Gb, Eb, XX },
+  { "xor",	Gv, Ev, XX },
+  { "xor",	AL, Ib, XX },
+  { "xor",	eAX, Iv, XX },
+  { "(bad)",	XX, XX, XX },			/* SEG SS prefix */
+  { "aaa",	XX, XX, XX },
   /* 38 */
-  { "cmpB",	Eb, Gb },
-  { "cmpS",	Ev, Gv },
-  { "cmpB",	Gb, Eb },
-  { "cmpS",	Gv, Ev },
-  { "cmpB",	AL, Ib },
-  { "cmpS",	eAX, Iv },
-  { "(bad)" },			/* SEG DS prefix */
-  { "aas" },
+  { "cmp",	Eb, Gb, XX },
+  { "cmp",	Ev, Gv, XX },
+  { "cmp",	Gb, Eb, XX },
+  { "cmp",	Gv, Ev, XX },
+  { "cmp",	AL, Ib, XX },
+  { "cmp",	eAX, Iv, XX },
+  { "(bad)",	XX, XX, XX },			/* SEG DS prefix */
+  { "aas",	XX, XX, XX },
   /* 40 */
-  { "incS",	eAX },
-  { "incS",	eCX },
-  { "incS",	eDX },
-  { "incS",	eBX },
-  { "incS",	eSP },
-  { "incS",	eBP },
-  { "incS",	eSI },
-  { "incS",	eDI },
+  { "inc",	eAX, XX, XX },
+  { "inc",	eCX, XX, XX },
+  { "inc",	eDX, XX, XX },
+  { "inc",	eBX, XX, XX },
+  { "inc",	eSP, XX, XX },
+  { "inc",	eBP, XX, XX },
+  { "inc",	eSI, XX, XX },
+  { "inc",	eDI, XX, XX },
   /* 48 */
-  { "decS",	eAX },
-  { "decS",	eCX },
-  { "decS",	eDX },
-  { "decS",	eBX },
-  { "decS",	eSP },
-  { "decS",	eBP },
-  { "decS",	eSI },
-  { "decS",	eDI },
+  { "dec",	eAX, XX, XX },
+  { "dec",	eCX, XX, XX },
+  { "dec",	eDX, XX, XX },
+  { "dec",	eBX, XX, XX },
+  { "dec",	eSP, XX, XX },
+  { "dec",	eBP, XX, XX },
+  { "dec",	eSI, XX, XX },
+  { "dec",	eDI, XX, XX },
   /* 50 */
-  { "pushS",	eAX },
-  { "pushS",	eCX },
-  { "pushS",	eDX },
-  { "pushS",	eBX },
-  { "pushS",	eSP },
-  { "pushS",	eBP },
-  { "pushS",	eSI },
-  { "pushS",	eDI },
+  { "push",	eAX, XX, XX },
+  { "push",	eCX, XX, XX },
+  { "push",	eDX, XX, XX },
+  { "push",	eBX, XX, XX },
+  { "push",	eSP, XX, XX },
+  { "push",	eBP, XX, XX },
+  { "push",	eSI, XX, XX },
+  { "push",	eDI, XX, XX },
   /* 58 */
-  { "popS",	eAX },
-  { "popS",	eCX },
-  { "popS",	eDX },
-  { "popS",	eBX },
-  { "popS",	eSP },
-  { "popS",	eBP },
-  { "popS",	eSI },
-  { "popS",	eDI },
+  { "pop",	eAX, XX, XX },
+  { "pop",	eCX, XX, XX },
+  { "pop",	eDX, XX, XX },
+  { "pop",	eBX, XX, XX },
+  { "pop",	eSP, XX, XX },
+  { "pop",	eBP, XX, XX },
+  { "pop",	eSI, XX, XX },
+  { "pop",	eDI, XX, XX },
   /* 60 */
-  { "pushaP" },
-  { "popaP" },
-  { "boundS",	Gv, Ma },
-  { "arpl",	Ew, Gw },
-  { "(bad)" },			/* seg fs */
-  { "(bad)" },			/* seg gs */
-  { "(bad)" },			/* op size prefix */
-  { "(bad)" },			/* adr size prefix */
+  { "pusha",	XX, XX, XX },
+  { "popa",	XX, XX, XX },
+  { "bound",	Gv, Ma, XX },
+  { "arpl",	Ew, Gw, XX },
+  { "(bad)",	XX, XX, XX },			/* seg fs */
+  { "(bad)",	XX, XX, XX },			/* seg gs */
+  { "(bad)",	XX, XX, XX },			/* op size prefix */
+  { "(bad)",	XX, XX, XX },			/* adr size prefix */
   /* 68 */
-  { "pushP",	Iv },		/* 386 book wrong */
-  { "imulS",	Gv, Ev, Iv },
-  { "pushP",	sIb },		/* push of byte really pushes 2 or 4 bytes */
-  { "imulS",	Gv, Ev, sIb },
-  { "insb",	Yb, indirDX },
-  { "insR",	Yv, indirDX },
-  { "outsb",	indirDX, Xb },
-  { "outsR",	indirDX, Xv },
+  { "push",	Iv, XX, XX },		/* 386 book wrong */
+  { "imul",	Gv, Ev, Iv },
+  { "push",	sIb, XX, XX },	/* push of byte really pushes 2 or 4 bytes */
+  { "imul",	Gv, Ev, sIb },
+  { "ins",	Yb, indirDX, XX },
+  { "ins",	Yv, indirDX, XX },
+  { "outs",	indirDX, Xb, XX },
+  { "outs",	indirDX, Xv, XX },
   /* 70 */
-  { "jo",	Jb },
-  { "jno",	Jb },
-  { "jb",	Jb },
-  { "jae",	Jb },
-  { "je",	Jb },
-  { "jne",	Jb },
-  { "jbe",	Jb },
-  { "ja",	Jb },
+  { "jo",	Jb, XX, XX },
+  { "jno",	Jb, XX, XX },
+  { "jb",	Jb, XX, XX },
+  { "jae",	Jb, XX, XX },
+  { "je",	Jb, XX, XX },
+  { "jne",	Jb, XX, XX },
+  { "jbe",	Jb, XX, XX },
+  { "ja",	Jb, XX, XX },
   /* 78 */
-  { "js",	Jb },
-  { "jns",	Jb },
-  { "jp",	Jb },
-  { "jnp",	Jb },
-  { "jl",	Jb },
-  { "jge",	Jb },
-  { "jle",	Jb },
-  { "jg",	Jb },
+  { "js",	Jb, XX, XX },
+  { "jns",	Jb, XX, XX },
+  { "jp",	Jb, XX, XX },
+  { "jnp",	Jb, XX, XX },
+  { "jl",	Jb, XX, XX },
+  { "jge",	Jb, XX, XX },
+  { "jle",	Jb, XX, XX },
+  { "jg",	Jb, XX, XX },
   /* 80 */
   { GRP1b },
   { GRP1S },
-  { "(bad)" },
+  { "(bad)",	XX, XX, XX },
   { GRP1Ss },
-  { "testB",	Eb, Gb },
-  { "testS",	Ev, Gv },
-  { "xchgB",	Eb, Gb },
-  { "xchgS",	Ev, Gv },
+  { "test",	Eb, Gb, XX },
+  { "test",	Ev, Gv, XX },
+  { "xchg",	Eb, Gb, XX },
+  { "xchg",	Ev, Gv, XX },
   /* 88 */
-  { "movB",	Eb, Gb },
-  { "movS",	Ev, Gv },
-  { "movB",	Gb, Eb },
-  { "movS",	Gv, Ev },
-  { "movQ",	Ev, Sw },
-  { "leaS",	Gv, M },
-  { "movQ",	Sw, Ev },
-  { "popQ",	Ev },
+  { "mov",	Eb, Gb, XX },
+  { "mov",	Ev, Gv, XX },
+  { "mov",	Gb, Eb, XX },
+  { "mov",	Gv, Ev, XX },
+  { "mov",	Ev, Sw, XX },
+  { "lea",	Gv, M, XX },
+  { "mov",	Sw, Ev, XX },
+  { "pop",	Ev, XX, XX },
   /* 90 */
-  { "nop" },
-  { "xchgS",	eCX, eAX },
-  { "xchgS",	eDX, eAX },
-  { "xchgS",	eBX, eAX },
-  { "xchgS",	eSP, eAX },
-  { "xchgS",	eBP, eAX },
-  { "xchgS",	eSI, eAX },
-  { "xchgS",	eDI, eAX },
+  { "nop",	XX, XX, XX },
+  { "xchg",	eCX, eAX, XX },
+  { "xchg",	eDX, eAX, XX },
+  { "xchg",	eBX, eAX, XX },
+  { "xchg",	eSP, eAX, XX },
+  { "xchg",	eBP, eAX, XX },
+  { "xchg",	eSI, eAX, XX },
+  { "xchg",	eDI, eAX, XX },
   /* 98 */
-  { "cWtR" },
-  { "cRtd" },
-  { "lcallP",	Ap },
-  { "(bad)" },		/* fwait */
-  { "pushfP" },
-  { "popfP" },
-  { "sahf" },
-  { "lahf" },
+  { "cW",	XX, XX, XX },		/* cwde and cbw */
+  { "cR",	XX, XX, XX },		/* cdq and cwd */
+  { "lcall",	Ap, XX, XX },
+  { "(bad)",	XX, XX, XX },		/* fwait */
+  { "pushf",	XX, XX, XX },
+  { "popf",	XX, XX, XX },
+  { "sahf",	XX, XX, XX },
+  { "lahf",	XX, XX, XX },
   /* a0 */
-  { "movB",	AL, Ob },
-  { "movS",	eAX, Ov },
-  { "movB",	Ob, AL },
-  { "movS",	Ov, eAX },
-  { "movsb",	Yb, Xb },
-  { "movsR",	Yv, Xv },
-  { "cmpsb",	Xb, Yb },
-  { "cmpsR",	Xv, Yv },
+  { "mov",	AL, Ob, XX },
+  { "mov",	eAX, Ov, XX },
+  { "mov",	Ob, AL, XX },
+  { "mov",	Ov, eAX, XX },
+  { "movs",	Yb, Xb, XX },
+  { "movs",	Yv, Xv, XX },
+  { "cmps",	Xb, Yb, XX },
+  { "cmps",	Xv, Yv, XX },
   /* a8 */
-  { "testB",	AL, Ib },
-  { "testS",	eAX, Iv },
-  { "stosB",	Yb, AL },
-  { "stosS",	Yv, eAX },
-  { "lodsB",	AL, Xb },
-  { "lodsS",	eAX, Xv },
-  { "scasB",	AL, Yb },
-  { "scasS",	eAX, Yv },
+  { "test",	AL, Ib, XX },
+  { "test",	eAX, Iv, XX },
+  { "stos",	Yb, AL, XX },
+  { "stos",	Yv, eAX, XX },
+  { "lods",	AL, Xb, XX },
+  { "lods",	eAX, Xv, XX },
+  { "scas",	AL, Yb, XX },
+  { "scas",	eAX, Yv, XX },
   /* b0 */
-  { "movB",	AL, Ib },
-  { "movB",	CL, Ib },
-  { "movB",	DL, Ib },
-  { "movB",	BL, Ib },
-  { "movB",	AH, Ib },
-  { "movB",	CH, Ib },
-  { "movB",	DH, Ib },
-  { "movB",	BH, Ib },
+  { "mov",	AL, Ib, XX },
+  { "mov",	CL, Ib, XX },
+  { "mov",	DL, Ib, XX },
+  { "mov",	BL, Ib, XX },
+  { "mov",	AH, Ib, XX },
+  { "mov",	CH, Ib, XX },
+  { "mov",	DH, Ib, XX },
+  { "mov",	BH, Ib, XX },
   /* b8 */
-  { "movS",	eAX, Iv },
-  { "movS",	eCX, Iv },
-  { "movS",	eDX, Iv },
-  { "movS",	eBX, Iv },
-  { "movS",	eSP, Iv },
-  { "movS",	eBP, Iv },
-  { "movS",	eSI, Iv },
-  { "movS",	eDI, Iv },
+  { "mov",	eAX, Iv, XX },
+  { "mov",	eCX, Iv, XX },
+  { "mov",	eDX, Iv, XX },
+  { "mov",	eBX, Iv, XX },
+  { "mov",	eSP, Iv, XX },
+  { "mov",	eBP, Iv, XX },
+  { "mov",	eSI, Iv, XX },
+  { "mov",	eDI, Iv, XX },
   /* c0 */
   { GRP2b },
   { GRP2S },
-  { "retP",	Iw },
-  { "retP" },
-  { "lesS",	Gv, Mp },
-  { "ldsS",	Gv, Mp },
-  { "movA",	Eb, Ib },
-  { "movQ",	Ev, Iv },
+  { "ret",	Iw, XX, XX },
+  { "ret",	XX, XX, XX },
+  { "les",	Gv, Mp, XX },
+  { "lds",	Gv, Mp, XX },
+  { "mov",	Eb, Ib, XX },
+  { "mov",	Ev, Iv, XX },
   /* c8 */
-  { "enterP",	Iw, Ib },
-  { "leaveP" },
-  { "lretP",	Iw },
-  { "lretP" },
-  { "int3" },
-  { "int",	Ib },
-  { "into" },
-  { "iretP" },
+  { "enter",	Iw, Ib, XX },
+  { "leave",	XX, XX, XX },
+  { "lret",	Iw, XX, XX },
+  { "lret",	XX, XX, XX },
+  { "int3",	XX, XX, XX },
+  { "int",	Ib, XX, XX },
+  { "into",	XX, XX, XX },
+  { "iret",	XX, XX, XX },
   /* d0 */
   { GRP2b_one },
   { GRP2S_one },
   { GRP2b_cl },
   { GRP2S_cl },
-  { "aam",	sIb },
-  { "aad",	sIb },
-  { "(bad)" },
-  { "xlat",	DSBX },
+  { "aam",	sIb, XX, XX },
+  { "aad",	sIb, XX, XX },
+  { "(bad)",	XX, XX, XX },
+  { "xlat",	DSBX, XX, XX },
   /* d8 */
   { FLOAT },
   { FLOAT },
@@ -840,539 +893,694 @@
   { FLOAT },
   { FLOAT },
   /* e0 */
-  { "loopne",	Jb },
-  { "loope",	Jb },
-  { "loop",	Jb },
-  { "jEcxz",	Jb },
-  { "inB",	AL, Ib },
-  { "inS",	eAX, Ib },
-  { "outB",	Ib, AL },
-  { "outS",	Ib, eAX },
+  { "loopne",	Jb, XX, XX },
+  { "loope",	Jb, XX, XX },
+  { "loop",	Jb, XX, XX },
+  { "jEcxz",	Jb, XX, XX },
+  { "in",	AL, Ib, XX },
+  { "in",	eAX, Ib, XX },
+  { "out",	Ib, AL, XX },
+  { "out",	Ib, eAX, XX },
   /* e8 */
-  { "callP",	Av },
-  { "jmpP",	Jv },
-  { "ljmpP",	Ap },
-  { "jmp",	Jb },
-  { "inB",	AL, indirDX },
-  { "inS",	eAX, indirDX },
-  { "outB",	indirDX, AL },
-  { "outS",	indirDX, eAX },
+  { "call",	Jv, XX, XX },
+  { "jmp",	Jv, XX, XX },
+  { "ljmp",	Ap, XX, XX },
+  { "jmp",	Jb, XX, XX },
+  { "in",	AL, indirDX, XX },
+  { "in",	eAX, indirDX, XX },
+  { "out",	indirDX, AL, XX },
+  { "out",	indirDX, eAX, XX },
   /* f0 */
-  { "(bad)" },			/* lock prefix */
-  { "(bad)" },
-  { "(bad)" },			/* repne */
-  { "(bad)" },			/* repz */
-  { "hlt" },
-  { "cmc" },
+  { "(bad)",	XX, XX, XX },			/* lock prefix */
+  { "(bad)",	XX, XX, XX },
+  { "(bad)",	XX, XX, XX },			/* repne */
+  { "(bad)",	XX, XX, XX },			/* repz */
+  { "hlt",	XX, XX, XX },
+  { "cmc",	XX, XX, XX },
   { GRP3b },
   { GRP3S },
   /* f8 */
-  { "clc" },
-  { "stc" },
-  { "cli" },
-  { "sti" },
-  { "cld" },
-  { "std" },
+  { "clc",	XX, XX, XX },
+  { "stc",	XX, XX, XX },
+  { "cli",	XX, XX, XX },
+  { "sti",	XX, XX, XX },
+  { "cld",	XX, XX, XX },
+  { "std",	XX, XX, XX },
   { GRP4 },
   { GRP5 },
 };
 
-static struct dis386 dis386_twobyte_att[] = {
+static const struct dis386 dis386_twobyte_att[] = {
   /* 00 */
   { GRP6 },
   { GRP7 },
-  { "larS", Gv, Ew },
-  { "lslS", Gv, Ew },
-  { "(bad)" },
-  { "(bad)" },
-  { "clts" },
-  { "(bad)" },
+  { "larS", Gv, Ew, XX },
+  { "lslS", Gv, Ew, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "clts", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
   /* 08 */
-  { "invd" },
-  { "wbinvd" },
-  { "(bad)" },
-  { "ud2a" },
-  { "(bad)" },
-  { GRP14 },
-  { "femms" },
+  { "invd", XX, XX, XX },
+  { "wbinvd", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "ud2a", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { GRPAMD },
+  { "femms", XX, XX, XX },
   { "", MX, EM, OPSUF }, /* See OP_3DNowSuffix */
   /* 10 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { PREGRP8 },
+  { PREGRP9 },
+  { "movlps", XM, EX, SIMD_Fixup, 'h' },  /* really only 2 operands */
+  { "movlps", EX, XM, SIMD_Fixup, 'h' },
+  { "unpcklps", XM, EX, XX },
+  { "unpckhps", XM, EX, XX },
+  { "movhps", XM, EX, SIMD_Fixup, 'l' },
+  { "movhps", EX, XM, SIMD_Fixup, 'l' },
   /* 18 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { GRP14 },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
   /* 20 */
   /* these are all backward in appendix A of the intel book */
-  { "movL", Rd, Cd },
-  { "movL", Rd, Dd },
-  { "movL", Cd, Rd },
-  { "movL", Dd, Rd },
-  { "movL", Rd, Td },
-  { "(bad)" },
-  { "movL", Td, Rd },
-  { "(bad)" },
+  { "movL", Rd, Cd, XX },
+  { "movL", Rd, Dd, XX },
+  { "movL", Cd, Rd, XX },
+  { "movL", Dd, Rd, XX },
+  { "movL", Rd, Td, XX },
+  { "(bad)", XX, XX, XX },
+  { "movL", Td, Rd, XX },
+  { "(bad)", XX, XX, XX },
   /* 28 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { "movaps", XM, EX, XX },
+  { "movaps", EX, XM, XX },
+  { PREGRP2 },
+  { "movntps", Ev, XM, XX },
+  { PREGRP4 },
+  { PREGRP3 },
+  { "ucomiss", XM, EX, XX },
+  { "comiss", XM, EX, XX },
   /* 30 */
-  { "wrmsr" },  { "rdtsc" },  { "rdmsr" },  { "rdpmc" },
-  { "sysenter" },  { "sysexit" },  { "(bad)" },  { "(bad)" },
+  { "wrmsr", XX, XX, XX },
+  { "rdtsc", XX, XX, XX },
+  { "rdmsr", XX, XX, XX },
+  { "rdpmc", XX, XX, XX },
+  { "sysenter", XX, XX, XX },
+  { "sysexit", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
   /* 38 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
   /* 40 */
-  { "cmovo", Gv,Ev }, { "cmovno", Gv,Ev }, { "cmovb", Gv,Ev }, { "cmovae", Gv,Ev },
-  { "cmove", Gv,Ev }, { "cmovne", Gv,Ev }, { "cmovbe", Gv,Ev }, { "cmova", Gv,Ev },
+  { "cmovo", Gv, Ev, XX },
+  { "cmovno", Gv, Ev, XX },
+  { "cmovb", Gv, Ev, XX },
+  { "cmovae", Gv, Ev, XX },
+  { "cmove", Gv, Ev, XX },
+  { "cmovne", Gv, Ev, XX },
+  { "cmovbe", Gv, Ev, XX },
+  { "cmova", Gv, Ev, XX },
   /* 48 */
-  { "cmovs", Gv,Ev }, { "cmovns", Gv,Ev }, { "cmovp", Gv,Ev }, { "cmovnp", Gv,Ev },
-  { "cmovl", Gv,Ev }, { "cmovge", Gv,Ev }, { "cmovle", Gv,Ev }, { "cmovg", Gv,Ev },
+  { "cmovs", Gv, Ev, XX },
+  { "cmovns", Gv, Ev, XX },
+  { "cmovp", Gv, Ev, XX },
+  { "cmovnp", Gv, Ev, XX },
+  { "cmovl", Gv, Ev, XX },
+  { "cmovge", Gv, Ev, XX },
+  { "cmovle", Gv, Ev, XX },
+  { "cmovg", Gv, Ev, XX },
   /* 50 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { "movmskps", Gv, EX, XX },
+  { PREGRP13 },
+  { PREGRP12 },
+  { PREGRP11 },
+  { "andps", XM, EX, XX },
+  { "andnps", XM, EX, XX },
+  { "orps", XM, EX, XX },
+  { "xorps", XM, EX, XX },
   /* 58 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { PREGRP0 },
+  { PREGRP10 },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { PREGRP14 },
+  { PREGRP7 },
+  { PREGRP5 },
+  { PREGRP6 },
   /* 60 */
-  { "punpcklbw", MX, EM },
-  { "punpcklwd", MX, EM },
-  { "punpckldq", MX, EM },
-  { "packsswb", MX, EM },
-  { "pcmpgtb", MX, EM },
-  { "pcmpgtw", MX, EM },
-  { "pcmpgtd", MX, EM },
-  { "packuswb", MX, EM },
+  { "punpcklbw", MX, EM, XX },
+  { "punpcklwd", MX, EM, XX },
+  { "punpckldq", MX, EM, XX },
+  { "packsswb", MX, EM, XX },
+  { "pcmpgtb", MX, EM, XX },
+  { "pcmpgtw", MX, EM, XX },
+  { "pcmpgtd", MX, EM, XX },
+  { "packuswb", MX, EM, XX },
   /* 68 */
-  { "punpckhbw", MX, EM },
-  { "punpckhwd", MX, EM },
-  { "punpckhdq", MX, EM },
-  { "packssdw", MX, EM },
-  { "(bad)" },  { "(bad)" },
-  { "movd", MX, Ev },
-  { "movq", MX, EM },
+  { "punpckhbw", MX, EM, XX },
+  { "punpckhwd", MX, EM, XX },
+  { "punpckhdq", MX, EM, XX },
+  { "packssdw", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "movd", MX, Ed, XX },
+  { "movq", MX, EM, XX },
   /* 70 */
-  { "(bad)" },
+  { "pshufw", MX, EM, Ib },
   { GRP10 },
   { GRP11 },
   { GRP12 },
-  { "pcmpeqb", MX, EM },
-  { "pcmpeqw", MX, EM },
-  { "pcmpeqd", MX, EM },
-  { "emms" },
+  { "pcmpeqb", MX, EM, XX },
+  { "pcmpeqw", MX, EM, XX },
+  { "pcmpeqd", MX, EM, XX },
+  { "emms", XX, XX, XX },
   /* 78 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },
-  { "movd", Ev, MX },
-  { "movq", EM, MX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "movd", Ed, MX, XX },
+  { "movq", EM, MX, XX },
   /* 80 */
-  { "jo", Jv },
-  { "jno", Jv },
-  { "jb", Jv },
-  { "jae", Jv },
-  { "je", Jv },
-  { "jne", Jv },
-  { "jbe", Jv },
-  { "ja", Jv },
+  { "jo", Jv, XX, XX },
+  { "jno", Jv, XX, XX },
+  { "jb", Jv, XX, XX },
+  { "jae", Jv, XX, XX },
+  { "je", Jv, XX, XX },
+  { "jne", Jv, XX, XX },
+  { "jbe", Jv, XX, XX },
+  { "ja", Jv, XX, XX },
   /* 88 */
-  { "js", Jv },
-  { "jns", Jv },
-  { "jp", Jv },
-  { "jnp", Jv },
-  { "jl", Jv },
-  { "jge", Jv },
-  { "jle", Jv },
-  { "jg", Jv },
+  { "js", Jv, XX, XX },
+  { "jns", Jv, XX, XX },
+  { "jp", Jv, XX, XX },
+  { "jnp", Jv, XX, XX },
+  { "jl", Jv, XX, XX },
+  { "jge", Jv, XX, XX },
+  { "jle", Jv, XX, XX },
+  { "jg", Jv, XX, XX },
   /* 90 */
-  { "seto", Eb },
-  { "setno", Eb },
-  { "setb", Eb },
-  { "setae", Eb },
-  { "sete", Eb },
-  { "setne", Eb },
-  { "setbe", Eb },
-  { "seta", Eb },
+  { "seto", Eb, XX, XX },
+  { "setno", Eb, XX, XX },
+  { "setb", Eb, XX, XX },
+  { "setae", Eb, XX, XX },
+  { "sete", Eb, XX, XX },
+  { "setne", Eb, XX, XX },
+  { "setbe", Eb, XX, XX },
+  { "seta", Eb, XX, XX },
   /* 98 */
-  { "sets", Eb },
-  { "setns", Eb },
-  { "setp", Eb },
-  { "setnp", Eb },
-  { "setl", Eb },
-  { "setge", Eb },
-  { "setle", Eb },
-  { "setg", Eb },
+  { "sets", Eb, XX, XX },
+  { "setns", Eb, XX, XX },
+  { "setp", Eb, XX, XX },
+  { "setnp", Eb, XX, XX },
+  { "setl", Eb, XX, XX },
+  { "setge", Eb, XX, XX },
+  { "setle", Eb, XX, XX },
+  { "setg", Eb, XX, XX },
   /* a0 */
-  { "pushP", fs },
-  { "popP", fs },
-  { "cpuid" },
-  { "btS", Ev, Gv },
+  { "pushP", fs, XX, XX },
+  { "popP", fs, XX, XX },
+  { "cpuid", XX, XX, XX },
+  { "btS", Ev, Gv, XX },
   { "shldS", Ev, Gv, Ib },
   { "shldS", Ev, Gv, CL },
-  { "(bad)" },
-  { "(bad)" },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
   /* a8 */
-  { "pushP", gs },
-  { "popP", gs },
-  { "rsm" },
-  { "btsS", Ev, Gv },
+  { "pushP", gs, XX, XX },
+  { "popP", gs, XX, XX },
+  { "rsm", XX, XX, XX },
+  { "btsS", Ev, Gv, XX },
   { "shrdS", Ev, Gv, Ib },
   { "shrdS", Ev, Gv, CL },
   { GRP13 },
-  { "imulS", Gv, Ev },
+  { "imulS", Gv, Ev, XX },
   /* b0 */
-  { "cmpxchgB", Eb, Gb },
-  { "cmpxchgS", Ev, Gv },
-  { "lssS", Gv, Mp },	/* 386 lists only Mp */
-  { "btrS", Ev, Gv },
-  { "lfsS", Gv, Mp },	/* 386 lists only Mp */
-  { "lgsS", Gv, Mp },	/* 386 lists only Mp */
-  { "movzbR", Gv, Eb },
-  { "movzwR", Gv, Ew }, /* yes, there really is movzww ! */
+  { "cmpxchgB", Eb, Gb, XX },
+  { "cmpxchgS", Ev, Gv, XX },
+  { "lssS", Gv, Mp, XX },
+  { "btrS", Ev, Gv, XX },
+  { "lfsS", Gv, Mp, XX },
+  { "lgsS", Gv, Mp, XX },
+  { "movzbR", Gv, Eb, XX },
+  { "movzwR", Gv, Ew, XX }, /* yes, there really is movzww ! */
   /* b8 */
-  { "(bad)" },
-  { "ud2b" },
+  { "(bad)", XX, XX, XX },
+  { "ud2b", XX, XX, XX },
   { GRP8 },
-  { "btcS", Ev, Gv },
-  { "bsfS", Gv, Ev },
-  { "bsrS", Gv, Ev },
-  { "movsbR", Gv, Eb },
-  { "movswR", Gv, Ew }, /* yes, there really is movsww ! */
+  { "btcS", Ev, Gv, XX },
+  { "bsfS", Gv, Ev, XX },
+  { "bsrS", Gv, Ev, XX },
+  { "movsbR", Gv, Eb, XX },
+  { "movswR", Gv, Ew, XX }, /* yes, there really is movsww ! */
   /* c0 */
-  { "xaddB", Eb, Gb },
-  { "xaddS", Ev, Gv },
-  { "(bad)" },
-  { "(bad)" },
-  { "(bad)" },
-  { "(bad)" },
-  { "(bad)" },
+  { "xaddB", Eb, Gb, XX },
+  { "xaddS", Ev, Gv, XX },
+  { PREGRP1 },
+  { "(bad)", XX, XX, XX },
+  { "pinsrw", MX, Ev, Ib },
+  { "pextrw", Ev, MX, Ib },
+  { "shufps", XM, EX, Ib },
   { GRP9 },
   /* c8 */
-  { "bswap", eAX },	/* bswap doesn't support 16 bit regs */
-  { "bswap", eCX },
-  { "bswap", eDX },
-  { "bswap", eBX },
-  { "bswap", eSP },
-  { "bswap", eBP },
-  { "bswap", eSI },
-  { "bswap", eDI },
+  { "bswap", eAX, XX, XX },	/* bswap doesn't support 16 bit regs */
+  { "bswap", eCX, XX, XX },
+  { "bswap", eDX, XX, XX },
+  { "bswap", eBX, XX, XX },
+  { "bswap", eSP, XX, XX },
+  { "bswap", eBP, XX, XX },
+  { "bswap", eSI, XX, XX },
+  { "bswap", eDI, XX, XX },
   /* d0 */
-  { "(bad)" },
-  { "psrlw", MX, EM },
-  { "psrld", MX, EM },
-  { "psrlq", MX, EM },
-  { "(bad)" },
-  { "pmullw", MX, EM },
-  { "(bad)" },  { "(bad)" },
+  { "(bad)", XX, XX, XX },
+  { "psrlw", MX, EM, XX },
+  { "psrld", MX, EM, XX },
+  { "psrlq", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "pmullw", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "pmovmskb", Ev, MX, XX },
   /* d8 */
-  { "psubusb", MX, EM },
-  { "psubusw", MX, EM },
-  { "(bad)" },
-  { "pand", MX, EM },
-  { "paddusb", MX, EM },
-  { "paddusw", MX, EM },
-  { "(bad)" },
-  { "pandn", MX, EM },
+  { "psubusb", MX, EM, XX },
+  { "psubusw", MX, EM, XX },
+  { "pminub", MX, EM, XX },
+  { "pand", MX, EM, XX },
+  { "paddusb", MX, EM, XX },
+  { "paddusw", MX, EM, XX },
+  { "pmaxub", MX, EM, XX },
+  { "pandn", MX, EM, XX },
   /* e0 */
-  { "(bad)" },
-  { "psraw", MX, EM },
-  { "psrad", MX, EM },
-  { "(bad)" },
-  { "(bad)" },
-  { "pmulhw", MX, EM },
-  { "(bad)" },  { "(bad)" },
+  { "pavgb", MX, EM, XX },
+  { "psraw", MX, EM, XX },
+  { "psrad", MX, EM, XX },
+  { "pavgw", MX, EM, XX },
+  { "pmulhuw", MX, EM, XX },
+  { "pmulhw", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "movntq", Ev, MX, XX },
   /* e8 */
-  { "psubsb", MX, EM },
-  { "psubsw", MX, EM },
-  { "(bad)" },
-  { "por", MX, EM },
-  { "paddsb", MX, EM },
-  { "paddsw", MX, EM },
-  { "(bad)" },
-  { "pxor", MX, EM },
+  { "psubsb", MX, EM, XX },
+  { "psubsw", MX, EM, XX },
+  { "pminsw", MX, EM, XX },
+  { "por", MX, EM, XX },
+  { "paddsb", MX, EM, XX },
+  { "paddsw", MX, EM, XX },
+  { "pmaxsw", MX, EM, XX },
+  { "pxor", MX, EM, XX },
   /* f0 */
-  { "(bad)" },
-  { "psllw", MX, EM },
-  { "pslld", MX, EM },
-  { "psllq", MX, EM },
-  { "(bad)" },
-  { "pmaddwd", MX, EM },
-  { "(bad)" },  { "(bad)" },
+  { "(bad)", XX, XX, XX },
+  { "psllw", MX, EM, XX },
+  { "pslld", MX, EM, XX },
+  { "psllq", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "pmaddwd", MX, EM, XX },
+  { "psadbw", MX, EM, XX },
+  { "maskmovq", MX, EM, XX },
   /* f8 */
-  { "psubb", MX, EM },
-  { "psubw", MX, EM },
-  { "psubd", MX, EM },
-  { "(bad)" },
-  { "paddb", MX, EM },
-  { "paddw", MX, EM },
-  { "paddd", MX, EM },
-  { "(bad)" }
+  { "psubb", MX, EM, XX },
+  { "psubw", MX, EM, XX },
+  { "psubd", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "paddb", MX, EM, XX },
+  { "paddw", MX, EM, XX },
+  { "paddd", MX, EM, XX },
+  { "(bad)", XX, XX, XX }
 };
 
-static struct dis386 dis386_twobyte_intel[] = {
+static const struct dis386 dis386_twobyte_intel[] = {
   /* 00 */
   { GRP6 },
   { GRP7 },
-  { "larS", Gv, Ew },
-  { "lslS", Gv, Ew },
-  { "(bad)" },
-  { "(bad)" },
-  { "clts" },
-  { "(bad)" },
+  { "lar", Gv, Ew, XX },
+  { "lsl", Gv, Ew, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "clts", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
   /* 08 */
-  { "invd" },
-  { "wbinvd" },
-  { "(bad)" },
-  { "ud2a" },
-  { "(bad)" },
-  { GRP14 },
-  { "femms" },
+  { "invd", XX, XX, XX },
+  { "wbinvd", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "ud2a", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { GRPAMD },
+  { "femms" , XX, XX, XX},
   { "", MX, EM, OPSUF }, /* See OP_3DNowSuffix */
   /* 10 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { PREGRP8 },
+  { PREGRP9 },
+  { "movlps", XM, EX, SIMD_Fixup, 'h' },  /* really only 2 operands */
+  { "movlps", EX, XM, SIMD_Fixup, 'h' },
+  { "unpcklps", XM, EX, XX },
+  { "unpckhps", XM, EX, XX },
+  { "movhps", XM, EX, SIMD_Fixup, 'l' },
+  { "movhps", EX, XM, SIMD_Fixup, 'l' },
   /* 18 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { GRP14 },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
   /* 20 */
   /* these are all backward in appendix A of the intel book */
-  { "movL", Rd, Cd },
-  { "movL", Rd, Dd },
-  { "movL", Cd, Rd },
-  { "movL", Dd, Rd },
-  { "movL", Rd, Td },
-  { "(bad)" },
-  { "movL", Td, Rd },
-  { "(bad)" },
+  { "mov", Rd, Cd, XX },
+  { "mov", Rd, Dd, XX },
+  { "mov", Cd, Rd, XX },
+  { "mov", Dd, Rd, XX },
+  { "mov", Rd, Td, XX },
+  { "(bad)", XX, XX, XX },
+  { "mov", Td, Rd, XX },
+  { "(bad)", XX, XX, XX },
   /* 28 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { "movaps", XM, EX, XX },
+  { "movaps", EX, XM, XX },
+  { PREGRP2 },
+  { "movntps", Ev, XM, XX },
+  { PREGRP4 },
+  { PREGRP3 },
+  { "ucomiss", XM, EX, XX },
+  { "comiss", XM, EX, XX },
   /* 30 */
-  { "wrmsr" },  { "rdtsc" },  { "rdmsr" },  { "rdpmc" },
-  { "sysenter" },  { "sysexit" },  { "(bad)" },  { "(bad)" },
+  { "wrmsr", XX, XX, XX },
+  { "rdtsc", XX, XX, XX },
+  { "rdmsr", XX, XX, XX },
+  { "rdpmc", XX, XX, XX },
+  { "sysenter", XX, XX, XX },
+  { "sysexit", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
   /* 38 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
   /* 40 */
-  { "cmovo", Gv,Ev }, { "cmovno", Gv,Ev }, { "cmovb", Gv,Ev }, { "cmovae", Gv,Ev },
-  { "cmove", Gv,Ev }, { "cmovne", Gv,Ev }, { "cmovbe", Gv,Ev }, { "cmova", Gv,Ev },
+  { "cmovo", Gv, Ev, XX },
+  { "cmovno", Gv, Ev, XX },
+  { "cmovb", Gv, Ev, XX },
+  { "cmovae", Gv, Ev, XX },
+  { "cmove", Gv, Ev, XX },
+  { "cmovne", Gv, Ev, XX },
+  { "cmovbe", Gv, Ev, XX },
+  { "cmova", Gv, Ev, XX },
   /* 48 */
-  { "cmovs", Gv,Ev }, { "cmovns", Gv,Ev }, { "cmovp", Gv,Ev }, { "cmovnp", Gv,Ev },
-  { "cmovl", Gv,Ev }, { "cmovge", Gv,Ev }, { "cmovle", Gv,Ev }, { "cmovg", Gv,Ev },
+  { "cmovs", Gv, Ev, XX },
+  { "cmovns", Gv, Ev, XX },
+  { "cmovp", Gv, Ev, XX },
+  { "cmovnp", Gv, Ev, XX },
+  { "cmovl", Gv, Ev, XX },
+  { "cmovge", Gv, Ev, XX },
+  { "cmovle", Gv, Ev, XX },
+  { "cmovg", Gv, Ev, XX },
   /* 50 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { "movmskps", Gv, EX, XX },
+  { PREGRP13 },
+  { PREGRP12 },
+  { PREGRP11 },
+  { "andps", XM, EX, XX },
+  { "andnps", XM, EX, XX },
+  { "orps", XM, EX, XX },
+  { "xorps", XM, EX, XX },
   /* 58 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
+  { PREGRP0 },
+  { PREGRP10 },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { PREGRP14 },
+  { PREGRP7 },
+  { PREGRP5 },
+  { PREGRP6 },
   /* 60 */
-  { "punpcklbw", MX, EM },
-  { "punpcklwd", MX, EM },
-  { "punpckldq", MX, EM },
-  { "packsswb", MX, EM },
-  { "pcmpgtb", MX, EM },
-  { "pcmpgtw", MX, EM },
-  { "pcmpgtd", MX, EM },
-  { "packuswb", MX, EM },
+  { "punpcklbw", MX, EM, XX },
+  { "punpcklwd", MX, EM, XX },
+  { "punpckldq", MX, EM, XX },
+  { "packsswb", MX, EM, XX },
+  { "pcmpgtb", MX, EM, XX },
+  { "pcmpgtw", MX, EM, XX },
+  { "pcmpgtd", MX, EM, XX },
+  { "packuswb", MX, EM, XX },
   /* 68 */
-  { "punpckhbw", MX, EM },
-  { "punpckhwd", MX, EM },
-  { "punpckhdq", MX, EM },
-  { "packssdw", MX, EM },
-  { "(bad)" },  { "(bad)" },
-  { "movd", MX, Ev },
-  { "movq", MX, EM },
+  { "punpckhbw", MX, EM, XX },
+  { "punpckhwd", MX, EM, XX },
+  { "punpckhdq", MX, EM, XX },
+  { "packssdw", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "movd", MX, Ed, XX },
+  { "movq", MX, EM, XX },
   /* 70 */
-  { "(bad)" },
+  { "pshufw", MX, EM, Ib },
   { GRP10 },
   { GRP11 },
   { GRP12 },
-  { "pcmpeqb", MX, EM },
-  { "pcmpeqw", MX, EM },
-  { "pcmpeqd", MX, EM },
-  { "emms" },
+  { "pcmpeqb", MX, EM, XX },
+  { "pcmpeqw", MX, EM, XX },
+  { "pcmpeqd", MX, EM, XX },
+  { "emms", XX, XX, XX },
   /* 78 */
-  { "(bad)" },  { "(bad)" },  { "(bad)" },  { "(bad)" },
-  { "(bad)" },  { "(bad)" },
-  { "movd", Ev, MX },
-  { "movq", EM, MX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
+  { "movd", Ed, MX, XX },
+  { "movq", EM, MX, XX },
   /* 80 */
-  { "jo", Jv },
-  { "jno", Jv },
-  { "jb", Jv },
-  { "jae", Jv },
-  { "je", Jv },
-  { "jne", Jv },
-  { "jbe", Jv },
-  { "ja", Jv },
+  { "jo", Jv, XX, XX },
+  { "jno", Jv, XX, XX },
+  { "jb", Jv, XX, XX },
+  { "jae", Jv, XX, XX },
+  { "je", Jv, XX, XX },
+  { "jne", Jv, XX, XX },
+  { "jbe", Jv, XX, XX },
+  { "ja", Jv, XX, XX },
   /* 88 */
-  { "js", Jv },
-  { "jns", Jv },
-  { "jp", Jv },
-  { "jnp", Jv },
-  { "jl", Jv },
-  { "jge", Jv },
-  { "jle", Jv },
-  { "jg", Jv },
+  { "js", Jv, XX, XX },
+  { "jns", Jv, XX, XX },
+  { "jp", Jv, XX, XX },
+  { "jnp", Jv, XX, XX },
+  { "jl", Jv, XX, XX },
+  { "jge", Jv, XX, XX },
+  { "jle", Jv, XX, XX },
+  { "jg", Jv, XX, XX },
   /* 90 */
-  { "seto", Eb },
-  { "setno", Eb },
-  { "setb", Eb },
-  { "setae", Eb },
-  { "sete", Eb },
-  { "setne", Eb },
-  { "setbe", Eb },
-  { "seta", Eb },
+  { "seto", Eb, XX, XX },
+  { "setno", Eb, XX, XX },
+  { "setb", Eb, XX, XX },
+  { "setae", Eb, XX, XX },
+  { "sete", Eb, XX, XX },
+  { "setne", Eb, XX, XX },
+  { "setbe", Eb, XX, XX },
+  { "seta", Eb, XX, XX },
   /* 98 */
-  { "sets", Eb },
-  { "setns", Eb },
-  { "setp", Eb },
-  { "setnp", Eb },
-  { "setl", Eb },
-  { "setge", Eb },
-  { "setle", Eb },
-  { "setg", Eb },
+  { "sets", Eb, XX, XX },
+  { "setns", Eb, XX, XX },
+  { "setp", Eb, XX, XX },
+  { "setnp", Eb, XX, XX },
+  { "setl", Eb, XX, XX },
+  { "setge", Eb, XX, XX },
+  { "setle", Eb, XX, XX },
+  { "setg", Eb, XX, XX },
   /* a0 */
-  { "pushP", fs },
-  { "popP", fs },
-  { "cpuid" },
-  { "btS", Ev, Gv },
-  { "shldS", Ev, Gv, Ib },
-  { "shldS", Ev, Gv, CL },
-  { "(bad)" },
-  { "(bad)" },
+  { "push", fs, XX, XX },
+  { "pop", fs, XX, XX },
+  { "cpuid", XX, XX, XX },
+  { "bt", Ev, Gv, XX },
+  { "shld", Ev, Gv, Ib },
+  { "shld", Ev, Gv, CL },
+  { "(bad)", XX, XX, XX },
+  { "(bad)", XX, XX, XX },
   /* a8 */
-  { "pushP", gs },
-  { "popP", gs },
-  { "rsm" },
-  { "btsS", Ev, Gv },
-  { "shrdS", Ev, Gv, Ib },
-  { "shrdS", Ev, Gv, CL },
+  { "push", gs, XX, XX },
+  { "pop", gs, XX, XX },
+  { "rsm" , XX, XX, XX},
+  { "bts", Ev, Gv, XX },
+  { "shrd", Ev, Gv, Ib },
+  { "shrd", Ev, Gv, CL },
   { GRP13 },
-  { "imulS", Gv, Ev },
+  { "imul", Gv, Ev, XX },
   /* b0 */
-  { "cmpxchgB", Eb, Gb },
-  { "cmpxchgS", Ev, Gv },
-  { "lssS", Gv, Mp },	/* 386 lists only Mp */
-  { "btrS", Ev, Gv },
-  { "lfsS", Gv, Mp },	/* 386 lists only Mp */
-  { "lgsS", Gv, Mp },	/* 386 lists only Mp */
-  { "movzx", Gv, Eb },
-  { "movzx", Gv, Ew },
+  { "cmpxchg", Eb, Gb, XX },
+  { "cmpxchg", Ev, Gv, XX },
+  { "lss", Gv, Mp, XX },
+  { "btr", Ev, Gv, XX },
+  { "lfs", Gv, Mp, XX },
+  { "lgs", Gv, Mp, XX },
+  { "movzx", Gv, Eb, XX },
+  { "movzx", Gv, Ew, XX },
   /* b8 */
-  { "(bad)" },
-  { "ud2b" },
+  { "(bad)", XX, XX, XX },
+  { "ud2b", XX, XX, XX },
   { GRP8 },
-  { "btcS", Ev, Gv },
-  { "bsfS", Gv, Ev },
-  { "bsrS", Gv, Ev },
-  { "movsx", Gv, Eb },
-  { "movsx", Gv, Ew },
+  { "btc", Ev, Gv, XX },
+  { "bsf", Gv, Ev, XX },
+  { "bsr", Gv, Ev, XX },
+  { "movsx", Gv, Eb, XX },
+  { "movsx", Gv, Ew, XX },
   /* c0 */
-  { "xaddB", Eb, Gb },
-  { "xaddS", Ev, Gv },
-  { "(bad)" },
-  { "(bad)" },
-  { "(bad)" },
-  { "(bad)" },
-  { "(bad)" },
+  { "xadd", Eb, Gb, XX },
+  { "xadd", Ev, Gv, XX },
+  { PREGRP1 },
+  { "(bad)", XX, XX, XX },
+  { "pinsrw", MX, Ev, Ib },
+  { "pextrw", Ev, MX, Ib },
+  { "shufps", XM, EX, Ib },
   { GRP9 },
   /* c8 */
-  { "bswap", eAX },	/* bswap doesn't support 16 bit regs */
-  { "bswap", eCX },
-  { "bswap", eDX },
-  { "bswap", eBX },
-  { "bswap", eSP },
-  { "bswap", eBP },
-  { "bswap", eSI },
-  { "bswap", eDI },
+  { "bswap", eAX, XX, XX },	/* bswap doesn't support 16 bit regs */
+  { "bswap", eCX, XX, XX },
+  { "bswap", eDX, XX, XX },
+  { "bswap", eBX, XX, XX },
+  { "bswap", eSP, XX, XX },
+  { "bswap", eBP, XX, XX },
+  { "bswap", eSI, XX, XX },
+  { "bswap", eDI, XX, XX },
   /* d0 */
-  { "(bad)" },
-  { "psrlw", MX, EM },
-  { "psrld", MX, EM },
-  { "psrlq", MX, EM },
-  { "(bad)" },
-  { "pmullw", MX, EM },
-  { "(bad)" },  { "(bad)" },
+  { "(bad)", XX, XX, XX },
+  { "psrlw", MX, EM, XX },
+  { "psrld", MX, EM, XX },
+  { "psrlq", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "pmullw", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "pmovmskb", Ev, MX, XX },
   /* d8 */
-  { "psubusb", MX, EM },
-  { "psubusw", MX, EM },
-  { "(bad)" },
-  { "pand", MX, EM },
-  { "paddusb", MX, EM },
-  { "paddusw", MX, EM },
-  { "(bad)" },
-  { "pandn", MX, EM },
+  { "psubusb", MX, EM, XX },
+  { "psubusw", MX, EM, XX },
+  { "pminub", MX, EM, XX },
+  { "pand", MX, EM, XX },
+  { "paddusb", MX, EM, XX },
+  { "paddusw", MX, EM, XX },
+  { "pmaxub", MX, EM, XX },
+  { "pandn", MX, EM, XX },
   /* e0 */
-  { "(bad)" },
-  { "psraw", MX, EM },
-  { "psrad", MX, EM },
-  { "(bad)" },
-  { "(bad)" },
-  { "pmulhw", MX, EM },
-  { "(bad)" },  { "(bad)" },
+  { "pavgb", MX, EM, XX },
+  { "psraw", MX, EM, XX },
+  { "psrad", MX, EM, XX },
+  { "pavgw", MX, EM, XX },
+  { "pmulhuw", MX, EM, XX },
+  { "pmulhw", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "movntq", Ev, MX, XX },
   /* e8 */
-  { "psubsb", MX, EM },
-  { "psubsw", MX, EM },
-  { "(bad)" },
-  { "por", MX, EM },
-  { "paddsb", MX, EM },
-  { "paddsw", MX, EM },
-  { "(bad)" },
-  { "pxor", MX, EM },
+  { "psubsb", MX, EM, XX },
+  { "psubsw", MX, EM, XX },
+  { "pminsw", MX, EM, XX },
+  { "por", MX, EM, XX },
+  { "paddsb", MX, EM, XX },
+  { "paddsw", MX, EM, XX },
+  { "pmaxsw", MX, EM, XX },
+  { "pxor", MX, EM, XX },
   /* f0 */
-  { "(bad)" },
-  { "psllw", MX, EM },
-  { "pslld", MX, EM },
-  { "psllq", MX, EM },
-  { "(bad)" },
-  { "pmaddwd", MX, EM },
-  { "(bad)" },  { "(bad)" },
+  { "(bad)", XX, XX, XX },
+  { "psllw", MX, EM, XX },
+  { "pslld", MX, EM, XX },
+  { "psllq", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "pmaddwd", MX, EM, XX },
+  { "psadbw", MX, EM, XX },
+  { "maskmovq", MX, EM, XX },
   /* f8 */
-  { "psubb", MX, EM },
-  { "psubw", MX, EM },
-  { "psubd", MX, EM },
-  { "(bad)" },
-  { "paddb", MX, EM },
-  { "paddw", MX, EM },
-  { "paddd", MX, EM },
-  { "(bad)" }
+  { "psubb", MX, EM, XX },
+  { "psubw", MX, EM, XX },
+  { "psubd", MX, EM, XX },
+  { "(bad)", XX, XX, XX },
+  { "paddb", MX, EM, XX },
+  { "paddw", MX, EM, XX },
+  { "paddd", MX, EM, XX },
+  { "(bad)", XX, XX, XX }
 };
 
 static const unsigned char onebyte_has_modrm[256] = {
-  1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
-  1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
-  1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
-  1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
-  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-  0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,
-  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-  1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,
-  1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,
-  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-  0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1
+  /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
+  /*       -------------------------------        */
+  /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
+  /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
+  /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
+  /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
+  /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
+  /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
+  /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
+  /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
+  /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
+  /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
+  /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
+  /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
+  /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
+  /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
+  /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
+  /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1  /* f0 */
+  /*       -------------------------------        */
+  /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
 };
 
 static const unsigned char twobyte_has_modrm[256] = {
+  /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
+  /*       -------------------------------        */
   /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
-  /* 10 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1f */
-  /* 20 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* 2f */
+  /* 10 */ 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, /* 1f */
+  /* 20 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 2f */
   /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */
   /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
-  /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 5f */
+  /* 50 */ 1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1, /* 5f */
   /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1, /* 6f */
-  /* 70 */ 0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1, /* 7f */
+  /* 70 */ 1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1, /* 7f */
   /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
   /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
   /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
   /* b0 */ 1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1, /* bf */
   /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
-  /* d0 */ 0,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1, /* df */
-  /* e0 */ 0,1,1,0,0,1,0,0,1,1,0,1,1,1,0,1, /* ef */
-  /* f0 */ 0,1,1,1,0,1,0,0,1,1,1,0,1,1,1,0  /* ff */
+  /* d0 */ 0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1, /* df */
+  /* e0 */ 1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1, /* ef */
+  /* f0 */ 0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0  /* ff */
+  /*       -------------------------------        */
+  /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
+};
+
+static const unsigned char twobyte_uses_f3_prefix[256] = {
+  /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
+  /*       -------------------------------        */
+  /* 00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0f */
+  /* 10 */ 1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1f */
+  /* 20 */ 0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0, /* 2f */
+  /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */
+  /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */
+  /* 50 */ 0,1,1,1,0,0,0,0,1,1,0,0,1,1,1,1, /* 5f */
+  /* 60 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 6f */
+  /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 7f */
+  /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
+  /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 9f */
+  /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* af */
+  /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* bf */
+  /* c0 */ 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* cf */
+  /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* df */
+  /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ef */
+  /* f0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0  /* ff */
+  /*       -------------------------------        */
+  /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
 };
 
 static char obuf[100];
@@ -1385,289 +1593,366 @@
 static int mod;
 static int rm;
 static int reg;
-static void oappend PARAMS ((char *s));
+static void oappend PARAMS ((const char *s));
 
-static char *names32[]={
+static const char *names32[]={
   "%eax","%ecx","%edx","%ebx", "%esp","%ebp","%esi","%edi",
 };
-static char *names16[] = {
+static const char *names16[] = {
   "%ax","%cx","%dx","%bx","%sp","%bp","%si","%di",
 };
-static char *names8[] = {
+static const char *names8[] = {
   "%al","%cl","%dl","%bl","%ah","%ch","%dh","%bh",
 };
-static char *names_seg[] = {
+static const char *names_seg[] = {
   "%es","%cs","%ss","%ds","%fs","%gs","%?","%?",
 };
-static char *index16[] = {
+static const char *index16[] = {
   "%bx,%si","%bx,%di","%bp,%si","%bp,%di","%si","%di","%bp","%bx"
 };
 
-static struct dis386 grps[][8] = {
+static const struct dis386 grps[][8] = {
   /* GRP1b */
   {
-    { "addA",	Eb, Ib },
-    { "orA",	Eb, Ib },
-    { "adcA",	Eb, Ib },
-    { "sbbA",	Eb, Ib },
-    { "andA",	Eb, Ib },
-    { "subA",	Eb, Ib },
-    { "xorA",	Eb, Ib },
-    { "cmpA",	Eb, Ib }
+    { "addA",	Eb, Ib, XX },
+    { "orA",	Eb, Ib, XX },
+    { "adcA",	Eb, Ib, XX },
+    { "sbbA",	Eb, Ib, XX },
+    { "andA",	Eb, Ib, XX },
+    { "subA",	Eb, Ib, XX },
+    { "xorA",	Eb, Ib, XX },
+    { "cmpA",	Eb, Ib, XX }
   },
   /* GRP1S */
   {
-    { "addQ",	Ev, Iv },
-    { "orQ",	Ev, Iv },
-    { "adcQ",	Ev, Iv },
-    { "sbbQ",	Ev, Iv },
-    { "andQ",	Ev, Iv },
-    { "subQ",	Ev, Iv },
-    { "xorQ",	Ev, Iv },
-    { "cmpQ",	Ev, Iv }
+    { "addQ",	Ev, Iv, XX },
+    { "orQ",	Ev, Iv, XX },
+    { "adcQ",	Ev, Iv, XX },
+    { "sbbQ",	Ev, Iv, XX },
+    { "andQ",	Ev, Iv, XX },
+    { "subQ",	Ev, Iv, XX },
+    { "xorQ",	Ev, Iv, XX },
+    { "cmpQ",	Ev, Iv, XX }
   },
   /* GRP1Ss */
   {
-    { "addQ",	Ev, sIb },
-    { "orQ",	Ev, sIb },
-    { "adcQ",	Ev, sIb },
-    { "sbbQ",	Ev, sIb },
-    { "andQ",	Ev, sIb },
-    { "subQ",	Ev, sIb },
-    { "xorQ",	Ev, sIb },
-    { "cmpQ",	Ev, sIb }
+    { "addQ",	Ev, sIb, XX },
+    { "orQ",	Ev, sIb, XX },
+    { "adcQ",	Ev, sIb, XX },
+    { "sbbQ",	Ev, sIb, XX },
+    { "andQ",	Ev, sIb, XX },
+    { "subQ",	Ev, sIb, XX },
+    { "xorQ",	Ev, sIb, XX },
+    { "cmpQ",	Ev, sIb, XX }
   },
   /* GRP2b */
   {
-    { "rolA",	Eb, Ib },
-    { "rorA",	Eb, Ib },
-    { "rclA",	Eb, Ib },
-    { "rcrA",	Eb, Ib },
-    { "shlA",	Eb, Ib },
-    { "shrA",	Eb, Ib },
-    { "(bad)" },
-    { "sarA",	Eb, Ib },
+    { "rolA",	Eb, Ib, XX },
+    { "rorA",	Eb, Ib, XX },
+    { "rclA",	Eb, Ib, XX },
+    { "rcrA",	Eb, Ib, XX },
+    { "shlA",	Eb, Ib, XX },
+    { "shrA",	Eb, Ib, XX },
+    { "(bad)",	XX, XX, XX },
+    { "sarA",	Eb, Ib, XX },
   },
   /* GRP2S */
   {
-    { "rolQ",	Ev, Ib },
-    { "rorQ",	Ev, Ib },
-    { "rclQ",	Ev, Ib },
-    { "rcrQ",	Ev, Ib },
-    { "shlQ",	Ev, Ib },
-    { "shrQ",	Ev, Ib },
-    { "(bad)" },
-    { "sarQ",	Ev, Ib },
+    { "rolQ",	Ev, Ib, XX },
+    { "rorQ",	Ev, Ib, XX },
+    { "rclQ",	Ev, Ib, XX },
+    { "rcrQ",	Ev, Ib, XX },
+    { "shlQ",	Ev, Ib, XX },
+    { "shrQ",	Ev, Ib, XX },
+    { "(bad)",	XX, XX, XX },
+    { "sarQ",	Ev, Ib, XX },
   },
   /* GRP2b_one */
   {
-    { "rolA",	Eb },
-    { "rorA",	Eb },
-    { "rclA",	Eb },
-    { "rcrA",	Eb },
-    { "shlA",	Eb },
-    { "shrA",	Eb },
-    { "(bad)" },
-    { "sarA",	Eb },
+    { "rolA",	Eb, XX, XX },
+    { "rorA",	Eb, XX, XX },
+    { "rclA",	Eb, XX, XX },
+    { "rcrA",	Eb, XX, XX },
+    { "shlA",	Eb, XX, XX },
+    { "shrA",	Eb, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "sarA",	Eb, XX, XX },
   },
   /* GRP2S_one */
   {
-    { "rolQ",	Ev },
-    { "rorQ",	Ev },
-    { "rclQ",	Ev },
-    { "rcrQ",	Ev },
-    { "shlQ",	Ev },
-    { "shrQ",	Ev },
-    { "(bad)" },
-    { "sarQ",	Ev },
+    { "rolQ",	Ev, XX, XX },
+    { "rorQ",	Ev, XX, XX },
+    { "rclQ",	Ev, XX, XX },
+    { "rcrQ",	Ev, XX, XX },
+    { "shlQ",	Ev, XX, XX },
+    { "shrQ",	Ev, XX, XX },
+    { "(bad)",	XX, XX, XX},
+    { "sarQ",	Ev, XX, XX },
   },
   /* GRP2b_cl */
   {
-    { "rolA",	Eb, CL },
-    { "rorA",	Eb, CL },
-    { "rclA",	Eb, CL },
-    { "rcrA",	Eb, CL },
-    { "shlA",	Eb, CL },
-    { "shrA",	Eb, CL },
-    { "(bad)" },
-    { "sarA",	Eb, CL },
+    { "rolA",	Eb, CL, XX },
+    { "rorA",	Eb, CL, XX },
+    { "rclA",	Eb, CL, XX },
+    { "rcrA",	Eb, CL, XX },
+    { "shlA",	Eb, CL, XX },
+    { "shrA",	Eb, CL, XX },
+    { "(bad)",	XX, XX, XX },
+    { "sarA",	Eb, CL, XX },
   },
   /* GRP2S_cl */
   {
-    { "rolQ",	Ev, CL },
-    { "rorQ",	Ev, CL },
-    { "rclQ",	Ev, CL },
-    { "rcrQ",	Ev, CL },
-    { "shlQ",	Ev, CL },
-    { "shrQ",	Ev, CL },
-    { "(bad)" },
-    { "sarQ",	Ev, CL }
+    { "rolQ",	Ev, CL, XX },
+    { "rorQ",	Ev, CL, XX },
+    { "rclQ",	Ev, CL, XX },
+    { "rcrQ",	Ev, CL, XX },
+    { "shlQ",	Ev, CL, XX },
+    { "shrQ",	Ev, CL, XX },
+    { "(bad)",	XX, XX, XX },
+    { "sarQ",	Ev, CL, XX }
   },
   /* GRP3b */
   {
-    { "testA",	Eb, Ib },
-    { "(bad)",	Eb },
-    { "notA",	Eb },
-    { "negA",	Eb },
-    { "mulB",	AL, Eb },
-    { "imulB",	AL, Eb },
-    { "divB",	AL, Eb },
-    { "idivB",	AL, Eb }
+    { "testA",	Eb, Ib, XX },
+    { "(bad)",	Eb, XX, XX },
+    { "notA",	Eb, XX, XX },
+    { "negA",	Eb, XX, XX },
+    { "mulB",	AL, Eb, XX },
+    { "imulB",	AL, Eb, XX },
+    { "divB",	AL, Eb, XX },
+    { "idivB",	AL, Eb, XX }
   },
   /* GRP3S */
   {
-    { "testQ",	Ev, Iv },
-    { "(bad)" },
-    { "notQ",	Ev },
-    { "negQ",	Ev },
-    { "mulS",	eAX, Ev },
-    { "imulS",	eAX, Ev },
-    { "divS",	eAX, Ev },
-    { "idivS",	eAX, Ev },
+    { "testQ",	Ev, Iv, XX },
+    { "(bad)",	XX, XX, XX },
+    { "notQ",	Ev, XX, XX },
+    { "negQ",	Ev, XX, XX },
+    { "mulS",	eAX, Ev, XX },
+    { "imulS",	eAX, Ev, XX },
+    { "divS",	eAX, Ev, XX },
+    { "idivS",	eAX, Ev, XX },
   },
   /* GRP4 */
   {
-    { "incA", Eb },
-    { "decA", Eb },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
+    { "incA",	Eb, XX, XX },
+    { "decA",	Eb, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
   },
   /* GRP5 */
   {
-    { "incQ",	Ev },
-    { "decQ",	Ev },
-    { "callP",	indirEv },
-    { "callP",	indirEv },
-    { "jmpP",	indirEv },
-    { "ljmpP",	indirEv },
-    { "pushQ",	Ev },
-    { "(bad)" },
+    { "incQ",	Ev, XX, XX },
+    { "decQ",	Ev, XX, XX },
+    { "callP",	indirEv, XX, XX },
+    { "callP",	indirEv, XX, XX },
+    { "jmpP",	indirEv, XX, XX },
+    { "ljmpP",	indirEv, XX, XX },
+    { "pushQ",	Ev, XX, XX },
+    { "(bad)",	XX, XX, XX },
   },
   /* GRP6 */
   {
-    { "sldt",	Ew },
-    { "str",	Ew },
-    { "lldt",	Ew },
-    { "ltr",	Ew },
-    { "verr",	Ew },
-    { "verw",	Ew },
-    { "(bad)" },
-    { "(bad)" }
+    { "sldt",	Ew, XX, XX },
+    { "str",	Ew, XX, XX },
+    { "lldt",	Ew, XX, XX },
+    { "ltr",	Ew, XX, XX },
+    { "verr",	Ew, XX, XX },
+    { "verw",	Ew, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX }
   },
   /* GRP7 */
   {
-    { "sgdt", Ew },
-    { "sidt", Ew },
-    { "lgdt", Ew },
-    { "lidt", Ew },
-    { "smsw", Ew },
-    { "(bad)" },
-    { "lmsw", Ew },
-    { "invlpg", Ew },
+    { "sgdt", Ew, XX, XX },
+    { "sidt", Ew, XX, XX },
+    { "lgdt", Ew, XX, XX },
+    { "lidt", Ew, XX, XX },
+    { "smsw", Ew, XX, XX },
+    { "(bad)", XX, XX, XX },
+    { "lmsw", Ew, XX, XX },
+    { "invlpg", Ew, XX, XX },
   },
   /* GRP8 */
   {
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "btQ",	Ev, Ib },
-    { "btsQ",	Ev, Ib },
-    { "btrQ",	Ev, Ib },
-    { "btcQ",	Ev, Ib },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "btQ",	Ev, Ib, XX },
+    { "btsQ",	Ev, Ib, XX },
+    { "btrQ",	Ev, Ib, XX },
+    { "btcQ",	Ev, Ib, XX },
   },
   /* GRP9 */
   {
-    { "(bad)" },
-    { "cmpxchg8b", Ev },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
+    { "(bad)",	XX, XX, XX },
+    { "cmpxchg8b", Ev, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
   },
   /* GRP10 */
   {
-    { "(bad)" },
-    { "(bad)" },
-    { "psrlw", MS, Ib },
-    { "(bad)" },
-    { "psraw", MS, Ib },
-    { "(bad)" },
-    { "psllw", MS, Ib },
-    { "(bad)" },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "psrlw",	MS, Ib, XX },
+    { "(bad)",	XX, XX, XX },
+    { "psraw",	MS, Ib, XX },
+    { "(bad)",	XX, XX, XX },
+    { "psllw",	MS, Ib, XX },
+    { "(bad)",	XX, XX, XX },
   },
   /* GRP11 */
   {
-    { "(bad)" },
-    { "(bad)" },
-    { "psrld", MS, Ib },
-    { "(bad)" },
-    { "psrad", MS, Ib },
-    { "(bad)" },
-    { "pslld", MS, Ib },
-    { "(bad)" },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "psrld",	MS, Ib, XX },
+    { "(bad)",	XX, XX, XX },
+    { "psrad",	MS, Ib, XX },
+    { "(bad)",	XX, XX, XX },
+    { "pslld",	MS, Ib, XX },
+    { "(bad)",	XX, XX, XX },
   },
   /* GRP12 */
   {
-    { "(bad)" },
-    { "(bad)" },
-    { "psrlq", MS, Ib },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "psllq", MS, Ib },
-    { "(bad)" },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "psrlq",	MS, Ib, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "psllq",	MS, Ib, XX },
+    { "(bad)",	XX, XX, XX },
   },
   /* GRP13 */
   {
-    { "fxsave", Ev },
-    { "fxrstor", Ev },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
+    { "fxsave", Ev, XX, XX },
+    { "fxrstor", Ev, XX, XX },
+    { "ldmxcsr", Ev, XX, XX },
+    { "stmxcsr", Ev, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "sfence", None, XX, XX },
   },
   /* GRP14 */
   {
-    { "prefetch", Eb },
-    { "prefetchw", Eb },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
+    { "prefetchnta", Ev, XX, XX },
+    { "prefetcht0", Ev, XX, XX },
+    { "prefetcht1", Ev, XX, XX },
+    { "prefetcht2", Ev, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+  },
+  /* GRPAMD */
+  {
+    { "prefetch", Eb, XX, XX },
+    { "prefetchw", Eb, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
   }
 
 };
 
-#define PREFIX_REPZ 1
-#define PREFIX_REPNZ 2
-#define PREFIX_LOCK 4
-#define PREFIX_CS 8
-#define PREFIX_SS 0x10
-#define PREFIX_DS 0x20
-#define PREFIX_ES 0x40
-#define PREFIX_FS 0x80
-#define PREFIX_GS 0x100
-#define PREFIX_DATA 0x200
-#define PREFIX_ADDR 0x400
-#define PREFIX_FWAIT 0x800
+static const struct dis386 prefix_user_table[][2] = {
+  /* PREGRP0 */
+  {
+    { "addps", XM, EX, XX },
+    { "addss", XM, EX, XX },
+  },
+  /* PREGRP1 */
+  {
+    { "", XM, EX, OPSIMD },	/* See OP_SIMD_SUFFIX */
+    { "", XM, EX, OPSIMD },
+  },
+  /* PREGRP2 */
+  {
+    { "cvtpi2ps", XM, EM, XX },
+    { "cvtsi2ss", XM, Ev, XX },
+  },
+  /* PREGRP3 */
+  {
+    { "cvtps2pi", MX, EX, XX },
+    { "cvtss2si", Gv, EX, XX },
+  },
+  /* PREGRP4 */
+  {
+    { "cvttps2pi", MX, EX, XX },
+    { "cvttss2si", Gv, EX, XX },
+  },
+  /* PREGRP5 */
+  {
+    { "divps", XM, EX, XX },
+    { "divss", XM, EX, XX },
+  },
+  /* PREGRP6 */
+  {
+    { "maxps", XM, EX, XX },
+    { "maxss", XM, EX, XX },
+  },
+  /* PREGRP7 */
+  {
+    { "minps", XM, EX, XX },
+    { "minss", XM, EX, XX },
+  },
+  /* PREGRP8 */
+  {
+    { "movups", XM, EX, XX },
+    { "movss", XM, EX, XX },
+  },
+  /* PREGRP9 */
+  {
+    { "movups", EX, XM, XX },
+    { "movss", EX, XM, XX },
+  },
+  /* PREGRP10 */
+  {
+    { "mulps", XM, EX, XX },
+    { "mulss", XM, EX, XX },
+  },
+  /* PREGRP11 */
+  {
+    { "rcpps", XM, EX, XX },
+    { "rcpss", XM, EX, XX },
+  },
+  /* PREGRP12 */
+  {
+    { "rsqrtps", XM, EX, XX },
+    { "rsqrtss", XM, EX, XX },
+  },
+  /* PREGRP13 */
+  {
+    { "sqrtps", XM, EX, XX },
+    { "sqrtss", XM, EX, XX },
+  },
+  /* PREGRP14 */
+  {
+    { "subps", XM, EX, XX },
+    { "subss", XM, EX, XX },
+  }
+};
 
-static int prefixes;
+#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
 
 static void
 ckprefix ()
 {
   prefixes = 0;
+  used_prefixes = 0;
   while (1)
     {
       FETCH_DATA (the_info, codep + 1);
@@ -1706,7 +1991,7 @@
 	case 0x67:
 	  prefixes |= PREFIX_ADDR;
 	  break;
-	case 0x9b:
+	case FWAIT_OPCODE:
 	  /* fwait is really an instruction.  If there are prefixes
 	     before the fwait, they belong to the fwait, *not* to the
 	     following instruction.  */
@@ -1725,6 +2010,45 @@
     }
 }
 
+/* Return the name of the prefix byte PREF, or NULL if PREF is not a
+   prefix byte.  */
+
+static const char *
+prefix_name (pref, sizeflag)
+     int pref;
+     int sizeflag;
+{
+  switch (pref)
+    {
+    case 0xf3:
+      return "repz";
+    case 0xf2:
+      return "repnz";
+    case 0xf0:
+      return "lock";
+    case 0x2e:
+      return "cs";
+    case 0x36:
+      return "ss";
+    case 0x3e:
+      return "ds";
+    case 0x26:
+      return "es";
+    case 0x64:
+      return "fs";
+    case 0x65:
+      return "gs";
+    case 0x66:
+      return (sizeflag & DFLAG) ? "data16" : "data32";
+    case 0x67:
+      return (sizeflag & AFLAG) ? "addr16" : "addr32";
+    case FWAIT_OPCODE:
+      return "fwait";
+    default:
+      return NULL;
+    }
+}
+
 static char op1out[100], op2out[100], op3out[100];
 static int op_ad, op_index[3];
 static unsigned int op_address[3];
@@ -1740,8 +2064,6 @@
  * The function returns the length of this instruction in bytes.
  */
 
-static int print_insn_x86
-  PARAMS ((bfd_vma pc, disassemble_info *info, int sizeflag));
 static int print_insn_i386
   PARAMS ((bfd_vma pc, disassemble_info *info));
 
@@ -1784,43 +2106,35 @@
      bfd_vma pc;
      disassemble_info *info;
 {
-  int flags;
-  if (info->mach == bfd_mach_i386_i386
-      || info->mach == bfd_mach_i386_i386_intel_syntax)
-    flags = AFLAG|DFLAG;
-  else if (info->mach == bfd_mach_i386_i8086)
-    flags = 0;
-  else
-    abort ();
-  return print_insn_x86 (pc, info, flags);
-}
-
-static int
-print_insn_x86 (pc, info, sizeflag)
-     bfd_vma pc;
-     disassemble_info *info;
-     int sizeflag;
-{
-  struct dis386 *dp;
+  const struct dis386 *dp;
   int i;
   int two_source_ops;
   char *first, *second, *third;
   int needcomma;
   unsigned char need_modrm;
+  unsigned char uses_f3_prefix;
+  VOLATILE int sizeflag;
+  VOLATILE int orig_sizeflag;
 
   struct dis_private priv;
   bfd_byte *inbuf = priv.the_buffer;
 
-  /* The output looks better if we put 5 bytes on a line, since that
-     puts long word instructions on a single line.  */
-  info->bytes_per_line = 5;
+  if (info->mach == bfd_mach_i386_i386
+      || info->mach == bfd_mach_i386_i386_intel_syntax)
+    sizeflag = AFLAG|DFLAG;
+  else if (info->mach == bfd_mach_i386_i8086)
+    sizeflag = 0;
+  else
+    abort ();
+  orig_sizeflag = sizeflag;
+
+  /* The output looks better if we put 6 bytes on a line, since that
+     puts most long word instructions on a single line.  */
+  info->bytes_per_line = 6;
 
   info->private_data = (PTR) &priv;
   priv.max_fetched = priv.the_buffer;
   priv.insn_start = pc;
-  if (setjmp (priv.bailout) != 0)
-    /* Error return.  */
-    return -1;
 
   obuf[0] = 0;
   op1out[0] = 0;
@@ -1834,6 +2148,31 @@
   start_codep = inbuf;
   codep = inbuf;
 
+  if (setjmp (priv.bailout) != 0)
+    {
+      const char *name;
+
+      /* Getting here means we tried for data but didn't get it.  That
+         means we have an incomplete instruction of some sort.  Just
+         print the first byte as a prefix or a .byte pseudo-op.  */
+      if (codep > inbuf)
+	{
+	  name = prefix_name (inbuf[0], orig_sizeflag);
+	  if (name != NULL)
+	    (*info->fprintf_func) (info->stream, "%s", name);
+	  else
+	    {
+	      /* Just print the first byte as a .byte instruction.  */
+	      (*info->fprintf_func) (info->stream, ".byte 0x%x",
+				     (unsigned int) inbuf[0]);
+	    }
+
+	  return 1;
+	}
+
+      return -1;
+    }
+
   ckprefix ();
 
   insn_codep = codep;
@@ -1846,18 +2185,53 @@
   if ((prefixes & PREFIX_FWAIT)
       && ((*codep < 0xd8) || (*codep > 0xdf)))
     {
-      /* fwait not followed by floating point instruction.  */
-      (*info->fprintf_func) (info->stream, "fwait");
-      /* There may be other prefixes.  Skip any before the fwait.  */
-      return codep - inbuf;
+      const char *name;
+
+      /* fwait not followed by floating point instruction.  Print the
+         first prefix, which is probably fwait itself.  */
+      name = prefix_name (inbuf[0], orig_sizeflag);
+      if (name == NULL)
+	name = INTERNAL_DISASSEMBLER_ERROR;
+      (*info->fprintf_func) (info->stream, "%s", name);
+      return 1;
     }
 
-  if (prefixes & PREFIX_REPZ)
-    oappend ("repz ");
+  if (*codep == 0x0f)
+    {
+      FETCH_DATA (info, codep + 2);
+      if (intel_syntax)
+        dp = &dis386_twobyte_intel[*++codep];
+      else
+        dp = &dis386_twobyte_att[*++codep];
+      need_modrm = twobyte_has_modrm[*codep];
+      uses_f3_prefix = twobyte_uses_f3_prefix[*codep];
+    }
+  else
+    {
+      if (intel_syntax)
+        dp = &dis386_intel[*codep];
+      else
+        dp = &dis386_att[*codep];
+      need_modrm = onebyte_has_modrm[*codep];
+      uses_f3_prefix = 0;
+    }
+  codep++;
+
+  if (!uses_f3_prefix && (prefixes & PREFIX_REPZ))
+    {
+      oappend ("repz ");
+      used_prefixes |= PREFIX_REPZ;
+    }
   if (prefixes & PREFIX_REPNZ)
-    oappend ("repnz ");
+    {
+      oappend ("repnz ");
+      used_prefixes |= PREFIX_REPNZ;
+    }
   if (prefixes & PREFIX_LOCK)
-    oappend ("lock ");
+    {
+      oappend ("lock ");
+      used_prefixes |= PREFIX_LOCK;
+    }
 
   if (prefixes & PREFIX_DATA)
     sizeflag ^= DFLAG;
@@ -1869,27 +2243,9 @@
         oappend ("addr32 ");
       else
 	oappend ("addr16 ");
+      used_prefixes |= PREFIX_ADDR;
     }
 
-  if (*codep == 0x0f)
-    {
-      FETCH_DATA (info, codep + 2);
-      if (intel_syntax)
-        dp = &dis386_twobyte_intel[*++codep];
-      else
-        dp = &dis386_twobyte_att[*++codep];
-      need_modrm = twobyte_has_modrm[*codep];
-    }
-  else
-    {
-      if (intel_syntax)
-        dp = &dis386_intel[*codep];
-      else
-        dp = &dis386_att[*codep];
-      need_modrm = onebyte_has_modrm[*codep];
-    }
-  codep++;
-
   if (need_modrm)
     {
       FETCH_DATA (info, codep + 1);
@@ -1905,7 +2261,21 @@
   else
     {
       if (dp->name == NULL)
-	dp = &grps[dp->bytemode1][reg];
+	{
+	  switch(dp->bytemode2)
+	    {
+	      case USE_GROUPS:
+	        dp = &grps[dp->bytemode1][reg];
+		break;
+	      case USE_PREFIX_USER_TABLE:
+		dp = &prefix_user_table[dp->bytemode1][prefixes & PREFIX_REPZ ? 1 : 0];
+		used_prefixes |= (prefixes & PREFIX_REPZ);
+		break;
+	      default:
+		oappend (INTERNAL_DISASSEMBLER_ERROR);
+		break;
+	    }
+	}
 
       putop (dp->name, sizeflag);
 
@@ -1925,6 +2295,21 @@
 	(*dp->op3)(dp->bytemode3, sizeflag);
     }
 
+  /* See if any prefixes were not used.  If so, print the first one
+     separately.  If we don't do this, we'll wind up printing an
+     instruction stream which does not precisely correspond to the
+     bytes we are disassembling.  */
+  if ((prefixes & ~used_prefixes) != 0)
+    {
+      const char *name;
+
+      name = prefix_name (inbuf[0], orig_sizeflag);
+      if (name == NULL)
+	name = INTERNAL_DISASSEMBLER_ERROR;
+      (*info->fprintf_func) (info->stream, "%s", name);
+      return 1;
+    }
+
   obufp = obuf + strlen (obuf);
   for (i = strlen (obuf); i < 6; i++)
     oappend (" ");
@@ -1933,7 +2318,7 @@
 
   /* The enter and bound instructions are printed with operands in the same
      order as the intel book; everything else is printed in reverse order.  */
-  if (intel_syntax || two_source_ops) 
+  if (intel_syntax || two_source_ops)
     {
       first = op1out;
       second = op2out;
@@ -1979,7 +2364,7 @@
   return codep - inbuf;
 }
 
-static char *float_mem_att[] = {
+static const char *float_mem_att[] = {
   /* d8 */
   "fadds",
   "fmuls",
@@ -2054,7 +2439,7 @@
   "fistpll",
 };
 
-static char *float_mem_intel[] = {
+static const char *float_mem_intel[] = {
   /* d8 */
   "fadd",
   "fmul",
@@ -2132,34 +2517,34 @@
 #define ST OP_ST, 0
 #define STi OP_STi, 0
 
-#define FGRPd9_2 NULL, NULL, 0
-#define FGRPd9_4 NULL, NULL, 1
-#define FGRPd9_5 NULL, NULL, 2
-#define FGRPd9_6 NULL, NULL, 3
-#define FGRPd9_7 NULL, NULL, 4
-#define FGRPda_5 NULL, NULL, 5
-#define FGRPdb_4 NULL, NULL, 6
-#define FGRPde_3 NULL, NULL, 7
-#define FGRPdf_4 NULL, NULL, 8
+#define FGRPd9_2 NULL, NULL, 0, NULL, 0, NULL, 0
+#define FGRPd9_4 NULL, NULL, 1, NULL, 0, NULL, 0
+#define FGRPd9_5 NULL, NULL, 2, NULL, 0, NULL, 0
+#define FGRPd9_6 NULL, NULL, 3, NULL, 0, NULL, 0
+#define FGRPd9_7 NULL, NULL, 4, NULL, 0, NULL, 0
+#define FGRPda_5 NULL, NULL, 5, NULL, 0, NULL, 0
+#define FGRPdb_4 NULL, NULL, 6, NULL, 0, NULL, 0
+#define FGRPde_3 NULL, NULL, 7, NULL, 0, NULL, 0
+#define FGRPdf_4 NULL, NULL, 8, NULL, 0, NULL, 0
 
-static struct dis386 float_reg[][8] = {
+static const struct dis386 float_reg[][8] = {
   /* d8 */
   {
-    { "fadd",	ST, STi },
-    { "fmul",	ST, STi },
-    { "fcom",	STi },
-    { "fcomp",	STi },
-    { "fsub",	ST, STi },
-    { "fsubr",	ST, STi },
-    { "fdiv",	ST, STi },
-    { "fdivr",	ST, STi },
+    { "fadd",	ST, STi, XX },
+    { "fmul",	ST, STi, XX },
+    { "fcom",	STi, XX, XX },
+    { "fcomp",	STi, XX, XX },
+    { "fsub",	ST, STi, XX },
+    { "fsubr",	ST, STi, XX },
+    { "fdiv",	ST, STi, XX },
+    { "fdivr",	ST, STi, XX },
   },
   /* d9 */
   {
-    { "fld",	STi },
-    { "fxch",	STi },
+    { "fld",	STi, XX, XX },
+    { "fxch",	STi, XX, XX },
     { FGRPd9_2 },
-    { "(bad)" },
+    { "(bad)",	XX, XX, XX },
     { FGRPd9_4 },
     { FGRPd9_5 },
     { FGRPd9_6 },
@@ -2167,83 +2552,83 @@
   },
   /* da */
   {
-    { "fcmovb",	ST, STi },
-    { "fcmove",	ST, STi },
-    { "fcmovbe",ST, STi },
-    { "fcmovu",	ST, STi },
-    { "(bad)" },
+    { "fcmovb",	ST, STi, XX },
+    { "fcmove",	ST, STi, XX },
+    { "fcmovbe",ST, STi, XX },
+    { "fcmovu",	ST, STi, XX },
+    { "(bad)",	XX, XX, XX },
     { FGRPda_5 },
-    { "(bad)" },
-    { "(bad)" },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
   },
   /* db */
   {
-    { "fcmovnb",ST, STi },
-    { "fcmovne",ST, STi },
-    { "fcmovnbe",ST, STi },
-    { "fcmovnu",ST, STi },
+    { "fcmovnb",ST, STi, XX },
+    { "fcmovne",ST, STi, XX },
+    { "fcmovnbe",ST, STi, XX },
+    { "fcmovnu",ST, STi, XX },
     { FGRPdb_4 },
-    { "fucomi",	ST, STi },
-    { "fcomi",	ST, STi },
-    { "(bad)" },
+    { "fucomi",	ST, STi, XX },
+    { "fcomi",	ST, STi, XX },
+    { "(bad)",	XX, XX, XX },
   },
   /* dc */
   {
-    { "fadd",	STi, ST },
-    { "fmul",	STi, ST },
-    { "(bad)" },
-    { "(bad)" },
+    { "fadd",	STi, ST, XX },
+    { "fmul",	STi, ST, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
 #if UNIXWARE_COMPAT
-    { "fsub",	STi, ST },
-    { "fsubr",	STi, ST },
-    { "fdiv",	STi, ST },
-    { "fdivr",	STi, ST },
+    { "fsub",	STi, ST, XX },
+    { "fsubr",	STi, ST, XX },
+    { "fdiv",	STi, ST, XX },
+    { "fdivr",	STi, ST, XX },
 #else
-    { "fsubr",	STi, ST },
-    { "fsub",	STi, ST },
-    { "fdivr",	STi, ST },
-    { "fdiv",	STi, ST },
+    { "fsubr",	STi, ST, XX },
+    { "fsub",	STi, ST, XX },
+    { "fdivr",	STi, ST, XX },
+    { "fdiv",	STi, ST, XX },
 #endif
   },
   /* dd */
   {
-    { "ffree",	STi },
-    { "(bad)" },
-    { "fst",	STi },
-    { "fstp",	STi },
-    { "fucom",	STi },
-    { "fucomp",	STi },
-    { "(bad)" },
-    { "(bad)" },
+    { "ffree",	STi, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "fst",	STi, XX, XX },
+    { "fstp",	STi, XX, XX },
+    { "fucom",	STi, XX, XX },
+    { "fucomp",	STi, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
   },
   /* de */
   {
-    { "faddp",	STi, ST },
-    { "fmulp",	STi, ST },
-    { "(bad)" },
+    { "faddp",	STi, ST, XX },
+    { "fmulp",	STi, ST, XX },
+    { "(bad)",	XX, XX, XX },
     { FGRPde_3 },
 #if UNIXWARE_COMPAT
-    { "fsubp",	STi, ST },
-    { "fsubrp",	STi, ST },
-    { "fdivp",	STi, ST },
-    { "fdivrp",	STi, ST },
+    { "fsubp",	STi, ST, XX },
+    { "fsubrp",	STi, ST, XX },
+    { "fdivp",	STi, ST, XX },
+    { "fdivrp",	STi, ST, XX },
 #else
-    { "fsubrp",	STi, ST },
-    { "fsubp",	STi, ST },
-    { "fdivrp",	STi, ST },
-    { "fdivp",	STi, ST },
+    { "fsubrp",	STi, ST, XX },
+    { "fsubp",	STi, ST, XX },
+    { "fdivrp",	STi, ST, XX },
+    { "fdivp",	STi, ST, XX },
 #endif
   },
   /* df */
   {
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
-    { "(bad)" },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "(bad)",	XX, XX, XX },
     { FGRPdf_4 },
-    { "fucomip",ST, STi },
-    { "fcomip", ST, STi },
-    { "(bad)" },
+    { "fucomip",ST, STi, XX },
+    { "fcomip", ST, STi, XX },
+    { "(bad)",	XX, XX, XX },
   },
 };
 
@@ -2300,7 +2685,7 @@
 dofloat (sizeflag)
      int sizeflag;
 {
-  struct dis386 *dp;
+  const struct dis386 *dp;
   unsigned char floatop;
 
   floatop = codep[-1];
@@ -2316,7 +2701,7 @@
         OP_E (x_mode, sizeflag);
       else if (floatop == 0xdd)
         OP_E (d_mode, sizeflag);
-      else 
+      else
         OP_E (v_mode, sizeflag);
       return;
     }
@@ -2347,8 +2732,8 @@
 /* ARGSUSED */
 static void
 OP_ST (ignore, sizeflag)
-     int ignore;
-     int sizeflag;
+     int ignore ATTRIBUTE_UNUSED;
+     int sizeflag ATTRIBUTE_UNUSED;
 {
   oappend ("%st");
 }
@@ -2356,8 +2741,8 @@
 /* ARGSUSED */
 static void
 OP_STi (ignore, sizeflag)
-     int ignore;
-     int sizeflag;
+     int ignore ATTRIBUTE_UNUSED;
+     int sizeflag ATTRIBUTE_UNUSED;
 {
   sprintf (scratchbuf, "%%st(%d)", rm);
   oappend (scratchbuf);
@@ -2367,10 +2752,10 @@
 /* capital letters in template are macros */
 static void
 putop (template, sizeflag)
-     char *template;
+     const char *template;
      int sizeflag;
 {
-  char *p;
+  const char *p;
 
   for (p = template; *p; p++)
     {
@@ -2412,6 +2797,8 @@
 	case 'N':
 	  if ((prefixes & PREFIX_FWAIT) == 0)
 	    *obufp++ = 'n';
+	  else
+	    used_prefixes |= PREFIX_FWAIT;
 	  break;
 	case 'P':
           if (intel_syntax)
@@ -2426,6 +2813,7 @@
 		*obufp++ = 'l';
 	      else
 		*obufp++ = 'w';
+	      used_prefixes |= (prefixes & PREFIX_DATA);
 	    }
 	  break;
 	case 'Q':
@@ -2441,15 +2829,31 @@
 		*obufp++ = 'l';
 	      else
 		*obufp++ = 'w';
+	      used_prefixes |= (prefixes & PREFIX_DATA);
 	    }
 	  break;
 	case 'R':
           if (intel_syntax)
-            break;
-	  if (sizeflag & DFLAG)
-	    *obufp++ = 'l';
+	    {
+	      if (sizeflag & DFLAG)
+		{
+		  *obufp++ = 'd';
+		  *obufp++ = 'q';
+		}
+	      else
+		{
+		  *obufp++ = 'w';
+		  *obufp++ = 'd';
+		}
+	    }
 	  else
-	    *obufp++ = 'w';
+	    {
+	      if (sizeflag & DFLAG)
+		*obufp++ = 'l';
+	      else
+		*obufp++ = 'w';
+	    }
+	  used_prefixes |= (prefixes & PREFIX_DATA);
 	  break;
 	case 'S':
           if (intel_syntax)
@@ -2461,17 +2865,29 @@
 		*obufp++ = 'l';
 	      else
 		*obufp++ = 'w';
+	      used_prefixes |= (prefixes & PREFIX_DATA);
 	    }
 #endif
 	  break;
 	case 'W':
-          if (intel_syntax)
-            break;
 	  /* operand size flag for cwtl, cbtw */
 	  if (sizeflag & DFLAG)
 	    *obufp++ = 'w';
 	  else
 	    *obufp++ = 'b';
+          if (intel_syntax)
+	    {
+	      if (sizeflag & DFLAG)
+		{
+		  *obufp++ = 'd';
+		  *obufp++ = 'e';
+		}
+	      else
+		{
+		  *obufp++ = 'w';
+		}
+	    }
+	  used_prefixes |= (prefixes & PREFIX_DATA);
 	  break;
 	}
     }
@@ -2480,7 +2896,7 @@
 
 static void
 oappend (s)
-     char *s;
+     const char *s;
 {
   strcpy (obufp, s);
   obufp += strlen (s);
@@ -2490,17 +2906,35 @@
 append_seg ()
 {
   if (prefixes & PREFIX_CS)
-    oappend ("%cs:");
+    {
+      oappend ("%cs:");
+      used_prefixes |= PREFIX_CS;
+    }
   if (prefixes & PREFIX_DS)
-    oappend ("%ds:");
+    {
+      oappend ("%ds:");
+      used_prefixes |= PREFIX_DS;
+    }
   if (prefixes & PREFIX_SS)
-    oappend ("%ss:");
+    {
+      oappend ("%ss:");
+      used_prefixes |= PREFIX_SS;
+    }
   if (prefixes & PREFIX_ES)
-    oappend ("%es:");
+    {
+      oappend ("%es:");
+      used_prefixes |= PREFIX_ES;
+    }
   if (prefixes & PREFIX_FS)
-    oappend ("%fs:");
+    {
+      oappend ("%fs:");
+      used_prefixes |= PREFIX_FS;
+    }
   if (prefixes & PREFIX_GS)
-    oappend ("%gs:");
+    {
+      oappend ("%gs:");
+      used_prefixes |= PREFIX_GS;
+    }
 }
 
 static void
@@ -2533,14 +2967,22 @@
 	case w_mode:
 	  oappend (names16[rm]);
 	  break;
+	case d_mode:
+	  oappend (names32[rm]);
+	  break;
 	case v_mode:
 	  if (sizeflag & DFLAG)
 	    oappend (names32[rm]);
 	  else
 	    oappend (names16[rm]);
+	  used_prefixes |= (prefixes & PREFIX_DATA);
+	  break;
+	case 0:
+	  if ( !(codep[-2] == 0xAE && codep[-1] == 0xF8 /* sfence */))
+	    BadOp();	/* bad sfence,lea,lds,les,lfs,lgs,lss modrm */
 	  break;
 	default:
-	  oappend ("<bad dis table>");
+	  oappend (INTERNAL_DISASSEMBLER_ERROR);
 	  break;
 	}
       return;
@@ -2597,7 +3039,7 @@
             sprintf (scratchbuf, "0x%x", disp);
             oappend (scratchbuf);
           }
-      
+
       if (havebase || (havesib && (index != 4 || scale != 0)))
 	{
           if (intel_syntax)
@@ -2645,7 +3087,7 @@
 		  oappend (scratchbuf);
 		}
               if (!intel_syntax
-                  || (intel_syntax 
+                  || (intel_syntax
                       && bytemode != b_mode
                       && bytemode != w_mode
                       && bytemode != v_mode))
@@ -2735,8 +3177,6 @@
     }
 }
 
-#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
-
 static void
 OP_G (bytemode, sizeflag)
      int bytemode;
@@ -2758,6 +3198,7 @@
 	oappend (names32[reg]);
       else
 	oappend (names16[reg]);
+      used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     default:
       oappend (INTERNAL_DISASSEMBLER_ERROR);
@@ -2802,7 +3243,7 @@
      int code;
      int sizeflag;
 {
-  char *s;
+  const char *s;
 
   switch (code)
     {
@@ -2827,6 +3268,7 @@
 	s = names32[code - eAX_reg];
       else
 	s = names16[code - eAX_reg];
+      used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     default:
       s = INTERNAL_DISASSEMBLER_ERROR;
@@ -2853,6 +3295,7 @@
 	op = get32 ();
       else
 	op = get16 ();
+      used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     case w_mode:
       op = get16 ();
@@ -2894,6 +3337,7 @@
 	  if ((op & 0x8000) != 0)
 	    op -= 0x10000;
 	}
+      used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     case w_mode:
       op = get16 ();
@@ -2938,6 +3382,7 @@
 	     displacement is added!  */
 	  mask = 0xffff;
 	}
+      used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     default:
       oappend (INTERNAL_DISASSEMBLER_ERROR);
@@ -2952,8 +3397,8 @@
 /* ARGSUSED */
 static void
 OP_SEG (dummy, sizeflag)
-     int dummy;
-     int sizeflag;
+     int dummy ATTRIBUTE_UNUSED;
+     int sizeflag ATTRIBUTE_UNUSED;
 {
   static char *sreg[] = {
     "%es","%cs","%ss","%ds","%fs","%gs","%?","%?",
@@ -2962,54 +3407,33 @@
   oappend (sreg[reg]);
 }
 
+/* ARGSUSED */
 static void
-OP_DIR (size, sizeflag)
-     int size;
+OP_DIR (dummy, sizeflag)
+     int dummy ATTRIBUTE_UNUSED;
      int sizeflag;
 {
   int seg, offset;
 
-  switch (size)
+  if (sizeflag & DFLAG)
     {
-    case lptr:
-      if (sizeflag & DFLAG)
-	{
-	  offset = get32 ();
-	  seg = get16 ();
-	}
-      else
-	{
-	  offset = get16 ();
-	  seg = get16 ();
-	}
-      sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
-      oappend (scratchbuf);
-      break;
-    case v_mode:
-      if (sizeflag & DFLAG)
-	offset = get32 ();
-      else
-	{
-	  offset = get16 ();
-	  if ((offset & 0x8000) != 0)
-	    offset -= 0x10000;
-	}
-
-      offset = start_pc + codep - start_codep + offset;
-      set_op (offset);
-      sprintf (scratchbuf, "0x%x", offset);
-      oappend (scratchbuf);
-      break;
-    default:
-      oappend (INTERNAL_DISASSEMBLER_ERROR);
-      break;
+      offset = get32 ();
+      seg = get16 ();
     }
+  else
+    {
+      offset = get16 ();
+      seg = get16 ();
+    }
+  used_prefixes |= (prefixes & PREFIX_DATA);
+  sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
+  oappend (scratchbuf);
 }
 
 /* ARGSUSED */
 static void
 OP_OFF (ignore, sizeflag)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
      int sizeflag;
 {
   int off;
@@ -3039,7 +3463,7 @@
      int code;
      int sizeflag;
 {
-  char *s;
+  const char *s;
   oappend ("(");
   if (sizeflag & AFLAG)
     s = names32[code - eAX_reg];
@@ -3075,27 +3499,12 @@
   ptr_reg (code, sizeflag);
 }
 
-#if 0
-/* Not used.  */
-
-/* ARGSUSED */
-static void
-OP_ONE (dummy, sizeflag)
-     int dummy;
-     int sizeflag;
-{
-  oappend ("1");
-}
-
-#endif
-
 /* ARGSUSED */
 static void
 OP_C (dummy, sizeflag)
-     int dummy;
-     int sizeflag;
+     int dummy ATTRIBUTE_UNUSED;
+     int sizeflag ATTRIBUTE_UNUSED;
 {
-  codep++; /* skip mod/rm */
   sprintf (scratchbuf, "%%cr%d", reg);
   oappend (scratchbuf);
 }
@@ -3103,10 +3512,9 @@
 /* ARGSUSED */
 static void
 OP_D (dummy, sizeflag)
-     int dummy;
-     int sizeflag;
+     int dummy ATTRIBUTE_UNUSED;
+     int sizeflag ATTRIBUTE_UNUSED;
 {
-  codep++; /* skip mod/rm */
   sprintf (scratchbuf, "%%db%d", reg);
   oappend (scratchbuf);
 }
@@ -3114,40 +3522,43 @@
 /* ARGSUSED */
 static void
 OP_T (dummy, sizeflag)
-     int dummy;
-     int sizeflag;
+     int dummy ATTRIBUTE_UNUSED;
+     int sizeflag ATTRIBUTE_UNUSED;
 {
-  codep++; /* skip mod/rm */
   sprintf (scratchbuf, "%%tr%d", reg);
   oappend (scratchbuf);
 }
 
 static void
-OP_rm (bytemode, sizeflag)
+OP_Rd (bytemode, sizeflag)
      int bytemode;
      int sizeflag;
 {
-  switch (bytemode)
-    {
-    case d_mode:
-      oappend (names32[rm]);
-      break;
-    case w_mode:
-      oappend (names16[rm]);
-      break;
-    }
+  if (mod == 3)
+    OP_E (bytemode, sizeflag);
+  else
+    BadOp();
 }
 
 static void
 OP_MMX (ignore, sizeflag)
-     int ignore;
-     int sizeflag;
+     int ignore ATTRIBUTE_UNUSED;
+     int sizeflag ATTRIBUTE_UNUSED;
 {
   sprintf (scratchbuf, "%%mm%d", reg);
   oappend (scratchbuf);
 }
 
 static void
+OP_XMM (bytemode, sizeflag)
+     int bytemode ATTRIBUTE_UNUSED;
+     int sizeflag ATTRIBUTE_UNUSED;
+{
+  sprintf (scratchbuf, "%%xmm%d", reg);
+  oappend (scratchbuf);
+}
+
+static void
 OP_EM (bytemode, sizeflag)
      int bytemode;
      int sizeflag;
@@ -3164,15 +3575,32 @@
 }
 
 static void
-OP_MS (ignore, sizeflag)
-     int ignore;
+OP_EX (bytemode, sizeflag)
+     int bytemode;
      int sizeflag;
 {
-  ++codep;
-  sprintf (scratchbuf, "%%mm%d", rm);
+  if (mod != 3)
+    {
+      OP_E (bytemode, sizeflag);
+      return;
+    }
+
+  codep++;
+  sprintf (scratchbuf, "%%xmm%d", rm);
   oappend (scratchbuf);
 }
 
+static void
+OP_MS (bytemode, sizeflag)
+     int bytemode;
+     int sizeflag;
+{
+  if (mod == 3)
+    OP_EM (bytemode, sizeflag);
+  else
+    BadOp();
+}
+
 static const char *Suffix3DNow[] = {
 /* 00 */	NULL,		NULL,		NULL,		NULL,
 /* 04 */	NULL,		NULL,		NULL,		NULL,
@@ -3242,8 +3670,8 @@
 
 static void
 OP_3DNowSuffix (bytemode, sizeflag)
-     int bytemode;
-     int sizeflag;
+     int bytemode ATTRIBUTE_UNUSED;
+     int sizeflag ATTRIBUTE_UNUSED;
 {
   const char *mnemonic;
 
@@ -3251,18 +3679,81 @@
   /* AMD 3DNow! instructions are specified by an opcode suffix in the
      place where an 8-bit immediate would normally go.  ie. the last
      byte of the instruction.  */
-  mnemonic = Suffix3DNow[*codep++];
+  obufp = obuf + strlen(obuf);
+  mnemonic = Suffix3DNow[*codep++ & 0xff];
   if (mnemonic)
-    strcat (obuf, mnemonic);
+    oappend (mnemonic);
   else
     {
       /* Since a variable sized modrm/sib chunk is between the start
 	 of the opcode (0x0f0f) and the opcode suffix, we need to do
 	 all the modrm processing first, and don't know until now that
 	 we have a bad opcode.  This necessitates some cleaning up.  */
-      op1out[0] = 0;
-      op2out[0] = 0;
-      codep = insn_codep + 1;
-      strcat (obuf, "(bad)");
+      op1out[0] = '\0';
+      op2out[0] = '\0';
+      BadOp();
     }
 }
+
+
+static const char *simd_cmp_op [] = {
+  "eq",
+  "lt",
+  "le",
+  "unord",
+  "neq",
+  "nlt",
+  "nle",
+  "ord"
+};
+
+static void
+OP_SIMD_Suffix (bytemode, sizeflag)
+     int bytemode ATTRIBUTE_UNUSED;
+     int sizeflag ATTRIBUTE_UNUSED;
+{
+  unsigned int cmp_type;
+
+  FETCH_DATA (the_info, codep + 1);
+  obufp = obuf + strlen(obuf);
+  cmp_type = *codep++ & 0xff;
+  if (cmp_type < 8)
+    {
+      sprintf (scratchbuf, "cmp%s%cs",
+	       simd_cmp_op[cmp_type],
+	       prefixes & PREFIX_REPZ ? 's' : 'p');
+      used_prefixes |= (prefixes & PREFIX_REPZ);
+      oappend (scratchbuf);
+    }
+  else
+    {
+      /* We have a bad extension byte.  Clean up.  */
+      op1out[0] = '\0';
+      op2out[0] = '\0';
+      BadOp();
+    }
+}
+
+static void
+SIMD_Fixup (extrachar, sizeflag)
+     int extrachar;
+     int sizeflag ATTRIBUTE_UNUSED;
+{
+  /* Change movlps/movhps to movhlps/movlhps for 2 register operand
+     forms of these instructions.  */
+  if (mod == 3)
+    {
+      char *p = obuf + strlen(obuf);
+      *(p+1) = '\0';
+      *p     = *(p-1);
+      *(p-1) = *(p-2);
+      *(p-2) = *(p-3);
+      *(p-3) = extrachar;
+    }
+}
+
+static void BadOp (void)
+{
+  codep = insn_codep + 1;	/* throw away prefixes and 1st. opcode byte */
+  oappend ("(bad)");
+}
diff --git a/opcodes/m68k-dis.c b/opcodes/m68k-dis.c
index a316c21..23d3a821 100644
--- a/opcodes/m68k-dis.c
+++ b/opcodes/m68k-dis.c
@@ -1,5 +1,5 @@
 /* Print Motorola 68k instructions.
-   Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
 This file is free software; you can redistribute it and/or modify
@@ -504,6 +504,18 @@
       (*info->fprintf_func) (info->stream, "%%usp");
       break;
 
+    case 'E':
+      (*info->fprintf_func) (info->stream, "%%acc");
+      break;
+
+    case 'G':
+      (*info->fprintf_func) (info->stream, "%%macsr");
+      break;
+
+    case 'H':
+      (*info->fprintf_func) (info->stream, "%%mask");
+      break;
+
     case 'J':
       {
 	static const struct { char *name; int value; } names[]
@@ -539,10 +551,19 @@
       break;
 
     case 'M':
-      val = fetch_arg (buffer, place, 8, info);
-      if (val & 0x80)
-	val = val - 0x100;
-      (*info->fprintf_func) (info->stream, "#%d", val);
+      if (place == 'h')
+	{
+	  static char *const scalefactor_name[] = { "<<", ">>" };
+	  val = fetch_arg (buffer, place, 1, info);
+	  (*info->fprintf_func) (info->stream, scalefactor_name[val]);
+	}
+      else
+	{
+	  val = fetch_arg (buffer, place, 8, info);
+	  if (val & 0x80)
+	    val = val - 0x100;
+	  (*info->fprintf_func) (info->stream, "#%d", val);
+	}
       break;
 
     case 'T':
@@ -979,6 +1000,22 @@
       }
       break;
 
+    case 'u':
+      {
+	short is_upper = 0;
+	int reg = fetch_arg (buffer, place, 5, info);
+	
+	if (reg & 0x10)
+	  {
+	    is_upper = 1;
+	    reg &= 0xf;
+	  }
+	(*info->fprintf_func) (info->stream, "%s%s",
+			       reg_names[reg],
+			       is_upper ? "u" : "l");
+      }
+      break;
+	
     default:
       return -2;
     }
@@ -1082,12 +1119,40 @@
       val = (buffer[1] >> 6);
       break;
 
+    case 'm': 
+      val = (buffer[1] & 0x40 ? 0x8 : 0)
+	| ((buffer[0] >> 1) & 0x7)
+	| (buffer[3] & 0x80 ? 0x10 : 0);
+      break;
+
+    case 'n': 
+      val = (buffer[1] & 0x40 ? 0x8 : 0) | ((buffer[0] >> 1) & 0x7);
+      break;
+
+    case 'o':
+      val = (buffer[2] >> 4) | (buffer[3] & 0x80 ? 0x10 : 0);
+      break;
+
+    case 'M':
+      val = buffer[1] | (buffer[3] & 0x40 ? 0x10 : 0);
+      break;
+
+    case 'N':
+      val = buffer[3] | (buffer[3] & 0x40 ? 0x10 : 0);
+      break;
+
+    case 'h':
+      val = buffer[2] >> 2;
+      break;
+
     default:
       abort ();
     }
 
   switch (bits)
     {
+    case 1:
+      return val & 1;
     case 2:
       return val & 3;
     case 3:
diff --git a/opcodes/m68k-opc.c b/opcodes/m68k-opc.c
index 15e1b8d..847ad7c 100644
--- a/opcodes/m68k-opc.c
+++ b/opcodes/m68k-opc.c
@@ -35,16 +35,16 @@
 {"abcd",	one(0140410),	one(0170770), "-s-d", m68000up },
 
 {"addaw",	one(0150300),	one(0170700), "*wAd", m68000up },
-{"addal",	one(0150700),	one(0170700), "*lAd", m68000up | mcf5200 },
+{"addal",	one(0150700),	one(0170700), "*lAd", m68000up | mcf },
 
 {"addib",	one(0003000),	one(0177700), "#b$s", m68000up },
 {"addiw",	one(0003100),	one(0177700), "#w$s", m68000up },
 {"addil",	one(0003200),	one(0177700), "#l$s", m68000up },
-{"addil",	one(0003200),	one(0177700), "#lDs", mcf5200 },
+{"addil",	one(0003200),	one(0177700), "#lDs", mcf },
 
 {"addqb",	one(0050000),	one(0170700), "Qd$b", m68000up },
 {"addqw",	one(0050100),	one(0170700), "Qd%w", m68000up },
-{"addql",	one(0050200),	one(0170700), "Qd%l", m68000up | mcf5200 },
+{"addql",	one(0050200),	one(0170700), "Qd%l", m68000up | mcf },
 
 /* The add opcode can generate the adda, addi, and addq instructions.  */
 {"addb",	one(0050000),	one(0170700), "Qd$b", m68000up },
@@ -56,18 +56,18 @@
 {"addw",	one(0003100),	one(0177700), "#w$s", m68000up },
 {"addw",	one(0150100),	one(0170700), "*wDd", m68000up },
 {"addw",	one(0150500),	one(0170700), "Dd~w", m68000up },
-{"addl",	one(0050200),	one(0170700), "Qd%l", m68000up | mcf5200 },
+{"addl",	one(0050200),	one(0170700), "Qd%l", m68000up | mcf },
 {"addl",	one(0003200),	one(0177700), "#l$s", m68000up },
-{"addl",	one(0003200),	one(0177700), "#lDs", mcf5200 },
-{"addl",	one(0150700),	one(0170700), "*lAd", m68000up | mcf5200 },
-{"addl",	one(0150200),	one(0170700), "*lDd", m68000up | mcf5200 },
-{"addl",	one(0150600),	one(0170700), "Dd~l", m68000up | mcf5200 },
+{"addl",	one(0003200),	one(0177700), "#lDs", mcf },
+{"addl",	one(0150700),	one(0170700), "*lAd", m68000up | mcf },
+{"addl",	one(0150200),	one(0170700), "*lDd", m68000up | mcf },
+{"addl",	one(0150600),	one(0170700), "Dd~l", m68000up | mcf },
 
 {"addxb",	one(0150400),	one(0170770), "DsDd", m68000up },
 {"addxb",	one(0150410),	one(0170770), "-s-d", m68000up },
 {"addxw",	one(0150500),	one(0170770), "DsDd", m68000up },
 {"addxw",	one(0150510),	one(0170770), "-s-d", m68000up },
-{"addxl",	one(0150600),	one(0170770), "DsDd", m68000up | mcf5200 },
+{"addxl",	one(0150600),	one(0170770), "DsDd", m68000up | mcf },
 {"addxl",	one(0150610),	one(0170770), "-s-d", m68000up },
 
 {"andib",	one(0001000),	one(0177700), "#b$s", m68000up },
@@ -75,7 +75,7 @@
 {"andiw",	one(0001100),	one(0177700), "#w$s", m68000up },
 {"andiw",	one(0001174),	one(0177777), "#wSs", m68000up },
 {"andil",	one(0001200),	one(0177700), "#l$s", m68000up },
-{"andil",	one(0001200),	one(0177700), "#lDs", mcf5200 },
+{"andil",	one(0001200),	one(0177700), "#lDs", mcf },
 {"andi",	one(0001100),	one(0177700), "#w$s", m68000up },
 {"andi",	one(0001074),	one(0177777), "#bCs", m68000up },
 {"andi",	one(0001174),	one(0177777), "#wSs", m68000up },
@@ -90,9 +90,9 @@
 {"andw",	one(0140100),	one(0170700), ";wDd", m68000up },
 {"andw",	one(0140500),	one(0170700), "Dd~w", m68000up },
 {"andl",	one(0001200),	one(0177700), "#l$s", m68000up },
-{"andl",	one(0001200),	one(0177700), "#lDs", mcf5200 },
-{"andl",	one(0140200),	one(0170700), ";lDd", m68000up | mcf5200 },
-{"andl",	one(0140600),	one(0170700), "Dd~l", m68000up | mcf5200 },
+{"andl",	one(0001200),	one(0177700), "#lDs", mcf },
+{"andl",	one(0140200),	one(0170700), ";lDd", m68000up | mcf },
+{"andl",	one(0140600),	one(0170700), "Dd~l", m68000up | mcf },
 {"and",		one(0001100),	one(0177700), "#w$w", m68000up },
 {"and",		one(0001074),	one(0177777), "#bCs", m68000up },
 {"and",		one(0001174),	one(0177777), "#wSs", m68000up },
@@ -104,31 +104,31 @@
 {"aslw",	one(0160500),	one(0170770), "QdDs", m68000up },
 {"aslw",	one(0160540),	one(0170770), "DdDs", m68000up },
 {"aslw",	one(0160700),	one(0177700), "~s",   m68000up },
-{"asll",	one(0160600),	one(0170770), "QdDs", m68000up | mcf5200 },
-{"asll",	one(0160640),	one(0170770), "DdDs", m68000up | mcf5200 },
+{"asll",	one(0160600),	one(0170770), "QdDs", m68000up | mcf },
+{"asll",	one(0160640),	one(0170770), "DdDs", m68000up | mcf },
 
 {"asrb",	one(0160000),	one(0170770), "QdDs", m68000up },
 {"asrb",	one(0160040),	one(0170770), "DdDs", m68000up },
 {"asrw",	one(0160100),	one(0170770), "QdDs", m68000up },
 {"asrw",	one(0160140),	one(0170770), "DdDs", m68000up },
 {"asrw",	one(0160300),	one(0177700), "~s",   m68000up },
-{"asrl",	one(0160200),	one(0170770), "QdDs", m68000up | mcf5200 },
-{"asrl",	one(0160240),	one(0170770), "DdDs", m68000up | mcf5200 },
+{"asrl",	one(0160200),	one(0170770), "QdDs", m68000up | mcf },
+{"asrl",	one(0160240),	one(0170770), "DdDs", m68000up | mcf },
 
-{"bhiw",	one(0061000),	one(0177777), "BW", m68000up | mcf5200 },
-{"blsw",	one(0061400),	one(0177777), "BW", m68000up | mcf5200 },
-{"bccw",	one(0062000),	one(0177777), "BW", m68000up | mcf5200 },
-{"bcsw",	one(0062400),	one(0177777), "BW", m68000up | mcf5200 },
-{"bnew",	one(0063000),	one(0177777), "BW", m68000up | mcf5200 },
-{"beqw",	one(0063400),	one(0177777), "BW", m68000up | mcf5200 },
-{"bvcw",	one(0064000),	one(0177777), "BW", m68000up | mcf5200 },
-{"bvsw",	one(0064400),	one(0177777), "BW", m68000up | mcf5200 },
-{"bplw",	one(0065000),	one(0177777), "BW", m68000up | mcf5200 },
-{"bmiw",	one(0065400),	one(0177777), "BW", m68000up | mcf5200 },
-{"bgew",	one(0066000),	one(0177777), "BW", m68000up | mcf5200 },
-{"bltw",	one(0066400),	one(0177777), "BW", m68000up | mcf5200 },
-{"bgtw",	one(0067000),	one(0177777), "BW", m68000up | mcf5200 },
-{"blew",	one(0067400),	one(0177777), "BW", m68000up | mcf5200 },
+{"bhiw",	one(0061000),	one(0177777), "BW", m68000up | mcf },
+{"blsw",	one(0061400),	one(0177777), "BW", m68000up | mcf },
+{"bccw",	one(0062000),	one(0177777), "BW", m68000up | mcf },
+{"bcsw",	one(0062400),	one(0177777), "BW", m68000up | mcf },
+{"bnew",	one(0063000),	one(0177777), "BW", m68000up | mcf },
+{"beqw",	one(0063400),	one(0177777), "BW", m68000up | mcf },
+{"bvcw",	one(0064000),	one(0177777), "BW", m68000up | mcf },
+{"bvsw",	one(0064400),	one(0177777), "BW", m68000up | mcf },
+{"bplw",	one(0065000),	one(0177777), "BW", m68000up | mcf },
+{"bmiw",	one(0065400),	one(0177777), "BW", m68000up | mcf },
+{"bgew",	one(0066000),	one(0177777), "BW", m68000up | mcf },
+{"bltw",	one(0066400),	one(0177777), "BW", m68000up | mcf },
+{"bgtw",	one(0067000),	one(0177777), "BW", m68000up | mcf },
+{"blew",	one(0067400),	one(0177777), "BW", m68000up | mcf },
 
 {"bhil",	one(0061377),	one(0177777), "BL", m68020up | cpu32 },
 {"blsl",	one(0061777),	one(0177777), "BL", m68020up | cpu32 },
@@ -145,44 +145,44 @@
 {"bgtl",	one(0067377),	one(0177777), "BL", m68020up | cpu32 },
 {"blel",	one(0067777),	one(0177777), "BL", m68020up | cpu32 },
 
-{"bhis",	one(0061000),	one(0177400), "BB", m68000up | mcf5200 },
-{"blss",	one(0061400),	one(0177400), "BB", m68000up | mcf5200 },
-{"bccs",	one(0062000),	one(0177400), "BB", m68000up | mcf5200 },
-{"bcss",	one(0062400),	one(0177400), "BB", m68000up | mcf5200 },
-{"bnes",	one(0063000),	one(0177400), "BB", m68000up | mcf5200 },
-{"beqs",	one(0063400),	one(0177400), "BB", m68000up | mcf5200 },
-{"bvcs",	one(0064000),	one(0177400), "BB", m68000up | mcf5200 },
-{"bvss",	one(0064400),	one(0177400), "BB", m68000up | mcf5200 },
-{"bpls",	one(0065000),	one(0177400), "BB", m68000up | mcf5200 },
-{"bmis",	one(0065400),	one(0177400), "BB", m68000up | mcf5200 },
-{"bges",	one(0066000),	one(0177400), "BB", m68000up | mcf5200 },
-{"blts",	one(0066400),	one(0177400), "BB", m68000up | mcf5200 },
-{"bgts",	one(0067000),	one(0177400), "BB", m68000up | mcf5200 },
-{"bles",	one(0067400),	one(0177400), "BB", m68000up | mcf5200 },
+{"bhis",	one(0061000),	one(0177400), "BB", m68000up | mcf },
+{"blss",	one(0061400),	one(0177400), "BB", m68000up | mcf },
+{"bccs",	one(0062000),	one(0177400), "BB", m68000up | mcf },
+{"bcss",	one(0062400),	one(0177400), "BB", m68000up | mcf },
+{"bnes",	one(0063000),	one(0177400), "BB", m68000up | mcf },
+{"beqs",	one(0063400),	one(0177400), "BB", m68000up | mcf },
+{"bvcs",	one(0064000),	one(0177400), "BB", m68000up | mcf },
+{"bvss",	one(0064400),	one(0177400), "BB", m68000up | mcf },
+{"bpls",	one(0065000),	one(0177400), "BB", m68000up | mcf },
+{"bmis",	one(0065400),	one(0177400), "BB", m68000up | mcf },
+{"bges",	one(0066000),	one(0177400), "BB", m68000up | mcf },
+{"blts",	one(0066400),	one(0177400), "BB", m68000up | mcf },
+{"bgts",	one(0067000),	one(0177400), "BB", m68000up | mcf },
+{"bles",	one(0067400),	one(0177400), "BB", m68000up | mcf },
 
-{"jhi",		one(0061000),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jls",		one(0061400),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jcc",		one(0062000),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jcs",		one(0062400),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jne",		one(0063000),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jeq",		one(0063400),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jvc",		one(0064000),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jvs",		one(0064400),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jpl",		one(0065000),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jmi",		one(0065400),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jge",		one(0066000),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jlt",		one(0066400),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jgt",		one(0067000),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jle",		one(0067400),	one(0177400), "Bg", m68000up | mcf5200 },
+{"jhi",		one(0061000),	one(0177400), "Bg", m68000up | mcf },
+{"jls",		one(0061400),	one(0177400), "Bg", m68000up | mcf },
+{"jcc",		one(0062000),	one(0177400), "Bg", m68000up | mcf },
+{"jcs",		one(0062400),	one(0177400), "Bg", m68000up | mcf },
+{"jne",		one(0063000),	one(0177400), "Bg", m68000up | mcf },
+{"jeq",		one(0063400),	one(0177400), "Bg", m68000up | mcf },
+{"jvc",		one(0064000),	one(0177400), "Bg", m68000up | mcf },
+{"jvs",		one(0064400),	one(0177400), "Bg", m68000up | mcf },
+{"jpl",		one(0065000),	one(0177400), "Bg", m68000up | mcf },
+{"jmi",		one(0065400),	one(0177400), "Bg", m68000up | mcf },
+{"jge",		one(0066000),	one(0177400), "Bg", m68000up | mcf },
+{"jlt",		one(0066400),	one(0177400), "Bg", m68000up | mcf },
+{"jgt",		one(0067000),	one(0177400), "Bg", m68000up | mcf },
+{"jle",		one(0067400),	one(0177400), "Bg", m68000up | mcf },
 
-{"bchg",	one(0000500),	one(0170700), "Dd$s", m68000up | mcf5200 },
+{"bchg",	one(0000500),	one(0170700), "Dd$s", m68000up | mcf },
 {"bchg",	one(0004100),	one(0177700), "#b$s", m68000up },
-{"bchg",	one(0004100),	one(0177700), "#bqs", mcf5200 },
+{"bchg",	one(0004100),	one(0177700), "#bqs", mcf },
 
 {"bclr",	one(0000600),	one(0170700), "Dd$s", m68000up },
-{"bclr",	one(0000600),	one(0170700), "Ddvs", mcf5200 },
+{"bclr",	one(0000600),	one(0170700), "Ddvs", mcf },
 {"bclr",	one(0004200),	one(0177700), "#b$s", m68000up },
-{"bclr",	one(0004200),	one(0177700), "#bqs", mcf5200 },
+{"bclr",	one(0004200),	one(0177700), "#bqs", mcf },
 
 {"bfchg",	two(0165300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
 {"bfclr",	two(0166300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
@@ -197,22 +197,22 @@
 
 {"bkpt",	one(0044110),		one(0177770), "ts", m68010up },
 
-{"braw",	one(0060000),	one(0177777), "BW", m68000up | mcf5200 },
+{"braw",	one(0060000),	one(0177777), "BW", m68000up | mcf },
 {"bral",	one(0060377),	one(0177777), "BL", m68020up | cpu32 },
-{"bras",	one(0060000),	one(0177400), "BB", m68000up | mcf5200 },
+{"bras",	one(0060000),	one(0177400), "BB", m68000up | mcf },
 
 {"bset",	one(0000700),	one(0170700), "Dd$s", m68000up },
-{"bset",	one(0000700),	one(0170700), "Ddvs", mcf5200 },
+{"bset",	one(0000700),	one(0170700), "Ddvs", mcf },
 {"bset",	one(0004300),	one(0177700), "#b$s", m68000up },
-{"bset",	one(0004300),	one(0177700), "#bqs", mcf5200 },
+{"bset",	one(0004300),	one(0177700), "#bqs", mcf },
 
-{"bsrw",	one(0060400),	one(0177777), "BW", m68000up | mcf5200 },
+{"bsrw",	one(0060400),	one(0177777), "BW", m68000up | mcf },
 {"bsrl",	one(0060777),	one(0177777), "BL", m68020up | cpu32 },
-{"bsrs",	one(0060400),	one(0177400), "BB", m68000up | mcf5200 },
+{"bsrs",	one(0060400),	one(0177400), "BB", m68000up | mcf },
 
-{"btst",	one(0000400),	one(0170700), "Dd;b", m68000up | mcf5200 },
+{"btst",	one(0000400),	one(0170700), "Dd;b", m68000up | mcf },
 {"btst",	one(0004000),	one(0177700), "#b@s", m68000up },
-{"btst",	one(0004000),	one(0177700), "#bqs", mcf5200 },
+{"btst",	one(0004000),	one(0177700), "#bqs", mcf },
 
 {"callm",	one(0003300),		one(0177700), "#b!s", m68020 },
 
@@ -242,28 +242,28 @@
 
 {"cpusha",	one(0xf420|SCOPE_ALL),  one(0xff38), "ce",   m68040up },
 {"cpushl",	one(0xf420|SCOPE_LINE), one(0xff38), "ceas", m68040up },
-{"cpushl",	one(0x04e8),		one(0xfff8), "as",   mcf5200  },
+{"cpushl",	one(0x04e8),		one(0xfff8), "as",   mcf },
 {"cpushp",	one(0xf420|SCOPE_PAGE), one(0xff38), "ceas", m68040up },
 
 #undef SCOPE_LINE
 #undef SCOPE_PAGE
 #undef SCOPE_ALL
 
-{"clrb",	one(0041000),	one(0177700), "$s", m68000up | mcf5200 },
-{"clrw",	one(0041100),	one(0177700), "$s", m68000up | mcf5200 },
-{"clrl",	one(0041200),	one(0177700), "$s", m68000up | mcf5200 },
+{"clrb",	one(0041000),	one(0177700), "$s", m68000up | mcf },
+{"clrw",	one(0041100),	one(0177700), "$s", m68000up | mcf },
+{"clrl",	one(0041200),	one(0177700), "$s", m68000up | mcf },
 
 {"cmp2b",	two(0000300,0), two(0177700,07777), "!sR1", m68020up | cpu32 },
 {"cmp2w",	two(0001300,0),	two(0177700,07777), "!sR1", m68020up | cpu32 },
 {"cmp2l",	two(0002300,0),	two(0177700,07777), "!sR1", m68020up | cpu32 },
 
 {"cmpaw",	one(0130300),	one(0170700), "*wAd", m68000up },
-{"cmpal",	one(0130700),	one(0170700), "*lAd", m68000up | mcf5200 },
+{"cmpal",	one(0130700),	one(0170700), "*lAd", m68000up | mcf },
 
 {"cmpib",	one(0006000),	one(0177700), "#b@s", m68000up },
 {"cmpiw",	one(0006100),	one(0177700), "#w@s", m68000up },
 {"cmpil",	one(0006200),	one(0177700), "#l@s", m68000up },
-{"cmpil",	one(0006200),	one(0177700), "#lDs", mcf5200 },
+{"cmpil",	one(0006200),	one(0177700), "#lDs", mcf },
 
 {"cmpmb",	one(0130410),	one(0170770), "+s+d", m68000up },
 {"cmpmw",	one(0130510),	one(0170770), "+s+d", m68000up },
@@ -277,11 +277,11 @@
 {"cmpw",	one(0006100),	one(0177700), "#w@s", m68000up },
 {"cmpw",	one(0130510),	one(0170770), "+s+d", m68000up },
 {"cmpw",	one(0130100),	one(0170700), "*wDd", m68000up },
-{"cmpl",	one(0130700),	one(0170700), "*lAd", m68000up | mcf5200 },
+{"cmpl",	one(0130700),	one(0170700), "*lAd", m68000up | mcf },
 {"cmpl",	one(0006200),	one(0177700), "#l@s", m68000up },
-{"cmpl",	one(0006200),	one(0177700), "#lDs", mcf5200 },
+{"cmpl",	one(0006200),	one(0177700), "#lDs", mcf },
 {"cmpl",	one(0130610),	one(0170770), "+s+d", m68000up },
-{"cmpl",	one(0130200),	one(0170700), "*lDd", m68000up | mcf5200 },
+{"cmpl",	one(0130200),	one(0170700), "*lDd", m68000up | mcf },
 
 {"dbcc",	one(0052310),	one(0177770), "DsBw", m68000up },
 {"dbcs",	one(0052710),	one(0177770), "DsBw", m68000up },
@@ -301,17 +301,21 @@
 {"dbvs",	one(0054710),	one(0177770), "DsBw", m68000up },
 
 {"divsw",	one(0100700),		one(0170700), ";wDd", m68000up },
+{"divsw",	one(0100700),   one(0170700), "vsDd", mcf5307 | mcf5206e },
 
 {"divsl", two(0046100,0006000),two(0177700,0107770),";lD3D1", m68020up|cpu32 },
 {"divsl", two(0046100,0004000),two(0177700,0107770),";lDD",   m68020up|cpu32 },
+{"divsl", two(0046100,0004000),two(0177700,0107770),"vsDD",   mcf5307 | mcf5206e },
 
 {"divsll", two(0046100,0004000),two(0177700,0107770),";lD3D1",m68020up|cpu32 },
 {"divsll", two(0046100,0004000),two(0177700,0107770),";lDD",  m68020up|cpu32 },
 
 {"divuw",	one(0100300),		one(0170700), ";wDd", m68000up },
+{"divuw",	one(0100300),		one(0170700), "vsDd", mcf5307 | mcf5206e },
 
 {"divul", two(0046100,0002000),two(0177700,0107770),";lD3D1", m68020up|cpu32 },
 {"divul", two(0046100,0000000),two(0177700,0107770),";lDD",   m68020up|cpu32 },
+{"divul", two(0046100,0000000),two(0177700,0107770),"vsDD",   mcf5307 | mcf5206e },
 
 {"divull", two(0046100,0000000),two(0177700,0107770),";lD3D1",m68020up|cpu32 },
 {"divull", two(0046100,0000000),two(0177700,0107770),";lDD",  m68020up|cpu32 },
@@ -321,7 +325,7 @@
 {"eoriw",	one(0005100),	one(0177700), "#w$s", m68000up },
 {"eoriw",	one(0005174),	one(0177777), "#wSs", m68000up },
 {"eoril",	one(0005200),	one(0177700), "#l$s", m68000up },
-{"eoril",	one(0005200),	one(0177700), "#lDs", mcf5200 },
+{"eoril",	one(0005200),	one(0177700), "#lDs", mcf },
 {"eori",	one(0005074),	one(0177777), "#bCs", m68000up },
 {"eori",	one(0005174),	one(0177777), "#wSs", m68000up },
 {"eori",	one(0005100),	one(0177700), "#w$s", m68000up },
@@ -334,8 +338,8 @@
 {"eorw",	one(0005174),	one(0177777), "#wSs", m68000up },
 {"eorw",	one(0130500),	one(0170700), "Dd$s", m68000up },
 {"eorl",	one(0005200),	one(0177700), "#l$s", m68000up },
-{"eorl",	one(0005200),	one(0177700), "#lDs", mcf5200 },
-{"eorl",	one(0130600),	one(0170700), "Dd$s", m68000up | mcf5200 },
+{"eorl",	one(0005200),	one(0177700), "#lDs", mcf },
+{"eorl",	one(0130600),	one(0170700), "Dd$s", m68000up | mcf },
 {"eor",		one(0005074),	one(0177777), "#bCs", m68000up },
 {"eor",		one(0005174),	one(0177777), "#wSs", m68000up },
 {"eor",		one(0005100),	one(0177700), "#w$s", m68000up },
@@ -346,9 +350,9 @@
 {"exg",		one(0140610),	one(0170770), "DdAs", m68000up },
 {"exg",		one(0140610),	one(0170770), "AsDd", m68000up },
 
-{"extw",	one(0044200),	one(0177770), "Ds", m68000up|mcf5200 },
-{"extl",	one(0044300),	one(0177770), "Ds", m68000up|mcf5200 },
-{"extbl",	one(0044700),	one(0177770), "Ds", m68020up|cpu32|mcf5200 },
+{"extw",	one(0044200),	one(0177770), "Ds", m68000up|mcf },
+{"extl",	one(0044300),	one(0177770), "Ds", m68000up|mcf },
+{"extbl",	one(0044700),	one(0177770), "Ds", m68020up|cpu32|mcf },
 
 /* float stuff starts here */
 
@@ -1198,27 +1202,27 @@
 {"ftwotoxx",	two(0xF000, 0x4811), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
 {"ftwotoxx",	two(0xF000, 0x0011), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"halt",	one(0045310),	one(0177777), "",     m68060 | mcf5200 },
+{"halt",	one(0045310),	one(0177777), "",     m68060 | mcf },
 
 {"illegal",	one(0045374),	one(0177777), "",     m68000up },
 
-{"jmp",		one(0047300),	one(0177700), "!s", m68000up | mcf5200 },
+{"jmp",		one(0047300),	one(0177700), "!s", m68000up | mcf },
 
-{"jra",		one(0060000),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jra",		one(0047300),	one(0177700), "!s", m68000up | mcf5200 },
+{"jra",		one(0060000),	one(0177400), "Bg", m68000up | mcf },
+{"jra",		one(0047300),	one(0177700), "!s", m68000up | mcf },
 
-{"jsr",		one(0047200),	one(0177700), "!s", m68000up | mcf5200 },
+{"jsr",		one(0047200),	one(0177700), "!s", m68000up | mcf },
 
-{"jbsr",	one(0060400),	one(0177400), "Bg", m68000up | mcf5200 },
-{"jbsr",	one(0047200),	one(0177700), "!s", m68000up | mcf5200 },
+{"jbsr",	one(0060400),	one(0177400), "Bg", m68000up | mcf },
+{"jbsr",	one(0047200),	one(0177700), "!s", m68000up | mcf },
 
-{"lea",		one(0040700),	one(0170700), "!sAd", m68000up | mcf5200 },
+{"lea",		one(0040700),	one(0170700), "!sAd", m68000up | mcf },
 
 {"lpstop",	two(0174000,0000700),two(0177777,0177777),"#w", cpu32|m68060 },
 
-{"linkw",	one(0047120),	one(0177770), "As#w", m68000up | mcf5200 },
+{"linkw",	one(0047120),	one(0177770), "As#w", m68000up | mcf },
 {"linkl",	one(0044010),	one(0177770), "As#l", m68020up | cpu32 },
-{"link",	one(0047120),	one(0177770), "As#W", m68000up | mcf5200 },
+{"link",	one(0047120),	one(0177770), "As#W", m68000up | mcf },
 {"link",	one(0044010),	one(0177770), "As#l", m68020up | cpu32 },
 
 {"lslb",	one(0160410),	one(0170770), "QdDs", m68000up },
@@ -1226,16 +1230,55 @@
 {"lslw",	one(0160510),	one(0170770), "QdDs", m68000up },
 {"lslw",	one(0160550),	one(0170770), "DdDs", m68000up },
 {"lslw",	one(0161700),	one(0177700), "~s",   m68000up },
-{"lsll",	one(0160610),	one(0170770), "QdDs", m68000up | mcf5200 },
-{"lsll",	one(0160650),	one(0170770), "DdDs", m68000up | mcf5200 },
+{"lsll",	one(0160610),	one(0170770), "QdDs", m68000up | mcf },
+{"lsll",	one(0160650),	one(0170770), "DdDs", m68000up | mcf },
 
 {"lsrb",	one(0160010),	one(0170770), "QdDs", m68000up },
 {"lsrb",	one(0160050),	one(0170770), "DdDs", m68000up },
 {"lsrw",	one(0160110),	one(0170770), "QdDs", m68000up },
 {"lsrw",	one(0160150),	one(0170770), "DdDs", m68000up },
 {"lsrw",	one(0161300),	one(0177700), "~s",   m68000up },
-{"lsrl",	one(0160210),	one(0170770), "QdDs", m68000up | mcf5200 },
-{"lsrl",	one(0160250),	one(0170770), "DdDs", m68000up | mcf5200 },
+{"lsrl",	one(0160210),	one(0170770), "QdDs", m68000up | mcf },
+{"lsrl",	one(0160250),	one(0170770), "DdDs", m68000up | mcf },
+
+  /* FIXME: add MAM mode (`&' after <ea> operand) / remove MACM */
+{"macw",  two(0120000, 0000000), two(0170660, 0005400), "uMum", mcf5307 | mcf5206e },
+{"macw",  two(0120000, 0001000), two(0170660, 0005400), "uMumMh", mcf5307 | mcf5206e },
+{"macw",  two(0120220, 0000000), two(0170670, 0005460), "uNuoasRn", mcf5307 | mcf5206e },
+{"macw",  two(0120230, 0000000), two(0170670, 0005460), "uNuo+sRn", mcf5307 | mcf5206e },
+{"macw",  two(0120240, 0000000), two(0170670, 0005460), "uNuo-sRn", mcf5307 | mcf5206e },
+{"macw",  two(0120250, 0000000), two(0170670, 0005460), "uNuodsRn", mcf5307 | mcf5206e },
+{"macw",  two(0120220, 0001000), two(0170670, 0005460), "uNuoMhasRn", mcf5307 | mcf5206e },
+{"macw",  two(0120230, 0001000), two(0170670, 0005460), "uNuoMh+sRn", mcf5307 | mcf5206e },
+{"macw",  two(0120240, 0001000), two(0170670, 0005460), "uNuoMh-sRn", mcf5307 | mcf5206e },
+{"macw",  two(0120250, 0001000), two(0170670, 0005460), "uNuoMhdsRn", mcf5307 | mcf5206e },
+{"macmw", two(0120220, 0000040), two(0170670, 0005460), "uNuoasRn", mcf5307 | mcf5206e },
+{"macmw", two(0120230, 0000040), two(0170670, 0005460), "uNuo+sRn", mcf5307 | mcf5206e },
+{"macmw", two(0120240, 0000040), two(0170670, 0005460), "uNuo-sRn", mcf5307 | mcf5206e },
+{"macmw", two(0120250, 0000040), two(0170670, 0005460), "uNuodsRn", mcf5307 | mcf5206e },
+{"macmw", two(0120220, 0001040), two(0170670, 0005460), "uNuoMhasRn", mcf5307 | mcf5206e },
+{"macmw", two(0120230, 0001040), two(0170670, 0005460), "uNuoMh+sRn", mcf5307 | mcf5206e },
+{"macmw", two(0120240, 0001040), two(0170670, 0005460), "uNuoMh-sRn", mcf5307 | mcf5206e },
+{"macmw", two(0120250, 0001040), two(0170670, 0005460), "uNuoMhdsRn", mcf5307 | mcf5206e },
+
+{"macl",  two(0120000, 0004000), two(0170660, 0005400), "RsRm", mcf5307 | mcf5206e },
+{"macl",  two(0120000, 0005000), two(0170660, 0005400), "RsRmMh", mcf5307 | mcf5206e },
+{"macl",  two(0120220, 0004000), two(0170670, 0005460), "R3R1asRn", mcf5307 | mcf5206e },
+{"macl",  two(0120230, 0004000), two(0170670, 0005460), "R3R1+sRn", mcf5307 | mcf5206e },
+{"macl",  two(0120240, 0004000), two(0170670, 0005460), "R3R1-sRn", mcf5307 | mcf5206e },
+{"macl",  two(0120250, 0004000), two(0170670, 0005460), "R3R1dsRn", mcf5307 | mcf5206e },
+{"macl",  two(0120220, 0005000), two(0170670, 0005460), "R3R1MhasRn", mcf5307 | mcf5206e },
+{"macl",  two(0120230, 0005000), two(0170670, 0005460), "R3R1Mh+sRn", mcf5307 | mcf5206e },
+{"macl",  two(0120240, 0005000), two(0170670, 0005460), "R3R1Mh-sRn", mcf5307 | mcf5206e },
+{"macl",  two(0120250, 0005000), two(0170670, 0005460), "R3R1MhdsRn", mcf5307 | mcf5206e },
+{"macml", two(0120220, 0004040), two(0170670, 0005460), "R3R1asRn", mcf5307 | mcf5206e },
+{"macml", two(0120230, 0004040), two(0170670, 0005460), "R3R1+sRn", mcf5307 | mcf5206e },
+{"macml", two(0120240, 0004040), two(0170670, 0005460), "R3R1-sRn", mcf5307 | mcf5206e },
+{"macml", two(0120250, 0004040), two(0170670, 0005460), "R3R1dsRn", mcf5307 | mcf5206e },
+{"macml", two(0120220, 0005040), two(0170670, 0005460), "R3R1MhasRn", mcf5307 | mcf5206e },
+{"macml", two(0120230, 0005040), two(0170670, 0005460), "R3R1Mh+sRn", mcf5307 | mcf5206e },
+{"macml", two(0120240, 0005040), two(0170670, 0005460), "R3R1Mh-sRn", mcf5307 | mcf5206e },
+{"macml", two(0120250, 0005040), two(0170670, 0005460), "R3R1MhdsRn", mcf5307 | mcf5206e },
 
 /* NOTE: The mcf5200 family programmer's reference manual does not 
    indicate the byte form of the movea instruction is invalid (as it
@@ -1254,11 +1297,11 @@
 	jtc@cygnus.com - 97/01/24
  */
 
-{"moveal",	one(0020100),	one(0170700), "*lAd", m68000up | mcf5200 },
-{"moveaw",	one(0030100),	one(0170700), "*wAd", m68000up | mcf5200 },
+{"moveal",	one(0020100),	one(0170700), "*lAd", m68000up | mcf },
+{"moveaw",	one(0030100),	one(0170700), "*wAd", m68000up | mcf },
 
-{"movec",	one(0047173),	one(0177777), "R1Jj", m68010up | mcf5200 },
-{"movec",	one(0047173),	one(0177777), "R1#j", m68010up | mcf5200 },
+{"movec",	one(0047173),	one(0177777), "R1Jj", m68010up | mcf },
+{"movec",	one(0047173),	one(0177777), "R1#j", m68010up | mcf },
 {"movec",	one(0047172),	one(0177777), "JjR1", m68010up },
 {"movec",	one(0047172),	one(0177777), "#jR1", m68010up },
 
@@ -1273,66 +1316,76 @@
 {"moveml",	one(0046300),	one(0177700), "<sLw", m68000up },
 {"moveml",	one(0046300),	one(0177700), "<s#w", m68000up },
 /* FIXME: need specifier for mode 2 and 5 to simplify below insn patterns */
-{"moveml",	one(0044320),	one(0177770), "Lwas", mcf5200 },
-{"moveml",	one(0044320),	one(0177770), "#was", mcf5200 },
-{"moveml",	one(0044350),	one(0177770), "Lwds", mcf5200 },
-{"moveml",	one(0044350),	one(0177770), "#wds", mcf5200 },
-{"moveml",	one(0046320),	one(0177770), "asLw", mcf5200 },
-{"moveml",	one(0046320),	one(0177770), "as#w", mcf5200 },
-{"moveml",	one(0046350),	one(0177770), "dsLw", mcf5200 },
-{"moveml",	one(0046350),	one(0177770), "ds#w", mcf5200 },
+{"moveml",	one(0044320),	one(0177770), "Lwas", mcf },
+{"moveml",	one(0044320),	one(0177770), "#was", mcf },
+{"moveml",	one(0044350),	one(0177770), "Lwds", mcf },
+{"moveml",	one(0044350),	one(0177770), "#wds", mcf },
+{"moveml",	one(0046320),	one(0177770), "asLw", mcf },
+{"moveml",	one(0046320),	one(0177770), "as#w", mcf },
+{"moveml",	one(0046350),	one(0177770), "dsLw", mcf },
+{"moveml",	one(0046350),	one(0177770), "ds#w", mcf },
 
 {"movepw",	one(0000410),	one(0170770), "dsDd", m68000up },
 {"movepw",	one(0000610),	one(0170770), "Ddds", m68000up },
 {"movepl",	one(0000510),	one(0170770), "dsDd", m68000up },
 {"movepl",	one(0000710),	one(0170770), "Ddds", m68000up },
 
-{"moveq",	one(0070000),	one(0170400), "MsDd", m68000up | mcf5200 },
-{"moveq",	one(0070000),	one(0170400), "#BDd", m68000up | mcf5200 },
+{"moveq",	one(0070000),	one(0170400), "MsDd", m68000up | mcf },
+{"moveq",	one(0070000),	one(0170400), "#BDd", m68000up | mcf },
 
 /* The move opcode can generate the movea and moveq instructions.  */
 {"moveb",	one(0010000),	one(0170000), ";b$d", m68000up },
-{"moveb",	one(0010000),	one(0170000), "ms%d", mcf5200 },
-{"moveb",	one(0010000),	one(0170000), "nspd", mcf5200 },
-{"moveb",	one(0010000),	one(0170000), "obmd", mcf5200 },
+{"moveb",	one(0010000),	one(0170000), "ms%d", mcf },
+{"moveb",	one(0010000),	one(0170000), "nspd", mcf },
+{"moveb",	one(0010000),	one(0170000), "obmd", mcf },
 
 {"movew",	one(0030000),	one(0170000), "*w%d", m68000up },
-{"movew",	one(0030000),	one(0170000), "ms%d", mcf5200 },
-{"movew",	one(0030000),	one(0170000), "nspd", mcf5200 },
-{"movew",	one(0030000),	one(0170000), "owmd", mcf5200 },
+{"movew",	one(0030000),	one(0170000), "ms%d", mcf },
+{"movew",	one(0030000),	one(0170000), "nspd", mcf },
+{"movew",	one(0030000),	one(0170000), "owmd", mcf },
 {"movew",	one(0040300),	one(0177700), "Ss$s", m68000up },
-{"movew",	one(0040300),	one(0177770), "SsDs", mcf5200 },
+{"movew",	one(0040300),	one(0177770), "SsDs", mcf },
 {"movew",	one(0041300),	one(0177700), "Cs$s", m68010up },
-{"movew",	one(0041300),	one(0177770), "CsDs", mcf5200 },
+{"movew",	one(0041300),	one(0177770), "CsDs", mcf },
 {"movew",	one(0042300),	one(0177700), ";wCd", m68000up },
-{"movew",	one(0042300),	one(0177700), "DsCd", mcf5200 },
-{"movew",	one(0042374),	one(0177777), "#wCd", mcf5200 },
+{"movew",	one(0042300),	one(0177700), "DsCd", mcf },
+{"movew",	one(0042374),	one(0177777), "#wCd", mcf },
 {"movew",	one(0043300),	one(0177700), ";wSd", m68000up },
-{"movew",	one(0043300),	one(0177700), "DsSd", mcf5200 },
-{"movew",	one(0043374),	one(0177777), "#wSd", mcf5200 },
+{"movew",	one(0043300),	one(0177700), "DsSd", mcf },
+{"movew",	one(0043374),	one(0177777), "#wSd", mcf },
 
-{"movel",	one(0070000),	one(0170400), "MsDd", m68000up | mcf5200 },
+{"movel",	one(0070000),	one(0170400), "MsDd", m68000up | mcf },
 {"movel",	one(0020000),	one(0170000), "*l%d", m68000up },
-{"movel",	one(0020000),	one(0170000), "ms%d", mcf5200 },
-{"movel",	one(0020000),	one(0170000), "nspd", mcf5200 },
-{"movel",	one(0020000),	one(0170000), "olmd", mcf5200 },
+{"movel",	one(0020000),	one(0170000), "ms%d", mcf },
+{"movel",	one(0020000),	one(0170000), "nspd", mcf },
+{"movel",	one(0020000),	one(0170000), "olmd", mcf },
 {"movel",	one(0047140),	one(0177770), "AsUd", m68000up },
 {"movel",	one(0047150),	one(0177770), "UdAs", m68000up },
+{"movel",	one(0120600),	one(0177760), "EsRs", mcf5307 | mcf5206e },
+{"movel",	one(0120400),	one(0177760), "RsEs", mcf5307 | mcf5206e },
+{"movel",	one(0120474),	one(0177777), "#lEs", mcf5307 | mcf5206e },
+{"movel",	one(0124600),	one(0177760), "GsRs", mcf5307 | mcf5206e },
+{"movel",	one(0124400),	one(0177760), "RsGs", mcf5307 | mcf5206e },
+{"movel",	one(0124474),	one(0177777), "#lGs", mcf5307 | mcf5206e },
+{"movel",	one(0126600),	one(0177760), "HsRs", mcf5307 | mcf5206e },
+{"movel",	one(0126400),	one(0177760), "RsHs", mcf5307 | mcf5206e },
+{"movel",	one(0126474),	one(0177777), "#lHs", mcf5307 | mcf5206e },
+{"movel",	one(0124700),	one(0177777), "GsCs", mcf5307 | mcf5206e },
 
 {"move",	one(0030000),	one(0170000), "*w%d", m68000up },
-{"move",	one(0030000),	one(0170000), "ms%d", mcf5200 },
-{"move",	one(0030000),	one(0170000), "nspd", mcf5200 },
-{"move",	one(0030000),	one(0170000), "owmd", mcf5200 },
+{"move",	one(0030000),	one(0170000), "ms%d", mcf },
+{"move",	one(0030000),	one(0170000), "nspd", mcf },
+{"move",	one(0030000),	one(0170000), "owmd", mcf },
 {"move",	one(0040300),	one(0177700), "Ss$s", m68000up },
-{"move",	one(0040300),	one(0177770), "SsDs", mcf5200 },
+{"move",	one(0040300),	one(0177770), "SsDs", mcf },
 {"move",	one(0041300),	one(0177700), "Cs$s", m68010up },
-{"move",	one(0041300),	one(0177770), "CsDs", mcf5200 },
+{"move",	one(0041300),	one(0177770), "CsDs", mcf },
 {"move",	one(0042300),	one(0177700), ";wCd", m68000up },
-{"move",	one(0042300),	one(0177700), "DsCd", mcf5200 },
-{"move",	one(0042374),	one(0177777), "#wCd", mcf5200 },
+{"move",	one(0042300),	one(0177700), "DsCd", mcf },
+{"move",	one(0042374),	one(0177777), "#wCd", mcf },
 {"move",	one(0043300),	one(0177700), ";wSd", m68000up },
-{"move",	one(0043300),	one(0177700), "DsSd", mcf5200 },
-{"move",	one(0043374),	one(0177777), "#wSd", mcf5200 },
+{"move",	one(0043300),	one(0177700), "DsSd", mcf },
+{"move",	one(0043374),	one(0177777), "#wSd", mcf },
 
 {"move",	one(0047140),	one(0177770), "AsUd", m68000up },
 {"move",	one(0047150),	one(0177770), "UdAs", m68000up },
@@ -1350,14 +1403,53 @@
 {"move16",	one(0xf610),		one(0xfff8), "as_L", m68040up },
 {"move16",	one(0xf618),		one(0xfff8), "_Las", m68040up },
 
-{"mulsw",	one(0140700),		one(0170700), ";wDd", m68000up|mcf5200 },
+  /* FIXME: add MAM mode (`&' after <ea> operand) / remove MSACM */
+{"msacw",  two(0120000, 0000400), two(0170660, 0005400), "uMum", mcf5307 | mcf5206e },
+{"msacw",  two(0120000, 0001400), two(0170660, 0005400), "uMumMh", mcf5307 | mcf5206e },
+{"msacw",  two(0120220, 0000400), two(0170670, 0005460), "uNuoasRn", mcf5307 | mcf5206e },
+{"msacw",  two(0120230, 0000400), two(0170670, 0005460), "uNuo+sRn", mcf5307 | mcf5206e },
+{"msacw",  two(0120240, 0000400), two(0170670, 0005460), "uNuo-sRn", mcf5307 | mcf5206e },
+{"msacw",  two(0120250, 0000400), two(0170670, 0005460), "uNuodsRn", mcf5307 | mcf5206e },
+{"msacw",  two(0120220, 0001400), two(0170670, 0005460), "uNuoMhasRn", mcf5307 | mcf5206e },
+{"msacw",  two(0120230, 0001400), two(0170670, 0005460), "uNuoMh+sRn", mcf5307 | mcf5206e },
+{"msacw",  two(0120240, 0001400), two(0170670, 0005460), "uNuoMh-sRn", mcf5307 | mcf5206e },
+{"msacw",  two(0120250, 0001400), two(0170670, 0005460), "uNuoMhdsRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120220, 0000440), two(0170670, 0005460), "uNuoasRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120230, 0000440), two(0170670, 0005460), "uNuo+sRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120240, 0000440), two(0170670, 0005460), "uNuo-sRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120250, 0000440), two(0170670, 0005460), "uNuodsRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120220, 0001440), two(0170670, 0005460), "uNuoMhasRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120230, 0001440), two(0170670, 0005460), "uNuoMh+sRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120240, 0001440), two(0170670, 0005460), "uNuoMh-sRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120250, 0001440), two(0170670, 0005460), "uNuoMhdsRn", mcf5307 | mcf5206e },
+
+{"msacl",  two(0120000, 0004400), two(0170660, 0005400), "RsRm", mcf5307 | mcf5206e },
+{"msacl",  two(0120000, 0005400), two(0170660, 0005400), "RsRmMh", mcf5307 | mcf5206e },
+{"msacl",  two(0120220, 0004400), two(0170670, 0005460), "R3R1asRn", mcf5307 | mcf5206e },
+{"msacl",  two(0120230, 0004400), two(0170670, 0005460), "R3R1+sRn", mcf5307 | mcf5206e },
+{"msacl",  two(0120240, 0004400), two(0170670, 0005460), "R3R1-sRn", mcf5307 | mcf5206e },
+{"msacl",  two(0120250, 0004400), two(0170670, 0005460), "R3R1dsRn", mcf5307 | mcf5206e },
+{"msacl",  two(0120220, 0005400), two(0170670, 0005460), "R3R1MhasRn", mcf5307 | mcf5206e },
+{"msacl",  two(0120230, 0005400), two(0170670, 0005460), "R3R1Mh+sRn", mcf5307 | mcf5206e },
+{"msacl",  two(0120240, 0005400), two(0170670, 0005460), "R3R1Mh-sRn", mcf5307 | mcf5206e },
+{"msacl",  two(0120250, 0005400), two(0170670, 0005460), "R3R1MhdsRn", mcf5307 | mcf5206e },
+{"msacml", two(0120220, 0004440), two(0170670, 0005460), "R3R1asRn", mcf5307 | mcf5206e },
+{"msacml", two(0120230, 0004440), two(0170670, 0005460), "R3R1+sRn", mcf5307 | mcf5206e },
+{"msacml", two(0120240, 0004440), two(0170670, 0005460), "R3R1-sRn", mcf5307 | mcf5206e },
+{"msacml", two(0120250, 0004440), two(0170670, 0005460), "R3R1dsRn", mcf5307 | mcf5206e },
+{"msacml", two(0120220, 0005440), two(0170670, 0005460), "R3R1MhasRn", mcf5307 | mcf5206e },
+{"msacml", two(0120230, 0005440), two(0170670, 0005460), "R3R1Mh+sRn", mcf5307 | mcf5206e },
+{"msacml", two(0120240, 0005440), two(0170670, 0005460), "R3R1Mh-sRn", mcf5307 | mcf5206e },
+{"msacml", two(0120250, 0005440), two(0170670, 0005460), "R3R1MhdsRn", mcf5307 | mcf5206e },
+
+{"mulsw",	one(0140700),		one(0170700), ";wDd", m68000up|mcf },
 {"mulsl",	two(0046000,004000), two(0177700,0107770), ";lD1", m68020up|cpu32 },
-{"mulsl",	two(0046000,004000), two(0177700,0107770), "qsD1", mcf5200 },
+{"mulsl",	two(0046000,004000), two(0177700,0107770), "qsD1", mcf },
 {"mulsl",	two(0046000,006000), two(0177700,0107770), ";lD3D1",m68020up|cpu32 },
 
-{"muluw",	one(0140300),		one(0170700), ";wDd", m68000up|mcf5200 },
+{"muluw",	one(0140300),		one(0170700), ";wDd", m68000up|mcf },
 {"mulul",	two(0046000,000000), two(0177700,0107770), ";lD1", m68020up|cpu32 },
-{"mulul",	two(0046000,000000), two(0177700,0107770), "qsD1", mcf5200 },
+{"mulul",	two(0046000,000000), two(0177700,0107770), "qsD1", mcf },
 {"mulul",	two(0046000,002000), two(0177700,0107770), ";lD3D1",m68020up|cpu32 },
 
 {"nbcd",	one(0044000),	one(0177700), "$s", m68000up },
@@ -1365,26 +1457,26 @@
 {"negb",	one(0042000),	one(0177700), "$s", m68000up },
 {"negw",	one(0042100),	one(0177700), "$s", m68000up },
 {"negl",	one(0042200),	one(0177700), "$s", m68000up },
-{"negl",	one(0042200),	one(0177700), "Ds", mcf5200},
+{"negl",	one(0042200),	one(0177700), "Ds", mcf},
 
 {"negxb",	one(0040000),	one(0177700), "$s", m68000up },
 {"negxw",	one(0040100),	one(0177700), "$s", m68000up },
 {"negxl",	one(0040200),	one(0177700), "$s", m68000up },
-{"negxl",	one(0040200),	one(0177700), "Ds", mcf5200},
+{"negxl",	one(0040200),	one(0177700), "Ds", mcf},
 
-{"nop",		one(0047161),	one(0177777), "", m68000up | mcf5200},
+{"nop",		one(0047161),	one(0177777), "", m68000up | mcf},
 
 {"notb",	one(0043000),	one(0177700), "$s", m68000up },
 {"notw",	one(0043100),	one(0177700), "$s", m68000up },
 {"notl",	one(0043200),	one(0177700), "$s", m68000up },
-{"notl",	one(0043200),	one(0177700), "Ds", mcf5200},
+{"notl",	one(0043200),	one(0177700), "Ds", mcf},
 
 {"orib",	one(0000000),	one(0177700), "#b$s", m68000up },
 {"orib",	one(0000074),	one(0177777), "#bCs", m68000up },
 {"oriw",	one(0000100),	one(0177700), "#w$s", m68000up },
 {"oriw",	one(0000174),	one(0177777), "#wSs", m68000up },
 {"oril",	one(0000200),	one(0177700), "#l$s", m68000up },
-{"oril",	one(0000200),	one(0177700), "#lDs", mcf5200 },
+{"oril",	one(0000200),	one(0177700), "#lDs", mcf },
 {"ori",		one(0000074),	one(0177777), "#bCs", m68000up },
 {"ori",		one(0000100),	one(0177700), "#w$s", m68000up },
 {"ori",		one(0000174),	one(0177777), "#wSs", m68000up },
@@ -1399,9 +1491,9 @@
 {"orw",		one(0100100),	one(0170700), ";wDd", m68000up },
 {"orw",		one(0100500),	one(0170700), "Dd~s", m68000up },
 {"orl",		one(0000200),	one(0177700), "#l$s", m68000up },
-{"orl",		one(0000200),	one(0177700), "#lDs", mcf5200 },
-{"orl",		one(0100200),	one(0170700), ";lDd", m68000up | mcf5200 },
-{"orl",		one(0100600),	one(0170700), "Dd~s", m68000up | mcf5200 },
+{"orl",		one(0000200),	one(0177700), "#lDs", mcf },
+{"orl",		one(0100200),	one(0170700), ";lDd", m68000up | mcf },
+{"orl",		one(0100600),	one(0170700), "Dd~s", m68000up | mcf },
 {"or",		one(0000074),	one(0177777), "#bCs", m68000up },
 {"or",		one(0000100),	one(0177700), "#w$s", m68000up },
 {"or",		one(0000174),	one(0177777), "#wSs", m68000up },
@@ -1461,7 +1553,7 @@
 {"pdbwc",	two(0xf048, 0x0009),	two(0xfff8, 0xffff), "DsBw", m68851 },
 {"pdbws",	two(0xf048, 0x0008),	two(0xfff8, 0xffff), "DsBw", m68851 },
 
-{"pea",		one(0044100),		one(0177700), "!s", m68000up|mcf5200 },
+{"pea",		one(0044100),		one(0177700), "!s", m68000up|mcf },
 
 {"pflusha",	one(0xf518),		one(0xfff8), "", m68040up },
 {"pflusha",	two(0xf000,0x2400), two(0xffff,0xffff), "", m68030 | m68851 },
@@ -1619,11 +1711,14 @@
 {"ptrapwsl",	two(0xf07b, 0x0008),	two(0xffff, 0xffff), "#l", m68851 },
 {"ptrapws",	two(0xf07c, 0x0008),	two(0xffff, 0xffff), "",   m68851 },
 
-{"pulse",	one(0045314),		one(0177777), "", m68060 | mcf5200 },
+{"pulse",	one(0045314),		one(0177777), "", m68060 | mcf },
 
 {"pvalid",	two(0xf000, 0x2800),	two(0xffc0, 0xffff), "Vs&s", m68851 },
 {"pvalid",	two(0xf000, 0x2c00),	two(0xffc0, 0xfff8), "A3&s", m68851 },
 
+  /* FIXME: don't allow Dw==Dx. */
+{"remsl",       two(0x4c40, 0x0800),    two(0xffc0, 0x8ff8), "vsD3D1", mcf5307 | mcf5206e },
+{"remul",       two(0x4c40, 0x0000),    two(0xffc0, 0x8ff8), "vsD3D1", mcf5307 | mcf5206e },
 
 {"reset",	one(0047160),		one(0177777), "", m68000up },
 
@@ -1661,64 +1756,64 @@
 
 {"rtd",		one(0047164),		one(0177777), "#w", m68010up },
 
-{"rte",		one(0047163),		one(0177777), "",   m68000up|mcf5200 },
+{"rte",		one(0047163),		one(0177777), "",   m68000up|mcf },
 
 {"rtm",		one(0003300),		one(0177760), "Rs", m68020 },
 
 {"rtr",		one(0047167),		one(0177777), "",   m68000up },
 
-{"rts",		one(0047165),		one(0177777), "",   m68000up|mcf5200 },
+{"rts",		one(0047165),		one(0177777), "",   m68000up|mcf },
 
 {"sbcd",	one(0100400),		one(0170770), "DsDd", m68000up },
 {"sbcd",	one(0100410),		one(0170770), "-s-d", m68000up },
 
 
 {"scc",		one(0052300),	one(0177700), "$s", m68000up },
-{"scc",		one(0052300),	one(0177700), "Ds", mcf5200 },
+{"scc",		one(0052300),	one(0177700), "Ds", mcf },
 {"scs",		one(0052700),	one(0177700), "$s", m68000up },
-{"scs",		one(0052700),	one(0177700), "Ds", mcf5200 },
+{"scs",		one(0052700),	one(0177700), "Ds", mcf },
 {"seq",		one(0053700),	one(0177700), "$s", m68000up },
-{"seq",		one(0053700),	one(0177700), "Ds", mcf5200 },
+{"seq",		one(0053700),	one(0177700), "Ds", mcf },
 {"sf",		one(0050700),	one(0177700), "$s", m68000up },
-{"sf",		one(0050700),	one(0177700), "Ds", mcf5200 },
+{"sf",		one(0050700),	one(0177700), "Ds", mcf },
 {"sge",		one(0056300),	one(0177700), "$s", m68000up },
-{"sge",		one(0056300),	one(0177700), "Ds", mcf5200 },
+{"sge",		one(0056300),	one(0177700), "Ds", mcf },
 {"sgt",		one(0057300),	one(0177700), "$s", m68000up },
-{"sgt",		one(0057300),	one(0177700), "Ds", mcf5200 },
+{"sgt",		one(0057300),	one(0177700), "Ds", mcf },
 {"shi",		one(0051300),	one(0177700), "$s", m68000up },
-{"shi",		one(0051300),	one(0177700), "Ds", mcf5200 },
+{"shi",		one(0051300),	one(0177700), "Ds", mcf },
 {"sle",		one(0057700),	one(0177700), "$s", m68000up },
-{"sle",		one(0057700),	one(0177700), "Ds", mcf5200 },
+{"sle",		one(0057700),	one(0177700), "Ds", mcf },
 {"sls",		one(0051700),	one(0177700), "$s", m68000up },
-{"sls",		one(0051700),	one(0177700), "Ds", mcf5200 },
+{"sls",		one(0051700),	one(0177700), "Ds", mcf },
 {"slt",		one(0056700),	one(0177700), "$s", m68000up },
-{"slt",		one(0056700),	one(0177700), "Ds", mcf5200 },
+{"slt",		one(0056700),	one(0177700), "Ds", mcf },
 {"smi",		one(0055700),	one(0177700), "$s", m68000up },
-{"smi",		one(0055700),	one(0177700), "Ds", mcf5200 },
+{"smi",		one(0055700),	one(0177700), "Ds", mcf },
 {"sne",		one(0053300),	one(0177700), "$s", m68000up },
-{"sne",		one(0053300),	one(0177700), "Ds", mcf5200 },
+{"sne",		one(0053300),	one(0177700), "Ds", mcf },
 {"spl",		one(0055300),	one(0177700), "$s", m68000up },
-{"spl",		one(0055300),	one(0177700), "Ds", mcf5200 },
+{"spl",		one(0055300),	one(0177700), "Ds", mcf },
 {"st",		one(0050300),	one(0177700), "$s", m68000up },
-{"st",		one(0050300),	one(0177700), "Ds", mcf5200 },
+{"st",		one(0050300),	one(0177700), "Ds", mcf },
 {"svc",		one(0054300),	one(0177700), "$s", m68000up },
-{"svc",		one(0054300),	one(0177700), "Ds", mcf5200 },
+{"svc",		one(0054300),	one(0177700), "Ds", mcf },
 {"svs",		one(0054700),	one(0177700), "$s", m68000up },
-{"svs",		one(0054700),	one(0177700), "Ds", mcf5200 },
+{"svs",		one(0054700),	one(0177700), "Ds", mcf },
 
-{"stop",	one(0047162),	one(0177777), "#w", m68000up | mcf5200 },
+{"stop",	one(0047162),	one(0177777), "#w", m68000up | mcf },
 
-{"subal",	one(0110700),	one(0170700), "*lAd", m68000up | mcf5200 },
+{"subal",	one(0110700),	one(0170700), "*lAd", m68000up | mcf },
 {"subaw",	one(0110300),	one(0170700), "*wAd", m68000up },
 
 {"subib",	one(0002000),	one(0177700), "#b$s", m68000up },
 {"subiw",	one(0002100),	one(0177700), "#w$s", m68000up },
 {"subil",	one(0002200),	one(0177700), "#l$s", m68000up },
-{"subil",	one(0002200),	one(0177700), "#lDs", mcf5200 },
+{"subil",	one(0002200),	one(0177700), "#lDs", mcf },
 
 {"subqb",	one(0050400),	one(0170700), "Qd%s", m68000up },
 {"subqw",	one(0050500),	one(0170700), "Qd%s", m68000up },
-{"subql",	one(0050600),	one(0170700), "Qd%s", m68000up | mcf5200 },
+{"subql",	one(0050600),	one(0170700), "Qd%s", m68000up | mcf },
 
 /* The sub opcode can generate the suba, subi, and subq instructions.  */
 {"subb",	one(0050400),	one(0170700), "Qd%s", m68000up },
@@ -1730,21 +1825,21 @@
 {"subw",	one(0110300),	one(0170700), "*wAd", m68000up },
 {"subw",	one(0110100),	one(0170700), "*wDd", m68000up },
 {"subw",	one(0110500),	one(0170700), "Dd~s", m68000up },
-{"subl",	one(0050600),	one(0170700), "Qd%s", m68000up | mcf5200 },
+{"subl",	one(0050600),	one(0170700), "Qd%s", m68000up | mcf },
 {"subl",	one(0002200),	one(0177700), "#l$s", m68000up },
-{"subl",	one(0002200),	one(0177700), "#lDs", mcf5200 },
-{"subl",	one(0110700),	one(0170700), "*lAd", m68000up | mcf5200 },
-{"subl",	one(0110200),	one(0170700), "*lDd", m68000up | mcf5200 },
-{"subl",	one(0110600),	one(0170700), "Dd~s", m68000up | mcf5200 },
+{"subl",	one(0002200),	one(0177700), "#lDs", mcf },
+{"subl",	one(0110700),	one(0170700), "*lAd", m68000up | mcf },
+{"subl",	one(0110200),	one(0170700), "*lDd", m68000up | mcf },
+{"subl",	one(0110600),	one(0170700), "Dd~s", m68000up | mcf },
 
 {"subxb",	one(0110400),	one(0170770), "DsDd", m68000up },
 {"subxb",	one(0110410),	one(0170770), "-s-d", m68000up },
 {"subxw",	one(0110500),	one(0170770), "DsDd", m68000up },
 {"subxw",	one(0110510),	one(0170770), "-s-d", m68000up },
-{"subxl",	one(0110600),	one(0170770), "DsDd", m68000up | mcf5200 },
+{"subxl",	one(0110600),	one(0170770), "DsDd", m68000up | mcf },
 {"subxl",	one(0110610),	one(0170770), "-s-d", m68000up },
 
-{"swap",	one(0044100),	one(0177770), "Ds", m68000up | mcf5200 },
+{"swap",	one(0044100),	one(0177770), "Ds", m68000up | mcf },
 
 /* swbeg and swbegl are magic constants used on sysV68.  The compiler
    generates them before a switch table.  They tell the debugger and
@@ -1752,8 +1847,8 @@
    number of elements in the table.  swbeg means that the entries in
    the table are word (2 byte) sized, and swbegl means that the
    entries in the table are longword (4 byte) sized.  */
-{"swbeg",	one(0045374),	one(0177777), "#w",   m68000up | mcf5200 },
-{"swbegl",	one(0045375),	one(0177777), "#l",   m68000up | mcf5200 },
+{"swbeg",	one(0045374),	one(0177777), "#w",   m68000up | mcf },
+{"swbegl",	one(0045375),	one(0177777), "#l",   m68000up | mcf },
 
 {"tas",		one(0045300),		one(0177700), "$s", m68000up },
 
@@ -1769,12 +1864,12 @@
 TBL("tblub", "tbluw", "tblul", 0, 1),
 TBL("tblunb", "tblunw", "tblunl", 0, 0),
 
-{"trap",	one(0047100),	one(0177760), "Ts", m68000up | mcf5200 },
+{"trap",	one(0047100),	one(0177760), "Ts", m68000up | mcf },
 
 {"trapcc",	one(0052374),	one(0177777), "", m68020up | cpu32 },
 {"trapcs",	one(0052774),	one(0177777), "", m68020up | cpu32 },
 {"trapeq",	one(0053774),	one(0177777), "", m68020up | cpu32 },
-{"trapf",	one(0050774),	one(0177777), "", m68020up | cpu32 | mcf5200 },
+{"trapf",	one(0050774),	one(0177777), "", m68020up | cpu32 | mcf },
 {"trapge",	one(0056374),	one(0177777), "", m68020up | cpu32 },
 {"trapgt",	one(0057374),	one(0177777), "", m68020up | cpu32 },
 {"traphi",	one(0051374),	one(0177777), "", m68020up | cpu32 },
@@ -1791,7 +1886,7 @@
 {"trapccw",	one(0052372),	one(0177777), "#w", m68020up|cpu32 },
 {"trapcsw",	one(0052772),	one(0177777), "#w", m68020up|cpu32 },
 {"trapeqw",	one(0053772),	one(0177777), "#w", m68020up|cpu32 },
-{"trapfw",	one(0050772),	one(0177777), "#w", m68020up|cpu32|mcf5200},
+{"trapfw",	one(0050772),	one(0177777), "#w", m68020up|cpu32|mcf},
 {"trapgew",	one(0056372),	one(0177777), "#w", m68020up|cpu32 },
 {"trapgtw",	one(0057372),	one(0177777), "#w", m68020up|cpu32 },
 {"traphiw",	one(0051372),	one(0177777), "#w", m68020up|cpu32 },
@@ -1808,7 +1903,7 @@
 {"trapccl",	one(0052373),	one(0177777), "#l", m68020up|cpu32 },
 {"trapcsl",	one(0052773),	one(0177777), "#l", m68020up|cpu32 },
 {"trapeql",	one(0053773),	one(0177777), "#l", m68020up|cpu32 },
-{"trapfl",	one(0050773),	one(0177777), "#l", m68020up|cpu32|mcf5200},
+{"trapfl",	one(0050773),	one(0177777), "#l", m68020up|cpu32|mcf},
 {"trapgel",	one(0056373),	one(0177777), "#l", m68020up|cpu32 },
 {"trapgtl",	one(0057373),	one(0177777), "#l", m68020up|cpu32 },
 {"traphil",	one(0051373),	one(0177777), "#l", m68020up|cpu32 },
@@ -1824,21 +1919,21 @@
 
 {"trapv",	one(0047166),	one(0177777), "", m68000up },
 
-{"tstb",	one(0045000),	one(0177700), ";b", m68020up|cpu32|mcf5200 },
+{"tstb",	one(0045000),	one(0177700), ";b", m68020up|cpu32|mcf },
 {"tstb",	one(0045000),	one(0177700), "$b", m68000up },
-{"tstw",	one(0045100),	one(0177700), "*w", m68020up|cpu32|mcf5200 },
+{"tstw",	one(0045100),	one(0177700), "*w", m68020up|cpu32|mcf },
 {"tstw",	one(0045100),	one(0177700), "$w", m68000up },
-{"tstl",	one(0045200),	one(0177700), "*l", m68020up|cpu32|mcf5200 },
+{"tstl",	one(0045200),	one(0177700), "*l", m68020up|cpu32|mcf },
 {"tstl",	one(0045200),	one(0177700), "$l", m68000up },
 
-{"unlk",	one(0047130),	one(0177770), "As", m68000up | mcf5200 },
+{"unlk",	one(0047130),	one(0177770), "As", m68000up | mcf },
 
 {"unpk",	one(0100600),	one(0170770), "DsDd#w", m68020up },
 {"unpk",	one(0100610),	one(0170770), "-s-d#w", m68020up },
 
-{"wddatab",	one(0172000),   one(0177700), "~s", mcf5200 },
-{"wddataw",	one(0172100),   one(0177700), "~s", mcf5200 },
-{"wddatal",	one(0172200),   one(0177700), "~s", mcf5200 },
+{"wddatab",	one(0172000),   one(0177700), "~s", mcf },
+{"wddataw",	one(0172100),   one(0177700), "~s", mcf },
+{"wddatal",	one(0172200),   one(0177700), "~s", mcf },
 
 };
 
@@ -1973,6 +2068,7 @@
   { "leal",	"lea", },
   { "lsl",	"lslw", },
   { "lsr",	"lsrw", },
+  { "mac",	"macw" },
   { "movea",	"moveaw", },
   { "movem",	"movemw", },
   { "movml",	"moveml", },
@@ -1983,6 +2079,7 @@
   { "moves",	"movesw" },
   { "muls",	"mulsw", },
   { "mulu",	"muluw", },
+  { "msac",	"msacw" },
   { "nbcdb",	"nbcd" },
   { "neg",	"negw", },
   { "negx",	"negxw", },
diff --git a/opcodes/mcore-dis.c b/opcodes/mcore-dis.c
index 42c1793b..36612a2 100644
--- a/opcodes/mcore-dis.c
+++ b/opcodes/mcore-dis.c
@@ -57,6 +57,9 @@
     /* OMc */ 0xFF00,
     /* SIa */ 0xFE00,
 
+/* start-sanitize-m340 */
+  /* MULSH */ 0xFF00,
+/* end-sanitize-m340 */
 		 
     /* JC  */ 0,		/* JC,JU,JL don't appear in object */
     /* JU  */ 0,
@@ -96,6 +99,8 @@
   mcore_opcode_info * op;
   int                 status;
 
+  info->bytes_per_chunk = 2;
+
   status = info->read_memory_func (memaddr, ibytes, 2, info);
 
   if (status != 0) 
@@ -104,17 +109,24 @@
       return -1;
     }
 
-  inst = (ibytes[0] << 8) | ibytes[1];
+/* start-sanitize-m340 */
+  if (info->endian == BFD_ENDIAN_BIG)
+/* end-sanitize-m340 */
+    inst = (ibytes[0] << 8) | ibytes[1];
+/* start-sanitize-m340 */
+  else if (info->endian == BFD_ENDIAN_LITTLE)
+    inst = (ibytes[1] << 8) | ibytes[0];
+  else
+    abort ();
+/* end-sanitize-m340 */
 
   /* Just a linear search of the table.  */
   for (op = mcore_table; op->name != 0; op ++)
-    {
-      if (op->inst == (inst & imsk[op->opclass]))
-	break;
-    }
+    if (op->inst == (inst & imsk[op->opclass]))
+      break;
 
   if (op->name == 0)
-    fprintf (stream, ".word 0x%04x", inst);
+    fprintf (stream, ".short 0x%04x", inst);
   else
     {
       const char * name = grname[inst & 0x0F];
@@ -130,6 +142,9 @@
 	case JSR: fprintf (stream, "\t%s", name); break;
 	case OC:  fprintf (stream, "\t%s, %s", name, crname[(inst >> 4) & 0x1F]); break;
 	case O1R1: fprintf (stream, "\t%s, r1", name); break;
+/* start-sanitize-m340 */
+	case MULSH:
+/* end-sanitize-m340 */
 	case O2: fprintf (stream, "\t%s, %s", name, grname[(inst >> 4) & 0xF]); break;
 	case X1: fprintf (stream, "\tr1, %s", name); break;
 	case OI: fprintf (stream, "\t%s, %d", name, ((inst >> 4) & 0x1F) + 1); break;
@@ -191,11 +206,17 @@
 	    if (status != 0) 
 	      {
 		info->memory_error_func (status, memaddr, info);
-		return -1;
+		break;
 	      }
 	    
-	    val = (ibytes[0] << 24) | (ibytes[1] << 16)
-	      | (ibytes[2] << 8) | (ibytes[3]);
+/* start-sanitize-m340 */
+	    if (info->endian == BFD_ENDIAN_LITTLE)
+	      val = (ibytes[3] << 24) | (ibytes[2] << 16)
+		| (ibytes[1] << 8) | (ibytes[0]);
+	    else
+/* end-sanitize-m340 */
+	      val = (ibytes[0] << 24) | (ibytes[1] << 16)
+		| (ibytes[2] << 8) | (ibytes[3]);
 	    
 	    /* Removed [] around literal value to match ABI syntax 12/95.  */
 	    fprintf (stream, "\t%s, 0x%X", grname[(inst >> 8) & 0xF], val);
@@ -216,11 +237,17 @@
 	    if (status != 0) 
 	      {
 		info->memory_error_func (status, memaddr, info);
-		return -1;
+		break;
 	      }
-	    
-	    val = (ibytes[0] << 24) | (ibytes[1] << 16)
-	      | (ibytes[2] << 8) | (ibytes[3]);
+
+/* start-sanitize-m340 */
+	    if (info->endian == BFD_ENDIAN_LITTLE)
+	      val = (ibytes[3] << 24) | (ibytes[2] << 16)
+		| (ibytes[1] << 8) | (ibytes[0]);
+	    else
+/* end-sanitize-m340 */
+	      val = (ibytes[0] << 24) | (ibytes[1] << 16)
+		| (ibytes[2] << 8) | (ibytes[3]);
 	    
 	    /* Removed [] around literal value to match ABI syntax 12/95.  */
 	    fprintf (stream, "\t0x%X", val);
diff --git a/opcodes/mcore-opc.h b/opcodes/mcore-opc.h
index 606ba84..856f78b 100644
--- a/opcodes/mcore-opc.h
+++ b/opcodes/mcore-opc.h
@@ -24,6 +24,9 @@
   OMa,   SI,   I7,   LS,   BR,    BL,    LR,    LJ,
   RM,    RQ,   JSR,  JMP,  OBRa,  OBRb,  OBRc,  OBR2,
   O1R1,  OMb,  OMc,  SIa,
+  /* start-sanitize-m340 */  
+  MULSH,
+  /* end-sanitize-m340 */  
   JC,    JU,   JL,   RSI,  DO21,  OB2
 }
 mcore_opclass;
@@ -48,6 +51,9 @@
   { "stop",	O0,	0,	0x0004 },
   { "wait",	O0,	0,	0x0005 },
   { "doze",	O0,	0,	0x0006 },
+  /* start-sanitize-m340 */
+  { "idly4",    O0,     0,      0x0007 },
+  /* end-sanitize-m340 */
   { "trap",	OT,	0,	0x0008 },
 /* SPACE:                       0x000C - 0x000F */
 /* SPACE:                       0x0010 - 0x001F */
@@ -146,6 +152,10 @@
   { "movi",	I7,	0,	0x6000 },
 #define MCORE_INST_BMASKI_ALT	0x6000
 #define MCORE_INST_BGENI_ALT	0x6000
+/* start-sanitize-m340 */
+  { "mulsh",    MULSH,  0,      0x6800 },
+  { "muls.h",   MULSH,  0,      0x6800 },
+/* end-sanitize-m340 */
 /* SPACE:                       0x6900 - 0x6FFF */
   { "jmpi",	LJ,	1,	0x7000 },
   { "jsri",	LJ,	0,	0x7F00 },
diff --git a/opcodes/po/POTFILES.in b/opcodes/po/POTFILES.in
index f072cca..743a65e 100644
--- a/opcodes/po/POTFILES.in
+++ b/opcodes/po/POTFILES.in
@@ -48,7 +48,6 @@
 mips-opc.c
 mips16-opc.c
 ns32k-dis.c
-opintl.h
 ppc-dis.c
 ppc-opc.c
 sh-dis.c
diff --git a/opcodes/po/opcodes.pot b/opcodes/po/opcodes.pot
index f7e3f0f..9601bdd 100644
--- a/opcodes/po/opcodes.pot
+++ b/opcodes/po/opcodes.pot
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-04-18 19:01-0400\n"
+"POT-Creation-Date: 1999-07-11 22:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -22,7 +22,33 @@
 msgid "jump hint unaligned"
 msgstr ""
 
-#: arm-dis.c:388
+#: arc-dis.c:231
+msgid "*unknown*"
+msgstr ""
+
+#: arc-opc.c:629
+msgid "unable to fit different valued constants into instruction"
+msgstr ""
+
+#: arc-opc.c:639
+msgid "auxiliary register not allowed here"
+msgstr ""
+
+#: arc-opc.c:652
+#, c-format
+msgid "invalid register number `%d'"
+msgstr ""
+
+#: arc-opc.c:775
+#, c-format
+msgid "value won't fit in range %ld - %ld"
+msgstr ""
+
+#: arc-opc.c:871
+msgid "branch address not on 4 byte boundary"
+msgstr ""
+
+#: arm-dis.c:407
 msgid "<illegal precision>"
 msgstr ""
 
@@ -56,38 +82,38 @@
 msgid "Address 0x%x is out of bounds.\n"
 msgstr ""
 
-#: fr30-asm.c:303 m32r-asm.c:319
+#: fr30-asm.c:303 m32r-asm.c:299
 #, c-format
 msgid "Unrecognized field %d while parsing.\n"
 msgstr ""
 
 #. We couldn't parse it.
-#: fr30-asm.c:367 fr30-asm.c:436 m32r-asm.c:383 m32r-asm.c:452
+#: fr30-asm.c:367 fr30-asm.c:436 m32r-asm.c:363 m32r-asm.c:432
 msgid "unrecognized instruction"
 msgstr ""
 
 #. Syntax char didn't match.  Can't be this insn.
 #. FIXME: would like to return something like
 #. "expected char `c'"
-#: fr30-asm.c:404 m32r-asm.c:420
+#: fr30-asm.c:404 m32r-asm.c:400
 msgid "syntax error"
 msgstr ""
 
-#: fr30-asm.c:430 m32r-asm.c:446
+#: fr30-asm.c:430 m32r-asm.c:426
 msgid "junk at end of line"
 msgstr ""
 
-#: fr30-asm.c:523 m32r-asm.c:539
+#: fr30-asm.c:523 m32r-asm.c:519
 #, c-format
 msgid "bad instruction `%.50s...'"
 msgstr ""
 
-#: fr30-asm.c:526 m32r-asm.c:542
+#: fr30-asm.c:526 m32r-asm.c:522
 #, c-format
 msgid "bad instruction `%.50s'"
 msgstr ""
 
-#: fr30-dis.c:300 m32r-dis.c:247
+#: fr30-dis.c:300 m32r-dis.c:227
 #, c-format
 msgid "Unrecognized field %d while printing insn.\n"
 msgstr ""
@@ -97,32 +123,32 @@
 msgid "operand out of range (%lu not between 0 and %lu)"
 msgstr ""
 
-#: fr30-ibld.c:749 m32r-ibld.c:683
+#: fr30-ibld.c:749 m32r-ibld.c:659
 #, c-format
 msgid "Unrecognized field %d while building insn.\n"
 msgstr ""
 
-#: fr30-ibld.c:952 m32r-ibld.c:819
+#: fr30-ibld.c:952 m32r-ibld.c:770
 #, c-format
 msgid "Unrecognized field %d while decoding insn.\n"
 msgstr ""
 
-#: fr30-ibld.c:1096 m32r-ibld.c:932
+#: fr30-ibld.c:1096 m32r-ibld.c:863
 #, c-format
 msgid "Unrecognized field %d while getting int operand.\n"
 msgstr ""
 
-#: fr30-ibld.c:1225 m32r-ibld.c:1030
+#: fr30-ibld.c:1225 m32r-ibld.c:941
 #, c-format
 msgid "Unrecognized field %d while getting vma operand.\n"
 msgstr ""
 
-#: fr30-ibld.c:1358 m32r-ibld.c:1132
+#: fr30-ibld.c:1358 m32r-ibld.c:1023
 #, c-format
 msgid "Unrecognized field %d while setting int operand.\n"
 msgstr ""
 
-#: fr30-ibld.c:1484 m32r-ibld.c:1227
+#: fr30-ibld.c:1484 m32r-ibld.c:1098
 #, c-format
 msgid "Unrecognized field %d while setting vma operand.\n"
 msgstr ""
@@ -158,7 +184,7 @@
 msgid "unknown\t0x%04lx"
 msgstr ""
 
-#: m10300-dis.c:706
+#: m10300-dis.c:546
 #, c-format
 msgid "unknown\t0x%04x"
 msgstr ""
@@ -168,7 +194,7 @@
 msgid "<internal error in opcode table: %s %s>\n"
 msgstr ""
 
-#: m68k-dis.c:967
+#: m68k-dis.c:988
 #, c-format
 msgid "<function code %d>"
 msgstr ""
@@ -178,7 +204,7 @@
 msgid "# <dis error: %08x>"
 msgstr ""
 
-#: mips-dis.c:373
+#: mips-dis.c:237
 #, c-format
 msgid "# internal error, undefined modifier(%c)"
 msgstr ""
@@ -222,21 +248,80 @@
 msgstr ""
 
 #. Mark as non-valid instruction
-#: sparc-dis.c:739
+#: sparc-dis.c:744
 msgid "unknown"
 msgstr ""
 
-#: sparc-dis.c:811
+#: sparc-dis.c:816
 #, c-format
 msgid "Internal error:  bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n"
 msgstr ""
 
-#: sparc-dis.c:822
+#: sparc-dis.c:827
 #, c-format
 msgid "Internal error: bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n"
 msgstr ""
 
-#: sparc-dis.c:871
+#: sparc-dis.c:876
 #, c-format
 msgid "Internal error: bad sparc-opcode.h: \"%s\" == \"%s\"\n"
 msgstr ""
+
+#: v850-dis.c:221
+#, c-format
+msgid "unknown operand shift: %x\n"
+msgstr ""
+
+#: v850-dis.c:233
+#, c-format
+msgid "unknown pop reg: %d\n"
+msgstr ""
+
+#. The functions used to insert and extract complicated operands.
+#. Note: There is a conspiracy between these functions and
+#. v850_insert_operand() in gas/config/tc-v850.c.  Error messages
+#. containing the string 'out of range' will be ignored unless a
+#. specific command line option is given to GAS.
+#: v850-opc.c:46
+msgid "displacement value is not in range and is not aligned"
+msgstr ""
+
+#: v850-opc.c:47
+msgid "displacement value is out of range"
+msgstr ""
+
+#: v850-opc.c:48
+msgid "displacement value is not aligned"
+msgstr ""
+
+#: v850-opc.c:50
+msgid "immediate value is out of range"
+msgstr ""
+
+#: v850-opc.c:61
+msgid "branch value not in range and to odd offset"
+msgstr ""
+
+#: v850-opc.c:63 v850-opc.c:95
+msgid "branch value out of range"
+msgstr ""
+
+#: v850-opc.c:66 v850-opc.c:98
+msgid "branch to odd offset"
+msgstr ""
+
+#: v850-opc.c:93
+msgid "branch value not in range and to an odd offset"
+msgstr ""
+
+#: v850-opc.c:321
+msgid "invalid register for stack adjustment"
+msgstr ""
+
+#: v850-opc.c:343
+msgid "immediate value not in range and not even"
+msgstr ""
+
+#: v850-opc.c:348
+msgid "immediate value must be even"
+msgstr ""
diff --git a/opcodes/sparc-dis.c b/opcodes/sparc-dis.c
index 0975b28..9fbdb60 100644
--- a/opcodes/sparc-dis.c
+++ b/opcodes/sparc-dis.c
@@ -283,6 +283,7 @@
 	  /* Nonzero means that we have found an instruction which has
 	     the effect of adding or or'ing the imm13 field to rs1.  */
 	  int imm_added_to_rs1 = 0;
+	  int imm_ored_to_rs1 = 0;
 
 	  /* Nonzero means that we have found a plus sign in the args
 	     field of the opcode table.  */
@@ -293,8 +294,9 @@
 
 	  /* Do we have an `add' or `or' instruction combining an
              immediate with rs1?  */
-	  if (opcode->match == 0x80102000 || opcode->match == 0x80002000)
-	  /*			  (or)				 (add)  */
+	  if (opcode->match == 0x80102000) /* or */
+	    imm_ored_to_rs1 = 1;
+	  if (opcode->match == 0x80002000) /* add */
 	    imm_added_to_rs1 = 1;
 
 	  if (X_RS1 (insn) != X_RD (insn)
@@ -670,7 +672,7 @@
 	     If so, attempt to print the result of the add or
 	     or (in this context add and or do the same thing)
 	     and its symbolic value.  */
-	  if (imm_added_to_rs1)
+	  if (imm_ored_to_rs1 || imm_added_to_rs1)
 	    {
 	      unsigned long prev_insn;
 	      int errcode;
@@ -709,8 +711,11 @@
 		    {
 		      (*info->fprintf_func) (stream, "\t! ");
 		      info->target = 
-			(0xFFFFFFFF & (int) X_IMM22 (prev_insn) << 10)
-			| X_SIMM (insn, 13);
+			(0xFFFFFFFF & (int) X_IMM22 (prev_insn) << 10);
+		      if (imm_added_to_rs1)
+			info->target += X_SIMM (insn, 13);
+		      else
+			info->target |= X_SIMM (insn, 13);
 		      (*info->print_address_func) (info->target, info);
 		      info->insn_type = dis_dref;
 		      info->data_size = 4;  /* FIXME!!! */
diff --git a/opcodes/sparc-opc.c b/opcodes/sparc-opc.c
index b50b39b..7ad9d18 100644
--- a/opcodes/sparc-opc.c
+++ b/opcodes/sparc-opc.c
@@ -1,5 +1,5 @@
 /* Table of opcodes for the sparc.
-   Copyright (C) 1989, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1989, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
 This file is part of the BFD library.
@@ -378,7 +378,7 @@
 { "lduwa",	F3(3, 0x10, 1), F3(~3, ~0x10, ~1)|RS1_G0,	"[i]o,d", F_ALIAS, v9 },
 { "lduwa",	F3(3, 0x10, 1), F3(~3, ~0x10, ~1)|SIMM13(~0),	"[1]o,d", F_ALIAS, v9 }, /* ld [rs1+0],d */
 
-{ "ldxa",	F3(3, 0x1b, 0), F3(~3, ~0x1b, ~0),		"[1+2]A,d", 0, v9 }, /* lduwa === lda */
+{ "ldxa",	F3(3, 0x1b, 0), F3(~3, ~0x1b, ~0),		"[1+2]A,d", 0, v9 },
 { "ldxa",	F3(3, 0x1b, 0), F3(~3, ~0x1b, ~0)|RS2_G0,	"[1]A,d", 0, v9 }, /* lda [rs1+%g0],d */
 { "ldxa",	F3(3, 0x1b, 1), F3(~3, ~0x1b, ~1),		"[1+i]o,d", 0, v9 },
 { "ldxa",	F3(3, 0x1b, 1), F3(~3, ~0x1b, ~1),		"[i+1]o,d", 0, v9 },
@@ -424,6 +424,25 @@
 { "stw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1),		"d,[i+1]", F_ALIAS, v9 },
 { "stw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0,	"d,[i]", F_ALIAS, v9 },
 { "stw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0),	"d,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */
+{ "stsw",	F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0),	"d,[1+2]", F_ALIAS, v9 },
+{ "stsw",	F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0),	"d,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */
+{ "stsw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1),		"d,[1+i]", F_ALIAS, v9 },
+{ "stsw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1),		"d,[i+1]", F_ALIAS, v9 },
+{ "stsw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0,	"d,[i]", F_ALIAS, v9 },
+{ "stsw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0),	"d,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */
+{ "stuw",	F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0),	"d,[1+2]", F_ALIAS, v9 },
+{ "stuw",	F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0),	"d,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */
+{ "stuw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1),		"d,[1+i]", F_ALIAS, v9 },
+{ "stuw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1),		"d,[i+1]", F_ALIAS, v9 },
+{ "stuw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0,	"d,[i]", F_ALIAS, v9 },
+{ "stuw",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0),	"d,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */
+
+{ "spill",	F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0),	"d,[1+2]", F_ALIAS, v6 },
+{ "spill",	F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0),	"d,[1]", F_ALIAS, v6 }, /* st d,[rs1+%g0] */
+{ "spill",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1),		"d,[1+i]", F_ALIAS, v6 },
+{ "spill",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1),		"d,[i+1]", F_ALIAS, v6 },
+{ "spill",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0,	"d,[i]", F_ALIAS, v6 },
+{ "spill",	F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0),	"d,[1]", F_ALIAS, v6 }, /* st d,[rs1+0] */
 
 { "sta",	F3(3, 0x14, 0), F3(~3, ~0x14, ~0),		"d,[1+2]A", 0, v6 },
 { "sta",	F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0),	"d,[1]A", 0, v6 }, /* sta d,[rs1+%g0] */
@@ -445,6 +464,18 @@
 { "stwa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1),		"d,[i+1]o", F_ALIAS, v9 },
 { "stwa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|RS1_G0,	"d,[i]o", F_ALIAS, v9 },
 { "stwa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|SIMM13(~0),	"d,[1]o", F_ALIAS, v9 }, /* st d,[rs1+0] */
+{ "stswa",	F3(3, 0x14, 0), F3(~3, ~0x14, ~0),		"d,[1+2]A", F_ALIAS, v9 },
+{ "stswa",	F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0),	"d,[1]A", F_ALIAS, v9 }, /* sta d,[rs1+%g0] */
+{ "stswa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1),		"d,[1+i]o", F_ALIAS, v9 },
+{ "stswa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1),		"d,[i+1]o", F_ALIAS, v9 },
+{ "stswa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|RS1_G0,	"d,[i]o", F_ALIAS, v9 },
+{ "stswa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|SIMM13(~0),	"d,[1]o", F_ALIAS, v9 }, /* st d,[rs1+0] */
+{ "stuwa",	F3(3, 0x14, 0), F3(~3, ~0x14, ~0),		"d,[1+2]A", F_ALIAS, v9 },
+{ "stuwa",	F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0),	"d,[1]A", F_ALIAS, v9 }, /* sta d,[rs1+%g0] */
+{ "stuwa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1),		"d,[1+i]o", F_ALIAS, v9 },
+{ "stuwa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1),		"d,[i+1]o", F_ALIAS, v9 },
+{ "stuwa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|RS1_G0,	"d,[i]o", F_ALIAS, v9 },
+{ "stuwa",	F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|SIMM13(~0),	"d,[1]o", F_ALIAS, v9 }, /* st d,[rs1+0] */
 
 { "stb",	F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI(~0),	"d,[1+2]", 0, v6 },
 { "stb",	F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI_RS2(~0),	"d,[1]", 0, v6 }, /* stb d,[rs1+%g0] */
@@ -453,6 +484,19 @@
 { "stb",	F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RS1_G0,	"d,[i]", 0, v6 },
 { "stb",	F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|SIMM13(~0),	"d,[1]", 0, v6 }, /* stb d,[rs1+0] */
 
+{ "stsb",	F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI(~0),	"d,[1+2]", F_ALIAS, v6 },
+{ "stsb",	F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI_RS2(~0),	"d,[1]", F_ALIAS, v6 }, /* stb d,[rs1+%g0] */
+{ "stsb",	F3(3, 0x05, 1), F3(~3, ~0x05, ~1),		"d,[1+i]", F_ALIAS, v6 },
+{ "stsb",	F3(3, 0x05, 1), F3(~3, ~0x05, ~1),		"d,[i+1]", F_ALIAS, v6 },
+{ "stsb",	F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RS1_G0,	"d,[i]", F_ALIAS, v6 },
+{ "stsb",	F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|SIMM13(~0),	"d,[1]", F_ALIAS, v6 }, /* stb d,[rs1+0] */
+{ "stub",	F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI(~0),	"d,[1+2]", F_ALIAS, v6 },
+{ "stub",	F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI_RS2(~0),	"d,[1]", F_ALIAS, v6 }, /* stb d,[rs1+%g0] */
+{ "stub",	F3(3, 0x05, 1), F3(~3, ~0x05, ~1),		"d,[1+i]", F_ALIAS, v6 },
+{ "stub",	F3(3, 0x05, 1), F3(~3, ~0x05, ~1),		"d,[i+1]", F_ALIAS, v6 },
+{ "stub",	F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RS1_G0,	"d,[i]", F_ALIAS, v6 },
+{ "stub",	F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|SIMM13(~0),	"d,[1]", F_ALIAS, v6 }, /* stb d,[rs1+0] */
+
 { "stba",	F3(3, 0x15, 0), F3(~3, ~0x15, ~0),		"d,[1+2]A", 0, v6 },
 { "stba",	F3(3, 0x15, 0), F3(~3, ~0x15, ~0)|RS2(~0),	"d,[1]A", 0, v6 }, /* stba d,[rs1+%g0] */
 { "stba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1),		"d,[1+i]o", 0, v9 },
@@ -460,6 +504,19 @@
 { "stba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|RS1_G0,	"d,[i]o", 0, v9 },
 { "stba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|SIMM13(~0),	"d,[1]o", 0, v9 }, /* stb d,[rs1+0] */
 
+{ "stsba",	F3(3, 0x15, 0), F3(~3, ~0x15, ~0),		"d,[1+2]A", F_ALIAS, v6 },
+{ "stsba",	F3(3, 0x15, 0), F3(~3, ~0x15, ~0)|RS2(~0),	"d,[1]A", F_ALIAS, v6 }, /* stba d,[rs1+%g0] */
+{ "stsba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1),		"d,[1+i]o", F_ALIAS, v9 },
+{ "stsba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1),		"d,[i+1]o", F_ALIAS, v9 },
+{ "stsba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|RS1_G0,	"d,[i]o", F_ALIAS, v9 },
+{ "stsba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|SIMM13(~0),	"d,[1]o", F_ALIAS, v9 }, /* stb d,[rs1+0] */
+{ "stuba",	F3(3, 0x15, 0), F3(~3, ~0x15, ~0),		"d,[1+2]A", F_ALIAS, v6 },
+{ "stuba",	F3(3, 0x15, 0), F3(~3, ~0x15, ~0)|RS2(~0),	"d,[1]A", F_ALIAS, v6 }, /* stba d,[rs1+%g0] */
+{ "stuba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1),		"d,[1+i]o", F_ALIAS, v9 },
+{ "stuba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1),		"d,[i+1]o", F_ALIAS, v9 },
+{ "stuba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|RS1_G0,	"d,[i]o", F_ALIAS, v9 },
+{ "stuba",	F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|SIMM13(~0),	"d,[1]o", F_ALIAS, v9 }, /* stb d,[rs1+0] */
+
 { "std",	F3(3, 0x07, 0), F3(~3, ~0x07, ~0)|ASI(~0),	"d,[1+2]", 0, v6 },
 { "std",	F3(3, 0x07, 0), F3(~3, ~0x07, ~0)|ASI_RS2(~0),	"d,[1]", 0, v6 }, /* std d,[rs1+%g0] */
 { "std",	F3(3, 0x07, 1), F3(~3, ~0x07, ~1),		"d,[1+i]", 0, v6 },
@@ -493,6 +550,13 @@
 { "std",	F3(3, 0x37, 1), F3(~3, ~0x37, ~1)|RS1_G0,	"D,[i]", 0, v6notv9 },
 { "std",	F3(3, 0x37, 1), F3(~3, ~0x37, ~1)|SIMM13(~0),	"D,[1]", 0, v6notv9 }, /* std d,[rs1+0] */
 
+{ "spilld",	F3(3, 0x07, 0), F3(~3, ~0x07, ~0)|ASI(~0),	"d,[1+2]", F_ALIAS, v6 },
+{ "spilld",	F3(3, 0x07, 0), F3(~3, ~0x07, ~0)|ASI_RS2(~0),	"d,[1]", F_ALIAS, v6 }, /* std d,[rs1+%g0] */
+{ "spilld",	F3(3, 0x07, 1), F3(~3, ~0x07, ~1),		"d,[1+i]", F_ALIAS, v6 },
+{ "spilld",	F3(3, 0x07, 1), F3(~3, ~0x07, ~1),		"d,[i+1]", F_ALIAS, v6 },
+{ "spilld",	F3(3, 0x07, 1), F3(~3, ~0x07, ~1)|RS1_G0,	"d,[i]", F_ALIAS, v6 },
+{ "spilld",	F3(3, 0x07, 1), F3(~3, ~0x07, ~1)|SIMM13(~0),	"d,[1]", F_ALIAS, v6 }, /* std d,[rs1+0] */
+
 { "stda",	F3(3, 0x17, 0), F3(~3, ~0x17, ~0),		"d,[1+2]A", 0, v6 },
 { "stda",	F3(3, 0x17, 0), F3(~3, ~0x17, ~0)|RS2(~0),	"d,[1]A", 0, v6 }, /* stda d,[rs1+%g0] */
 { "stda",	F3(3, 0x17, 1), F3(~3, ~0x17, ~1),		"d,[1+i]o", 0, v9 },
@@ -513,6 +577,19 @@
 { "sth",	F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RS1_G0,	"d,[i]", 0, v6 },
 { "sth",	F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|SIMM13(~0),	"d,[1]", 0, v6 }, /* sth d,[rs1+0] */
 
+{ "stsh",	F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI(~0),	"d,[1+2]", F_ALIAS, v6 },
+{ "stsh",	F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI_RS2(~0),	"d,[1]", F_ALIAS, v6 }, /* sth d,[rs1+%g0] */
+{ "stsh",	F3(3, 0x06, 1), F3(~3, ~0x06, ~1),		"d,[1+i]", F_ALIAS, v6 },
+{ "stsh",	F3(3, 0x06, 1), F3(~3, ~0x06, ~1),		"d,[i+1]", F_ALIAS, v6 },
+{ "stsh",	F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RS1_G0,	"d,[i]", F_ALIAS, v6 },
+{ "stsh",	F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|SIMM13(~0),	"d,[1]", F_ALIAS, v6 }, /* sth d,[rs1+0] */
+{ "stuh",	F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI(~0),	"d,[1+2]", F_ALIAS, v6 },
+{ "stuh",	F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI_RS2(~0),	"d,[1]", F_ALIAS, v6 }, /* sth d,[rs1+%g0] */
+{ "stuh",	F3(3, 0x06, 1), F3(~3, ~0x06, ~1),		"d,[1+i]", F_ALIAS, v6 },
+{ "stuh",	F3(3, 0x06, 1), F3(~3, ~0x06, ~1),		"d,[i+1]", F_ALIAS, v6 },
+{ "stuh",	F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RS1_G0,	"d,[i]", F_ALIAS, v6 },
+{ "stuh",	F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|SIMM13(~0),	"d,[1]", F_ALIAS, v6 }, /* sth d,[rs1+0] */
+
 { "stha",	F3(3, 0x16, 0), F3(~3, ~0x16, ~0),		"d,[1+2]A", 0, v6 },
 { "stha",	F3(3, 0x16, 0), F3(~3, ~0x16, ~0)|RS2(~0),	"d,[1]A", 0, v6 }, /* stha ,[rs1+%g0] */
 { "stha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1),		"d,[1+i]o", 0, v9 },
@@ -520,6 +597,19 @@
 { "stha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|RS1_G0,	"d,[i]o", 0, v9 },
 { "stha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|SIMM13(~0),	"d,[1]o", 0, v9 }, /* sth d,[rs1+0] */
 
+{ "stsha",	F3(3, 0x16, 0), F3(~3, ~0x16, ~0),		"d,[1+2]A", F_ALIAS, v6 },
+{ "stsha",	F3(3, 0x16, 0), F3(~3, ~0x16, ~0)|RS2(~0),	"d,[1]A", F_ALIAS, v6 }, /* stha ,[rs1+%g0] */
+{ "stsha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1),		"d,[1+i]o", F_ALIAS, v9 },
+{ "stsha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1),		"d,[i+1]o", F_ALIAS, v9 },
+{ "stsha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|RS1_G0,	"d,[i]o", F_ALIAS, v9 },
+{ "stsha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|SIMM13(~0),	"d,[1]o", F_ALIAS, v9 }, /* sth d,[rs1+0] */
+{ "stuha",	F3(3, 0x16, 0), F3(~3, ~0x16, ~0),		"d,[1+2]A", F_ALIAS, v6 },
+{ "stuha",	F3(3, 0x16, 0), F3(~3, ~0x16, ~0)|RS2(~0),	"d,[1]A", F_ALIAS, v6 }, /* stha ,[rs1+%g0] */
+{ "stuha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1),		"d,[1+i]o", F_ALIAS, v9 },
+{ "stuha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1),		"d,[i+1]o", F_ALIAS, v9 },
+{ "stuha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|RS1_G0,	"d,[i]o", F_ALIAS, v9 },
+{ "stuha",	F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|SIMM13(~0),	"d,[1]o", F_ALIAS, v9 }, /* sth d,[rs1+0] */
+
 { "stx",	F3(3, 0x0e, 0), F3(~3, ~0x0e, ~0)|ASI(~0),	"d,[1+2]", 0, v9 },
 { "stx",	F3(3, 0x0e, 0), F3(~3, ~0x0e, ~0)|ASI_RS2(~0),	"d,[1]", 0, v9 }, /* stx d,[rs1+%g0] */
 { "stx",	F3(3, 0x0e, 1), F3(~3, ~0x0e, ~1),		"d,[1+i]", 0, v9 },
@@ -1374,9 +1464,9 @@
 
 { "nop",	F2(0, 4), 0xfeffffff, "", 0, v6 }, /* sethi 0, %g0 */
 
-{ "set",	F2(0x0, 0x4), F2(~0x0, ~0x4), "Sh,d", F_ALIAS, v6 },
-{ "setuw",	F2(0x0, 0x4), F2(~0x0, ~0x4), "Sh,d", F_ALIAS, v9 },
-{ "setsw",	F2(0x0, 0x4), F2(~0x0, ~0x4), "Sh,d", F_ALIAS, v9 },
+{ "set",	F2(0x0, 0x4), F2(~0x0, ~0x4), "S0,d", F_ALIAS, v6 },
+{ "setuw",	F2(0x0, 0x4), F2(~0x0, ~0x4), "S0,d", F_ALIAS, v9 },
+{ "setsw",	F2(0x0, 0x4), F2(~0x0, ~0x4), "S0,d", F_ALIAS, v9 },
 { "setx",	F2(0x0, 0x4), F2(~0x0, ~0x4), "S0,1,d", F_ALIAS, v9 },
 
 { "sethi",	F2(0x0, 0x4), F2(~0x0, ~0x4), "h,d", 0, v6 },
@@ -1444,33 +1534,42 @@
 
 { "fdivd",	F3F(2, 0x34, 0x04e), F3F(~2, ~0x34, ~0x04e), "v,B,H", F_FLOAT, v6 },
 { "fdivq",	F3F(2, 0x34, 0x04f), F3F(~2, ~0x34, ~0x04f), "V,R,J", F_FLOAT, v8 },
+{ "fdivx",	F3F(2, 0x34, 0x04f), F3F(~2, ~0x34, ~0x04f), "V,R,J", F_FLOAT|F_ALIAS, v8 },
 { "fdivs",	F3F(2, 0x34, 0x04d), F3F(~2, ~0x34, ~0x04d), "e,f,g", F_FLOAT, v6 },
 { "fmuld",	F3F(2, 0x34, 0x04a), F3F(~2, ~0x34, ~0x04a), "v,B,H", F_FLOAT, v6 },
 { "fmulq",	F3F(2, 0x34, 0x04b), F3F(~2, ~0x34, ~0x04b), "V,R,J", F_FLOAT, v8 },
+{ "fmulx",	F3F(2, 0x34, 0x04b), F3F(~2, ~0x34, ~0x04b), "V,R,J", F_FLOAT|F_ALIAS, v8 },
 { "fmuls",	F3F(2, 0x34, 0x049), F3F(~2, ~0x34, ~0x049), "e,f,g", F_FLOAT, v6 },
 
 { "fdmulq",	F3F(2, 0x34, 0x06e), F3F(~2, ~0x34, ~0x06e), "v,B,J", F_FLOAT, v8 },
+{ "fdmulx",	F3F(2, 0x34, 0x06e), F3F(~2, ~0x34, ~0x06e), "v,B,J", F_FLOAT|F_ALIAS, v8 },
 { "fsmuld",	F3F(2, 0x34, 0x069), F3F(~2, ~0x34, ~0x069), "e,f,H", F_FLOAT, v8 },
 
 { "fsqrtd",	F3F(2, 0x34, 0x02a), F3F(~2, ~0x34, ~0x02a)|RS1_G0, "B,H", F_FLOAT, v7 },
 { "fsqrtq",	F3F(2, 0x34, 0x02b), F3F(~2, ~0x34, ~0x02b)|RS1_G0, "R,J", F_FLOAT, v8 },
+{ "fsqrtx",	F3F(2, 0x34, 0x02b), F3F(~2, ~0x34, ~0x02b)|RS1_G0, "R,J", F_FLOAT|F_ALIAS, v8 },
 { "fsqrts",	F3F(2, 0x34, 0x029), F3F(~2, ~0x34, ~0x029)|RS1_G0, "f,g", F_FLOAT, v7 },
 
 { "fabsd",	F3F(2, 0x34, 0x00a), F3F(~2, ~0x34, ~0x00a)|RS1_G0, "B,H", F_FLOAT, v9 },
 { "fabsq",	F3F(2, 0x34, 0x00b), F3F(~2, ~0x34, ~0x00b)|RS1_G0, "R,J", F_FLOAT, v9 },
+{ "fabsx",	F3F(2, 0x34, 0x00b), F3F(~2, ~0x34, ~0x00b)|RS1_G0, "R,J", F_FLOAT|F_ALIAS, v9 },
 { "fabss",	F3F(2, 0x34, 0x009), F3F(~2, ~0x34, ~0x009)|RS1_G0, "f,g", F_FLOAT, v6 },
 { "fmovd",	F3F(2, 0x34, 0x002), F3F(~2, ~0x34, ~0x002)|RS1_G0, "B,H", F_FLOAT, v9 },
 { "fmovq",	F3F(2, 0x34, 0x003), F3F(~2, ~0x34, ~0x003)|RS1_G0, "R,J", F_FLOAT, v9 },
+{ "fmovx",	F3F(2, 0x34, 0x003), F3F(~2, ~0x34, ~0x003)|RS1_G0, "R,J", F_FLOAT|F_ALIAS, v9 },
 { "fmovs",	F3F(2, 0x34, 0x001), F3F(~2, ~0x34, ~0x001)|RS1_G0, "f,g", F_FLOAT, v6 },
 { "fnegd",	F3F(2, 0x34, 0x006), F3F(~2, ~0x34, ~0x006)|RS1_G0, "B,H", F_FLOAT, v9 },
 { "fnegq",	F3F(2, 0x34, 0x007), F3F(~2, ~0x34, ~0x007)|RS1_G0, "R,J", F_FLOAT, v9 },
+{ "fnegx",	F3F(2, 0x34, 0x007), F3F(~2, ~0x34, ~0x007)|RS1_G0, "R,J", F_FLOAT|F_ALIAS, v9 },
 { "fnegs",	F3F(2, 0x34, 0x005), F3F(~2, ~0x34, ~0x005)|RS1_G0, "f,g", F_FLOAT, v6 },
 
 { "faddd",	F3F(2, 0x34, 0x042), F3F(~2, ~0x34, ~0x042), "v,B,H", F_FLOAT, v6 },
 { "faddq",	F3F(2, 0x34, 0x043), F3F(~2, ~0x34, ~0x043), "V,R,J", F_FLOAT, v8 },
+{ "faddx",	F3F(2, 0x34, 0x043), F3F(~2, ~0x34, ~0x043), "V,R,J", F_FLOAT|F_ALIAS, v8 },
 { "fadds",	F3F(2, 0x34, 0x041), F3F(~2, ~0x34, ~0x041), "e,f,g", F_FLOAT, v6 },
 { "fsubd",	F3F(2, 0x34, 0x046), F3F(~2, ~0x34, ~0x046), "v,B,H", F_FLOAT, v6 },
 { "fsubq",	F3F(2, 0x34, 0x047), F3F(~2, ~0x34, ~0x047), "V,R,J", F_FLOAT, v8 },
+{ "fsubx",	F3F(2, 0x34, 0x047), F3F(~2, ~0x34, ~0x047), "V,R,J", F_FLOAT|F_ALIAS, v8 },
 { "fsubs",	F3F(2, 0x34, 0x045), F3F(~2, ~0x34, ~0x045), "e,f,g", F_FLOAT, v6 },
 
 #define CMPFCC(x)	(((x)&0x3)<<25)
@@ -1495,6 +1594,16 @@
 { "fcmpeq",	CMPFCC(1)|F3F(2, 0x35, 0x057), CMPFCC(~1)|F3F(~2, ~0x35, ~0x057),	 "7,V,R", F_FLOAT, v9 },
 { "fcmpeq",	CMPFCC(2)|F3F(2, 0x35, 0x057), CMPFCC(~2)|F3F(~2, ~0x35, ~0x057),	 "8,V,R", F_FLOAT, v9 },
 { "fcmpeq",	CMPFCC(3)|F3F(2, 0x35, 0x057), CMPFCC(~3)|F3F(~2, ~0x35, ~0x057),	 "9,V,R", F_FLOAT, v9 },
+{ "fcmpx",	          F3F(2, 0x35, 0x053),            F3F(~2, ~0x35, ~0x053)|RD_G0,	 "V,R", F_FLOAT|F_ALIAS, v8 },
+{ "fcmpx",	CMPFCC(0)|F3F(2, 0x35, 0x053), CMPFCC(~0)|F3F(~2, ~0x35, ~0x053),	 "6,V,R", F_FLOAT|F_ALIAS, v9 },
+{ "fcmpx",	CMPFCC(1)|F3F(2, 0x35, 0x053), CMPFCC(~1)|F3F(~2, ~0x35, ~0x053),	 "7,V,R", F_FLOAT|F_ALIAS, v9 },
+{ "fcmpx",	CMPFCC(2)|F3F(2, 0x35, 0x053), CMPFCC(~2)|F3F(~2, ~0x35, ~0x053),	 "8,V,R", F_FLOAT|F_ALIAS, v9 },
+{ "fcmpx",	CMPFCC(3)|F3F(2, 0x35, 0x053), CMPFCC(~3)|F3F(~2, ~0x35, ~0x053),	 "9,V,R", F_FLOAT|F_ALIAS, v9 },
+{ "fcmpex",	          F3F(2, 0x35, 0x057),            F3F(~2, ~0x35, ~0x057)|RD_G0,	 "V,R", F_FLOAT|F_ALIAS, v8 },
+{ "fcmpex",	CMPFCC(0)|F3F(2, 0x35, 0x057), CMPFCC(~0)|F3F(~2, ~0x35, ~0x057),	 "6,V,R", F_FLOAT|F_ALIAS, v9 },
+{ "fcmpex",	CMPFCC(1)|F3F(2, 0x35, 0x057), CMPFCC(~1)|F3F(~2, ~0x35, ~0x057),	 "7,V,R", F_FLOAT|F_ALIAS, v9 },
+{ "fcmpex",	CMPFCC(2)|F3F(2, 0x35, 0x057), CMPFCC(~2)|F3F(~2, ~0x35, ~0x057),	 "8,V,R", F_FLOAT|F_ALIAS, v9 },
+{ "fcmpex",	CMPFCC(3)|F3F(2, 0x35, 0x057), CMPFCC(~3)|F3F(~2, ~0x35, ~0x057),	 "9,V,R", F_FLOAT|F_ALIAS, v9 },
 { "fcmps",	          F3F(2, 0x35, 0x051),            F3F(~2, ~0x35, ~0x051)|RD_G0, "e,f",   F_FLOAT, v6 },
 { "fcmps",	CMPFCC(0)|F3F(2, 0x35, 0x051), CMPFCC(~0)|F3F(~2, ~0x35, ~0x051),	 "6,e,f", F_FLOAT, v9 },
 { "fcmps",	CMPFCC(1)|F3F(2, 0x35, 0x051), CMPFCC(~1)|F3F(~2, ~0x35, ~0x051),	 "7,e,f", F_FLOAT, v9 },
@@ -1608,10 +1717,11 @@
 { "casxa",	F3(3, 0x3e, 1), F3(~3, ~0x3e, ~1), "[1]o,2,d", 0, v9 },
 
 /* v9 synthetic insns */
-/* FIXME: still missing "signx d", and "clruw d".  Can't be done here.  */
 { "iprefetch",	F2(0, 1)|(2<<20)|BPRED, F2(~0, ~1)|(1<<20)|ANNUL|COND(~0), "G", 0, v9 }, /* bn,a,pt %xcc,label */
 { "signx",	F3(2, 0x27, 0), F3(~2, ~0x27, ~0)|(1<<12)|ASI(~0)|RS2_G0, "1,d", F_ALIAS, v9 }, /* sra rs1,%g0,rd */
+{ "signx",	F3(2, 0x27, 0), F3(~2, ~0x27, ~0)|(1<<12)|ASI(~0)|RS2_G0, "r", F_ALIAS, v9 }, /* sra rd,%g0,rd */
 { "clruw",	F3(2, 0x26, 0), F3(~2, ~0x26, ~0)|(1<<12)|ASI(~0)|RS2_G0, "1,d", F_ALIAS, v9 }, /* srl rs1,%g0,rd */
+{ "clruw",	F3(2, 0x26, 0), F3(~2, ~0x26, ~0)|(1<<12)|ASI(~0)|RS2_G0, "r", F_ALIAS, v9 }, /* srl rd,%g0,rd */
 { "cas",	F3(3, 0x3c, 0)|ASI(0x80), F3(~3, ~0x3c, ~0)|ASI(~0x80), "[1],2,d", F_ALIAS, v9 }, /* casa [rs1]ASI_P,rs2,rd */
 { "casl",	F3(3, 0x3c, 0)|ASI(0x88), F3(~3, ~0x3c, ~0)|ASI(~0x88), "[1],2,d", F_ALIAS, v9 }, /* casa [rs1]ASI_P_L,rs2,rd */
 { "casx",	F3(3, 0x3e, 0)|ASI(0x80), F3(~3, ~0x3e, ~0)|ASI(~0x80), "[1],2,d", F_ALIAS, v9 }, /* casxa [rs1]ASI_P,rs2,rd */
diff --git a/opcodes/tic30-dis.c b/opcodes/tic30-dis.c
index 1051457..5ccf893 100644
--- a/opcodes/tic30-dis.c
+++ b/opcodes/tic30-dis.c
@@ -1,5 +1,5 @@
 /* Disassembly routines for TMS320C30 architecture
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
    This program is free software; you can redistribute it and/or modify
@@ -19,8 +19,7 @@
 
 #include <errno.h>
 #include <math.h>
-#include <stdlib.h>
-#include <string.h>
+#include "sysdep.h"
 #include "dis-asm.h"
 #include "opcode/tic30.h"
 
diff --git a/texinfo/texinfo.tex b/texinfo/texinfo.tex
new file mode 100644
index 0000000..7d3a33c
--- /dev/null
+++ b/texinfo/texinfo.tex
@@ -0,0 +1,5431 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+% $Id$
+%
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
+% Free Software Foundation, Inc.
+%
+% This texinfo.tex file 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, or (at
+% your option) any later version.
+%
+% This texinfo.tex file 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 texinfo.tex file; see the file COPYING.  If not, write
+% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+% Boston, MA 02111-1307, USA.
+%
+% In other words, you are welcome to use, share and improve this program.
+% You are forbidden to forbid anyone else to use, share and improve
+% what you give them.   Help stamp out software-hoarding!
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+%   ftp://ftp.gnu.org/pub/gnu/texinfo.tex
+%   /home/gd/gnu/doc/texinfo.tex on the GNU machines.
+%   (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
+%   ftp://tug.org/tex/texinfo.tex
+%   ftp://ctan.org/macros/texinfo/texinfo.tex
+%   (and all CTAN mirrors, finger ctan@ctan.org for a list).
+% The texinfo.tex in the texinfo distribution itself could well be out
+% of date, so if that's what you're using, please check.
+% 
+% Send bug reports to bug-texinfo@gnu.org.
+% Please include a precise test case in each bug report,
+% including a complete document with which we can reproduce the problem.
+% 
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution.  For simple
+% manuals, however, you can get away with:
+%   tex foo.texi
+%   texindex foo.??
+%   tex foo.texi
+%   tex foo.texi
+%   dvips foo.dvi -o # or whatever, to process the dvi file.
+% The extra runs of TeX get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+
+
+% Make it possible to create a .fmt file just by loading this file:
+% if the underlying format is not loaded, start by loading it now.
+% Added by gildea November 1993.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+
+% This automatically updates the version number based on RCS.
+\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
+\deftexinfoversion$Revision$
+\message{Loading texinfo package [Version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}\message{}
+  \catcode`+=\active \catcode`\_=\active}
+
+% Save some parts of plain tex whose names we will redefine.
+
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexi=\i
+\let\ptexlbrace=\{
+\let\ptexrbrace=\}
+\let\ptexstar=\*
+\let\ptext=\t
+
+% We never want plain's outer \+ definition in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+
+\message{Basics,}
+\chardef\other=12
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined  \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined     \gdef\putwordfile{file}\fi
+\ifx\putwordInfo\undefined     \gdef\putwordInfo{Info}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordon\undefined       \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined     \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined  \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined  \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined      \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined      \gdef\putwordSee{See}\fi
+\ifx\putwordShortContents\undefined  \gdef\putwordShortContents{Short Contents}\fi
+\ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+\hyphenation{ap-pen-dix}
+\hyphenation{mini-buf-fer mini-buf-fers}
+\hyphenation{eshell}
+\hyphenation{white-space}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen \bindingoffset
+\newdimen \normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal.  We don't just call \tracingall here,
+% since that produces some useless output on the terminal.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\ifx\eTeXversion\undefined
+\def\loggingall{\tracingcommands2 \tracingstats2
+   \tracingpages1 \tracingoutput1 \tracinglostchars1
+   \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+   \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\else
+\def\loggingall{\tracingcommands3 \tracingstats2
+   \tracingpages1 \tracingoutput1 \tracinglostchars1
+   \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+   \tracingscantokens1 \tracingassigns1 \tracingifs1
+   \tracinggroups1 \tracingnesting2
+   \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\fi
+
+% For @cropmarks command.
+% Do @cropmarks to get crop marks.
+% 
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong  \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument.  Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+  \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+  %
+  \ifodd\pageno  \advance\hoffset by \bindingoffset
+  \else \advance\hoffset by -\bindingoffset\fi
+  %
+  % Do this outside of the \shipout so @code etc. will be expanded in
+  % the headline as they should be, not taken literally (outputting ''code).
+  \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+  \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+  %
+  {%
+    % Have to do this stuff outside the \shipout because we want it to
+    % take effect in \write's, yet the group defined by the \vbox ends
+    % before the \shipout runs.
+    %
+    \escapechar = `\\     % use backslash in output files.
+    \indexdummies         % don't expand commands in the output.
+    \normalturnoffactive  % \ in index entries must not stay \, e.g., if
+                   % the page break happens to be in the middle of an example.
+    \shipout\vbox{%
+      \ifcropmarks \vbox to \outervsize\bgroup
+        \hsize = \outerhsize
+        \line{\ewtop\hfil\ewtop}%
+        \nointerlineskip
+        \line{%
+          \vbox{\moveleft\cornerthick\nstop}%
+          \hfill
+          \vbox{\moveright\cornerthick\nstop}%
+        }%
+        \vskip\topandbottommargin
+        \line\bgroup
+          \hfil % center the page within the outer (page) hsize.
+          \ifodd\pageno\hskip\bindingoffset\fi
+          \vbox\bgroup
+      \fi
+      %
+      \unvbox\headlinebox
+      \pagebody{#1}%
+      \ifdim\ht\footlinebox > 0pt
+        % Only leave this space if the footline is nonempty.
+        % (We lessened \vsize for it in \oddfootingxxx.)
+        % The \baselineskip=24pt in plain's \makefootline has no effect.
+        \vskip 2\baselineskip
+        \unvbox\footlinebox
+      \fi
+      %
+      \ifcropmarks
+          \egroup % end of \vbox\bgroup
+        \hfil\egroup % end of (centering) \line\bgroup
+        \vskip\topandbottommargin plus1fill minus1fill
+        \boxmaxdepth = \cornerthick
+        \line{%
+          \vbox{\moveleft\cornerthick\nsbot}%
+          \hfill
+          \vbox{\moveright\cornerthick\nsbot}%
+        }%
+        \nointerlineskip
+        \line{\ewbot\hfil\ewbot}%
+      \egroup % \vbox from first cropmarks clause
+      \fi
+    }% end of \shipout\vbox
+  }% end of group with \turnoffactive
+  \advancepageno
+  \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+  \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1 \unvbox#1
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks.  Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+  {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+  {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1.  The argument is the rest of
+% the input line (except we remove a trailing comment).  #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg#1{%
+  \let\next = #1%
+  \begingroup
+    \obeylines
+    \futurelet\temp\parseargx
+}
+
+% If the next token is an obeyed space (from an @example environment or
+% the like), remove it and recurse.  Otherwise, we're done.
+\def\parseargx{%
+  % \obeyedspace is defined far below, after the definition of \sepspaces.
+  \ifx\obeyedspace\temp
+    \expandafter\parseargdiscardspace
+  \else
+    \expandafter\parseargline
+  \fi
+}
+
+% Remove a single space (as the delimiter token to the macro call).
+{\obeyspaces %
+ \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
+
+{\obeylines %
+  \gdef\parseargline#1^^M{%
+    \endgroup % End of the group started in \parsearg.
+    %
+    % First remove any @c comment, then any @comment.
+    % Result of each macro is put in \toks0.
+    \argremovec #1\c\relax %
+    \expandafter\argremovecomment \the\toks0 \comment\relax %
+    %
+    % Call the caller's macro, saved as \next in \parsearg.
+    \expandafter\next\expandafter{\the\toks0}%
+  }%
+}
+
+% Since all \c{,omment} does is throw away the argument, we can let TeX
+% do that for us.  The \relax here is matched by the \relax in the call
+% in \parseargline; it could be more or less anything, its purpose is
+% just to delimit the argument to the \c.
+\def\argremovec#1\c#2\relax{\toks0 = {#1}}
+\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
+
+% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
+%    @end itemize  @c foo
+% will have two active spaces as part of the argument with the
+% `itemize'.  Here we remove all active spaces from #1, and assign the
+% result to \toks0.
+%
+% This loses if there are any *other* active characters besides spaces
+% in the argument -- _ ^ +, for example -- since they get expanded.
+% Fortunately, Texinfo does not define any such commands.  (If it ever
+% does, the catcode of the characters in questionwill have to be changed
+% here.)  But this means we cannot call \removeactivespaces as part of
+% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
+% that \parsearg gets might well have any character at all in it.
+%
+\def\removeactivespaces#1{%
+  \begingroup
+    \ignoreactivespaces
+    \edef\temp{#1}%
+    \global\toks0 = \expandafter{\temp}%
+  \endgroup
+}
+
+% Change the active space to expand to nothing.
+%
+\begingroup
+  \obeyspaces
+  \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
+\endgroup
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+%% These are used to keep @begin/@end levels from running away
+%% Call \inENV within environments (after a \begingroup)
+\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
+\def\ENVcheck{%
+\ifENV\errmessage{Still within an environment; press RETURN to continue}
+\endgroup\fi} % This is not perfect, but it should reduce lossage
+
+% @begin foo  is the same as @foo, for now.
+\newhelp\EMsimple{Press RETURN to continue.}
+
+\outer\def\begin{\parsearg\beginxxx}
+
+\def\beginxxx #1{%
+\expandafter\ifx\csname #1\endcsname\relax
+{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
+\csname #1\endcsname\fi}
+
+% @end foo executes the definition of \Efoo.
+%
+\def\end{\parsearg\endxxx}
+\def\endxxx #1{%
+  \removeactivespaces{#1}%
+  \edef\endthing{\the\toks0}%
+  %
+  \expandafter\ifx\csname E\endthing\endcsname\relax
+    \expandafter\ifx\csname \endthing\endcsname\relax
+      % There's no \foo, i.e., no ``environment'' foo.
+      \errhelp = \EMsimple
+      \errmessage{Undefined command `@end \endthing'}%
+    \else
+      \unmatchedenderror\endthing
+    \fi
+  \else
+    % Everything's ok; the right environment has been started.
+    \csname E\endthing\endcsname
+  \fi
+}
+
+% There is an environment #1, but it hasn't been started.  Give an error.
+%
+\def\unmatchedenderror#1{%
+  \errhelp = \EMsimple
+  \errmessage{This `@end #1' doesn't have a matching `@#1'}%
+}
+
+% Define the control sequence \E#1 to give an unmatched @end error.
+%
+\def\defineunmatchedend#1{%
+  \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
+}
+
+
+% Single-spacing is done by various environments (specifically, in
+% \nonfillstart and \quotations).
+\newskip\singlespaceskip \singlespaceskip = 12.5pt
+\def\singlespace{%
+  % Why was this kern here?  It messes up equalizing space above and below
+  % environments.  --karl, 6may93
+  %{\advance \baselineskip by -\singlespaceskip
+  %\kern \baselineskip}%
+  \setleading \singlespaceskip
+}
+
+%% Simple single-character @ commands
+
+% @@ prints an @
+% Kludge this until the fonts are right (grr).
+\def\@{{\tt\char64}}
+
+% This is turned off because it was never documented
+% and you can use @w{...} around a quote to suppress ligatures.
+%% Define @` and @' to be the same as ` and '
+%% but suppressing ligatures.
+%\def\`{{`}}
+%\def\'{{'}}
+
+% Used to generate quoted braces.
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
+\let\{=\mylbrace
+\let\}=\myrbrace
+\begingroup
+  % Definitions to produce actual \{ & \} command in an index.
+  \catcode`\{ = 12 \catcode`\} = 12
+  \catcode`\[ = 1 \catcode`\] = 2
+  \catcode`\@ = 0 \catcode`\\ = 12
+  @gdef@lbracecmd[\{]%
+  @gdef@rbracecmd[\}]%
+@endgroup
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
+\let\, = \c
+\let\dotaccent = \.
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \t
+\let\ubaraccent = \b
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown
+% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+  \def\temp{#1}%
+  \ifx\temp\imacro \ptexi
+  \else\ifx\temp\jmacro \j
+  \else \errmessage{@dotless can be used only with i or j}%
+  \fi\fi
+}
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\hfil\break\hbox{}\ignorespaces}
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=3000 }
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=3000 }
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=3000 }
+
+% @w prevents a word break.  Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line.  According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0).  If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+\def\group{\begingroup
+  \ifnum\catcode13=\active \else
+    \errhelp = \groupinvalidhelp
+    \errmessage{@group invalid in context where filling is enabled}%
+  \fi
+  %
+  % The \vtop we start below produces a box with normal height and large
+  % depth; thus, TeX puts \baselineskip glue before it, and (when the
+  % next line of text is done) \lineskip glue after it.  (See p.82 of
+  % the TeXbook.)  Thus, space below is not quite equal to space
+  % above.  But it's pretty close.
+  \def\Egroup{%
+    \egroup           % End the \vtop.
+    \endgroup         % End the \group.
+  }%
+  %
+  \vtop\bgroup
+    % We have to put a strut on the last line in case the @group is in
+    % the midst of an example, rather than completely enclosing it.
+    % Otherwise, the interline space between the last line of the group
+    % and the first line afterwards is too small.  But we can't put the
+    % strut in \Egroup, since there it would be on a line by itself.
+    % Hence this just inserts a strut at the beginning of each line.
+    \everypar = {\strut}%
+    %
+    % Since we have a strut on every line, we don't need any of TeX's
+    % normal interline spacing.
+    \offinterlineskip
+    %
+    % OK, but now we have to do something about blank
+    % lines in the input in @example-like environments, which normally
+    % just turn into \lisppar, which will insert no space now that we've
+    % turned off the interline space.  Simplest is to make them be an
+    % empty paragraph.
+    \ifx\par\lisppar
+      \edef\par{\leavevmode \par}%
+      %
+      % Reset ^^M's definition to new definition of \par.
+      \obeylines
+    \fi
+    %
+    % Do @comment since we are called inside an environment such as
+    % @example, where each end-of-line in the input causes an
+    % end-of-line in the output.  We don't want the end-of-line after
+    % the `@group' to put extra space in the output.  Since @group
+    % should appear on a line by itself (according to the Texinfo
+    % manual), we don't worry about eating any user text.
+    \comment
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil  \mil=0.001in
+
+\def\need{\parsearg\needx}
+
+% Old definition--didn't work.
+%\def\needx #1{\par %
+%% This method tries to make TeX break the page naturally
+%% if the depth of the box does not fit.
+%{\baselineskip=0pt%
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
+%\prevdepth=-1000pt
+%}}
+
+\def\needx#1{%
+  % Go into vertical mode, so we don't make a big box in the middle of a
+  % paragraph.
+  \par
+  %
+  % Don't add any leading before our big empty box, but allow a page
+  % break, since the best break might be right here.
+  \allowbreak
+  \nointerlineskip
+  \vtop to #1\mil{\vfil}%
+  %
+  % TeX does not even consider page breaks if a penalty added to the
+  % main vertical list is 10000 or more.  But in order to see if the
+  % empty box we just added fits on the page, we must make it consider
+  % page breaks.  On the other hand, we don't want to actually break the
+  % page after the empty box.  So we use a penalty of 9999.
+  %
+  % There is an extremely small chance that TeX will actually break the
+  % page at this \penalty, if there are no other feasible breakpoints in
+  % sight.  (If the user is using lots of big @group commands, which
+  % almost-but-not-quite fill up a page, TeX will have a hard time doing
+  % good page breaking, for example.)  However, I could not construct an
+  % example where a page broke at this \penalty; if it happens in a real
+  % document, then we can reconsider our strategy.
+  \penalty9999
+  %
+  % Back up by the size of the box, whether we did a page break or not.
+  \kern -#1\mil
+  %
+  % Do not allow a page break right after this kern.
+  \nobreak
+}
+
+% @br   forces paragraph break
+
+\let\br = \par
+
+% @dots{} output an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{%
+  \leavevmode
+  \hbox to 1.5em{%
+    \hskip 0pt plus 0.25fil minus 0.25fil
+    .\hss.\hss.%
+    \hskip 0pt plus 0.5fil minus 0.5fil
+  }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+% 
+\def\enddots{%
+  \leavevmode
+  \hbox to 2em{%
+    \hskip 0pt plus 0.25fil minus 0.25fil
+    .\hss.\hss.\hss.%
+    \hskip 0pt plus 0.5fil minus 0.5fil
+  }%
+  \spacefactor=3000
+}
+
+
+% @page    forces the start of a new page
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\def\exdent{\parsearg\exdentyyy}
+\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
+
+% This defn is used inside nofill environments such as @example.
+\def\nofillexdent{\parsearg\nofillexdentyyy}
+\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
+\leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
+
+\def\inmargin#1{%
+\strut\vadjust{\nobreak\kern-\strutdepth
+  \vtop to \strutdepth{\baselineskip\strutdepth\vss
+  \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+
+%\hbox{{\rm#1}}\hfil\break}}
+
+% @include file    insert text of that file as input.
+% Allow normal characters that  we make active in the argument (a file name).
+\def\include{\begingroup
+  \catcode`\\=12
+  \catcode`~=12
+  \catcode`^=12
+  \catcode`_=12
+  \catcode`|=12
+  \catcode`<=12
+  \catcode`>=12
+  \catcode`+=12
+  \parsearg\includezzz}
+% Restore active chars for included file.
+\def\includezzz#1{\endgroup\begingroup
+  % Read the included file in a group so nested @include's work.
+  \def\thisfile{#1}%
+  \input\thisfile
+\endgroup}
+
+\def\thisfile{}
+
+% @center line   outputs that line, centered
+
+\def\center{\parsearg\centerzzz}
+\def\centerzzz #1{{\advance\hsize by -\leftskip
+\advance\hsize by -\rightskip
+\centerline{#1}}}
+
+% @sp n   outputs n lines of vertical space
+
+\def\sp{\parsearg\spxxx}
+\def\spxxx #1{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore  is another way to write a comment
+
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+
+\let\c=\comment
+
+% @paragraphindent  is defined for the Info formatting commands only.
+\let\paragraphindent=\comment
+
+% Prevent errors for section commands.
+% Used in @ignore and in failing conditionals.
+\def\ignoresections{%
+\let\chapter=\relax
+\let\unnumbered=\relax
+\let\top=\relax
+\let\unnumberedsec=\relax
+\let\unnumberedsection=\relax
+\let\unnumberedsubsec=\relax
+\let\unnumberedsubsection=\relax
+\let\unnumberedsubsubsec=\relax
+\let\unnumberedsubsubsection=\relax
+\let\section=\relax
+\let\subsec=\relax
+\let\subsubsec=\relax
+\let\subsection=\relax
+\let\subsubsection=\relax
+\let\appendix=\relax
+\let\appendixsec=\relax
+\let\appendixsection=\relax
+\let\appendixsubsec=\relax
+\let\appendixsubsection=\relax
+\let\appendixsubsubsec=\relax
+\let\appendixsubsubsection=\relax
+\let\contents=\relax
+\let\smallbook=\relax
+\let\titlepage=\relax
+}
+
+% Used in nested conditionals, where we have to parse the Texinfo source
+% and so want to turn off most commands, in case they are used
+% incorrectly.
+%
+\def\ignoremorecommands{%
+  \let\defcodeindex = \relax
+  \let\defcv = \relax
+  \let\deffn = \relax
+  \let\deffnx = \relax
+  \let\defindex = \relax
+  \let\defivar = \relax
+  \let\defmac = \relax
+  \let\defmethod = \relax
+  \let\defop = \relax
+  \let\defopt = \relax
+  \let\defspec = \relax
+  \let\deftp = \relax
+  \let\deftypefn = \relax
+  \let\deftypefun = \relax
+  \let\deftypevar = \relax
+  \let\deftypevr = \relax
+  \let\defun = \relax
+  \let\defvar = \relax
+  \let\defvr = \relax
+  \let\ref = \relax
+  \let\xref = \relax
+  \let\printindex = \relax
+  \let\pxref = \relax
+  \let\settitle = \relax
+  \let\setchapternewpage = \relax
+  \let\setchapterstyle = \relax
+  \let\everyheading = \relax
+  \let\evenheading = \relax
+  \let\oddheading = \relax
+  \let\everyfooting = \relax
+  \let\evenfooting = \relax
+  \let\oddfooting = \relax
+  \let\headings = \relax
+  \let\include = \relax
+  \let\lowersections = \relax
+  \let\down = \relax
+  \let\raisesections = \relax
+  \let\up = \relax
+  \let\set = \relax
+  \let\clear = \relax
+  \let\item = \relax
+}
+
+% Ignore @ignore ... @end ignore.
+%
+\def\ignore{\doignore{ignore}}
+
+% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
+%
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\html{\doignore{html}}
+\def\menu{\doignore{menu}}
+\def\direntry{\doignore{direntry}}
+
+% @dircategory CATEGORY  -- specify a category of the dir file
+% which this file should belong to.  Ignore this in TeX.
+\let\dircategory = \comment
+
+% Ignore text until a line `@end #1'.
+%
+\def\doignore#1{\begingroup
+  % Don't complain about control sequences we have declared \outer.
+  \ignoresections
+  %
+  % Define a command to swallow text until we reach `@end #1'.
+  % This @ is a catcode 12 token (that is the normal catcode of @ in
+  % this texinfo.tex file).  We change the catcode of @ below to match.
+  \long\def\doignoretext##1@end #1{\enddoignore}%
+  %
+  % Make sure that spaces turn into tokens that match what \doignoretext wants.
+  \catcode32 = 10
+  %
+  % Ignore braces, too, so mismatched braces don't cause trouble.
+  \catcode`\{ = 9
+  \catcode`\} = 9
+  %
+  % We must not have @c interpreted as a control sequence.
+  \catcode`\@ = 12
+  %
+  % Make the letter c a comment character so that the rest of the line
+  % will be ignored. This way, the document can have (for example)
+  %   @c @end ifinfo
+  % and the @end ifinfo will be properly ignored.
+  % (We've just changed @ to catcode 12.)
+  \catcode`\c = 14
+  %
+  % And now expand that command.
+  \doignoretext
+}
+
+% What we do to finish off ignored text.
+%
+\def\enddoignore{\endgroup\ignorespaces}%
+
+\newif\ifwarnedobs\warnedobsfalse
+\def\obstexwarn{%
+  \ifwarnedobs\relax\else
+  % We need to warn folks that they may have trouble with TeX 3.0.
+  % This uses \immediate\write16 rather than \message to get newlines.
+    \immediate\write16{}
+    \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
+    \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
+    \immediate\write16{If you are running another version of TeX, relax.}
+    \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
+    \immediate\write16{  Then upgrade your TeX installation if you can.}
+    \immediate\write16{  (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
+    \immediate\write16{If you are stuck with version 3.0, run the}
+    \immediate\write16{  script ``tex3patch'' from the Texinfo distribution}
+    \immediate\write16{  to use a workaround.}
+    \immediate\write16{}
+    \global\warnedobstrue
+    \fi
+}
+
+% **In TeX 3.0, setting text in \nullfont hangs tex.  For a
+% workaround (which requires the file ``dummy.tfm'' to be installed),
+% uncomment the following line:
+%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
+
+% Ignore text, except that we keep track of conditional commands for
+% purposes of nesting, up to an `@end #1' command.
+%
+\def\nestedignore#1{%
+  \obstexwarn
+  % We must actually expand the ignored text to look for the @end
+  % command, so that nested ignore constructs work.  Thus, we put the
+  % text into a \vbox and then do nothing with the result.  To minimize
+  % the change of memory overflow, we follow the approach outlined on
+  % page 401 of the TeXbook: make the current font be a dummy font.
+  %
+  \setbox0 = \vbox\bgroup
+    % Don't complain about control sequences we have declared \outer.
+    \ignoresections
+    %
+    % Define `@end #1' to end the box, which will in turn undefine the
+    % @end command again.
+    \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
+    %
+    % We are going to be parsing Texinfo commands.  Most cause no
+    % trouble when they are used incorrectly, but some commands do
+    % complicated argument parsing or otherwise get confused, so we
+    % undefine them.
+    %
+    % We can't do anything about stray @-signs, unfortunately;
+    % they'll produce `undefined control sequence' errors.
+    \ignoremorecommands
+    %
+    % Set the current font to be \nullfont, a TeX primitive, and define
+    % all the font commands to also use \nullfont.  We don't use
+    % dummy.tfm, as suggested in the TeXbook, because not all sites
+    % might have that installed.  Therefore, math mode will still
+    % produce output, but that should be an extremely small amount of
+    % stuff compared to the main input.
+    %
+    \nullfont
+    \let\tenrm = \nullfont  \let\tenit = \nullfont  \let\tensl = \nullfont
+    \let\tenbf = \nullfont  \let\tentt = \nullfont  \let\smallcaps = \nullfont
+    \let\tensf = \nullfont
+    % Similarly for index fonts (mostly for their use in
+    % smallexample)
+    \let\indrm = \nullfont  \let\indit = \nullfont  \let\indsl = \nullfont
+    \let\indbf = \nullfont  \let\indtt = \nullfont  \let\indsc = \nullfont
+    \let\indsf = \nullfont
+    %
+    % Don't complain when characters are missing from the fonts.
+    \tracinglostchars = 0
+    %
+    % Don't bother to do space factor calculations.
+    \frenchspacing
+    %
+    % Don't report underfull hboxes.
+    \hbadness = 10000
+    %
+    % Do minimal line-breaking.
+    \pretolerance = 10000
+    %
+    % Do not execute instructions in @tex
+    \def\tex{\doignore{tex}}%
+    % Do not execute macro definitions.
+    % `c' is a comment character, so the word `macro' will get cut off.
+    \def\macro{\doignore{ma}}%
+}
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it.  Make sure the catcode of space is correct to avoid
+% losing inside @example, for instance.
+%
+\def\set{\begingroup\catcode` =10
+  \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
+  \parsearg\setxxx}
+\def\setxxx#1{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+  \def\temp{#2}%
+  \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
+  \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
+  \fi
+  \endgroup
+}
+% Can't use \xdef to pre-expand #2 and save some time, since \temp or
+% \next or other control sequences that we've defined might get us into
+% an infinite loop. Consider `@set foo @cite{bar}'.
+\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\def\clear{\parsearg\clearxxx}
+\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
+
+% @value{foo} gets the text saved in variable foo.
+%
+{
+  \catcode`\_ = \active
+  %
+  % We might end up with active _ or - characters in the argument if
+  % we're called from @code, as @code{@value{foo-bar_}}.  So \let any
+  % such active characters to their normal equivalents.
+  \gdef\value{\begingroup
+    \catcode`\-=12 \catcode`\_=12
+    \indexbreaks \let_\normalunderscore
+    \valuexxx}
+}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we \let\value to this in \indexdummies).  Ones
+% whose names contain - or _ still won't work, but we can't do anything
+% about that.  The command has to be fully expandable, since the result
+% winds up in the index file.  This means that if the variable's value
+% contains other Texinfo commands, it's almost certain it will fail
+% (although perhaps we could fix that with sufficient work to do a
+% one-level expansion on the result, instead of complete).
+% 
+\def\expandablevalue#1{%
+  \expandafter\ifx\csname SET#1\endcsname\relax
+    {[No value for ``#1'']v}%
+  \else
+    \csname SET#1\endcsname
+  \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+\def\ifset{\parsearg\ifsetxxx}
+\def\ifsetxxx #1{%
+  \expandafter\ifx\csname SET#1\endcsname\relax
+    \expandafter\ifsetfail
+  \else
+    \expandafter\ifsetsucceed
+  \fi
+}
+\def\ifsetsucceed{\conditionalsucceed{ifset}}
+\def\ifsetfail{\nestedignore{ifset}}
+\defineunmatchedend{ifset}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+\def\ifclear{\parsearg\ifclearxxx}
+\def\ifclearxxx #1{%
+  \expandafter\ifx\csname SET#1\endcsname\relax
+    \expandafter\ifclearsucceed
+  \else
+    \expandafter\ifclearfail
+  \fi
+}
+\def\ifclearsucceed{\conditionalsucceed{ifclear}}
+\def\ifclearfail{\nestedignore{ifclear}}
+\defineunmatchedend{ifclear}
+
+% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
+% following, through the first @end iftex (etc.).  Make `@end iftex'
+% (etc.) valid only after an @iftex.
+%
+\def\iftex{\conditionalsucceed{iftex}}
+\def\ifnothtml{\conditionalsucceed{ifnothtml}}
+\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
+\defineunmatchedend{iftex}
+\defineunmatchedend{ifnothtml}
+\defineunmatchedend{ifnotinfo}
+
+% We can't just want to start a group at @iftex (for example) and end it
+% at @end iftex, since then @set commands inside the conditional have no
+% effect (they'd get reverted at the end of the group).  So we must
+% define \Eiftex to redefine itself to be its previous value.  (We can't
+% just define it to fail again with an ``unmatched end'' error, since
+% the @ifset might be nested.)
+%
+\def\conditionalsucceed#1{%
+  \edef\temp{%
+    % Remember the current value of \E#1.
+    \let\nece{prevE#1} = \nece{E#1}%
+    %
+    % At the `@end #1', redefine \E#1 to be its previous value.
+    \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
+  }%
+  \temp
+}
+
+% We need to expand lots of \csname's, but we don't want to expand the
+% control sequences after we've constructed them.
+%
+\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
+
+% @asis just yields its argument.  Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math means output in math mode.
+% We don't use $'s directly in the definition of \math because control
+% sequences like \math are expanded when the toc file is written.  Then,
+% we read the toc file back, the $'s will be normal characters (as they
+% should be, according to the definition of Texinfo).  So we must use a
+% control sequence to switch into and out of math mode.
+%
+% This isn't quite enough for @math to work properly in indices, but it
+% seems unlikely it will ever be needed there.
+%
+\let\implicitmath = $
+\def\math#1{\implicitmath #1\implicitmath}
+
+% @bullet and @minus need the same treatment as @math, just above.
+\def\bullet{\implicitmath\ptexbullet\implicitmath}
+\def\minus{\implicitmath-\implicitmath}
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+   \iflinks 
+     \readauxfile
+   \fi % \openindices needs to do some work in any case.
+   \openindices
+   \fixbackslash  % Turn off hack to swallow `\input texinfo'.
+   \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
+   %
+   % If texinfo.cnf is present on the system, read it.
+   % Useful for site-wide @afourpaper, etc.
+   % Just to be on the safe side, close the input stream before the \input.
+   \openin 1 texinfo.cnf
+   \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
+   \closein1
+   \temp
+   %
+   \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+% 
+\def\openindices{%
+  \newindex{cp}%
+  \newcodeindex{fn}%
+  \newcodeindex{vr}%
+  \newcodeindex{tp}%
+  \newcodeindex{ky}%
+  \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{fonts,}
+% Font-change commands.
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf analogous to plain's \rm, etc.
+\newfam\sffam
+\def\sf{\fam=\sffam \tensf}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this one.
+\def\ttsl{\tenttsl}
+
+% Use Computer Modern fonts at \magstephalf (11pt).
+\newcount\mainmagstep
+\mainmagstep=\magstephalf
+
+% Set the font macro #1 to the font named #2, adding on the
+% specified font prefix (normally `cm').
+% #3 is the font's design size, #4 is a scale factor
+\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\undefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx}               %where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+\ifx\bigger\relax
+\let\mainmagstep=\magstep1
+\setfont\textrm\rmshape{12}{1000}
+\setfont\texttt\ttshape{12}{1000}
+\else
+\setfont\textrm\rmshape{10}{\mainmagstep}
+\setfont\texttt\ttshape{10}{\mainmagstep}
+\fi
+% Instead of cmb10, you many want to use cmbx10.
+% cmbx10 is a prettier font on its own, but cmb10
+% looks better when embedded in a line with cmr10.
+\setfont\textbf\bfshape{10}{\mainmagstep}
+\setfont\textit\itshape{10}{\mainmagstep}
+\setfont\textsl\slshape{10}{\mainmagstep}
+\setfont\textsf\sfshape{10}{\mainmagstep}
+\setfont\textsc\scshape{10}{\mainmagstep}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun, etc.
+\setfont\defbf\bxshape{10}{\magstep1} %was 1314
+\setfont\deftt\ttshape{10}{\magstep1}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
+
+% Fonts for indices and small examples (9pt).
+% We actually use the slanted font rather than the italic,
+% because texinfo normally uses the slanted fonts for that.
+% Do not make many font distinctions in general in the index, since they
+% aren't very useful.
+\setfont\ninett\ttshape{9}{1000}
+\setfont\ninettsl\ttslshape{10}{900}
+\setfont\indrm\rmshape{9}{1000}
+\setfont\indit\itshape{9}{1000}
+\setfont\indsl\slshape{9}{1000}
+\let\indtt=\ninett
+\let\indttsl=\ninettsl
+\let\indsf=\indrm
+\let\indbf=\indrm
+\setfont\indsc\scshape{10}{900}
+\font\indi=cmmi9
+\font\indsy=cmsy9
+
+% Fonts for title page:
+\setfont\titlerm\rmbshape{12}{\magstep3}
+\setfont\titleit\itbshape{10}{\magstep4}
+\setfont\titlesl\slbshape{10}{\magstep4}
+\setfont\titlett\ttbshape{12}{\magstep3}
+\setfont\titlettsl\ttslshape{10}{\magstep4}
+\setfont\titlesf\sfbshape{17}{\magstep1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\setfont\chaprm\rmbshape{12}{\magstep2}
+\setfont\chapit\itbshape{10}{\magstep3}
+\setfont\chapsl\slbshape{10}{\magstep3}
+\setfont\chaptt\ttbshape{12}{\magstep2}
+\setfont\chapttsl\ttslshape{10}{\magstep3}
+\setfont\chapsf\sfbshape{17}{1000}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+
+% Section fonts (14.4pt).
+\setfont\secrm\rmbshape{12}{\magstep1}
+\setfont\secit\itbshape{10}{\magstep2}
+\setfont\secsl\slbshape{10}{\magstep2}
+\setfont\sectt\ttbshape{12}{\magstep1}
+\setfont\secttsl\ttslshape{10}{\magstep2}
+\setfont\secsf\sfbshape{12}{\magstep1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+
+% \setfont\ssecrm\bxshape{10}{\magstep1}    % This size an font looked bad.
+% \setfont\ssecit\itshape{10}{\magstep1}    % The letters were too crowded.
+% \setfont\ssecsl\slshape{10}{\magstep1}
+% \setfont\ssectt\ttshape{10}{\magstep1}
+% \setfont\ssecsf\sfshape{10}{\magstep1}
+
+%\setfont\ssecrm\bfshape{10}{1315}      % Note the use of cmb rather than cmbx.
+%\setfont\ssecit\itshape{10}{1315}      % Also, the size is a little larger than
+%\setfont\ssecsl\slshape{10}{1315}      % being scaled magstep1.
+%\setfont\ssectt\ttshape{10}{1315}
+%\setfont\ssecsf\sfshape{10}{1315}
+
+%\let\ssecbf=\ssecrm
+
+% Subsection fonts (13.15pt).
+\setfont\ssecrm\rmbshape{12}{\magstephalf}
+\setfont\ssecit\itbshape{10}{1315}
+\setfont\ssecsl\slbshape{10}{1315}
+\setfont\ssectt\ttbshape{12}{\magstephalf}
+\setfont\ssecttsl\ttslshape{10}{1315}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{\magstep1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
+% but that is not a standard magnification.
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families.  Since
+% texinfo doesn't allow for producing subscripts and superscripts, we
+% don't bother to reset \scriptfont and \scriptscriptfont (which would
+% also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+  \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
+  \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
+  \textfont\ttfam = \tentt \textfont\sffam = \tensf
+}
+
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE.  We do this so that font changes will continue to work
+% in math mode, where it is the current \fam that is relevant in most
+% cases, not the current font.  Plain TeX does \def\bf{\fam=\bffam
+% \tenbf}, for example.  By redefining \tenbf, we obviate the need to
+% redefine \bf itself.
+\def\textfonts{%
+  \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
+  \resetmathfonts}
+\def\titlefonts{%
+  \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+  \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+  \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+  \let\tenttsl=\titlettsl
+  \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rm #1}}
+\def\chapfonts{%
+  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+  \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
+  \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+  \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+  \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+  \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
+  \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+  \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+  \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+  \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
+  \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
+\def\indexfonts{%
+  \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
+  \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
+  \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
+  \resetmathfonts \setleading{12pt}}
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\textfonts
+
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}
+\setfont\shortcontbf\bxshape{12}{1000}
+\setfont\shortcontsl\slshape{12}{1000}
+
+%% Add scribe-like font environments, plus @l for inline lisp (usually sans
+%% serif) and @ii for TeX italic
+
+% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
+% unless the following character is such as not to need one.
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
+\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
+
+\let\i=\smartitalic
+\let\var=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+\let\cite=\smartslanted
+
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph.  Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+\def\t#1{%
+  {\tt \rawbackslash \frenchspacing #1}%
+  \null
+}
+\let\ttfont=\t
+\def\samp#1{`\tclose{#1}'\null}
+\setfont\smallrm\rmshape{8}{1000}
+\font\smallsy=cmsy9
+\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
+  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+    \vbox{\hrule\kern-0.4pt
+     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+    \kern-0.4pt\hrule}%
+  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+% The old definition, with no lozenge:
+%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @file, @option are the same as @samp.
+\let\file=\samp
+\let\option=\samp
+
+% @code is a modification of @t,
+% which makes spaces the same size as normal in the surrounding text.
+\def\tclose#1{%
+  {%
+    % Change normal interword space to be same as for the current font.
+    \spaceskip = \fontdimen2\font
+    %
+    % Switch to typewriter.
+    \tt
+    %
+    % But `\ ' produces the large typewriter interword space.
+    \def\ {{\spaceskip = 0pt{} }}%
+    %
+    % Turn off hyphenation.
+    \nohyphenation
+    %
+    \rawbackslash
+    \frenchspacing
+    #1%
+  }%
+  \null
+}
+
+% We *must* turn on hyphenation at `-' and `_' in \code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+%  -- rms.
+{
+  \catcode`\-=\active
+  \catcode`\_=\active
+  %
+  \global\def\code{\begingroup
+    \catcode`\-=\active \let-\codedash
+    \catcode`\_=\active \let_\codeunder
+    \codex
+  }
+  %
+  % If we end up with any active - characters when handling the index,
+  % just treat them as a normal -.
+  \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
+}
+
+\def\realdash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
+\def\codex #1{\tclose{#1}\endgroup}
+
+%\let\exp=\tclose  %Was temporary
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+%   `example' (@kbd uses ttsl only inside of @example and friends),
+%   or `code' (@kbd uses normal tty font always).
+\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
+\def\kbdinputstylexxx#1{%
+  \def\arg{#1}%
+  \ifx\arg\worddistinct
+    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+  \else\ifx\arg\wordexample
+    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+  \else\ifx\arg\wordcode
+    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+  \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is kbdinputdistinct.  (Too much of a hassle to call the macro,
+% the catcodes are wrong for parsearg to work.)
+\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
+
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\kbdfont\look}}\fi
+\else{\tclose{\kbdfont\look}}\fi}
+
+% For @url, @env, @command quotes seem unnecessary, so use \code.
+\let\url=\code
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional second argument
+% specifying the text to display.  First (mandatory) arg is the url.
+% Perhaps eventually put in a hypertex \special here.
+% 
+\def\uref#1{\urefxxx #1,,\finish}
+\def\urefxxx#1,#2,#3\finish{%
+  \setbox0 = \hbox{\ignorespaces #2}%
+  \ifdim\wd0 > 0pt
+    \unhbox0\ (\code{#1})%
+  \else
+    \code{#1}%
+  \fi
+}
+
+% rms does not like the angle brackets --karl, 17may97.
+% So now @email is just like @uref.
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\let\email=\uref
+
+% Check if we are currently using a typewriter font.  Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find.  We need it for
+% Polish suppressed-l.  --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}}              % roman font
+\def\sc#1{{\smallcaps#1}}       % smallcaps font
+\def\ii#1{{\it #1}}             % italic font
+
+% @acronym downcases the argument and prints in smallcaps.
+\def\acronym#1{{\smallcaps \lowercase{#1}}}
+
+% @pounds{} is a sterling sign.
+\def\pounds{{\it\$}}
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page.  Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @contentsaftertitlepage or @shortcontentsaftertitlepage.
+% 
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\def\shorttitlepage{\parsearg\shorttitlepagezzz}
+\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+        \endgroup\page\hbox{}\page}
+
+\def\titlepage{\begingroup \parindent=0pt \textfonts
+   \let\subtitlerm=\tenrm
+   \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
+   %
+   \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
+   %
+   % Leave some space at the very top of the page.
+   \vglue\titlepagetopglue
+   %
+   % Now you can print the title using @title.
+   \def\title{\parsearg\titlezzz}%
+   \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
+                    % print a rule at the page bottom also.
+                    \finishedtitlepagefalse
+                    \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
+   % No rule at page bottom unless we print one at the top with @title.
+   \finishedtitlepagetrue
+   %
+   % Now you can put text using @subtitle.
+   \def\subtitle{\parsearg\subtitlezzz}%
+   \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
+   %
+   % @author should come last, but may come many times.
+   \def\author{\parsearg\authorzzz}%
+   \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
+      {\authorfont \leftline{##1}}}%
+   %
+   % Most title ``pages'' are actually two pages long, with space
+   % at the top of the second.  We don't want the ragged left on the second.
+   \let\oldpage = \page
+   \def\page{%
+      \iffinishedtitlepage\else
+         \finishtitlepage
+      \fi
+      \oldpage
+      \let\page = \oldpage
+      \hbox{}}%
+%   \def\page{\oldpage \hbox{}}
+}
+
+\def\Etitlepage{%
+   \iffinishedtitlepage\else
+      \finishtitlepage
+   \fi
+   % It is important to do the page break before ending the group,
+   % because the headline and footline are only empty inside the group.
+   % If we use the new definition of \page, we always get a blank page
+   % after the title page, which we certainly don't want.
+   \oldpage
+   \endgroup
+   %
+   % If they want short, they certainly want long too.
+   \ifsetshortcontentsaftertitlepage
+     \shortcontents
+     \contents
+     \global\let\shortcontents = \relax
+     \global\let\contents = \relax
+   \fi
+   %
+   \ifsetcontentsaftertitlepage
+     \contents
+     \global\let\contents = \relax
+     \global\let\shortcontents = \relax
+   \fi
+   %
+   \HEADINGSon
+}
+
+\def\finishtitlepage{%
+   \vskip4pt \hrule height 2pt width \hsize
+   \vskip\titlepagebottomglue
+   \finishedtitlepagetrue
+}
+
+%%% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline    % headline on even pages
+\newtoks\oddheadline     % headline on odd pages
+\newtoks\evenfootline    % footline on even pages
+\newtoks\oddfootline     % footline on odd pages
+
+% Now make Tex use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+                            \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+                            \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what  @headings on  does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\everyheading{\parsearg\everyheadingxxx}
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\everyfooting{\parsearg\everyfootingxxx}
+
+{\catcode`\@=0 %
+
+\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
+\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
+\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
+\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
+\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
+  \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+  %
+  % Leave some space for the footline.  Hopefully ok to assume
+  % @evenfooting will not be used by itself.
+  \global\advance\pageheight by -\baselineskip
+  \global\advance\vsize by -\baselineskip
+}
+
+\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+%
+}% unbind the catcode of @.
+
+% @headings double      turns headings on for double-sided printing.
+% @headings single      turns headings on for single-sided printing.
+% @headings off         turns them off.
+% @headings on          same as @headings double, retained for compatibility.
+% @headings after       turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\HEADINGSoff{
+\global\evenheadline={\hfil} \global\evenfootline={\hfil}
+\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
+\HEADINGSoff
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% Produces Day Month Year style of output.
+\def\today{\number\day\space
+\ifcase\month\or
+January\or February\or March\or April\or May\or June\or
+July\or August\or September\or October\or November\or December\fi
+\space\number\year}
+
+% Use this if you want the Month Day, Year style of output.
+%\def\today{\ifcase\month\or
+%January\or February\or March\or April\or May\or June\or
+%July\or August\or September\or October\or November\or December\fi
+%\space\number\day, \number\year}
+
+% @settitle line...  specifies the title of the document, for headings
+% It generates no output of its own
+
+\def\thistitle{No Title}
+\def\settitle{\parsearg\settitlezzz}
+\def\settitlezzz #1{\gdef\thistitle{#1}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent  \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin  \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
+\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
+
+\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
+\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
+
+\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
+                 \itemzzz {#1}}
+
+\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
+                 \itemzzz {#1}}
+
+\def\itemzzz #1{\begingroup %
+  \advance\hsize by -\rightskip
+  \advance\hsize by -\tableindent
+  \setbox0=\hbox{\itemfont{#1}}%
+  \itemindex{#1}%
+  \nobreak % This prevents a break before @itemx.
+  %
+  % If the item text does not fit in the space we have, put it on a line
+  % by itself, and do not allow a page break either before or after that
+  % line.  We do not start a paragraph here because then if the next
+  % command is, e.g., @kindex, the whatsit would get put into the
+  % horizontal list on a line by itself, resulting in extra blank space.
+  \ifdim \wd0>\itemmax
+    %
+    % Make this a paragraph so we get the \parskip glue and wrapping,
+    % but leave it ragged-right.
+    \begingroup
+      \advance\leftskip by-\tableindent
+      \advance\hsize by\tableindent
+      \advance\rightskip by0pt plus1fil
+      \leavevmode\unhbox0\par
+    \endgroup
+    %
+    % We're going to be starting a paragraph, but we don't want the
+    % \parskip glue -- logically it's part of the @item we just started.
+    \nobreak \vskip-\parskip
+    %
+    % Stop a page break at the \parskip glue coming up.  Unfortunately
+    % we can't prevent a possible page break at the following
+    % \baselineskip glue.
+    \nobreak
+    \endgroup
+    \itemxneedsnegativevskipfalse
+  \else
+    % The item text fits into the space.  Start a paragraph, so that the
+    % following text (if any) will end up on the same line.  
+    \noindent
+    % Do this with kerns and \unhbox so that if there is a footnote in
+    % the item text, it can migrate to the main vertical list and
+    % eventually be printed.
+    \nobreak\kern-\tableindent
+    \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+    \unhbox0
+    \nobreak\kern\dimen0
+    \endgroup
+    \itemxneedsnegativevskiptrue
+  \fi
+}
+
+\def\item{\errmessage{@item while not in a table}}
+\def\itemx{\errmessage{@itemx while not in a table}}
+\def\kitem{\errmessage{@kitem while not in a table}}
+\def\kitemx{\errmessage{@kitemx while not in a table}}
+\def\xitem{\errmessage{@xitem while not in a table}}
+\def\xitemx{\errmessage{@xitemx while not in a table}}
+
+% Contains a kludge to get @end[description] to work.
+\def\description{\tablez{\dontindex}{1}{}{}{}{}}
+
+% @table, @ftable, @vtable.
+\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
+{\obeylines\obeyspaces%
+\gdef\tablex #1^^M{%
+\tabley\dontindex#1        \endtabley}}
+
+\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
+{\obeylines\obeyspaces%
+\gdef\ftablex #1^^M{%
+\tabley\fnitemindex#1        \endtabley
+\def\Eftable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
+{\obeylines\obeyspaces%
+\gdef\vtablex #1^^M{%
+\tabley\vritemindex#1        \endtabley
+\def\Evtable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\dontindex #1{}
+\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
+\def\vritemindex #1{\doind {vr}{\code{#1}}}%
+
+{\obeyspaces %
+\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
+\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
+
+\def\tablez #1#2#3#4#5#6{%
+\aboveenvbreak %
+\begingroup %
+\def\Edescription{\Etable}% Necessary kludge.
+\let\itemindex=#1%
+\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
+\ifnum 0#4>0 \tableindent=#4\mil \fi %
+\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
+\def\itemfont{#2}%
+\itemmax=\tableindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \tableindent %
+\exdentamount=\tableindent
+\parindent = 0pt
+\parskip = \smallskipamount
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def\Etable{\endgraf\afterenvbreak\endgroup}%
+\let\item = \internalBitem %
+\let\itemx = \internalBitemx %
+\let\kitem = \internalBkitem %
+\let\kitemx = \internalBkitemx %
+\let\xitem = \internalBxitem %
+\let\xitemx = \internalBxitemx %
+}
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\def\itemize{\parsearg\itemizezzz}
+
+\def\itemizezzz #1{%
+  \begingroup % ended by the @end itemize
+  \itemizey {#1}{\Eitemize}
+}
+
+\def\itemizey #1#2{%
+\aboveenvbreak %
+\itemmax=\itemindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \itemindent %
+\exdentamount=\itemindent
+\parindent = 0pt %
+\parskip = \smallskipamount %
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def#2{\endgraf\afterenvbreak\endgroup}%
+\def\itemcontents{#1}%
+\let\item=\itemizeitem}
+
+% Set sfcode to normal for the chars that usually have another value.
+% These are `.?!:;,'
+\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
+  \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list.  No
+% argument is the same as `1'.
+%
+\def\enumerate{\parsearg\enumeratezzz}
+\def\enumeratezzz #1{\enumeratey #1  \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+  \begingroup % ended by the @end enumerate
+  %
+  % If we were given no argument, pretend we were given `1'.
+  \def\thearg{#1}%
+  \ifx\thearg\empty \def\thearg{1}\fi
+  %
+  % Detect if the argument is a single token.  If so, it might be a
+  % letter.  Otherwise, the only valid thing it can be is a number.
+  % (We will always have one token, because of the test we just made.
+  % This is a good thing, since \splitoff doesn't work given nothing at
+  % all -- the first parameter is undelimited.)
+  \expandafter\splitoff\thearg\endmark
+  \ifx\rest\empty
+    % Only one token in the argument.  It could still be anything.
+    % A ``lowercase letter'' is one whose \lccode is nonzero.
+    % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+    %   not equal to itself.
+    % Otherwise, we assume it's a number.
+    %
+    % We need the \relax at the end of the \ifnum lines to stop TeX from
+    % continuing to look for a <number>.
+    %
+    \ifnum\lccode\expandafter`\thearg=0\relax
+      \numericenumerate % a number (we hope)
+    \else
+      % It's a letter.
+      \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+        \lowercaseenumerate % lowercase letter
+      \else
+        \uppercaseenumerate % uppercase letter
+      \fi
+    \fi
+  \else
+    % Multiple tokens in the argument.  We hope it's a number.
+    \numericenumerate
+  \fi
+}
+
+% An @enumerate whose labels are integers.  The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+  \itemno = \thearg
+  \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+  \itemno = \expandafter`\thearg
+  \startenumeration{%
+    % Be sure we're not beyond the end of the alphabet.
+    \ifnum\itemno=0
+      \errmessage{No more lowercase letters in @enumerate; get a bigger
+                  alphabet}%
+    \fi
+    \char\lccode\itemno
+  }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+  \itemno = \expandafter`\thearg
+  \startenumeration{%
+    % Be sure we're not beyond the end of the alphabet.
+    \ifnum\itemno=0
+      \errmessage{No more uppercase letters in @enumerate; get a bigger
+                  alphabet}
+    \fi
+    \char\uccode\itemno
+  }%
+}
+
+% Call itemizey, adding a period to the first argument and supplying the
+% common last two arguments.  Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+  \advance\itemno by -1
+  \itemizey{#1.}\Eenumerate\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+% Definition of @item while inside @itemize.
+
+\def\itemizeitem{%
+\advance\itemno by 1
+{\let\par=\endgraf \smallbreak}%
+\ifhmode \errmessage{In hmode at itemizeitem}\fi
+{\parskip=0in \hskip 0pt
+\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
+\vadjust{\penalty 1200}}%
+\flushcr}
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble.  Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+%   @multitable @columnfractions .25 .3 .45
+%   @item ...
+%
+%   Numbers following @columnfractions are the percent of the total
+%   current hsize to be used for each column. You may use as many
+%   columns as desired.
+
+
+% Or use a template:
+%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+%   @item ...
+%   using the widest term desired in each column.
+%
+% For those who want to use more than one line's worth of words in
+% the preamble, break the line within one argument and it
+% will parse correctly, i.e.,
+%
+%     @multitable {Column 1 template} {Column 2 template} {Column 3
+%      template}
+% Not:
+%     @multitable {Column 1 template} {Column 2 template}
+%      {Column 3 template}
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab, @multitable or @end multitable do not need to be on their
+% own lines, but it will not hurt if they are.
+
+% Sample multitable:
+
+%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+%   @item first col stuff @tab second col stuff @tab third col
+%   @item
+%   first col stuff
+%   @tab
+%   second col stuff
+%   @tab
+%   third col
+%   @item first col stuff @tab second col stuff
+%   @tab Many paragraphs of text may be used in any column.
+%
+%         They will wrap at the width determined by the template.
+%   @item@tab@tab This will be in third column.
+%   @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+%                                                            to baseline.
+%   0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+% 
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% 2/1/96, to allow fractions to be given with more than one digit.
+\def\pickupwholefraction#1 {\global\advance\colcount by1 %
+\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
+\setuptable}
+
+\newcount\colcount
+\def\setuptable#1{\def\firstarg{#1}%
+\ifx\firstarg\xendsetuptable\let\go\relax%
+\else
+  \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
+  \else
+    \ifsetpercent
+       \let\go\pickupwholefraction   % In this case arg of setuptable
+                                     % is the decimal point before the
+                                     % number given in percent of hsize.
+                                     % We don't need this so we don't use it.
+    \else
+       \global\advance\colcount by1
+       \setbox0=\hbox{#1 }% Add a normal word space as a separator;
+                          % typically that is always in the input, anyway.
+       \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+    \fi%
+  \fi%
+\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
+\fi\go}
+
+% multitable syntax
+\def\tab{&\hskip1sp\relax} % 2/2/96
+                           % tiny skip here makes sure this column space is
+                           % maintained, even if it is never used.
+
+% @multitable ... @end multitable definitions:
+
+\def\multitable{\parsearg\dotable}
+\def\dotable#1{\bgroup
+  \vskip\parskip
+  \let\item\crcr
+  \tolerance=9500
+  \hbadness=9500
+  \setmultitablespacing
+  \parskip=\multitableparskip
+  \parindent=\multitableparindent
+  \overfullrule=0pt
+  \global\colcount=0
+  \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
+  %
+  % To parse everything between @multitable and @item:
+  \setuptable#1 \endsetuptable
+  %
+  % \everycr will reset column counter, \colcount, at the end of
+  % each line. Every column entry will cause \colcount to advance by one.
+  % The table preamble
+  % looks at the current \colcount to find the correct column width.
+  \everycr{\noalign{%
+  %
+  % \filbreak%% keeps underfull box messages off when table breaks over pages.
+  % Maybe so, but it also creates really weird page breaks when the table
+  % breaks over pages. Wouldn't \vfil be better?  Wait until the problem
+  % manifests itself, so it can be fixed for real --karl.
+    \global\colcount=0\relax}}%
+  %
+  % This preamble sets up a generic column definition, which will
+  % be used as many times as user calls for columns.
+  % \vtop will set a single line and will also let text wrap and
+  % continue for many paragraphs if desired.
+  \halign\bgroup&\global\advance\colcount by 1\relax
+    \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
+  %
+  % In order to keep entries from bumping into each other
+  % we will add a \leftskip of \multitablecolspace to all columns after
+  % the first one.
+  % 
+  % If a template has been used, we will add \multitablecolspace
+  % to the width of each template entry.
+  % 
+  % If the user has set preamble in terms of percent of \hsize we will
+  % use that dimension as the width of the column, and the \leftskip
+  % will keep entries from bumping into each other.  Table will start at
+  % left margin and final column will justify at right margin.
+  % 
+  % Make sure we don't inherit \rightskip from the outer environment.
+  \rightskip=0pt
+  \ifnum\colcount=1
+    % The first column will be indented with the surrounding text.
+    \advance\hsize by\leftskip
+  \else
+    \ifsetpercent \else
+      % If user has not set preamble in terms of percent of \hsize
+      % we will advance \hsize by \multitablecolspace.
+      \advance\hsize by \multitablecolspace
+    \fi
+   % In either case we will make \leftskip=\multitablecolspace:
+  \leftskip=\multitablecolspace
+  \fi
+  % Ignoring space at the beginning and end avoids an occasional spurious
+  % blank line, when TeX decides to break the line at the space before the
+  % box from the multistrut, so the strut ends up on a line by itself.
+  % For example:
+  % @multitable @columnfractions .11 .89
+  % @item @code{#}
+  % @tab Legal holiday which is valid in major parts of the whole country.
+  % Is automatically provided with highlighting sequences respectively marking
+  % characters.
+  \noindent\ignorespaces##\unskip\multistrut}\cr
+}
+
+\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
+% If so, do nothing. If not, give it an appropriate dimension based on
+% current baselineskip.
+\ifdim\multitablelinespace=0pt
+%% strut to put in table in case some entry doesn't have descenders,
+%% to keep lines equally spaced
+\let\multistrut = \strut
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%%        If so, set to same dimension as multitablelinespace.
+\else
+\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
+width0pt\relax} \fi
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+                                      %% than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+                                      %% than skip between lines in the table.
+\fi}
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within \newindex.
+{\catcode`\@=11
+\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index.  The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+  \iflinks
+    \expandafter\newwrite \csname#1indfile\endcsname
+    \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+  \fi
+  \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
+    \noexpand\doindex{#1}}
+}
+
+% @defindex foo  ==  \newindex{foo}
+
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+
+\def\newcodeindex#1{%
+  \iflinks
+    \expandafter\newwrite \csname#1indfile\endcsname
+    \openout \csname#1indfile\endcsname \jobname.#1
+  \fi
+  \expandafter\xdef\csname#1index\endcsname{%
+    \noexpand\docodeindex{#1}}
+}
+
+\def\defcodeindex{\parsearg\newcodeindex}
+
+% @synindex foo bar    makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+% The \closeout helps reduce unnecessary open files; the limit on the
+% Acorn RISC OS is a mere 16 files.
+\def\synindex#1 #2 {%
+  \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+  \expandafter\closeout\csname#1indfile\endcsname
+  \expandafter\let\csname#1indfile\endcsname=\synindexfoo
+  \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
+    \noexpand\doindex{#2}}%
+}
+
+% @syncodeindex foo bar   similar, but put all entries made for index foo
+% inside @code.
+\def\syncodeindex#1 #2 {%
+  \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+  \expandafter\closeout\csname#1indfile\endcsname
+  \expandafter\let\csname#1indfile\endcsname=\synindexfoo
+  \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
+    \noexpand\docodeindex{#2}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+%  and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+\def\indexdummies{%
+\def\ { }%
+% Take care of the plain tex accent commands.
+\def\"{\realbackslash "}%
+\def\`{\realbackslash `}%
+\def\'{\realbackslash '}%
+\def\^{\realbackslash ^}%
+\def\~{\realbackslash ~}%
+\def\={\realbackslash =}%
+\def\b{\realbackslash b}%
+\def\c{\realbackslash c}%
+\def\d{\realbackslash d}%
+\def\u{\realbackslash u}%
+\def\v{\realbackslash v}%
+\def\H{\realbackslash H}%
+% Take care of the plain tex special European modified letters.
+\def\oe{\realbackslash oe}%
+\def\ae{\realbackslash ae}%
+\def\aa{\realbackslash aa}%
+\def\OE{\realbackslash OE}%
+\def\AE{\realbackslash AE}%
+\def\AA{\realbackslash AA}%
+\def\o{\realbackslash o}%
+\def\O{\realbackslash O}%
+\def\l{\realbackslash l}%
+\def\L{\realbackslash L}%
+\def\ss{\realbackslash ss}%
+% Take care of texinfo commands likely to appear in an index entry.
+% (Must be a way to avoid doing expansion at all, and thus not have to
+% laboriously list every single command here.)
+\def\@{@}% will be @@ when we switch to @ as escape char.
+%\let\{ = \lbracecmd
+%\let\} = \rbracecmd
+\def\_{{\realbackslash _}}%
+\def\w{\realbackslash w }%
+\def\bf{\realbackslash bf }%
+%\def\rm{\realbackslash rm }%
+\def\sl{\realbackslash sl }%
+\def\sf{\realbackslash sf}%
+\def\tt{\realbackslash tt}%
+\def\gtr{\realbackslash gtr}%
+\def\less{\realbackslash less}%
+\def\hat{\realbackslash hat}%
+\def\TeX{\realbackslash TeX}%
+\def\dots{\realbackslash dots }%
+\def\result{\realbackslash result}%
+\def\equiv{\realbackslash equiv}%
+\def\expansion{\realbackslash expansion}%
+\def\print{\realbackslash print}%
+\def\error{\realbackslash error}%
+\def\point{\realbackslash point}%
+\def\copyright{\realbackslash copyright}%
+\def\tclose##1{\realbackslash tclose {##1}}%
+\def\code##1{\realbackslash code {##1}}%
+\def\dotless##1{\realbackslash dotless {##1}}%
+\def\samp##1{\realbackslash samp {##1}}%
+\def\,##1{\realbackslash ,{##1}}%
+\def\t##1{\realbackslash t {##1}}%
+\def\r##1{\realbackslash r {##1}}%
+\def\i##1{\realbackslash i {##1}}%
+\def\b##1{\realbackslash b {##1}}%
+\def\sc##1{\realbackslash sc {##1}}%
+\def\cite##1{\realbackslash cite {##1}}%
+\def\key##1{\realbackslash key {##1}}%
+\def\file##1{\realbackslash file {##1}}%
+\def\var##1{\realbackslash var {##1}}%
+\def\kbd##1{\realbackslash kbd {##1}}%
+\def\dfn##1{\realbackslash dfn {##1}}%
+\def\emph##1{\realbackslash emph {##1}}%
+%
+% Handle some cases of @value -- where the variable name does not
+% contain - or _, and the value does not contain any
+% (non-fully-expandable) commands.
+\let\value = \expandablevalue
+%
+\unsepspaces
+}
+
+% If an index command is used in an @example environment, any spaces
+% therein should become regular spaces in the raw index file, not the
+% expansion of \tie (\\leavevmode \penalty \@M \ ).
+{\obeyspaces
+ \gdef\unsepspaces{\obeyspaces\let =\space}}
+
+% \indexnofonts no-ops all font-change commands.
+% This is used when outputting the strings to sort the index by.
+\def\indexdummyfont#1{#1}
+\def\indexdummytex{TeX}
+\def\indexdummydots{...}
+
+\def\indexnofonts{%
+% Just ignore accents.
+\let\,=\indexdummyfont
+\let\"=\indexdummyfont
+\let\`=\indexdummyfont
+\let\'=\indexdummyfont
+\let\^=\indexdummyfont
+\let\~=\indexdummyfont
+\let\==\indexdummyfont
+\let\b=\indexdummyfont
+\let\c=\indexdummyfont
+\let\d=\indexdummyfont
+\let\u=\indexdummyfont
+\let\v=\indexdummyfont
+\let\H=\indexdummyfont
+\let\dotless=\indexdummyfont
+% Take care of the plain tex special European modified letters.
+\def\oe{oe}%
+\def\ae{ae}%
+\def\aa{aa}%
+\def\OE{OE}%
+\def\AE{AE}%
+\def\AA{AA}%
+\def\o{o}%
+\def\O{O}%
+\def\l{l}%
+\def\L{L}%
+\def\ss{ss}%
+\let\w=\indexdummyfont
+\let\t=\indexdummyfont
+\let\r=\indexdummyfont
+\let\i=\indexdummyfont
+\let\b=\indexdummyfont
+\let\emph=\indexdummyfont
+\let\strong=\indexdummyfont
+\let\cite=\indexdummyfont
+\let\sc=\indexdummyfont
+%Don't no-op \tt, since it isn't a user-level command
+% and is used in the definitions of the active chars like <, >, |...
+%\let\tt=\indexdummyfont
+\let\tclose=\indexdummyfont
+\let\code=\indexdummyfont
+\let\file=\indexdummyfont
+\let\samp=\indexdummyfont
+\let\kbd=\indexdummyfont
+\let\key=\indexdummyfont
+\let\var=\indexdummyfont
+\let\TeX=\indexdummytex
+\let\dots=\indexdummydots
+\def\@{@}%
+}
+
+% To define \realbackslash, we must make \ not be an escape.
+% We must first make another character (@) an escape
+% so we do not become unable to do a definition.
+
+{\catcode`\@=0 \catcode`\\=\other
+ @gdef@realbackslash{\}}
+
+\let\indexbackslash=0  %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% For \ifx comparisons.
+\def\emptymacro{\empty}
+
+% Most index entries go through here, but \dosubind is the general case.
+% 
+\def\doind#1#2{\dosubind{#1}{#2}\empty}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% \empty if called from \doind, as we usually are.  The main exception
+% is with defuns, which call us directly.
+% 
+\def\dosubind#1#2#3{%
+  % Put the index entry in the margin if desired.
+  \ifx\SETmarginindex\relax\else
+    \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
+  \fi
+  {%
+    \count255=\lastpenalty
+    {%
+      \indexdummies % Must do this here, since \bf, etc expand at this stage
+      \escapechar=`\\
+      {%
+        \let\folio = 0% We will expand all macros now EXCEPT \folio.
+        \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
+        % so it will be output as is; and it will print as backslash.
+        %
+        \def\thirdarg{#3}%
+        %
+        % If third arg is present, precede it with space in sort key.
+        \ifx\thirdarg\emptymacro
+          \let\subentry = \empty
+        \else
+          \def\subentry{ #3}%
+        \fi
+        %
+        % First process the index-string with all font commands turned off
+        % to get the string to sort by.
+        {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
+        %
+        % Now produce the complete index entry, with both the sort key and the
+        % original text, including any font commands.
+        \toks0 = {#2}%
+        \edef\temp{%
+          \write\csname#1indfile\endcsname{%
+            \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
+        }%
+        %
+        % If third (subentry) arg is present, add it to the index string.
+        \ifx\thirdarg\emptymacro \else
+          \toks0 = {#3}%
+          \edef\temp{\temp{\the\toks0}}%
+        \fi
+        %
+        % If a skip is the last thing on the list now, preserve it
+        % by backing up by \lastskip, doing the \write, then inserting
+        % the skip again.  Otherwise, the whatsit generated by the
+        % \write will make \lastskip zero.  The result is that sequences
+        % like this:
+        % @end defun
+        % @tindex whatever
+        % @defun ...
+        % will have extra space inserted, because the \medbreak in the
+        % start of the @defun won't see the skip inserted by the @end of
+        % the previous defun.
+        % 
+        % But don't do any of this if we're not in vertical mode.  We
+        % don't want to do a \vskip and prematurely end a paragraph.
+        % 
+        % Avoid page breaks due to these extra skips, too.
+        % 
+        \iflinks
+          \ifvmode
+            \skip0 = \lastskip
+            \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
+          \fi
+          %
+          \temp % do the write
+          %
+          % 
+          \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
+        \fi
+      }%
+    }%
+    \penalty\count255
+  }%
+}
+
+% The index entry written in the file actually looks like
+%  \entry {sortstring}{page}{topic}
+% or
+%  \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+%  \initial {c}
+%     before the first topic whose initial is c
+%  \entry {topic}{pagelist}
+%     for a topic that is used without subtopics
+%  \primary {topic}
+%     for the beginning of a topic that is used with subtopics
+%  \secondary {subtopic}{pagelist}
+%     for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\def\printindex{\parsearg\doprintindex}
+\def\doprintindex#1{\begingroup
+  \dobreak \chapheadingskip{10000}%
+  %
+  \indexfonts \rm
+  \tolerance = 9500
+  \indexbreaks
+  %
+  % See if the index file exists and is nonempty.
+  % Change catcode of @ here so that if the index file contains
+  % \initial {@}
+  % as its first line, TeX doesn't complain about mismatched braces
+  % (because it thinks @} is a control sequence).
+  \catcode`\@ = 11
+  \openin 1 \jobname.#1s
+  \ifeof 1
+    % \enddoublecolumns gets confused if there is no text in the index,
+    % and it loses the chapter title and the aux file entries for the
+    % index.  The easiest way to prevent this problem is to make sure
+    % there is some text.
+    (Index is nonexistent)
+  \else
+    %
+    % If the index file exists but is empty, then \openin leaves \ifeof
+    % false.  We have to make TeX try to read something from the file, so
+    % it can discover if there is anything in it.
+    \read 1 to \temp
+    \ifeof 1
+      (Index is empty)
+    \else
+      % Index files are almost Texinfo source, but we use \ as the escape
+      % character.  It would be better to use @, but that's too big a change
+      % to make right now.
+      \def\indexbackslash{\rawbackslashxx}%
+      \catcode`\\ = 0
+      \escapechar = `\\
+      \begindoublecolumns
+      \input \jobname.#1s
+      \enddoublecolumns
+    \fi
+  \fi
+  \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+  % Some minor font changes for the special characters.
+  \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+  %
+  % Remove any glue we may have, we'll be inserting our own.
+  \removelastskip
+  % 
+  % We like breaks before the index initials, so insert a bonus.
+  \penalty -300
+  %
+  % Typeset the initial.  Making this add up to a whole number of
+  % baselineskips increases the chance of the dots lining up from column
+  % to column.  It still won't often be perfect, because of the stretch
+  % we need before each entry, but it's better.
+  % 
+  % No shrink because it confuses \balancecolumns.
+  \vskip 1.67\baselineskip plus .5\baselineskip
+  \leftline{\secbf #1}%
+  \vskip .33\baselineskip plus .1\baselineskip
+  %
+  % Do our best not to break after the initial.
+  \nobreak
+}}
+
+% This typesets a paragraph consisting of #1, dot leaders, and then #2
+% flush to the right margin.  It is used for index and table of contents
+% entries.  The paragraph is indented by \leftskip.
+%
+\def\entry#1#2{\begingroup
+  %
+  % Start a new paragraph if necessary, so our assignments below can't
+  % affect previous text.
+  \par
+  %
+  % Do not fill out the last line with white space.
+  \parfillskip = 0in
+  %
+  % No extra space above this paragraph.
+  \parskip = 0in
+  %
+  % Do not prefer a separate line ending with a hyphen to fewer lines.
+  \finalhyphendemerits = 0
+  %
+  % \hangindent is only relevant when the entry text and page number
+  % don't both fit on one line.  In that case, bob suggests starting the
+  % dots pretty far over on the line.  Unfortunately, a large
+  % indentation looks wrong when the entry text itself is broken across
+  % lines.  So we use a small indentation and put up with long leaders.
+  %
+  % \hangafter is reset to 1 (which is the value we want) at the start
+  % of each paragraph, so we need not do anything with that.
+  \hangindent = 2em
+  %
+  % When the entry text needs to be broken, just fill out the first line
+  % with blank space.
+  \rightskip = 0pt plus1fil
+  %
+  % A bit of stretch before each entry for the benefit of balancing columns.
+  \vskip 0pt plus1pt
+  %
+  % Start a ``paragraph'' for the index entry so the line breaking
+  % parameters we've set above will have an effect.
+  \noindent
+  %
+  % Insert the text of the index entry.  TeX will do line-breaking on it.
+  #1%
+  % The following is kludged to not output a line of dots in the index if
+  % there are no page numbers.  The next person who breaks this will be
+  % cursed by a Unix daemon.
+  \def\tempa{{\rm }}%
+  \def\tempb{#2}%
+  \edef\tempc{\tempa}%
+  \edef\tempd{\tempb}%
+  \ifx\tempc\tempd\ \else%
+    %
+    % If we must, put the page number on a line of its own, and fill out
+    % this line with blank space.  (The \hfil is overwhelmed with the
+    % fill leaders glue in \indexdotfill if the page number does fit.)
+    \hfil\penalty50
+    \null\nobreak\indexdotfill % Have leaders before the page number.
+    %
+    % The `\ ' here is removed by the implicit \unskip that TeX does as
+    % part of (the primitive) \par.  Without it, a spurious underfull
+    % \hbox ensues.
+    \ #2% The page number ends the paragraph.
+  \fi%
+  \par
+\endgroup}
+
+% Like \dotfill except takes at least 1 em.
+\def\indexdotfill{\cleaders
+  \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+
+\def\secondary #1#2{
+{\parfillskip=0in \parskip=0in
+\hangindent =1in \hangafter=1
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+  % Grab any single-column material above us.
+  \output = {\global\setbox\partialpage = \vbox{%
+    % 
+    % Here is a possibility not foreseen in manmac: if we accumulate a
+    % whole lot of material, we might end up calling this \output
+    % routine twice in a row (see the doublecol-lose test, which is
+    % essentially a couple of indexes with @setchapternewpage off).  In
+    % that case, we must prevent the second \partialpage from
+    % simply overwriting the first, causing us to lose the page.
+    % This will preserve it until a real output routine can ship it
+    % out.  Generally, \partialpage will be empty when this runs and
+    % this will be a no-op.
+    \unvbox\partialpage
+    %
+    % Unvbox the main output page.
+    \unvbox255
+    \kern-\topskip \kern\baselineskip
+  }}%
+  \eject
+  %
+  % Use the double-column output routine for subsequent pages.
+  \output = {\doublecolumnout}%
+  %
+  % Change the page size parameters.  We could do this once outside this
+  % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+  % format, but then we repeat the same computation.  Repeating a couple
+  % of assignments once per index is clearly meaningless for the
+  % execution time, so we may as well do it in one place.
+  %
+  % First we halve the line length, less a little for the gutter between
+  % the columns.  We compute the gutter based on the line length, so it
+  % changes automatically with the paper format.  The magic constant
+  % below is chosen so that the gutter has the same value (well, +-<1pt)
+  % as it did when we hard-coded it.
+  %
+  % We put the result in a separate register, \doublecolumhsize, so we
+  % can restore it in \pagesofar, after \hsize itself has (potentially)
+  % been clobbered.
+  %
+  \doublecolumnhsize = \hsize
+    \advance\doublecolumnhsize by -.04154\hsize
+    \divide\doublecolumnhsize by 2
+  \hsize = \doublecolumnhsize
+  %
+  % Double the \vsize as well.  (We don't need a separate register here,
+  % since nobody clobbers \vsize.)
+  \advance\vsize by -\ht\partialpage
+  \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+% 
+\def\doublecolumnout{%
+  \splittopskip=\topskip \splitmaxdepth=\maxdepth
+  % Get the available space for the double columns -- the normal
+  % (undoubled) page height minus any material left over from the
+  % previous page.
+  \dimen@ = \vsize
+  \divide\dimen@ by 2
+  %
+  % box0 will be the left-hand column, box2 the right.
+  \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+  \onepageout\pagesofar
+  \unvbox255
+  \penalty\outputpenalty
+}
+\def\pagesofar{%
+  % Re-output the contents of the output page -- any previous material,
+  % followed by the two boxes we just split, in box0 and box2.
+  \advance\vsize by \ht\partialpage
+  \unvbox\partialpage
+  %
+  \hsize = \doublecolumnhsize
+  \wd0=\hsize \wd2=\hsize
+  \hbox to\pagewidth{\box0\hfil\box2}%
+}
+\def\enddoublecolumns{%
+  \output = {%
+    % Split the last of the double-column material.  Leave on the
+    % current page, no automatic page break.
+    \balancecolumns
+    %
+    % If we end up splitting too much material for the current page,
+    % though, there will be another page break right after this \output
+    % invocation ends.  Having called \balancecolumns once, we do not
+    % want to call it again.  Therefore, reset \output to its normal
+    % definition right away.  (We hope \balancecolumns will never be
+    % called on to balance too much material, but if it is, this makes
+    % the output somewhat more palatable.)
+    \global\output = {\onepageout{\pagecontents\PAGE}}%
+    %
+    % \pagegoal was set to the doubled \vsize above, since we restarted
+    % the current page.  We're now back to normal single-column
+    % typesetting, so reset \pagegoal to the normal \vsize.
+    \pagegoal = \vsize
+  }%
+  \eject
+  \endgroup % started in \begindoublecolumns
+}
+\def\balancecolumns{%
+  % Called at the end of the double column material.
+  \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+  \dimen@ = \ht0
+  \advance\dimen@ by \topskip
+  \advance\dimen@ by-\baselineskip
+  \divide\dimen@ by 2 % target to split to
+  %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+  \splittopskip = \topskip
+  % Loop until we get a decent breakpoint.
+  {%
+    \vbadness = 10000
+    \loop
+      \global\setbox3 = \copy0
+      \global\setbox1 = \vsplit3 to \dimen@
+    \ifdim\ht3>\dimen@
+      \global\advance\dimen@ by 1pt
+    \repeat
+  }%
+  %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+  \setbox0=\vbox to\dimen@{\unvbox1}%
+  \setbox2=\vbox to\dimen@{\unvbox3}%
+  %
+  \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Define chapters, sections, etc.
+
+\newcount\chapno
+\newcount\secno        \secno=0
+\newcount\subsecno     \subsecno=0
+\newcount\subsubsecno  \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno  \appendixno = `\@
+\def\appendixletter{\char\the\appendixno}
+
+% Each @chapter defines this as the name of the chapter.
+% page headings and footings can use it.  @section does likewise.
+\def\thischapter{}
+\def\thissection{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raise/lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% Choose a numbered-heading macro
+% #1 is heading level if unmodified by @raisesections or @lowersections
+% #2 is text for heading
+\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+  \chapterzzz{#2}
+\or
+  \seczzz{#2}
+\or
+  \numberedsubseczzz{#2}
+\or
+  \numberedsubsubseczzz{#2}
+\else
+  \ifnum \absseclevel<0
+    \chapterzzz{#2}
+  \else
+    \numberedsubsubseczzz{#2}
+  \fi
+\fi
+}
+
+% like \numhead, but chooses appendix heading levels
+\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+  \appendixzzz{#2}
+\or
+  \appendixsectionzzz{#2}
+\or
+  \appendixsubseczzz{#2}
+\or
+  \appendixsubsubseczzz{#2}
+\else
+  \ifnum \absseclevel<0
+    \appendixzzz{#2}
+  \else
+    \appendixsubsubseczzz{#2}
+  \fi
+\fi
+}
+
+% like \numhead, but chooses numberless heading levels
+\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+  \unnumberedzzz{#2}
+\or
+  \unnumberedseczzz{#2}
+\or
+  \unnumberedsubseczzz{#2}
+\or
+  \unnumberedsubsubseczzz{#2}
+\else
+  \ifnum \absseclevel<0
+    \unnumberedzzz{#2}
+  \else
+    \unnumberedsubsubseczzz{#2}
+  \fi
+\fi
+}
+
+% @chapter, @appendix, @unnumbered.
+\def\thischaptername{No Chapter Title}
+\outer\def\chapter{\parsearg\chapteryyy}
+\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
+\chapmacro {#1}{\the\chapno}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+% We don't substitute the actual chapter name into \thischapter
+% because we don't want its macros evaluated now.
+\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+                                  {\the\chapno}}}%
+\temp
+\donoderef
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\def\appendix{\parsearg\appendixyyy}
+\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \appendixno by 1
+\message{\putwordAppendix\space \appendixletter}%
+\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+                       {\putwordAppendix{} \appendixletter}}}%
+\temp
+\appendixnoderef
+\global\let\section = \appendixsec
+\global\let\subsection = \appendixsubsec
+\global\let\subsubsection = \appendixsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\def\centerchap{\parsearg\centerchapyyy}
+\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
+
+% @top is like @unnumbered.
+\outer\def\top{\parsearg\unnumberedyyy}
+
+\outer\def\unnumbered{\parsearg\unnumberedyyy}
+\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+%
+% This used to be simply \message{#1}, but TeX fully expands the
+% argument to \message.  Therefore, if #1 contained @-commands, TeX
+% expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
+% expanded @cite (which turns out to cause errors because \cite is meant
+% to be executed, not expanded).
+%
+% Anyway, we don't want the fully-expanded definition of @cite to appear
+% as a result of the \message, we just want `@cite' itself.  We use
+% \the<toks register> to achieve this: TeX expands \the<toks> only once,
+% simply yielding the contents of <toks register>.  (We also do this for
+% the toc entries.)
+\toks0 = {#1}\message{(\the\toks0)}%
+%
+\unnumbchapmacro {#1}%
+\gdef\thischapter{#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\global\let\section = \unnumberedsec
+\global\let\subsection = \unnumberedsubsec
+\global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% Sections.
+\outer\def\numberedsec{\parsearg\secyyy}
+\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
+\def\seczzz #1{%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+                                  {\the\chapno}{\the\secno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsection{\parsearg\appendixsecyyy}
+\outer\def\appendixsec{\parsearg\appendixsecyyy}
+\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz #1{%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+                                  {\appendixletter}{\the\secno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
+\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz #1{%
+\plainsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% Subsections.
+\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
+\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz #1{%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+                                    {\the\chapno}{\the\secno}{\the\subsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
+\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz #1{%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+                                {\appendixletter}{\the\secno}{\the\subsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
+\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz #1{%
+\plainsubsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
+                                    {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% Subsubsections.
+\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
+\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz #1{%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+  {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+  {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
+\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz #1{%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+  {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+  {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
+\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz #1{%
+\plainsubsubsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
+                                    {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% These are variants which are not "outer", so they can appear in @ifinfo.
+% Actually, they should now be obsolete; ordinary section commands should work.
+\def\infotop{\parsearg\unnumberedzzz}
+\def\infounnumbered{\parsearg\unnumberedzzz}
+\def\infounnumberedsec{\parsearg\unnumberedseczzz}
+\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
+\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
+
+\def\infoappendix{\parsearg\appendixzzz}
+\def\infoappendixsec{\parsearg\appendixseczzz}
+\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
+\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
+
+\def\infochapter{\parsearg\chapterzzz}
+\def\infosection{\parsearg\sectionzzz}
+\def\infosubsection{\parsearg\subsectionzzz}
+\def\infosubsubsection{\parsearg\subsubsectionzzz}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+% NOTE on use of \vbox for chapter headings, section headings, and such:
+%       1) We use \vbox rather than the earlier \line to permit
+%          overlong headings to fold.
+%       2) \hyphenpenalty is set to 10000 because hyphenation in a
+%          heading is obnoxious; this forbids it.
+%       3) Likewise, headings look best if no \parindent is used, and
+%          if justification is not attempted.  Hence \raggedright.
+
+
+\def\majorheading{\parsearg\majorheadingzzz}
+\def\majorheadingzzz #1{%
+{\advance\chapheadingskip by 10pt \chapbreak }%
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+                  \parindent=0pt\raggedright
+                  \rm #1\hfill}}\bigskip \par\penalty 200}
+
+\def\chapheading{\parsearg\chapheadingzzz}
+\def\chapheadingzzz #1{\chapbreak %
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+                  \parindent=0pt\raggedright
+                  \rm #1\hfill}}\bigskip \par\penalty 200}
+
+% @heading, @subheading, @subsubheading.
+\def\heading{\parsearg\plainsecheading}
+\def\subheading{\parsearg\plainsubsecheading}
+\def\subsubheading{\parsearg\plainsubsubsecheading}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+%%% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+
+%%% Define plain chapter starts, and page on/off switching for it
+% Parameter controlling skip before chapter headings (if needed)
+
+\newskip\chapheadingskip
+
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+\def\CHAPFplain{
+\global\let\chapmacro=\chfplain
+\global\let\unnumbchapmacro=\unnchfplain
+\global\let\centerchapmacro=\centerchfplain}
+
+% Plain chapter opening.
+% #1 is the text, #2 the chapter number or empty if unnumbered.
+\def\chfplain#1#2{%
+  \pchapsepmacro
+  {%
+    \chapfonts \rm
+    \def\chapnum{#2}%
+    \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
+    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+          \hangindent = \wd0 \centerparametersmaybe
+          \unhbox0 #1\par}%
+  }%
+  \nobreak\bigskip % no page break after a chapter title
+  \nobreak
+}
+
+% Plain opening for unnumbered.
+\def\unnchfplain#1{\chfplain{#1}{}}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerchfplain#1{{%
+  \def\centerparametersmaybe{%
+    \advance\rightskip by 3\rightskip
+    \leftskip = \rightskip
+    \parfillskip = 0pt
+  }%
+  \chfplain{#1}{}%
+}}
+
+\CHAPFplain % The default
+
+\def\unnchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+                       \parindent=0pt\raggedright
+                       \rm #1\hfill}}\bigskip \par\nobreak
+}
+
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+
+\def\centerchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+                       \parindent=0pt
+                       \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
+}
+
+\def\CHAPFopen{
+\global\let\chapmacro=\chfopen
+\global\let\unnumbchapmacro=\unnchfopen
+\global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles.
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
+\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
+\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
+
+% Subsection titles.
+\newskip \subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
+\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
+\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
+
+% Subsubsection titles.
+\let\subsubsecheadingskip = \subsecheadingskip
+\let\subsubsecheadingbreak = \subsecheadingbreak
+\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
+\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
+
+
+% Print any size section title.
+%
+% #1 is the section type (sec/subsec/subsubsec), #2 is the section
+% number (maybe empty), #3 the text.
+\def\sectionheading#1#2#3{%
+  {%
+    \expandafter\advance\csname #1headingskip\endcsname by \parskip
+    \csname #1headingbreak\endcsname
+  }%
+  {%
+    % Switch to the right set of fonts.
+    \csname #1fonts\endcsname \rm
+    %
+    % Only insert the separating space if we have a section number.
+    \def\secnum{#2}%
+    \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
+    %
+    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+          \hangindent = \wd0 % zero if no section number
+          \unhbox0 #3}%
+  }%
+  \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
+}
+
+
+\message{toc,}
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc.  We supply {\folio} at the end of the
+% argument, which will end up as the last argument to the \...entry macro.
+% 
+% We open the .toc file here instead of at @setfilename or any other
+% given time so that @contents can be put in the document anywhere.
+% 
+\newif\iftocfileopened
+\def\writetocentry#1{%
+  \iftocfileopened\else
+    \immediate\openout\tocfile = \jobname.toc
+    \global\tocfileopenedtrue
+  \fi
+  \iflinks \write\tocfile{#1{\folio}}\fi
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Finish up the main text and prepare to read what we've written
+% to \tocfile.
+% 
+\def\startcontents#1{%
+   % If @setchapternewpage on, and @headings double, the contents should
+   % start on an odd page, unlike chapters.  Thus, we maintain
+   % \contentsalignmacro in parallel with \pagealignmacro.
+   % From: Torbjorn Granlund <tege@matematik.su.se>
+   \contentsalignmacro
+   \immediate\closeout\tocfile
+   %
+   % Don't need to put `Contents' or `Short Contents' in the headline.
+   % It is abundantly clear what they are.
+   \unnumbchapmacro{#1}\def\thischapter{}%
+   \savepageno = \pageno
+   \begingroup                  % Set up to handle contents files properly.
+      \catcode`\\=0  \catcode`\{=1  \catcode`\}=2  \catcode`\@=11
+      % We can't do this, because then an actual ^ in a section
+      % title fails, e.g., @chapter ^ -- exponentiation.  --karl, 9jul97.
+      %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
+      \raggedbottom             % Worry more about breakpoints than the bottom.
+      \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+      %
+      % Roman numerals for page numbers.
+      \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
+}
+
+
+% Normal (long) toc.
+\def\contents{%
+   \startcontents{\putwordTableofContents}%
+     \openin 1 \jobname.toc
+     \ifeof 1 \else
+       \closein 1
+       \input \jobname.toc
+     \fi
+     \vfill \eject
+   \endgroup
+   \lastnegativepageno = \pageno
+   \pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+   \startcontents{\putwordShortContents}%
+      %
+      \let\chapentry = \shortchapentry
+      \let\unnumbchapentry = \shortunnumberedentry
+      % We want a true roman here for the page numbers.
+      \secfonts
+      \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
+      \rm
+      \hyphenpenalty = 10000
+      \advance\baselineskip by 1pt % Open it up a little.
+      \def\secentry ##1##2##3##4{}
+      \def\unnumbsecentry ##1##2{}
+      \def\subsecentry ##1##2##3##4##5{}
+      \def\unnumbsubsecentry ##1##2{}
+      \def\subsubsecentry ##1##2##3##4##5##6{}
+      \def\unnumbsubsubsecentry ##1##2{}
+      \openin 1 \jobname.toc
+      \ifeof 1 \else
+        \closein 1
+        \input \jobname.toc
+      \fi
+     \vfill \eject
+   \endgroup
+   \lastnegativepageno = \pageno
+   \pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Chapter-level things, for both the long and short contents.
+\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
+
+% See comments in \dochapentry re vbox and related settings
+\def\shortchapentry#1#2#3{%
+  \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
+}
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
+% We could simplify the code here by writing out an \appendixentry
+% command in the toc file for appendices, instead of using \chapentry
+% for both, but it doesn't seem worth it.
+\setbox0 = \hbox{\shortcontrm \putwordAppendix }
+\newdimen\shortappendixwidth \shortappendixwidth = \wd0
+
+\def\shortchaplabel#1{%
+  % We typeset #1 in a box of constant width, regardless of the text of
+  % #1, so the chapter titles will come out aligned.
+  \setbox0 = \hbox{#1}%
+  \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
+  %
+  % This space should be plenty, since a single number is .5em, and the
+  % widest letter (M) is 1em, at least in the Computer Modern fonts.
+  % (This space doesn't include the extra space that gets added after
+  % the label; that gets put in by \shortchapentry above.)
+  \advance\dimen0 by 1.1em
+  \hbox to \dimen0{#1\hfil}%
+}
+
+\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
+\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
+
+% Sections.
+\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
+\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
+
+% Subsections.
+\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
+\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
+
+% And subsubsections.
+\def\subsubsecentry#1#2#3#4#5#6{%
+  \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
+\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
+
+% This parameter controls the indentation of the various levels.
+\newdimen\tocindent \tocindent = 3pc
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+   \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+   \begingroup
+     \chapentryfonts
+     \tocentry{#1}{\dopageno{#2}}%
+   \endgroup
+   \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+  \secentryfonts \leftskip=\tocindent
+  \tocentry{#1}{\dopageno{#2}}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+  \subsecentryfonts \leftskip=2\tocindent
+  \tocentry{#1}{\dopageno{#2}}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+  \subsubsecentryfonts \leftskip=3\tocindent
+  \tocentry{#1}{\dopageno{#2}}%
+\endgroup}
+
+% Final typesetting of a toc entry; we use the same \entry macro as for
+% the index entries, but we want to suppress hyphenation here.  (We
+% can't do that in the \entry macro, since index entries might consist
+% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
+\def\tocentry#1#2{\begingroup
+  \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
+  % Do not use \turnoffactive in these arguments.  Since the toc is
+  % typeset in cmr, so characters such as _ would come out wrong; we
+  % have to do the usual translation tricks.
+  \entry{#1}{#2}%
+\endgroup}
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\let\subsecentryfonts = \textfonts
+\let\subsubsecentryfonts = \textfonts
+
+
+\message{environments,}
+
+% Since these characters are used in examples, it should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+% Furthermore, these definitions must come after we define our fonts.
+\newbox\dblarrowbox    \newbox\longdblarrowbox
+\newbox\pushcharbox    \newbox\bullbox
+\newbox\equivbox       \newbox\errorbox
+
+%{\tentt
+%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
+%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
+%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
+%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
+% Adapted from the manmac format (p.420 of TeXbook)
+%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
+%                                      depth .1ex\hfil}
+%}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+\def\point{$\star$}
+\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% Adapted from the TeXbook's \boxit.
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
+
+\global\setbox\errorbox=\hbox to \dimen0{\hfil
+   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+   \advance\hsize by -2\dimen2 % Rules.
+   \vbox{
+      \hrule height\dimen2
+      \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
+         \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+         \kern3pt\vrule width\dimen2}% Space to right.
+      \hrule height\dimen2}
+    \hfil}
+
+% The @error{} command.
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @tex ... @end tex    escapes into raw Tex temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain tex @ character.
+
+\def\tex{\begingroup
+  \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+  \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+  \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+  \catcode `\%=14
+  \catcode 43=12 % plus
+  \catcode`\"=12
+  \catcode`\==12
+  \catcode`\|=12
+  \catcode`\<=12
+  \catcode`\>=12
+  \escapechar=`\\
+  %
+  \let\b=\ptexb
+  \let\bullet=\ptexbullet
+  \let\c=\ptexc
+  \let\,=\ptexcomma
+  \let\.=\ptexdot
+  \let\dots=\ptexdots
+  \let\equiv=\ptexequiv
+  \let\!=\ptexexclam
+  \let\i=\ptexi
+  \let\{=\ptexlbrace
+  \let\+=\tabalign
+  \let\}=\ptexrbrace
+  \let\*=\ptexstar
+  \let\t=\ptext
+  %
+  \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+  \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+  \def\@{@}%
+\let\Etex=\endgroup}
+
+% Define @lisp ... @endlisp.
+% @lisp does a \begingroup so it can rebind things,
+% including the definition of @endlisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments.  \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% Make each space character in the input produce a normal interword
+% space in the output.  Don't allow a line break at this space, as this
+% is used only in environments like @example, where each line of input
+% should produce a line of output anyway.
+%
+{\obeyspaces %
+\gdef\sepspaces{\obeyspaces\let =\tie}}
+
+% Define \obeyedspace to be our active space, whatever it is.  This is
+% for use in \parsearg.
+{\sepspaces%
+\global\let\obeyedspace= }
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical.  We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip
+%
+\def\aboveenvbreak{{\advance\envskipamount by \parskip
+\endgraf \ifdim\lastskip<\envskipamount
+\removelastskip \penalty-50 \vskip\envskipamount \fi}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+        \ctl\leaders\hrule height\circthick\hfil\ctr
+        \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+        \cbl\leaders\hrule height\circthick\hfil\cbr
+        \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\long\def\cartouche{%
+\begingroup
+        \lskip=\leftskip \rskip=\rightskip
+        \leftskip=0pt\rightskip=0pt %we want these *outside*.
+        \cartinner=\hsize \advance\cartinner by-\lskip
+                          \advance\cartinner by-\rskip
+        \cartouter=\hsize
+        \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+%                                    side, and for 6pt waste from
+%                                    each corner char, and rule thickness
+        \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+        % Flag to tell @lisp, etc., not to narrow margin.
+        \let\nonarrowing=\comment
+        \vbox\bgroup
+                \baselineskip=0pt\parskip=0pt\lineskip=0pt
+                \carttop
+                \hbox\bgroup
+                        \hskip\lskip
+                        \vrule\kern3pt
+                        \vbox\bgroup
+                                \hsize=\cartinner
+                                \kern3pt
+                                \begingroup
+                                        \baselineskip=\normbskip
+                                        \lineskip=\normlskip
+                                        \parskip=\normpskip
+                                        \vskip -\parskip
+\def\Ecartouche{%
+                                \endgroup
+                                \kern3pt
+                        \egroup
+                        \kern3pt\vrule
+                        \hskip\rskip
+                \egroup
+                \cartbot
+        \egroup
+\endgroup
+}}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\def\nonfillstart{%
+  \aboveenvbreak
+  \inENV % This group ends at the end of the body
+  \hfuzz = 12pt % Don't be fussy
+  \sepspaces % Make spaces be word-separators rather than space tokens.
+  \singlespace
+  \let\par = \lisppar % don't ignore blank lines
+  \obeylines % each line of input is a line of output
+  \parskip = 0pt
+  \parindent = 0pt
+  \emergencystretch = 0pt % don't try to avoid overfull boxes
+  % @cartouche defines \nonarrowing to inhibit narrowing
+  % at next level down.
+  \ifx\nonarrowing\relax
+    \advance \leftskip by \lispnarrowing
+    \exdentamount=\lispnarrowing
+    \let\exdent=\nofillexdent
+    \let\nonarrowing=\relax
+  \fi
+}
+
+% Define the \E... control sequence only if we are inside the particular
+% environment, so the error checking in \end will work.
+% 
+% To end an @example-like environment, we first end the paragraph (via
+% \afterenvbreak's vertical glue), and then the group.  That way we keep
+% the zero \parskip that the environments set -- \parskip glue will be
+% inserted at the beginning of the next paragraph in the document, after
+% the environment.
+%
+\def\nonfillfinish{\afterenvbreak\endgroup}
+
+% @lisp: indented, narrowed, typewriter font.
+\def\lisp{\begingroup
+  \nonfillstart
+  \let\Elisp = \nonfillfinish
+  \tt
+  \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+  \gobble       % eat return
+}
+
+% @example: Same as @lisp.
+\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
+
+% @small... is usually equivalent to the non-small (@smallbook
+% redefines).  We must call \example (or whatever) last in the
+% definition, since it reads the return following the @example (or
+% whatever) command.
+% 
+% This actually allows (for example) @end display inside an
+% @smalldisplay.  Too bad, but makeinfo will catch the error anyway.
+%
+\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
+\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
+\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
+\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
+
+% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
+% Originally contributed by Pavel@xerox.
+\def\smalllispx{\begingroup
+  \def\Esmalllisp{\nonfillfinish\endgroup}%
+  \def\Esmallexample{\nonfillfinish\endgroup}%
+  \indexfonts
+  \lisp
+}
+
+% @display: same as @lisp except keep current font.
+%
+\def\display{\begingroup
+  \nonfillstart
+  \let\Edisplay = \nonfillfinish
+  \gobble
+}
+
+% @smalldisplay (when @smallbook): @display plus smaller fonts.
+%
+\def\smalldisplayx{\begingroup
+  \def\Esmalldisplay{\nonfillfinish\endgroup}%
+  \indexfonts \rm
+  \display
+}
+
+% @format: same as @display except don't narrow margins.
+%
+\def\format{\begingroup
+  \let\nonarrowing = t
+  \nonfillstart
+  \let\Eformat = \nonfillfinish
+  \gobble
+}
+
+% @smallformat (when @smallbook): @format plus smaller fonts.
+%
+\def\smallformatx{\begingroup
+  \def\Esmallformat{\nonfillfinish\endgroup}%
+  \indexfonts \rm
+  \format
+}
+
+% @flushleft (same as @format).
+%
+\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
+
+% @flushright.
+% 
+\def\flushright{\begingroup
+  \let\nonarrowing = t
+  \nonfillstart
+  \let\Eflushright = \nonfillfinish
+  \advance\leftskip by 0pt plus 1fill
+  \gobble
+}
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins.
+%
+\def\quotation{%
+  \begingroup\inENV %This group ends at the end of the @quotation body
+  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+  \singlespace
+  \parindent=0pt
+  % We have retained a nonzero parskip for the environment, since we're
+  % doing normal filling. So to avoid extra space below the environment...
+  \def\Equotation{\parskip = 0pt \nonfillfinish}%
+  %
+  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+  \ifx\nonarrowing\relax
+    \advance\leftskip by \lispnarrowing
+    \advance\rightskip by \lispnarrowing
+    \exdentamount = \lispnarrowing
+    \let\nonarrowing = \relax
+  \fi
+}
+
+
+\message{defuns,}
+% Define formatter for defuns
+% First, allow user to change definition object font (\df) internally
+\def\setdeffont #1 {\csname DEF#1\endcsname}
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deftypemargin \deftypemargin=12pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+
+\newcount\parencount
+% define \functionparens, which makes ( and ) and & do special things.
+% \functionparens affects the group it is contained in.
+\def\activeparens{%
+\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
+\catcode`\[=\active \catcode`\]=\active}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
+
+% Be sure that we always have a definition for `(', etc.  For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+\global\let(=\lparen \global\let)=\rparen
+\global\let[=\lbrack \global\let]=\rbrack
+
+\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
+\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+% This is used to turn on special parens
+% but make & act ordinary (given that it's active).
+\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
+
+% Definitions of (, ) and & used in args for functions.
+% This is the definition of ( outside of all parentheses.
+\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
+  \global\advance\parencount by 1
+}
+%
+% This is the definition of ( when already inside a level of parens.
+\gdef\opnested{\char`\(\global\advance\parencount by 1 }
+%
+\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
+  % also in that case restore the outer-level definition of (.
+  \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
+  \global\advance \parencount by -1 }
+% If we encounter &foo, then turn on ()-hacking afterwards
+\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
+%
+\gdef\normalparens{\boldbrax\let&=\ampnr}
+} % End of definition inside \activeparens
+%% These parens (in \boldbrax) actually are a little bolder than the
+%% contained text.  This is especially needed for [ and ]
+\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
+\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
+\def\ampnr{\&}
+\def\lbrb{{\bf\char`\[}}
+\def\rbrb{{\bf\char`\]}}
+
+% First, defname, which formats the header line itself.
+% #1 should be the function name.
+% #2 should be the type of definition, such as "Function".
+
+\def\defname #1#2{%
+% Get the values of \leftskip and \rightskip as they were
+% outside the @def...
+\dimen2=\leftskip
+\advance\dimen2 by -\defbodyindent
+\noindent
+\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
+\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
+\parshape 2 0in \dimen0 \defargsindent \dimen1
+% Now output arg 2 ("Function" or some such)
+% ending at \deftypemargin from the right margin,
+% but stuck inside a box of width 0 so it does not interfere with linebreaking
+{% Adjust \hsize to exclude the ambient margins,
+% so that \rightline will obey them.
+\advance \hsize by -\dimen2
+\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
+% Make all lines underfull and no complaints:
+\tolerance=10000 \hbadness=10000
+\advance\leftskip by -\defbodyindent
+\exdentamount=\defbodyindent
+{\df #1}\enskip        % Generate function name
+}
+
+% Actually process the body of a definition
+% #1 should be the terminating control sequence, such as \Edefun.
+% #2 should be the "another name" control sequence, such as \defunx.
+% #3 should be the control sequence that actually processes the header,
+%    such as \defunheader.
+
+\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active % 61 is `='
+\obeylines\activeparens\spacesplit#3}
+
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by the space, is the class name.
+% 
+\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
+
+% @deftypemethod has an extra argument that nothing else does.  Sigh.
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by the space, is the class name.
+% #5 is the method's return type.
+% 
+\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
+
+\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
+
+% These parsing functions are similar to the preceding ones
+% except that they do not make parens into active characters.
+% These are used for "variables" since they have no arguments.
+
+\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active %
+\obeylines\spacesplit#3}
+
+% This is used for \def{tp,vr}parsebody.  It could probably be used for
+% some of the others, too, with some judicious conditionals.
+%
+\def\parsebodycommon#1#2#3{%
+  \begingroup\inENV %
+  \medbreak %
+  % Define the end token that this defining construct specifies
+  % so that it will exit this group.
+  \def#1{\endgraf\endgroup\medbreak}%
+  \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
+  \parindent=0in
+  \advance\leftskip by \defbodyindent
+  \exdentamount=\defbodyindent
+  \begingroup\obeylines
+}
+
+\def\defvrparsebody#1#2#3#4 {%
+  \parsebodycommon{#1}{#2}{#3}%
+  \spacesplit{#3{#4}}%
+}
+
+% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
+% type is just `struct', because we lose the braces in `{struct
+% termios}' when \spacesplit reads its undelimited argument.  Sigh.
+% \let\deftpparsebody=\defvrparsebody
+%
+% So, to get around this, we put \empty in with the type name.  That
+% way, TeX won't find exactly `{...}' as an undelimited argument, and
+% won't strip off the braces.
+%
+\def\deftpparsebody #1#2#3#4 {%
+  \parsebodycommon{#1}{#2}{#3}%
+  \spacesplit{\parsetpheaderline{#3{#4}}}\empty
+}
+
+% Fine, but then we have to eventually remove the \empty *and* the
+% braces (if any).  That's what this does.
+%
+\def\removeemptybraces\empty#1\relax{#1}
+
+% After \spacesplit has done its work, this is called -- #1 is the final
+% thing to call, #2 the type name (which starts with \empty), and #3
+% (which might be empty) the arguments.
+%
+\def\parsetpheaderline#1#2#3{%
+  #1{\removeemptybraces#2\relax}{#3}%
+}%
+
+\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\spacesplit{#3{#5}}}
+
+% Split up #2 at the first space token.
+% call #1 with two arguments:
+%  the first is all of #2 before the space token,
+%  the second is all of #2 after that space token.
+% If #2 contains no space token, all of it is passed as the first arg
+% and the second is passed as empty.
+
+{\obeylines
+\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
+\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
+\ifx\relax #3%
+#1{#2}{}\else #1{#2}{#3#4}\fi}}
+
+% So much for the things common to all kinds of definitions.
+
+% Define @defun.
+
+% First, define the processing that is wanted for arguments of \defun
+% Use this to expand the args and terminate the paragraph they make up
+
+\def\defunargs #1{\functionparens \sl
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+\hyphenchar\tensl=0
+#1%
+\hyphenchar\tensl=45
+\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\nobreak\vskip -\parskip\nobreak
+}
+
+\def\deftypefunargs #1{%
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+% Use \boldbraxnoamp, not \functionparens, so that & is not special.
+\boldbraxnoamp
+\tclose{#1}% avoid \code because of side effects on active chars
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\nobreak\vskip -\parskip\nobreak
+}
+
+% Do complete processing of one @defun or @defunx line already parsed.
+
+% @deffn Command forward-char nchars
+
+\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
+
+\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defun == @deffn Function
+
+\def\defun{\defparsebody\Edefun\defunx\defunheader}
+
+\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{Function}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefun int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
+
+% #1 is the data type.  #2 is the name and args.
+\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
+% #1 is the data type, #2 the name, #3 the args.
+\def\deftypefunheaderx #1#2 #3\relax{%
+\doind {fn}{\code{#2}}% Make entry in function index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
+\deftypefunargs {#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
+
+% \defheaderxcond#1\relax$$$
+% puts #1 in @code, followed by a space, but does nothing if #1 is null.
+\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
+
+% #1 is the classification.  #2 is the data type.  #3 is the name and args.
+\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
+% #1 is the classification, #2 the data type, #3 the name, #4 the args.
+\def\deftypefnheaderx #1#2#3 #4\relax{%
+\doind {fn}{\code{#3}}% Make entry in function index
+\begingroup
+\normalparens % notably, turn off `&' magic, which prevents
+%               at least some C++ text from working
+\defname {\defheaderxcond#2\relax$$$#3}{#1}%
+\deftypefunargs {#4}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defmac == @deffn Macro
+
+\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
+
+\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{Macro}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defspec == @deffn Special Form
+
+\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
+
+\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{Special Form}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% This definition is run if you use @defunx
+% anywhere other than immediately after a @defun or @defunx.
+
+\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
+\def\defunx #1 {\errmessage{@defunx in invalid context}}
+\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
+\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
+\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
+\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
+\def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}}
+
+% @defmethod, and so on
+
+% @defop CATEGORY CLASS OPERATION ARG...
+
+\def\defop #1 {\def\defoptype{#1}%
+\defopparsebody\Edefop\defopx\defopheader\defoptype}
+
+\def\defopheader #1#2#3{%
+\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
+\begingroup\defname {#2}{\defoptype{} on #1}%
+\defunargs {#3}\endgroup %
+}
+
+% @deftypemethod CLASS RETURN-TYPE METHOD ARG...
+%
+\def\deftypemethod{%
+  \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
+%
+% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
+\def\deftypemethodheader#1#2#3#4{%
+  \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+  \begingroup
+    \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
+    \deftypefunargs{#4}%
+  \endgroup
+}
+
+% @defmethod == @defop Method
+%
+\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
+%
+% #1 is the class name, #2 the method name, #3 the args.
+\def\defmethodheader#1#2#3{%
+  \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
+  \begingroup
+    \defname{#2}{\putwordMethodon\ \code{#1}}%
+    \defunargs{#3}%
+  \endgroup
+}
+
+% @defcv {Class Option} foo-class foo-flag
+
+\def\defcv #1 {\def\defcvtype{#1}%
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
+
+\def\defcvarheader #1#2#3{%
+\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
+\begingroup\defname {#2}{\defcvtype{} of #1}%
+\defvarargs {#3}\endgroup %
+}
+
+% @defivar == @defcv {Instance Variable}
+
+\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
+
+\def\defivarheader #1#2#3{%
+\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
+\begingroup\defname {#2}{Instance Variable of #1}%
+\defvarargs {#3}\endgroup %
+}
+
+% These definitions are run if you use @defmethodx, etc.,
+% anywhere other than immediately after a @defmethod, etc.
+
+\def\defopx #1 {\errmessage{@defopx in invalid context}}
+\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
+\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
+\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
+
+% Now @defvar
+
+% First, define the processing that is wanted for arguments of @defvar.
+% This is actually simple: just print them in roman.
+% This must expand the args and terminate the paragraph they make up
+\def\defvarargs #1{\normalparens #1%
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak}
+
+% @defvr Counter foo-count
+
+\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
+
+\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
+
+% @defvar == @defvr Variable
+
+\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
+
+\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{Variable}%
+\defvarargs {#2}\endgroup %
+}
+
+% @defopt == @defvr {User Option}
+
+\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
+
+\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{User Option}%
+\defvarargs {#2}\endgroup %
+}
+
+% @deftypevar int foobar
+
+\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
+
+% #1 is the data type.  #2 is the name, perhaps followed by text that
+% is actually part of the data type, which should not be put into the index.
+\def\deftypevarheader #1#2{%
+\dovarind#2 \relax% Make entry in variables index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak
+\endgroup}
+\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
+
+% @deftypevr {Global Flag} int enable
+
+\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
+
+\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
+\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak
+\endgroup}
+
+% This definition is run if you use @defvarx
+% anywhere other than immediately after a @defvar or @defvarx.
+
+\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
+\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
+\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
+\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
+\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
+
+% Now define @deftp
+% Args are printed in bold, a slight difference from @defvar.
+
+\def\deftpargs #1{\bf \defvarargs{#1}}
+
+% @deftp Class window height width ...
+
+\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
+
+\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
+\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
+
+% This definition is run if you use @deftpx, etc
+% anywhere other than immediately after a @deftp, etc.
+
+\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens, 
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scanmacro#1{%
+   \begingroup \newlinechar`\^^M
+   \immediate\openout\macscribble=\jobname.tmp
+   \immediate\write\macscribble{#1}%
+   \immediate\closeout\macscribble
+   \let\xeatspaces\eatspaces
+   \input \jobname.tmp
+   \endgroup
+}
+\else
+\def\scanmacro#1{%
+\begingroup \newlinechar`\^^M
+\let\xeatspaces\eatspaces\scantokens{#1}\endgroup}
+\fi
+
+\newcount\paramno   % Count of parameters
+\newtoks\macname    % Macro name
+\newif\ifrecursive  % Is it recursive?
+
+% Utility routines.
+% Thisdoes \let #1 = #2, except with \csnames.
+\def\cslet#1#2{%
+\expandafter\expandafter
+\expandafter\let
+\expandafter\expandafter
+\csname#1\endcsname
+\csname#2\endcsname}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=12\catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% It's necessary to have hard CRs when the macro is executed. This is 
+% done by  making ^^M (\endlinechar) catcode 12 when reading the macro 
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\macrobodyctxt{%
+  \catcode`\~=12
+  \catcode`\^=12
+  \catcode`\_=12
+  \catcode`\|=12
+  \catcode`\<=12
+  \catcode`\>=12
+  \catcode`\+=12
+  \catcode`\{=12
+  \catcode`\}=12
+  \catcode`\@=12
+  \catcode`\^^M=12
+  \usembodybackslash}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N 
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+  \getargs{#1}%           now \macname is the macname and \argl the arglist
+  \ifx\argl\empty       % no arguments
+     \paramno=0%
+  \else
+     \expandafter\parsemargdef \argl;% 
+  \fi
+  \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
+     \cslet{macsave.\the\macname}{\the\macname}%
+  \else
+     \message{Warning: redefining \the\macname}%
+  \fi
+  \begingroup \macrobodyctxt
+  \ifrecursive \expandafter\parsermacbody
+  \else \expandafter\parsemacbody 
+  \fi}
+
+\def\unmacro{\parsearg\unmacroxxx}
+\def\unmacroxxx#1{%
+  \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
+    \errmessage{Macro \the\macname\ not defined.}%
+  \else
+    \cslet{#1}{macsave.#1}%
+    \expandafter\let \csname macsave.\the\macname\endcsname \undefined
+  \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list.  Set up \paramno and \paramlist
+% so \defmacro knows what to do.  Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX:  let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+        \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+  \if#1;\let\next=\relax
+  \else \let\next=\parsemargdefxxx
+    \advance\paramno by 1%
+    \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+        {\xeatspaces{\hash\the\paramno}}%
+    \edef\paramlist{\paramlist\hash\the\paramno,}%
+  \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+  \let\hash=##% convert placeholders to macro parameter chars
+  \ifrecursive
+    \ifcase\paramno
+    % 0
+      \expandafter\xdef\csname\the\macname\endcsname{%
+        \noexpand\scanmacro{\temp}}%
+    \or % 1
+      \expandafter\xdef\csname\the\macname\endcsname{%
+         \noexpand\braceorline\csname\the\macname xxx\endcsname}%
+      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+         \noexpand\scanmacro{\temp}}%
+    \else % many
+      \expandafter\xdef\csname\the\macname\endcsname##1{%
+          \csname\the\macname xxx\endcsname ##1,}%
+      \expandafter\expandafter
+      \expandafter\xdef
+      \expandafter\expandafter
+        \csname\the\macname xxx\endcsname 
+          \paramlist{\noexpand\scanmacro{\temp}}%
+    \fi
+  \else
+    \ifcase\paramno
+    % 0
+      \expandafter\xdef\csname\the\macname\endcsname{%
+        \noexpand\norecurse{\the\macname}%
+        \noexpand\scanmacro{\temp}\egroup}%
+    \or % 1
+      \expandafter\xdef\csname\the\macname\endcsname{%
+         \noexpand\braceorline\csname\the\macname xxx\endcsname}%
+      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+        \noexpand\norecurse{\the\macname}%
+        \noexpand\scanmacro{\temp}\egroup}%
+    \else % many
+      \expandafter\xdef\csname\the\macname\endcsname##1{%
+          \csname\the\macname xxx\endcsname ##1,}%
+      \expandafter\expandafter
+      \expandafter\xdef
+      \expandafter\expandafter
+      \csname\the\macname xxx\endcsname
+      \paramlist{%
+          \noexpand\norecurse{\the\macname}%
+          \noexpand\scanmacro{\temp}\egroup}%
+    \fi
+  \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {.  If so it reads up to the closing }, if not, it reads the whole
+% line.  Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+  \ifx\nchar\bgroup\else
+    \expandafter\parsearg 
+  \fi \next}
+
+
+\message{cross references,}
+\newwrite\auxfile
+
+\newif\ifhavexrefs    % True if xref values are known.
+\newif\ifwarnedxrefs  % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+  node \samp{\ignorespaces#1{}}}
+
+% @node's job is to define \lastnode.
+\def\node{\ENVcheck\parsearg\nodezzz}
+\def\nodezzz#1{\nodexxx [#1,]}
+\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+\let\nwnode=\node
+\let\lastnode=\relax
+
+% The sectioning commands (@chapter, etc.) call these.
+\def\donoderef{%
+  \ifx\lastnode\relax\else
+    \expandafter\expandafter\expandafter\setref{\lastnode}%
+      {Ysectionnumberandtype}%
+    \global\let\lastnode=\relax
+  \fi
+}
+\def\unnumbnoderef{%
+  \ifx\lastnode\relax\else
+    \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
+    \global\let\lastnode=\relax
+  \fi
+}
+\def\appendixnoderef{%
+  \ifx\lastnode\relax\else
+    \expandafter\expandafter\expandafter\setref{\lastnode}%
+      {Yappendixletterandtype}%
+    \global\let\lastnode=\relax
+  \fi
+}
+
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+% 
+\def\anchor#1{\setref{#1}{Ynothing}}
+
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
+% NAME-title, NAME-pg, and NAME-SNT.  Called from \foonoderef.  We have
+% to set \indexdummies so commands such as @code in a section title
+% aren't expanded.  It would be nicer not to expand the titles in the
+% first place, but there's so many layers that that is hard to do.
+% 
+\def\setref#1#2{{%
+  \indexdummies
+  \dosetq{#1-title}{Ytitle}%
+  \dosetq{#1-pg}{Ypagenumber}%
+  \dosetq{#1-snt}{#2}
+}}
+
+% @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual.  All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+  \def\printedmanual{\ignorespaces #5}%
+  \def\printednodename{\ignorespaces #3}%
+  \setbox1=\hbox{\printedmanual}%
+  \setbox0=\hbox{\printednodename}%
+  \ifdim \wd0 = 0pt
+    % No printed node name was explicitly given.
+    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
+      % Use the node name inside the square brackets.
+      \def\printednodename{\ignorespaces #1}%
+    \else
+      % Use the actual chapter/section title appear inside
+      % the square brackets.  Use the real section title if we have it.
+      \ifdim \wd1 > 0pt
+        % It is in another manual, so we don't have it.
+        \def\printednodename{\ignorespaces #1}%
+      \else
+        \ifhavexrefs
+          % We know the real title if we have the xref values.
+          \def\printednodename{\refx{#1-title}{}}%
+        \else
+          % Otherwise just copy the Info node name.
+          \def\printednodename{\ignorespaces #1}%
+        \fi%
+      \fi
+    \fi
+  \fi
+  %
+  % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+  % insert empty discretionaries after hyphens, which means that it will
+  % not find a line break at a hyphen in a node names.  Since some manuals
+  % are best written with fairly long node names, containing hyphens, this
+  % is a loss.  Therefore, we give the text of the node name again, so it
+  % is as if TeX is seeing it for the first time.
+  \ifdim \wd1 > 0pt
+    \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
+  \else
+    % _ (for example) has to be the character _ for the purposes of the
+    % control sequence corresponding to the node, but it has to expand
+    % into the usual \leavevmode...\vrule stuff for purposes of
+    % printing. So we \turnoffactive for the \refx-snt, back on for the
+    % printing, back off for the \refx-pg.
+    {\normalturnoffactive
+     % Only output a following space if the -snt ref is nonempty; for
+     % @unnumbered and @anchor, it won't be.
+     \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+     \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+    }%
+    % [mynode], 
+    [\printednodename],\space
+    % page 3
+    \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+  \fi
+\endgroup}
+
+% \dosetq is the interface for calls from other macros
+
+% Use \normalturnoffactive so that punctuation chars such as underscore
+% and backslash work in node names.  (\turnoffactive doesn't do \.)
+\def\dosetq#1#2{%
+  {\let\folio=0
+   \normalturnoffactive
+   \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
+   \iflinks
+     \next
+   \fi
+  }%
+}
+
+% \internalsetq {foo}{page} expands into
+% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
+% When the aux file is read, ' is the escape character
+
+\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
+
+% Things to be expanded by \internalsetq
+
+\def\Ypagenumber{\folio}
+
+\def\Ytitle{\thissection}
+
+\def\Ynothing{}
+
+\def\Ysectionnumberandtype{%
+\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
+\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\def\Yappendixletterandtype{%
+\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
+\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\gdef\xreftie{'tie}
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+  \let\linenumber = \empty % Non-3.0.
+\else
+  \def\linenumber{\the\inputlineno:\space}
+\fi
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+
+\def\refx#1#2{%
+  \expandafter\ifx\csname X#1\endcsname\relax
+    % If not defined, say something at least.
+    \angleleft un\-de\-fined\angleright
+    \iflinks
+      \ifhavexrefs
+        \message{\linenumber Undefined cross reference `#1'.}%
+      \else
+        \ifwarnedxrefs\else
+          \global\warnedxrefstrue
+          \message{Cross reference values unknown; you must run TeX again.}%
+        \fi
+      \fi
+    \fi
+  \else
+    % It's defined, so just use it.
+    \csname X#1\endcsname
+  \fi
+  #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file.
+% 
+\def\xrdef#1{\begingroup
+  % Reenable \ as an escape while reading the second argument.
+  \catcode`\\ = 0
+  \afterassignment\endgroup
+  \expandafter\gdef\csname X#1\endcsname
+}
+
+% Read the last existing aux file, if any.  No error if none exists.
+\def\readauxfile{\begingroup
+  \catcode`\^^@=\other
+  \catcode`\^^A=\other
+  \catcode`\^^B=\other
+  \catcode`\^^C=\other
+  \catcode`\^^D=\other
+  \catcode`\^^E=\other
+  \catcode`\^^F=\other
+  \catcode`\^^G=\other
+  \catcode`\^^H=\other
+  \catcode`\^^K=\other
+  \catcode`\^^L=\other
+  \catcode`\^^N=\other
+  \catcode`\^^P=\other
+  \catcode`\^^Q=\other
+  \catcode`\^^R=\other
+  \catcode`\^^S=\other
+  \catcode`\^^T=\other
+  \catcode`\^^U=\other
+  \catcode`\^^V=\other
+  \catcode`\^^W=\other
+  \catcode`\^^X=\other
+  \catcode`\^^Z=\other
+  \catcode`\^^[=\other
+  \catcode`\^^\=\other
+  \catcode`\^^]=\other
+  \catcode`\^^^=\other
+  \catcode`\^^_=\other
+  \catcode`\@=\other
+  \catcode`\^=\other
+  % It was suggested to define this as 7, which would allow ^^e4 etc.
+  % in xref tags, i.e., node names.  But since ^^e4 notation isn't
+  % supported in the main text, it doesn't seem desirable.  Furthermore,
+  % that is not enough: for node names that actually contain a ^
+  % character, we would end up writing a line like this: 'xrdef {'hat
+  % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+  % argument, and \hat is not an expandable control sequence.  It could
+  % all be worked out, but why?  Either we support ^^ or we don't.
+  %
+  % The other change necessary for this was to define \auxhat:
+  % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+  % and then to call \auxhat in \setq.
+  %
+  \catcode`\~=\other
+  \catcode`\[=\other
+  \catcode`\]=\other
+  \catcode`\"=\other
+  \catcode`\_=\other
+  \catcode`\|=\other
+  \catcode`\<=\other
+  \catcode`\>=\other
+  \catcode`\$=\other
+  \catcode`\#=\other
+  \catcode`\&=\other
+  \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+  % Make the characters 128-255 be printing characters
+  {%
+    \count 1=128
+    \def\loop{%
+      \catcode\count 1=\other
+      \advance\count 1 by 1
+      \ifnum \count 1<256 \loop \fi
+    }%
+  }%
+  % The aux file uses ' as the escape (for now).
+  % Turn off \ as an escape so we do not lose on
+  % entries which were dumped with control sequences in their names.
+  % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
+  % Reference to such entries still does not work the way one would wish,
+  % but at least they do not bomb out when the aux file is read in.
+  \catcode`\{=1
+  \catcode`\}=2
+  \catcode`\%=\other
+  \catcode`\'=0
+  \catcode`\\=\other
+  %
+  \openin 1 \jobname.aux
+  \ifeof 1 \else
+    \closein 1
+    \input \jobname.aux
+    \global\havexrefstrue
+    \global\warnedobstrue
+  \fi
+  % Open the new aux file.  TeX will close it automatically at exit.
+  \openout\auxfile=\jobname.aux
+\endgroup}
+
+
+% Footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for info output only.
+\let\footnotestyle=\comment
+
+\let\ptexfootnote=\footnote
+
+{\catcode `\@=11
+%
+% Auto-number footnotes.  Otherwise like plain.
+\gdef\footnote{%
+  \global\advance\footnoteno by \@ne
+  \edef\thisfootno{$^{\the\footnoteno}$}%
+  %
+  % In case the footnote comes at the end of a sentence, preserve the
+  % extra spacing after we do the footnote number.
+  \let\@sf\empty
+  \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+  %
+  % Remove inadvertent blank space before typesetting the footnote number.
+  \unskip
+  \thisfootno\@sf
+  \footnotezzz
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter.  Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset and anything else that uses
+% \parseargline fail inside footnotes because the tokens are fixed when
+% the footnote is read.  --karl, 16nov96.
+%
+\long\gdef\footnotezzz{\insert\footins\bgroup
+  % We want to typeset this text as a normal paragraph, even if the
+  % footnote reference occurs in (for example) a display environment.
+  % So reset some parameters.
+  \interlinepenalty\interfootnotelinepenalty
+  \splittopskip\ht\strutbox % top baseline for broken footnotes
+  \splitmaxdepth\dp\strutbox
+  \floatingpenalty\@MM
+  \leftskip\z@skip
+  \rightskip\z@skip
+  \spaceskip\z@skip
+  \xspaceskip\z@skip
+  \parindent\defaultparindent
+  %
+  % Hang the footnote text off the number.
+  \hang
+  \textindent{\thisfootno}%
+  %
+  % Don't crash into the line above the footnote text.  Since this
+  % expands into a box, it must come within the paragraph, lest it
+  % provide a place where TeX can split the footnote.
+  \footstrut
+  \futurelet\next\fo@t
+}
+\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
+  \else\let\next\f@t\fi \next}
+\def\f@@t{\bgroup\aftergroup\@foot\let\next}
+\def\f@t#1{#1\@foot}
+\def\@foot{\strut\egroup}
+
+}%end \catcode `\@=11
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly.  There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+\def\setleading#1{%
+  \normalbaselineskip = #1\relax
+  \normallineskip = \lineskipfactor\normalbaselineskip
+  \normalbaselines
+  \setbox\strutbox =\hbox{%
+    \vrule width0pt height\strutheightpercent\baselineskip
+                    depth \strutdepthpercent \baselineskip
+  }%
+}
+
+% @| inserts a changebar to the left of the current line.  It should
+% surround any changed text.  This approach does *not* work if the
+% change spans more than two lines of output.  To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+  % \vadjust can only be used in horizontal mode.
+  \leavevmode
+  %
+  % Append this vertical mode material after the current line in the output.
+  \vadjust{%
+    % We want to insert a rule with the height and depth of the current
+    % leading; that is exactly what \strutbox is supposed to record.
+    \vskip-\baselineskip
+    %
+    % \vadjust-items are inserted at the left edge of the type.  So
+    % the \llap here moves out into the left-hand margin.
+    \llap{%
+      %
+      % For a thicker or thinner bar, change the `1pt'.
+      \vrule height\baselineskip width1pt
+      %
+      % This is the space between the bar and the text.
+      \hskip 12pt
+    }%
+  }%
+}
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+% @image.  We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+% 
+% Check for and read epsf.tex up front.  If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+  \closein 1
+  % Do not bother showing banner with post-v2.7 epsf.tex (available in
+  % doc/epsf.tex until it shows up on ctan).
+  \def\epsfannounce{\toks0 = }%
+  \input epsf.tex
+\fi
+%
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+  work.  It is also included in the Texinfo distribution, or you can get
+  it from ftp://ftp.tug.org/tex/epsf.tex.}
+%
+% Only complain once about lack of epsf.tex.
+\def\image#1{%
+  \ifx\epsfbox\undefined
+    \ifwarnednoepsf \else
+      \errhelp = \noepsfhelp
+      \errmessage{epsf.tex not found, images will be ignored}%
+      \global\warnednoepsftrue
+    \fi
+  \else
+    \imagexxx #1,,,\finish
+  \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is just the usual extra ignored arg for parsing this stuff.
+\def\imagexxx#1,#2,#3,#4\finish{%
+  % \epsfbox itself resets \epsf?size at each figure.
+  \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+  \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+  % If the image is by itself, center it.
+  \ifvmode
+    \nobreak\medskip
+    \nobreak
+    \centerline{\epsfbox{#1.eps}}%
+    \bigbreak
+  \else
+    \epsfbox{#1.eps}%
+  \fi
+}
+
+
+\message{paper sizes,}
+% And other related parameters.
+
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
+
+% Following George Bush, just get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything.  We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize.  This makes it come to about 9pt for the 8.5x11 format.  We
+% call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+  \ifx\emergencystretch\thisisundefined
+    % Allow us to assign to \emergencystretch anyway.
+    \def\emergencystretch{\dimen0}%
+  \else
+    \emergencystretch = \hsize
+    \divide\emergencystretch by 45
+  \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
+% 4) hoffset; 5) binding offset; 6) topskip.  Then whoever calls us can
+% set \parskip and call \setleading for \baselineskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6{%
+  \voffset = #3\relax
+  \topskip = #6\relax
+  \splittopskip = \topskip
+  %
+  \vsize = #1\relax
+  \advance\vsize by \topskip
+  \outervsize = \vsize
+  \advance\outervsize by 0.6in
+  \pageheight = \vsize
+  %
+  \hsize = #2\relax
+  \outerhsize = \hsize
+  \advance\outerhsize by 0.5in
+  \pagewidth = \hsize
+  %
+  \normaloffset = #4\relax
+  \bindingoffset = #5\relax
+  %
+  \parindent = \defaultparindent
+  \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+  \parskip = 3pt plus 2pt minus 1pt
+  \setleading{13.2pt}%
+  %
+  % If page is nothing but text, make it come out even.
+  \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.5 (or so) format.
+\def\smallbook{{\globaldefs = 1
+  \parskip = 2pt plus 1pt
+  \setleading{12pt}%
+  %
+  \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
+  %
+  \lispnarrowing = 0.3in
+  \tolerance = 700
+  \hfuzz = 1pt
+  \contentsrightmargin = 0pt
+  \deftypemargin = 0pt
+  \defbodyindent = .5cm
+  %
+  \let\smalldisplay = \smalldisplayx
+  \let\smallexample = \smalllispx
+  \let\smallformat = \smallformatx
+  \let\smalllisp = \smalllispx
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+  \setleading{12pt}%
+  \parskip = 3pt plus 2pt minus 1pt
+  %
+  \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
+  %
+  \tolerance = 700
+  \hfuzz = 1pt
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper.  Top margin
+% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
+\def\afourlatex{{\globaldefs = 1
+  \setleading{13.6pt}%
+  %
+  \afourpaper
+  \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
+  %
+  \globaldefs = 0
+}}
+
+% Use @afourwide to print on European A4 paper in wide format.
+\def\afourwide{%
+  \afourpaper
+  \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
+  %
+  \globaldefs = 0
+}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+% 
+\def\pagesizes{\parsearg\pagesizesxxx}
+\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+  \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+  \globaldefs = 1
+  %
+  \parskip = 3pt plus 2pt minus 1pt
+  \setleading{13.2pt}%
+  %
+  \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
+}}
+
+% Set default to letter.
+% 
+\letterpaper
+
+\message{and turning on texinfo input format.}
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other
+\catcode`\~=\other
+\catcode`\^=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode`\+=\other
+\def\normaldoublequote{"}
+\def\normaltilde{~}
+\def\normalcaret{^}
+\def\normalunderscore{_}
+\def\normalverticalbar{|}
+\def\normalless{<}
+\def\normalgreater{>}
+\def\normalplus{+}
+
+% This macro is used to make a character print one way in ttfont
+% where it can probably just be output, and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise.  Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+%\catcode 27=\active
+%\def^^[{$\diamondsuit$}
+
+% Set up an active definition for =, but don't enable it most of the time.
+{\catcode`\==\active
+\global\def={{\tt \char 61}}}
+
+\catcode`+=\active
+\catcode`\_=\active
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+\catcode`\@=0
+
+% \rawbackslashxx output one backslash character in current font
+\global\chardef\rawbackslashxx=`\\
+%{\catcode`\\=\other
+%@gdef@rawbackslashxx{\}}
+
+% \rawbackslash redefines \ as input to do \rawbackslashxx.
+{\catcode`\\=\active
+@gdef@rawbackslash{@let\=@rawbackslashxx }}
+
+% \normalbackslash outputs one backslash in fixed width font.
+\def\normalbackslash{{\tt\rawbackslashxx}}
+
+% Say @foo, not \foo, in error messages.
+\escapechar=`\@
+
+% \catcode 17=0   % Define control-q
+\catcode`\\=\active
+
+% Used sometimes to turn off (effectively) the active characters
+% even after parsing them.
+@def@turnoffactive{@let"=@normaldoublequote
+@let\=@realbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus}
+
+@def@normalturnoffactive{@let"=@normaldoublequote
+@let\=@normalbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\{ in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also back turn on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
+  @catcode`+=@active @catcode`@_=@active}
+
+% These look ok in all fonts, so just make them not special.  The @rm below
+% makes sure that the current font starts out as the newly loaded cmr10
+@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
+
+@textfonts
+@rm
+
+@c Local variables:
+@c page-delimiter: "^\\\\message"
+@c End: